客户样式调整

This commit is contained in:
‘huanghaiixia’
2025-12-04 17:03:49 +08:00
parent 52c58b9cc8
commit 239e269368
6 changed files with 84 additions and 44 deletions

View File

@ -79,7 +79,7 @@
//所有按钮
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true}]);
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'enable', 'disable', 'startwork','flowRecord']);
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'startwork','flowRecord']);
const buttonConfigs = computed(()=>{
return filterButtonAuth(buttons.value);
})
@ -145,13 +145,19 @@
dataIndex: 'action',
slots: { customRender: 'action' },
},
rowSelection: {
type: 'checkbox',
onChange: onSelectChange
},
tableSetting: {
size: false,
setting: false,
},
});
function onSelectChange(rowKeys: string[]) {
selectedKeys.value = rowKeys;
}
function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
return;
@ -261,16 +267,16 @@
}
function handleEnable(record: Recordable) {
// if (!selectedKeys.value.length) {
// notification.warning({
// message: 'Tip',
// description: t('请选择需要启用的数据'),
// });
// return;
// }
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要启用的数据'),
});
return;
}
// let ids = selectedKeys.value;
let ids = [record.id]
let ids = selectedKeys.value;
// let ids = [record.id]
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
@ -291,15 +297,15 @@
}
function handleDisable(record: Recordable) {
let ids = [record.id]
// if (!selectedKeys.value.length) {
// notification.warning({
// message: 'Tip',
// description: t('请选择需要禁用的数据'),
// });
// return;
// }
// let ids = selectedKeys.value;
// let ids = [record.id]
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要禁用的数据'),
});
return;
}
let ids = selectedKeys.value;
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
@ -406,13 +412,13 @@
actionsList = actionsList.concat(editAndDelBtn);
}
}
if (record.approCode === 'YSP') {
let idx = actionsList.findIndex(v =>v.tooltip == '作废')
idx>-1 && actionsList.splice(idx, 1)
} else {
let idx = actionsList.findIndex(v =>v.tooltip == '启用')
idx>-1 && actionsList.splice(idx, 1)
}
// if (record.approCode === 'YSP' && record.valid!='有效') {
// let idx = actionsList.findIndex(v =>v.tooltip == '作废')
// idx>-1 && actionsList.splice(idx, 1)
// } else {
// let idx = actionsList.findIndex(v =>v.tooltip == '启用')
// record.valid=='有效' && idx>-1 && actionsList.splice(idx, 1)
// }
return actionsList;
}