From b012ab3a1e5495be068c543eb8f0482124db13b5 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 31 十二月 2022 16:48:22 +0800
Subject: [PATCH] 1.登录页文字跟随系统变化

---
 src/views/sbgl/djbz.vue |  206 ++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 145 insertions(+), 61 deletions(-)

diff --git a/src/views/sbgl/djbz.vue b/src/views/sbgl/djbz.vue
index 8dc73b3..0bf8b9e 100644
--- a/src/views/sbgl/djbz.vue
+++ b/src/views/sbgl/djbz.vue
@@ -10,12 +10,12 @@
         <el-form
           ref="form"
           :model="form"
-          label-width="80px"
+          label-width="100px"
           inline
           style="display: flex;justify-content: space-between"
         >
           <div class="elForm">
-            <el-form-item label="鏍囧噯缂栫爜" style=" display: flex;">
+            <el-form-item label-width="70px" label="鏍囧噯缂栫爜" style=" display: flex;">
               <el-input v-model="form.checkstandcode" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
             <el-form-item label="鏍囧噯鍚嶇О" style=" display: flex;">
@@ -32,18 +32,24 @@
               </el-select>
             </el-form-item>
           </div>
-          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
             <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
             <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
+
+        <div
+          class="bodyTopFormExpand"
+        />
       </div>
 
       <div class="elTableDiv">
         <el-table
+          ref="tableDataRef"
           :data="tableData"
           :height="tableHeight+'px'"
           border
+          class="tableFixed"
           :row-class-name="tableRowClassName"
           :style="{width: 100+'%',height:tableHeight+'px',}"
           highlight-current-row
@@ -64,11 +70,13 @@
           <el-table-column
             prop="code"
             label="鏍囧噯缂栫爜"
+            show-tooltip-when-overflow
             sortable="custom"
           />
           <el-table-column
             prop="name"
             label="鏍囧噯鍚嶇О"
+            show-tooltip-when-overflow
             sortable="custom"
           />
 
@@ -87,14 +95,15 @@
             prop="iscontr"
             label="鐐规绠℃帶"
             sortable="custom"
+            show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <div v-if="row.iscontr==='Y'">
-                <svg-icon icon-class="circleYes" style="margin-right: 2px" />
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
                 鏄�
               </div>
               <div v-if="row.iscontr==='N'">
-                <svg-icon icon-class="circleNo" style="margin-right: 2px" />
+                <i class="el-icon-info" style="margin-right: 2px" />
                 鍚�
               </div>
             </template>
@@ -102,10 +111,11 @@
           <el-table-column
             prop="is_checkeqp"
             label="鍏宠仈璁惧"
+            show-tooltip-when-overflow
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <i v-if="row.is_checkeqp==='Y'" class="el-icon-share" @click="checkeqpClick(row)" />
+              <i v-if="row.is_checkeqp==='Y'" :style="{color:$store.state.settings.theme}" class="el-icon-share" @click="checkeqpClick(row)" />
               <i
                 v-if="row.is_checkeqp==='N'"
                 class="el-icon-share"
@@ -118,12 +128,14 @@
             prop="lm_user"
             label="鍒涘缓浜哄憳"
             sortable="custom"
+            show-tooltip-when-overflow
           />
           <el-table-column
             prop="lm_date"
             label="鍒涘缓鏃堕棿"
             width="160"
             sortable="custom"
+            show-tooltip-when-overflow
           />
           <el-table-column
             label="鎿嶄綔"
@@ -133,10 +145,10 @@
             <template slot-scope="{row}">
               <div class="operationClass">
                 <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
-                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+                  <i :style="{color:$store.state.settings.theme}" class="el-icon-edit-outline" @click="edit('edit',row)" />
                 </el-tooltip>
                 <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
-                  <i class="el-icon-delete" @click="del(row)" />
+                  <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
                 </el-tooltip>
               </div>
             </template>
@@ -165,7 +177,7 @@
     >
       <!--      @close="handleClose"-->
       <div>
-        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />璁惧鐐规鏍囧噯淇℃伅锛�
+        <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />璁惧鐐规鏍囧噯淇℃伅锛�
       </div>
       <div style="margin: 0 30px;">
         <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
@@ -196,7 +208,7 @@
         </el-form>
       </div>
       <div>
-        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />璁惧鍏宠仈鐐规椤逛俊鎭細
+        <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />璁惧鍏宠仈鐐规椤逛俊鎭細
       </div>
       <div style="margin-bottom:10px">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="addRow">鏂板</el-button>
@@ -221,6 +233,7 @@
           <el-table-column
             prop="checkitem_code"
             label="鐐规閮ㄤ綅缂栫爜"
+            show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <div v-if="row.isVisible===0">{{ row.checkitem_code }}</div>
@@ -242,6 +255,7 @@
           <el-table-column
             prop="checkitem_name"
             label="鐐规閮ㄤ綅鍚嶇О"
