Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
businessId?: string;
|
businessId?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
columns?: BasicColumn[];
|
columns?: BasicColumn[];
|
||||||
|
onDeleteProcess?: (record: Recordable, reload: () => Promise<void>) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = ref('流程列表');
|
const title = ref('流程列表');
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
const currentBusinessId = ref('');
|
const currentBusinessId = ref('');
|
||||||
const defaultColumns = columns;
|
const defaultColumns = columns;
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
|
const onDeleteProcessRef = ref<OpenParams['onDeleteProcess']>();
|
||||||
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
|
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
|
||||||
|
|
||||||
const [registerTable, { setColumns, setTableData, setLoading, clearSelectedRowKeys }] = useTable({
|
const [registerTable, { setColumns, setTableData, setLoading, clearSelectedRowKeys }] = useTable({
|
||||||
@@ -51,7 +53,7 @@
|
|||||||
actionColumn: {
|
actionColumn: {
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 120,
|
width: 180,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { customRender: 'action' },
|
slots: { customRender: 'action' },
|
||||||
},
|
},
|
||||||
@@ -85,6 +87,7 @@
|
|||||||
async function open(params: OpenParams = {}) {
|
async function open(params: OpenParams = {}) {
|
||||||
currentBusinessId.value = params.businessId || '';
|
currentBusinessId.value = params.businessId || '';
|
||||||
title.value = params.title || '流程列表';
|
title.value = params.title || '流程列表';
|
||||||
|
onDeleteProcessRef.value = params.onDeleteProcess;
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
await nextTick();
|
await nextTick();
|
||||||
setColumns(params.columns?.length ? params.columns : defaultColumns);
|
setColumns(params.columns?.length ? params.columns : defaultColumns);
|
||||||
@@ -94,6 +97,7 @@
|
|||||||
function handleCancel() {
|
function handleCancel() {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
currentBusinessId.value = '';
|
currentBusinessId.value = '';
|
||||||
|
onDeleteProcessRef.value = undefined;
|
||||||
setColumns(defaultColumns);
|
setColumns(defaultColumns);
|
||||||
setTableData([]);
|
setTableData([]);
|
||||||
clearSelectedRowKeys();
|
clearSelectedRowKeys();
|
||||||
@@ -106,13 +110,34 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleDeleteProcess(record) {
|
||||||
|
if (typeof onDeleteProcessRef.value === 'function') {
|
||||||
|
await onDeleteProcessRef.value(record, loadData);
|
||||||
|
} else {
|
||||||
|
createMessage.warning('未配置删除流程回调');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getTableAction(record) {
|
function getTableAction(record) {
|
||||||
return [
|
const actions: any[] = [
|
||||||
{
|
{
|
||||||
label: '审批历史',
|
label: '审批历史',
|
||||||
onClick: handlePreviewPic.bind(null, record),
|
onClick: handlePreviewPic.bind(null, record),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (typeof onDeleteProcessRef.value === 'function') {
|
||||||
|
actions.push({
|
||||||
|
label: '删除流程',
|
||||||
|
popConfirm: {
|
||||||
|
title: '确定删除该流程吗?',
|
||||||
|
confirm: handleDeleteProcess.bind(null, record),
|
||||||
|
placement: 'topLeft',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|||||||
@@ -89,6 +89,22 @@ export const columns: BasicColumn[] = [
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'completionStatus_dictText',
|
dataIndex: 'completionStatus_dictText',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '截止日期',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'deadline',
|
||||||
|
customRender: ({ text }) => {
|
||||||
|
if (!text) return '';
|
||||||
|
if (text instanceof Date) {
|
||||||
|
const y = text.getFullYear();
|
||||||
|
const m = String(text.getMonth() + 1).padStart(2, '0');
|
||||||
|
const d = String(text.getDate()).padStart(2, '0');
|
||||||
|
return `${y}-${m}-${d}`;
|
||||||
|
}
|
||||||
|
text = String(text);
|
||||||
|
return text.length > 10 ? text.substr(0, 10) : text;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '落实部门',
|
title: '落实部门',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -251,7 +267,8 @@ export const superQuerySchema = {
|
|||||||
isCompletionRisk: { title: '是否存在完成风险(0不存在,1存在)', order: 14, view: 'number', type: 'number' },
|
isCompletionRisk: { title: '是否存在完成风险(0不存在,1存在)', order: 14, view: 'number', type: 'number' },
|
||||||
delayRiskMitigation: { title: '拖期风险应对措施', order: 15, view: 'text', type: 'string' },
|
delayRiskMitigation: { title: '拖期风险应对措施', order: 15, view: 'text', type: 'string' },
|
||||||
completionStatus: { title: '完成状态(督办中,1已完成)', order: 16, view: 'number', type: 'number' },
|
completionStatus: { title: '完成状态(督办中,1已完成)', order: 16, view: 'number', type: 'number' },
|
||||||
implDept: { title: '落实部门id', order: 17, view: 'sel_depart', type: 'string' },
|
deadline: { title: '截止日期', order: 17, view: 'date', type: 'string' },
|
||||||
|
implDept: { title: '落实部门id', order: 18, view: 'sel_depart', type: 'string' },
|
||||||
treeDepth: { title: '层深(最顶层节点层深为0)', order: 18, view: 'number', type: 'number' },
|
treeDepth: { title: '层深(最顶层节点层深为0)', order: 18, view: 'number', type: 'number' },
|
||||||
sortOrder: { title: '同级数据排序号', order: 19, view: 'number', type: 'number' },
|
sortOrder: { title: '同级数据排序号', order: 19, view: 'number', type: 'number' },
|
||||||
bpmStatus: { title: '流程引擎状态字段', order: 21, view: 'number', type: 'number' },
|
bpmStatus: { title: '流程引擎状态字段', order: 21, view: 'number', type: 'number' },
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<BasicTable @register="registerTable" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess">
|
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
|
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
|
||||||
@@ -137,6 +137,7 @@
|
|||||||
const flowScheduleModalRef = ref();
|
const flowScheduleModalRef = ref();
|
||||||
const feedbackRightNowModalRef = ref();
|
const feedbackRightNowModalRef = ref();
|
||||||
const businessProcessListModalRef = ref();
|
const businessProcessListModalRef = ref();
|
||||||
|
const currentBusinessId = ref('');
|
||||||
const pendingFeedbackRightNow = ref(0);
|
const pendingFeedbackRightNow = ref(0);
|
||||||
const processColumns = taskTaskColumns;
|
const processColumns = taskTaskColumns;
|
||||||
const selectedFeedbackId = ref<string | number | null>(null);
|
const selectedFeedbackId = ref<string | number | null>(null);
|
||||||
@@ -160,7 +161,6 @@
|
|||||||
const showSdwLeaderSelect = computed(() => queryParam.value.needSdwApproval === '1');
|
const showSdwLeaderSelect = computed(() => queryParam.value.needSdwApproval === '1');
|
||||||
|
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
designScope: 'bg-xispeak-template',
|
|
||||||
tableProps: {
|
tableProps: {
|
||||||
title: '习总书记重要讲话指示批示情况',
|
title: '习总书记重要讲话指示批示情况',
|
||||||
api: list,
|
api: list,
|
||||||
@@ -168,30 +168,14 @@
|
|||||||
canResize: false,
|
canResize: false,
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
isTreeTable: true,
|
isTreeTable: true,
|
||||||
clickToRowSelect: true,
|
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 120,
|
width: 240,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
},
|
},
|
||||||
beforeFetch: async (params) => {
|
beforeFetch: async (params) => {
|
||||||
params.hasQuery = 'true';
|
params.hasQuery = 'true';
|
||||||
return Object.assign(params, queryParam.value);
|
return Object.assign(params, queryParam.value);
|
||||||
},
|
},
|
||||||
afterFetch: (result) => {
|
|
||||||
if (result && result.length > 0) {
|
|
||||||
result.forEach((item) => {
|
|
||||||
if (item.hasChild == '1' && (!item.children || item.children.length === 0)) {
|
|
||||||
item.children = [{ id: item.id + '_loadChild', name: 'loading...', isLoading: true }];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
pagination: {
|
|
||||||
current: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
pageSizeOptions: ['10', '20', '30'],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
exportConfig: {
|
exportConfig: {
|
||||||
name: '习总书记重要讲话指示批示情况',
|
name: '习总书记重要讲话指示批示情况',
|
||||||
@@ -203,7 +187,7 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { selectedRowKeys }] = tableContext;
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
||||||
provide('mainId', mainId);
|
provide('mainId', mainId);
|
||||||
|
|
||||||
@@ -565,13 +549,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleQueryProcess(record) {
|
function handleQueryProcess(record) {
|
||||||
|
currentBusinessId.value = record.id;
|
||||||
businessProcessListModalRef.value?.open({
|
businessProcessListModalRef.value?.open({
|
||||||
title: '流程列表',
|
title: '流程列表',
|
||||||
businessId: record.id,
|
businessId: record.id,
|
||||||
columns: '',
|
columns: '',
|
||||||
|
onDeleteProcess: handleDeleteProcess,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleDeleteProcess(processRecord, reload) {
|
||||||
|
const res = await withDrawXiSpeak({ id: currentBusinessId.value });
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message || '删除流程成功');
|
||||||
|
await reload();
|
||||||
|
} else {
|
||||||
|
createMessage.error(res.message || '删除流程失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleFlowScheduleConfirm({ payload, options }) {
|
async function handleFlowScheduleConfirm({ payload, options }) {
|
||||||
const record = payload?.record || {};
|
const record = payload?.record || {};
|
||||||
const flowCode = payload?.flowCode || FLOW_CODE;
|
const flowCode = payload?.flowCode || FLOW_CODE;
|
||||||
@@ -627,7 +623,7 @@
|
|||||||
deptId: deptId,
|
deptId: deptId,
|
||||||
deptLeaderId: deptId,
|
deptLeaderId: deptId,
|
||||||
requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'),
|
requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'),
|
||||||
deadline: formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'),
|
deadline: record.deadline || formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -664,7 +660,7 @@
|
|||||||
deptId: options.deptId || record.leadDepartment,
|
deptId: options.deptId || record.leadDepartment,
|
||||||
deptLeaderId: record.responsiblePerson,
|
deptLeaderId: record.responsiblePerson,
|
||||||
requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'),
|
requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'),
|
||||||
deadline: formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'),
|
deadline: record.deadline || formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<a-row class="base-info-row" :gutter="[12, 4]">
|
<a-row class="base-info-row" :gutter="[12, 4]">
|
||||||
<a-col :span="12" v-if="hasPermission('xizhishi')">
|
<a-col :span="12">
|
||||||
<a-form-item label="重要讲话指示批示" name="speakStatus">
|
<a-form-item label="重要讲话指示批示" name="speakStatus">
|
||||||
<a-textarea v-model:value="mainForm.speakStatus" :auto-size="{ minRows: 1, maxRows: 7 }" :disabled="isDisabledAuth('xizhishi')" allow-clear />
|
<a-textarea v-model:value="mainForm.speakStatus" :auto-size="{ minRows: 1, maxRows: 7 }" :disabled="mainDisabled" allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
@@ -27,9 +27,9 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<template v-if="showBaseInfoDetail">
|
<template v-if="showBaseInfoDetail">
|
||||||
<a-col :span="12" v-if="hasPermission('xitime')">
|
<a-col :span="12">
|
||||||
<a-form-item label="时间" name="time">
|
<a-form-item label="时间" name="time">
|
||||||
<a-date-picker v-model:value="mainForm.time" value-format="YYYY-MM-DD" :disabled="isDisabledAuth('xitime')" style="width: 100%" allow-clear />
|
<a-date-picker v-model:value="mainForm.time" value-format="YYYY-MM-DD" :disabled="mainDisabled" style="width: 100%" allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
@@ -82,11 +82,37 @@
|
|||||||
<JDictSelectTag v-model:value="mainForm.completionStatus" dictCode="db_status" placeholder="请选择完成状态" type="radio" :disabled="mainDisabled" />
|
<JDictSelectTag v-model:value="mainForm.completionStatus" dictCode="db_status" placeholder="请选择完成状态" type="radio" :disabled="mainDisabled" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="截止日期" name="deadline">
|
||||||
|
<a-date-picker v-model:value="mainForm.deadline" value-format="YYYY-MM-DD HH:mm:ss" :show-time="true" :disabled="mainDisabled" style="width: 100%" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="报告反馈情况" name="reportFeedbackStatus">
|
<a-form-item label="报告反馈情况" name="reportFeedbackStatus">
|
||||||
<a-input v-model:value="mainForm.reportFeedbackStatus" :disabled="mainDisabled" allow-clear />
|
<a-input v-model:value="mainForm.reportFeedbackStatus" :disabled="mainDisabled" allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="是否存在完成风险" name="isCompletionRisk">
|
||||||
|
<a-radio-group v-model:value="mainForm.isCompletionRisk" :disabled="mainDisabled">
|
||||||
|
<a-radio :value="0">不存在</a-radio>
|
||||||
|
<a-radio :value="1">存在</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="是否需要督办领导" name="needSdwApproval">
|
||||||
|
<a-radio-group v-model:value="mainForm.needSdwApproval" :disabled="mainDisabled">
|
||||||
|
<a-radio :value="1">是</a-radio>
|
||||||
|
<a-radio :value="0">否</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col v-if="mainForm.needSdwApproval === 1" :span="12">
|
||||||
|
<a-form-item label="督导领导列表" name="sdwLeaderList">
|
||||||
|
<j-select-user v-model:value="mainForm.sdwLeaderList" :disabled="mainDisabled" :multiple="true" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="拖期风险应对措施" name="delayRiskMitigation">
|
<a-form-item label="拖期风险应对措施" name="delayRiskMitigation">
|
||||||
<a-input v-model:value="mainForm.delayRiskMitigation" :disabled="mainDisabled" allow-clear />
|
<a-input v-model:value="mainForm.delayRiskMitigation" :disabled="mainDisabled" allow-clear />
|
||||||
@@ -226,7 +252,7 @@
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const savingMain = ref(false);
|
const savingMain = ref(false);
|
||||||
const savingSubApproveUser = ref(false);
|
const savingSubApproveUser = ref(false);
|
||||||
const showBaseInfoDetail = ref(false);
|
const showBaseInfoDetail = ref(true);
|
||||||
const feedbackList = ref<any[]>([]);
|
const feedbackList = ref<any[]>([]);
|
||||||
const subApproveUser = ref('');
|
const subApproveUser = ref('');
|
||||||
const isEnd = ref(0);
|
const isEnd = ref(0);
|
||||||
@@ -239,7 +265,7 @@
|
|||||||
elmComment: '',
|
elmComment: '',
|
||||||
status: '',
|
status: '',
|
||||||
responsiblePerson: '',
|
responsiblePerson: '',
|
||||||
needSdwApproval: '',
|
needSdwApproval: 0,
|
||||||
sdwLeaderList: '',
|
sdwLeaderList: '',
|
||||||
implPlan: '',
|
implPlan: '',
|
||||||
leadDepartment: '',
|
leadDepartment: '',
|
||||||
@@ -251,7 +277,8 @@
|
|||||||
reportFeedbackStatus: '',
|
reportFeedbackStatus: '',
|
||||||
isCompletionRisk: undefined,
|
isCompletionRisk: undefined,
|
||||||
delayRiskMitigation: '',
|
delayRiskMitigation: '',
|
||||||
completionStatus: '',
|
completionStatus: undefined,
|
||||||
|
deadline: '',
|
||||||
implDept: '',
|
implDept: '',
|
||||||
treeDepth: undefined,
|
treeDepth: undefined,
|
||||||
sortOrder: undefined,
|
sortOrder: undefined,
|
||||||
|
|||||||
@@ -100,6 +100,11 @@
|
|||||||
<JDictSelectTag v-model:value="formData.completionStatus" dictCode="db_status" placeholder="请选择完成状态" type="radio" />
|
<JDictSelectTag v-model:value="formData.completionStatus" dictCode="db_status" placeholder="请选择完成状态" type="radio" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="截止日期" id="BgXiSpeakForm-deadline" name="deadline">
|
||||||
|
<a-date-picker placeholder="请选择截止日期" v-model:value="formData.deadline" value-format="YYYY-MM-DD HH:mm:ss" :show-time="true" style="width: 100%" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="拖期风险应对措施" v-bind="validateInfos.delayRiskMitigation" id="BgXiSpeakForm-delayRiskMitigation" name="delayRiskMitigation">
|
<a-form-item label="拖期风险应对措施" v-bind="validateInfos.delayRiskMitigation" id="BgXiSpeakForm-delayRiskMitigation" name="delayRiskMitigation">
|
||||||
<a-input v-model:value="formData.delayRiskMitigation" placeholder="请输入" allow-clear></a-input>
|
<a-input v-model:value="formData.delayRiskMitigation" placeholder="请输入" allow-clear></a-input>
|
||||||
@@ -175,6 +180,7 @@
|
|||||||
isCompletionRisk: undefined,
|
isCompletionRisk: undefined,
|
||||||
delayRiskMitigation: '',
|
delayRiskMitigation: '',
|
||||||
completionStatus: undefined,
|
completionStatus: undefined,
|
||||||
|
deadline: '',
|
||||||
implDept: '',
|
implDept: '',
|
||||||
treeDepth: undefined,
|
treeDepth: undefined,
|
||||||
sortOrder: undefined,
|
sortOrder: undefined,
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
|
||||||
|
|
||||||
enum Api {
|
|
||||||
list = '/check/djCheck/list',
|
|
||||||
save='/check/djCheck/add',
|
|
||||||
edit='/check/djCheck/edit',
|
|
||||||
deleteOne = '/check/djCheck/delete',
|
|
||||||
deleteBatch = '/check/djCheck/deleteBatch',
|
|
||||||
importExcel = '/check/djCheck/importExcel',
|
|
||||||
exportXls = '/check/djCheck/exportXls',
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 导出api
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const getExportUrl = Api.exportXls;
|
|
||||||
/**
|
|
||||||
* 导入api
|
|
||||||
*/
|
|
||||||
export const getImportUrl = Api.importExcel;
|
|
||||||
/**
|
|
||||||
* 列表接口
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const list = (params) =>
|
|
||||||
defHttp.get({url: Api.list, params});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除单个
|
|
||||||
*/
|
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
|
||||||
createConfirm({
|
|
||||||
iconType: 'warning',
|
|
||||||
title: '确认删除',
|
|
||||||
content: '是否删除选中数据',
|
|
||||||
okText: '确认',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 保存或者更新
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
|
||||||
return defHttp.post({url: url, params});
|
|
||||||
}
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
import { BasicColumn } from '/@/components/Table';
|
|
||||||
import { FormSchema } from '/@/components/Table';
|
|
||||||
import { rules } from '/@/utils/helper/validator';
|
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
|
||||||
//列表数据
|
|
||||||
export const columns: BasicColumn[] = [
|
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'sortNo',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '一级指标',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'primaryIndex',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '评价要点',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'evalPoints',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '评价内容',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'evalContent',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问题表现',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'problemManifestation',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '整改措施',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'rectificationMeasures',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成时限',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionDeadline',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '责任部门',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'responsibleDept_dictText',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成情况',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionStatus',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否可发起',
|
|
||||||
width: 150,
|
|
||||||
dataIndex: 'isLaunchable_dictText',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
//查询数据
|
|
||||||
export const searchFormSchema: FormSchema[] = [];
|
|
||||||
//表单数据
|
|
||||||
export const formSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
label: '序号',
|
|
||||||
field: 'sortNo',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '一级指标',
|
|
||||||
field: 'primaryIndex',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '评价要点',
|
|
||||||
field: 'evalPoints',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '评价内容',
|
|
||||||
field: 'evalContent',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题表现',
|
|
||||||
field: 'problemManifestation',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '整改措施',
|
|
||||||
field: 'rectificationMeasures',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成时限',
|
|
||||||
field: 'completionDeadline',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '责任部门',
|
|
||||||
field: 'responsibleDept',
|
|
||||||
component: 'JSelectDept',
|
|
||||||
componentProps: ({ formActionType, formModel }) => {
|
|
||||||
return {
|
|
||||||
sync: false,
|
|
||||||
checkStrictly: true,
|
|
||||||
defaultExpandLevel: 2,
|
|
||||||
|
|
||||||
onSelect: (options, values) => {
|
|
||||||
const { updateSchema } = formActionType;
|
|
||||||
//所属部门修改后更新负责部门下拉框数据
|
|
||||||
updateSchema([
|
|
||||||
{
|
|
||||||
field: 'departIds',
|
|
||||||
componentProps: { options },
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
if (!values) {
|
|
||||||
formModel.departIds = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
//所属部门修改后更新负责部门数据
|
|
||||||
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成情况',
|
|
||||||
field: 'completionStatus',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
// TODO 主键隐藏字段,目前写死为ID
|
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
field: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 高级查询数据
|
|
||||||
export const superQuerySchema = {
|
|
||||||
sortNo: { title: '序号', order: 0, view: 'number', type: 'number' },
|
|
||||||
primaryIndex: { title: '一级指标', order: 1, view: 'text', type: 'string' },
|
|
||||||
evalPoints: { title: '评价要点', order: 2, view: 'text', type: 'string' },
|
|
||||||
evalContent: { title: '评价内容', order: 3, view: 'text', type: 'string' },
|
|
||||||
problemManifestation: { title: '问题表现', order: 4, view: 'text', type: 'string' },
|
|
||||||
rectificationMeasures: { title: '整改措施', order: 5, view: 'text', type: 'string' },
|
|
||||||
completionDeadline: { title: '完成时限', order: 6, view: 'date', type: 'string' },
|
|
||||||
responsibleDept: { title: '责任部门', order: 7, view: 'text', type: 'string' },
|
|
||||||
completionStatus: { title: '完成情况', order: 8, view: 'text', type: 'string' },
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流程表单调用这个方法获取formSchema
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
|
||||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|
||||||
return formSchema;
|
|
||||||
}
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!--引用表格-->
|
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
||||||
<!--插槽:table标题-->
|
|
||||||
<template #tableTitle>
|
|
||||||
<a-button type="primary" v-auth="'check:dj_check:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增 </a-button>
|
|
||||||
<a-button type="primary" v-auth="'check:dj_check:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出 </a-button>
|
|
||||||
<j-upload-button type="primary" v-auth="'check:dj_check:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"
|
|
||||||
>导入
|
|
||||||
</j-upload-button>
|
|
||||||
|
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
||||||
<template #overlay>
|
|
||||||
<a-menu>
|
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
|
||||||
删除
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</template>
|
|
||||||
<a-button v-auth="'check:dj_check:deleteBatch'"
|
|
||||||
>批量操作
|
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
|
||||||
</a-button>
|
|
||||||
</a-dropdown>
|
|
||||||
<!-- 高级查询 -->
|
|
||||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
|
||||||
</template>
|
|
||||||
<!--操作栏-->
|
|
||||||
<template #action="{ record }">
|
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
|
||||||
</template>
|
|
||||||
<!--字段回显插槽-->
|
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
|
|
||||||
</BasicTable>
|
|
||||||
<!-- 表单区域 -->
|
|
||||||
<DjCheckModal @register="registerModal" @success="handleSuccess"></DjCheckModal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="check-djCheck" setup>
|
|
||||||
import { ref, reactive, computed, unref } from 'vue';
|
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
||||||
import { useModal } from '/@/components/Modal';
|
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
|
||||||
import DjCheckModal from './components/DjCheckModal.vue';
|
|
||||||
import { columns, searchFormSchema, superQuerySchema } from './DjCheck.data';
|
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DjCheck.api';
|
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({});
|
|
||||||
const queryParam = reactive<any>({});
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
const userStore = useUserStore();
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
//注册model
|
|
||||||
const [registerModal, { openModal }] = useModal();
|
|
||||||
//注册table数据
|
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|
||||||
tableProps: {
|
|
||||||
title: '党建检查台账',
|
|
||||||
api: list,
|
|
||||||
columns,
|
|
||||||
canResize: true,
|
|
||||||
formConfig: {
|
|
||||||
//labelWidth: 120,
|
|
||||||
schemas: searchFormSchema,
|
|
||||||
autoSubmitOnEnter: true,
|
|
||||||
showAdvancedButton: true,
|
|
||||||
fieldMapToNumber: [],
|
|
||||||
fieldMapToTime: [],
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 120,
|
|
||||||
fixed: 'right',
|
|
||||||
},
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
if (params && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (params[key]) {
|
|
||||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Object.assign(params, queryParam);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
exportConfig: {
|
|
||||||
name: '党建检查台账',
|
|
||||||
url: getExportUrl,
|
|
||||||
params: queryParam,
|
|
||||||
},
|
|
||||||
importConfig: {
|
|
||||||
url: getImportUrl,
|
|
||||||
success: handleSuccess,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
||||||
|
|
||||||
// 高级查询配置
|
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 高级查询事件
|
|
||||||
*/
|
|
||||||
function handleSuperQuery(params) {
|
|
||||||
Object.keys(params).map((k) => {
|
|
||||||
queryParam[k] = params[k];
|
|
||||||
});
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增事件
|
|
||||||
*/
|
|
||||||
function handleAdd() {
|
|
||||||
openModal(true, {
|
|
||||||
isUpdate: false,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑事件
|
|
||||||
*/
|
|
||||||
function handleEdit(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
function handleDetail(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除事件
|
|
||||||
*/
|
|
||||||
async function handleDelete(record) {
|
|
||||||
await deleteOne({ id: record.id }, handleSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除事件
|
|
||||||
*/
|
|
||||||
async function batchHandleDelete() {
|
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 成功回调
|
|
||||||
*/
|
|
||||||
function handleSuccess() {
|
|
||||||
(selectedRowKeys.value = []) && reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作栏
|
|
||||||
*/
|
|
||||||
function getTableAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
auth: 'check:dj_check:edit',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '发起流程',
|
|
||||||
onClick: handleProcessLaunch(),
|
|
||||||
disabled: record.isLaunch !== 1,
|
|
||||||
//auth: 'rectifylist:dj_inspection_rectify_list:edit',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发起流程
|
|
||||||
*/
|
|
||||||
function handleProcessLaunch() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下拉操作栏
|
|
||||||
*/
|
|
||||||
function getDropDownAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '详情',
|
|
||||||
onClick: handleDetail.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
},
|
|
||||||
auth: 'check:dj_check:delete',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
:deep(.ant-picker),
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="min-height: 400px">
|
|
||||||
<BasicForm @register="registerForm"></BasicForm>
|
|
||||||
<div style="width: 100%; text-align: center" v-if="!formDisabled">
|
|
||||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
|
||||||
import { computed, defineComponent } from 'vue';
|
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
|
||||||
import { getBpmFormSchema } from '../DjCheck.data';
|
|
||||||
import { saveOrUpdate } from '../DjCheck.api';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'DjCheckForm',
|
|
||||||
components: {
|
|
||||||
BasicForm,
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
formData: propTypes.object.def({}),
|
|
||||||
formBpm: propTypes.bool.def(true),
|
|
||||||
},
|
|
||||||
setup(props) {
|
|
||||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: getBpmFormSchema(props.formData),
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: { span: 24 },
|
|
||||||
});
|
|
||||||
|
|
||||||
const formDisabled = computed(() => {
|
|
||||||
if (props.formData.disabled === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
let formData = {};
|
|
||||||
const queryByIdUrl = '/check/djCheck/queryById';
|
|
||||||
async function initFormData() {
|
|
||||||
let params = { id: props.formData.dataId };
|
|
||||||
const data = await defHttp.get({ url: queryByIdUrl, params });
|
|
||||||
formData = { ...data };
|
|
||||||
//设置表单的值
|
|
||||||
await setFieldsValue(formData);
|
|
||||||
//默认是禁用
|
|
||||||
await setProps({ disabled: formDisabled.value });
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitForm() {
|
|
||||||
let data = getFieldsValue();
|
|
||||||
let params = Object.assign({}, formData, data);
|
|
||||||
console.log('表单数据', params);
|
|
||||||
await saveOrUpdate(params, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
initFormData();
|
|
||||||
|
|
||||||
return {
|
|
||||||
registerForm,
|
|
||||||
formDisabled,
|
|
||||||
submitForm,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
|
||||||
<BasicForm @register="registerForm" name="DjCheckForm" />
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref, computed, unref, reactive } from 'vue';
|
|
||||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
||||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
|
||||||
import { formSchema } from '../DjCheck.data';
|
|
||||||
import { saveOrUpdate } from '../DjCheck.api';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
// Emits声明
|
|
||||||
const emit = defineEmits(['register', 'success']);
|
|
||||||
const isUpdate = ref(true);
|
|
||||||
const isDetail = ref(false);
|
|
||||||
//表单配置
|
|
||||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: formSchema,
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: { span: 24 },
|
|
||||||
});
|
|
||||||
//表单赋值
|
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
|
||||||
//重置表单
|
|
||||||
await resetFields();
|
|
||||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
|
||||||
isUpdate.value = !!data?.isUpdate;
|
|
||||||
isDetail.value = !!data?.showFooter;
|
|
||||||
if (unref(isUpdate)) {
|
|
||||||
//表单赋值
|
|
||||||
await setFieldsValue({
|
|
||||||
...data.record,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 隐藏底部时禁用整个表单
|
|
||||||
setProps({ disabled: !data?.showFooter });
|
|
||||||
});
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({});
|
|
||||||
//设置标题
|
|
||||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
|
||||||
//表单提交事件
|
|
||||||
async function handleSubmit(v) {
|
|
||||||
try {
|
|
||||||
let values = await validate();
|
|
||||||
// 预处理日期数据
|
|
||||||
changeDateValue(values);
|
|
||||||
setModalProps({ confirmLoading: true });
|
|
||||||
//提交表单
|
|
||||||
await saveOrUpdate(values, isUpdate.value);
|
|
||||||
//关闭弹窗
|
|
||||||
closeModal();
|
|
||||||
//刷新列表
|
|
||||||
emit('success');
|
|
||||||
} catch ({ errorFields }) {
|
|
||||||
if (errorFields) {
|
|
||||||
const firstField = errorFields[0];
|
|
||||||
if (firstField) {
|
|
||||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.reject(errorFields);
|
|
||||||
} finally {
|
|
||||||
setModalProps({ confirmLoading: false });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理日期值
|
|
||||||
* @param formData 表单数据
|
|
||||||
*/
|
|
||||||
const changeDateValue = (formData) => {
|
|
||||||
if (formData && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (formData[key]) {
|
|
||||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
/** 时间和数字输入框样式 */
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-calendar-picker) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
|
||||||
|
|
||||||
enum Api {
|
|
||||||
list = '/demoMetting/djDemoLifeMeeting/list',
|
|
||||||
save='/demoMetting/djDemoLifeMeeting/add',
|
|
||||||
edit='/demoMetting/djDemoLifeMeeting/edit',
|
|
||||||
deleteOne = '/demoMetting/djDemoLifeMeeting/delete',
|
|
||||||
deleteBatch = '/demoMetting/djDemoLifeMeeting/deleteBatch',
|
|
||||||
importExcel = '/demoMetting/djDemoLifeMeeting/importExcel',
|
|
||||||
exportXls = '/demoMetting/djDemoLifeMeeting/exportXls',
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 导出api
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const getExportUrl = Api.exportXls;
|
|
||||||
/**
|
|
||||||
* 导入api
|
|
||||||
*/
|
|
||||||
export const getImportUrl = Api.importExcel;
|
|
||||||
/**
|
|
||||||
* 列表接口
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const list = (params) =>
|
|
||||||
defHttp.get({url: Api.list, params});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除单个
|
|
||||||
*/
|
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
|
||||||
createConfirm({
|
|
||||||
iconType: 'warning',
|
|
||||||
title: '确认删除',
|
|
||||||
content: '是否删除选中数据',
|
|
||||||
okText: '确认',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 保存或者更新
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
|
||||||
return defHttp.post({url: url, params});
|
|
||||||
}
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
import { BasicColumn } from '/@/components/Table';
|
|
||||||
import { FormSchema } from '/@/components/Table';
|
|
||||||
import { rules } from '/@/utils/helper/validator';
|
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
|
||||||
//列表数据
|
|
||||||
export const columns: BasicColumn[] = [
|
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'sortNo',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问题分类',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'problemType',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问题清单',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'problemList',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问题表现',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'problemManifestation',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '责任领导',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'responsibleLeader',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '责任部门',
|
|
||||||
width: 150,
|
|
||||||
dataIndex: 'responsibleDept_dictText',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '整改措施',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'rectificationMeasures',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成时限',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionDeadline',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成时间',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionDate',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '输出成果',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'outputResults',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成情况',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionStatus',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否可发起',
|
|
||||||
align: 'center',
|
|
||||||
width: 150,
|
|
||||||
dataIndex: 'isLaunchable_dictText',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
//查询数据
|
|
||||||
export const searchFormSchema: FormSchema[] = [];
|
|
||||||
//表单数据
|
|
||||||
export const formSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
label: '序号',
|
|
||||||
field: 'sortNo',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题分类',
|
|
||||||
field: 'problemType',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题清单',
|
|
||||||
field: 'problemList',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题表现',
|
|
||||||
field: 'problemManifestation',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '责任领导',
|
|
||||||
field: 'responsibleLeader',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '责任部门',
|
|
||||||
field: 'responsibleDept',
|
|
||||||
component: 'JSelectDept',
|
|
||||||
componentProps: ({ formActionType, formModel }) => {
|
|
||||||
return {
|
|
||||||
sync: false,
|
|
||||||
checkStrictly: true,
|
|
||||||
defaultExpandLevel: 2,
|
|
||||||
|
|
||||||
onSelect: (options, values) => {
|
|
||||||
const { updateSchema } = formActionType;
|
|
||||||
//所属部门修改后更新负责部门下拉框数据
|
|
||||||
updateSchema([
|
|
||||||
{
|
|
||||||
field: 'departIds',
|
|
||||||
componentProps: { options },
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
if (!values) {
|
|
||||||
formModel.departIds = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
//所属部门修改后更新负责部门数据
|
|
||||||
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '整改措施',
|
|
||||||
field: 'rectificationMeasures',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成时限',
|
|
||||||
field: 'completionDeadline',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成时间',
|
|
||||||
field: 'completionDate',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '输出成果',
|
|
||||||
field: 'outputResults',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成情况',
|
|
||||||
field: 'completionStatus',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
// TODO 主键隐藏字段,目前写死为ID
|
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
field: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 高级查询数据
|
|
||||||
export const superQuerySchema = {
|
|
||||||
sortNo: { title: '序号', order: 0, view: 'number', type: 'number' },
|
|
||||||
problemType: { title: '问题分类', order: 1, view: 'number', type: 'number' },
|
|
||||||
problemList: { title: '问题清单', order: 2, view: 'text', type: 'string' },
|
|
||||||
problemManifestation: { title: '问题表现', order: 3, view: 'text', type: 'string' },
|
|
||||||
responsibleLeader: { title: '责任领导', order: 4, view: 'text', type: 'string' },
|
|
||||||
responsibleDept: { title: '责任部门', order: 5, view: 'text', type: 'string' },
|
|
||||||
rectificationMeasures: { title: '整改措施', order: 6, view: 'text', type: 'string' },
|
|
||||||
completionDeadline: { title: '完成时限', order: 7, view: 'date', type: 'string' },
|
|
||||||
completionDate: { title: '完成时间', order: 8, view: 'date', type: 'string' },
|
|
||||||
outputResults: { title: '输出成果', order: 9, view: 'text', type: 'string' },
|
|
||||||
completionStatus: { title: '完成情况', order: 10, view: 'text', type: 'string' },
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流程表单调用这个方法获取formSchema
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
|
||||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|
||||||
return formSchema;
|
|
||||||
}
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!--引用表格-->
|
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
||||||
<!--插槽:table标题-->
|
|
||||||
<template #tableTitle>
|
|
||||||
<a-button type="primary" v-auth="'demoMetting:dj_demo_life_meeting:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">
|
|
||||||
新增</a-button
|
|
||||||
>
|
|
||||||
<a-button type="primary" v-auth="'demoMetting:dj_demo_life_meeting:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
|
||||||
导出</a-button
|
|
||||||
>
|
|
||||||
<j-upload-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'demoMetting:dj_demo_life_meeting:importExcel'"
|
|
||||||
preIcon="ant-design:import-outlined"
|
|
||||||
@click="onImportXls"
|
|
||||||
>导入</j-upload-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
||||||
<template #overlay>
|
|
||||||
<a-menu>
|
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
|
||||||
删除
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</template>
|
|
||||||
<a-button v-auth="'demoMetting:dj_demo_life_meeting:deleteBatch'"
|
|
||||||
>批量操作
|
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
|
||||||
</a-button>
|
|
||||||
</a-dropdown>
|
|
||||||
<!-- 高级查询 -->
|
|
||||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
|
||||||
</template>
|
|
||||||
<!--操作栏-->
|
|
||||||
<template #action="{ record }">
|
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
|
||||||
</template>
|
|
||||||
<!--字段回显插槽-->
|
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
|
|
||||||
</BasicTable>
|
|
||||||
<!-- 表单区域 -->
|
|
||||||
<DjDemoLifeMeetingModal @register="registerModal" @success="handleSuccess"></DjDemoLifeMeetingModal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="demoMetting-djDemoLifeMeeting" setup>
|
|
||||||
import { ref, reactive, computed, unref } from 'vue';
|
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
||||||
import { useModal } from '/@/components/Modal';
|
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
|
||||||
import DjDemoLifeMeetingModal from './components/DjDemoLifeMeetingModal.vue';
|
|
||||||
import { columns, searchFormSchema, superQuerySchema } from './DjDemoLifeMeeting.data';
|
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DjDemoLifeMeeting.api';
|
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({});
|
|
||||||
const queryParam = reactive<any>({});
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
const userStore = useUserStore();
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
//注册model
|
|
||||||
const [registerModal, { openModal }] = useModal();
|
|
||||||
//注册table数据
|
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|
||||||
tableProps: {
|
|
||||||
title: '所领导板子民主生活会问题台账',
|
|
||||||
api: list,
|
|
||||||
columns,
|
|
||||||
canResize: true,
|
|
||||||
formConfig: {
|
|
||||||
//labelWidth: 120,
|
|
||||||
schemas: searchFormSchema,
|
|
||||||
autoSubmitOnEnter: true,
|
|
||||||
showAdvancedButton: true,
|
|
||||||
fieldMapToNumber: [],
|
|
||||||
fieldMapToTime: [],
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 120,
|
|
||||||
fixed: 'right',
|
|
||||||
},
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
if (params && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (params[key]) {
|
|
||||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Object.assign(params, queryParam);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
exportConfig: {
|
|
||||||
name: '所领导板子民主生活会问题台账',
|
|
||||||
url: getExportUrl,
|
|
||||||
params: queryParam,
|
|
||||||
},
|
|
||||||
importConfig: {
|
|
||||||
url: getImportUrl,
|
|
||||||
success: handleSuccess,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
||||||
|
|
||||||
// 高级查询配置
|
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 高级查询事件
|
|
||||||
*/
|
|
||||||
function handleSuperQuery(params) {
|
|
||||||
Object.keys(params).map((k) => {
|
|
||||||
queryParam[k] = params[k];
|
|
||||||
});
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 新增事件
|
|
||||||
*/
|
|
||||||
function handleAdd() {
|
|
||||||
openModal(true, {
|
|
||||||
isUpdate: false,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 编辑事件
|
|
||||||
*/
|
|
||||||
function handleEdit(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
function handleDetail(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除事件
|
|
||||||
*/
|
|
||||||
async function handleDelete(record) {
|
|
||||||
await deleteOne({ id: record.id }, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除事件
|
|
||||||
*/
|
|
||||||
async function batchHandleDelete() {
|
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 成功回调
|
|
||||||
*/
|
|
||||||
function handleSuccess() {
|
|
||||||
(selectedRowKeys.value = []) && reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 发起流程
|
|
||||||
*/
|
|
||||||
function handleProcessLaunch() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 操作栏
|
|
||||||
*/
|
|
||||||
function getTableAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
auth: 'demoMetting:dj_demo_life_meeting:edit',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '发起流程',
|
|
||||||
onClick: handleProcessLaunch(),
|
|
||||||
disabled: record.isLaunch === 0,
|
|
||||||
//auth: 'rectifylist:dj_inspection_rectify_list:edit',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下拉操作栏
|
|
||||||
*/
|
|
||||||
function getDropDownAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '详情',
|
|
||||||
onClick: handleDetail.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
},
|
|
||||||
auth: 'demoMetting:dj_demo_life_meeting:delete',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
:deep(.ant-picker),
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="min-height: 400px">
|
|
||||||
<BasicForm @register="registerForm"></BasicForm>
|
|
||||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
|
||||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {computed, defineComponent} from 'vue';
|
|
||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
|
||||||
import {getBpmFormSchema} from '../DjDemoLifeMeeting.data';
|
|
||||||
import {saveOrUpdate} from '../DjDemoLifeMeeting.api';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "DjDemoLifeMeetingForm",
|
|
||||||
components:{
|
|
||||||
BasicForm
|
|
||||||
},
|
|
||||||
props:{
|
|
||||||
formData: propTypes.object.def({}),
|
|
||||||
formBpm: propTypes.bool.def(true),
|
|
||||||
},
|
|
||||||
setup(props){
|
|
||||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: getBpmFormSchema(props.formData),
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
|
|
||||||
const formDisabled = computed(()=>{
|
|
||||||
if(props.formData.disabled === false){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
let formData = {};
|
|
||||||
const queryByIdUrl = '/demoMetting/djDemoLifeMeeting/queryById';
|
|
||||||
async function initFormData(){
|
|
||||||
let params = {id: props.formData.dataId};
|
|
||||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
|
||||||
formData = {...data}
|
|
||||||
//设置表单的值
|
|
||||||
await setFieldsValue(formData);
|
|
||||||
//默认是禁用
|
|
||||||
await setProps({disabled: formDisabled.value})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitForm() {
|
|
||||||
let data = getFieldsValue();
|
|
||||||
let params = Object.assign({}, formData, data);
|
|
||||||
console.log('表单数据', params)
|
|
||||||
await saveOrUpdate(params, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
initFormData();
|
|
||||||
|
|
||||||
return {
|
|
||||||
registerForm,
|
|
||||||
formDisabled,
|
|
||||||
submitForm,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
|
||||||
<BasicForm @register="registerForm" name="DjDemoLifeMeetingForm" />
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import {ref, computed, unref, reactive} from 'vue';
|
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {formSchema} from '../DjDemoLifeMeeting.data';
|
|
||||||
import {saveOrUpdate} from '../DjDemoLifeMeeting.api';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
// Emits声明
|
|
||||||
const emit = defineEmits(['register','success']);
|
|
||||||
const isUpdate = ref(true);
|
|
||||||
const isDetail = ref(false);
|
|
||||||
//表单配置
|
|
||||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: formSchema,
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
//表单赋值
|
|
||||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
|
||||||
//重置表单
|
|
||||||
await resetFields();
|
|
||||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
|
||||||
isUpdate.value = !!data?.isUpdate;
|
|
||||||
isDetail.value = !!data?.showFooter;
|
|
||||||
if (unref(isUpdate)) {
|
|
||||||
//表单赋值
|
|
||||||
await setFieldsValue({
|
|
||||||
...data.record,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 隐藏底部时禁用整个表单
|
|
||||||
setProps({ disabled: !data?.showFooter })
|
|
||||||
});
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({
|
|
||||||
});
|
|
||||||
//设置标题
|
|
||||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
|
||||||
//表单提交事件
|
|
||||||
async function handleSubmit(v) {
|
|
||||||
try {
|
|
||||||
let values = await validate();
|
|
||||||
// 预处理日期数据
|
|
||||||
changeDateValue(values);
|
|
||||||
setModalProps({confirmLoading: true});
|
|
||||||
//提交表单
|
|
||||||
await saveOrUpdate(values, isUpdate.value);
|
|
||||||
//关闭弹窗
|
|
||||||
closeModal();
|
|
||||||
//刷新列表
|
|
||||||
emit('success');
|
|
||||||
} catch ({ errorFields }) {
|
|
||||||
if (errorFields) {
|
|
||||||
const firstField = errorFields[0];
|
|
||||||
if (firstField) {
|
|
||||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.reject(errorFields);
|
|
||||||
} finally {
|
|
||||||
setModalProps({confirmLoading: false});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理日期值
|
|
||||||
* @param formData 表单数据
|
|
||||||
*/
|
|
||||||
const changeDateValue = (formData) => {
|
|
||||||
if (formData && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (formData[key]) {
|
|
||||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
/** 时间和数字输入框样式 */
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-calendar-picker) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
+13
-13
@@ -4,15 +4,15 @@ import { useMessage } from "/@/hooks/web/useMessage";
|
|||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/rectifylist/djInspectionRectifyList/rootList',
|
list = '/dj/inspectimprove/djInspectImprove/rootList',
|
||||||
save='/rectifylist/djInspectionRectifyList/add',
|
save='/dj/inspectimprove/djInspectImprove/add',
|
||||||
edit='/rectifylist/djInspectionRectifyList/edit',
|
edit='/dj/inspectimprove/djInspectImprove/edit',
|
||||||
deleteDjInspectionRectifyList = '/rectifylist/djInspectionRectifyList/delete',
|
deleteDjInspectImprove = '/dj/inspectimprove/djInspectImprove/delete',
|
||||||
importExcel = '/rectifylist/djInspectionRectifyList/importExcel',
|
importExcel = '/dj/inspectimprove/djInspectImprove/importExcel',
|
||||||
exportXls = '/rectifylist/djInspectionRectifyList/exportXls',
|
exportXls = '/dj/inspectimprove/djInspectImprove/exportXls',
|
||||||
loadTreeData = '/rectifylist/djInspectionRectifyList/loadTreeRoot',
|
loadTreeData = '/dj/inspectimprove/djInspectImprove/loadTreeRoot',
|
||||||
getChildList = '/rectifylist/djInspectionRectifyList/childList',
|
getChildList = '/dj/inspectimprove/djInspectImprove/childList',
|
||||||
getChildListBatch = '/rectifylist/djInspectionRectifyList/getChildListBatch',
|
getChildListBatch = '/dj/inspectimprove/djInspectImprove/getChildListBatch',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,8 +34,8 @@ export const list = (params) =>
|
|||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
export const deleteDjInspectionRectifyList = (params,handleSuccess) => {
|
export const deleteDjInspectImprove = (params,handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteDjInspectionRectifyList, params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({url: Api.deleteDjInspectImprove, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ export const deleteDjInspectionRectifyList = (params,handleSuccess) => {
|
|||||||
* 批量删除
|
* 批量删除
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const batchDeleteDjInspectionRectifyList = (params, handleSuccess) => {
|
export const batchDeleteDjInspectImprove = (params, handleSuccess) => {
|
||||||
createConfirm({
|
createConfirm({
|
||||||
iconType: 'warning',
|
iconType: 'warning',
|
||||||
title: '确认删除',
|
title: '确认删除',
|
||||||
@@ -51,7 +51,7 @@ export const batchDeleteDjInspectionRectifyList = (params, handleSuccess) => {
|
|||||||
okText: '确认',
|
okText: '确认',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
return defHttp.delete({url: Api.deleteDjInspectionRectifyList, data: params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({url: Api.deleteDjInspectImprove, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
import {BasicColumn} from '/@/components/Table';
|
||||||
|
import {FormSchema} from '/@/components/Table';
|
||||||
|
import { rules} from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
|
import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil';
|
||||||
|
//列表数据
|
||||||
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '树形表单父id',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'pid'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '问题分类',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'questionCategory',
|
||||||
|
customRender: ({text}) => filterDictTextByCache('inspect_improve_type', text),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '面上问题',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'mianshangQuestion'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '具体问题',
|
||||||
|
align: 'left',
|
||||||
|
dataIndex: 'specicalQuestion'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '巡视建议',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'inspectAdvice'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '整改措施',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'improveMeasure'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '完成时限',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'deadline',
|
||||||
|
customRender:({text}) =>{
|
||||||
|
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
|
||||||
|
return text;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '目标节点',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'targetNode'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '问题责任领导',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'questionResLeader'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '问题责任部门',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'questionResDept'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '措施责任领导',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'measureResLeader'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '措施责任部门',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'measureResDept'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '整改交付成果',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'rectificationEvidence'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成效评价标准',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'evaluationCriterion'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '工作进展',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'workProgress'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '检查情况',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'inspectionStatus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '监督意见',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'supervisoryOpinion'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '措施数量',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'measureCount'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
//查询数据
|
||||||
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
];
|
||||||
|
//表单数据
|
||||||
|
export const formSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
label: '树形表单父id',
|
||||||
|
field: 'pid',
|
||||||
|
component: 'JTreeSelect',
|
||||||
|
componentProps: {
|
||||||
|
dict: "dj_inspect_improve,specical_question,id",
|
||||||
|
pidField: "pid",
|
||||||
|
pidValue: "0",
|
||||||
|
hasChildField: "has_child",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '问题分类',
|
||||||
|
field: 'questionCategory',
|
||||||
|
component: 'JDictSelectTag',
|
||||||
|
componentProps: {
|
||||||
|
dictCode: 'inspect_improve_type',
|
||||||
|
stringToNumber: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '面上问题',
|
||||||
|
field: 'mianshangQuestion',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '具体问题',
|
||||||
|
field: 'specicalQuestion',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '巡视建议',
|
||||||
|
field: 'inspectAdvice',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '整改措施',
|
||||||
|
field: 'improveMeasure',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '完成时限',
|
||||||
|
field: 'deadline',
|
||||||
|
component: 'DatePicker',
|
||||||
|
componentProps: {
|
||||||
|
valueFormat: 'YYYY-MM-DD'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '目标节点',
|
||||||
|
field: 'targetNode',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '问题责任领导',
|
||||||
|
field: 'questionResLeader',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '问题责任部门',
|
||||||
|
field: 'questionResDept',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '措施责任领导',
|
||||||
|
field: 'measureResLeader',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '措施责任部门',
|
||||||
|
field: 'measureResDept',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '整改交付成果',
|
||||||
|
field: 'rectificationEvidence',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '成效评价标准',
|
||||||
|
field: 'evaluationCriterion',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '工作进展',
|
||||||
|
field: 'workProgress',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '检查情况',
|
||||||
|
field: 'inspectionStatus',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '监督意见',
|
||||||
|
field: 'supervisoryOpinion',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '措施数量',
|
||||||
|
field: 'measureCount',
|
||||||
|
component: 'InputNumber',
|
||||||
|
},
|
||||||
|
// TODO 主键隐藏字段,目前写死为ID
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
field: 'id',
|
||||||
|
component: 'Input',
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 高级查询数据
|
||||||
|
export const superQuerySchema = {
|
||||||
|
pid: {title: '树形表单父id',order: 0,view: 'text', type: 'string',},
|
||||||
|
questionCategory: {title: '问题分类',order: 1,view: 'number', type: 'number',},
|
||||||
|
mianshangQuestion: {title: '面上问题',order: 2,view: 'text', type: 'string',},
|
||||||
|
specicalQuestion: {title: '具体问题',order: 3,view: 'text', type: 'string',},
|
||||||
|
inspectAdvice: {title: '巡视建议',order: 4,view: 'text', type: 'string',},
|
||||||
|
improveMeasure: {title: '整改措施',order: 5,view: 'text', type: 'string',},
|
||||||
|
deadline: {title: '完成时限',order: 6,view: 'date', type: 'string',},
|
||||||
|
targetNode: {title: '目标节点',order: 7,view: 'text', type: 'string',},
|
||||||
|
questionResLeader: {title: '问题责任领导',order: 8,view: 'text', type: 'string',},
|
||||||
|
questionResDept: {title: '问题责任部门',order: 9,view: 'text', type: 'string',},
|
||||||
|
measureResLeader: {title: '措施责任领导',order: 10,view: 'text', type: 'string',},
|
||||||
|
measureResDept: {title: '措施责任部门',order: 11,view: 'text', type: 'string',},
|
||||||
|
rectificationEvidence: {title: '整改交付成果',order: 12,view: 'text', type: 'string',},
|
||||||
|
evaluationCriterion: {title: '成效评价标准',order: 13,view: 'text', type: 'string',},
|
||||||
|
workProgress: {title: '工作进展',order: 14,view: 'text', type: 'string',},
|
||||||
|
inspectionStatus: {title: '检查情况',order: 15,view: 'text', type: 'string',},
|
||||||
|
supervisoryOpinion: {title: '监督意见',order: 16,view: 'text', type: 'string',},
|
||||||
|
measureCount: {title: '措施数量',order: 17,view: 'number', type: 'number',},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程表单调用这个方法获取formSchema
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||||
|
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||||
|
return formSchema;
|
||||||
|
}
|
||||||
@@ -0,0 +1,336 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<a-button type="primary" v-auth="'dj.inspectimprove:dj_inspect_improve:add'" @click="handleCreate" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
<a-button type="primary" v-auth="'dj.inspectimprove:dj_inspect_improve:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||||
|
<j-upload-button type="primary" v-auth="'dj.inspectimprove:dj_inspect_improve:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||||
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||||
|
删除
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button v-auth="'dj.inspectimprove:dj_inspect_improve:deleteBatch'">批量操作
|
||||||
|
<Icon icon="ant-design:down-outlined"></Icon>
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown>
|
||||||
|
<!-- 高级查询 -->
|
||||||
|
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||||
|
</template>
|
||||||
|
<!--字段回显插槽-->
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!--字典弹窗-->
|
||||||
|
<DjInspectImproveModal @register="registerModal" @success="handleSuccess"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="dj.inspectimprove-djInspectImprove" setup>
|
||||||
|
//ts语法
|
||||||
|
import {ref, reactive, computed, unref, toRaw, nextTick} from 'vue';
|
||||||
|
import {BasicTable, TableAction} from '/@/components/Table';
|
||||||
|
import {useModal} from '/@/components/Modal';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage'
|
||||||
|
import DjInspectImproveModal from './components/DjInspectImproveModal.vue';
|
||||||
|
import {columns, searchFormSchema, superQuerySchema} from './DjInspectImprove.data';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import {list, deleteDjInspectImprove, batchDeleteDjInspectImprove, getExportUrl,getImportUrl, getChildList,getChildListBatch} from './DjInspectImprove.api';
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const expandedRowKeys = ref([]);
|
||||||
|
//字典model
|
||||||
|
const [registerModal, {openModal}] = useModal();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||||
|
tableProps:{
|
||||||
|
api: list,
|
||||||
|
title: '巡视整改台账',
|
||||||
|
columns,
|
||||||
|
canResize:false,
|
||||||
|
isTreeTable: true,
|
||||||
|
formConfig: {
|
||||||
|
//labelWidth: 120,
|
||||||
|
schemas: searchFormSchema,
|
||||||
|
autoSubmitOnEnter:true,
|
||||||
|
showAdvancedButton:true,
|
||||||
|
fieldMapToNumber: [
|
||||||
|
],
|
||||||
|
fieldMapToTime: [
|
||||||
|
],
|
||||||
|
},
|
||||||
|
actionColumn: {
|
||||||
|
width: 240,
|
||||||
|
fixed:'right'
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
params.hasQuery = "true";
|
||||||
|
return Object.assign(params, queryParam);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
exportConfig: {
|
||||||
|
name:"巡视整改台账",
|
||||||
|
url: getExportUrl,
|
||||||
|
params: queryParam,
|
||||||
|
},
|
||||||
|
importConfig: {
|
||||||
|
url: getImportUrl,
|
||||||
|
success: importSuccess
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const [registerTable, {reload, collapseAll, updateTableDataRecord, findTableDataRecord,getDataSource},{ rowSelection, selectedRowKeys }] = tableContext
|
||||||
|
|
||||||
|
// 高级查询配置
|
||||||
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高级查询事件
|
||||||
|
*/
|
||||||
|
function handleSuperQuery(params) {
|
||||||
|
Object.keys(params).map((k) => {
|
||||||
|
queryParam[k] = params[k];
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增事件
|
||||||
|
*/
|
||||||
|
function handleCreate() {
|
||||||
|
openModal(true, {
|
||||||
|
isUpdate: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑事件
|
||||||
|
*/
|
||||||
|
async function handleEdit(record) {
|
||||||
|
openModal(true, {
|
||||||
|
record,
|
||||||
|
isUpdate: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
async function handleDetail(record) {
|
||||||
|
openModal(true, {
|
||||||
|
record,
|
||||||
|
isUpdate: true,
|
||||||
|
hideFooter: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除事件
|
||||||
|
*/
|
||||||
|
async function handleDelete(record) {
|
||||||
|
await deleteDjInspectImprove({id: record.id}, importSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除事件
|
||||||
|
*/
|
||||||
|
async function batchHandleDelete() {
|
||||||
|
const ids = selectedRowKeys.value.filter(item => !item.includes('loadChild'))
|
||||||
|
await batchDeleteDjInspectImprove({id: ids}, importSuccess);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 导入
|
||||||
|
*/
|
||||||
|
function importSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 添加下级
|
||||||
|
*/
|
||||||
|
function handleAddSub(record) {
|
||||||
|
openModal(true, {
|
||||||
|
record,
|
||||||
|
isUpdate: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
async function handleSuccess({isUpdate, values, expandedArr, changeParent}) {
|
||||||
|
if (isUpdate) {
|
||||||
|
if (changeParent) {
|
||||||
|
reload();
|
||||||
|
} else {
|
||||||
|
let data = await list({ id: values.id, pageSize: 1, pageNo: 1, pid: values['pid'] });
|
||||||
|
if (data && data.records && data.records.length > 0) {
|
||||||
|
// 编辑回调
|
||||||
|
updateTableDataRecord(values.id, data.records[0]);
|
||||||
|
}else{
|
||||||
|
updateTableDataRecord(values.id, values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(!values['id'] || !values['pid']){
|
||||||
|
//新增根节点
|
||||||
|
reload();
|
||||||
|
}else{
|
||||||
|
//新增子集
|
||||||
|
expandedRowKeys.value = [];
|
||||||
|
for (let key of unref(expandedArr)) {
|
||||||
|
await expandTreeNode(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口请求成功后回调
|
||||||
|
*/
|
||||||
|
function onFetchSuccess(result) {
|
||||||
|
getDataByResult(result.items)&&loadDataByExpandedRows();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据)
|
||||||
|
*/
|
||||||
|
async function loadDataByExpandedRows() {
|
||||||
|
if (unref(expandedRowKeys).length > 0) {
|
||||||
|
const res = await getChildListBatch({ parentIds: unref(expandedRowKeys).join(',')});
|
||||||
|
if (res.success && res.result.records.length>0) {
|
||||||
|
//已展开的数据批量子节点
|
||||||
|
let records = res.result.records
|
||||||
|
const listMap = new Map();
|
||||||
|
for (let item of records) {
|
||||||
|
let pid = item['pid'];
|
||||||
|
if (unref(expandedRowKeys).includes(pid)) {
|
||||||
|
let mapList = listMap.get(pid);
|
||||||
|
if (mapList == null) {
|
||||||
|
mapList = [];
|
||||||
|
}
|
||||||
|
mapList.push(item);
|
||||||
|
listMap.set(pid, mapList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let childrenMap = listMap;
|
||||||
|
let fn = (list) => {
|
||||||
|
if(list) {
|
||||||
|
list.forEach(data => {
|
||||||
|
if (unref(expandedRowKeys).includes(data.id)) {
|
||||||
|
data.children = getDataByResult(childrenMap.get(data.id))
|
||||||
|
fn(data.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fn(getDataSource())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 处理数据集
|
||||||
|
*/
|
||||||
|
function getDataByResult(result){
|
||||||
|
if(result && result.length>0){
|
||||||
|
return result.map(item=>{
|
||||||
|
//判断是否标记了带有子节点
|
||||||
|
if(item["hasChild"]=='1'){
|
||||||
|
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
|
||||||
|
item.children = [loadChild]
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*树节点展开合并
|
||||||
|
* */
|
||||||
|
async function handleExpand(expanded, record) {
|
||||||
|
// 判断是否是展开状态,展开状态(expanded)并且存在子集(children)并且未加载过(isLoading)的就去查询子节点数据
|
||||||
|
if (expanded) {
|
||||||
|
expandedRowKeys.value.push(record.id)
|
||||||
|
if (record.children.length > 0 && !!record.children[0].isLoading) {
|
||||||
|
let result = await getChildList({pid: record.id});
|
||||||
|
result=result.records?result.records:result;
|
||||||
|
if (result && result.length > 0) {
|
||||||
|
record.children = getDataByResult(result);
|
||||||
|
} else {
|
||||||
|
record.children = null
|
||||||
|
record.hasChild = '0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let keyIndex = expandedRowKeys.value.indexOf(record.id)
|
||||||
|
if (keyIndex >= 0) {
|
||||||
|
expandedRowKeys.value.splice(keyIndex, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*操作表格后处理树节点展开合并
|
||||||
|
* */
|
||||||
|
async function expandTreeNode(key) {
|
||||||
|
let record = findTableDataRecord(key)
|
||||||
|
expandedRowKeys.value.push(key);
|
||||||
|
let result = await getChildList({pid: key});
|
||||||
|
if (result && result.length > 0) {
|
||||||
|
record.children = getDataByResult(result);
|
||||||
|
} else {
|
||||||
|
record.children = null
|
||||||
|
record.hasChild = '0'
|
||||||
|
}
|
||||||
|
updateTableDataRecord(key, record);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '编辑',
|
||||||
|
onClick: handleEdit.bind(null, record),
|
||||||
|
auth: 'dj.inspectimprove:dj_inspect_improve:edit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '添加下级',
|
||||||
|
onClick: handleAddSub.bind(null, {pid: record.id}),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 下拉操作栏
|
||||||
|
*/
|
||||||
|
function getDropDownAction(record){
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}, {
|
||||||
|
label: '删除',
|
||||||
|
popConfirm: {
|
||||||
|
title: '确定删除吗?',
|
||||||
|
confirm: handleDelete.bind(null, record),
|
||||||
|
placement: 'topLeft'
|
||||||
|
},
|
||||||
|
auth: 'dj.inspectimprove:dj_inspect_improve:delete'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(.ant-picker),:deep(.ant-input-number){
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+5
-5
@@ -12,11 +12,11 @@
|
|||||||
import {computed, defineComponent} from 'vue';
|
import {computed, defineComponent} from 'vue';
|
||||||
import {defHttp} from '/@/utils/http/axios';
|
import {defHttp} from '/@/utils/http/axios';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
import {getBpmFormSchema} from '../DjInspectionRectifyList.data';
|
import {getBpmFormSchema} from '../DjInspectImprove.data';
|
||||||
import {saveOrUpdateDict} from '../DjInspectionRectifyList.api';
|
import {saveOrUpdateDict} from '../DjInspectImprove.api';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "DjInspectionRectifyListForm",
|
name: "DjInspectImproveForm",
|
||||||
components:{
|
components:{
|
||||||
BasicForm
|
BasicForm
|
||||||
},
|
},
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
let formData = {};
|
let formData = {};
|
||||||
const queryByIdUrl = '/rectifylist/djInspectionRectifyList/queryById';
|
const queryByIdUrl = '/dj/inspectimprove/djInspectImprove/queryById';
|
||||||
async function initFormData(){
|
async function initFormData(){
|
||||||
let params = {id: props.formData.dataId};
|
let params = {id: props.formData.dataId};
|
||||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||||
@@ -67,4 +67,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
+5
-26
@@ -1,19 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :width="800" :title="getTitle" @ok="handleSubmit">
|
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :width="800" :title="getTitle" @ok="handleSubmit">
|
||||||
<BasicForm @register="registerForm" name="DjInspectionRectifyListForm" />
|
<BasicForm @register="registerForm" name="DjInspectImproveForm" />
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref, computed, unref, reactive} from 'vue';
|
import {ref, computed, unref} from 'vue';
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||||
import {BasicForm, useForm} from '/@/components/Form';
|
import {BasicForm, useForm} from '/@/components/Form';
|
||||||
import {formSchema} from '../DjInspectionRectifyList.data';
|
import {formSchema} from '../DjInspectImprove.data';
|
||||||
import {loadTreeData, saveOrUpdateDict} from '../DjInspectionRectifyList.api';
|
import {loadTreeData, saveOrUpdateDict} from '../DjInspectImprove.api';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({
|
|
||||||
});
|
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
// 获取emit
|
// 获取emit
|
||||||
const emit = defineEmits(['register', 'success']);
|
const emit = defineEmits(['register', 'success']);
|
||||||
@@ -83,8 +79,6 @@
|
|||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
let values = await validate();
|
let values = await validate();
|
||||||
// 预处理日期数据
|
|
||||||
changeDateValue(values);
|
|
||||||
setModalProps({confirmLoading: true});
|
setModalProps({confirmLoading: true});
|
||||||
//提交表单
|
//提交表单
|
||||||
await saveOrUpdateDict(values, isUpdate.value);
|
await saveOrUpdateDict(values, isUpdate.value);
|
||||||
@@ -112,21 +106,6 @@
|
|||||||
setModalProps({confirmLoading: false});
|
setModalProps({confirmLoading: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理日期值
|
|
||||||
* @param formData 表单数据
|
|
||||||
*/
|
|
||||||
const changeDateValue = (formData) => {
|
|
||||||
if (formData && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (formData[key]) {
|
|
||||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
/** 时间和数字输入框样式 */
|
/** 时间和数字输入框样式 */
|
||||||
@@ -137,4 +116,4 @@
|
|||||||
:deep(.ant-calendar-picker) {
|
:deep(.ant-calendar-picker) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
|
||||||
|
|
||||||
enum Api {
|
|
||||||
list = '/peopleService/djPeopleService/list',
|
|
||||||
save='/peopleService/djPeopleService/add',
|
|
||||||
edit='/peopleService/djPeopleService/edit',
|
|
||||||
deleteOne = '/peopleService/djPeopleService/delete',
|
|
||||||
deleteBatch = '/peopleService/djPeopleService/deleteBatch',
|
|
||||||
importExcel = '/peopleService/djPeopleService/importExcel',
|
|
||||||
exportXls = '/peopleService/djPeopleService/exportXls',
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 导出api
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const getExportUrl = Api.exportXls;
|
|
||||||
/**
|
|
||||||
* 导入api
|
|
||||||
*/
|
|
||||||
export const getImportUrl = Api.importExcel;
|
|
||||||
/**
|
|
||||||
* 列表接口
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const list = (params) =>
|
|
||||||
defHttp.get({url: Api.list, params});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除单个
|
|
||||||
*/
|
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
|
||||||
createConfirm({
|
|
||||||
iconType: 'warning',
|
|
||||||
title: '确认删除',
|
|
||||||
content: '是否删除选中数据',
|
|
||||||
okText: '确认',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 保存或者更新
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
|
||||||
return defHttp.post({url: url, params});
|
|
||||||
}
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
import { BasicColumn } from '/@/components/Table';
|
|
||||||
import { FormSchema } from '/@/components/Table';
|
|
||||||
import { rules } from '/@/utils/helper/validator';
|
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
|
||||||
//列表数据
|
|
||||||
export const columns: BasicColumn[] = [
|
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'sortNo',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问题分类',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'problemType',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '具体措施',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'specificMeasure',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成时限',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionDeadline',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '责任部门',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'responsibleDept_dictText',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成情况',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionStatus',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否可发起',
|
|
||||||
align: 'center',
|
|
||||||
width: 150,
|
|
||||||
dataIndex: 'isLaunchable_dictText',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
//查询数据
|
|
||||||
export const searchFormSchema: FormSchema[] = [];
|
|
||||||
//表单数据
|
|
||||||
export const formSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
label: '序号',
|
|
||||||
field: 'sortNo',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题分类',
|
|
||||||
field: 'problemType',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '具体措施',
|
|
||||||
field: 'specificMeasure',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成时限',
|
|
||||||
field: 'completionDeadline',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '责任部门',
|
|
||||||
field: 'responsibleDept',
|
|
||||||
component: 'JSelectDept',
|
|
||||||
componentProps: ({ formActionType, formModel }) => {
|
|
||||||
return {
|
|
||||||
sync: false,
|
|
||||||
checkStrictly: true,
|
|
||||||
defaultExpandLevel: 2,
|
|
||||||
|
|
||||||
onSelect: (options, values) => {
|
|
||||||
const { updateSchema } = formActionType;
|
|
||||||
//所属部门修改后更新负责部门下拉框数据
|
|
||||||
updateSchema([
|
|
||||||
{
|
|
||||||
field: 'departIds',
|
|
||||||
componentProps: { options },
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
if (!values) {
|
|
||||||
formModel.departIds = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
//所属部门修改后更新负责部门数据
|
|
||||||
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成情况',
|
|
||||||
field: 'completionStatus',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
// TODO 主键隐藏字段,目前写死为ID
|
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
field: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 高级查询数据
|
|
||||||
export const superQuerySchema = {
|
|
||||||
sortNo: { title: '序号', order: 0, view: 'number', type: 'number' },
|
|
||||||
problemType: { title: '问题分类', order: 1, view: 'text', type: 'string' },
|
|
||||||
specificMeasure: { title: '具体措施', order: 2, view: 'text', type: 'string' },
|
|
||||||
completionDeadline: { title: '完成时限', order: 3, view: 'date', type: 'string' },
|
|
||||||
responsibleDept: { title: '责任部门', order: 4, view: 'text', type: 'string' },
|
|
||||||
completionStatus: { title: '完成情况', order: 5, view: 'text', type: 'string' },
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流程表单调用这个方法获取formSchema
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
|
||||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|
||||||
return formSchema;
|
|
||||||
}
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!--引用表格-->
|
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
||||||
<!--插槽:table标题-->
|
|
||||||
<template #tableTitle>
|
|
||||||
<a-button type="primary" v-auth="'peopleService:dj_people_service:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
|
||||||
<a-button type="primary" v-auth="'peopleService:dj_people_service:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
|
||||||
导出</a-button
|
|
||||||
>
|
|
||||||
<j-upload-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'peopleService:dj_people_service:importExcel'"
|
|
||||||
preIcon="ant-design:import-outlined"
|
|
||||||
@click="onImportXls"
|
|
||||||
>导入</j-upload-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
||||||
<template #overlay>
|
|
||||||
<a-menu>
|
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
|
||||||
删除
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</template>
|
|
||||||
<a-button v-auth="'peopleService:dj_people_service:deleteBatch'"
|
|
||||||
>批量操作
|
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
|
||||||
</a-button>
|
|
||||||
</a-dropdown>
|
|
||||||
<!-- 高级查询 -->
|
|
||||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
|
||||||
</template>
|
|
||||||
<!--操作栏-->
|
|
||||||
<template #action="{ record }">
|
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
|
||||||
</template>
|
|
||||||
<!--字段回显插槽-->
|
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
|
|
||||||
</BasicTable>
|
|
||||||
<!-- 表单区域 -->
|
|
||||||
<DjPeopleServiceModal @register="registerModal" @success="handleSuccess"></DjPeopleServiceModal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="peopleService-djPeopleService" setup>
|
|
||||||
import { ref, reactive, computed, unref } from 'vue';
|
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
||||||
import { useModal } from '/@/components/Modal';
|
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
|
||||||
import DjPeopleServiceModal from './components/DjPeopleServiceModal.vue';
|
|
||||||
import { columns, searchFormSchema, superQuerySchema } from './DjPeopleService.data';
|
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DjPeopleService.api';
|
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({});
|
|
||||||
const queryParam = reactive<any>({});
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
const userStore = useUserStore();
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
//注册model
|
|
||||||
const [registerModal, { openModal }] = useModal();
|
|
||||||
//注册table数据
|
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|
||||||
tableProps: {
|
|
||||||
title: '我为群众办实事台账',
|
|
||||||
api: list,
|
|
||||||
columns,
|
|
||||||
canResize: true,
|
|
||||||
formConfig: {
|
|
||||||
//labelWidth: 120,
|
|
||||||
schemas: searchFormSchema,
|
|
||||||
autoSubmitOnEnter: true,
|
|
||||||
showAdvancedButton: true,
|
|
||||||
fieldMapToNumber: [],
|
|
||||||
fieldMapToTime: [],
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 120,
|
|
||||||
fixed: 'right',
|
|
||||||
},
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
if (params && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (params[key]) {
|
|
||||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Object.assign(params, queryParam);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
exportConfig: {
|
|
||||||
name: '我为群众办实事台账',
|
|
||||||
url: getExportUrl,
|
|
||||||
params: queryParam,
|
|
||||||
},
|
|
||||||
importConfig: {
|
|
||||||
url: getImportUrl,
|
|
||||||
success: handleSuccess,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
||||||
|
|
||||||
// 高级查询配置
|
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 高级查询事件
|
|
||||||
*/
|
|
||||||
function handleSuperQuery(params) {
|
|
||||||
Object.keys(params).map((k) => {
|
|
||||||
queryParam[k] = params[k];
|
|
||||||
});
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 新增事件
|
|
||||||
*/
|
|
||||||
function handleAdd() {
|
|
||||||
openModal(true, {
|
|
||||||
isUpdate: false,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 编辑事件
|
|
||||||
*/
|
|
||||||
function handleEdit(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
function handleDetail(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 发起流程
|
|
||||||
*/
|
|
||||||
function handleProcessLaunch() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除事件
|
|
||||||
*/
|
|
||||||
async function handleDelete(record) {
|
|
||||||
await deleteOne({ id: record.id }, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除事件
|
|
||||||
*/
|
|
||||||
async function batchHandleDelete() {
|
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 成功回调
|
|
||||||
*/
|
|
||||||
function handleSuccess() {
|
|
||||||
(selectedRowKeys.value = []) && reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 操作栏
|
|
||||||
*/
|
|
||||||
function getTableAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
auth: 'peopleService:dj_people_service:edit',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '发起流程',
|
|
||||||
onClick: handleProcessLaunch(),
|
|
||||||
disabled: record.isLaunch === 0,
|
|
||||||
//auth: 'rectifylist:dj_inspection_rectify_list:edit',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下拉操作栏
|
|
||||||
*/
|
|
||||||
function getDropDownAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '详情',
|
|
||||||
onClick: handleDetail.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
},
|
|
||||||
auth: 'peopleService:dj_people_service:delete',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
:deep(.ant-picker),
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="min-height: 400px">
|
|
||||||
<BasicForm @register="registerForm"></BasicForm>
|
|
||||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
|
||||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {computed, defineComponent} from 'vue';
|
|
||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
|
||||||
import {getBpmFormSchema} from '../DjPeopleService.data';
|
|
||||||
import {saveOrUpdate} from '../DjPeopleService.api';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "DjPeopleServiceForm",
|
|
||||||
components:{
|
|
||||||
BasicForm
|
|
||||||
},
|
|
||||||
props:{
|
|
||||||
formData: propTypes.object.def({}),
|
|
||||||
formBpm: propTypes.bool.def(true),
|
|
||||||
},
|
|
||||||
setup(props){
|
|
||||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: getBpmFormSchema(props.formData),
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
|
|
||||||
const formDisabled = computed(()=>{
|
|
||||||
if(props.formData.disabled === false){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
let formData = {};
|
|
||||||
const queryByIdUrl = '/peopleService/djPeopleService/queryById';
|
|
||||||
async function initFormData(){
|
|
||||||
let params = {id: props.formData.dataId};
|
|
||||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
|
||||||
formData = {...data}
|
|
||||||
//设置表单的值
|
|
||||||
await setFieldsValue(formData);
|
|
||||||
//默认是禁用
|
|
||||||
await setProps({disabled: formDisabled.value})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitForm() {
|
|
||||||
let data = getFieldsValue();
|
|
||||||
let params = Object.assign({}, formData, data);
|
|
||||||
console.log('表单数据', params)
|
|
||||||
await saveOrUpdate(params, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
initFormData();
|
|
||||||
|
|
||||||
return {
|
|
||||||
registerForm,
|
|
||||||
formDisabled,
|
|
||||||
submitForm,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
|
||||||
<BasicForm @register="registerForm" name="DjPeopleServiceForm" />
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import {ref, computed, unref, reactive} from 'vue';
|
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {formSchema} from '../DjPeopleService.data';
|
|
||||||
import {saveOrUpdate} from '../DjPeopleService.api';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
// Emits声明
|
|
||||||
const emit = defineEmits(['register','success']);
|
|
||||||
const isUpdate = ref(true);
|
|
||||||
const isDetail = ref(false);
|
|
||||||
//表单配置
|
|
||||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: formSchema,
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
//表单赋值
|
|
||||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
|
||||||
//重置表单
|
|
||||||
await resetFields();
|
|
||||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
|
||||||
isUpdate.value = !!data?.isUpdate;
|
|
||||||
isDetail.value = !!data?.showFooter;
|
|
||||||
if (unref(isUpdate)) {
|
|
||||||
//表单赋值
|
|
||||||
await setFieldsValue({
|
|
||||||
...data.record,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 隐藏底部时禁用整个表单
|
|
||||||
setProps({ disabled: !data?.showFooter })
|
|
||||||
});
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({
|
|
||||||
});
|
|
||||||
//设置标题
|
|
||||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
|
||||||
//表单提交事件
|
|
||||||
async function handleSubmit(v) {
|
|
||||||
try {
|
|
||||||
let values = await validate();
|
|
||||||
// 预处理日期数据
|
|
||||||
changeDateValue(values);
|
|
||||||
setModalProps({confirmLoading: true});
|
|
||||||
//提交表单
|
|
||||||
await saveOrUpdate(values, isUpdate.value);
|
|
||||||
//关闭弹窗
|
|
||||||
closeModal();
|
|
||||||
//刷新列表
|
|
||||||
emit('success');
|
|
||||||
} catch ({ errorFields }) {
|
|
||||||
if (errorFields) {
|
|
||||||
const firstField = errorFields[0];
|
|
||||||
if (firstField) {
|
|
||||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.reject(errorFields);
|
|
||||||
} finally {
|
|
||||||
setModalProps({confirmLoading: false});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理日期值
|
|
||||||
* @param formData 表单数据
|
|
||||||
*/
|
|
||||||
const changeDateValue = (formData) => {
|
|
||||||
if (formData && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (formData[key]) {
|
|
||||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
/** 时间和数字输入框样式 */
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-calendar-picker) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,222 +0,0 @@
|
|||||||
import { BasicColumn } from '/@/components/Table';
|
|
||||||
import { FormSchema } from '/@/components/Table';
|
|
||||||
import { rules } from '/@/utils/helper/validator';
|
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
|
||||||
//列表数据
|
|
||||||
export const columns: BasicColumn[] = [
|
|
||||||
{
|
|
||||||
title: '问题名称',
|
|
||||||
align: 'left',
|
|
||||||
dataIndex: 'issueName',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问题分类',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'problemType',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '面上问题',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'msIssue',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '具体问题',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'specificIssue',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '整改措施',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'rectificationMeasures',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成时限',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionDeadline',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '责任部门',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'responsibleDept_dictText',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '分管所领导',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'supervisingLeader',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '标志性成果',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'landmarkAchievement',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成时间',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionDate',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '监督意见',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'supervisionOpinion',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '措施数量',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'measureCount',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否可发起',
|
|
||||||
align: 'center',
|
|
||||||
width: 150,
|
|
||||||
dataIndex: 'isLaunchable_dictText',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
//查询数据
|
|
||||||
export const searchFormSchema: FormSchema[] = [];
|
|
||||||
//表单数据
|
|
||||||
export const formSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
label: '父级节点',
|
|
||||||
field: 'pid',
|
|
||||||
component: 'JTreeSelect',
|
|
||||||
componentProps: {
|
|
||||||
dict: 'dj_inspection_rectify_list,issue_name,id',
|
|
||||||
pidField: 'pid',
|
|
||||||
pidValue: '0',
|
|
||||||
hasChildField: 'has_child',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题名称',
|
|
||||||
field: 'issueName',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题分类',
|
|
||||||
field: 'problemType',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '面上问题',
|
|
||||||
field: 'msIssue',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '具体问题',
|
|
||||||
field: 'specificIssue',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '整改措施',
|
|
||||||
field: 'rectificationMeasures',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成时限',
|
|
||||||
field: 'completionDeadline',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '责任部门',
|
|
||||||
field: 'responsibleDept',
|
|
||||||
component: 'JSelectDept',
|
|
||||||
componentProps: ({ formActionType, formModel }) => {
|
|
||||||
return {
|
|
||||||
sync: false,
|
|
||||||
checkStrictly: true,
|
|
||||||
defaultExpandLevel: 2,
|
|
||||||
|
|
||||||
onSelect: (options, values) => {
|
|
||||||
const { updateSchema } = formActionType;
|
|
||||||
//所属部门修改后更新负责部门下拉框数据
|
|
||||||
updateSchema([
|
|
||||||
{
|
|
||||||
field: 'departIds',
|
|
||||||
componentProps: { options },
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
if (!values) {
|
|
||||||
formModel.departIds = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
//所属部门修改后更新负责部门数据
|
|
||||||
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '分管所领导',
|
|
||||||
field: 'supervisingLeader',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '标志性成果',
|
|
||||||
field: 'landmarkAchievement',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成时间',
|
|
||||||
field: 'completionDate',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '监督意见',
|
|
||||||
field: 'supervisionOpinion',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '措施数量',
|
|
||||||
field: 'measureCount',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
// TODO 主键隐藏字段,目前写死为ID
|
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
field: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 高级查询数据
|
|
||||||
export const superQuerySchema = {
|
|
||||||
issueName: { title: '问题名称', order: 1, view: 'text', type: 'string' },
|
|
||||||
problemType: { title: '问题分类', order: 2, view: 'number', type: 'number' },
|
|
||||||
msIssue: { title: '面上问题', order: 3, view: 'text', type: 'string' },
|
|
||||||
specificIssue: { title: '具体问题', order: 4, view: 'text', type: 'string' },
|
|
||||||
rectificationMeasures: { title: '整改措施', order: 5, view: 'text', type: 'string' },
|
|
||||||
completionDeadline: { title: '完成时限', order: 6, view: 'date', type: 'string' },
|
|
||||||
responsibleDept: { title: '责任部门', order: 7, view: 'text', type: 'string' },
|
|
||||||
supervisingLeader: { title: '分管所领导', order: 8, view: 'text', type: 'string' },
|
|
||||||
landmarkAchievement: { title: '标志性成果', order: 9, view: 'text', type: 'string' },
|
|
||||||
completionDate: { title: '完成时间', order: 10, view: 'date', type: 'string' },
|
|
||||||
supervisionOpinion: { title: '监督意见', order: 11, view: 'text', type: 'string' },
|
|
||||||
measureCount: { title: '措施数量', order: 12, view: 'number', type: 'number' },
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流程表单调用这个方法获取formSchema
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
|
||||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|
||||||
return formSchema;
|
|
||||||
}
|
|
||||||
@@ -1,387 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!--引用表格-->
|
|
||||||
<BasicTable
|
|
||||||
@register="registerTable"
|
|
||||||
:rowSelection="rowSelection"
|
|
||||||
:expandedRowKeys="expandedRowKeys"
|
|
||||||
@expand="handleExpand"
|
|
||||||
@fetch-success="onFetchSuccess"
|
|
||||||
>
|
|
||||||
<!--插槽:table标题-->
|
|
||||||
<template #tableTitle>
|
|
||||||
<a-button type="primary" v-auth="'rectifylist:dj_inspection_rectify_list:add'" @click="handleCreate" preIcon="ant-design:plus-outlined">
|
|
||||||
新增</a-button
|
|
||||||
>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'rectifylist:dj_inspection_rectify_list:exportXls'"
|
|
||||||
preIcon="ant-design:export-outlined"
|
|
||||||
@click="onExportXls"
|
|
||||||
>
|
|
||||||
导出</a-button
|
|
||||||
>
|
|
||||||
<j-upload-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'rectifylist:dj_inspection_rectify_list:importExcel'"
|
|
||||||
preIcon="ant-design:import-outlined"
|
|
||||||
@click="onImportXls"
|
|
||||||
>导入</j-upload-button
|
|
||||||
>
|
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
||||||
<template #overlay>
|
|
||||||
<a-menu>
|
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
|
||||||
删除
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</template>
|
|
||||||
<a-button v-auth="'rectifylist:dj_inspection_rectify_list:deleteBatch'"
|
|
||||||
>批量操作
|
|
||||||
<Icon icon="ant-design:down-outlined"></Icon>
|
|
||||||
</a-button>
|
|
||||||
</a-dropdown>
|
|
||||||
<!-- 高级查询 -->
|
|
||||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
|
||||||
</template>
|
|
||||||
<!--操作栏-->
|
|
||||||
<template #action="{ record }">
|
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
|
||||||
</template>
|
|
||||||
<!--字段回显插槽-->
|
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
|
|
||||||
</BasicTable>
|
|
||||||
<!--字典弹窗-->
|
|
||||||
<DjInspectionRectifyListModal @register="registerModal" @success="handleSuccess" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="rectifylist-djInspectionRectifyList" setup>
|
|
||||||
//ts语法
|
|
||||||
import { ref, reactive, computed, unref, toRaw, nextTick } from 'vue';
|
|
||||||
import { BasicTable, TableAction } from '/@/components/Table';
|
|
||||||
import { useModal } from '/@/components/Modal';
|
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
|
||||||
import DjInspectionRectifyListModal from './components/DjInspectionRectifyListModal.vue';
|
|
||||||
import { columns, searchFormSchema, superQuerySchema } from './DjInspectionRectifyList.data';
|
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import {
|
|
||||||
list,
|
|
||||||
deleteDjInspectionRectifyList,
|
|
||||||
batchDeleteDjInspectionRectifyList,
|
|
||||||
getExportUrl,
|
|
||||||
getImportUrl,
|
|
||||||
getChildList,
|
|
||||||
getChildListBatch,
|
|
||||||
} from './DjInspectionRectifyList.api';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({});
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
const queryParam = reactive<any>({});
|
|
||||||
const expandedRowKeys = ref([]);
|
|
||||||
//字典model
|
|
||||||
const [registerModal, { openModal }] = useModal();
|
|
||||||
//注册table数据
|
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|
||||||
tableProps: {
|
|
||||||
api: list,
|
|
||||||
title: '党建巡视整改提升工作台账',
|
|
||||||
columns,
|
|
||||||
canResize: true,
|
|
||||||
isTreeTable: true,
|
|
||||||
formConfig: {
|
|
||||||
//labelWidth: 120,
|
|
||||||
schemas: searchFormSchema,
|
|
||||||
autoSubmitOnEnter: true,
|
|
||||||
showAdvancedButton: true,
|
|
||||||
fieldMapToNumber: [],
|
|
||||||
fieldMapToTime: [],
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 240,
|
|
||||||
fixed: 'right',
|
|
||||||
},
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
if (params && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (params[key]) {
|
|
||||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
params.hasQuery = 'true';
|
|
||||||
return Object.assign(params, queryParam);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
exportConfig: {
|
|
||||||
name: '党建巡视整改提升工作台账',
|
|
||||||
url: getExportUrl,
|
|
||||||
params: queryParam,
|
|
||||||
},
|
|
||||||
importConfig: {
|
|
||||||
url: getImportUrl,
|
|
||||||
success: importSuccess,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
|
|
||||||
tableContext;
|
|
||||||
|
|
||||||
// 高级查询配置
|
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 高级查询事件
|
|
||||||
*/
|
|
||||||
function handleSuperQuery(params) {
|
|
||||||
Object.keys(params).map((k) => {
|
|
||||||
queryParam[k] = params[k];
|
|
||||||
});
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增事件
|
|
||||||
*/
|
|
||||||
function handleCreate() {
|
|
||||||
openModal(true, {
|
|
||||||
isUpdate: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发起流程
|
|
||||||
*/
|
|
||||||
function handleProcessLaunch() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑事件
|
|
||||||
*/
|
|
||||||
async function handleEdit(record) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
async function handleDetail(record) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
hideFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除事件
|
|
||||||
*/
|
|
||||||
async function handleDelete(record) {
|
|
||||||
await deleteDjInspectionRectifyList({ id: record.id }, importSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除事件
|
|
||||||
*/
|
|
||||||
async function batchHandleDelete() {
|
|
||||||
const ids = selectedRowKeys.value.filter((item) => !item.includes('loadChild'));
|
|
||||||
await batchDeleteDjInspectionRectifyList({ id: ids }, importSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 导入
|
|
||||||
*/
|
|
||||||
function importSuccess() {
|
|
||||||
(selectedRowKeys.value = []) && reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 添加下级
|
|
||||||
*/
|
|
||||||
function handleAddSub(record) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 成功回调
|
|
||||||
*/
|
|
||||||
async function handleSuccess({ isUpdate, values, expandedArr, changeParent }) {
|
|
||||||
if (isUpdate) {
|
|
||||||
if (changeParent) {
|
|
||||||
reload();
|
|
||||||
} else {
|
|
||||||
let data = await list({ id: values.id, pageSize: 1, pageNo: 1, pid: values['pid'] });
|
|
||||||
if (data && data.records && data.records.length > 0) {
|
|
||||||
// 编辑回调
|
|
||||||
updateTableDataRecord(values.id, data.records[0]);
|
|
||||||
} else {
|
|
||||||
updateTableDataRecord(values.id, values);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!values['id'] || !values['pid']) {
|
|
||||||
//新增根节点
|
|
||||||
reload();
|
|
||||||
} else {
|
|
||||||
//新增子集
|
|
||||||
expandedRowKeys.value = [];
|
|
||||||
for (let key of unref(expandedArr)) {
|
|
||||||
await expandTreeNode(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接口请求成功后回调
|
|
||||||
*/
|
|
||||||
function onFetchSuccess(result) {
|
|
||||||
getDataByResult(result.items) && loadDataByExpandedRows();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据)
|
|
||||||
*/
|
|
||||||
async function loadDataByExpandedRows() {
|
|
||||||
if (unref(expandedRowKeys).length > 0) {
|
|
||||||
const res = await getChildListBatch({ parentIds: unref(expandedRowKeys).join(',') });
|
|
||||||
if (res.success && res.result.records.length > 0) {
|
|
||||||
//已展开的数据批量子节点
|
|
||||||
let records = res.result.records;
|
|
||||||
const listMap = new Map();
|
|
||||||
for (let item of records) {
|
|
||||||
let pid = item['pid'];
|
|
||||||
if (unref(expandedRowKeys).includes(pid)) {
|
|
||||||
let mapList = listMap.get(pid);
|
|
||||||
if (mapList == null) {
|
|
||||||
mapList = [];
|
|
||||||
}
|
|
||||||
mapList.push(item);
|
|
||||||
listMap.set(pid, mapList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let childrenMap = listMap;
|
|
||||||
let fn = (list) => {
|
|
||||||
if (list) {
|
|
||||||
list.forEach((data) => {
|
|
||||||
if (unref(expandedRowKeys).includes(data.id)) {
|
|
||||||
data.children = getDataByResult(childrenMap.get(data.id));
|
|
||||||
fn(data.children);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
fn(getDataSource());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 处理数据集
|
|
||||||
*/
|
|
||||||
function getDataByResult(result) {
|
|
||||||
if (result && result.length > 0) {
|
|
||||||
return result.map((item) => {
|
|
||||||
//判断是否标记了带有子节点
|
|
||||||
if (item['hasChild'] == '1') {
|
|
||||||
let loadChild = { id: item.id + '_loadChild', name: 'loading...', isLoading: true };
|
|
||||||
item.children = [loadChild];
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*树节点展开合并
|
|
||||||
* */
|
|
||||||
async function handleExpand(expanded, record) {
|
|
||||||
// 判断是否是展开状态,展开状态(expanded)并且存在子集(children)并且未加载过(isLoading)的就去查询子节点数据
|
|
||||||
if (expanded) {
|
|
||||||
expandedRowKeys.value.push(record.id);
|
|
||||||
if (record.children.length > 0 && !!record.children[0].isLoading) {
|
|
||||||
let result = await getChildList({ pid: record.id });
|
|
||||||
result = result.records ? result.records : result;
|
|
||||||
if (result && result.length > 0) {
|
|
||||||
record.children = getDataByResult(result);
|
|
||||||
} else {
|
|
||||||
record.children = null;
|
|
||||||
record.hasChild = '0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let keyIndex = expandedRowKeys.value.indexOf(record.id);
|
|
||||||
if (keyIndex >= 0) {
|
|
||||||
expandedRowKeys.value.splice(keyIndex, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*操作表格后处理树节点展开合并
|
|
||||||
* */
|
|
||||||
async function expandTreeNode(key) {
|
|
||||||
let record = findTableDataRecord(key);
|
|
||||||
expandedRowKeys.value.push(key);
|
|
||||||
let result = await getChildList({ pid: key });
|
|
||||||
if (result && result.length > 0) {
|
|
||||||
record.children = getDataByResult(result);
|
|
||||||
} else {
|
|
||||||
record.children = null;
|
|
||||||
record.hasChild = '0';
|
|
||||||
}
|
|
||||||
updateTableDataRecord(key, record);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 操作栏
|
|
||||||
*/
|
|
||||||
function getTableAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
auth: 'rectifylist:dj_inspection_rectify_list:edit',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '发起流程',
|
|
||||||
onClick: handleProcessLaunch(),
|
|
||||||
disabled: record.isLaunch === 0,
|
|
||||||
//auth: 'rectifylist:dj_inspection_rectify_list:edit',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '添加下级',
|
|
||||||
onClick: handleAddSub.bind(null, { pid: record.id }),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下拉操作栏
|
|
||||||
*/
|
|
||||||
function getDropDownAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '详情',
|
|
||||||
onClick: handleDetail.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '确定删除吗?',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
},
|
|
||||||
auth: 'rectifylist:dj_inspection_rectify_list:delete',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
:deep(.ant-picker),
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import { defHttp } from '/@/utils/http/axios';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
|
||||||
|
|
||||||
enum Api {
|
|
||||||
list = '/tzMetting/djMeetingRecord/list',
|
|
||||||
save = '/tzMetting/djMeetingRecord/add',
|
|
||||||
edit = '/tzMetting/djMeetingRecord/edit',
|
|
||||||
deleteOne = '/tzMetting/djMeetingRecord/delete',
|
|
||||||
deleteBatch = '/tzMetting/djMeetingRecord/deleteBatch',
|
|
||||||
importExcel = '/tzMetting/djMeetingRecord/importExcel',
|
|
||||||
exportXls = '/tzMetting/djMeetingRecord/exportXls',
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 导出api
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const getExportUrl = Api.exportXls;
|
|
||||||
/**
|
|
||||||
* 导入api
|
|
||||||
*/
|
|
||||||
export const getImportUrl = Api.importExcel;
|
|
||||||
/**
|
|
||||||
* 列表接口
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除单个
|
|
||||||
*/
|
|
||||||
export const deleteOne = (params, handleSuccess) => {
|
|
||||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
|
||||||
createConfirm({
|
|
||||||
iconType: 'warning',
|
|
||||||
title: '确认删除',
|
|
||||||
content: '是否删除选中数据',
|
|
||||||
okText: '确认',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 保存或者更新
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
|
||||||
return defHttp.post({ url: url, params });
|
|
||||||
};
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
import { BasicColumn } from '/@/components/Table';
|
|
||||||
import { FormSchema } from '/@/components/Table';
|
|
||||||
import { rules } from '/@/utils/helper/validator';
|
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
|
||||||
//列表数据
|
|
||||||
export const columns: BasicColumn[] = [
|
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'sortNo',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问题分类',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'problemType',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '具体措施',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'specificMeasure',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成时限',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionDeadline',
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
|
||||||
return text;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '责任部门',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'responsibleDept_dictText',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '完成情况',
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'completionStatus',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否可发起',
|
|
||||||
align: 'center',
|
|
||||||
width: 150,
|
|
||||||
dataIndex: 'isLaunchable_dictText',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
//查询数据
|
|
||||||
export const searchFormSchema: FormSchema[] = [];
|
|
||||||
//表单数据
|
|
||||||
export const formSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
label: '序号',
|
|
||||||
field: 'sortNo',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '问题分类',
|
|
||||||
field: 'problemType',
|
|
||||||
component: 'InputNumber',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '具体措施',
|
|
||||||
field: 'specificMeasure',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成时限',
|
|
||||||
field: 'completionDeadline',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '责任部门',
|
|
||||||
field: 'responsibleDept',
|
|
||||||
component: 'JSelectDept',
|
|
||||||
componentProps: ({ formActionType, formModel }) => {
|
|
||||||
return {
|
|
||||||
sync: false,
|
|
||||||
checkStrictly: true,
|
|
||||||
defaultExpandLevel: 2,
|
|
||||||
|
|
||||||
onSelect: (options, values) => {
|
|
||||||
const { updateSchema } = formActionType;
|
|
||||||
//所属部门修改后更新负责部门下拉框数据
|
|
||||||
updateSchema([
|
|
||||||
{
|
|
||||||
field: 'departIds',
|
|
||||||
componentProps: { options },
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
if (!values) {
|
|
||||||
formModel.departIds = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
|
||||||
//所属部门修改后更新负责部门数据
|
|
||||||
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '完成情况',
|
|
||||||
field: 'completionStatus',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
// TODO 主键隐藏字段,目前写死为ID
|
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
field: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 高级查询数据
|
|
||||||
export const superQuerySchema = {
|
|
||||||
sortNo: { title: '序号', order: 0, view: 'number', type: 'number' },
|
|
||||||
problemType: { title: '问题分类', order: 1, view: 'number', type: 'number' },
|
|
||||||
specificMeasure: { title: '具体措施', order: 2, view: 'text', type: 'string' },
|
|
||||||
completionDeadline: { title: '完成时限', order: 3, view: 'date', type: 'string' },
|
|
||||||
responsibleDept: { title: '责任部门', order: 4, view: 'text', type: 'string' },
|
|
||||||
completionStatus: { title: '完成情况', order: 5, view: 'text', type: 'string' },
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流程表单调用这个方法获取formSchema
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
export function getBpmFormSchema(_formData): FormSchema[] {
|
|
||||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|
||||||
return formSchema;
|
|
||||||
}
|
|
||||||
@@ -1,217 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!--引用表格-->
|
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
||||||
<!--插槽:table标题-->
|
|
||||||
<template #tableTitle>
|
|
||||||
<a-button type="primary" v-auth="'tzMetting:dj_meeting_record:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
|
||||||
<a-button type="primary" v-auth="'tzMetting:dj_meeting_record:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
|
||||||
导出</a-button
|
|
||||||
>
|
|
||||||
<j-upload-button type="primary" v-auth="'tzMetting:dj_meeting_record:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"
|
|
||||||
>导入</j-upload-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
||||||
<template #overlay>
|
|
||||||
<a-menu>
|
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
|
||||||
删除
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</template>
|
|
||||||
<a-button v-auth="'tzMetting:dj_meeting_record:deleteBatch'"
|
|
||||||
>批量操作
|
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
|
||||||
</a-button>
|
|
||||||
</a-dropdown>
|
|
||||||
<!-- 高级查询 -->
|
|
||||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
|
||||||
</template>
|
|
||||||
<!--操作栏-->
|
|
||||||
<template #action="{ record }">
|
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
|
||||||
</template>
|
|
||||||
<!--字段回显插槽-->
|
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
|
|
||||||
</BasicTable>
|
|
||||||
<!-- 表单区域 -->
|
|
||||||
<DjMeetingRecordModal @register="registerModal" @success="handleSuccess"></DjMeetingRecordModal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="tzMetting-djMeetingRecord" setup>
|
|
||||||
import { ref, reactive, computed, unref } from 'vue';
|
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
||||||
import { useModal } from '/@/components/Modal';
|
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
|
||||||
import DjMeetingRecordModal from './components/DjMeetingRecordModal.vue';
|
|
||||||
import { columns, searchFormSchema, superQuerySchema } from './DjMeetingRecord.data';
|
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DjMeetingRecord.api';
|
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({});
|
|
||||||
const queryParam = reactive<any>({});
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
const userStore = useUserStore();
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
//注册model
|
|
||||||
const [registerModal, { openModal }] = useModal();
|
|
||||||
//注册table数据
|
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|
||||||
tableProps: {
|
|
||||||
title: '统战座谈会意见台账及督办反馈',
|
|
||||||
api: list,
|
|
||||||
columns,
|
|
||||||
canResize: true,
|
|
||||||
formConfig: {
|
|
||||||
//labelWidth: 120,
|
|
||||||
schemas: searchFormSchema,
|
|
||||||
autoSubmitOnEnter: true,
|
|
||||||
showAdvancedButton: true,
|
|
||||||
fieldMapToNumber: [],
|
|
||||||
fieldMapToTime: [],
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 120,
|
|
||||||
fixed: 'right',
|
|
||||||
},
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
if (params && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (params[key]) {
|
|
||||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Object.assign(params, queryParam);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
exportConfig: {
|
|
||||||
name: '统战座谈会意见台账及督办反馈',
|
|
||||||
url: getExportUrl,
|
|
||||||
params: queryParam,
|
|
||||||
},
|
|
||||||
importConfig: {
|
|
||||||
url: getImportUrl,
|
|
||||||
success: handleSuccess,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
||||||
|
|
||||||
// 高级查询配置
|
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 高级查询事件
|
|
||||||
*/
|
|
||||||
function handleSuperQuery(params) {
|
|
||||||
Object.keys(params).map((k) => {
|
|
||||||
queryParam[k] = params[k];
|
|
||||||
});
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 新增事件
|
|
||||||
*/
|
|
||||||
function handleAdd() {
|
|
||||||
openModal(true, {
|
|
||||||
isUpdate: false,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 编辑事件
|
|
||||||
*/
|
|
||||||
function handleEdit(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
function handleDetail(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除事件
|
|
||||||
*/
|
|
||||||
async function handleDelete(record) {
|
|
||||||
await deleteOne({ id: record.id }, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除事件
|
|
||||||
*/
|
|
||||||
async function batchHandleDelete() {
|
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 成功回调
|
|
||||||
*/
|
|
||||||
function handleSuccess() {
|
|
||||||
(selectedRowKeys.value = []) && reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 发起流程
|
|
||||||
*/
|
|
||||||
function handleProcessLaunch() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 操作栏
|
|
||||||
*/
|
|
||||||
function getTableAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
auth: 'tzMetting:dj_meeting_record:edit',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '发起流程',
|
|
||||||
onClick: handleProcessLaunch(),
|
|
||||||
disabled: record.isLaunch === 0,
|
|
||||||
//auth: 'rectifylist:dj_inspection_rectify_list:edit',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下拉操作栏
|
|
||||||
*/
|
|
||||||
function getDropDownAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '详情',
|
|
||||||
onClick: handleDetail.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
},
|
|
||||||
auth: 'tzMetting:dj_meeting_record:delete',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
:deep(.ant-picker),
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="min-height: 400px">
|
|
||||||
<BasicForm @register="registerForm"></BasicForm>
|
|
||||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
|
||||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {computed, defineComponent} from 'vue';
|
|
||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
|
||||||
import {getBpmFormSchema} from '../DjMeetingRecord.data';
|
|
||||||
import {saveOrUpdate} from '../DjMeetingRecord.api';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "DjMeetingRecordForm",
|
|
||||||
components:{
|
|
||||||
BasicForm
|
|
||||||
},
|
|
||||||
props:{
|
|
||||||
formData: propTypes.object.def({}),
|
|
||||||
formBpm: propTypes.bool.def(true),
|
|
||||||
},
|
|
||||||
setup(props){
|
|
||||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: getBpmFormSchema(props.formData),
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
|
|
||||||
const formDisabled = computed(()=>{
|
|
||||||
if(props.formData.disabled === false){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
let formData = {};
|
|
||||||
const queryByIdUrl = '/tzMetting/djMeetingRecord/queryById';
|
|
||||||
async function initFormData(){
|
|
||||||
let params = {id: props.formData.dataId};
|
|
||||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
|
||||||
formData = {...data}
|
|
||||||
//设置表单的值
|
|
||||||
await setFieldsValue(formData);
|
|
||||||
//默认是禁用
|
|
||||||
await setProps({disabled: formDisabled.value})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitForm() {
|
|
||||||
let data = getFieldsValue();
|
|
||||||
let params = Object.assign({}, formData, data);
|
|
||||||
console.log('表单数据', params)
|
|
||||||
await saveOrUpdate(params, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
initFormData();
|
|
||||||
|
|
||||||
return {
|
|
||||||
registerForm,
|
|
||||||
formDisabled,
|
|
||||||
submitForm,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
|
||||||
<BasicForm @register="registerForm" name="DjMeetingRecordForm" />
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import {ref, computed, unref, reactive} from 'vue';
|
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {formSchema} from '../DjMeetingRecord.data';
|
|
||||||
import {saveOrUpdate} from '../DjMeetingRecord.api';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
// Emits声明
|
|
||||||
const emit = defineEmits(['register','success']);
|
|
||||||
const isUpdate = ref(true);
|
|
||||||
const isDetail = ref(false);
|
|
||||||
//表单配置
|
|
||||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: formSchema,
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
//表单赋值
|
|
||||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
|
||||||
//重置表单
|
|
||||||
await resetFields();
|
|
||||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
|
||||||
isUpdate.value = !!data?.isUpdate;
|
|
||||||
isDetail.value = !!data?.showFooter;
|
|
||||||
if (unref(isUpdate)) {
|
|
||||||
//表单赋值
|
|
||||||
await setFieldsValue({
|
|
||||||
...data.record,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 隐藏底部时禁用整个表单
|
|
||||||
setProps({ disabled: !data?.showFooter })
|
|
||||||
});
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({
|
|
||||||
});
|
|
||||||
//设置标题
|
|
||||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
|
||||||
//表单提交事件
|
|
||||||
async function handleSubmit(v) {
|
|
||||||
try {
|
|
||||||
let values = await validate();
|
|
||||||
// 预处理日期数据
|
|
||||||
changeDateValue(values);
|
|
||||||
setModalProps({confirmLoading: true});
|
|
||||||
//提交表单
|
|
||||||
await saveOrUpdate(values, isUpdate.value);
|
|
||||||
//关闭弹窗
|
|
||||||
closeModal();
|
|
||||||
//刷新列表
|
|
||||||
emit('success');
|
|
||||||
} catch ({ errorFields }) {
|
|
||||||
if (errorFields) {
|
|
||||||
const firstField = errorFields[0];
|
|
||||||
if (firstField) {
|
|
||||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.reject(errorFields);
|
|
||||||
} finally {
|
|
||||||
setModalProps({confirmLoading: false});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理日期值
|
|
||||||
* @param formData 表单数据
|
|
||||||
*/
|
|
||||||
const changeDateValue = (formData) => {
|
|
||||||
if (formData && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (formData[key]) {
|
|
||||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
/** 时间和数字输入框样式 */
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-calendar-picker) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
export const ROLE_SCOPE_CONFIG = {
|
export const ROLE_SCOPE_CONFIG = {
|
||||||
DEFAULT_PERMESSION_IDS: '2035916880060223489,2026041610467690430',
|
DEFAULT_PERMESSION_IDS: '2035916880060223489,2026041610467690430,2026051809451730260',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user