fix(xispeak): 重构权限文档控制层级并修复部门过滤不生效
- BPM_NODE_PERMISSIONS.md: showBaseInfo/baseInfoReadonly 改为 edit;jiJianFieldsReadonly 移至 showEditFeedback 下 - BgXiSpeakBPMForm.vue: 添加 watch(showDeptFeedback) 和客户端部门过滤逻辑 - "措施内容" 统一改为 "具体措施" Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -267,6 +267,7 @@
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
||||
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
|
||||
import JTreeSelect from '/@/components/Form/src/jeecg/components/JTreeSelect.vue';
|
||||
@@ -286,6 +287,7 @@
|
||||
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
||||
|
||||
const { isDisabledAuth, hasPermission, initBpmFormData } = usePermission();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
@@ -353,7 +355,7 @@
|
||||
{ title: '序号', key: 'seq', align: 'center', width: 60 },
|
||||
{ title: '反馈部门名称', dataIndex: 'responDeptname', align: 'center', width: 140 },
|
||||
{ title: '反馈人姓名', dataIndex: 'responPersonname', align: 'center', width: 120 },
|
||||
{ title: '措施内容', dataIndex: 'method', align: 'left', width: 200 },
|
||||
{ title: '具体措施', dataIndex: 'method', align: 'left', width: 200 },
|
||||
{ title: '完成状态', dataIndex: 'completionStatus_dictText', align: 'center', width: 100 },
|
||||
{ title: '是否有报送上级报告', dataIndex: 'isReportedToHigher_dictText', align: 'center', width: 140 },
|
||||
{ title: '进展情况', dataIndex: 'progress', align: 'left', width: 200 },
|
||||
@@ -435,6 +437,10 @@
|
||||
|
||||
watch([() => props.formData?.dataId, () => processInfo.value.processInstanceId], () => initFormData());
|
||||
|
||||
watch(showDeptFeedback, () => {
|
||||
loadFeedbackList();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.formData?.vars?.isEnd,
|
||||
(value) => {
|
||||
@@ -465,6 +471,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
function getCurrentUserDeptId() {
|
||||
const userInfo = (userStore.getUserInfo || {}) as Record<string, any>;
|
||||
const loginInfo = (userStore.getLoginInfo || {}) as Record<string, any>;
|
||||
const departs = Array.isArray(loginInfo.departs) ? loginInfo.departs : [];
|
||||
if (userInfo.orgCode) {
|
||||
const dept = departs.find((item: any) => item.orgCode === userInfo.orgCode);
|
||||
return dept?.id || '';
|
||||
}
|
||||
return departs.length === 1 ? departs[0]?.id || '' : '';
|
||||
}
|
||||
|
||||
async function loadFeedbackList() {
|
||||
const bpmProcessId = processInfo.value.processInstanceId;
|
||||
if (!mainForm.id || !bpmProcessId) {
|
||||
@@ -473,7 +490,17 @@
|
||||
}
|
||||
const apiFn = showDeptFeedback.value ? bgXiSpeakFeedbackListWithDept : bgXiSpeakFeedbackList;
|
||||
const res = await apiFn({ mainId: mainForm.id, bpmProcessId, pageNo: 1, pageSize: 999 });
|
||||
feedbackList.value = res?.records || res?.result?.records || [];
|
||||
let list = res?.records || res?.result?.records || [];
|
||||
if (list.length && showDeptFeedback.value) {
|
||||
const deptId = getCurrentUserDeptId();
|
||||
if (deptId) {
|
||||
list = list.filter((item: any) => {
|
||||
const deptIds = String(item.responDeptid || '').split(',').map((s: string) => s.trim());
|
||||
return deptIds.includes(String(deptId));
|
||||
});
|
||||
}
|
||||
}
|
||||
feedbackList.value = list;
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<a-divider orientation="left" plain>措施信息</a-divider>
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="措施内容" name="method">
|
||||
<a-form-item label="具体措施" name="method">
|
||||
<a-textarea v-model:value="formData.method" placeholder="请输入措施内容" :rows="3" allow-clear></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
Reference in New Issue
Block a user