Ver código fonte

-破锁管理看板页面

jiangbiao 2 anos atrás
pai
commit
b5ab3993ac
2 arquivos alterados com 38 adições e 38 exclusões
  1. 1 0
      ui/src/assets/icons/svg/key.svg
  2. 37 38
      ui/src/views/apply/lock/lock-eu.vue

+ 1 - 0
ui/src/assets/icons/svg/key.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1678091142606" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6390" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M446.680407 513.704726h136.078739v510.295274h-136.078739z" p-id="6391"></path><path d="M532.410013 666.793308h115.666928v136.07874H532.410013zM532.410013 843.69567h149.686613v136.07874H532.410013zM511.998202 585.146065A290.528109 290.528109 0 0 1 219.428912 292.576775 290.528109 290.528109 0 0 1 511.998202 0.007484a290.528109 290.528109 0 0 1 292.56929 292.569291 290.528109 290.528109 0 0 1-292.56929 292.56929z m0-449.059841A153.768976 153.768976 0 0 0 355.507651 292.576775a153.768976 153.768976 0 0 0 156.490551 156.49055 153.768976 153.768976 0 0 0 156.49055-156.49055A153.768976 153.768976 0 0 0 511.998202 136.086224z" p-id="6392"></path></svg>

+ 37 - 38
ui/src/views/apply/lock/lock-eu.vue

@@ -1,5 +1,10 @@
 <template>
   <div class="app-container" :style="`height:${height}px`" id="parent">
+    <el-row :gutter="10" class="mb8" style="z-index: 10;flex: right">
+      <el-tooltip class="top-right-btn" effect="dark" :content="$t('tagsView.refresh')" placement="top">
+        <el-button size="mini" circle icon="el-icon-refresh" @click="getList" />
+      </el-tooltip>
+    </el-row>
     <vue-draggable-resizable v-drag
                              w="auto" h="auto" :draggable="dragMove" style="background-color:#fff;padding: 0px 20px">
       <div class="zoom" @wheel.prevent="handleTableWheel($event)" ref="branch">
@@ -12,12 +17,12 @@
           </tr>
           <tr v-for="(list) in data">
             <td v-for="(item) in list">
-              <el-button type="text" @click="handleClick,openDialog(item.id)"
+              <el-button type="text" @click="handleClick,openDialog(item.id,item.status)"
                          style="color: #fff;padding: 5px;height: 100%;font-weight: bold"
-                         :class=" item.status==2? 'grey' : (item.status==1 ? 'red':'green')">
-                <i class="el-icon-unlock" v-if="item.status==1"/>
-                <i class="el-icon-circle-close" v-else-if="item.status==2"/>
-                <i class="el-icon-lock" v-else/>
+                         :class=" item.status===2? 'grey' : (item.status===1 ? 'red':'green')">
+                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status===1"/>
+                <i class="el-icon-circle-close" style="font-size: 300%" v-else-if="item.status===2"/>
+                <svg-icon icon-class="key" style="font-size: 300%" v-else/>
                 <br/>
                 <br/>
                 <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
@@ -30,18 +35,31 @@
         </table>
       </div>
     </vue-draggable-resizable>
-    <el-dialog :visible.sync="visible">
-      <el-button type="info" round @click="changeColor(1)">状态1</el-button>
-      <el-button type="danger" round @click="changeColor(2)">状态2</el-button>
-      <el-button type="warning" round @click="changeColor(3)">状态3</el-button>
-      <el-button type="success" round @click="changeColor(4)">状态4</el-button>
+    <el-dialog :visible.sync="visible" title="锁详情">
+      <el-descriptions class="margin-top" :column="3" size="medium" border>
+        <el-descriptions-item>
+          <template slot="label">
+            <i style="font-size: 100%" class="el-icon-edit"></i>
+            修改锁状态
+          </template>
+          <el-button :disabled="status==0" size="medium" type="success" plain round @click="changeColor(0)">挂锁
+          </el-button>
+          <el-button :disabled="status==1" size="medium" type="danger" plain round @click="changeColor(1)">拆锁
+          </el-button>
+          <el-button :disabled="status==2" size="medium" type="info" plain round @click="changeColor(2)">删除
+          </el-button>
+        </el-descriptions-item>
+      </el-descriptions>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="visible = false">返 回</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import VueDraggableResizable from 'vue-draggable-resizable'
-import {listAllLock} from "@/api/apply/lock";
+import {listAllLock, updateLock} from "@/api/apply/lock";
 
 export default {
   components: {VueDraggableResizable},
@@ -84,6 +102,7 @@ export default {
       dragMove: true,
       drawer: false,
       data: [],
+      status: 0,
       index: null,
       loading: true,
       visible: false,
@@ -143,7 +162,6 @@ export default {
     },
     handleClick() {
       setTimeout(function () {
-
         // 点击事件触发时,判断当前状态是拖拽还是点击,若是拖拽,直接返回不继续执行
         const isDrag = document.getElementById('parent').getAttribute('drag-flag')
         if (isDrag == 'true') {
@@ -165,7 +183,7 @@ export default {
       }
       return false
     },
-    openDialog(index) {
+    openDialog(index, status) {
       // 点击事件触发时,判断当前状态是拖拽还是点击,若是拖拽,直接返回不继续执行
       const isDrag = document.getElementById('parent').getAttribute('drag-flag')
       if (isDrag === 'true') {
@@ -173,33 +191,14 @@ export default {
       }
       this.visible = true;
       this.index = index
+      this.status = status
     },
     changeColor(type) {
-      let index = this.index
-      let flag;
-      if (this.status1.includes(index))
-        this.status1.splice(this.status1.indexOf(index), 1);
-      if (this.status2.includes(index))
-        this.status2.splice(this.status2.indexOf(index), 1);
-      if (this.status3.includes(index))
-        this.status3.splice(this.status3.indexOf(index), 1);
-      if (this.status4.includes(index))
-        this.status4.splice(this.status4.indexOf(index), 1);
-      switch (type) {
-        case 1:
-          this.status1.push(index)
-          break;
-        case 2:
-          this.status2.push(index)
-          break;
-        case 3:
-          this.status3.push(index)
-          break;
-        case 4:
-          this.status4.push(index)
-          break;
-      }
-      this.visible = false;
+      updateLock({id: this.index, status: type}).then(response => {
+        this.msgSuccess("修改成功");
+        this.visible = false;
+        this.getList();
+      });
     }
   }
 }