|
|
|
@ -9,6 +9,7 @@ import ModelAttributeFormModal from './ModelAttributeFormModal.vue'
|
|
|
|
|
import { BasicTable, TableAction } from '@/components/Table' |
|
|
|
|
import type { ModelAttribute } from '@/api/product/types' |
|
|
|
|
import JsonPreviewModal from '@/components/JsonPreviewModal' |
|
|
|
|
import { usePermission } from '@/hooks/web/usePermission' |
|
|
|
|
|
|
|
|
|
defineProps<{ tsl?: string }>() |
|
|
|
|
|
|
|
|
@ -30,6 +31,8 @@ const {
|
|
|
|
|
reloadModalAttribute, |
|
|
|
|
handleDeleteModelAttribute, |
|
|
|
|
} = useModelAttribute(route.params.id as string, selectedModelId) |
|
|
|
|
|
|
|
|
|
const { hasPermission } = usePermission() |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
@ -50,7 +53,7 @@ const {
|
|
|
|
|
<div font-bold> |
|
|
|
|
服务列表 |
|
|
|
|
</div> |
|
|
|
|
<div class="i-ant-design:plus-outlined cursor-pointer text-20px" @click="openModelServiceModal()" /> |
|
|
|
|
<div v-if="hasPermission('product_model_service_add')" class="i-ant-design:plus-outlined cursor-pointer text-20px" @click="openModelServiceModal()" /> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div |
|
|
|
@ -70,10 +73,10 @@ const {
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="item.serviceId !== 'DEFAULT'"> |
|
|
|
|
<a-button type="link" size="small" @click="openModelServiceModal(true, item)"> |
|
|
|
|
<a-button v-if="hasPermission('product_model_service_edit')" type="link" size="small" @click="openModelServiceModal(true, item)"> |
|
|
|
|
<span class="i-ant-design:edit-outlined" /> |
|
|
|
|
</a-button> |
|
|
|
|
<Popconfirm title="是否要删除数据?" @confirm="handleDeleteModelService(item.id)"> |
|
|
|
|
<Popconfirm v-if="hasPermission('product_model_service_delete')" title="是否要删除数据?" @confirm="handleDeleteModelService(item.id)"> |
|
|
|
|
<a-button type="link" size="small" danger> |
|
|
|
|
<span class="i-ant-design:delete-outlined" /> |
|
|
|
|
</a-button> |
|
|
|
@ -84,7 +87,7 @@ const {
|
|
|
|
|
|
|
|
|
|
<div w-0 flex-1> |
|
|
|
|
<BasicTable :api="async () => ([] as ModelAttribute[])" @register="registerModelAttributeTable"> |
|
|
|
|
<template #tableTitle> |
|
|
|
|
<template v-if="hasPermission('product_model_attr_add')" #tableTitle> |
|
|
|
|
<a-button type="primary" @click="openModelAttributeModal"> |
|
|
|
|
<PlusOutlined /> |
|
|
|
|
新增属性 |
|
|
|
@ -107,12 +110,14 @@ const {
|
|
|
|
|
{ |
|
|
|
|
icon: 'i-ant-design:edit-outlined', |
|
|
|
|
label: '编辑', |
|
|
|
|
auth: 'product_model_attr_edit', |
|
|
|
|
onClick: () => openModelAttributeModal(true, record), |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
icon: 'i-ant-design:delete-outlined', |
|
|
|
|
danger: true, |
|
|
|
|
label: '删除', |
|
|
|
|
auth: 'product_model_attr_delete', |
|
|
|
|
popConfirm: { |
|
|
|
|
title: '是否要删除数据?', |
|
|
|
|
placement: 'left', |
|
|
|
|