From f57eabe21d68428f8f35ab0710eced41140b5771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Thu, 5 Sep 2024 16:07:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/UserPermissionModal.vue | 12 +++++++++- src/views/system/user/columns.tsx | 23 +++---------------- src/views/system/user/dataruleIndex.vue | 1 - src/views/system/user/dataruleInfo.vue | 11 +++++++-- src/views/system/user/index.vue | 1 - 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/views/system/user/UserPermissionModal.vue b/src/views/system/user/UserPermissionModal.vue index aa3227df..85e75cb1 100644 --- a/src/views/system/user/UserPermissionModal.vue +++ b/src/views/system/user/UserPermissionModal.vue @@ -96,12 +96,17 @@ }) if (type) { permissionId.value = checkedKeys[0] + InfoId.value = '' + RefdataruleInfo.value.resetFields() + RefdataruleInfo.value.setFieldsValue({ permissionId: permissionId.value }) } } const RefdataruleIndex = ref() const RefdataruleInfo = ref() // 新增 function Create() { + console.log(permissionId.value) + RefdataruleIndex.value.clearSelectedRowKeys() RefdataruleInfo.value.resetFields() RefdataruleInfo.value.setFieldsValue({ permissionId: permissionId.value }) @@ -113,7 +118,6 @@ const InfoId = ref('') // 改变选中 function ChangeSelect(data) { - console.log(data[0]) InfoId.value = data[0] } /** @@ -121,12 +125,18 @@ */ function reset() { treeData.value = [] + permissionId.value = '' + selectedKeys.value = [] + expandedKeys.value = [] } /** * 提交 */ async function handleSubmit(exit) { RefdataruleInfo.value.handleSave() + if (exit) { + closeModal() + } } diff --git a/src/views/system/user/columns.tsx b/src/views/system/user/columns.tsx index 920533b1..fb0d3629 100644 --- a/src/views/system/user/columns.tsx +++ b/src/views/system/user/columns.tsx @@ -35,7 +35,6 @@ const ClientPermissionData = [] let ClientPermissionList = [] const res2: API.DataResult = await getClientPermissionList() if (res2.succeeded) { - console.log(res2) ClientPermissionList = res2.data res2.data.forEach((item) => { ClientPermissionData.push({ @@ -164,9 +163,9 @@ export const searchFormSchema: FormSchema[] = [ showSearch: true, filterOption: (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - } + }, } - } + }, }, { field: 'deptId', @@ -180,7 +179,7 @@ export const searchFormSchema: FormSchema[] = [ labelField: 'orgName', valueField: 'id', resultField: 'data', - immediate: false + immediate: false, } }, }, @@ -720,12 +719,9 @@ export const infoformSchema: FormSchema[] = [ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, onChange: async (e: ChangeEvent, a) => { - console.log(e, a) - const res: API.DataResult = await getColumns({ tableViewName: e }) fields.value = [] if (res.succeeded) { - console.log(res) const Arr = [ { dbColumnName: '{loginRole}', @@ -766,8 +762,6 @@ export const infoformSchema: FormSchema[] = [ conditions: [], } } - - console.log(fields.value, 'fields.value') } }, } @@ -805,10 +799,8 @@ export const infoformSchema: FormSchema[] = [ }, // xxxx props onChange: (e) => { - console.log(e) ClientPermissionList.forEach((item) => { if (item.id == e) { - console.log(item) formModel.permissionEntity = item.permissionEntity } }) @@ -882,16 +874,7 @@ export const infoformSchema: FormSchema[] = [ return h(ConditionFilter, { modelValue: model[field], filterFields: fields.value, - // onChange: (e: ChangeEvent) => { - // console.log(e); - // model[field] = e.target.value; - // }, }) }, - // componentProps: { - // onChange: (e: ChangeEvent) => { - // console.log('change', e); - // }, - // }, }, ] diff --git a/src/views/system/user/dataruleIndex.vue b/src/views/system/user/dataruleIndex.vue index f181f62b..7fc7c8bf 100644 --- a/src/views/system/user/dataruleIndex.vue +++ b/src/views/system/user/dataruleIndex.vue @@ -62,7 +62,6 @@ }, }) function handleCreate() { - console.log('新增') emit('Create') } defineExpose({ diff --git a/src/views/system/user/dataruleInfo.vue b/src/views/system/user/dataruleInfo.vue index 20fc3f64..8af65fa2 100644 --- a/src/views/system/user/dataruleInfo.vue +++ b/src/views/system/user/dataruleInfo.vue @@ -22,8 +22,15 @@ watch( () => props.InfoId, (Nval) => { - rowId.value = Nval - GetData() + if (Nval) { + rowId.value = Nval + GetData() + } else { + resetFields() + setFieldsValue({ + permissionId: props.permissionId, + }) + } }, ) // 声明Emits diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 451fef1d..2dbae4e9 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -65,7 +65,6 @@ const [registerTable, { reload, getForm, getPaginationRef }] = useTable({ api: async (p) => { const res: API.DataResult = await getUserList(p) - // console.log(items); return new Promise((resolve) => { resolve({ data: [...res.data], total: res.count }) }) From a7d65f8b4ae7c9689544136d7b9c7774b41e6e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Thu, 5 Sep 2024 16:40:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BE=80=E6=9D=A5=E5=8D=95=E4=BD=8D=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=B4=B9=E7=94=A8=E6=A8=A1=E6=9D=BF=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infoclient/FeeCustTemplate/api.ts | 8 ++-- .../infoclient/FeeCustTemplate/feeField.vue | 37 +++++++++++-------- src/views/system/user/columns.tsx | 33 ++++++++++++++++- src/views/system/user/dataruleIndex.vue | 4 +- 4 files changed, 59 insertions(+), 23 deletions(-) diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/api.ts b/src/views/baseinfo/infoclient/FeeCustTemplate/api.ts index 0b2f7833..a1b4eb65 100644 --- a/src/views/baseinfo/infoclient/FeeCustTemplate/api.ts +++ b/src/views/baseinfo/infoclient/FeeCustTemplate/api.ts @@ -6,8 +6,8 @@ enum Api { edit = '/feeApi/FeeCustTemplate/Edit', info = '/feeApi/FeeCustTemplate/Edit', delete = '/feeApi/FeeCustTemplate/Delete', - GenerateFees = '/feeApi/FeeCustTemplate/GenerateFees', GetColumns = '/mainApi/Common/GetColumnsByClient', + DeleteDetails = '/feeApi/FeeCustTemplate/DeleteDetails', } // 根据表明 查询数据 export function getColumns(query: { id: string }) { @@ -50,10 +50,10 @@ export function ApiDel(data: PageRequest) { }) } -// 生成订单费用 (Auth) -export function ApiGenerateFees(data: PageRequest) { +// 根据ID删除明细 (Auth) +export function DeleteDetails(data: PageRequest) { return request({ - url: Api.GenerateFees, + url: Api.DeleteDetails, method: 'post', data }) diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue b/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue index abab2f96..32c1f0eb 100644 --- a/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue +++ b/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue @@ -11,7 +11,7 @@ 添加 - + @@ -56,7 +56,7 @@ } from 'vue' // 下拉框数据接口 import { GetFeeCodeSelectList, GetFeeCurrencySelectList } from '/@/api/common' - import { getColumns } from './api' + import { getColumns, DeleteDetails } from './api' // import { GetFeeTemplateDetailList, BatchDelFeeTemplateDetail } from '../api' // 引入计费标准字典 import { feeUnitDict } from '/@/hooks/dict/index' @@ -796,23 +796,28 @@ ) // 删除行 const deleteRow = async () => { - // const ids = [] + // list.value.forEach((item: any, index) => { + // if (item.selected) { + // list.value.splice(index, 1) + // } + // }) + const ids = [] list.value.forEach((item: any, index) => { if (item.selected) { - list.value.splice(index, 1) + ids.push(item.id) } }) - // if (ids.length) { - // loading.value = true - // const data = await BatchDelFeeTemplateDetail({ ids }) - // loading.value = false - // createMessage.success(data.message) - // } - // const res = list.value.filter((item) => { - // return !item.selected - // }) - // list.value = res - // hotTb.value.hotInstance.loadData(res) + if (ids.length) { + loading.value = true + const data = await DeleteDetails({ ids }) + loading.value = false + createMessage.success(data.message) + } + const res = list.value.filter((item) => { + return !item.selected + }) + list.value = res + hotTb.value.hotInstance.loadData(res) } // 如果有id通过id查询表格 // watch( diff --git a/src/views/system/user/columns.tsx b/src/views/system/user/columns.tsx index fb0d3629..6cdd6e4f 100644 --- a/src/views/system/user/columns.tsx +++ b/src/views/system/user/columns.tsx @@ -9,7 +9,7 @@ import { getCountryList, } from '/@/api/common' import { GetTablesByClient } from '/@/views/baseinfo/clientflowtemplate/api' -import { getTables, getColumns, getClientPermissionList } from '/@/api/system/role' +import { getColumns, getClientPermissionList } from '/@/api/system/role' import { Tag } from 'ant-design-vue' import { useOptionsStore } from '/@/store/modules/options' import { checkPermissions } from '/@/hooks/Permissions/index' @@ -878,3 +878,34 @@ export const infoformSchema: FormSchema[] = [ }, }, ] + +export const indexcolumns: BasicColumn[] = [ + { + title: '权限描述', + dataIndex: 'description', + width: 200, + }, + { + title: '排序号', + dataIndex: 'orderNo', + width: 150, + }, + { + title: '状态', + dataIndex: 'status', + width: 100, + customRender: ({ text }) => { + if (text === 0) { + return 启用 + } else if (text === 1) { + return 禁用 + } + return text + }, + }, + { + title: '备注', + dataIndex: 'note', + width: 150, + }, +] diff --git a/src/views/system/user/dataruleIndex.vue b/src/views/system/user/dataruleIndex.vue index 7fc7c8bf..42a11165 100644 --- a/src/views/system/user/dataruleIndex.vue +++ b/src/views/system/user/dataruleIndex.vue @@ -18,7 +18,7 @@