luowei преди 2 години
родител
ревизия
87061236d7
променени са 3 файла, в които са добавени 19 реда и са изтрити 16 реда
  1. 2 1
      package.json
  2. 9 9
      src/views/system/menu/index.vue
  3. 8 6
      src/views/system/role/index.vue

+ 2 - 1
package.json

@@ -4,6 +4,7 @@
   "description": "若依管理系统",
   "author": "若依",
   "license": "MIT",
+  "private": true,
   "scripts": {
     "dev": "vue-cli-service serve",
     "build:prod": "vue-cli-service build",
@@ -44,7 +45,7 @@
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",
     "fuse.js": "6.4.3",
-    "highlight.js": "9.18.5",
+    "highlight.js": "10.7.3",
     "js-beautify": "1.13.0",
     "js-cookie": "3.0.1",
     "jsencrypt": "3.0.0-rc.1",

+ 9 - 9
src/views/system/menu/index.vue

@@ -52,7 +52,7 @@
       v-if="refreshTable"
       v-loading="loading"
       :data="menuList"
-      row-key="menuId"
+      row-key="id"
       :default-expand-all="isExpandAll"
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
@@ -166,7 +166,7 @@
                 是否外链
               </span>
               <el-radio-group v-model="form.isFrame">
-              debugger
+          
                 <el-radio label="0">是</el-radio>
                 <el-radio label="1">否</el-radio>
               </el-radio-group>
@@ -335,7 +335,7 @@ export default {
     getList() {
       this.loading = true;
       listMenu(this.queryParams).then(response => {
-        this.menuList = this.handleTree(response.data, "menuId");
+        this.menuList = this.handleTree(response.data, "id");
         this.loading = false;
       });
     },
@@ -345,7 +345,7 @@ export default {
         delete node.children;
       }
       return {
-        id: node.menuId,
+        id: node.id,
         label: node.menuName,
         children: node.children
       };
@@ -354,8 +354,8 @@ export default {
     getTreeselect() {
       listMenu().then(response => {
         this.menuOptions = [];
-        const menu = { menuId: 0, menuName: '主类目', children: [] };
-        menu.children = this.handleTree(response.data, "menuId");
+        const menu = { id: 0, menuName: '主类目', children: [] };
+        menu.children = this.handleTree(response.data, "id");
         this.menuOptions.push(menu);
       });
     },
@@ -393,9 +393,9 @@ export default {
     handleAdd(row) {
       this.reset();
       this.getTreeselect();
-      debugger
-      if (row != null && row.menuId) {
-        this.form.parentId = row.menuId;
+      
+      if (row != null && row.id) {
+        this.form.parentId = row.id;
       } else {
         this.form.parentId = 0;
       }

+ 8 - 6
src/views/system/role/index.vue

@@ -119,7 +119,7 @@
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope" v-if="scope.row.roleId !== 1">
+        <template slot-scope="scope" v-if="scope.row.id !== 1">
           <el-button
             size="mini"
             type="text"
@@ -397,10 +397,12 @@ export default {
     handleStatusChange(row) {
       let text = row.status === "0" ? "启用" : "停用";
       this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
-        return changeRoleStatus(row.roleId, row.status);
+        return changeRoleStatus(row.id, row.status);
       }).then(() => {
+       
         this.$modal.msgSuccess(text + "成功");
       }).catch(function() {
+        
         row.status = row.status === "0" ? "1" : "0";
       });
     },
@@ -507,9 +509,9 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const roleId = row.roleId || this.ids
-      const roleMenu = this.getRoleMenuTreeselect(roleId);
-      getRole(roleId).then(response => {
+      const id = row.id || this.ids
+      const roleMenu = this.getRoleMenuTreeselect(Number(id));
+      getRole(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.$nextTick(() => {
@@ -555,7 +557,7 @@ export default {
     submitForm: function() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.roleId != undefined) {
+          if (this.form.id != undefined) {
             this.form.menuIds = this.getMenuAllCheckedKeys();
             updateRole(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");