Browse Source

feat: 初步完成所有功能,待拆出新目录

kuanghua liu 1 year ago
parent
commit
a64dee5a44

+ 6 - 1
src/views/message/questionNotifications/components/ManageContent.vue

@@ -101,7 +101,12 @@
           isEnabled: 1,
           overtime: obj.longTimeValue!,
           pushType: PushTypeStatus.longtime,
-          ccRecipients: obj.copyTo,
+          //只传obj.copyTo中的id
+          ccRecipients: obj.copyTo!.map((user) => ({
+            id: user.id,
+            realname: user.realname,
+            staffNo: user.staffNo,
+          })),
         });
       }
     }

+ 73 - 43
src/views/message/questionNotifications/components/contentPanel.vue

@@ -2,7 +2,7 @@
   <div class="content_panel" style="margin-right: 40px">
     <div class="panel_top">
       <div class="top_content">
-        <div class="circle">1</div>
+        <div class="circle">{{ props.issueType }}</div>
         <div class="title_name">问题{{ props.title }}阶段</div>
         <div class="title_explain">问题{{ props.title }}阶段</div>
       </div>
@@ -89,8 +89,9 @@
       }}员并抄送给<el-select
         :disabled="!editDetails.openEdit || !editDetails.atLongTimeExpiry"
         v-model="editDetails.copyTo"
-        value-key="realname"
+        value-key="id"
         @click="openNameTree"
+        @change="openNameTree"
         placeholder="Select"
         size="small"
         style="width: 105px"
@@ -99,18 +100,26 @@
         collapse-tags-tooltip
       >
         <el-option
-          v-for="item in directors"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
+          v-for="item in editDetails.copyTo"
+          :key="item.id"
+          :label="item.realname"
+          :value="item"
         /> </el-select
     ></div>
     <div class="subtitle">推送文案 </div>
-    <el-input
-      :disabled="!editDetails.openEdit"
-      v-model="editDetails.textToPush"
-      style="width: 364px; margin-left: 30px; margin-top: 4px"
-    />
+    <el-tooltip
+      class="box-item"
+      effect="dark"
+      :disabled="!showToolTip"
+      :content="editDetails.textToPush"
+      placement="bottom"
+    >
+      <el-input
+        disabled
+        style="width: 364px; margin-left: 30px; margin-top: 4px"
+        :placeholder="textToshow"
+      />
+    </el-tooltip>
   </div>
   <el-dialog
     v-model="dialogVisible"
@@ -133,8 +142,9 @@
 <script lang="ts" setup>
   import { panelDetails, QuestionStatus, issueDetilasType, PushTypeStatus } from '../type';
   import { EditPen } from '@element-plus/icons-vue';
-  import { ref, watch } from 'vue';
+  import { ref, watch, computed } from 'vue';
   import { SelectedFilterPersonInfo } from '@/api/message/person-group';
+  import PersonFilterSelection from '@/views/message/components/PersonFilterSelection.vue';
 
   const props = defineProps<{
     savedData: Array<issueDetilasType>;
@@ -143,30 +153,6 @@
     saveUpdate: (data: panelDetails, issueType: number) => unknown;
   }>();
 
