Browse Source

:ok_hand: 菜单图标已安排上

smallchill 7 years ago
parent
commit
44e0ef7879

+ 2 - 2
src/config/env.js

@@ -1,7 +1,7 @@
 // 配置编译环境和线上环境之间的切换
 
 let baseUrl = '';
-let iconfontVersion = ['567566_pwc3oottzol'];
+let iconfontVersion = ['567566_pwc3oottzol', '1066523_fl1r6w21kv'];
 let iconfontUrl = `//at.alicdn.com/t/font_$key.css`;
 let codeUrl = `${baseUrl}/code`
 const env = process.env
@@ -18,4 +18,4 @@ export {
     iconfontVersion,
     codeUrl,
     env
-}
+}

+ 68 - 2
src/config/iconList.js

@@ -1,6 +1,72 @@
 export default [
   {
-    label: "阿里云图标",
+    label: "通用图标",
+    list: [
+      "iconfont iconicon_roundadd",
+      "iconfont iconicon_compile",
+      "iconfont iconicon_glass",
+      "iconfont iconicon_roundclose",
+      "iconfont iconicon_roundreduce",
+      "iconfont iconicon_delete",
+      "iconfont iconicon_shakehands",
+      "iconfont iconicon_task_done",
+      "iconfont iconicon_shakehands",
+      "iconfont iconicon_voipphone",
+      "iconfont iconicon_safety",
+      "iconfont iconicon_work",
+      "iconfont iconicon_study",
+      "iconfont iconicon_task",
+      "iconfont iconicon_subordinate",
+      "iconfont iconicon_star",
+      "iconfont iconicon_setting",
+      "iconfont iconicon_sms",
+      "iconfont iconicon_share",
+      "iconfont iconicon_secret",
+      "iconfont iconicon_scan_namecard",
+      "iconfont iconicon_principal",
+      "iconfont iconicon_send",
+      "iconfont iconicon_scan",
+      "iconfont iconicon_search",
+      "iconfont iconicon_refresh",
+      "iconfont iconicon_savememo",
+      "iconfont iconicon_QRcode",
+      "iconfont iconicon_im_keyboard",
+      "iconfont iconicon_redpacket",
+      "iconfont iconicon_photo",
+      "iconfont iconicon_qq",
+      "iconfont iconicon_phone",
+      "iconfont iconicon_namecard",
+      "iconfont iconicon_notice",
+      "iconfont iconicon_next_arrow",
+      "iconfont iconicon_left",
+      "iconfont iconicon_more",
+      "iconfont iconicon_details",
+      "iconfont iconicon_message",
+      "iconfont iconicon_mobilephone",
+      "iconfont iconicon_im_voice",
+      "iconfont iconicon_GPS",
+      "iconfont iconicon_ding",
+      "iconfont iconicon_exchange",
+      "iconfont iconicon_cspace",
+      "iconfont iconicon_doc",
+      "iconfont iconicon_dispose",
+      "iconfont iconicon_discovery",
+      "iconfont iconicon_community_line",
+      "iconfont iconicon_cloud_history",
+      "iconfont iconicon_coinpurse_line",
+      "iconfont iconicon_airplay",
+      "iconfont iconicon_at",
+      "iconfont iconicon_addressbook",
+      "iconfont iconicon_boss",
+      "iconfont iconicon_addperson",
+      "iconfont iconicon_affiliations_li",
+      "iconfont iconicon_addmessage",
+      "iconfont iconicon_addresslist",
+      "iconfont iconicon_add",
+    ]
+  },
+  {
+    label: "系统图标",
     list: [
       "iconfont icon-zhongyingwen",
       "iconfont icon-caidan",
@@ -46,4 +112,4 @@ export default [
       "iconfont icon-huanyingye",
     ]
   }
-]
+]

+ 1 - 1
src/views/desk/notice.vue

@@ -82,7 +82,7 @@
             },
             {
               label: "通知日期",
-              type: "date",
+              type: "releaseTime",
               prop: "date",
               format: "yyyy-MM-dd hh:mm:ss",
               valueFormat: "yyyy-MM-dd hh:mm:ss",

+ 1 - 1
src/views/system/dept.vue

@@ -95,7 +95,7 @@
               rules: [{
                 required: false,
                 message: "请选择上级部门",
-                trigger: "blur"
+                trigger: "click"
               }]
             },
 

+ 1 - 1
src/views/system/dict.vue

