Browse Source

电签角色库修改

duy 2 tháng trước cách đây
mục cha
commit
5bc6b1b704
2 tập tin đã thay đổi với 111 bổ sung8 xóa
  1. 18 0
      src/api/sigital/signer.js
  2. 93 8
      src/views/digital/signer.vue

+ 18 - 0
src/api/sigital/signer.js

@@ -71,3 +71,21 @@ export const elementDetail= (params) => {
         params
     })
 }
+//删除
+export const removeEle = (data) => {
+    return request({
+        url: '/api/blade-manager/signConfig/remove',
+        method: 'post',
+        params:data
+    });
+}
+
+
+//启用
+export const updateStatusEle = (data) => {
+    return request({
+        url: '/api//blade-manager/signConfig/updateStatus',
+        method: 'post',
+        params:data
+    });
+}

+ 93 - 8
src/views/digital/signer.vue

@@ -47,12 +47,13 @@
                            
                             <el-button type="primary" size="small" @click="addEleClick">新增</el-button>
                             <el-button type="info" size="small">编辑</el-button>
-                            <el-button type="success" size="small">启用</el-button>
-                            <el-button type="warning" size="small">停用</el-button>
-                            <el-button type="danger" size="small">删除</el-button>
+                            <el-button type="success" size="small"  @click="openClick(row,1)" :loading="openLoading">启用</el-button>
+                            <el-button type="warning" size="small"  @click="openClick(row,0)" :loading="closeLoading">停用</el-button>
+                            <el-button type="danger" size="small" @click="rowDel(row)" :loading="removeLoad">删除</el-button>
                         </div>
                         <div class="table-box">
                             <el-table
+                                v-loading="tableLoading"
                                 ref="multipleTable"
                                 :data="tableData"
                                 tooltip-effect="dark"
@@ -123,7 +124,7 @@
             width="80%"
             :before-close="handleAddClose">
            <div>
-            <el-table
+            <el-table 
                                 :data="tableData1"
                                 style="width: 100%"
                               >
@@ -318,7 +319,7 @@
 </template>
 
 <script>
-  import {getRoleList,getListPage,getElementList,getTableTypeList,getTableList,queryAllRoleList,submitEle,elementDetail} from "@/api/sigital/signer.js";
+  import {getRoleList,getListPage,getElementList,getTableTypeList,getTableList,queryAllRoleList,submitEle,elementDetail,removeEle,updateStatusEle} from "@/api/sigital/signer.js";
   import { getDictionary } from "@/api/system/dict";
     export default {
         data() {
@@ -329,16 +330,22 @@
                 roleListLoading:false,
                 multipleTable:null,
                 tableData: [],
+                tableLoading: false,
+
                 selectedItem: {
                     id: '',
                 },
+                removeLoad:false,
+                openLoading:false,
+                closeLoading:false,
+
                 currentPage: 1,
                 pageSize: 10,
                 total: 0,
 
                 addDialogVisible: false,
                 saveBatchLoading: false,
-
+                checkedList: [],
                 tableData1: [{}],
                 eleOptions: [
                   
@@ -410,6 +417,8 @@
                  
                 }
             },
+        
+        
     
 
         },
@@ -422,7 +431,7 @@
               this.getRoleData();
             },
             handleSelectionChange(val) {
-                
+                this.checkedList=val
             },
             //获取岗位列表
             getRoleData() {
@@ -444,6 +453,7 @@
                 this.selectedItem = item; 
             },
             getTableData() {
+                this.$refs.multipleTable.clearSelection();
                 this.tableLoading = true;
                 getListPage({
                     size: this.pageSize,
@@ -472,6 +482,44 @@
             addEleClick() {
                 this.addDialogVisible = true;
             },
+            //启用
+            openClick(row,type){
+                if(type==1){
+                    this.openLoading=true;
+                }else{
+                    this.closeLoading=true;
+                }
+                let ids = '';
+                if (this.checkedList.length > 0) {
+                    ids = this.checkedList.map(item => item.id).join(',');
+                }
+                updateStatusEle({
+                    ids: ids,
+                    status: type
+                })                
+                .then(res => {
+                    if(res.data.code==200){
+                        this.$message({
+                            type: 'success',
+                            message: '操作成功!'
+                        });
+                        this.getTableData();
+                    }else{
+                        this.$message({
+                            type: 'error',
+                            message: res.data.msg
+                        });
+                    }
+                }).finally(() => {
+                    if(type==1){
+                        this.openLoading=false;
+                    }else{
+                        this.closeLoading=false;
+                    }
+                });
+            },
+            
+
             handleAddClose(){
                 this.addDialogVisible = false;
             },
@@ -514,6 +562,42 @@
                 this.tableData1.splice(index, 1);
                 // 删除操作的逻辑
             },
+            rowDel() {
+                let ids=''
+                if (this.checkedList.length > 0) {
+                    ids = this.checkedList.map(item => item.id).join(',');
+                }
+                let _that = this;
+                this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                })
+                    .then(() => {
+                    _that.remove({ ids });
+                    })
+                    .catch(() => {
+                    this.$message({
+                        type: "info",
+                        message: "已取消删除",
+                    });
+                    })
+            },
+            async remove(ids) {
+                this.removeLoad = true;
+                removeEle(ids).then(res => {
+                    this.removeLoad = false;
+                    if (res.code == 200) {
+                        this.$message({
+                            type: "success",
+                            message: "删除成功!",
+                        });
+                        this.getTableData();
+                    }
+                }).finally(() => {
+                    this.removeLoad = false;
+                });
+            },
             changeEleType(value,row) {
                 const selectedItem = this.eleOptions.find(item => item.value === value);
                     if (selectedItem && selectedItem.etype != null) {
@@ -535,10 +619,11 @@
                     this.eleCheckRow = row;
                     this.eleIndex=index
                     this.selectedSourceOption=0
-                    this.sourceDialogVisible = true;
+                   
                     this.getElementCategoryOptions();
                    
                 }
+                this.sourceDialogVisible = true;