From c1b1976f059aea9b69e85f2bbc6bdf4381d5691a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 10 四月 2022 16:05:50 +0800 Subject: [PATCH] 2022-04-10 --- public/options.json | 14 +++++++------- src/tabviews/zshare/mutilform/index.jsx | 18 +++++++++++++++--- src/templates/zshare/modalform/index.jsx | 2 +- src/templates/zshare/formconfig.jsx | 20 +++++++++++++++++++- 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/public/options.json b/public/options.json index 792a858..f317ad5 100644 --- a/public/options.json +++ b/public/options.json @@ -1,17 +1,17 @@ { - "appId": "202108312122504607B107A83F55B40C98CCF", - "appkey": "20210831212235413F287EC3BF489424496C8", + "appId": "201912040924165801464FF1788654BC5AC73", + "appkey": "20191106103859640976D6E924E464D029CF0", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "false", "lineColor": "", "filter": "false", - "defaultApp": "mkindustry", + "defaultApp": "mk", "defaultLang": "zh-CN", "WXAppID": "", "debugger": false, - "licenseKey": "7EFE13KIKLILIJB64C12", - "probation": "2021-12-31", - "host": "http://demo.mk9h.cn", - "service": "erp_new/" + "licenseKey": "", + "probation": "", + "host": "http://qingqiumarket.cn", + "service": "MKWMS/" } \ No newline at end of file diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index f67bfa1..1db51b6 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -231,10 +231,14 @@ }, { required: item.required === 'true', message: item.label + '涓嶅彲涓虹┖!' - }, { - max: item.fieldlength, - message: formRule.input.formMessage.replace('@max', item.fieldlength) }] + + if (!item.lenControl || item.lenControl === 'limit') { + _rules.push({ + max: item.fieldlength, + message: formRule.input.formMessage.replace('@max', item.fieldlength) + }) + } if (item.regular) { if (item.regular === 'number') { @@ -906,6 +910,14 @@ _item.type = 'text' } } + + if (item.type === 'text' && item.lenControl && item.lenControl !== 'limit') { + if (item.lenControl === 'left') { + _item.value = _item.value.substr(0, item.fieldlength) + } else { + _item.value = _item.value.slice(-item.fieldlength) + } + } search.push(_item) }) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index a7d05d7..235e9be 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2837,7 +2837,7 @@ label: Formdict['model.form.field'] + Formdict['model.length'], // tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512', initVal: card.fieldlength || _fieldlength, - required: false + required: true }, { type: 'number', @@ -3262,6 +3262,24 @@ }] }, { + type: 'radio', + key: 'lenControl', + label: '闀垮害鎺у埗', + initVal: card.lenControl || 'limit', + tooltip: '鍦ㄨ缃瓧娈甸暱搴﹀悗锛屽闀垮害鐨勬帶鍒舵柟寮忋��', + required: false, + options: [{ + value: 'limit', + text: '闄愬埗杈撳叆' + }, { + value: 'left', + text: '宸︽埅' + }, { + value: 'right', + text: '鍙虫埅' + }] + }, + { type: 'number', key: 'labelwidth', min: 1, diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index b601b19..0fca860 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -19,7 +19,7 @@ const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) const modalTypeOptions = { - text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom'], + text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl'], number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom'], select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'], checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'arrange', 'marginTop', 'marginBottom'], -- Gitblit v1.8.0