Jelajahi Sumber

feat(系统管理): 角色编码字段自动生成并禁用编辑,优化表格样式

yusheng 5 bulan lalu
induk
melakukan
a8b3578dd5

+ 5 - 32
src/views/rulesManagement/releaseRules/components/templateDiv/customTable.vue

@@ -360,7 +360,7 @@
         if (item?.colspanKey.length) {
           item.colspanKey.forEach((id) => {
             let { columnIndex } = this.getIndex(id);
-            console.log(columnIndex, 'columnIndex');
+        
 
             this.columns[columnIndex].forEach((cell, rowIndex) => {
               if (cell.colspanKey.length) {
@@ -437,7 +437,7 @@
               );
             }
           } else if (item[rowIndex].rowspan > 1) {
-            //rowspan大于1,代表合并过单元格,需要值继承给下一行
+            //rowspan大于1,代表合并过单元格,需要值继承给下一行
             let data = item[rowIndex];
             data.rowspan--;
             this.$set(this.columns[columnIndex], [rowIndex + 1], data);
@@ -561,19 +561,7 @@
     background-color: #fff;
   }
 
-  .table-header {
-    span {
-      display: inline-block;
-      height: 30px;
-      border: 1px solid #ddd;
-      width: 100px;
-      background-color: #f2f2f2 !important;
-    }
 
-    input {
-      background-color: #f2f2f2 !important;
-    }
-  }
   .table-body {
     white-space: nowrap;
     .column {
@@ -584,29 +572,14 @@
         width: 100%;
       }
       > div:nth-of-type(1) {
-        background-color: #f2f2f2 !important;
+        // background-color: #f2f2f2 !important;
         > input {
-          background-color: #f2f2f2 !important;
+          // background-color: #f2f2f2 !important;
         }
       }
     }
   }
-  // th,
-  // td {
-  //   border: 1px solid #ddd;
-  //   padding: 2px;
-  //   text-align: center;
-  //   height: 30px;
-  // }
-  // th {
-  //   background-color: #f2f2f2;
-  //   > input {
-  //     background-color: #f2f2f2 !important;
-  //   }
-  // }
-  tr:nth-child(even) {
-    background-color: #f9f9f9;
-  }
+
   input:focus {
     border-color: #66afe9; /* 改变边框颜色 */
     outline: none; /* 移除默认的轮廓线 */

+ 8 - 2
src/views/system/role/components/role-edit.vue

@@ -18,7 +18,7 @@
         />
       </el-form-item>
       <el-form-item label="编码:" prop="code">
-        <el-input placeholder=" " v-model="form.code" />
+        <el-input placeholder=" " v-model="form.code" :disabled="true" />
       </el-form-item>
       <el-form-item label="启用状态:" prop="enable">
         <el-switch
@@ -83,6 +83,8 @@
   import { addRole, putRoles } from '@/api/system/role';
   import { listOrganizations } from '@/api/system/organization';
   import { secretLevelList } from '@/enum/dict';
+  import { getCode } from '@/api/codeManagement/index.js';
+
   export default {
     props: {
       // 弹窗是否打开
@@ -100,7 +102,8 @@
         enable: 1,
         dataScope: '',
         dataScopeDeptIds: '',
-        secretLevel: 1,code:''
+        secretLevel: 1,
+        code: ''
       };
       return {
         defaultForm,
@@ -220,6 +223,9 @@
             this.isUpdate = true;
           } else {
             this.isUpdate = false;
+            getCode('role_code').then((res) => {
+              this.$set(this.form, 'code', res);
+            });
           }
         } else {
           this.$refs.form.clearValidate();