@@ -95,7 +95,7 @@
               rules: [{
                 required: false,
                 message: "请选择上级字典",
-                trigger: "blur"
+                trigger: "click"
               }]
             },
             {

+ 273 - 258
src/views/system/menu.vue

@@ -42,286 +42,301 @@
 </template>
 
 <script>
-import { getList, remove, update, add, getMenu } from "@/api/system/menu";
-import { mapGetters } from "vuex";
-import iconList from "@/config/iconList";
-export default {
-  data() {
-    return {
-      form: {},
-      selectionList: [],
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 0
-      },
-      option: {
-        tip: false,
-        dialogWidth: "70%",
-        tree: true,
-        border: true,
-        index: true,
-        selection: true,
-        viewBtn: true,
-        column: [
-          {
-            label: "菜单名称",
-            prop: "name",
-            search: true,
-            rules: [
-              {
-                required: true,
-                message: "请输入菜单名称",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "菜单编号",
-            prop: "code",
-            search: true,
-            rules: [
-              {
-                required: true,
-                message: "请输入菜单编号",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "菜单别名",
-            prop: "alias",
-            rules: [
-              {
-                required: true,
-                message: "请输入菜单别名",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "菜单图标",
-            prop: "source",
-            type: "icon-select",
-            slot: true,
-            iconList: iconList,
-            rules: [
-              {
-                required: true,
-                message: "请输入菜单图标",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "路由地址",
-            prop: "path",
-            rules: [
-              {
-                required: true,
-                message: "请输入路由地址",
-                trigger: "blur"
-              }
-            ]
-          },
+  import {getList, remove, update, add, getMenu} from "@/api/system/menu";
+  import {mapGetters} from "vuex";
+  import iconList from "@/config/iconList";
 
-          {
-            label: "上级菜单",
-            prop: "parentId",
-            type: "tree",
-            dicUrl: "/api/blade-system/menu/tree",
-            hide: true,
-            props: {
-              label: "title"
+  export default {
+    data() {
+      return {
+        form: {},
+        selectionList: [],
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        option: {
+          tip: false,
+          dialogWidth: "60%",
+          tree: true,
+          border: true,
+          index: true,
+          selection: true,
+          viewBtn: true,
+          column: [
+            {
+              label: "菜单名称",
+              prop: "name",
+              search: true,
+              rules: [
+                {
+                  required: true,
+                  message: "请输入菜单名称",
+                  trigger: "blur"
+                }
+              ]
             },
-            rules: [
-              {
-                required: false,
-                message: "请选择上级菜单",
-                trigger: "blur"
-              }
-            ]
-          },
-
-          {
-            label: "菜单类型",
-            prop: "category",
-            type: "radio",
-            dicData: [
-              {
-                label: "菜单",
-                value: 1
-              },
-              {
-                label: "按钮",
-                value: 2
-              }
-            ],
-            hide: true,
-            rules: [
-              {
-                required: true,
-                message: "请选择菜单类型",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "菜单排序",
-            prop: "sort",
-            type: "number",
-            rules: [
-              {
-                required: true,
-                message: "请输入菜单排序",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "按钮功能",
-            prop: "action",
-            type: "radio",
-            dicData: [
-              {
-                label: "工具栏",
-                value: 0
-              },
-              {
-                label: "操作栏",
-                value: 1
+            {
+              label: "路由地址",
+              prop: "path",
+              rules: [
+                {
+                  required: true,
+                  message: "请输入路由地址",
+                  trigger: "blur"
+                }
+              ]
+            },
+            {
+              label: "上级菜单",
+              prop: "parentId",
+              type: "tree",
+              dicUrl: "/api/blade-system/menu/tree",
+              hide: true,
+              props: {
+                label: "title"
               },
-              {
-                label: "工具操作栏",
-                value: 2
-              }
-            ],
-            hide: true,
-            rules: [
-              {
-                required: true,
-                message: "请选择按钮功能",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "菜单备注",
-            prop: "remark",
-            type: "textarea",
-            span: 24,
-            minRows: 6,
-            hide: true
-          }
-        ]
-      },
-      data: []
-    };
-  },
-
-  computed: {
-    ...mapGetters(["permission"]),
-    permissionList() {
-      return {
-        addBtn: this.permission.menu_add,
-        viewBtn: this.permission.menu_view,
-        delBtn: this.permission.menu_delete,
-        editBtn: this.permission.menu_edit
+              rules: [
+                {
+                  required: false,
+                  message: "请选择上级菜单",
+                  trigger: "click"
+                }
+              ]
+            },
+            {
+              label: "菜单图标",
+              prop: "source",
+              type: "icon-select",
+              slot: true,
+              iconList: iconList,
+              rules: [
+                {
+                  required: true,
+                  message: "请输入菜单图标",
+                  trigger: "click"
+                }
+              ]
+            },
+            {
+              label: "菜单编号",
+              prop: "code",
+              search: true,
+              rules: [
+                {
+                  required: true,
+                  message: "请输入菜单编号",
+                  trigger: "blur"
+                }
+              ]
+            },
+            {
+              label: "菜单类型",
+              prop: "category",
+              type: "radio",
+              dicData: [
+                {
+                  label: "菜单",
+                  value: 1
+                },
+                {
+                  label: "按钮",
+                  value: 2
+                }
+              ],
+              hide: true,
+              rules: [
+                {
+                  required: true,
+                  message: "请选择菜单类型",
+                  trigger: "blur"
+                }
+              ]
+            },
+            {
+              label: "菜单别名",
+              prop: "alias",
+              rules: [
+                {
+                  required: true,
+                  message: "请输入菜单别名",
+                  trigger: "blur"
+                }
+              ]
+            },
+            {
+              label: "按钮功能",
+              prop: "action",
+              type: "radio",
+              dicData: [
+                {
+                  label: "工具栏",
+                  value: 0
+                },
+                {
+                  label: "操作栏",
+                  value: 1
+                },
+                {
+                  label: "工具操作栏",
+                  value: 2
+                }
+              ],
+              hide: true,
+              rules: [
+                {
+                  required: true,
+                  message: "请选择按钮功能",
+                  trigger: "blur"
+                }
+              ]
+            },
+            {
+              label: "菜单排序",
+              prop: "sort",
+              type: "number",
+              rules: [
+                {
+                  required: true,
+                  message: "请输入菜单排序",
+                  trigger: "blur"
+                }
+              ]
+            },
+            {
+              label: "新窗口",
+              prop: "isOpen",
+              type: "radio",
+              dicData: [
+                {
+                  label: "否",
+                  value: 0
+                },
+                {
+                  label: "是",
+                  value: 1
+                },
+              ],
+              hide: true
+            },
+            {
+              label: "菜单备注",
+              prop: "remark",
+              type: "textarea",
+              span: 24,
+              minRows: 6,
+              hide: true
+            }
+          ]
+        },
+        data: []
       };
     },
-    ids() {
-      let ids = [];
-      this.selectionList.forEach(ele => {
-        ids.push(ele.id);
-      });
-      return ids.join(",");
-    }
-  },
-  methods: {
-    rowSave(row, loading) {
-      add(row).then(() => {
-        loading();
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-      });
-    },
-    rowUpdate(row, index, loading) {
-      update(row).then(() => {
-        loading();
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
+
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.permission.menu_add,
+          viewBtn: this.permission.menu_view,
+          delBtn: this.permission.menu_delete,
+          editBtn: this.permission.menu_edit
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
         });
-      });
+        return ids.join(",");
+      }
     },
-    rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return remove(row.id);
-        })
-        .then(() => {
+    methods: {
+      rowSave(row, loading) {
+        add(row).then(() => {
+          loading();
           this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
         });
-    },
-    searchReset() {
-      this.onLoad(this.page);
-    },
-    searchChange(params) {
-      this.onLoad(this.page, params);
-    },
-    selectionChange(list) {
-      this.selectionList = list;
-    },
-    handleDelete() {
-      if (this.selectionList.length === 0) {
-        this.$message.warning("请选择至少一条数据");
-        return;
-      }
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return remove(this.ids);
-        })
-        .then(() => {
+      },
+      rowUpdate(row, index, loading) {
+        update(row).then(() => {
+          loading();
           this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.$refs.crud.toggleSelection();
         });
-    },
-    beforeOpen(done, type) {
-      if (["edit", "view"].includes(type)) {
-        getMenu(this.form.id).then(res => {
-          this.form = res.data.data;
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      searchReset() {
+        this.onLoad(this.page);
+      },
+      searchChange(params) {
+        this.onLoad(this.page, params);
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getMenu(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      onLoad(page, params = {}) {
+        getList(page.currentPage, page.pageSize, params).then(res => {
+          const data = res.data.data;
+          this.data = data;
         });
       }
-      done();
-    },
-    onLoad(page, params = {}) {
-      getList(page.currentPage, page.pageSize, params).then(res => {
-        const data = res.data.data;
-        this.data = data;
-      });
     }
-  }
-};
+  };
 </script>
 
 <style>

+ 1 - 1
src/views/system/role.vue

@@ -129,7 +129,7 @@ export default {
               {
                 required: false,
                 message: "请选择上级角色",
-                trigger: "blur"
+                trigger: "click"
               }
             ]
           },

+ 2 - 2
src/views/system/user.vue

@@ -147,7 +147,7 @@
               rules: [{
                 required: true,
                 message: "请选择所属角色",
-                trigger: "blur"
+                trigger: "click"
               }]
             },
             {
@@ -163,7 +163,7 @@
               rules: [{
                 required: true,
                 message: "请选择所属部门",
-                trigger: "blur"
+                trigger: "click"
               }]
             },
             {