-  watch(
-    () => props.savedData, //监听状态值,,当拉取的数据发生变化时,对editDetails进行赋初值
-    (newValue) => {
-      //问题审核阶段,后端拉取保存数据
-      let subData = newValue.find((item) => item.issuePhase === props.issueType);
-      let atonceData = subData?.issueProcessMessageList.find(
-        (item) => item.pushType === PushTypeStatus.atonce,
-      );
-      editDetails.value.atProcessing = atonceData?.isEnabled === 1 ? true : false;
-      let expireData = subData?.issueProcessMessageList.find(
-        (item) => item.pushType === PushTypeStatus.expire,
-      );
-      editDetails.value.atExpiry = expireData?.isEnabled === 1 ? true : false;
-      editDetails.value.expiryTime = expireData!.overtime;
-      let longTimeData = subData?.issueProcessMessageList.find(
-        (item) => item.pushType === PushTypeStatus.longtime,
-      );
-      editDetails.value.atLongTimeExpiry = longTimeData?.isEnabled === 1 ? true : false;
-      editDetails.value.longTimeValue = longTimeData!.overtime;
-      editDetails.value.copyTo = longTimeData!.ccRecipients;
-    },
-    { deep: true, immediate: true }, //deep,深度监听。immediate,在程序开始运行时即马上监听
-  );
-
   const editDetails = ref<panelDetails>({
     atProcessing: false,
     atExpiry: false,
@@ -174,9 +160,24 @@
     expiryTime: 0,
     longTimeValue: 0,
     copyTo: [],
-    textToPush: '',
+    textToPush: '您有一条【待审核/超期未审核/长期未审核】的问题单,请及时关注并整改',
     openEdit: false,
   });
+
+  const textToshow = computed(() => {
+    if (editDetails.value.textToPush.length > 24) {
+      return editDetails.value.textToPush.slice(0, 24) + '...';
+    } else {
+      return editDetails.value.textToPush;
+    }
+  });
+  const showToolTip = computed(() => {
+    if (editDetails.value.textToPush.length > 20) {
+      return true;
+    } else {
+      return false;
+    }
+  });
   const openQuestionEdit = () => {
     editDetails.value.openEdit = true;
   };
@@ -185,12 +186,6 @@
     editDetails.value.openEdit = false;
   };
 
-  const directors = [
-    {
-      value: '陆顶',
-      label: '陆顶',
-    },
-  ];
   const dialogVisible = ref<boolean>(false);
   const selectedUser = ref<SelectedFilterPersonInfo[]>([]);
 
@@ -207,6 +202,41 @@
   const handleCancle = () => {
     dialogVisible.value = false;
   };
