From b3852c89968e9d5d6a3b9a4998d869bfbbfd1842 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 01 十二月 2020 18:19:04 +0800 Subject: [PATCH] 2020-12-01 --- src/tabviews/zshare/mutilform/index.jsx | 118 ++++++++++------------- src/menu/modelsource/option.jsx | 4 src/tabviews/zshare/calendar/index.jsx | 15 ++ src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx | 4 src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 6 - src/templates/zshare/verifycard/index.jsx | 4 src/templates/sharecomponent/settingcomponent/settingform/utils.jsx | 2 src/tabviews/zshare/calendar/index.scss | 2 src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx | 36 ++++--- src/utils/utils.js | 50 +++++++++ src/tabviews/calendar/index.jsx | 10 +- 11 files changed, 143 insertions(+), 108 deletions(-) diff --git a/src/menu/modelsource/option.jsx b/src/menu/modelsource/option.jsx index d6bf059..4bd287c 100644 --- a/src/menu/modelsource/option.jsx +++ b/src/menu/modelsource/option.jsx @@ -8,7 +8,7 @@ import card1 from '@/assets/mobimg/card1.png' import card2 from '@/assets/mobimg/card2.png' import TableCard from '@/assets/mobimg/table-card.png' -import NormalTable from '@/assets/mobimg/normal-table.png' +// import NormalTable from '@/assets/mobimg/normal-table.png' import Pie from '@/assets/mobimg/pie.png' import Pie1 from '@/assets/mobimg/ring.png' import Pie2 from '@/assets/mobimg/nightingale.png' @@ -22,7 +22,7 @@ { type: 'menu', url: Mainsearch, component: 'search', subtype: 'mainsearch', title: '鎼滅储鏉′欢', width: 24, forbid: ['billPrint'] }, { type: 'menu', url: card1, component: 'card', subtype: 'datacard', title: '鏁版嵁鍗�', config: `[{"uuid":"160135809128212dm7i29fim9ksto9od","setting":{"width":6},"style":{"paddingTop":"15px","marginTop":"4px","paddingRight":"15px","marginRight":"8px","marginLeft":"8px","backgroundColor":"rgba(255, 255, 255, 1)","borderColor":"#e8e8e8","paddingLeft":"15px","marginBottom":"4px","borderWidth":"1px","paddingBottom":"10px"},"backStyle":{},"elements":[{"datatype":"static","width":12,"marks":null,"height":1,"value":"鍏冲崟","style":{},"prefix":"","postfix":"","format":"","eleType":"text","uuid":"160231860159931untbea62sgokunc5s"},{"datatype":"static","width":12,"marks":null,"style":{"color":"rgba(250, 219, 20, 1)","textAlign":"right"},"btnstyle":{},"eleType":"icon","icon":"question-circle","field":"","uuid":"1602318768361nv8ql4t47sgcsn88b0u"},{"datatype":"static","width":24,"marks":null,"height":1,"innerHeight":36,"value":"100","style":{"fontSize":"24px","fontWeight":"500","color":"rgba(0, 0, 0, 1)"},"prefix":"","btnstyle":{},"postfix":"","format":"","eleType":"text","uuid":"1602318817884v70gtgb65ubnm8mbcvv"},{"color":"#1890ff","width":24,"marks":null,"maxValue":100,"style":{"color":"rgba(250, 140, 22, 1)","paddingTop":"20px","paddingBottom":"10px"},"btnstyle":{},"eleType":"slider","field":"int1","uuid":"16023188871233rkktuvpp1h077igrsu"},{"eleType":"splitline","width":24,"color":"#e8e8e8","uuid":"1602320017038n31bk9o831ggug0tu0b","marks":null,"style":{"marginTop":"10px","marginBottom":"10px"},"btnstyle":{}},{"datatype":"static","width":12,"marks":null,"height":1,"value":"100","style":{"marginTop":"6px"},"prefix":"鍏冲崟","btnstyle":{},"postfix":"","format":"","eleType":"text","uuid":"1602320061243drd7lf3agvn04kgr175"}],"backElements":[]}]` }, { type: 'menu', url: card2, component: 'card', subtype: 'propcard', title: '灞炴�у崱', config: `[{"uuid":"1603681387259qaqf1127f72esmtchge","setting":{"width":6,"type":"simple"},"style":{"paddingTop":"15px","marginTop":"8px","paddingRight":"15px","marginRight":"8px","marginLeft":"8px","borderColor":"#e8e8e8","paddingLeft":"15px","marginBottom":"8px","borderWidth":"1px","paddingBottom":"15px"},"backStyle":{},"elements":[{"datatype":"static","width":12,"marks":null,"height":1,"value":"瓒呮椂宸ュ崟","style":{"color":"rgba(67, 67, 67, 0.51)"},"prefix":"","postfix":"","format":"","eleType":"text","uuid":"1603681402945qnkgm7q8cng65evn5ev"},{"eleType":"icon","datatype":"static","width":12,"icon":"question-circle","tooltip":"瓒呮椂宸ュ崟","uuid":"1603681473384i2crkbtofg4pu76k06a","marks":null,"style":{"textAlign":"right","color":"rgba(250, 219, 20, 1)"}},{"datatype":"static","width":24,"marks":null,"height":1,"innerHeight":36,"value":"100","style":{"fontSize":"24px","color":"rgba(0, 0, 0, 1)"},"prefix":"","postfix":"","format":"","eleType":"number","uuid":"1603681539870d704ufqf98kc6t7537t"},{"color":"rgba(250, 219, 20, 1)","datatype":"static","width":24,"marks":null,"maxValue":100,"value":50,"style":{"paddingTop":"10px","paddingBottom":"10px"},"eleType":"slider","uuid":"1603683067556mvupau0odvrtv45u7o8"},{"eleType":"splitline","width":24,"color":"#e8e8e8","uuid":"1603683117981t9k55k8an430fuppmci","marks":null,"style":{"paddingTop":"5px","paddingBottom":"5px"}},{"datatype":"static","width":12,"marks":null,"height":1,"value":"100","style":{"color":"rgba(0, 0, 0, 0.65)","marginTop":"10px"},"prefix":"瓒呮椂宸ュ崟 ","postfix":"","format":"","eleType":"text","uuid":"1603683136553uvsmkfohkft9idbfkhu"}],"backElements":[]}]` }, - { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '甯哥敤琛�', width: 24 }, + // { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '甯哥敤琛�', width: 24 }, { type: 'menu', url: TableCard, component: 'table', subtype: 'tablecard', title: '琛ㄦ牸', width: 12 }, { type: 'menu', url: line, component: 'line', subtype: 'line', title: '鎶樼嚎鍥�' }, { type: 'menu', url: line1, component: 'line', subtype: 'line1', title: '闃舵鎶樼嚎鍥�' }, diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx index f9c7c92..0689eea 100644 --- a/src/tabviews/calendar/index.jsx +++ b/src/tabviews/calendar/index.jsx @@ -329,7 +329,7 @@ } let _dataresource = setting.dataresource - let regoptions = null + let regoptions = [] if (setting.queryType === 'statistics' || param.custom_script) { let allSearch = Utils.getAllSearchOptions(search) let userName = sessionStorage.getItem('User_Name') || '' @@ -355,18 +355,18 @@ }) } - if (config.calendar.refresh === 'true' && regoptions) { + if (config.calendar.refresh === 'true') { regoptions.push({ reg: new RegExp('@calendarDate@', 'ig'), - value: `${calendarYear}-01-01 00:00:00.000` + value: `'${calendarYear}-01-01 00:00:00.000'` }) regoptions.push({ reg: new RegExp('@calendarDate1@', 'ig'), - value: `${calendarYear}-12-31 23:59:59.999` + value: `'${calendarYear}-12-31 23:59:59.999'` }) } - if (setting.queryType === 'statistics' && setting.execute !== 'false') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲 + if ((setting.queryType === 'statistics' || config.calendar.refresh === 'true') && setting.execute !== 'false') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲 regoptions.forEach(item => { _dataresource = _dataresource.replace(item.reg, item.value) }) diff --git a/src/tabviews/zshare/calendar/index.jsx b/src/tabviews/zshare/calendar/index.jsx index 9dec047..3f9f15a 100644 --- a/src/tabviews/zshare/calendar/index.jsx +++ b/src/tabviews/zshare/calendar/index.jsx @@ -67,7 +67,7 @@ let datelist = this.getDateList(this.state.selectYear) let monthlist = null - datelist = this.mountdata(datelist, nextProps.data || []) + datelist = this.mountdata(datelist, nextProps.data) if (this.state.levels.includes('month') || this.state.levels.includes('year')) { monthlist = datelist.filter(item => item.month === this.state.selectMonth)[0] @@ -95,7 +95,7 @@ let levels = { red: 1, orange: 2, yellow: 3, green: 4, cyan: 5, blue: 6, purple: 7, gray: 8 } let colors = { red: '#d0021b', orange: '#f5a623', yellow: '#f8e71c', green: '#7ed321', cyan: '#50e3c2', blue: '#1890ff', purple: '#bd10e0', gray: '#9b9b9b' } - data.forEach(item => { + data && data.forEach(item => { let startTime = item[calendar.startfield] let endTime = item[calendar.endfield] let color = item[calendar.colorfield] @@ -237,7 +237,16 @@ } monthChange = (value) => { - const { datelist } = this.state + const { datelist, levels, selectYear } = this.state + + if (!levels.includes('month')) { + if (this.props.triggerDate) { + this.props.triggerDate({ + time: `${selectYear}${value}01` + }) + } + return + } this.setState({ level: 'month', diff --git a/src/tabviews/zshare/calendar/index.scss b/src/tabviews/zshare/calendar/index.scss index d458768..917f694 100644 --- a/src/tabviews/zshare/calendar/index.scss +++ b/src/tabviews/zshare/calendar/index.scss @@ -133,9 +133,9 @@ .year-calendar { .year-wrap { width: calc(100% - 2px); + box-shadow: 0px 0px 3px #bae7ff; cursor: pointer; transition: background 0.1s; - box-shadow: 0px 0px 3px #bae7ff; .header { text-align: center; font-size: 16px; diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 2767199..1160ba3 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -66,6 +66,7 @@ let formlist = [] let encrypts = [] let intercepts = [] + let _inputfields = [] if (action.groups.length > 0) { action.groups.forEach(group => { @@ -85,29 +86,32 @@ formlist = action.fields } - let _inputfields = formlist.filter(item => (item.type === 'text' || item.type === 'number') && item.field) // 鐢ㄤ簬杩囨护涓嬫媺鑿滃崟鍏宠仈琛ㄥ崟 + let linkFields = {} // 鍏宠仈鑿滃崟 + let supItemVal = {} // 涓婄骇鑿滃崟鍒濆鍊� + let deForms = [] // 闇�瑕佸姩鎬佽幏鍙栦笅鎷夎彍鍗曠殑琛ㄥ崟 + + formlist.forEach(item => { + if (item.type === 'text' || item.type === 'number') { // 鐢ㄤ簬杩囨护涓嬫媺鑿滃崟鍏宠仈琛ㄥ崟 + _inputfields.push(item.field) + } else if (item.type === 'textarea' && item.encryption === 'true') { // 鍔犲瘑瀛楁 + encrypts.push(item.field) + } else if (item.type === 'link') { + linkFields[item.linkField] = linkFields[item.linkField] || [] + linkFields[item.linkField].push(item.field) + } + if (item.interception === 'true') { // 瀛楃鎴彇瀛楁 + intercepts.push(item.field) + } + }) formlist = formlist.map(item => { if (item.type === 'title') return item - - // 鍔犲瘑瀛楁 - if (item.type === 'textarea' && item.encryption === 'true') { - encrypts.push(item.field) - } - - // 瀛楃鎴彇瀛楁 - if (item.interception === 'true') { - intercepts.push(item.field) - } // 鏁版嵁鑷姩濉厖 let _readin = item.readin !== 'false' if (item.type === 'linkMain' || item.type === 'funcvar') { _readin = false } - - // 鐢ㄤ簬鍙楁帶鍊肩殑琛ㄥ崟锛岄殣钘忔椂浼犻粯璁ゅ��(鏈娇鐢紵) - item.initVal = typeof(item.initval) === 'object' ? fromJS(item.initval).toJS() : item.initval let _fieldlen = item.fieldlength || 50 if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { @@ -122,29 +126,22 @@ writein[item.field] = item.writein !== 'false' fieldlen[item.field] = _fieldlen - if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect' || item.type === 'radio' || item.type === 'checkbox') { - if (item.setAll === 'true' && (item.type === 'select' || item.type === 'link' || item.type === 'radio')) { - item.options.unshift({ - key: Utils.getuuid(), - Value: '', - Text: item.emptyText || '绌�' - }) - } + if (item.setAll === 'true' && (item.type === 'select' || item.type === 'link' || item.type === 'radio')) { // 娣诲姞绌哄�� + item.options.unshift({ + key: Utils.getuuid(), + Value: '', + Text: item.emptyText || '绌�' + }) + } - // 淇濆瓨鍒濆鍒楄〃锛岀敤浜庤仈鍔ㄨ彍鍗曟帶鍒� - item.oriOptions = fromJS(item.options).toJS() + item.oriOptions = item.options ? fromJS(item.options).toJS() : null // 淇濆瓨鍒濆鍒楄〃锛岀敤浜庤仈鍔ㄨ彍鍗曟帶鍒� - // 涓嬬骇琛ㄥ崟鎺у埗-瀛楁鍐欏叆 - if (item.type === 'select' || item.type === 'radio') { - if (item.linkSubField && item.linkSubField.length > 0) { - item.linkSubField = item.linkSubField.filter(_item => _inputfields.includes(_item)) - } - if (item.linkSubField && item.linkSubField.length === 0) { - item.linkSubField = null - } - } else { - item.linkSubField = null - } + // 涓嬬骇琛ㄥ崟鎺у埗-瀛楁鍐欏叆 + if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) { + item.linkSubField = item.linkSubField.filter(_item => _inputfields.includes(_item)) + } + if (item.linkSubField && item.linkSubField.length === 0) { + item.linkSubField = null } let newval = '' @@ -226,31 +223,30 @@ item.supvalue = supvals } + if (linkFields[item.field]) { + item.linkFields = linkFields[item.field] + } + supItemVal[item.field] = item.initval + + if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type) && item.resourceType === '1') { + deForms.push(item) + } + return item }) formlist = formlist.map(item => { if (item.type === 'link') { - let supItem = formlist.filter(form => form.field === item.linkField)[0] + item.supInitVal = '' - // 鍏宠仈鏄剧ず鍒椾腑鐨勫瓧娈靛�硷紝閫氳繃璇ュ�艰繃婊や笅鎷夐�夐」 - if (!supItem && data && data.hasOwnProperty(item.linkField)) { - supItem = {initval: data[item.linkField]} + if (supItemVal[item.linkField]) { + item.supInitVal = supItemVal[item.linkField] + } else if (data && data.hasOwnProperty(item.linkField)) { + item.supInitVal = data[item.linkField] } - if (!supItem) { - notification.warning({ - top: 92, - message: '鏈煡璇㈠埌琛ㄥ崟銆�' + item.label + '銆嬪叧鑱斿瓧娈碉紒', - duration: 5 - }) - item.supInitVal = '' - } else { - item.supInitVal = supItem.initval - item.options = item.oriOptions.filter(option => option.ParentID === supItem.initval) - } + item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal) } - return item }) @@ -281,19 +277,16 @@ this.setState({ loaded: true }) - this.improveActionForm() + this.improveActionForm(deForms) }) } /** * @description 鑾峰彇涓嬫媺琛ㄥ崟閫夐」淇℃伅 */ - improveActionForm = () => { + improveActionForm = (deForms) => { const { BID, menuType } = this.props const { formlist } = this.state - - // 闇�瑕佸姩鎬佽幏鍙栦笅鎷夎彍鍗曠殑琛ㄥ崟 - let deForms = formlist.filter(item => ['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type) && item.resourceType === '1' && (item.type === 'link' || item.hidden !== 'true')) if (deForms.length === 0) { return @@ -445,11 +438,7 @@ this.setState({ formlist: _formlist.map(item => { if (item.type === 'link') { - if (item.supInitVal) { - item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal) - } else { - item.options = item.oriOptions - } + item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal) } else if (['select', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type)) { item.options = item.oriOptions } @@ -542,11 +531,7 @@ this.setState({ formlist: _formlist.map(item => { if (item.type === 'link') { - if (item.supInitVal) { - item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal) - } else { - item.options = item.oriOptions - } + item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal) } else if (['select', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type)) { item.options = item.oriOptions } @@ -1291,7 +1276,6 @@ return item }) } - resolve(search) } else { reject(err) diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx index ebe803d..d3c4ef6 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx @@ -244,7 +244,7 @@ } sqlverify = (resolve, reject, type, testScripts) => { - const { searches } = this.props + const { searches, config } = this.props const { columns, setting, scripts } = this.state if (setting.interType !== 'system') { // 涓嶄娇鐢ㄧ郴缁熸帴鍙f椂锛屼笉闇�瑕乻ql楠岃瘉 @@ -278,7 +278,7 @@ } else if (setting.execute !== 'false' || _scripts.length > 0) { let param = { func: 's_debug_sql', - LText: SettingUtils.getDebugSql(setting, _scripts, columns, searches) + LText: SettingUtils.getDebugSql(setting, _scripts, columns, Utils.getRegOptions(searches), config.calendar) } param.LText = Utils.formatOptions(param.LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx index af0e089..3c4d069 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/utils.jsx @@ -7,7 +7,7 @@ * @return {Object} setting 椤甸潰璁剧疆 * @return {Array} columns 鏄剧ず瀛楁 */ - static getDebugSql (setting, scripts, columns, searches) { + static getDebugSql (setting, scripts, columns, searches, calendar) { let sql = '' let _dataresource = '' let _customScript = '' @@ -39,27 +39,31 @@ } // 姝e垯鏇挎崲 - let _regoptions = searches.map(item => { - return { - reg: new RegExp('@' + item.key + '@', 'ig'), - value: `'${item.value}'` - } - }) + let _regoptions = [] let _search = '' - // 鏃ュ巻涓殑骞翠唤鏇挎崲 if (setting.queryType === 'statistics' || _customScript) { - _regoptions.push({ - reg: new RegExp('@calendarDate@', 'ig'), - value: `1970-01-01 00:00:00.000` - }) - _regoptions.push({ - reg: new RegExp('@calendarDate1@', 'ig'), - value: `2030-12-31 23:59:59.999` + _regoptions = searches.map(item => { + return { + reg: new RegExp('@' + item.key + '@', 'ig'), + value: `'0'` + } }) } - if (setting.queryType === 'statistics' && _dataresource) { + // 鏃ュ巻涓殑骞翠唤鏇挎崲 + if (calendar.refresh === 'true') { + _regoptions.push({ + reg: new RegExp('@calendarDate@', 'ig'), + value: `'1970-01-01 00:00:00.000'` + }) + _regoptions.push({ + reg: new RegExp('@calendarDate1@', 'ig'), + value: `'2030-12-31 23:59:59.999'` + }) + } + + if ((setting.queryType === 'statistics' || calendar.refresh === 'true') && _dataresource) { _regoptions.forEach(item => { _dataresource = _dataresource.replace(item.reg, item.value) }) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 55002a4..b102d60 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -69,10 +69,6 @@ }) } - // 鎼滅储鏉′欢锛屾鍒欐浛鎹� - let allSearch = Utils.initMainSearch(search) - allSearch = Utils.getAllSearchOptions(allSearch) - // 鎼滅储鐨剋here鏉′欢 let _search = this.formatSearch(search) _search = Utils.joinMainSearchkey(_search) @@ -84,7 +80,7 @@ setting: _setting, search: _search, arr_field: arr_field.join(','), - regoptions: allSearch, + regoptions: Utils.getRegOptions(search), // 鎼滅储鏉′欢锛屾鍒欐浛鎹� columns: columns, scripts: _scripts }) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx index 273f935..e28b165 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx @@ -38,7 +38,7 @@ let _regoptions = regoptions.map(item => { return { reg: new RegExp('@' + item.key + '@', 'ig'), - value: `'${item.value}'` + value: `'0'` } }) diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 758fcd7..02def1d 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -818,12 +818,12 @@ { obj_name: 'voucher', arr_field: 'ID,NameNO,TypeCharOne', - LText: window.btoa(window.encodeURIComponent('select distinct ModularCode as ID,ModularCode+ModularName+ModularNo as NameNO,TypeCharOne from sModular where deleted=0 and Appkey=case when Appkey=\'\' then \'\' else @Appkey@ end order by ModularCode')) + LText: window.btoa(window.encodeURIComponent(`select distinct ModularCode as ID,ModularCode+ModularName+ModularNo as NameNO,TypeCharOne from sModular where deleted=0 and Appkey=case when Appkey='' then '' else @Appkey@ end order by ModularCode`)) }, { obj_name: 'voucherDetail', arr_field: 'ModularDetailCode,CodeName,BID,VoucherTypeTwo,IDefine1', - LText: window.btoa(window.encodeURIComponent('select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID, VoucherTypeTwo, IDefine1 from sModularDetail where Deleted=0 and VoucherTypeTwo!=\'\' and Appkey=case when Appkey=\'\' then \'\' else @Appkey@ end order by ModularDetailCode')) + LText: window.btoa(window.encodeURIComponent(`select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID, VoucherTypeTwo, IDefine1 from sModularDetail where Deleted=0 and VoucherTypeTwo!='' and Appkey=case when Appkey='' then '' else @Appkey@ end order by ModularDetailCode`)) }, { obj_name: 'noteCodes', diff --git a/src/utils/utils.js b/src/utils/utils.js index a2b1ad5..19713b8 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -524,7 +524,7 @@ } /** - * @description 鎷兼帴鎼滅储鏉′欢main + * @description 鑾峰彇鎼滅储鐢ㄤ簬姝e垯鏇挎崲 * @param {Array} searches 鎼滅储鏉′欢 * @return {String} searchText 鎷兼帴缁撴灉 */ @@ -538,9 +538,7 @@ key: search.key, match: search.match, type: search.type, - label: search.label, - value: search.value, - required: search.required + value: search.value } if (fieldmap.has(item.key)) { @@ -613,6 +611,50 @@ } /** + * @description 鑾峰彇鎼滅储鐢ㄤ簬姝e垯鏇挎崲 + * @param {Array} searches 鎼滅储鏉′欢 + * @return {String} searchText 鎷兼帴缁撴灉 + */ + static getRegOptions (searches) { + if (!searches || searches.length === 0) return [] + + let options = [] + let fieldmap = new Map() + searches.forEach(search => { + let item = { + key: search.field, + value: '0' + } + + if (fieldmap.has(item.key)) { + item.key = item.key + '1' + } + + fieldmap.set(item.key, true) + + if (search.type === 'group') { + options.push({ + key: search.datefield, + value: '0' + }) + if (search.transfer === 'true') { + options.push(item) + } + } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) { + options.push(item) + options.push({ + key: item.key + '1', + value: '0' + }) + } else { + options.push(item) + } + }) + + return options + } + + /** * @description 鎷兼帴鎼滅储鏉′欢datamanage * @param {Array} searches 鎼滅储鏉′欢 * @return {String} searchText 鎷兼帴缁撴灉 -- Gitblit v1.8.0