| | |
| | | |
| | | if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type)) { |
| | | item.options = item.options || [] |
| | | item.options = item.options.filter(cell => { |
| | | cell.value = cell.Value |
| | | cell.label = cell.Text |
| | | |
| | | return !cell.Hide |
| | | }) |
| | | item.$select = true |
| | | if (item.type === 'checkcard') { |
| | | item.options = item.options.filter(cell => { |
| | | cell.$value = cell.$value + '' |
| | | return !cell.Hide |
| | | }) |
| | | } else { |
| | | item.options = item.options.filter(cell => { |
| | | cell.value = cell.Value + '' |
| | | cell.label = cell.Text |
| | | |
| | | return !cell.Hide |
| | | }) |
| | | } |
| | | |
| | | if (item.setAll === 'true' && ['select', 'link', 'radio'].includes(item.type)) { // 添加空值 |
| | | item.options.unshift({ |
| | | key: Utils.getuuid(), |
| | |
| | | newval = '' |
| | | } |
| | | } |
| | | } else if (item.$select && item.resourceType === '0') { |
| | | newval = newval + '' |
| | | } |
| | | |
| | | if (newval !== '$empty') { |
| | |
| | | if (isNaN(item.initval) || item.initval === '') { |
| | | item.initval = 0 |
| | | } |
| | | } else if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && item.resourceType === '1') { |
| | | } else if (item.$select && item.resourceType === '1') { |
| | | deForms.push(item) |
| | | } else if (item.type === 'rate') { |
| | | item.rateCount = item.rateCount || 5 |
| | |
| | | item.rules = [] |
| | | if (item.type === 'text') { |
| | | item.initval = item.initval + '' |
| | | if (/@currentYear@/ig.test(item.initval)) { // 系统变量替换 |
| | | item.initval = item.initval.replace(/@currentYear@/ig, moment().format('YYYY')) |
| | | } |
| | | |
| | | if (item.required === 'true') { |
| | | item.rules.push({ |
| | |
| | | }) |
| | | |
| | | if (localItems.length) { |
| | | deffers.push({ |
| | | $backend: true, |
| | | $type: 's_Get_SelectedList', |
| | | data: localItems |
| | | }) |
| | | if (!window.GLOB.mkHS && window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | localItems.forEach(item => { |
| | | deffers.push({ |
| | | $backend: true, |
| | | $type: 's_Get_SelectedList', |
| | | data: [item] |
| | | }) |
| | | }) |
| | | } else { |
| | | deffers.push({ |
| | | $backend: true, |
| | | $type: 's_Get_SelectedList', |
| | | data: localItems |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (mainItems.length) { |
| | | deffers.push({ |
| | | $backend: true, |
| | | $type: 's_Get_SelectedList', |
| | | data: mainItems, |
| | | rduri: window.GLOB.mainSystemApi |
| | | }) |
| | | if (!window.GLOB.mkHS && window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | mainItems.forEach(item => { |
| | | deffers.push({ |
| | | $backend: true, |
| | | $type: 's_Get_SelectedList', |
| | | data: [item], |
| | | rduri: window.GLOB.mainSystemApi |
| | | }) |
| | | }) |
| | | } else { |
| | | deffers.push({ |
| | | $backend: true, |
| | | $type: 's_Get_SelectedList', |
| | | data: mainItems, |
| | | rduri: window.GLOB.mainSystemApi |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (!deffers.length) return |
| | | |
| | | deffers = deffers.map(item => { |
| | | deffers = deffers.map((item, i) => { |
| | | return new Promise(resolve => { |
| | | Api.getSystemCacheConfig(item, cache).then(res => { |
| | | if (!res.status) { |
| | | if (res.ErrCode !== '-2') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | setTimeout(() => { |
| | | Api.getSystemCacheConfig(item, cache).then(res => { |
| | | if (!res.status) { |
| | | if (res.ErrCode !== '-2') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | skip = true |
| | | } |
| | | skip = true |
| | | } |
| | | resolve(res) |
| | | }) |
| | | resolve(res) |
| | | }) |
| | | }, 30 * i) |
| | | }) |
| | | }) |
| | | |
| | | Promise.all(deffers).then(response => { |
| | | let result = {...response[0], ...(response[1] || {})} |
| | | let result = {} |
| | | |
| | | response.forEach(item => { |
| | | result = {...result, ...item} |
| | | }) |
| | | |
| | | delete result.ErrCode |
| | | delete result.ErrMesg |