diff --git a/package.json b/package.json index 5e0eb38..85c10fb 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "quill-image-drop-module": "^1.0.3", "quill-image-extend-module": "^1.1.2", "quill-image-resize-module": "^3.0.0", + "svg-sprite-loader": "^6.0.11", "uuid": "^3.4.0", "vue": "^2.6.11", "vue-axios": "^3.4.0", diff --git a/src/api/modules/dictionary.js b/src/api/modules/dictionary.js index e1e94a6..8138474 100644 --- a/src/api/modules/dictionary.js +++ b/src/api/modules/dictionary.js @@ -1,6 +1,7 @@ import { instance as request } from '@/utils/request' export default { + //外层 addDic (data) { return request({ url: '/api/sys/dict/add', @@ -29,4 +30,40 @@ export default { params:data }) }, + //内层 + addItemDic (data) { + return request({ + url: '/api/sys/dictItem/add', + method: 'post', + data + }) + }, + editItemDic (data) { + return request({ + url: '/api/sys/dictItem/edit', + method: 'put', + data + }) + }, + getItemDic (data) { + return request({ + url: '/api/sys/dictItem/page', + method: 'get', + params:data + }) + }, + delItemDic (data) { + return request({ + url: '/api/sys/dictItem/delete', + method: 'delete', + params:data + }) + }, + // 获取字典值 + getCode(data) { + return request({ + url: '/api/sys/dictItem/'+data, + method: 'get', + }) + } } diff --git a/src/api/modules/org.js b/src/api/modules/org.js new file mode 100644 index 0000000..013c412 --- /dev/null +++ b/src/api/modules/org.js @@ -0,0 +1,35 @@ +import { instance as request } from '@/utils/request' + +export default { + // 新增|编辑 + sysOrgAddUser (data) { + return request({ + url: '/api/sys/org/saveOrUpdate', + method: 'POST', + data + }) + }, + // // 用户启用或禁用 + // sysUserIsUse (data) { + // return request({ + // url: `/api/sys/user/isUse/${data.USID}/${data.type}`, + // method: 'POST' + // }) + // }, + // 获取所有部门 + sysOrgList (data) { + return request({ + url: '/api/sys/org/page', + method: 'POST', + data + }) + }, + // 删除部门 + sysOrgDelete (data) { + return request({ + url: '/api/sys/org/delete', + method: 'POST', + params: data + }) + } +} diff --git a/src/components/Header.vue b/src/components/Header.vue index 501905a..616c108 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -86,6 +86,7 @@ export default { this.$store.commit('saveUserInfo', null) this.$store.commit('setHandleProcess', null) this.$store.commit('savePathUrl', null) + this.$store.commit('removeDicts', null) // var sevice = "http://"+window.location.host+"/"; // var serviceUrl = encodeURIComponent(sevice); // 正式 diff --git a/src/components/ProcessMixin.vue b/src/components/ProcessMixin.vue index 796e336..6dfc558 100644 --- a/src/components/ProcessMixin.vue +++ b/src/components/ProcessMixin.vue @@ -9,9 +9,21 @@ return { processTypeList: [ { - label: '权限申请流程', + label: '下载申请流程', value: '1' }, + { + label: '预览申请流程', + value: '2' + }, + { + label: '预览+下载申请流程', + value: '3' + }, + { + label: '上传审批流程', + value: '4' + }, ], formDisableFlag: false, nowOrder: '', diff --git a/src/components/SvgIcon.vue b/src/components/SvgIcon.vue new file mode 100644 index 0000000..27da76c --- /dev/null +++ b/src/components/SvgIcon.vue @@ -0,0 +1,43 @@ + + + + + + + diff --git a/src/components/dict.js b/src/components/dict.js new file mode 100644 index 0000000..0da9263 --- /dev/null +++ b/src/components/dict.js @@ -0,0 +1,58 @@ +// 混入字典方法 做到按需加载 +import interfaces from "@/api/modules/dictionary"; +import store from "@/store"; +import Vue from "vue"; + +class Dict { + constructor(dict) { + this.dict = dict; + } + + async init(names) { + const ps = []; + names.forEach((name) => { + if (store.getters.dicts[name]) { + Vue.set(this.dict, name, store.getters.dicts[name]); + } else { + Vue.set(this.dict, name, []); + ps.push( + interfaces.getCode(name).then((res) => { + this.dict[name] = Object.freeze(res.data); + store.dispatch('setDicts_a', { + label: name, + value: Object.freeze(res.data), + }) + }) + ); + + } + }); + await Promise.all(ps); + } +} + +const install = function (Vue) { + Vue.mixin({ + data() { + if ( + this.$options.dicts instanceof Array && + this.$options.dicts.length > 0 + ) { + return { dict: {} }; + } else { + return {}; + } + }, + created() { + if ( + this.$options.dicts instanceof Array && + this.$options.dicts.length > 0 + ) { + new Dict(this.dict).init(this.$options.dicts); + } + }, + }); +}; + +export default { install }; + diff --git a/src/icon/index.js b/src/icon/index.js new file mode 100644 index 0000000..2c6b309 --- /dev/null +++ b/src/icon/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/src/icon/svg/pointe.svg b/src/icon/svg/pointe.svg new file mode 100644 index 0000000..e5cc7b0 --- /dev/null +++ b/src/icon/svg/pointe.svg @@ -0,0 +1 @@ + diff --git a/src/icon/svg/pointe_fill.svg b/src/icon/svg/pointe_fill.svg new file mode 100644 index 0000000..5c82f5e --- /dev/null +++ b/src/icon/svg/pointe_fill.svg @@ -0,0 +1 @@ + diff --git a/src/main.js b/src/main.js index 26b2d10..558b169 100644 --- a/src/main.js +++ b/src/main.js @@ -35,13 +35,14 @@ import VueQuillEditor from 'vue-quill-editor' import 'quill/dist/quill.core.css' import 'quill/dist/quill.snow.css' import 'quill/dist/quill.bubble.css' - +import dict from '@/components/dict' +import './icon' VXETable.setup({ table: { resizable: true } }) - +Vue.use(dict); Vue.use(VXETable) Vue.use(VueQuillEditor) Vue.use(ElementUI, { size: 'mini', zIndex: 3000 }) diff --git a/src/router/modules/system.js b/src/router/modules/system.js index e2d3c41..ca0262e 100644 --- a/src/router/modules/system.js +++ b/src/router/modules/system.js @@ -32,6 +32,15 @@ const routes = [ crumb: ['角色管理'] } }, + // 组织机构管理 + { + path: 'Org', + name: 'Org', + component: () => import('../../views/System/Org.vue'), + meta: { + crumb: ['组织机构管理'] + } + }, // // 角色管理 // { // path: 'mail', diff --git a/src/store/index.js b/src/store/index.js index 56fb363..c57283a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -14,7 +14,8 @@ export default new Vuex.Store({ menuName: '', activeTab: '', handleProcess: '', - marketpre:'' + marketpre:'', + dicts:{} }, getters: { marketpre: (state) => state.marketpre, @@ -22,9 +23,16 @@ export default new Vuex.Store({ menuName: (state) => state.menuName, userInfo: (state) => state.userInfo, activeTab: (state) =>state.activeTab, - handleProcess: (state) =>state.handleProcess + handleProcess: (state) =>state.handleProcess, + dicts: (state) =>state.dicts }, mutations: { + setDicts(state, obj) { + state.dicts[obj.label] = obj.value; + }, + removeDicts(state, obj) { + state.dicts = {} + }, setMarketpre(state, data){ state.marketpre = data }, @@ -53,7 +61,11 @@ export default new Vuex.Store({ state.menuName = data } }, - actions: {}, + actions: { + setDicts_a({ commit }, obj) { + commit('setDicts', obj) + }, + }, modules: {}, plugins: [createPersistedState()] }) diff --git a/src/utils/request.js b/src/utils/request.js index 2e411ef..fa68921 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -82,6 +82,7 @@ instance.interceptors.response.use(function (response) { if (error.response.data.status == 401) { store.commit('savePathUrl', null) store.commit('setHandleProcess', null) + store.commit('removeDicts', null) router.push('/login') Message.error('登录超时过期') // window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self'); @@ -95,6 +96,7 @@ instance.interceptors.response.use(function (response) { if (error.response.status === 500) { store.commit('savePathUrl', null) store.commit('setHandleProcess', null) + store.commit('removeDicts', null) router.push('/login') Message.error('登录超时过期') // window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self'); diff --git a/src/utils/waterMark.js b/src/utils/waterMark.js index 6cbe521..5818d16 100644 --- a/src/utils/waterMark.js +++ b/src/utils/waterMark.js @@ -22,11 +22,12 @@ Vue.directive('watermark', { can.style.display = 'none' const cans = can.getContext('2d') cans.rotate(-20 * Math.PI / 180) - cans.font = font || '13px Microsoft Yahei' + cans.font = font || '13px Helvetica Neue' cans.fillStyle = textColor || 'rgba(100, 100, 100, 0.2)' cans.textAlign = 'left' cans.textBaseline = 'Middle' cans.fillText(str, fillTextX, can.height) + console.log(cans) // 设置背景图(整个项目中都添加水印建议使用此方法) // parentNode.style.backgroundImage = "url(" + can.toDataURL("image/png") + ")"; diff --git a/src/views/Report/ReportDetail.vue b/src/views/Report/ReportDetail.vue index 7cb966b..fd4c33e 100644 --- a/src/views/Report/ReportDetail.vue +++ b/src/views/Report/ReportDetail.vue @@ -7,6 +7,10 @@