| | |
| | | } |
| | | }) |
| | | param.sign = md5(values) |
| | | param.t = new Date().getTime() |
| | | param.t = new Date().getTime(); |
| | | |
| | | ['arr_field', 'LText_field', 'custom_script', 'LText1', 'LText', 'LText2', 'DateCount'].forEach(key => { |
| | | if (param[key]) { |
| | | let val = param[key] |
| | | delete param[key] |
| | | param[key] = val |
| | | } |
| | | }) |
| | | |
| | | return param |
| | | } |
| | |
| | | writable: false, |
| | | value: GLOB.linkurl |
| | | }) |
| | | Object.defineProperty(GLOB, 'dataFormat', { |
| | | writable: false, |
| | | value: GLOB.dataFormat |
| | | }) |
| | | Object.defineProperty(window, 'GLOB', { |
| | | writable: false, |
| | | value: GLOB |
| | |
| | | |
| | | if (card.OpenType === 'form') { |
| | | if (card.formType === 'switch') { |
| | | btnElement = (<Switch style={_style} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) |
| | | btnElement = (<Switch style={_style} className={card.size === 'large' ? 'ant-switch-large' : ''} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) |
| | | } else { |
| | | btnElement = (<Checkbox style={_style}></Checkbox>) |
| | | } |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | .ant-switch-large { |
| | | min-width: 60px; |
| | | height: 30px; |
| | | line-height: 28px; |
| | | |
| | | .ant-switch-inner { |
| | | margin-right: 5px; |
| | | margin-left: 30px; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | .ant-switch-large.ant-switch-checked { |
| | | .ant-switch-inner { |
| | | margin-right: 30px; |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | .ant-switch-large::after { |
| | | width: 26px; |
| | | height: 26px; |
| | | } |
| | | } |
| | |
| | | field: 'selected', |
| | | label: '首行选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={0} max={10000} precision={0} />)} |
| | | })(<InputNumber min={0} max={10000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | type: 'text', |
| | | key: 'output', |
| | | label: '返回值', |
| | | tooltip: '执行成功后的返回值。', |
| | | tooltip: '执行成功后的返回值。例如:@id', |
| | | initVal: card.output || '', |
| | | required: false |
| | | }, |
| | |
| | | { required: item.required, message: dict['form.required.input'] + item.label + '!' } |
| | | ] |
| | | |
| | | content = <InputNumber min={item.min} max={item.max} precision={item.precision} /> |
| | | content = <InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/> |
| | | } else if (item.type === 'select') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.select'] + item.label + '!' } |
| | |
| | | type: 'text', |
| | | key: 'output', |
| | | label: '返回值', |
| | | tooltip: '执行成功后的返回值。', |
| | | tooltip: '执行成功后的返回值。例如:@id', |
| | | initVal: card.output || '', |
| | | required: false, |
| | | forbid: viewType === 'popview' |
| | |
| | | label: '开关尺寸', |
| | | initVal: card.size || 'default', |
| | | options: [{ |
| | | value: 'default', |
| | | value: 'large', |
| | | text: '大' |
| | | }, { |
| | | value: 'default', |
| | | text: '中' |
| | | }, { |
| | | value: 'small', |
| | | text: '小' |
| | | }] |
| | |
| | | label: Formdict['model.sort'], |
| | | initVal: card.IsSort || 'false', |
| | | required: true, |
| | | forbidden: card.isSub, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | |
| | | type: 'radio', |
| | | key: 'IsSort', |
| | | label: Formdict['model.sort'], |
| | | initVal: card.IsSort || 'true', |
| | | initVal: card.IsSort || (card.isSub ? 'false' : 'true'), |
| | | required: true, |
| | | forbidden: card.isSub, |
| | | // forbidden: card.isSub, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | |
| | | title: col.label, |
| | | dataIndex: col.uuid, |
| | | align: col.Align, |
| | | sorter: !isSub && col.IsSort === 'true', |
| | | // sorter: !isSub && col.IsSort === 'true', |
| | | sorter: col.IsSort === 'true', |
| | | onCell: () => ({ |
| | | column: col, |
| | | width: col.Width, |
| | |
| | | field: 'selected', |
| | | label: '首行选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | |
| | | config.setting.selected = 'false' |
| | | } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { |
| | | config.setting.selected = 'false' |
| | | } else { |
| | | config.setting.orisel = true |
| | | } |
| | | |
| | | let autoMatic = null |
| | |
| | | } |
| | | } |
| | | |
| | | loadData = () => { |
| | | loadData = (id) => { |
| | | const { MenuID } = this.props |
| | | const { setting, search, loadCustomApi, hasReqFields, ContainerId } = this.state |
| | | |
| | |
| | | |
| | | this.loadOutResource() |
| | | if (setting.execType === 'async') { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } else { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 主表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | async loadmaindata (id) { |
| | | const { setting, arr_field, search, orderBy, BID, pageIndex, pageSize, absFields, autoMatic } = this.state |
| | | |
| | | this.setState({ |
| | |
| | | start = pageSize * (pageIndex - 1) + 1 |
| | | } |
| | | |
| | | if (setting.selected !== 'false') { |
| | | if (setting.selected !== 'false' || (setting.orisel && id)) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID) |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | /** |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = (btn) => { |
| | | reloadtable = (btn, id = '') => { |
| | | if (!btn || btn.resetPageIndex !== 'false') { |
| | | MKEmitter.emit('resetTable', this.props.MenuID) // 列表重置 |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | }) |
| | | } else { |
| | | MKEmitter.emit('resetTable', this.props.MenuID, 'false') // 列表重置 |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | } |
| | | |
| | |
| | | if (position === 'line' && lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } |
| | | } |
| | | |
| | |
| | | .ant-mk-picture.scale { |
| | | cursor: zoom-in; |
| | | } |
| | | .ant-switch-large { |
| | | min-width: 60px; |
| | | height: 30px; |
| | | line-height: 28px; |
| | | |
| | | .ant-switch-inner { |
| | | margin-right: 5px; |
| | | margin-left: 30px; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | .ant-switch-large.ant-switch-checked { |
| | | .ant-switch-inner { |
| | | margin-right: 30px; |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | .ant-switch-large::after { |
| | | width: 26px; |
| | | height: 26px; |
| | | } |
| | | } |
| | | .card-cell-list::after { |
| | | content: ' '; |
| | |
| | | let selected = 'false' |
| | | if (_config.wrap.selected === 'always' || _config.wrap.selected === 'init') { |
| | | selected = _config.wrap.selected |
| | | } else { |
| | | _config.wrap.selected = 'false' |
| | | } |
| | | |
| | | if (_data) { |
| | |
| | | * @param {*} position // 刷新位置 |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn, id, lines) => { |
| | | refreshByButtonResult = (menuId, position, btn, id = '', lines) => { |
| | | const { config, BID, supComs, supNodes } = this.state |
| | | |
| | | if (config.uuid !== menuId) return |
| | |
| | | if (lines && lines.length === 1) { |
| | | this.loadLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | } else if (!btn || btn.resetPageIndex !== 'false') { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | }) |
| | | } else { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | } |
| | | } else { |
| | |
| | | if (lines && lines.length === 1) { |
| | | this.loadLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | } else if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | } else if (!btn || btn.resetPageIndex !== 'false') { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | }) |
| | | } else { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | checkTopLine = () => { |
| | | checkTopLine = (id) => { |
| | | const { config, data } = this.state |
| | | |
| | | if (!data || data.length === 0 || data[0].$disabled) { |
| | |
| | | return |
| | | } |
| | | |
| | | let index = 0 |
| | | if (id) { |
| | | index = data.findIndex(item => item.$$uuid === id) |
| | | if (index === -1) { |
| | | index = 0 |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | activeKey: 0, |
| | | selectKeys: [0], |
| | | selectedData: [data[0]] |
| | | activeKey: index, |
| | | selectKeys: [index], |
| | | selectedData: [data[index]] |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, data[0].$$uuid, data[0]) |
| | | MKEmitter.emit('resetSelectLine', config.uuid, data[index].$$uuid, data[index]) |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [data[0]], data.length === 1) |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [data[index]], data.length === 1) |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | async loadData () { |
| | | async loadData (id) { |
| | | const { mainSearch, menuType } = this.props |
| | | const { config, arr_field, pageIndex, search, BID, BData, selected } = this.state |
| | | |
| | |
| | | loading: false |
| | | }) |
| | | |
| | | if (selected !== 'false') { |
| | | if (selected !== 'false' || (id && config.wrap.selected !== 'false')) { |
| | | setTimeout(() => { |
| | | this.checkTopLine() |
| | | this.checkTopLine(id) |
| | | }, 200) |
| | | if (selected === 'init') { |
| | | this.setState({selected: 'false'}) |
| | |
| | | start = config.setting.pageSize * (pageIndex - 1) + 1 |
| | | } |
| | | |
| | | if (selected !== 'false') { |
| | | if (selected !== 'false' || (id && config.wrap.selected !== 'false')) { |
| | | setTimeout(() => { |
| | | this.checkTopLine() |
| | | this.checkTopLine(id) |
| | | }, 200) |
| | | if (selected === 'init') { |
| | | this.setState({selected: 'false'}) |
| | |
| | | MKEmitter.removeListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | | mkCheckTopLine = (menuId) => { |
| | | mkCheckTopLine = (menuId, id) => { |
| | | const { MenuID, data, setting } = this.props |
| | | |
| | | if (MenuID !== menuId || !data || data.length === 0) return |
| | | if (data[0].$disabled) return |
| | | |
| | | this.changedata(0) |
| | | this.setState({ selectedRowKeys: [0], activeIndex: 0 }) |
| | | this.props.chgSelectData([data[0]]) |
| | | let index = 0 |
| | | if (id) { |
| | | index = data.findIndex(item => item.$$uuid === id) |
| | | if (index === -1) { |
| | | index = 0 |
| | | } |
| | | } |
| | | |
| | | if (data[index].$disabled) return |
| | | |
| | | this.changedata(index) |
| | | this.setState({ selectedRowKeys: [index], activeIndex: index }) |
| | | this.props.chgSelectData([data[index]]) |
| | | |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1) |
| | | MKEmitter.emit('syncBalconyData', MenuID, [data[index]], data.length === 1) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | changedata = (index) => { |
| | | const { MenuID, data, setting } = this.props |
| | | const { MenuID, data } = this.props |
| | | |
| | | let _id = '' |
| | | let _data = '' |
| | | |
| | | if (data && data.length > 0 && index !== '') { |
| | | _id = data[index][setting.primaryKey] || '' |
| | | _id = data[index].$$uuid || '' |
| | | _data = data[index] || '' |
| | | } |
| | | |
| | |
| | | |
| | | if (setting.selected !== 'always' && setting.selected !== 'init') { |
| | | setting.selected = 'false' |
| | | } else { |
| | | setting.orisel = true |
| | | } |
| | | |
| | | if (_config.setting.sync === 'true' && data) { |
| | |
| | | * @param { Boolean } reset 表格是否重置 |
| | | * @param { String } repage 表格是否重置页码 |
| | | */ |
| | | async loadmaindata (reset, repage) { |
| | | async loadmaindata (reset, repage, id) { |
| | | const { mainSearch } = this.props |
| | | const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize, BData } = this.state |
| | | |
| | |
| | | selectedData: [], |
| | | total: 0 |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换 |
| | | reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置 |
| | | if (setting.$hasSyncModule) { |
| | |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | if (setting.selected !== 'false' && result.data && result.data.length > 0) { |
| | | if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid) |
| | | MKEmitter.emit('mkCheckTopLine', config.uuid, id) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | /** |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = (btn) => { |
| | | reloadtable = (btn, id) => { |
| | | if (!btn || btn.resetPageIndex !== 'false') { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadmaindata(true, 'true') |
| | | this.loadmaindata(true, 'true', id) |
| | | this.getStatFieldsValue() |
| | | }) |
| | | } else { |
| | | this.loadmaindata(true, 'false') |
| | | this.loadmaindata(true, 'false', id) |
| | | this.getStatFieldsValue() |
| | | } |
| | | } |
| | |
| | | if (lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } |
| | | } else if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } |
| | | } else { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } |
| | | } |
| | | |
| | |
| | | config.setting.selected = 'false' |
| | | } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { |
| | | config.setting.selected = 'false' |
| | | } else { |
| | | config.setting.orisel = true |
| | | } |
| | | |
| | | if (config.setting.controlField) { |
| | |
| | | } |
| | | } |
| | | |
| | | loadData = () => { |
| | | loadData = (id) => { |
| | | const { mainSearch } = this.props |
| | | const { setting, BID, search, loadCustomApi, hasReqFields } = this.state |
| | | |
| | |
| | | |
| | | this.loadOutResource(searches) |
| | | if (setting.execType === 'async') { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } else { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 子表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | async loadmaindata (id) { |
| | | const { mainSearch } = this.props |
| | | const { setting, BID, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state |
| | | |
| | |
| | | start = pageSize * (pageIndex - 1) + 1 |
| | | } |
| | | |
| | | if (setting.selected !== 'false') { |
| | | if (setting.selected !== 'false' || (setting.orisel && id)) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID) |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | /** |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = (btn) => { |
| | | reloadtable = (btn, id = '') => { |
| | | if (!btn || btn.resetPageIndex !== 'false') { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid) // 列表重置 |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | }) |
| | | } else { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid, 'false') // 列表重置 |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | } |
| | | |
| | |
| | | if (lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } |
| | | } else if (position === 'grid' || position === 'view') { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } else if (position === 'maingrid' || position === 'mainline') { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | if (Tab.supMenu && BID) { |
| | | MKEmitter.emit('reloadData', Tab.supMenu, BID) // 主表重置 |
| | | } else if (!Tab.supMenu && Tab.level === 0 && BID) { |
| | | MKEmitter.emit('reloadData', SupMenuID, BID) // 树形结构,0级标签 |
| | | } |
| | | } else if (position === 'equaltab') { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | if (Tab.equalTab && Tab.equalTab.length > 0) { |
| | | MKEmitter.emit('reloadData', Tab.equalTab.join(',')) // 同级标签重置 |
| | | } |
| | |
| | | config.setting.selected = 'false' |
| | | } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { |
| | | config.setting.selected = 'false' |
| | | } else { |
| | | config.setting.orisel = true |
| | | } |
| | | |
| | | if (config.setting.controlField) { |
| | |
| | | } |
| | | } |
| | | |
| | | loadData = () => { |
| | | loadData = (id) => { |
| | | const { setting, search, hasReqFields, loadCustomApi } = this.state |
| | | |
| | | let searches = fromJS(search).toJS() |
| | |
| | | |
| | | this.loadOutResource(searches) |
| | | if (setting.execType === 'async') { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } else { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 子表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | async loadmaindata (id) { |
| | | const { BID } = this.props |
| | | const { setting, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state |
| | | |
| | |
| | | start = pageSize * (pageIndex - 1) + 1 |
| | | } |
| | | |
| | | if (setting.selected !== 'false') { |
| | | if (setting.selected !== 'false' || (setting.orisel && id)) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID) |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | /** |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = (btn) => { |
| | | reloadtable = (btn, id) => { |
| | | if (!btn || btn.resetPageIndex !== 'false') { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid) // 列表重置 |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | }) |
| | | } else { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid, 'false') // 列表重置 |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | |
| | | } |
| | |
| | | * @param {*} position // 刷新位置 |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn, id, lines) => { |
| | | refreshByButtonResult = (menuId, position, btn, id = '', lines) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | |
| | | if (position === 'line' && lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } |
| | | MKEmitter.emit('refreshPopButton', this.props.Tab.uuid) |
| | | } |
| | |
| | | |
| | | if (btn.OpenType === 'form') { |
| | | if (btn.formType === 'switch') { |
| | | return <Switch loading={loading} checked={check} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} onChange={(val,e) => {e.stopPropagation();this.actionTrigger()}} style={style} size={btn.size} checkedChildren={btn.openText || ''} unCheckedChildren={btn.closeText || ''}/> |
| | | return <Switch loading={loading} checked={check} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} onChange={(val,e) => {e.stopPropagation();this.actionTrigger()}} style={style} className={btn.size === 'large' ? 'ant-switch-large' : ''} size={btn.size} checkedChildren={btn.openText || ''} unCheckedChildren={btn.closeText || ''}/> |
| | | } else { |
| | | return <Checkbox disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} checked={check} onChange={(e) => {e.stopPropagation();this.actionTrigger()}} style={style}></Checkbox> |
| | | } |
| | |
| | | MKEmitter.removeListener('mkTableCheckTopLine', this.mkTableCheckTopLine) |
| | | } |
| | | |
| | | mkTableCheckTopLine = (id) => { |
| | | if (id !== this.props.MenuID) return |
| | | mkTableCheckTopLine = (menuid, id) => { |
| | | const {MenuID, data} = this.props |
| | | |
| | | if (this.props.data.length > 0) { |
| | | this.changeRow(this.props.data[0], 0) |
| | | if (menuid !== MenuID || data.length === 0) return |
| | | |
| | | let index = 0 |
| | | if (id) { |
| | | index = data.findIndex(item => item.$$uuid === id) |
| | | if (index === -1) { |
| | | index = 0 |
| | | } |
| | | } |
| | | |
| | | this.changeRow(data[index], index) |
| | | } |
| | | |
| | | autoSelectData = (id, index) => { |
| | |
| | | { required: item.required, message: dict['form.required.input'] + item.label + '!' } |
| | | ] |
| | | |
| | | content = <InputNumber min={item.min} max={item.max} precision={item.precision} /> |
| | | content = <InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/> |
| | | } else if (item.type === 'select') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.select'] + item.label + '!' } |
| | |
| | | </Col> |
| | | {tableType !== '' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="在启用无人值守功能时无效。"> |
| | | <Tooltip placement="topLeft" title="当按钮执行完成并返回主键值时,默认选中主键值对应行。注:在启用无人值守功能时无效。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 首行选中 |
| | | </Tooltip> |
| | |
| | | type: 'text', |
| | | key: 'output', |
| | | label: '返回值', |
| | | tooltip: '执行成功后的返回值。', |
| | | tooltip: '执行成功后的返回值。例如:@id', |
| | | initVal: card.output || '', |
| | | required: false |
| | | }, |
| | |
| | | MenuID: tempId |
| | | } |
| | | |
| | | window.GLOB.dataFormat = false // 打印去除水印 |
| | | |
| | | if (window.GLOB.mainSystemApi) { // 从单点登录服务器取打印配置信息 |
| | | _param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | |
| | | if (component.search) component.search = [] |
| | | component.data = [] // 初始化数据为空 |
| | | |
| | | if (component.type === 'table' && component.subtype === 'normaltable') { |
| | | let getColumns = (cols) => { |
| | | return cols.map(item => { |
| | | if (item.type === 'colspan') { |
| | | item.subcols = getColumns(item.subcols) |
| | | } else { |
| | | item.IsSort = 'false' |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | component.cols = getColumns(component.cols) |
| | | } |
| | | |
| | | if (component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | } |