diff --git a/src/resources/assets/languages/page/en.json b/src/resources/assets/languages/page/en.json index 74d6ce9ca769f59cf2b0d1a1269ddfae1848180e..a2e86bb26f9cd0b1199051fddcc003382ff0807c 100644 --- a/src/resources/assets/languages/page/en.json +++ b/src/resources/assets/languages/page/en.json @@ -1085,5 +1085,7 @@ "datachange": "data conversion", "childmenucount": "Number of submenus", "systemmenuauth": "System menu permissions", - "defaulthomepage": "default page" + "defaulthomepage": "default page", + "selectalltip": "Support full selection of current data in multiple selection mode", + "pagesizedes": "Quantity limit: 10-500 pieces" } \ No newline at end of file diff --git a/src/resources/assets/languages/page/zh.json b/src/resources/assets/languages/page/zh.json index 8581427190e2ff31c60edac5706d98062c0c564f..f64605a6031f69e36c429d683788348b155417b9 100644 --- a/src/resources/assets/languages/page/zh.json +++ b/src/resources/assets/languages/page/zh.json @@ -1087,5 +1087,7 @@ "datachange": "数据转换", "childmenucount": "子菜单数量", "systemmenuauth": "系统菜单权限", - "defaulthomepage": "默认首页" + "defaulthomepage": "默认首页", + "selectalltip": "多选模式下支持当前数据全选", + "pagesizedes": "数量限制:10-500条" } \ No newline at end of file diff --git a/src/resources/assets/languages/term/en.json b/src/resources/assets/languages/term/en.json index b4819605c543c12234f3db3d964538a89aadf005..7c5dfe8838dd0bdeb41e9cf7bf6a2877e32a93ac 100644 --- a/src/resources/assets/languages/term/en.json +++ b/src/resources/assets/languages/term/en.json @@ -2907,7 +2907,8 @@ "similarrate": "similarity", "comparecount": "Compare data volume", "samplecount": "sample size", - "generatecode": "generate code" + "generatecode": "generate code", + "open": "open" }, "runnergroup": { "ruletips": "The request for login authentication needs to carry a header as a rule expression (note that the header parameter in the expression is all lowercase). If the value of the expression after execution is true, the executor group will take effect, and false and syntax exceptions will not take effect. For example: ${env}==\\ bit \\&&(${test}==\\ 1 \\ | | ${test2}==\\ aaa \\)" diff --git a/src/resources/assets/languages/term/zh.json b/src/resources/assets/languages/term/zh.json index 8243c725ee29118ff34a57175283d826038cd7ea..15e14227b9117c61da58eb9c4522b217d346b726 100644 --- a/src/resources/assets/languages/term/zh.json +++ b/src/resources/assets/languages/term/zh.json @@ -2907,7 +2907,8 @@ "similarrate": "相似度", "comparecount": "比较数据量", "samplecount": "样本数", - "generatecode": "生成代码" + "generatecode": "生成代码", + "open": "打开" }, "informant": { "last5dump": "最近5次快照", diff --git a/src/resources/plugins/TsForm/TsFormInput.vue b/src/resources/plugins/TsForm/TsFormInput.vue index 570cc170f40013ec447d9d33a259f6e4773e12aa..2c302bd9ff84f1093fe5f2c15015a2c20f48131d 100755 --- a/src/resources/plugins/TsForm/TsFormInput.vue +++ b/src/resources/plugins/TsForm/TsFormInput.vue @@ -232,7 +232,10 @@ export default { this.$emit('on-clear'); }, onBlurValue: function() { - const value = typeof this.currentValue === 'string' ? this.currentValue.trim() : this.currentValue; + if (typeof this.currentValue === 'string') { + this.currentValue = this.currentValue.trim(); // 去除首尾空格;否则由于前后值一致不会触发 watch,this.currentValue 的空格无法更新,最终导致校验失败。 + } + const value = this.currentValue; typeof this.onBlur == 'function' && this.onBlur(value); this.$emit('on-blur', value); if (this.currentValidList.length > 0 && this.canValid('blur', this.currentValidList)) { diff --git a/src/resources/plugins/TsForm/TsFormSelect.md b/src/resources/plugins/TsForm/TsFormSelect.md index ad369fb91736218ee1b84d13b6b3a9f8d900e438..30b009e33957f8f1e72fb8eb9a3008e97714f8b8 100644 --- a/src/resources/plugins/TsForm/TsFormSelect.md +++ b/src/resources/plugins/TsForm/TsFormSelect.md @@ -88,8 +88,10 @@ needCallback|Boolean|false|否|是否搜索需要回调,主要用于实时搜 forbidContent|String,Array||否|禁止输入的字符串,主要用于通过allowCreate来创建选项时,主要是为了防止xss攻击 一般情况下面值为 ['<', '>', '"', "'", '&'] 或者 '<>&'|生效条件 search 时 firstSelect|Boolean|true|否|必填且下拉列表只有一个时,是否选中下拉列表的唯一项|- nowrapHead|Boolean|false|否|当出现多选的时候,不换行显示,如果数据过多时则显示不全,通过滚动条来查看数据|- -dropdownMenuMaxWidth|String,Boolean|false|下拉列表最大宽度 - +dropdownMenuMaxWidth|String,Boolean|false|否|下拉列表最大宽度 +pageSize|Number|20|否|dynamicUrl模式下,设置返回数据的条数 +isCanAll|Boolean|false|否|多选模式下支持当前数据全选 +allText|String|全选|否|多选时,全选文字 2021-11-09 新加方法 参数名|数据类型|默认值|必传|用途|说明 diff --git a/src/resources/plugins/TsForm/TsFormSelect.vue b/src/resources/plugins/TsForm/TsFormSelect.vue index aeff8e6e784c15eb6d5c527c5239ae434cc671e3..39c8e7bcdbe1c24f5ee6edb4ca4476a3b75e7c2e 100755 --- a/src/resources/plugins/TsForm/TsFormSelect.vue +++ b/src/resources/plugins/TsForm/TsFormSelect.vue @@ -114,6 +114,11 @@ {{ addItem[showName ? showName : textName] }} +
  • {{ allText }}
  • +
  • {{ allText }}
  • { @@ -1412,6 +1439,22 @@ export default { this.$utils.equalStr(arr, str) && (index = 0); } return index; + }, + selectAll() { + // 全选 + let value = []; + this.nodeList.forEach(item => { + if (item && item._disabled || !item) { + return; + } else { + value.push(item[this.valueName]); + } + }); + this.selectedList = this.nodeList.filter(item => !item._disabled && item); + this.currentValue = value; + this.searchKeyWord = ''; + this.onChangeValue(); + this.scrollTop(); } }, computed: { diff --git a/src/resources/plugins/TsSheet/form/component/formselect.vue b/src/resources/plugins/TsSheet/form/component/formselect.vue index f75f19f3301f86ca8fe3fe4c8999fc8a5f53972d..235001c1aee2ed11aad2a2cbcd620ccde576eb50 100644 --- a/src/resources/plugins/TsSheet/form/component/formselect.vue +++ b/src/resources/plugins/TsSheet/form/component/formselect.vue @@ -232,6 +232,8 @@ export default { setting.placeholder = this.config.placeholder; setting.sperateText = this.config.sperateText || '、'; setting.isAutoSelectdOnlyValue = this.config.isAutoSelectdOnlyValue || false; + setting.isCanAll = this.config.isCanAll || false; + setting.pageSize = this.config.pageSize || 20; if (this.config.dataSource === 'matrix') { setting.dynamicUrl = '/api/rest/matrix/column/data/search/forselect'; setting.rootName = 'dataList'; diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue b/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue index d18008a7d3957a540f16992ce77ce75bf515b915..1564bde7d2cb379cd3e396bf45cefa31fd8d8f45 100644 --- a/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue @@ -118,6 +118,11 @@ export default { reactionValueData: { type: Object, default: () => {} + }, + expressionData: { + // 表达式的值 + type: Object, + default: () => {} } }, data() { @@ -559,7 +564,7 @@ export default { }; }, formData() { - return {...(this.reactionValueData || {}), ...(this.rowData || {})}; + return {...(this.reactionValueData || {}), ...(this.rowData || {}), ...(this.expressionData || {})}; }, formItemUuid() { return this.formItem && this.formItem.uuid; diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/expression-mixin.js b/src/resources/plugins/TsSheet/form/component/formtableinputer/expression-mixin.js new file mode 100644 index 0000000000000000000000000000000000000000..d99de2266ee32083c9a8d3799eaf5130cdeedd5b --- /dev/null +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/expression-mixin.js @@ -0,0 +1,66 @@ +export default { + methods: { + handleExpressionData({expression, formData = {}}) { + let expressionFormData = {}; + const { type = '', jsValue = '', list = [] } = expression || {}; + if (type === 'strExpression') { + list.forEach(item => { + if (item.mappingMode === 'formCommonComponent') { + const uuidList = item.value.split('#'); + const formItemValue = formData[uuidList[0]] || ''; + const uuid = uuidList[0]; + if (!this.$utils.isEmpty(formItemValue)) { + if (Array.isArray(formItemValue)) { + let multipleValueList = []; + formItemValue.forEach(a => { + if (typeof a === 'object') { + if (uuidList[1]) { + multipleValueList.push(a[uuidList[1]]); + } else { + multipleValueList.push(a['value']); + } + } else { + multipleValueList.push(a); + } + }); + expressionFormData[uuid] = multipleValueList; + } else if (typeof formItemValue === 'object') { + if (uuidList[1]) { + expressionFormData[uuidList[1]] = formItemValue[uuidList[1]] || ''; + } else { + expressionFormData[uuid] = formItemValue; + } + } else { + expressionFormData[uuid] = formItemValue; + } + } + } + }); + } else if (type === 'jsExpression' && jsValue) { + expressionFormData = this._getFormlabelMapping(formData); + } + return expressionFormData; + }, + _getFormlabelMapping(formData) { + let data = {}; + const whiteList = ['formtext', 'formdate', 'formtime', 'formselect', 'formradio', 'formnumber']; + this.formItemList.forEach(item => { + if (whiteList.includes(item.handler)) { + data[item.uuid] = formData[item.uuid]; + } else { + if (item.config && item.config.dataConfig) { + const findItem = item.config.dataConfig.find(a => a.uuid === this.formItem.uuid); + if (findItem) { + item.config.dataConfig.forEach(a => { + if (whiteList.includes(a.handler)) { + data[a.uuid] = formData[a.uuid]; + } + }); + } + } + } + }); + return data; + } + } +}; diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue index d1a8de53279b3ea18f576dcbf9912f14663aa1e3..b86062c6a3955c2b5e1b5f746b45d93d021acde3 100644 --- a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue @@ -130,6 +130,7 @@ :extraUuid="extra.uuid" :reactionData="getReactionData(extra, row)" :reactionValueData="reactionValuesMap[extra.uuid]" + :expressionData="getExpressionData(extra)" class="form-item-width" @change="changeRow" @getCurrentRowData="getCurrentRowData" @@ -163,6 +164,7 @@ import base from '../base.vue'; import validmixin from '../common/validate-mixin.js'; import conditionMixin from './condition-mixin.js'; +import expressionMixin from './expression-mixin.js'; import TableImportExportMixin from './table-import-export-mixin.js'; export default { name: '', @@ -172,7 +174,7 @@ export default { ColumnItem: () => import('@/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue') }, extends: base, - mixins: [validmixin, conditionMixin, TableImportExportMixin], + mixins: [validmixin, conditionMixin, expressionMixin, TableImportExportMixin], props: { readonly: { type: Boolean, default: false }, disabled: { type: Boolean, default: false } @@ -686,6 +688,17 @@ export default { return result; }; }, + getExpressionData() { + return (extra) => { + const { handler, config = {} } = extra || {}; + const { expression } = config || {}; + let resultData = {}; + if (handler === 'formexpression') { + resultData = this.handleExpressionData({expression: expression, formData: this.formData}); + } + return resultData; + }; + }, frozenFormItemList() { return Object.freeze([...this.formItemList || []]); // 解构不影响原数据 }, diff --git a/src/resources/plugins/TsSheet/form/config/formselect-conf.vue b/src/resources/plugins/TsSheet/form/config/formselect-conf.vue index b8a3da7e469a3baa5d7e9ecb73c5510dbcc7d340..1e6e517045550d38fb122e52fab03911f1638299 100644 --- a/src/resources/plugins/TsSheet/form/config/formselect-conf.vue +++ b/src/resources/plugins/TsSheet/form/config/formselect-conf.vue @@ -8,6 +8,22 @@ :disabled="disabled" > + + + + + +
    @@ -268,6 +297,7 @@ export default { this.$set(this.config, 'sourceColumnList', []); this.$set(this.config, 'hiddenFieldList', []); this.$set(this.config, 'defaultValue', null); + this.$set(this.config, 'pageSize', 20); if (!this.$utils.isEmpty(this.formItem.reaction)) { Object.keys(this.formItem.reaction).forEach(key => { this.$set(this.formItem.reaction, key, {}); diff --git a/src/resources/plugins/TsSheet/form/config/formtableinputer-conf/formtableinputer-attr-config-dialog.vue b/src/resources/plugins/TsSheet/form/config/formtableinputer-conf/formtableinputer-attr-config-dialog.vue index 48cdf651af2c7e6111267a789040ac48dababd63..5d512986919b9400230112796292d56cd06bc870 100644 --- a/src/resources/plugins/TsSheet/form/config/formtableinputer-conf/formtableinputer-attr-config-dialog.vue +++ b/src/resources/plugins/TsSheet/form/config/formtableinputer-conf/formtableinputer-attr-config-dialog.vue @@ -93,20 +93,34 @@ - - - + + + +
    @@ -920,6 +946,7 @@ export default { this.$set(this.propertyLocal.config, 'matrixUuid', null); this.$set(this.propertyLocal.config, 'formtableinputerUuid', null); this.$set(this.propertyLocal.config, 'mapping', {}); + this.$set(this.propertyLocal.config, 'pageSize', 20); this.$delete(this.propertyLocal.reaction, 'filter'); this.isReady = false; this.$nextTick(() => { diff --git a/src/views/components/topnav/topnav-menu.vue b/src/views/components/topnav/topnav-menu.vue index 0a9ce5d24015c468ea1d475ca65de4e0c41fb1e4..64307e6e2a3c3d547c0ab59886f63fcadd7b2a2a 100644 --- a/src/views/components/topnav/topnav-menu.vue +++ b/src/views/components/topnav/topnav-menu.vue @@ -75,7 +75,8 @@ export default { selectedExtraMenuList: [] // 已选的额外菜单列表。用于在点击跳转后重置选中状态,防止第二次点击无效。 }; }, - created() { + async created() { + await this.initExtramenu(); //检测hash变化,用于framework.html切换hash window.addEventListener('hashchange', this.onHashChange); //如果从别的页面进来,使用此方法检测 @@ -254,17 +255,19 @@ export default { }; }, initExtramenu() { - this.$api.framework && - this.$api.framework.extramenu - .getMenuList() - .then(res => { - this.extramenuList = res.Return; - }) - .finally(() => { - this.$nextTick(() => { - this.$store.commit('setExtramenu', false); - }); + if (!this.$api.framework) { + return; + } + return this.$api.framework.extramenu + .getMenuList() + .then(res => { + this.extramenuList = res.Return; + }) + .finally(() => { + this.$nextTick(() => { + this.$store.commit('setExtramenu', false); }); + }); } }, computed: { @@ -283,9 +286,6 @@ export default { return groupList; }; }, - isHasExtramenu() { - return this.$AuthUtils.hasRole('EXTRA_MENU_MODIFY'); - }, isUpdateExtramenu() { return this.$store.state.isUpdateExtramenu; }, @@ -296,14 +296,6 @@ export default { } }, watch: { - isHasExtramenu: { - handler(val) { - if (val) { - this.initExtramenu(); - } - }, - immediate: true - }, isUpdateExtramenu: { handler(val) { if (val) { diff --git a/src/views/pages/framework/api/api-manage-test.vue b/src/views/pages/framework/api/api-manage-test.vue index 2c5054e4e2703764664f16b66ca21b9a4446a1e7..9c40e2af814e88c96274efff7087fa6655d0900d 100644 --- a/src/views/pages/framework/api/api-manage-test.vue +++ b/src/views/pages/framework/api/api-manage-test.vue @@ -138,8 +138,9 @@ export default { error: '', inputColumns: Object.freeze([ { title: this.$t('page.name'), key: 'name' }, - { title: this.$t('page.explain'), key: 'description' }, + { title: this.$t('page.description'), key: 'description' }, { title: this.$t('page.type'), key: 'type' }, + { title: this.$t('page.rule'), key: 'rule' }, { title: this.$t('page.isrequired'), key: 'isRequired', width: 100, render: (h, params) => { if (params.row.isRequired) { return h('div', {class: 'text-success'}, this.$t('page.yes')); @@ -147,7 +148,7 @@ export default { return h('div', {class: 'text-grey'}, this.$t('page.no')); } } }, - { title: this.$t('page.help'), key: 'help' }, + { title: this.$t('page.explain'), key: 'help' }, { title: this.$t('page.insert'), key: 'input', slot: 'input' } ]), outputColumns: Object.freeze([ diff --git a/src/views/pages/framework/schedule/job-edit-dialog.vue b/src/views/pages/framework/schedule/job-edit-dialog.vue index 40f2a484788b68674978845a64a5a8939eb6fd7f..414a77d191da399c3cc8953072691e0e1faf6813 100644 --- a/src/views/pages/framework/schedule/job-edit-dialog.vue +++ b/src/views/pages/framework/schedule/job-edit-dialog.vue @@ -14,11 +14,6 @@ labelPosition="right" > - @@ -98,7 +89,7 @@ export default { isSaving: false, dialogConfig: { type: 'modal', - title: this.jobUuid && this.isCopy ? this.$t('page.copy') : this.jobUuid && !this.isCopy ? this.$t('page.edit') : this.$t('page.add'), + title: (this.jobUuid && this.isCopy ? this.$t('page.copy') : this.jobUuid && !this.isCopy ? this.$t('page.edit') : this.$t('page.add')) + this.$t('term.autoexec.job'), maskClose: false, isShow: true, width: 'medium' @@ -143,6 +134,7 @@ export default { value: '', defaultValue: '', //默认值 maxlength: 20, + transfer: true, label: this.$t('term.autoexec.jobmodule'), validateList: ['required'], url: '/api/rest/job/class/search', //通过url获取数据 @@ -253,7 +245,18 @@ export default { }, save() { var form = this.$refs.mainForm; - if (form.valid()) { + let isValid = true; + this.propList.forEach((d, index) => { + const propValue = this.$refs['propValue_' + index]; + if (propValue && !propValue.valid()) { + isValid = false; + } + }); + + if (!form.valid()) { + isValid = false; + } + if (isValid) { let data = form.getFormValue(); data.propList = []; this.propList && diff --git a/src/views/pages/process/task/processdispatch/dispatch-common.vue b/src/views/pages/process/task/processdispatch/dispatch-common.vue index 988d67112960f469588229e6fbbd92d7bc4f4baf..92a626043762c25995709fae9eaa92986f7b9b93 100644 --- a/src/views/pages/process/task/processdispatch/dispatch-common.vue +++ b/src/views/pages/process/task/processdispatch/dispatch-common.vue @@ -236,7 +236,7 @@ export default { return validList; }, knowledgeSearch() { - this.$refs.baseSetting.knowledgeSearch(this.dispatchTitle); + this.$refs.baseSetting && this.$refs.baseSetting.knowledgeSearch(this.dispatchTitle); }, updateFormWidth() { if (this.$refs.formSetting && this.$refs.formSetting.$el && this.$refs.formSetting.$el.__vue__.$refs.formSheet) { diff --git a/src/views/pages/process/task/processdispatch/workorder/base-setting.vue b/src/views/pages/process/task/processdispatch/workorder/base-setting.vue index deb3c612c191bc0bd8d005c44bb0950bcadb423c..16aa76d4feb213e09b22b621f6c655c81697e4b9 100644 --- a/src/views/pages/process/task/processdispatch/workorder/base-setting.vue +++ b/src/views/pages/process/task/processdispatch/workorder/base-setting.vue @@ -1,6 +1,6 @@