diff --git a/package.json b/package.json index 4f3947cca90b9ffb9e16e3ee570d57f862992c6f..24c1bbee176fb1ad05fcab54d611b578d721b5c4 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neatlogic-web", - "version": "3.0.0", + "version": "4.0.0", "private": false, "author": "neatlogic", "scripts": { diff --git a/src/resources/api/common/index.js b/src/resources/api/common/index.js index 2bb8016fce69dd911fd6f099f02088bf2013de90..04c8344ada67dfd8894bd8376a786ecccf3bf2fa 100644 --- a/src/resources/api/common/index.js +++ b/src/resources/api/common/index.js @@ -166,10 +166,6 @@ const common = { updateCmdbMenu(params) { return axios.post('/api/rest/cmdb/ci/citype/search', params); }, - //后去ALERT的视图列表 - updateAlertMenu() { - return axios.post('/api/rest/alert/view/list', {}); - }, // 获取工单中心分类 updateProcessMenu(params) { return axios.post('/api/rest/workcenter/list', params); diff --git a/src/resources/api/http.js b/src/resources/api/http.js index a4e7eb7445f316140d440bba26e342aed7dbd8cd..005e82271a439f576adefb36f8519d561ae54364 100644 --- a/src/resources/api/http.js +++ b/src/resources/api/http.js @@ -32,7 +32,7 @@ const tip = ({desc, onClose, name, title, type = 'error', duration = 4.5, errorD } } }, desc), - errorDetail + errorDetail ? h('span', { class: ['tsfont-copy', 'text-action'], on: { @@ -86,6 +86,8 @@ var instance = Vue.prototype.$axios.create({ //timeout: 1000 * 20, //headers: {'Authorization': utils.getCookie('neatlogic_authorization') ? utils.getCookie('neatlogic_authorization') : ''} }); +instance.defaults.headers.get['source'] = 'pc'; //post请求头 +instance.defaults.headers.post['source'] = 'pc'; //post请求头 instance.defaults.headers.post['Content-Type'] = 'application/json'; //post请求头 instance.defaults.baseURL = BASEURLPREFIX; //默认接口前缀 instance.CancelToken = axios.CancelToken; diff --git a/src/resources/assets/css/common.less b/src/resources/assets/css/common.less index 3201b59443846c2ce83b0c19773a41598d22e5f5..b27066bb1dc291e220a017d7a50d699311ef76b6 100644 --- a/src/resources/assets/css/common.less +++ b/src/resources/assets/css/common.less @@ -22,7 +22,10 @@ html { vertical-align: middle; text-align: left; } - + .@{iv-prev}cascader-menu { + height: 100%; + max-height: 200px; + } //input .@{iv-prev}input { border: none; diff --git a/src/resources/assets/languages/term/en.json b/src/resources/assets/languages/term/en.json index e697635b310acccee551775b2e2e9074723f3904..ea92567d7f5dfec7bbe92adb0ffc30338b7910c9 100644 --- a/src/resources/assets/languages/term/en.json +++ b/src/resources/assets/languages/term/en.json @@ -632,7 +632,9 @@ "editprocessconfig": "Edit the current work order process configuration", "stepishandledby": "Step Handling Human", "sercalendar": "Service Calendar", - "flowauthuserupdatetip": "The processor includes all step handlers" + "flowauthuserupdatetip": "The processor includes all step handlers", + "settime": "Set time", + "setdate": "Set Calendar" }, "autoexec": { "addrootdirectory": "Add root directory", diff --git a/src/resources/assets/languages/term/zh.json b/src/resources/assets/languages/term/zh.json index 45641bcdc795036ebb43b99bc0244bdc61dcd699..fb2669c355519b1838325e9fa8876ac0011cac56 100644 --- a/src/resources/assets/languages/term/zh.json +++ b/src/resources/assets/languages/term/zh.json @@ -632,7 +632,9 @@ "editprocessconfig": "编辑当前工单流程配置", "stepishandledby": "步骤处理人为", "sercalendar": "服务日历", - "flowauthuserupdatetip": "处理人包含所有步骤处理人" + "flowauthuserupdatetip": "处理人包含所有步骤处理人", + "settime": "设置时间", + "setdate": "设置日历" }, "autoexec": { "addrootdirectory": "添加根目录", diff --git a/src/resources/plugins/TsSheet/form-item.vue b/src/resources/plugins/TsSheet/form-item.vue index 4915529e90eb2fb89c69ff2fcabe240e29f3faf7..74ae99f1d043f94c3d036bf4abcee7b1261adfcc 100644 --- a/src/resources/plugins/TsSheet/form-item.vue +++ b/src/resources/plugins/TsSheet/form-item.vue @@ -73,6 +73,7 @@ :externalData="externalData" :rowUuid="rowUuid" :extendConfigList="extendConfigList" + :extraFormItemList="extraFormItemList" @setValue="setValue" @resize="$emit('resize')" @select="selectFormItem" diff --git a/src/resources/plugins/TsSheet/form/component/formtable.vue b/src/resources/plugins/TsSheet/form/component/formtable.vue index c4a045c10dd5488993aacc6d9d7b716f2bed6c7b..7c76ffe9233d94bac278fc74968500571d686497 100644 --- a/src/resources/plugins/TsSheet/form/component/formtable.vue +++ b/src/resources/plugins/TsSheet/form/component/formtable.vue @@ -13,7 +13,7 @@ :ref="'formitem_' + extra.uuid + '_' + index" :formItem="extra" :formData="{...filterUuid(initFormData), ...row}" - :formItemList="$utils.deepClone(config.dataConfig.concat(formItemList))" + :formItemList="$utils.deepClone([...extraFormItemList, ...config.dataConfig, ...formItemList])" :showStatusIcon="false" :readonly="readonly" :isCustomValue="isCustomValue" @@ -48,7 +48,8 @@ export default { mixins: [validmixin], props: { readonly: { type: Boolean, default: false }, - disabled: { type: Boolean, default: false } + disabled: { type: Boolean, default: false }, + extraFormItemList: { type: Array, default: () => [] } }, data() { return { diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue index 2ee218b467da78b4cfff2fa5e54a0780886f9c4b..ff7ed0e8aa019c0ff1dbb4bb28f3be3a1b8382a7 100644 --- a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue @@ -358,18 +358,26 @@ export default { if (!this.$utils.isEmpty(row)) { Object.keys(row).forEach(key => { const findUnunique = uniqueRuleList.find(d => d.uuid === key); - if (findUnunique && row[key]) { - if (existMap[key] && existMap[key].includes(row[key])) { - let findItem = errorList.find(d => d.attrUuid === key); - if (findItem && !findItem.errorPageList.find(d => d === pageCount)) { - findItem.errorPageList.push(pageCount); - findItem.errorPageList = findItem.errorPageList.sort(this.$utils.sortNumber()); - findItem.error = `${this.formItem.label}:第${findItem.errorPageList.join(',')}页【${findUnunique.label}】属性必须唯一`; + let value = row[key]; + if (!this.$utils.isEmpty(value)) { + if (Array.isArray(value)) { + value = this.$utils.mapArray(value, 'text').join('_'); + } else if (typeof value === 'object') { + value = value['text']; + } + if (findUnunique) { + if (existMap[key] && existMap[key].includes(value)) { + let findItem = errorList.find(d => d.attrUuid === key); + if (findItem && !findItem.errorPageList.find(d => d === pageCount)) { + findItem.errorPageList.push(pageCount); + findItem.errorPageList = findItem.errorPageList.sort(this.$utils.sortNumber()); + findItem.error = `${this.formItem.label}:第${findItem.errorPageList.join(',')}页【${findUnunique.label}】属性必须唯一`; + } else { + errorList.push({ uuid: this.formItem.uuid, attrUuid: key, errorPageList: [pageCount], error: `${this.formItem.label}:第${pageCount}页【${findUnunique.label}】属性必须唯一` }); + } } else { - errorList.push({ uuid: this.formItem.uuid, attrUuid: key, errorPageList: [pageCount], error: `${this.formItem.label}:第${pageCount}页【${findUnunique.label}】属性必须唯一` }); + existMap[key] = existMap[key] ? [...existMap[key], value] : [value]; } - } else { - existMap[key] = existMap[key] ? [...existMap[key], row[key]] : [row[key]]; } } }); @@ -490,7 +498,7 @@ export default { const reactionValid = this.validReaction(th.reaction, data); let isValid = true; let errorList = defaultErrorList || []; - if (this.validateMap && this.validateMap[key]) { + if (!reactionValid.isDisable && this.validateMap && this.validateMap[key]) { const validateList = this.validateMap[key].validateList; if (!this.$utils.isEmpty(validateList)) { isValid = this.$utils.validParamValue(row[key], validateList); @@ -550,12 +558,14 @@ export default { for (let key in reactionMap) { if (reactionMap[key]) { isDisable = true; - isRequired = false; break; } } } - + // 当 isDisable 为 true 时,不用校验必填,设置 isRequired 为 false, + if (isDisable) { + isRequired = false; + } return { isDisable: isDisable, isRequired: isRequired diff --git a/src/resources/plugins/TsSheet/form/component/formtime.vue b/src/resources/plugins/TsSheet/form/component/formtime.vue index 846551e837d078107cef30c279c792b95ae7d7a8..27da329791d32194e04a1b7a1040d83a78d8e840 100644 --- a/src/resources/plugins/TsSheet/form/component/formtime.vue +++ b/src/resources/plugins/TsSheet/form/component/formtime.vue @@ -98,7 +98,7 @@ export default { return null; }, getValidList() { - let validateList = this.validateList || []; + let validateList = this.$utils.deepClone(this.validateList || []); //自定义校验 if (this.config.validType && this.config.validType.indexOf('custom') >= 0 && !this.$utils.isEmpty(this.config.validValueList)) { this.config.validValueList.forEach(item => { diff --git a/src/resources/store/modules/topMenu.js b/src/resources/store/modules/topMenu.js index 0f0fb2bc68de5863435b7fea7d39c1174e65bc3c..cf2871971eee9851baf64bf4f8864516c18d91cd 100644 --- a/src/resources/store/modules/topMenu.js +++ b/src/resources/store/modules/topMenu.js @@ -86,39 +86,27 @@ const actions = { }, // 更新模块菜单 - updateMenu({ dispatch }, { forceUpdate = false } = {}) { + updateMenu({ dispatch, commit, state, rootState }, { forceUpdate = false } = {}) { dispatch('updateProcessMenu', { forceUpdate }); dispatch('updateKnowledgeMenu', { forceUpdate }); dispatch('updateDashboardMenu', { forceUpdate }); dispatch('updateReportMenu', { forceUpdate }); dispatch('updateCmdbMenu', { forceUpdate }); dispatch('updateInspectMenu', { forceUpdate }); - dispatch('updateAlertMenu', { forceUpdate }); - }, - - // alert - async updateAlertMenu({ commit, state, rootState }, { forceUpdate = true } = {}) { - await state.gettingModuleList; - const alertModule = state.moduleList.find(item => item.moduleId === 'alert'); - if (!alertModule || (!forceUpdate && state.dynamicMenu.hasOwnProperty('alert')) || !hasCustomMenuAuthority('alert', 'alert-manage')) { - return; - } - const res = await commonApi.updateAlertMenu(); - if (!res.Return || res.Return.length === 0) return; - const alertViewList = res.Return.map(view => ({ - name: view.label, - path: `/alert-manage/${view.name}`, - url: `/alert-manage/${view.name}`, - icon: 'tsfont-dot' - })); - const newMenuGroup = [ - { - menuTypeName: '告警视图', - menuList: alertViewList - } + + const moduleContexts = [ + require.context('@/community-module/', true, /store\/modules\/topMenu\.js$/), + require.context('@/commercial-module/', true, /store\/modules\/topMenu\.js$/) ]; - commit('updateMenu', { module: alertModule, startIndex: 0, newMenuGroup }); - return res; + const args = { commit, dispatch, state, rootState, forceUpdate, hasCustomMenuAuthority }; + moduleContexts.forEach((context) => { + context.keys().forEach((path) => { + const fn = context(path) && context(path).default; + if (fn && typeof fn === 'function') { + fn(args); + } + }); + }); }, // process diff --git a/src/views/pages/framework/extramenu/menu-treeview.vue b/src/views/pages/framework/extramenu/menu-treeview.vue index 8e486267c99bc561ceb23dacdce033057838d79b..deec10683885087707b18c0180bf8da97390ce20 100644 --- a/src/views/pages/framework/extramenu/menu-treeview.vue +++ b/src/views/pages/framework/extramenu/menu-treeview.vue @@ -7,11 +7,10 @@ :list="childrenList" :move="checkMove" handle=".tsfont-drag" - :forceFallback="false" - :data-parentid="parentId" + group="tree" + :empty-insert-threshold="56" @start="moveStart" - @sort="moveEnd" - @remove="moveRemove" + @end="moveEnd" >
@@ -83,22 +80,12 @@ export default { required: true, type: Array, default: () => [] - }, - show: { - type: Boolean, - default: true } }, data() { return { - needUpdate: true, currentParentId: null, childrenList: [], - isShow: true, - childrenLoading: [], - parentUuid: '', - moveObject: null, - moveParentUuid: '', currentMenuId: null, isEdit: false, newParentId: null, @@ -107,16 +94,7 @@ export default { }; }, beforeCreate() {}, - created() { - if (!this.search) { - this.childrenList.forEach(item => { - if (item.childCount > 0) { - this.$set(item, 'isShow', false); - this.$set(item, 'isRequest', false); - } - }); - } - }, + created() {}, beforeMount() {}, mounted() {}, beforeUpdate() {}, @@ -126,10 +104,6 @@ export default { beforeDestroy() {}, destroyed() {}, methods: { - moveRemove() { - //如果是新菜单加入,不触发更新,避免重复保存 - this.needUpdate = false; - }, editMenu(id) { this.currentMenuId = id; this.isEdit = true; @@ -167,49 +141,23 @@ export default { checkMove(evt, originalEvent) { const source = evt.draggedContext.element; const target = evt.relatedContext.element; - const targetParentId = evt.to.dataset.parentid; - if (source.type === 1 && target && target.type === 1 && source.parentId === target.parentId) { - //链接选项调整顺序 - //console.log('链接选项调整顺序'); - return true; - } else if (source.type === 1 && target && source.parentId !== target.parentId && target.parentId !== 0) { + if (source.type === 1 && target && source.parentId !== target.parentId && target.parentId !== 0) { //链接调整归属 - //console.log('调整菜单归属'); this.newParentId = target.parentId; - return true; - } else if (source.type === 0 && target && source.parentId === target.parentId) { - //目录调整顺序 - //console.log('链目录调整顺序'); - return true; } else if (source.type === 0 && target && source.parentId !== target.parentId) { //目录调整归属 this.newParentId = target.parentId; - //console.log('目录调整归属'); - return true; } else if (source.type === 1 && target && source.parentId !== target.parentId && target.childCount == 0) { // 链接节点拖到目录下面(目录下为空的节点) this.newParentId = target.id; - return true; } else if (source.type === 1 && target && target.type === 0 && source.parentId == target.parentId) { // 链接节点拖到目录下面(目录下已存在节点) - this.newParentId = target.parentId; - return true; + this.newParentId = target.id; } else if (source.type === 1 && target && source.parentId != target.parentId) { // 链接拖到空白处,最顶层 - this.newParentId = target.parentId; - return true; - } else if (!target) { - const parentNode = this.childrenList.find(d => d.id == targetParentId); - if (parentNode && parentNode.type === 0) { - // 只能拖到目录下面 - this.newParentId = parentNode.id; - return true; - } else { - // 链接节点不允许有子节点 - return false; - } - } - return false; + this.newParentId = 0; + } + return true; }, moveStart(e) { this.currentId = e.item.attributes.id.value; @@ -219,16 +167,12 @@ export default { this.$emit('update', this.childrenList, this.parentId); }, moveEnd(evt) { - if (this.needUpdate) { - if (this.currentNode && this.newParentId !== null) { - this.$set(this.currentNode, 'parentId', this.newParentId); - this.newParentId = null; - this.currentNode = null; - } - this.update(); - } else { - this.needUpdate = true; + if (this.currentNode && this.newParentId !== null) { + this.$set(this.currentNode, 'parentId', this.newParentId); + this.newParentId = null; } + this.update(); + this.currentNode = null; }, isOpen(cd) { this.$set(cd, '_isHidden', !cd._isHidden); @@ -241,8 +185,7 @@ export default { animation: 150, scroll: true, disabled: false, - ghostClass: 'ghost', - group: { name: 'tree', pull: true, put: true } + ghostClass: 'ghost' }; } }, diff --git a/src/views/pages/framework/worktime/worktime-manage.vue b/src/views/pages/framework/worktime/worktime-manage.vue index 47d02a66b2a226d5ffefa66de9268ebdda7faaa5..e71c108d2b84b5a79b08d6fe43733a3fecc9a4f0 100644 --- a/src/views/pages/framework/worktime/worktime-manage.vue +++ b/src/views/pages/framework/worktime/worktime-manage.vue @@ -41,8 +41,8 @@