+            show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <div v-if="row.isVisible===0">{{ row.checkitem_name }}</div>
@@ -274,6 +288,7 @@
           <el-table-column
             prop="isscan"
             label="閫夋嫨鎵爜"
+            show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '鏄�' : '鍚�' }}</div>
@@ -294,6 +309,7 @@
           <el-table-column
             prop="cycle"
             label="鐐规鍛ㄦ湡"
+            show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <div v-if="row.isVisible===0">{{ row.cycle === 'D' ? '鏃�' : '' }}</div>
@@ -331,7 +347,12 @@
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
           <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
-          <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+          <el-button
+            type="primary"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            @click="dialogVisibleConfirm"
+          >纭� 瀹�</el-button>
         </div>
       </span>
     </el-dialog>
@@ -350,39 +371,52 @@
       <!--      @opened="handleOpenedRoles"-->
 
       <div>
-        <i class="el-icon-s-comment" style="color:#42b983;" /> 鏍囧噯鍚嶇О锛歿{ dialogFormEqp.name }}
+        <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 鏍囧噯鍚嶇О锛歿{ dialogFormEqp.name }}
       </div>
       <el-divider />
       <div>
         <div style="margin-bottom:20px">
-          <i class="el-icon-s-operation" style="color:#42b983;" /> 璁惧鎵�灞炶溅闂撮泦鍚堬細
+          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 璁惧鎵�灞炶溅闂撮泦鍚堬細
         </div>
         <div class="myCheckboxGroup">
 
           <div
             v-for="item in dialogFormEqp.eqpArr"
             :key="item.code"
-            :style="{border:item.isSelected1?'1px solid #42b983':'1px solid #eee'}"
+            :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}"
             class="myCheckbox"
             @click="myCheckboxClick(item)"
           >
-            <input
-              class="myCheckboxInput"
-              type="checkbox"
-              :value="item.code"
-              :name="item.name"
-              :style="{color:item.isSelected2?'#42b983':'#fff'}"
-              @click="myCheckboxInputClick(item)"
-            >{{ item.name }}
+            <!--            <input-->
+            <!--              class="myCheckboxInput"-->
+            <!--              type="checkbox"-->
+            <!--              :value="item.code"-->
+            <!--              :name="item.name"-->
+            <!--              :style="{color:item.isSelected2?'#42b983':'#fff'}"-->
+            <!--              @click="myCheckboxInputClick(item)"-->
+            <!--            >{{ item.name }}-->
             <!--            鐖跺瓙鐐瑰嚮浜嬩欢涓嶅奖鍝�-->
             <!--            onClick="event.cancelBubble = true"-->
+
+            <el-checkbox
+              :key="item.code"
+              v-model="item.isSelected2"
+              class="myCheckboxInput"
+              :value="item.code"
+              :name="item.name"
+              :checked="item.isSelected2"
+              :label="item.name"
+              @change="myCheckboxInputClick(item)"
+            />
+            <div class="myCheckboxInputLabel">{{ item.name }}</div>
+
           </div>
         </div>
       </div>
       <el-divider />
       <div>
         <div style="margin-bottom:20px">
-          <i class="el-icon-s-operation" style="color:#42b983;" /> 璁惧淇℃伅锛�
+          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 璁惧淇℃伅锛�
         </div>
         <el-tree
           ref="epqTree"
@@ -400,7 +434,12 @@
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
           <el-button @click="eqpDialogVisibleCancel">鍙� 娑�</el-button>
-          <el-button type="primary" @click="eqpDialogVisibleConfirm">纭� 瀹�</el-button>
+          <el-button
+            type="primary"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            @click="eqpDialogVisibleConfirm"
+          >纭� 瀹�</el-button>
         </div>
       </span>
     </el-dialog>
@@ -500,7 +539,7 @@
       },
 
       title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
-      code: '4',
+      code: '22',
       shows: false
 
     }
@@ -655,6 +694,7 @@
     dialogVisibleConfirm() {
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
+          this.$store.state.app.buttonIsDisabled = true
           // this.tableDataDialog.forEach((item, index) => { // 鍘绘帀姝e湪缂栬緫涓旀槸绌篶heckitem_code
           //   if (item.isVisible === 1 && item.checkitem_code === '') {
           //     this.tableDataDialog.splice(index, 1)
@@ -682,9 +722,10 @@
 
           AddUpdateDeviceCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
             if (res.code === '200') {
-              this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
               this.dialogVisible = false
+              this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
               this.getDeviceCheckStandArdSearch()
+              this.$store.state.app.buttonIsDisabled = false
             } else {
               this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
             }
@@ -803,50 +844,66 @@
     getHeight() {
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight - 85
-        this.tableHeight = this.mainHeight - 200
+        this.tableHeight = this.mainHeight - 195
+        this.$refs.tableDataRef.doLayout()
       })
     },
     tableRowClassName({ row, rowIndex }) {
       return 'custom-row'
     },
     // 鍏宠仈璁惧
