Эх сурвалжийг харах

Merge branch 'master' of http://120.26.64.82:3000/BFFE/CABaggageData2.0

zhongxiaoyu 3 жил өмнө
parent
commit
df1eb1fc78

+ 34 - 10
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,8 +1,13 @@
 <template>
   <div v-if="!item.hidden">
-    <template v-if="hasOneShowingChild(item.children, item) && !item.alwaysShow">
+    <template
+      v-if="hasOneShowingChild(item.children, item) && !item.alwaysShow"
+    >
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
+        <el-menu-item
+          :index="resolvePath(onlyOneChild.path)"
+          :class="{ 'submenu-title-noDropdown': !isNest }"
+        >
           <!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> -->
           <!-- <item :icon="onlyOneChild.meta.title||(item.meta&&item.meta.title)"/> -->
           <!-- <el-tooltip
@@ -14,8 +19,22 @@
           <!-- <img class="nav_item" :src="onlyOneChild.meta.imger" /> -->
           <!-- <span class="pathName" :class="getClass(item.path)"></span>
           </el-tooltip> -->
-          <span class="pathName" v-if="!leup" :class="getClass(item.path)"></span>
-          <span class="pathNamecosy" v-if="leup" :class="getClass(item.path)"></span>
+          <el-tooltip
+            class="item"
+            effect="dark"
+            :content="onlyOneChild.meta.title"
+            placement="right"
+             v-if="!leup"
+            ><span
+              class="pathName"
+              :class="getClass(item.path)"
+            ></span
+          ></el-tooltip>
+          <span
+            class="pathNamecosy"
+            v-if="leup"
+            :class="getClass(item.path)"
+          ></span>
           <span class="pathNameer" v-if="leup">{{
             onlyOneChild.meta.title
           }}</span>
@@ -23,7 +42,12 @@
       </app-link>
     </template>
 
-    <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
+    <el-submenu
+      v-else
+      ref="subMenu"
+      :index="resolvePath(item.path)"
+      popper-append-to-body
+    >
       <template slot="title">
         <img class="nav_item" :src="onlyOneChild.meta.imger" />
       </template>
@@ -64,19 +88,19 @@ export default {
       default: true,
     },
   },
-  data () {
+  data() {
     // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
     // TODO: refactor with render function
     this.onlyOneChild = null;
     return {};
   },
-  mounted () {
+  mounted() {
     // console.log(this.item, 'item')
     // const vnodes
     // vnodes.push(<span slot='title'>{(title)}</span>)
   },
   methods: {
-    hasOneShowingChild (children = [], parent) {
+    hasOneShowingChild(children = [], parent) {
       // console.log(this.item,'item')
       const showingChildren = children.filter((item) => {
         if (item.hidden) {
@@ -117,7 +141,7 @@ export default {
 
       return false;
     },
-    resolvePath (routePath) {
+    resolvePath(routePath) {
       if (isExternal(routePath)) {
         return routePath;
       }
@@ -126,7 +150,7 @@ export default {
       }
       return path.resolve(this.basePath, routePath);
     },
-    getClass (path) {
+    getClass(path) {
       const p = path.split("/").join("");
       if (p) {
         return p;

+ 1 - 1
src/router/routes/routes-file-four.js

@@ -112,7 +112,7 @@ const roleRoutes = {
               path: 'editRole',
               name: 'AuthorityRoleEdit',
               component: () => import('@/views/authorityManagement/components/authorityRoleEdit'),
-              meta: { title: '编辑角色' }
+              meta: { title: '账号权限' }
             }
           ]
         }

+ 4 - 4
src/views/authorityManagement/components/authorityRoleEdit.vue

@@ -30,14 +30,14 @@
           <div class="addApp-form-content dialog-public-background">
             <el-form :inline="true" label-width="80px" ref="form" :rules="rules" class="form" :model="form">
               <el-form-item prop="name" label="角色名称">
-                <el-input placeholder="请输入角色名称" maxlength="32" v-model="form.name"></el-input>
+                <el-input disabled placeholder="请输入角色名称" maxlength="32" v-model="form.name"></el-input>
               </el-form-item>
               <el-form-item label="角色描述">
-                <el-input style="width: 340px" type="textarea" :rows="3" maxlength="200" placeholder="请输入描述" v-model="form.app"></el-input>
+                <el-input style="width: 340px" disabled type="textarea" :rows="3" maxlength="200" placeholder="请输入描述" v-model="form.app"></el-input>
               </el-form-item>
               <el-form-item label="是否启用">
-                <el-radio v-model="radio" :label="1">是</el-radio>
-                <el-radio v-model="radio" :label="0">否</el-radio>
+                <el-radio disabled v-model="radio" :label="1">是</el-radio>
+                <el-radio disabled v-model="radio" :label="0">否</el-radio>
               </el-form-item>
             </el-form>
           </div>

+ 4 - 11
src/views/authorityManagement/components/authorityRoleHome.vue

@@ -258,7 +258,6 @@ export default {
           } else {
             this.editRoleFunc()
           }
-          this.resetForm('ruleForm')
         } else {
           return false
         }
@@ -275,6 +274,7 @@ export default {
         const res = await SaveRole(this.ruleForm);
         if (res.code === 0) {
           this.$message.success(res.message);
+          this.resetForm('ruleForm');
           this.gueryRole({
             QueryName: this.keyWords,
             PageSize: this.PageSize,
@@ -294,10 +294,7 @@ export default {
           RoleId: id,
         });
         if (res.code === 0) {
-          const { RoleName, RoleDesc, RoleStatus } = res.returnData;
-          this.ruleForm.RoleName = RoleName;
-          this.ruleForm.RoleDesc = RoleDesc;
-          this.ruleForm.RoleStatus = RoleStatus;
+          this.ruleForm = res.returnData;
         } else {
           this.$message.error(res.message);
         }
@@ -308,14 +305,10 @@ export default {
     //确认保存
     async editRoleFunc () {
       try {
-        const res = await EditRole({
-          RoleName: this.ruleForm.RoleName,
-          RoleDesc: this.ruleForm.RoleDesc,
-          RoleStatus: this.ruleForm.RoleStatus,
-          RoleId: this.roleId,
-        });
+        const res = await EditRole(this.ruleForm);
         if (res.code === 0) {
           this.$message.success(res.message);
+          this.resetForm('ruleForm');
           this.gueryRole({
             QueryName: this.keyWords,
             PageSize: this.PageSize,