| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | menuType: PropTypes.object, // 菜单类型,是否为HS |
| | | action: PropTypes.object, // 按钮信息、表单列表 |
| | | data: PropTypes.any, // 表格数据 |
| | | BID: PropTypes.any, // 主表ID |
| | |
| | | let item = fieldMap.get(cell.field) |
| | | |
| | | // 下级表单控制-字段写入 |
| | | if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) && item.linkSubField) { |
| | | if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true') || (item.type === 'cascader' && item.resourceType !== '2')) && item.linkSubField) { |
| | | item.subFields = [] |
| | | item.linkSubField.forEach(m => { |
| | | let n = fieldMap.get(m) |
| | |
| | | item.options = fromJS(item.oriOptions).toJS() |
| | | } |
| | | item.linkSubField = null |
| | | } else if (item.type === 'cascader' && item.fillField) { |
| | | let n = fieldMap.get(item.fillField) |
| | | item.fillFieldId = n ? n.uuid : '' |
| | | } |
| | | |
| | | // if (item.type === 'link') { |
| | |
| | | } |
| | | |
| | | if (item.subFields && item.options.length > 0) { |
| | | let initval = item.initval |
| | | if (item.type === 'cascader' && item.separator) { |
| | | initval = initval.split(item.separator).pop() |
| | | } |
| | | // eslint-disable-next-line |
| | | let option = item.options.filter(cell => item.initval == cell.value)[0] |
| | | let option = item.options.filter(cell => initval == cell.value)[0] |
| | | |
| | | if (option) { |
| | | reFieldsVal = reFieldsVal || {} |
| | | item.subFields.forEach(n => { |
| | | reFieldsVal[n.field] = option[n.field] |
| | | }) |
| | | } |
| | | } else if (item.fillField && item.initval && item.separator && item.options.length > 0) { |
| | | let initvals = item.initval.split(item.separator) |
| | | let label = [] |
| | | initvals.forEach(m => { |
| | | // eslint-disable-next-line |
| | | let option = item.options.filter(cell => m == cell.value)[0] |
| | | if (option) { |
| | | label.push(option.label) |
| | | } |
| | | }) |
| | | |
| | | label = label.join(item.separator) |
| | | |
| | | if (label) { |
| | | reFieldsVal = reFieldsVal || {} |
| | | reFieldsVal[item.fillField] = label |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (deForms.length > 0) { |
| | | if (this.props.menuType !== 'HS' && options.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | if (!window.GLOB.mkHS && options.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | this.improveSimpleActionForm(deForms) |
| | | } else { |
| | | this.improveActionForm(deForms) |
| | |
| | | * @description 获取下拉表单选项信息 |
| | | */ |
| | | improveActionForm = (deForms) => { |
| | | const { BID, menuType, action } = this.props |
| | | const { BID, action } = this.props |
| | | |
| | | let deffers = [] |
| | | let mainItems = [] // 云端或单点数据 |
| | |
| | | } |
| | | }) |
| | | |
| | | if (menuType !== 'HS' && options.sysType !== 'local') { |
| | | if (!window.GLOB.mkHS && options.sysType !== 'local') { |
| | | localItems = [...localItems, ...mainItems] |
| | | mainItems = [] |
| | | } |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | if (menuType === 'HS') { // 云端数据验证 |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | | |
| | |
| | | mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp) |
| | | |
| | | if (menuType === 'HS') { // 云端数据验证 |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | mainparam.open_key = Utils.encryptOpenKey(mainparam.secretkey, mainparam.timestamp) |
| | | if (options.cloudServiceApi) { |
| | | mainparam.rduri = options.cloudServiceApi |
| | |
| | | } |
| | | |
| | | if (item.subFields && item.options.length > 0) { |
| | | let initval = item.initval |
| | | if (item.type === 'cascader' && item.separator) { |
| | | initval = initval.split(item.separator).pop() |
| | | } |
| | | // eslint-disable-next-line |
| | | let option = item.options.filter(cell => item.initval == cell.value)[0] |
| | | let option = item.options.filter(cell => initval == cell.value)[0] |
| | | |
| | | if (option) { |
| | | reFieldsVal = reFieldsVal || {} |
| | | item.subFields.forEach(n => { |
| | | reFieldsVal[n.field] = option[n.field] |
| | | }) |
| | | } |
| | | } else if (item.fillField && item.initval && item.separator && item.options.length > 0) { |
| | | let initvals = item.initval.split(item.separator) |
| | | let label = [] |
| | | initvals.forEach(m => { |
| | | // eslint-disable-next-line |
| | | let option = item.options.filter(cell => m == cell.value)[0] |
| | | if (option) { |
| | | label.push(option.label) |
| | | } |
| | | }) |
| | | |
| | | label = label.join(item.separator) |
| | | |
| | | if (label) { |
| | | reFieldsVal = reFieldsVal || {} |
| | | reFieldsVal[item.fillField] = label |
| | | } |
| | | } |
| | | } |