From ac1d52c46ff9019fcc93cf3d5e7ab17cf850824e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 10 八月 2023 16:05:24 +0800 Subject: [PATCH] 2023-08-10 --- src/menu/components/table/edit-table/columns/tableIn/index.jsx | 111 ++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 77 insertions(+), 34 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 e604816..032381a 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/index.jsx @@ -1,13 +1,14 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' -import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' +import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, Cascader, Tooltip, InputNumber, Radio, Typography } from 'antd' +import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined, QuestionCircleOutlined } from '@ant-design/icons' import moment from 'moment' import Api from '@/api' import Utils from '@/utils/utils.js' - +import MKEmitter from '@/utils/events.js' +import MenuUtils from '@/utils/utils-custom.js' import UniqueForm from './uniqueform' import CustomScript from './customscript' import asyncComponent from '@/utils/asyncComponent' @@ -17,6 +18,7 @@ const { confirm } = Modal const { Paragraph } = Typography const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) +const FullScripts = asyncComponent(() => import('@/templates/zshare/verifycard/fullScripts')) class VerifyTableCard extends Component { static propTpyes = { @@ -27,6 +29,7 @@ state = { verify: {}, fields: [], + modules: [], fieldLabel: {}, systemScripts: [], activeKey: 'basemsg', @@ -125,15 +128,13 @@ dataIndex: 'position', width: '10%', render: (text, record) => { - let _text = '' - if (record.position === 'front') { - _text = 'sql鍓�' - } else if (record.position === 'init') { - _text = '鍒濆鍖�' + if (record.position === 'init') { + return <span style={{color: 'orange'}}>鍒濆鍖�</span> + } else if (record.position === 'front') { + return <span style={{color: '#26C281'}}>sql鍓�</span> } else { - _text = 'sql鍚�' + return <span style={{color: '#1890ff'}}>sql鍚�</span> } - return _text } }, { @@ -176,27 +177,32 @@ } UNSAFE_componentWillMount() { - const { columns, card, setting } = this.props - let _verify = fromJS(card).toJS() + const { columns, submit, setting, uuid } = this.props.config + let _verify = fromJS(submit).toJS() _verify.sheet = _verify.sheet || setting.tableName let fieldLabel = {} - // let _columns = [] - // let _fields = {} columns.forEach(col => { fieldLabel[col.field] = col.label - // _fields[col.field] = col }) - // cols.forEach(col => { - // if (!col.field || col.type === 'index' || !_fields[col.field]) return - - // _columns.push(_fields[col.field]) - // }) + + let supId = '' + if (setting && setting.supModule) { + let pid = setting.supModule[setting.supModule.length - 1] + if (pid && pid !== 'empty') { + supId = pid + } else { + supId = '' + } + } + + let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, uuid, supId) this.setState({ fields: fromJS(columns).toJS().filter(item => item.field !== setting.primaryKey), fieldLabel, + modules: modules, verify: _verify }, () => { this.resetUniqueColumns() @@ -231,7 +237,7 @@ _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 浜戠鏁版嵁楠岃瘉 - Api.getSystemConfig(_sParam).then(res => { + Api.getCloudConfig(_sParam).then(res => { if (res.status) { let _scripts = res.data.map(item => { return { @@ -321,6 +327,8 @@ values.uuid = Utils.getuuid() verify.scripts.push(values) } + + MKEmitter.emit('editLineId', values.uuid) this.setState({ verify: verify @@ -490,7 +498,7 @@ } render() { - const { verify, scriptsColumns, uniqueColumns, activeKey, fields } = this.state + const { verify, scriptsColumns, uniqueColumns, activeKey, fields, modules } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -561,6 +569,16 @@ </Radio.Group> </Form.Item> </Col> : null} + <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鎵ц鎴愬姛鍚庯紙鎴栧脊绐楁爣绛惧叧闂椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢銆傛敞锛氶�夋嫨褰撳墠缁勪欢鐨勪笂绾х粍浠舵棤鏁堬紝鍒锋柊涓婄骇缁勪欢璇烽�夋嫨鎴愬姛鍚庘�滀笂绾э紙琛岋級鈥濄��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鍒锋柊缁勪欢 + </Tooltip> + }> + <Cascader options={modules} value={verify.syncComponent || []} expandTrigger="hover" allowClear placeholder="" onChange={(val) => this.onOptionChange(val, 'syncComponent')}/> + </Form.Item> + </Col> </Row> </Form> </TabPane> @@ -579,6 +597,23 @@ {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null} </span> } key="scripts"> + <FullScripts + verify={verify} + getScriptsFullForm={() => this.scriptsFullForm} + getScriptsForm={() => this.scriptsForm} + handleStatus={this.handleStatus} + handleDelete={this.handleDelete} + > + <CustomScript + type="fullscreen" + btn={verify} + usefulfields={fields} + scripts={verify.scripts} + systemScripts={this.state.systemScripts} + scriptsChange={this.scriptsChange} + wrappedComponentRef={(inst) => this.scriptsFullForm = inst} + /> + </FullScripts> <CustomScript btn={verify} usefulfields={fields} @@ -593,7 +628,7 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> + <Form.Item label="鎻愮ず缂栫爜"> <span className="errorval"> S </span> <Button onClick={() => {this.showError('S')}} type="primary" size="small"> 鏌ョ湅 @@ -601,14 +636,14 @@ </Form.Item> </Col> <Col span={8}> - <Form.Item label={'鍋滅暀鏃堕棿'}> + <Form.Item label="鍋滅暀鏃堕棿"> <InputNumber defaultValue={verify.stime || 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={'鎻愮ず缂栫爜'}> + <Form.Item label="鎻愮ず缂栫爜"> <span className="errorval"> Y </span> <Button onClick={() => {this.showError('Y')}} type="primary" size="small"> 鏌ョ湅 @@ -618,7 +653,15 @@ </Row> <Row gutter={24}> <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> + <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"> 鏌ョ湅 @@ -626,14 +669,14 @@ </Form.Item> </Col> <Col span={8}> - <Form.Item label={'鍋滅暀鏃堕棿'}> + <Form.Item label="鍋滅暀鏃堕棿"> <InputNumber defaultValue={verify.ntime || 10} 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={'鎻愮ず缂栫爜'}> + <Form.Item label="鎻愮ず缂栫爜"> <span className="errorval"> F </span> <Button onClick={() => {this.showError('F')}} type="primary" size="small"> 鏌ョ湅 @@ -641,14 +684,14 @@ </Form.Item> </Col> <Col span={8}> - <Form.Item label={'鍋滅暀鏃堕棿'}> + <Form.Item label="鍋滅暀鏃堕棿"> <InputNumber defaultValue={verify.ftime || 10} 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={'鎻愮ず缂栫爜'}> + <Form.Item label="鎻愮ず缂栫爜"> <span className="errorval"> E </span> <Button onClick={() => {this.showError('E')}} type="primary" size="small"> 鏌ョ湅 @@ -658,7 +701,7 @@ </Row> <Row gutter={24}> <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> + <Form.Item label="鎻愮ず缂栫爜"> <span className="errorval"> NM </span> <Button onClick={() => {this.showError('NM')}} type="primary" size="small"> 鏌ョ湅 @@ -668,9 +711,9 @@ </Row> <Row gutter={24}> <Col offset={6} span={6}> - <Form.Item label={'鎻愮ず缂栫爜'}> - <span className="errorval"> -1 </span> - 涓嶆彁绀� + <Form.Item label="鎻愮ず缂栫爜"> + <span className="errorval"> -2 </span> + 鎵ц澶辫触鏃犳彁绀� </Form.Item> </Col> </Row> -- Gitblit v1.8.0