1 line
6.9 KiB
JSON
1 line
6.9 KiB
JSON
{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\menu\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\menu\\index.vue","mtime":1732871026790},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport crudMenu from '@/views/system/menu/menu'\r\nimport IconSelect from '@/components/IconSelect'\r\nimport Treeselect from '@riophae/vue-treeselect'\r\nimport '@riophae/vue-treeselect/dist/vue-treeselect.css'\r\nimport { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'\r\nimport CRUD, { presenter, header, form, crud } from '@crud/crud'\r\nimport rrOperation from '@crud/RR.operation'\r\nimport crudOperation from '@crud/CRUD.operation'\r\nimport udOperation from '@crud/UD.operation'\r\nimport Dict from '../../../components/Dict/Dict'\r\nimport i18n from '@/i18n'\r\n\r\n// crud交由presenter持有\r\nconst defaultForm = {\r\n menu_id: null,\r\n title: null,\r\n en_title: null,\r\n in_title: null,\r\n zh_title: null,\r\n ko_title: null,\r\n menu_sort: 999,\r\n path: null,\r\n system_type: null,\r\n category: null,\r\n component: null,\r\n component_name: null,\r\n iframe: false,\r\n roles: [],\r\n pid: 0,\r\n icon: null,\r\n cache: false,\r\n hidden: false,\r\n type: 2,\r\n permission: null\r\n}\r\nexport default {\r\n name: 'Menu',\r\n components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation },\r\n cruds() {\r\n return CRUD({ title: i18n.t('menu.title'), idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})\r\n },\r\n mixins: [presenter(), header(), form(defaultForm), crud()],\r\n dicts: ['system_type'],\r\n data() {\r\n return {\r\n typeList: [],\r\n defaultType: '',\r\n menus: [],\r\n permission: {\r\n add: ['admin', 'menu:add'],\r\n edit: ['admin', 'menu:edit'],\r\n del: ['admin', 'menu:del']\r\n },\r\n rules: {\r\n title: [\r\n { required: true, message: '请输入标题', trigger: 'blur' }\r\n ],\r\n zh_title: [\r\n { required: true, message: '请输入标题', trigger: 'blur' }\r\n ],\r\n en_title: [\r\n { required: true, message: '请输入标题', trigger: 'blur' }\r\n ],\r\n in_title: [\r\n { required: true, message: '请输入标题', trigger: 'blur' }\r\n ],\r\n path: [\r\n { required: true, message: '请输入地址', trigger: 'blur' }\r\n ]\r\n }\r\n }\r\n },\r\n methods: {\r\n normalizer(node) {\r\n return {\r\n id: node.menu_id,\r\n label: node.title,\r\n children: node.children\r\n }\r\n },\r\n queryBlurry() {\r\n if (this.query.blurry) {\r\n this.query.pid = null\r\n }\r\n this.crud.toQuery()\r\n },\r\n changetype() {\r\n const sysType = this.dict.dict.system_type[this.query.system_type]\r\n this.query.pid = sysType.para1\r\n this.crud.toQuery()\r\n },\r\n [CRUD.HOOK.beforeRefresh]() {\r\n // if (this.crud.query.system_type == null) {\r\n // this.crud.query.system_type = '1'\r\n // }\r\n return true\r\n },\r\n // 新增与编辑前做的操作\r\n [CRUD.HOOK.afterToCU](crud, form) {\r\n this.menus = []\r\n if (form.menu_id) { // 修改\r\n if (!form.pid) { // 一级菜单,一级的父级菜单的pid为0.\r\n form.pid = 0\r\n }\r\n this.getSupMenus(form.menu_id)\r\n } else { // 新增\r\n this.menus.push({ menu_id: 0, title: '顶级类目', children: null })\r\n }\r\n },\r\n [CRUD.HOOK.afterSubmit](crud, form) {\r\n if (this.$options.dicts instanceof Array) {\r\n new Dict(this.dict).init(this.$options.dicts, () => {\r\n this.$nextTick(() => {\r\n this.$emit('dictReady')\r\n })\r\n })\r\n }\r\n },\r\n [CRUD.HOOK.afterDelete](crud, form) {\r\n if (this.$options.dicts instanceof Array) {\r\n new Dict(this.dict).init(this.$options.dicts, () => {\r\n this.$nextTick(() => {\r\n this.$emit('dictReady')\r\n })\r\n })\r\n }\r\n },\r\n getMenus(tree, treeNode, resolve) {\r\n const params = { pid: tree.menu_id, system_type: tree.system_type }\r\n setTimeout(() => {\r\n crudMenu.getMenus(params).then(res => {\r\n resolve(res.content)\r\n })\r\n }, 100)\r\n },\r\n getSupMenus(menu_id) {\r\n crudMenu.getMenuSuperior(menu_id).then(res => {\r\n const children = res.map(function(obj) {\r\n if (!obj.leaf && !obj.children) {\r\n obj.children = null\r\n }\r\n return obj\r\n })\r\n this.menus = [{ menu_id: 0, title: '顶级类目', children: children }]\r\n })\r\n },\r\n loadMenus({ action, parentNode, callback }) {\r\n if (action === LOAD_CHILDREN_OPTIONS) {\r\n crudMenu.getMenusTree(parentNode.menu_id).then(res => {\r\n parentNode.children = res.map(function(obj) {\r\n if (!obj.leaf) {\r\n obj.children = null\r\n }\r\n return obj\r\n })\r\n setTimeout(() => {\r\n callback()\r\n }, 100)\r\n })\r\n }\r\n },\r\n // 选中图标\r\n selected(name) {\r\n this.form.icon = name\r\n }\r\n }\r\n}\r\n",null]} |