-    async checkeqpClick(row) {
+    checkeqpClick(row) {
+      const loading = this.$loading({
+        lock: true,
+        text: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+        spinner: 'el-icon-loading',
+        customClass: 'osloading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
       this.dialogFormEqp.name = row.name
       this.dialogFormEqp.code = row.code
 
-      const { data: res } = await DeviceCheckStanedAssociationEqp({ checkstand_code: row.code })
-      this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0)
+      DeviceCheckStanedAssociationEqp({ checkstand_code: row.code }).then(res => {
+        if (res.code === '200') {
+          setTimeout(() => {
+            loading.close()
+            this.dialogFormEqp.eqpAll = res.data.filter(item => item.children.length > 0)
 
-      if (this.dialogFormEqp.eqpAll.length > 0) {
-        this.dialogFormEqp.eqpAll.forEach((item, index) => {
-          this.dialogFormEqp.eqpArr.push({
-            code: item.code,
-            name: item.name,
-            type: item.type,
-            isSelected1: index === 0,
-            isSelected2: item.flag === 'Y'
-          })
-          if (item.flag === 'Y') {
-            this.$nextTick(() => {
-              $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+            if (this.dialogFormEqp.eqpAll.length > 0) {
+              this.dialogFormEqp.eqpAll.forEach((item, index) => {
+                this.dialogFormEqp.eqpArr.push({
+                  code: item.code,
+                  name: item.name,
+                  type: item.type,
+                  isSelected1: index === 0,
+                  isSelected2: item.flag === 'Y'
+                })
+                if (item.flag === 'Y') {
+                  this.$nextTick(() => {
+                    $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+                  })
+                }
+                if (item.children && item.children.length > 0) {
+                  item.children.forEach(it => {
+                    if (it.flag === 'Y') {
+                      this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
+                    }
+                  })
+                }
+              })
+              this.dialogFormEqp.eqpAll[0].name = '鍏ㄩ儴'
+              this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]]
+            }
+
+            this.dialogVisibleEqp = true
+
+            this.$nextTick(() => { // 鏍戝舰鍥炴樉
+              this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
             })
-          }
-          if (item.children && item.children.length > 0) {
-            item.children.forEach(it => {
-              if (it.flag === 'Y') {
-                this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
-              }
-            })
-          }
-        })
-        this.dialogFormEqp.eqpAll[0].name = '鍏ㄩ儴'
-        this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]]
-      }
-
-      this.dialogVisibleEqp = true
-
-      this.$nextTick(() => { // 鏍戝舰鍥炴樉
-        this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
+          }, 1000)
+        } else {
+          loading.close()
+        }
       })
     },
     // 鍏宠仈璁惧瀵硅瘽妗嗗叧闂�
@@ -875,7 +932,7 @@
     // 灏忕洅瀛愮偣鍑�
     myCheckboxInputClick(val) {
       console.log(val)
-      val.isSelected2 = !val.isSelected2
+      val.isSelected2 = !!val.isSelected2
       if (val.isSelected2) { // 浠庢病閫変腑鍒伴�変腑
         console.log('浠庢病閫変腑鍒伴�変腑')
         this.dialogFormEqp.eqpAll.forEach((item, index) => {
@@ -1006,6 +1063,7 @@
     eqpDialogVisibleConfirm() {
       // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888)
       // this.dialogVisibleEqp = false
+      this.$store.state.app.buttonIsDisabled = true
       const data = []
       this.dialogFormEqp.eqpAll.forEach((item, index) => {
         if (item.children && item.children.length > 0) {
@@ -1022,9 +1080,10 @@
 
       SaveDeviceCheckStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => {
         if (res.code === '200') {
+          this.dialogVisibleEqp = false
           this.$message.success('鍏宠仈鎴愬姛锛�')
           this.getDeviceCheckStandArdSearch()
-          this.dialogVisibleEqp = false
+          this.$store.state.app.buttonIsDisabled = false
         }
       })
     }
@@ -1050,10 +1109,20 @@
       margin: 10px 30px 0 0;
       border-radius: 5px;
       cursor: default;
+      position: relative;
 
       .myCheckboxInput {
         margin: 1px 5px 0 0;
         cursor: pointer;
+      }
+
+      .myCheckboxInputLabel {
+        position: absolute;
+        left: 29px;
+        padding: 5px;
+        top: 6px;
+        color: transparent;
+
       }
 
     }
@@ -1197,9 +1266,24 @@
   align-items: center;
   justify-content: center;
 }
+
+.tableFixed{
+  ::v-deep .el-table__fixed-right{
+    height: 100% !important;
+  }
+  ::v-deep .el-table__fixed{
+    height: 100% !important;
+  }
+}
 </style>
 <style>
+.osloading{
+  font-size: 26px !important;
+}
 
+.el-loading-text{
+  font-size: 26px !important;
+}
 .el-table .custom-row {
   background: #f8f8fa;
 }

--
Gitblit v1.9.3