Jelajahi Sumber

默认消息类型

qinhb 11 bulan lalu
induk
melakukan
31cb034d68
2 mengubah file dengan 16 tambahan dan 5 penghapusan
  1. 4 2
      src/views/system/logs/index.vue
  2. 12 3
      src/views/system/message/index.vue

+ 4 - 2
src/views/system/logs/index.vue

@@ -309,7 +309,8 @@ const handleLoginQuery = (params: any, done: any) => {
   const querySearch = {
     pageSize: pageLogin.value.pageSize,
     pageNo: pageLogin.value.currentPage,
-    ...params,
+    state: searchLogin.value.state === '' ? null : searchLogin.value.state,
+    creator: searchLogin.value.creator === '' ? null : searchLogin.value.creator,
   };
   getLoginLogPage(querySearch)
     .then(({ data }) => {
@@ -371,7 +372,8 @@ const handleOperQuery = (params: any, done: any) => {
   const querySearch = {
     pageSize: page.value.pageSize,
     pageNo: page.value.currentPage,
-    ...params,
+    creator: search.value.creator === '' ? null : search.value.creator,
+    operatorType: search.value.operatorType === '' ? null : search.value.operatorType,
   };
   getOperaLogPage(querySearch)
     .then(({ data }) => {

+ 12 - 3
src/views/system/message/index.vue

@@ -40,9 +40,17 @@
             link
             v-if="row.state === '0'"
             size="small"
-            @click="handleSend(row,0)"
+            @click="handleSend(row,1)"
         ><i-ep-edit />发送
         </el-button>
+        <el-button
+            type="primary"
+            link
+            v-if="row.state === '1'"
+            size="small"
+            @click="handleSend(row,0)"
+        ><i-ep-edit />撤销
+        </el-button>
       </template>
     </avue-crud>
     <el-dialog
@@ -171,13 +179,14 @@ const handleEdit =(row,index)=>{
   dialog.visible = true
 }
 const handleSend =(row,index)=>{
-  ElMessageBox.confirm("确定要发送吗?", "提示", {
+  let msg = index === 0 ? '撤销' : '发送'
+  ElMessageBox.confirm("确定要"+msg+"吗?", "提示", {
     confirmButtonText: "确定",
     cancelButtonText: "取消",
     type: "warning",
     lockScroll: false,
   }).then(() => {
-    row.state = 1
+    row.state = index
     updateMessage(row).then((data)=>{
       if(data.code === '200'){
         ElMessage.success(data.msg)