Procházet zdrojové kódy

Merge branch 'question-alert' into 'dev'

Question alert

See merge request skyeye/skyeye_frontend/skyeye-admin!37
航飞 楼 před 1 rokem
rodič
revize
398889b388

+ 51 - 0
src/api/datamanagement/alert-default.ts

@@ -48,3 +48,54 @@ export const updateDefaultTableData = (body: UpdateList) => {
     data: body,
   });
 };
+
+// 隐藏问题单
+export interface UpdateHide {
+  id: Number,     // 问题单id
+  hide: Boolean,  // 是否隐藏
+};
+export const updateDefaultHide = (body: UpdateHide) => {
+  return http.request({
+    url: '/issue/hide',
+    method: 'post',
+    data: body,
+  })
+};
+// 批量隐藏问题单
+export interface UpdateHides {
+  ids: Number[],     // 问题单id
+  hide: Boolean,  // 是否隐藏
+};
+export const updateDefaultHideAll = (body: UpdateHides) => {
+  return http.request({
+    url: '/issue/hide/batch',
+    method: 'post',
+    data: body,
+  })
+};
+
+// 调整问题单优先级
+export interface UpdatePriority {
+  id: Number,        // 问题单id
+  priority: Number,  // 是否加急 0-未加急,1-加急
+};
+export const updateDefaultPriority = (body: UpdatePriority) => {
+  return http.request({
+    url: '/issue/priority',
+    method: 'post',
+    data: body,
+  })
+};
+
+// 批量调整问题单优先级
+export interface UpdatePrioritys {
+  ids: Number[],        // 问题单id
+  priority: Number,  // 是否加急 0-未加急,1-加急
+};
+export const updateDefaultPriorityAll = (body: UpdatePrioritys) => {
+  return http.request({
+    url: '/issue/priority/batch',
+    method: 'post',
+    data: body,
+  })
+};

+ 4 - 3
src/views/datamanager/alertformdata/components/common/AlertTable.vue

@@ -114,9 +114,10 @@ const getSplicedDes = (val) => {
 
 const colorOfState = ({ row, columnIndex }) => {
   if (columnIndex === 7) {
-    if (row.issueState === 4) return { color: "#FF4D4F" };
-    else if (row.issueState === 5) return { color: "#52C41A " };
-    else return { color: "#1890FF " };
+    if (row.issueState === 4 || row.issueState === 6) return { color: "#FF4D4F" };         // 待处理
+    else if (row.issueState === 7 || row.issueState === 8) return { color: "#52C41A " };   // 已处理
+    else if (row.issueState === 3) return { color: "#cdca00" };        // 已撤销
+    else return { color: "#1890FF " };    // 待审核,待复核
   };
   if (row.isHide) {
     return { color: "#A8ABB2" };

+ 20 - 17
src/views/datamanager/alertformdata/components/default/Default.vue

@@ -44,9 +44,12 @@ import { useIssueType } from '../../hooks/useIssueType';
 import { useWorkLocation } from '../../hooks/useWorkLocation';
 import {
   getDefaultTableData,
-  updateDefaultTableData,
   deleteDefaultTableData,
-  copyToShowTableData
+  copyToShowTableData,
+  updateDefaultHide,
+  updateDefaultHideAll,
+  updateDefaultPriority,
+  updateDefaultPriorityAll
 } from '@/api/datamanagement/alert-default';
 import { useUserStore } from '@/store/modules/user';
 
@@ -117,10 +120,10 @@ const handleSelectNone = () => {
 const handleHideAll = () => {
   if (showActionBar.value) isActiveHide.value = !isActiveHide.value;
   const updateList = {
-    id: chooseId.value,
-    isHide: true,
+    ids: chooseId.value,
+    hide: true,
   };
-  updateDefaultTableData(updateList).then(() => {
+  updateDefaultHideAll(updateList).then(() => {
     handleSelectNone();
     getTableData();
     ElMessage({
@@ -137,10 +140,10 @@ const handleHideAll = () => {
 const handleCancelHideAll = () => {
   if (showActionBar.value) isActiveCancelHide.value = !isActiveCancelHide.value;
   const updateList = {
-    id: chooseId.value,
-    isHide: false,
+    ids: chooseId.value,
+    hide: false,
   };
-  updateDefaultTableData(updateList).then(() => {
+  updateDefaultHideAll(updateList).then(() => {
     handleSelectNone();
     getTableData();
     ElMessage({
@@ -191,10 +194,10 @@ const handleDeleteAll = () => {
 const handleUrgentAll = () => {
   if (showActionBar.value) isActiveUrgent.value = !isActiveUrgent.value;
   const updateList = {
-    id: chooseId.value,
+    ids: chooseId.value,
     priority: 1,
   };
-  updateDefaultTableData(updateList).then(() => {
+  updateDefaultPriorityAll(updateList).then(() => {
     handleSelectNone();
     getTableData();
     ElMessage({
@@ -211,10 +214,10 @@ const handleUrgentAll = () => {
 const handleCancelUrgentAll = () => {
   if (showActionBar.value) isActiveCancelUrgent.value = !isActiveCancelUrgent.value;
   const updateList = {
-    id: chooseId.value,
+    ids: chooseId.value,
     priority: 0,
   };
-  updateDefaultTableData(updateList).then(() => {
+  updateDefaultPriorityAll(updateList).then(() => {
     handleSelectNone();
     getTableData();
     ElMessage({
@@ -256,10 +259,10 @@ const handleDetail = (row) => {
 const handleUrgent = (row) => {
   const tempPriority = row.priority === 0 ? 1 : 0;
   const updateList = {
-    id: [row.id],
+    id: row.id,
     priority: tempPriority,
   };
-  updateDefaultTableData(updateList).then(() => {
+  updateDefaultPriority(updateList).then(() => {
     getTableData();
   });
 };
@@ -268,10 +271,10 @@ const handleUrgent = (row) => {
 const handleShow = (row) => {
   const tempHide = row.isHide === false ? true : false;
   const updateList = {
-    id: [row.id],
-    isHide: tempHide,
+    id: row.id,
+    hide: tempHide,
   };
-  updateDefaultTableData(updateList).then(() => {
+  updateDefaultHide(updateList).then(() => {
     getTableData();
   });
 };