diff --git a/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue b/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue
index 1da08530..fad765dc 100644
--- a/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue
+++ b/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue
@@ -3,14 +3,20 @@
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
- width="80%"
+ :width="670"
@register="registerModal"
@ok="handleSave"
>
-
+
-
+
([])
+ const RefcolumnView = ref()
+ const columnViewType = ref(false)
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, getFieldsValue, validate, updateSchema }] =
useForm({
@@ -73,6 +82,19 @@
schemas: formSchema,
showActionButtonGroup: false,
})
+ function ChangeColumnView(data) {
+ columnViewType.value = false
+ ColumnViewschemas.value.splice(0)
+ data.forEach((item) => {
+ ColumnViewschemas.value.push({
+ field: item.dbColumnName,
+ label: item.columnDescription,
+ })
+ })
+ console.log(ColumnViewschemas.value)
+
+ columnViewType.value = true
+ }
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(
async (data) => {
resetFields()
@@ -86,8 +108,8 @@
setFieldsValue({
...res.data,
})
- feeField.value.SetData(res.data.details)
- feeField.value.condition = res.data.condition
+ // feeField.value.SetData(res.data.details)
+ RefcolumnView.value.condition = JSON.parse(res.data.dataRules)
detailId.value = res.data.id
}
} else {
@@ -96,21 +118,22 @@
customerName: props.customerName,
customerId: props.customerId,
})
- feeField.value.SetData([])
- feeField.value.condition = ''
+ // feeField.value.SetData([])
+ // feeField.value.condition = ''
}
+ RefcolumnView.value.init(null)
setModalProps({ loading: false })
},
)
- const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
+ const getTitle = computed(() => (!unref(isUpdate) ? '新增数据权限' : '编辑数据权限'))
// 费用表格
- const feeField = ref()
+ // const feeField = ref()
async function handleSave(exit) {
try {
const values = await validate()
- const feeList = feeField.value.validate()
- values['details'] = feeList
- values['condition'] = feeField.value.condition
+ // const feeList = feeField.value.validate()
+ // values['details'] = feeList
+ values['dataRules'] = JSON.stringify(RefcolumnView.value.queryData)
loading.value = true
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await ApiEdit(values)
diff --git a/src/views/system/CodeDataRuleTemplate/api.ts b/src/views/system/CodeDataRuleTemplate/api.ts
index a1b4eb65..6bf5ef47 100644
--- a/src/views/system/CodeDataRuleTemplate/api.ts
+++ b/src/views/system/CodeDataRuleTemplate/api.ts
@@ -2,10 +2,11 @@
import { request } from '/@/utils/request'
import { DataResult, PageRequest } from '/@/api/model/baseModel'
enum Api {
- list = '/feeApi/FeeCustTemplate/GetList',
- edit = '/feeApi/FeeCustTemplate/Edit',
- info = '/feeApi/FeeCustTemplate/Edit',
- delete = '/feeApi/FeeCustTemplate/Delete',
+ list = '/mainApi/CodeDataRuleTemplate/GetDataRuleTemplateList',
+ edit = '/mainApi/CodeDataRuleTemplate/EditDataRuleTemplate',
+ info = '/mainApi/CodeDataRuleTemplate/GetDataRuleTemplateInfo',
+ delete = '/mainApi/CodeDataRuleTemplate/BatchDelDataRuleTemplate',
+
GetColumns = '/mainApi/Common/GetColumnsByClient',
DeleteDetails = '/feeApi/FeeCustTemplate/DeleteDetails',
}
diff --git a/src/views/system/CodeDataRuleTemplate/columnView.vue b/src/views/system/CodeDataRuleTemplate/columnView.vue
new file mode 100644
index 00000000..bfef407b
--- /dev/null
+++ b/src/views/system/CodeDataRuleTemplate/columnView.vue
@@ -0,0 +1,444 @@
+
+
+
+
+
+
diff --git a/src/views/system/CodeDataRuleTemplate/columns.tsx b/src/views/system/CodeDataRuleTemplate/columns.tsx
index 7c26f7e4..f251b5ea 100644
--- a/src/views/system/CodeDataRuleTemplate/columns.tsx
+++ b/src/views/system/CodeDataRuleTemplate/columns.tsx
@@ -1,15 +1,22 @@
import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
+import { getTablesByClient } from '/@/views/baseinfo/formcopy/api'
+import { getColumns, getClientPermissionList } from '/@/api/system/role'
+import { Tag } from 'ant-design-vue'
// 引入字典数据
import { getDictOption } from '/@/utils/dictUtil'
+const columnViewData: any = []
+const res: API.DataResult = await getTablesByClient()
+if (res.succeeded) {
+ res.data.forEach((item) => {
+ columnViewData.push({
+ label: item.description,
+ value: item.description,
+ })
+ })
+}
// 下拉框数据接口
import { GetClientListByCode } from '/@/api/common'
-// 往来单位下拉框数据
-const companyDict = ref([])
-let businessType: any = [
- { value: 1, label: '海运出口' },
- { value: 2, label: '海运进口' },
-]
export const columns: BasicColumn[] = [
{
title: '权限模板类型',
@@ -23,7 +30,7 @@ export const columns: BasicColumn[] = [
},
{
title: '资源标识',
- dataIndex: 'permissionId',
+ dataIndex: 'permissionEntity',
width: 200,
},
{
@@ -37,25 +44,40 @@ export const columns: BasicColumn[] = [
// width: 200,
},
{
- title: '可视/可操作???',
- dataIndex: 'note',
- // width: 200,
+ title: '可视/可操作',
+ dataIndex: 'ruleType',
+ customRender: ({ text }) => {
+ if (text === 'visible') {
+ return '可视'
+ } else if (text === 'operate') {
+ return '可操作'
+ }
+ return text
+ },
},
{
title: '是否启用',
- dataIndex: 'note',
- // width: 200,
+ dataIndex: 'status',
+ width: 80,
+ customRender: ({ text }) => {
+ if (text === 0) {
+ return 启用
+ } else if (text === 1) {
+ return 禁用
+ }
+ return text
+ },
},
{
title: '权限描述',
- dataIndex: 'note',
- width: 200,
- },
- {
- title: '备注',
- dataIndex: 'note',
+ dataIndex: 'description',
width: 200,
},
+ // {
+ // title: '备注??',
+ // dataIndex: 'note',
+ // width: 200,
+ // },
]
export const searchFormSchema: FormSchema[] = [
@@ -75,100 +97,160 @@ export const formSchema: FormSchema[] = [
show: false,
},
{
- field: 'name',
- label: '模板名称',
+ field: 'templateName',
+ label: '权限模板类型',
component: 'Input',
- required: true,
- colProps: { span: 8 },
+ // required: true,
+ colProps: { span: 12 },
},
{
- field: 'businessType',
- label: '业务类型',
- component: 'Select',
- required: true,
- colProps: { span: 8 },
- componentProps: () => {
+ label: '权限模板范围名称',
+ field: 'ruleScopeName',
+ component: 'Input',
+ defaultValue: '',
+ show: false,
+ },
+ {
+ label: '权限模板范围',
+ field: 'ruleScope',
+ component: 'ApiSelect',
+ colProps: { span: 12 },
+ componentProps: ({ formModel }) => {
return {
- options: businessType,
+ api: () => {
+ return new Promise((resolve) => {
+ getDictOption('datarule_scope_type').then((res) => {
+ resolve(res)
+ })
+ })
+ },
+ labelField: 'label',
+ valueField: 'value',
+ resultField: 'data',
+ allowClear: true,
+ filterOption: (input: string, option: any) => {
+ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
+ },
+ getPopupContainer: () => document.body,
+ onChange: async (e, obj) => {
+ if (e && obj) {
+ formModel.ruleScope = obj.value
+ formModel.ruleScopeName = obj.label
+ }
+ if (!e && !obj) {
+ formModel.ruleScope = ''
+ formModel.ruleScopeName = ''
+ }
+ },
}
},
},
- // {
- // field: 'customerType',
- // label: '客户类别',
- // defaultValue: '',
- // component: 'ApiSelect',
- // colProps: { span: 5 },
- // componentProps: ({ formModel }) => {
- // return {
- // api: () => {
- // return new Promise((resolve) => {
- // getDictOption('djy_cust_prop').then((res) => {
- // console.log(res, 111111111111111)
-
- // resolve(res)
- // })
- // })
- // },
- // labelField: 'label',
- // valueField: 'value',
- // resultField: 'data',
- // filterOption: (input: string, option: any) => {
- // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
- // },
- // onChange: (v: string, obj) => {
- // GetClientListByCode({ code: v }).then((res) => {
- // const { data } = res
- // data.forEach((item) => {
- // item['label'] = item.shortName
- // item['value'] = item.codeName
- // })
- // companyDict.value = data
- // })
- // },
- // }
- // },
- // },
{
- field: 'customerId',
- label: '结算对象',
- defaultValue: '',
+ label: '权限实体',
+ field: 'permissionEntity',
component: 'Input',
+ defaultValue: '',
show: false,
- colProps: { span: 8 },
},
{
- field: 'customerName',
- label: '结算对象',
- component: 'Input',
- defaultValue: '',
- dynamicDisabled: true,
- colProps: { span: 8 },
+ field: 'permissionId',
+ label: '资源标识',
+ component: 'ApiSelect',
+ colProps: { span: 12 },
+ componentProps: ({ formModel }) => {
+ return {
+ api: getClientPermissionList,
+ labelField: 'permissionName',
+ valueField: 'id',
+ immediate: false,
+ resultField: 'data',
+ filterOption: (input: string, option: any) => {
+ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
+ },
+ getPopupContainer: () => document.body,
+ onChange: async (e, obj) => {
+ if (e && obj) {
+ formModel.permissionId = obj.id
+ formModel.permissionEntity = obj.permissionEntity
+ }
+ if (!e && !obj) {
+ formModel.permissionId = ''
+ formModel.permissionEntity = ''
+ }
+ },
+ }
+ },
},
- // {
- // label: '',
- // field: 'customerId',
- // component: 'Input',
- // defaultValue: '',
- // show: false,
- // },
- // {
- // label: '',
- // field: 'customerType',
- // component: 'Input',
- // defaultValue: '',
- // show: false,
- // },
{
- field: 'description',
- label: '模板说明',
- component: 'Input',
- colProps: { span: 8 },
+ field: 'columnView',
+ label: '中文视图名',
+ component: 'Select',
+ required: true,
+ colProps: { span: 12 },
+ componentProps: ({ formActionType }) => {
+ return {
+ options: columnViewData,
+ getPopupContainer: () => document.body,
+ onChange: async (e: any) => {
+ let tableViewName = ''
+ columnViewData.forEach((item) => {
+ if (item.description == e) {
+ tableViewName = item.name
+ }
+ })
+ const res: any = await getColumns({ tableViewName })
+ if (res.succeeded) {
+ formActionType.linkageForm(res.data)
+ }
+ },
+ }
+ },
},
{
- field: 'note',
- label: '备注',
+ field: 'orderNo',
+ label: '排序号',
component: 'Input',
- colProps: { span: 16 },
+ colProps: { span: 12 },
},
+ {
+ field: 'ruleType',
+ label: '可视/可操作',
+ component: 'Switch',
+ colProps: { span: 6 },
+ defaultValue: false,
+ componentProps: {
+ checkedChildren: '可视',
+ checkedValue: 'visible',
+ unCheckedChildren: '可操作',
+ unCheckedValue: 'operate',
+ },
+ },
+ {
+ field: 'status',
+ label: '是否启用',
+ component: 'Switch',
+ colProps: { span: 6 },
+ defaultValue: 0,
+ componentProps: {
+ checkedChildren: '禁用',
+ checkedValue: 1,
+ unCheckedChildren: '启用',
+ unCheckedValue: 0,
+ },
+ },
+ {
+ field: 'description',
+ label: '权限描述',
+ component: 'InputTextArea',
+ colProps: { span: 12 },
+ componentProps: {
+ rows: 2,
+ },
+ },
+ // {
+ // field: 'description',
+ // label: '备注',
+ // component: 'Input',
+ // colProps: { span: 12 },
+ // },
]
diff --git a/src/views/system/CodeDataRuleTemplate/feeField.vue b/src/views/system/CodeDataRuleTemplate/feeField.vue
index 5d5a176a..e0e50fce 100644
--- a/src/views/system/CodeDataRuleTemplate/feeField.vue
+++ b/src/views/system/CodeDataRuleTemplate/feeField.vue
@@ -28,7 +28,7 @@