From f7d1f17bdcb8c3e794a798165737bb7529dbe8ca Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 三月 2020 12:15:19 +0800 Subject: [PATCH] 2020-03-26 --- src/tabviews/zshare/verifycard/tabcard/columnform/index.scss | 0 src/tabviews/zshare/verifycard/index.jsx | 11 + src/tabviews/zshare/actionList/index.jsx | 8 src/tabviews/subtable/index.jsx | 9 src/tabviews/subtabtable/index.jsx | 79 +-------- src/tabviews/commontable/index.jsx | 9 src/tabviews/zshare/normalTable/index.jsx | 12 + src/tabviews/managetable/index.jsx | 28 ++ src/tabviews/zshare/verifycard/tabcard/index.jsx | 115 ++++++++------ src/templates/comtableconfig/index.jsx | 4 src/tabviews/zshare/verifycard/tabcard/columnform/index.jsx | 181 ++++++++++++++++++++++ 11 files changed, 322 insertions(+), 134 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 24c0f60..ce24774 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -13,8 +13,6 @@ import {refreshTabView, modifyTabview} from '@/store/action' import MainTable from '@/tabviews/zshare/normalTable' -// import MainAction from '@/tabviews/zshare/actionList' -// import VerifyCard from '@/tabviews/zshare/verifycard' import MainSearch from '@/tabviews/zshare/topSearch' import NotFount from '@/components/404' import './index.scss' @@ -363,7 +361,7 @@ triggerBtn: { uuid: new Date().getTime(), parentId: key, - button: item, + button: {...item, uuid: btnkey}, data: null } }) @@ -1049,6 +1047,11 @@ this.reloadview() } this.props.refreshTabView('') + } else if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { + let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0] + if (selectTab && selectTab.MenuID === this.props.MenuID) { + this.setShortcut() + } } } diff --git a/src/tabviews/managetable/index.jsx b/src/tabviews/managetable/index.jsx index 86ec7d4..cb4e2b7 100644 --- a/src/tabviews/managetable/index.jsx +++ b/src/tabviews/managetable/index.jsx @@ -15,12 +15,12 @@ import {refreshTabView, modifyTabview} from '@/store/action' import MainTable from '@/tabviews/zshare/normalTable' -import MainAction from '@/tabviews/zshare/actionList' import MainSearch from '@/tabviews/zshare/topSearch' import NotFount from '@/components/404' import './index.scss' const SubTable = asyncLoadComponent(() => import('@/tabviews/subtable')) +const MainAction = asyncComponent(() => import('@/tabviews/zshare/actionList')) const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) const FormTab = asyncComponent(() => import('@/tabviews/formtab')) @@ -64,7 +64,8 @@ treevisible: false, // 鑿滃崟缁撴瀯鏍戝脊妗嗘樉绀洪殣钘忔帶鍒� tabBtn: null, // 琛ㄥ崟鏍囩鎸夐挳 tabParam: null, // 琛ㄥ崟鏍囩鍙傛暟 - refreshtabs: null // 闇�瑕佸埛鏂扮殑鏍囩闆� + refreshtabs: null, // 闇�瑕佸埛鏂扮殑鏍囩闆� + triggerBtn: null // 鎸夐挳瑙﹀彂 } /** @@ -518,7 +519,15 @@ orderBy: '', search: '', BIDs: {}, - pickup: false + pickup: false, + popAction: false, + popData: false, + visible: false, + treevisible: false, + tabBtn: null, + tabParam: null, + refreshtabs: null, + triggerBtn: null }, () => { this.loadconfig() }) @@ -615,7 +624,14 @@ * @description 琛ㄦ牸涓紝鎸夐挳瑙﹀彂浜嬩欢浼犻�� */ buttonTrigger = (btn, record) => { - this.refs.mainButton.actionTrigger(btn, record) + this.setState({ + triggerBtn: { + uuid: new Date().getTime(), + parentId: this.props.MenuID, + button: btn, + data: record + } + }) } /** @@ -810,7 +826,7 @@ } render() { - const { view, setting, searchlist, actions, columns, loadingview, viewlost, pickup, config } = this.state + const { view, setting, searchlist, actions, columns, loadingview, viewlost, pickup, config, triggerBtn } = this.state return ( <div> @@ -825,13 +841,13 @@ } {actions && setting.onload !== 'false' ? <MainAction - ref="mainButton" BID="" type="main" menuType="HS" setting={setting} actions={actions} dict={this.state.dict} + triggerBtn={triggerBtn} MenuID={this.props.MenuID} logcolumns={this.state.logcolumns} ContainerId={this.state.ContainerId} diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index e11eef8..829ebfe 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -12,14 +12,14 @@ import options from '@/store/options.js' import SubTable from '@/tabviews/zshare/normalTable' -// import SubAction from '@/tabviews/zshare/actionList' import SubSearch from '@/tabviews/zshare/topSearch' +import asyncComponent from '@/utils/asyncComponent' import asyncLoadComponent from '@/utils/asyncLoadComponent' import NotFount from '@/components/404' import './index.scss' -const SubAction = asyncLoadComponent(() => import('@/tabviews/zshare/actionList')) +const SubAction = asyncComponent(() => import('@/tabviews/zshare/actionList')) const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable')) class SubTabViewTable extends Component { @@ -57,7 +57,6 @@ pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 orderBy: '', // 鎺掑簭 search: '', // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� - configMap: {}, // 椤甸潰閰嶇疆淇℃伅锛氫笅鎷夈�佹寜閽瓑 popAction: false, // 寮规椤甸潰锛屾寜閽俊鎭� popData: false, // 寮规椤甸潰锛屾墍閫夌殑琛ㄦ牸鏁版嵁 visible: false, // 寮规鏄剧ず闅愯棌鎺у埗 @@ -625,7 +624,7 @@ pageSize: 10, orderBy: '', search: '', - configMap: {} + triggerBtn: null }, () => { this.loadconfig() }) @@ -780,7 +779,7 @@ BID={this.props.BID} BData={this.props.BData} dict={this.state.dict} - MenuID={this.props.SupMenuID} + MenuID={this.props.MenuID} permRoles={this.props.permRoles} logcolumns={this.state.logcolumns} refreshdata={this.refreshbyaction} diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 0c4b5be..8057ba0 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -11,12 +11,14 @@ import Utils from '@/utils/utils.js' import options from '@/store/options.js' +import asyncComponent from '@/utils/asyncComponent' import SubTable from '@/tabviews/zshare/normalTable' -import SubAction from '@/tabviews/zshare/actionList' import SubSearch from '@/tabviews/zshare/topSearch' import NotFount from '@/components/404' import './index.scss' + +const SubAction = asyncComponent(() => import('@/tabviews/zshare/actionList')) class SubTabModalTable extends Component { static propTpyes = { @@ -49,7 +51,7 @@ pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 orderBy: '', // 鎺掑簭 search: '', // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� - configMap: {} // 椤甸潰閰嶇疆淇℃伅锛氫笅鎷夈�佹寜閽瓑 + triggerBtn: null // 鎸夐挳瑙﹀彂 } /** @@ -532,7 +534,7 @@ pageSize: 10, orderBy: '', search: '', - configMap: {} + triggerBtn: null }, () => { this.loadconfig() }) @@ -550,68 +552,10 @@ this.reloadtable() } else if (btn.execError === 'view' && type === 'error') { this.reloadview() - } else if (type === 'excelOut') { - this.handleDefaultExcelout(btn) } if (type === 'success') { this.props.refreshSupView() } - } - - /** - * @description 浣跨敤榛樿瀛樺偍杩囩▼ sPC_Get_TableData 瀵煎嚭excel琛ㄦ牸 - */ - handleDefaultExcelout = (btn) => { - const { MenuName } = this.props - const { arr_field, orderBy, search, setting, config } = this.state - - let _arr_labels = [] // 鍒楀悕绉伴泦 - let _arr_label_field = [] // 鍒楀悕绉板瓧娈甸泦 - - config.columns.forEach(col => { - if (col.field) { - _arr_labels.push(col.label) - _arr_label_field.push(`${col.field} as ${col.label}`) - } - }) - - _arr_labels = _arr_labels.join(',') - _arr_label_field = _arr_label_field.join(',') - - let _search = Utils.joinMainSearchkey(search) - _search = _search ? 'where (' + _search + ')' : '' - // 鑾峰彇鍒楄〃鏁版嵁 - let param = { - func: 'sPC_Get_TableData', - obj_name: 'data', - arr_field: _arr_labels, - BID: this.props.BID, - appkey: window.GLOB.appkey || '' - } - - let _orderBy = orderBy || setting.order - let _dataresource = setting.dataresource - - if (/\s/.test(_dataresource)) { - _dataresource = '(' + _dataresource + ') tb' - } - - let LText = `select ${_arr_label_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` - - param.LText = Utils.formatOptions(LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - param.DateCount = '' - - let name = `${MenuName}${moment().format('YYYYMMDDHHmmss')}.xlsx` - - Api.getExcelOut(param, name).then(res => { - if (res && res.status === false) { - this.refs.subtabButton.execError(res, btn) - } else { - this.refs.subtabButton.execSuccess(btn) - } - }) } /** @@ -629,7 +573,14 @@ * @description 琛ㄦ牸涓紝鎸夐挳瑙﹀彂浜嬩欢浼犻�� */ buttonTrigger = (btn, record) => { - this.refs.subtabButton.actionTrigger(btn, record) + this.setState({ + triggerBtn: { + uuid: new Date().getTime(), + parentId: this.props.MenuID, + button: btn, + data: record + } + }) } UNSAFE_componentWillMount () { @@ -651,7 +602,7 @@ } render() { - const { setting, searchlist, actions, columns, loadingview, viewlost } = this.state + const { setting, searchlist, actions, columns, loadingview, viewlost, triggerBtn } = this.state return ( <div className="subtabtable" id={'subtabtable' + this.props.MenuID}> @@ -666,8 +617,8 @@ {actions ? <div style={{minHeight: '25px'}}> <SubAction - ref="subtabButton" type="subtab" + triggerBtn={triggerBtn} menuType={this.props.menuType} setting={setting} actions={actions} diff --git a/src/tabviews/zshare/actionList/index.jsx b/src/tabviews/zshare/actionList/index.jsx index 1898fda..4536ca8 100644 --- a/src/tabviews/zshare/actionList/index.jsx +++ b/src/tabviews/zshare/actionList/index.jsx @@ -53,7 +53,13 @@ UNSAFE_componentWillReceiveProps(nextProps) { if (nextProps.triggerBtn && !is(fromJS(this.props.triggerBtn), fromJS(nextProps.triggerBtn)) && nextProps.triggerBtn.parentId === this.props.MenuID) { if (!this.state.loadingUuid && !this.state.visible && !this.state.running) { - this.actionTrigger(nextProps.triggerBtn.button, nextProps.triggerBtn.data) + let _btn = nextProps.triggerBtn.button + if (!_btn.OpenType) { + _btn = this.props.actions.filter(item => item.uuid === _btn.uuid)[0] + } + if (_btn) { + this.actionTrigger(_btn, nextProps.triggerBtn.data) + } } } } diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 6bc177f..fac986c 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -32,8 +32,8 @@ const { columns } = this.props let _columns = [] - columns.forEach(item => { - if (item.hidden === 'true') return + columns.forEach((item, index) => { + if (item.hidden === true || item.hidden === 'true') return let cell = { align: item.Align, @@ -45,6 +45,14 @@ return this.getContent(item, record) } } + + if (item.fixed === true || item.fixed === 'true') { + if (index < columns.length / 2) { + cell.fixed = 'left' + } else { + cell.fixed = 'right' + } + } _columns.push(cell) }) diff --git a/src/tabviews/zshare/verifycard/index.jsx b/src/tabviews/zshare/verifycard/index.jsx index 7b2ea3b..07a9e8b 100644 --- a/src/tabviews/zshare/verifycard/index.jsx +++ b/src/tabviews/zshare/verifycard/index.jsx @@ -35,6 +35,7 @@ this.setState({ loadingview: true }) + menuParam.push({ uuid: MenuID, @@ -66,6 +67,7 @@ label: item.label, Width: item.Width, hidden: item.hidden || false, + fixed: item.fixed || false, sort: item.sort || 0 } }) @@ -95,6 +97,9 @@ top: 92, message: errors[0].message, duration: 10 + }) + this.setState({ + loading: false }) return } @@ -247,6 +252,7 @@ label: item.label, Width: item.Width, hidden: item.hidden || false, + fixed: item.fixed || false, sort: item.sort || 0 } }) @@ -271,7 +277,10 @@ }) } else { this.setState({ - loading: false + loading: false, + menuParam: menuParam + }, () => { + this.getInitParam() }) } } diff --git a/src/tabviews/zshare/verifycard/tabcard/columnform/index.jsx b/src/tabviews/zshare/verifycard/tabcard/columnform/index.jsx new file mode 100644 index 0000000..e92f497 --- /dev/null +++ b/src/tabviews/zshare/verifycard/tabcard/columnform/index.jsx @@ -0,0 +1,181 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { Form, Row, Col, Button, Input, InputNumber, Radio } from 'antd' +import './index.scss' + +const shortkeycode = { + 65: 'A', + 66: 'B', + 67: 'C', + 68: 'D', + 69: 'E', + 70: 'F', + 71: 'G', + 72: 'H', + 73: 'I', + 74: 'J', + 75: 'K', + 76: 'L', + 77: 'M', + 78: 'N', + 79: 'O', + 80: 'P', + 81: 'Q', + 82: 'R', + 83: 'S', + 84: 'T', + 85: 'U', + 86: 'V', + 87: 'W', + 88: 'X', + 89: 'Y', + 90: 'Z' +} + +class UniqueForm extends Component { + static propTpyes = { + dict: PropTypes.object, // 瀛楀吀椤� + columnChange: PropTypes.func // 淇敼鍑芥暟 + } + + state = { + editItem: null, // 缂栬緫鍏冪礌 + shortcutOptions: null + } + + UNSAFE_componentWillMount () { + let keys = ['shift', 'ctrl', 'alt'] + let _options = [] + + keys.forEach(item => { + let _op = { + value: item, + label: item, + children: [] + } + Object.keys(shortkeycode).forEach(key => { + if (item === 'ctrl' && (key === '67' || key === '86')) return + if (item === 'alt' && key === '65') return + + _op.children.push({ + value: +key, + label: shortkeycode[key] + }) + }) + + _options.push(_op) + }) + + this.setState({ + shortcutOptions: _options + }) + } + + edit = (record) => { + this.setState({ + editItem: record + }, () => { + let item = { + label: record.label, + Width: record.Width, + hidden: record.hidden ? 'true' : 'false', + fixed: record.fixed ? 'true' : 'false' + } + + this.props.form.setFieldsValue(item) + }) + } + + + handleConfirm = () => { + // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + values.uuid = this.state.editItem ? this.state.editItem.uuid : '' + + values.hidden = values.hidden === 'true' + values.fixed = values.fixed === 'true' + + this.props.columnChange(values) + + this.setState({ + editItem: null + }) + } + }) + } + + render() { + const { getFieldDecorator } = this.props.form + const { editItem } = this.state + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + } + } + + return ( + <Form {...formItemLayout} className="verify-form"> + {editItem ? <Row gutter={24}> + <Col span={10}> + <Form.Item label={'鍚嶇О'}> + {getFieldDecorator('label', { + initialValue: '', + })(<Input placeholder="" autoComplete="off" disabled />)} + </Form.Item> + </Col> + <Col span={10}> + <Form.Item label={'鍒楀'}> + {getFieldDecorator('Width', { + initialValue: 0 + })(<InputNumber min={50} max={1200} precision={0} />)} + </Form.Item> + </Col> + <Col span={4} className="add"> + <Button onClick={this.handleConfirm} type="primary" className="add-row"> + 纭畾 + </Button> + </Col> + <Col span={10}> + <Form.Item label="闅愯棌"> + {getFieldDecorator('hidden', { + initialValue: 'false' + })( + <Radio.Group> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={10}> + <Form.Item label="鍥哄畾"> + {getFieldDecorator('fixed', { + initialValue: 'false' + })( + <Radio.Group> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + </Row> : null} + {!editItem ? <Row gutter={24} style={{height: '64px', paddingTop: '5px'}}> + <Col span={24} className="print-tip"> + <Form.Item label={'鎻愮ず'}> + 鐐瑰嚮缂栬緫鍥炬爣锛屽彲鑷畾涔夋樉绀哄垪瀹藉害銆佹槸鍚﹂殣钘忋�佹槸鍚﹀浐瀹氱瓑璁剧疆锛岀偣鍑讳笂涓嬬澶村彲璋冩暣鏄剧ず鍒楅『搴忋�� + </Form.Item> + </Col> + </Row> : null} + </Form> + ) + } +} + +export default Form.create()(UniqueForm) \ No newline at end of file diff --git a/src/tabviews/zshare/verifycard/tabcard/columnform/index.scss b/src/tabviews/zshare/verifycard/tabcard/columnform/index.scss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/tabviews/zshare/verifycard/tabcard/columnform/index.scss diff --git a/src/tabviews/zshare/verifycard/tabcard/index.jsx b/src/tabviews/zshare/verifycard/tabcard/index.jsx index 30801b3..56be2ec 100644 --- a/src/tabviews/zshare/verifycard/tabcard/index.jsx +++ b/src/tabviews/zshare/verifycard/tabcard/index.jsx @@ -2,9 +2,8 @@ import PropTypes from 'prop-types' import { Form, Tabs, Row, Col, Radio, Table, Icon, Select, notification } from 'antd' -// import Utils from '@/utils/utils.js' - import ActionForm from './actionform' +import ColumnForm from './columnform' import PrintForm from './printform' import PrintTypeForm from './printtypeform' import './index.scss' @@ -51,31 +50,43 @@ printbtns: null, colColumns: [ { - title: '瀛楁鍚�', - dataIndex: 'field', - width: '35%' + title: '鍒楀悕', + dataIndex: 'label', + width: '20%' }, { title: '鍒楀', dataIndex: 'Width', - width: '35%' + width: '20%' }, { - title: '瀛楁鍚�', - dataIndex: 'field', - width: '35%' + title: '闅愯棌', + dataIndex: 'hidden', + width: '20%', + render: (text, record) => { + if (record.hidden) return '鏄�' + return '鍚�' + } + }, + { + title: '鍥哄畾', + dataIndex: 'fixed', + width: '20%', + render: (text, record) => { + if (record.fixed) return '鏄�' + return '鍚�' + } }, { title: '鎿嶄綔', align: 'center', - width: '25%', + width: '20%', dataIndex: 'operation', render: (text, record) => (<div> <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'column')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <span className="operation-btn" title="涓婄Щ" onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title="涓嬬Щ" onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span> </div>) } ], @@ -160,7 +171,7 @@ UNSAFE_componentWillMount() { let config = JSON.parse(JSON.stringify(this.props.config)) - + let _subconfig = { label: config.label, setting: config.setting, @@ -177,8 +188,10 @@ config.columns.forEach((item, index) => { _subconfig.columns[item.uuid] = { + label: item.label, Width: item.Width, hidden: item.hidden, + fixed: item.fixed, sort: index } }) @@ -271,14 +284,17 @@ let _config = JSON.parse(JSON.stringify(this.state.config)) let _subconfig = JSON.parse(JSON.stringify(this.state.subconfig)) - _config.action = _config.action.map(item => { + _config.columns = _config.columns.map((item, index) => { if (values.uuid === item.uuid) { item = {...item, ...values} } - _subconfig.action[item.uuid] = { - printer: item.printer || '', - shortcut: item.shortcut + _subconfig.columns[item.uuid] = { + label: item.label, + Width: item.Width, + hidden: item.hidden, + fixed: item.fixed, + sort: index } return item @@ -377,7 +393,7 @@ } else if (type === 'printtype') { this.printTypeForm.edit(record) } else if (type === 'column') { - this.uniqueForm.edit(record) + this.columnForm.edit(record) } if (type === 'printtype') return @@ -398,47 +414,46 @@ } } - handleStatus = (record) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) - record.status = record.status === 'false' ? 'true' : 'false' - - verify.scripts = verify.scripts.map(item => { - if (item.uuid === record.uuid) { - return record - } else { - return item - } - }) - - this.setState({ - verify: verify - }) - } - - handleUpDown = (record, type, direction) => { - let verify = JSON.parse(JSON.stringify(this.state.verify)) + handleUpDown = (record, direction) => { + let _config = JSON.parse(JSON.stringify(this.state.config)) + let _subconfig = JSON.parse(JSON.stringify(this.state.subconfig)) let index = 0 - verify.customverifys = verify.customverifys.filter((item, i) => { + _config.columns = _config.columns.filter((item, i) => { if (item.uuid === record.uuid) { index = i } return item.uuid !== record.uuid }) - if ((index === 0 && direction === 'up') || (index === verify.customverifys.length && direction === 'down')) { + if ((index === 0 && direction === 'up') || (index === _config.columns.length && direction === 'down')) { return } if (direction === 'up') { - verify.customverifys.splice(index - 1, 0, record) + _config.columns.splice(index - 1, 0, record) } else { - verify.customverifys.splice(index + 1, 0, record) + _config.columns.splice(index + 1, 0, record) } - this.setState({ - verify: verify + _config.columns = _config.columns.map((item, index) => { + _subconfig.columns[item.uuid] = { + label: item.label, + Width: item.Width, + hidden: item.hidden, + fixed: item.fixed, + sort: index + } + + return item }) + + this.setState({ + config: _config, + subconfig: _subconfig + }) + + this.props.handleconfig(_config.uuid, _subconfig) } handleConfirm = () => { @@ -504,7 +519,7 @@ render() { const { config } = this.props - const { actionColumns, printColumns, printTypeColumns, printbtns } = this.state + const { actionColumns, printColumns, colColumns, printTypeColumns, printbtns } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -564,21 +579,21 @@ pagination={false} /> </TabPane> - {/* <TabPane tab="鏄剧ず鍒楄缃�" key="column"> - <ActionForm + <TabPane tab="鏄剧ず鍒楄缃�" key="column"> + <ColumnForm dict={this.props.dict} - actionChange={this.actionChange} - wrappedComponentRef={(inst) => this.actionForm = inst} + columnChange={this.columnChange} + wrappedComponentRef={(inst) => this.columnForm = inst} /> <Table bordered rowKey="uuid" className="custom-table" - dataSource={this.state.config.action} - columns={actionColumns} + dataSource={this.state.config.columns} + columns={colColumns} pagination={false} /> - </TabPane> */} + </TabPane> {printbtns && printbtns.length > 0 ? <TabPane tab="鎵撳嵃璁剧疆" key="print"> <PrintForm dict={this.props.dict} diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 0c3dc10..7f749bd 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -33,7 +33,7 @@ import TransferForm from '@/components/transferform' import SourceElement from '@/templates/zshare/dragelement/source' import CreateFunc from '@/templates/zshare/createfunc' -import CreateInterface from '@/templates/zshare/createinterface' +// import CreateInterface from '@/templates/zshare/createinterface' import Source from './source' import './index.scss' @@ -3092,7 +3092,7 @@ }) }} footer={[ - <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>, + // <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>, <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>, <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['header.cancel']}</Button>, <Button key="confirm" type="primary" onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button> -- Gitblit v1.8.0