Browse Source

fix:消息管理优化

liziliang 12 giờ trước cách đây
mục cha
commit
5f38da8014
1 tập tin đã thay đổi với 22 bổ sung1 xóa
  1. 22 1
      src/views/messages/index.vue

+ 22 - 1
src/views/messages/index.vue

@@ -219,6 +219,7 @@ option.value = Object.assign(option.value, {
     {
     {
       label: "发送部门",
       label: "发送部门",
       prop: "deptIds",
       prop: "deptIds",
+      overHidden: true,
       type: "tree",
       type: "tree",
       dicData: deptList, // 使用树形结构数据
       dicData: deptList, // 使用树形结构数据
       props: {
       props: {
@@ -230,18 +231,26 @@ option.value = Object.assign(option.value, {
       showCheckbox: true, // 显示复选框
       showCheckbox: true, // 显示复选框
       search: true,
       search: true,
       valueformat: "array", // 确保值是数组格式
       valueformat: "array", // 确保值是数组格式
+      // nodeKey: "id",
+      // formatter: (row) => {
+      //   if (!row.deptIds) return "";
+      //   return row.deptIds.map(id => {
+      //     const dept = findDeptById(deptList.value, id);
+      //     return dept ? dept.deptName : id;
+      //   }).join(", ");
+      // }
     },
     },
     {
     {
       label: "消息组织",
       label: "消息组织",
       prop: "messageOrgIds",
       prop: "messageOrgIds",
       type: "select",
       type: "select",
       dicData: messageOrgList, // 组织列表
       dicData: messageOrgList, // 组织列表
+      overHidden: true,
       props: {
       props: {
         label: "messageOrgName",
         label: "messageOrgName",
         value: "id",
         value: "id",
       },
       },
       multiple: true, // 支持多选
       multiple: true, // 支持多选
-      hide: true,
     },
     },
     {
     {
       label: "消息内容",
       label: "消息内容",
@@ -278,6 +287,17 @@ option.value = Object.assign(option.value, {
   ],
   ],
 });
 });
 
 
+// const findDeptById = (nodes, id) => {
+//   // 递归查找部门
+//     for (const node of nodes) {
+//       if (node.id === id) return node;
+//       if (node.children) {
+//         const found = findDeptById(node.children, id);
+//         if (found) return found;
+//       }
+//     }
+//     return null;
+// };
 const onSelectedFinish = (selectedRowIds) => {
 const onSelectedFinish = (selectedRowIds) => {
   form.value.receiveUsers = selectedRowIds;
   form.value.receiveUsers = selectedRowIds;
   console.log(selectedRowIds, form.value);
   console.log(selectedRowIds, form.value);
@@ -296,6 +316,7 @@ onMounted(() => {
     }
     }
     if (item.prop === "receiveUsers") {
     if (item.prop === "receiveUsers") {
       item.addDisplay = messageType.value === "0";
       item.addDisplay = messageType.value === "0";
+      item.editDisplay = messageType.value === "0";
     }
     }
     if (item.prop === "deptIds") {
     if (item.prop === "deptIds") {
       item.viewDisplay = false;
       item.viewDisplay = false;