From eba06cc3df5f5736d3310b3b57dfc7243f41134a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 01 八月 2024 15:39:12 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/index.js | 1 src/tabviews/custom/components/table/base-table/index.jsx | 10 ++- src/tabviews/zshare/mutilform/mkCheckCard/index.jsx | 2 src/components/editor/index.scss | 9 +++ src/templates/zshare/formconfig.jsx | 5 + src/tabviews/custom/components/table/normal-table/index.jsx | 10 ++- src/menu/components/editor/braft-editor/editorcontent/index.scss | 7 -- src/tabviews/custom/popview/index.jsx | 2 src/tabviews/zshare/mutilform/index.jsx | 21 ++++++ src/tabviews/custom/components/table/edit-table/index.jsx | 4 - src/tabviews/basetable/index.jsx | 2 src/api/index.js | 21 +----- src/tabviews/custom/index.jsx | 8 +- src/tabviews/zshare/mutilform/mkInput/index.jsx | 4 + src/views/mobdesign/index.jsx | 10 ++ src/tabviews/custom/components/card/data-card/index.jsx | 6 ++ 16 files changed, 80 insertions(+), 42 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 78cdb4f..18c6f41 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -103,23 +103,10 @@ wxAccessToken (appId, domain = '') { let _url = domain || window.GLOB.baseurl - return new Promise(resolve => { - if (window.GLOB.accessToken.appId === appId && window.GLOB.accessToken.accessTime && (parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.accessTime < 30)) { - resolve(window.GLOB.accessToken) - } else { - window.GLOB.accessToken = {appId} - axios({ - url: _url + 'wechat/getaccesstoken', - method: 'post', - data: JSON.stringify({app_id: appId}) - }).then(res => { - if (res.access_token) { - window.GLOB.accessToken.accessTime = parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.access_token = res.access_token - } - resolve(res) - }) - } + return axios({ + url: _url + 'wechat/getaccesstoken', + method: 'post', + data: JSON.stringify({app_id: appId}) }) } diff --git a/src/components/editor/index.scss b/src/components/editor/index.scss index 856400d..9f9132f 100644 --- a/src/components/editor/index.scss +++ b/src/components/editor/index.scss @@ -11,6 +11,15 @@ padding-bottom: 0px; .public-DraftEditor-content { padding-bottom: 0; + + * { + font-weight: inherit; + font-style: inherit; + } + } + .DraftEditor-root, .DraftEditor-editorContainer, .public-DraftEditor-content { + height: var(--editor-height, auto); + min-height: var(--editor-height, 500px); } } .bf-content::-webkit-scrollbar { diff --git a/src/index.js b/src/index.js index d0f3e4e..a267b7f 100644 --- a/src/index.js +++ b/src/index.js @@ -51,7 +51,6 @@ GLOB.WXMerchID = config.WXMerchID || '' GLOB.WXNotice = config.WXNotice + '' === 'true' GLOB.execType = config.execType === 'x' ? 'x' : '' - GLOB.accessToken = {} GLOB.mkHS = false GLOB.debugger = false GLOB.dataFormat = false diff --git a/src/menu/components/editor/braft-editor/editorcontent/index.scss b/src/menu/components/editor/braft-editor/editorcontent/index.scss index a8e2f42..01d1ce3 100644 --- a/src/menu/components/editor/braft-editor/editorcontent/index.scss +++ b/src/menu/components/editor/braft-editor/editorcontent/index.scss @@ -4,11 +4,4 @@ >.anticon-form { color: purple; } -} -.model-menu-edit-content-form { - .normal-braft-editor { - .bf-container .DraftEditor-root, .bf-container .public-DraftEditor-content { - min-height: 500px; - } - } } \ No newline at end of file diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 3d13f4b..ea98f50 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -504,6 +504,8 @@ if (cell.OpenType === 'excelOut') { // 瀵煎嚭 cell.$menuName = item.$menuname + } else if (cell.OpenType === 'pop' && cell.modal) { + cell.modal.uuid = cell.uuid + 'pop' } if (cell.verify) { diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 7e95542..2748a02 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -949,6 +949,12 @@ _data.$$BID = BID || '' _data.$$BData = BData || '' + if (config.wrap.controlField) { + if (config.wrap.controlVal.includes(_data[config.wrap.controlField] + '')) { + _data.$disabled = true + } + } + data = data.map(item => { if (item.$$uuid === _data.$$uuid) { _data.key = item.key diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 045bf64..b02d9ae 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -288,6 +288,12 @@ _data.$$BID = BID || '' _data.$$BData = BData || '' + if (setting.controlField) { + if (setting.controlVal.includes(_data[setting.controlField] + '')) { + _data.$disabled = true + } + } + if (config.absFields) { config.absFields.forEach(f => { if (!isNaN(_data[f])) { @@ -597,9 +603,7 @@ if (config.$searchId !== searchId) return - this.setState({pageIndex: 1}, () => { - this.reloadtable() - }) + this.reloadtable() } autoExec = (times) => { diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index dae82f3..30e10ab 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -805,9 +805,7 @@ if (config.$searchId !== searchId) return - this.setState({pageIndex: 1}, () => { - this.reloadtable() - }) + this.reloadtable() } shouldComponentUpdate (nextProps, nextState) { diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index be55ae8..12f76e9 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -724,6 +724,12 @@ _data.$$uuid = _data[setting.primaryKey] || '' _data.$$BID = BID || '' _data.$$BData = BData || '' + + if (setting.controlField) { + if (setting.controlVal.includes(_data[setting.controlField] + '')) { + _data.$disabled = true + } + } if (config.absFields) { config.absFields.forEach(f => { @@ -1027,9 +1033,7 @@ if (config.$searchId !== searchId) return - this.setState({pageIndex: 1}, () => { - this.reloadtable() - }) + this.reloadtable() } render() { diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index ce3f77e..b3f0872 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -956,9 +956,11 @@ if (cell.OpenType === 'excelOut') { // 瀵煎嚭 cell.$menuName = item.$menuname - } else if (cell.OpenType === 'pop' && item.$cache && item.$time && cell.modal) { - cell.modal.$cache = item.$cache - cell.modal.$time = item.$time + } else if (cell.OpenType === 'pop' && cell.modal) { + if (item.$cache && item.$time) { + cell.modal.$cache = item.$cache + cell.modal.$time = item.$time + } cell.modal.uuid = cell.uuid + 'pop' } diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index cf6e6a3..1b097d4 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -667,6 +667,8 @@ if (cell.OpenType === 'excelOut') { // 瀵煎嚭 cell.$menuName = item.$menuname + } else if (cell.OpenType === 'pop' && cell.modal) { + cell.modal.uuid = cell.uuid + 'pop' } if (cell.verify) { diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index d7d6c61..24f5748 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -69,11 +69,18 @@ let fieldMap = new Map() let check = action.setting.formType === 'check' - if (this.props.data) { + if (this.props.data && !this.props.data.$$empty) { Object.keys(this.props.data).forEach(key => { data[key.toLowerCase()] = this.props.data[key] }) + } else if (action.uuid && sessionStorage.getItem('local_' + action.uuid)) { + let _data = JSON.parse(sessionStorage.getItem('local_' + action.uuid)) + + Object.keys(_data).forEach(key => { + data[key.toLowerCase()] = _data[key] + }) } + if (this.props.BData) { Object.keys(this.props.BData).forEach(key => { BData[key.toLowerCase()] = this.props.BData[key] @@ -146,6 +153,7 @@ // 鏁版嵁鑷姩濉厖 let readin = item.readin !== 'false' + item.local = item.readin === 'local' item.readin = item.readin !== 'false' && item.readin !== 'top' item.readonly = check || item.readonly === 'true' item.writein = item.writein !== 'false' @@ -1379,6 +1387,7 @@ } handleConfirm = (formId) => { + const { action } = this.props const { formlist, send_type, timestamp, n_id } = this.state // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� @@ -1390,6 +1399,7 @@ } let forms = [] let record = {...this.record, ...values} + let locals = null formlist.forEach(item => { if (!item.field || ['hint', 'split', 'formula'].includes(item.type)) return @@ -1486,12 +1496,21 @@ value: n_id || '' }) } + + if (item.local) { + locals = locals || {} + locals[item.field] = _item.value + } forms.push(_item) }) this.submitId = formId || '' + if (locals) { + sessionStorage.setItem('local_' + action.uuid, JSON.stringify(locals)) + } + resolve(forms) }) }) diff --git a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx index a7dc070..a73b13c 100644 --- a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx +++ b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx @@ -28,6 +28,8 @@ selectKeys = config.initval ? config.initval.split(',') : [] initlength = selectKeys.length selectKeys = this.filterVals(config.options, selectKeys) + } else if (config.options[0] && typeof(config.options[0].$value) === 'number' && /^([0-9]|[1-9]\d{0,2})$/.test(config.initval)) { + selectKeys = +config.initval } if (!config.selectStyle && config.backgroundColor) { diff --git a/src/tabviews/zshare/mutilform/mkInput/index.jsx b/src/tabviews/zshare/mutilform/mkInput/index.jsx index cad739c..9bdbbcf 100644 --- a/src/tabviews/zshare/mutilform/mkInput/index.jsx +++ b/src/tabviews/zshare/mutilform/mkInput/index.jsx @@ -85,7 +85,9 @@ let val = e.target.value let submit = /\n/g.test(val) - val = val.replace(/\n/g, '') + if (submit) { + val = val.replace(/\n|'/g, '') + } if (submit && /^\s+$/.test(val)) { submit = false diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 1e41bb9..b494bb7 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -1915,7 +1915,7 @@ type: 'radio', key: 'readin', label: '鑷姩濉厖', - tooltip: '灏嗚〃鏍奸�変腑鐨勬暟鎹嚜鍔ㄥ~鍏呭埌琛ㄥ崟涓�傛敞锛氬湪鎵归噺鎿嶄綔鏃讹紝濡傛兂瑕佹墍閫夎锛堝綋鍓嶅瓧娈碉級鍏ㄩ儴淇敼璇疯涓哄惁鎴栭琛屻��', + tooltip: '灏嗚〃鏍奸�変腑鐨勬暟鎹嚜鍔ㄥ~鍏呭埌琛ㄥ崟涓�傛敞锛氬湪鎵归噺鎿嶄綔鏃讹紝濡傛兂瑕佹墍閫夎锛堝綋鍓嶅瓧娈碉級鍏ㄩ儴淇敼璇疯涓哄惁鎴栭琛岋紱浣跨敤鈥滅紦瀛樷�濇椂锛屽皢鍦ㄦ湰鍦颁繚瀛樹笌璇诲彇琛ㄥ崟淇℃伅锛岄�夎鏃朵娇鐢ㄨ淇℃伅濉厖銆�', initVal: card.readin || 'true', options: [{ value: 'true', @@ -1926,6 +1926,9 @@ }, { value: 'top', text: '棣栬' + }, { + value: 'local', + text: '缂撳瓨' }] }, { diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index a76850e..ebeda0b 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -1528,6 +1528,7 @@ } delete config.miniTitle + delete config.miniReloadUp config.components.forEach(item => { if (item.type === 'login') { @@ -1536,8 +1537,13 @@ config.loginview = true } else if (item.type === 'navbar') { config.tabview = true - } else if (item.type === 'topbar' && adapters.includes('wxmini') && item.wrap.minishow !== 'true') { - config.miniTitle = item.wrap.title || '' + } else if (item.type === 'topbar' && adapters.includes('wxmini')) { + if (item.wrap.minishow !== 'true') { + config.miniTitle = item.wrap.title || '' + } + if (item.wrap.reload === 'true') { + config.miniReloadUp = true + } } }) -- Gitblit v1.8.0