From 6d0137932fcc8f9848123743c1aad5cff8172d8a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 09 二月 2020 13:09:39 +0800 Subject: [PATCH] 2020-02-09 --- src/templates/tableshare/verifycard/index.jsx | 478 +++++++++++++++++++++++++++++++---------------------------- 1 files changed, 252 insertions(+), 226 deletions(-) diff --git a/src/templates/tableshare/verifycard/index.jsx b/src/templates/tableshare/verifycard/index.jsx index c704bc2..1b1efea 100644 --- a/src/templates/tableshare/verifycard/index.jsx +++ b/src/templates/tableshare/verifycard/index.jsx @@ -75,6 +75,9 @@ render: (text, record) => (<div> <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'unique')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'unique', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> + <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> + <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['header.confirm']} @@ -83,9 +86,6 @@ }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> </Popconfirm> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'unique', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> </div>) } ], @@ -141,6 +141,9 @@ render: (text, record) => (<div> <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'contrast')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'contrast', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> + <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'contrast', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> + <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'contrast')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['header.confirm']} @@ -149,9 +152,6 @@ }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> </Popconfirm> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'contrast', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'contrast', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'contrast')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> </div>) } ], @@ -202,6 +202,9 @@ render: (text, record) => (<div> <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'customverify')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'customverify', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> + <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'customverify', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> + <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'customverify')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['header.confirm']} @@ -210,9 +213,6 @@ }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> </Popconfirm> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'customverify', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'customverify', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'customverify')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> </div>) } ], @@ -248,6 +248,9 @@ render: (text, record) => (<div> <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> + <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> + <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['header.confirm']} @@ -256,9 +259,6 @@ }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> </Popconfirm> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> </div>) } ], @@ -339,6 +339,9 @@ render: (text, record) => (<div> <span className="operation-btn" title={this.props.dict['header.edit']} onClick={() => this.handleEdit(record, 'ordercode')} style={{color: '#1890ff'}}><Icon type="edit" /></span> + <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'ordercode', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> + <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'ordercode', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> + <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'ordercode')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm title={this.props.dict['header.form.query.delete']} okText={this.props.dict['header.confirm']} @@ -347,9 +350,6 @@ }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> </Popconfirm> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'ordercode', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'ordercode', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'ordercode')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> </div>) } ] @@ -402,14 +402,14 @@ _fields = _LongParam.fields } - let _usefulfields = [] + let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] _fields.forEach(_f => { if (_f.field) { _usefulfields.push(_f.field) } }) - if (columns && columns.length > 0) { + if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { columns.forEach(_f => { if (_f.field) { _usefulfields.push(_f.field) @@ -432,6 +432,24 @@ duration: 10 }) } + }) + } else { + let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] + + if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { + columns.forEach(_f => { + if (_f.field) { + _usefulfields.push(_f.field) + } + }) + } + + _usefulfields = Array.from(new Set(_usefulfields)) + _usefulfields = _usefulfields.join(', ') + + + this.setState({ + usefulfields: _usefulfields }) } } @@ -708,6 +726,12 @@ } else if (type === 'contrast') { this.contrastForm.edit(record) } + + let node = document.getElementById('verify-card-box-tab').parentNode + + if (node && node.scrollTop) { + node.scrollTop = 0 + } } handleStatus = (record, type) => { @@ -919,215 +943,217 @@ } return ( - <Tabs defaultActiveKey="1" className="verify-card-box" onChange={this.tabchange}> - <TabPane tab="鍩虹楠岃瘉" key="1"> - <Form {...formItemLayout}> - <Row gutter={24}> - <Col span={12}> - <Form.Item label={ - <Tooltip placement="bottomLeft" title={'榛樿sql鎵ц椤哄簭涓鸿嚜瀹氫箟鑴氭湰涔嬪墠'}> - <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> - 榛樿sql - </Tooltip> - }> - <Radio.Group value={verify.default} onChange={(e) => {this.onOptionChange(e, 'default')}}> - <Radio value="true">鎵ц</Radio> - <Radio value="false">涓嶆墽琛�</Radio> - </Radio.Group> - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={'璐︽湡楠岃瘉'}> - <Radio.Group value={verify.accountdate} onChange={(e) => {this.onOptionChange(e, 'accountdate')}}> - <Radio value="true">寮�鍚�</Radio> - <Radio value="false">涓嶅紑鍚�</Radio> - </Radio.Group> - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={'澶辨晥楠岃瘉'}> - <Radio.Group value={verify.invalid} onChange={(e) => {this.onOptionChange(e, 'invalid')}}> - <Radio value="true">寮�鍚�</Radio> - <Radio value="false">涓嶅紑鍚�</Radio> - </Radio.Group> - </Form.Item> - </Col> - </Row> - </Form> - </TabPane> - <TabPane tab="姣旇緝楠岃瘉" key="2x"> - <ContrastForm - dict={this.props.dict} - contrastChange={this.contrastChange} - wrappedComponentRef={(inst) => this.contrastForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.contrasts} - columns={contrastColumns} - pagination={false} - /> - </TabPane> - <TabPane tab="鍞竴鎬ч獙璇�" key="2"> - <UniqueForm - fields={fields} - dict={this.props.dict} - uniqueChange={this.uniqueChange} - wrappedComponentRef={(inst) => this.uniqueForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.uniques} - columns={uniqueColumns} - pagination={false} - /> - </TabPane> - <TabPane tab="鑷畾涔夐獙璇�" key="3"> - <CustomForm - dict={this.props.dict} - usefulfields={this.state.usefulfields} - customChange={this.customChange} - wrappedComponentRef={(inst) => this.customForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.customverifys} - columns={customColumns} - pagination={false} - /> - </TabPane> - <TabPane tab="鍗曞彿鐢熸垚" key="4"> - <BillcodeForm - floor={this.props.floor} - fields={fields} - billcodes={verify.billcodes} - columns={this.props.columns} - dict={this.props.dict} - modular={orderModular} - modularDetail={orderModularDetail} - orderChange={this.orderChange} - wrappedComponentRef={(inst) => this.orderForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.billcodes} - columns={orderColumns} - pagination={false} - /> - </TabPane> - <TabPane tab="鍒涘缓鍑瘉" key="5"> - <VoucherForm - dict={this.props.dict} - voucher={voucher} - columns={this.props.columns} - voucherobj={verify.voucher} - voucherDetail={voucherDetail} - voucherChange={this.voucherChange} - wrappedComponentRef={(inst) => this.voucherForm = inst} - /> - </TabPane> - <TabPane tab="鑷畾涔夎剼鏈�" key="6"> - <CustomScript - usefulfields={this.state.usefulfields} - dict={this.props.dict} - scriptsChange={this.scriptsChange} - wrappedComponentRef={(inst) => this.scriptsForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="custom-table" - dataSource={verify.scripts} - columns={scriptsColumns} - pagination={false} - /> - </TabPane> - <TabPane tab="淇℃伅鎻愮ず" key="7"> - <Form {...formItemLayout}> - <Row gutter={24}> - <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> - <span className="errorval"> S </span> - <Button onClick={() => {this.showError('S')}} type="primary" size="small"> - 鏌ョ湅 - </Button> - </Form.Item> - </Col> - <Col span={8}> - <Form.Item label={'鍋滅暀鏃堕棿'}> - <InputNumber defaultValue={2} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'stime')}} /> - </Form.Item> - </Col> - </Row> - <Row gutter={24}> - <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> - <span className="errorval"> -1 </span> - 涓嶆彁绀� - </Form.Item> - </Col> - </Row> - <Row gutter={24}> - <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> - <span className="errorval"> N </span> - <Button onClick={() => {this.showError('N')}} type="primary" size="small"> - 鏌ョ湅 - </Button> - </Form.Item> - </Col> - <Col span={8}> - <Form.Item label={'鍋滅暀鏃堕棿'}> - <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} /> - </Form.Item> - </Col> - </Row> - <Row gutter={24}> - <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> - <span className="errorval"> F </span> - <Button onClick={() => {this.showError('F')}} type="primary" size="small"> - 鏌ョ湅 - </Button> - </Form.Item> - </Col> - <Col span={8}> - <Form.Item label={'鍋滅暀鏃堕棿'}> - <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} /> - </Form.Item> - </Col> - </Row> - <Row gutter={24}> - <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> - <span className="errorval"> E </span> - <Button onClick={() => {this.showError('E')}} type="primary" size="small"> - 鏌ョ湅 - </Button> - </Form.Item> - </Col> - </Row> - <Row gutter={24}> - <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> - <span className="errorval"> NM </span> - <Button onClick={() => {this.showError('NM')}} type="primary" size="small"> - 鏌ョ湅 - </Button> - </Form.Item> - </Col> - </Row> - </Form> - </TabPane> - </Tabs> + <div id="verify-card-box-tab"> + <Tabs defaultActiveKey="1" className="verify-card-box" onChange={this.tabchange}> + <TabPane tab="鍩虹楠岃瘉" key="1"> + <Form {...formItemLayout}> + <Row gutter={24}> + <Col span={12}> + <Form.Item label={ + <Tooltip placement="bottomLeft" title={'榛樿sql鎵ц椤哄簭涓鸿嚜瀹氫箟鑴氭湰涔嬪墠'}> + <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> + 榛樿sql + </Tooltip> + }> + <Radio.Group value={verify.default} onChange={(e) => {this.onOptionChange(e, 'default')}}> + <Radio value="true">鎵ц</Radio> + <Radio value="false">涓嶆墽琛�</Radio> + </Radio.Group> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label={'璐︽湡楠岃瘉'}> + <Radio.Group value={verify.accountdate} onChange={(e) => {this.onOptionChange(e, 'accountdate')}}> + <Radio value="true">寮�鍚�</Radio> + <Radio value="false">涓嶅紑鍚�</Radio> + </Radio.Group> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label={'澶辨晥楠岃瘉'}> + <Radio.Group value={verify.invalid} onChange={(e) => {this.onOptionChange(e, 'invalid')}}> + <Radio value="true">寮�鍚�</Radio> + <Radio value="false">涓嶅紑鍚�</Radio> + </Radio.Group> + </Form.Item> + </Col> + </Row> + </Form> + </TabPane> + <TabPane tab="姣旇緝楠岃瘉" key="2x"> + <ContrastForm + dict={this.props.dict} + contrastChange={this.contrastChange} + wrappedComponentRef={(inst) => this.contrastForm = inst} + /> + <Table + bordered + rowKey="uuid" + className="custom-table" + dataSource={verify.contrasts} + columns={contrastColumns} + pagination={false} + /> + </TabPane> + <TabPane tab="鍞竴鎬ч獙璇�" key="2"> + <UniqueForm + fields={fields} + dict={this.props.dict} + uniqueChange={this.uniqueChange} + wrappedComponentRef={(inst) => this.uniqueForm = inst} + /> + <Table + bordered + rowKey="uuid" + className="custom-table" + dataSource={verify.uniques} + columns={uniqueColumns} + pagination={false} + /> + </TabPane> + <TabPane tab="鑷畾涔夐獙璇�" key="3"> + <CustomForm + dict={this.props.dict} + usefulfields={this.state.usefulfields} + customChange={this.customChange} + wrappedComponentRef={(inst) => this.customForm = inst} + /> + <Table + bordered + rowKey="uuid" + className="custom-table" + dataSource={verify.customverifys} + columns={customColumns} + pagination={false} + /> + </TabPane> + <TabPane tab="鍗曞彿鐢熸垚" key="4"> + <BillcodeForm + floor={this.props.floor} + fields={fields} + billcodes={verify.billcodes} + columns={this.props.columns} + dict={this.props.dict} + modular={orderModular} + modularDetail={orderModularDetail} + orderChange={this.orderChange} + wrappedComponentRef={(inst) => this.orderForm = inst} + /> + <Table + bordered + rowKey="uuid" + className="custom-table" + dataSource={verify.billcodes} + columns={orderColumns} + pagination={false} + /> + </TabPane> + <TabPane tab="鍒涘缓鍑瘉" key="5"> + <VoucherForm + dict={this.props.dict} + voucher={voucher} + columns={this.props.columns} + voucherobj={verify.voucher} + voucherDetail={voucherDetail} + voucherChange={this.voucherChange} + wrappedComponentRef={(inst) => this.voucherForm = inst} + /> + </TabPane> + <TabPane tab="鑷畾涔夎剼鏈�" key="6"> + <CustomScript + usefulfields={this.state.usefulfields} + dict={this.props.dict} + scriptsChange={this.scriptsChange} + wrappedComponentRef={(inst) => this.scriptsForm = inst} + /> + <Table + bordered + rowKey="uuid" + className="custom-table" + dataSource={verify.scripts} + columns={scriptsColumns} + pagination={false} + /> + </TabPane> + <TabPane tab="淇℃伅鎻愮ず" key="7"> + <Form {...formItemLayout}> + <Row gutter={24}> + <Col offset={6} span={6}> + <Form.Item label={'鎻愮ず缂栫爜'}> + <span className="errorval"> S </span> + <Button onClick={() => {this.showError('S')}} type="primary" size="small"> + 鏌ョ湅 + </Button> + </Form.Item> + </Col> + <Col span={8}> + <Form.Item label={'鍋滅暀鏃堕棿'}> + <InputNumber defaultValue={2} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'stime')}} /> + </Form.Item> + </Col> + </Row> + <Row gutter={24}> + <Col offset={6} span={6}> + <Form.Item label={'鎻愮ず缂栫爜'}> + <span className="errorval"> -1 </span> + 涓嶆彁绀� + </Form.Item> + </Col> + </Row> + <Row gutter={24}> + <Col offset={6} span={6}> + <Form.Item label={'鎻愮ず缂栫爜'}> + <span className="errorval"> N </span> + <Button onClick={() => {this.showError('N')}} type="primary" size="small"> + 鏌ョ湅 + </Button> + </Form.Item> + </Col> + <Col span={8}> + <Form.Item label={'鍋滅暀鏃堕棿'}> + <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} /> + </Form.Item> + </Col> + </Row> + <Row gutter={24}> + <Col offset={6} span={6}> + <Form.Item label={'鎻愮ず缂栫爜'}> + <span className="errorval"> F </span> + <Button onClick={() => {this.showError('F')}} type="primary" size="small"> + 鏌ョ湅 + </Button> + </Form.Item> + </Col> + <Col span={8}> + <Form.Item label={'鍋滅暀鏃堕棿'}> + <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} /> + </Form.Item> + </Col> + </Row> + <Row gutter={24}> + <Col offset={6} span={6}> + <Form.Item label={'鎻愮ず缂栫爜'}> + <span className="errorval"> E </span> + <Button onClick={() => {this.showError('E')}} type="primary" size="small"> + 鏌ョ湅 + </Button> + </Form.Item> + </Col> + </Row> + <Row gutter={24}> + <Col offset={6} span={6}> + <Form.Item label={'鎻愮ず缂栫爜'}> + <span className="errorval"> NM </span> + <Button onClick={() => {this.showError('NM')}} type="primary" size="small"> + 鏌ョ湅 + </Button> + </Form.Item> + </Col> + </Row> + </Form> + </TabPane> + </Tabs> + </div> ) } } -- Gitblit v1.8.0