+  watch(
+    () => props.savedData, //监听状态值,,当拉取的数据发生变化时,对editDetails进行赋初值
+    (newValue) => {
+      //问题审核阶段,后端拉取保存数据
+      // console.log('props.savedData=', newValue);
+      let subData = newValue.find((item) => item.issuePhase === props.issueType);
+      let atonceData = subData?.issueProcessMessageList.find(
+        (item) => item.pushType === PushTypeStatus.atonce,
+      );
+      editDetails.value.atProcessing = atonceData?.isEnabled === 1 ? true : false;
+      //完成阶段不需要执行下面的内容
+      if (props.issueType != QuestionStatus.finishe) {
+        let expireData = subData?.issueProcessMessageList.find(
+          (item) => item.pushType === PushTypeStatus.expire,
+        );
+        console.log('expireData=', expireData);
+        editDetails.value.atExpiry = expireData?.isEnabled === 1 ? true : false;
+        if (expireData && expireData!.overtime) {
+          editDetails.value.expiryTime = expireData!.overtime;
+        }
+        // editDetails.value.expiryTime = expireData!.overtime;
+        let longTimeData = subData?.issueProcessMessageList.find(
+          (item) => item.pushType === PushTypeStatus.longtime,
+        );
+        editDetails.value.atLongTimeExpiry = longTimeData?.isEnabled === 1 ? true : false;
+        if (longTimeData && longTimeData!.overtime) {
+          editDetails.value.longTimeValue = longTimeData!.overtime;
+        }
+        if (longTimeData && longTimeData!.ccRecipients) {
+          editDetails.value.copyTo = longTimeData!.ccRecipients;
+        }
+      }
+    },
+    { deep: true, immediate: true }, //deep,深度监听。immediate,在程序开始运行时即马上监听
+  );
 </script>
 <style lang="scss" scoped>
   .content_panel {

+ 9 - 7
src/views/message/questionNotifications/components/problemHandleTable.vue

@@ -76,7 +76,7 @@
   </div>
 </template>
 <script lang="ts" setup>
-  import { ref, onMounted, nextTick } from 'vue';
+  import { ref, onMounted, computed } from 'vue';
   import {
     queryIssueProcessMessage,
     modifyContent,
@@ -92,12 +92,14 @@
 
   const cameraChosen = ref<any>([]);
 
-  const options = [
-    {
-      value: 'Option1',
-      label: 'Option1',
-    },
-  ];
+  const options = computed(() => {
+    return cameraChosen.value.map((item: any) => {
+      return {
+        value: item,
+        label: item,
+      };
+    });
+  });
 
   const setCameraChosen = (arr: treeSelected[]) => {
     cameraChosen.value = arr.map((arr) => arr.name);

+ 47 - 47
src/views/message/systemNotifications/systemNotifications.vue

@@ -25,59 +25,59 @@
 </template>
 
 <script lang="ts" setup>
-import { ref } from 'vue';
-import systemNotificationTable from './components/systemNotificationTable.vue';
-import problemHandleTable from './components/problemHandleTable.vue';
+  import { ref } from 'vue';
+  import systemNotificationTable from './components/systemNotificationTable.vue';
+  import problemHandleTable from '../questionNotifications/components/problemHandleTable.vue';
 
-enum notificationType {
-  system,
-  problemHandle,
-}
-const currentNotification = ref(notificationType.system);
+  enum notificationType {
+    system,
+    problemHandle,
+  }
+  const currentNotification = ref(notificationType.system);
 
-const changeNotification = (notificationType: notificationType) => {
-  currentNotification.value = notificationType;
-};
+  const changeNotification = (notificationType: notificationType) => {
+    currentNotification.value = notificationType;
+  };
 </script>
 
 <style lang="scss" scoped>
-.notificationPage {
-  height: calc(100vh - 64px - 18px);
-  background-color: rgba(255, 255, 255, 1);
-  padding: 24px 44px 35px 21px;
-  position: relative;
-}
+  .notificationPage {
+    height: calc(100vh - 64px - 18px);
+    background-color: rgba(255, 255, 255, 1);
+    padding: 24px 44px 35px 21px;
+    position: relative;
+  }
 
-.notificationSelectionBar {
-  display: flex;
-  width: 376px;
-  height: 38px;
-  border: 1px solid #d9d9d9;
-  background: rgba(0, 0, 0, 0.02);
-  margin-bottom: 24px;
-  cursor: pointer;
-  border-radius: 4px;
-  .notification {
-    width: 50%;
+  .notificationSelectionBar {
+    display: flex;
+    width: 376px;
+    height: 38px;
+    border: 1px solid #d9d9d9;
     background: rgba(0, 0, 0, 0.02);
-    line-height: 36px;
-    text-align: center;
-  }
-  .snotificationSelected {
-    width: 50%;
-    outline: 1px solid #1890ff;
-    background: rgba(24, 144, 255, 0.15);
-    line-height: 36px;
-    text-align: center;
-    border-radius: 4px 0 0 4px;
-  }
-  .pnotificationSelected {
-    width: 50%;
-    outline: 1px solid #1890ff;
-    background: rgba(24, 144, 255, 0.15);
-    line-height: 36px;
-    text-align: center;
-    border-radius: 0 4px 4px 0;
+    margin-bottom: 24px;
+    cursor: pointer;
+    border-radius: 4px;
+    .notification {
+      width: 50%;
+      background: rgba(0, 0, 0, 0.02);
+      line-height: 36px;
+      text-align: center;
+    }
+    .snotificationSelected {
+      width: 50%;
+      outline: 1px solid #1890ff;
+      background: rgba(24, 144, 255, 0.15);
+      line-height: 36px;
+      text-align: center;
+      border-radius: 4px 0 0 4px;
+    }
+    .pnotificationSelected {
+      width: 50%;
+      outline: 1px solid #1890ff;
+      background: rgba(24, 144, 255, 0.15);
+      line-height: 36px;
+      text-align: center;
+      border-radius: 0 4px 4px 0;
+    }
   }
-}
 </style>