From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/menu/components/table/edit-table/columns/tableIn/index.jsx | 45 +++++++++++++++++++++++++++++---------------- 1 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/tableIn/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/index.jsx index 9e83517..144df97 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/index.jsx @@ -21,7 +21,6 @@ class VerifyTableCard extends Component { static propTpyes = { columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, } @@ -80,13 +79,13 @@ render: (text, record) => record.status === 'false' ? ( <div> - {this.props.dict['model.status.forbidden']} + 绂佺敤 <StopTwoTone style={{marginLeft: '5px'}} twoToneColor="#ff4d4f" /> </div> ) : ( <div> - {this.props.dict['model.status.open']} + 鍚敤 <CheckCircleTwoTone style={{marginLeft: '5px'}} twoToneColor="#52c41a" /> </div> ) @@ -133,13 +132,13 @@ render: (text, record) => record.status === 'false' ? ( <div> - {this.props.dict['model.status.forbidden']} + 绂佺敤 <StopTwoTone style={{marginLeft: '5px'}} twoToneColor="#ff4d4f" /> </div> ) : ( <div> - {this.props.dict['model.status.open']} + 鍚敤 <CheckCircleTwoTone style={{marginLeft: '5px'}} twoToneColor="#52c41a" /> </div> ) @@ -154,10 +153,10 @@ <span className="operation-btn" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> <span className="operation-btn" onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><ArrowUpOutlined /></span> <span className="operation-btn" onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><ArrowDownOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -196,6 +195,17 @@ } componentDidMount () { + this.getsysScript() + } + + getsysScript = () => { + if (sessionStorage.getItem('mk_sys_scripts')) { + this.setState({ + systemScripts: JSON.parse(sessionStorage.getItem('mk_sys_scripts')) + }) + return + } + let _scriptSql = `Select distinct func+Remark as funcname,longparam, s.Sort from聽 s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end order by s.Sort` _scriptSql = Utils.formatOptions(_scriptSql) @@ -214,13 +224,17 @@ Api.getSystemConfig(_sParam).then(res => { if (res.status) { + let _scripts = res.data.map(item => { + return { + name: item.funcname, + value: window.decodeURIComponent(window.atob(item.longparam)) + } + }) + + sessionStorage.setItem('mk_sys_scripts', JSON.stringify(_scripts)) + this.setState({ - systemScripts: res.data.map(item => { - return { - name: item.funcname, - value: window.decodeURIComponent(window.atob(item.longparam)) - } - }) + systemScripts: _scripts }) } else { notification.warning({ @@ -532,7 +546,7 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col span={8}> - <Form.Item required label={this.props.dict['model.form.tablename']}> + <Form.Item required label="琛ㄥ悕"> <Input value={verify.sheet} placeholder="" autoComplete="off" onChange={(e) => this.onOptionChange(e.target.value, 'sheet')}/> </Form.Item> </Col> @@ -592,7 +606,7 @@ {verify.uniques.length ? <span className="count-tip">{verify.uniques.length}</span> : null} </span> } key="unique"> - <UniqueForm fields={fields} dict={this.props.dict} uniqueChange={this.uniqueChange}/> + <UniqueForm fields={fields} uniqueChange={this.uniqueChange}/> <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> </TabPane> <TabPane disabled={verify.intertype !== 'system'} tab={ @@ -602,7 +616,6 @@ </span> } key="scripts"> <CustomScript - dict={this.props.dict} btn={verify} usefulfields={fields} scripts={verify.scripts} -- Gitblit v1.8.0