From 4c2ef2d3a98d7d9a2592721db2f5858528eb5c86 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 十二月 2019 11:33:48 +0800 Subject: [PATCH] 2019-12-26 --- src/templates/tableshare/gridbtnform/index.scss | 0 src/tabviews/subtable/subTable/index.jsx | 1 src/templates/tableshare/editcard/index.scss | 0 src/templates/tableshare/columnform/index.jsx | 0 src/templates/comtableconfig/index.jsx | 22 +++++----- src/templates/tableshare/gridbtnform/index.jsx | 0 src/tabviews/tableshare/actionList/index.jsx | 30 +++++++------- src/templates/tableshare/editable/index.jsx | 0 src/templates/tableshare/dragelement/card.jsx | 0 src/tabviews/home/index.jsx | 11 +---- src/templates/tableshare/menuform/index.jsx | 1 src/tabviews/subtable/index.jsx | 13 +++--- src/templates/tableshare/colspanform/index.scss | 0 src/templates/tableshare/searchform/index.jsx | 0 src/tabviews/commontable/index.jsx | 6 ++- src/templates/tableshare/dragelement/index.scss | 0 src/templates/tableshare/menuform/index.scss | 0 src/templates/tableshare/columnform/index.scss | 0 src/templates/tableshare/transferform/index.jsx | 0 src/tabviews/tableshare/topSearch/index.scss | 0 src/tabviews/tableshare/mutilform/index.jsx | 0 src/templates/tableshare/dragelement/source.jsx | 0 src/templates/tableshare/dragelement/index.jsx | 0 src/tabviews/tableshare/mutilform/index.scss | 0 src/tabviews/tableshare/topSearch/index.jsx | 0 src/templates/subtableconfig/index.jsx | 16 ++++---- src/templates/tableshare/editcard/index.jsx | 0 src/templates/tableshare/transferform/index.scss | 0 /dev/null | 6 --- src/templates/tableshare/colspanform/index.jsx | 0 src/templates/tableshare/dragelement/itemtypes.js | 0 src/templates/tableshare/editable/index.scss | 0 src/tabviews/tableshare/actionList/index.scss | 0 src/templates/tableshare/searchform/index.scss | 0 34 files changed, 48 insertions(+), 58 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 305452c..e4ed65e 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -4,9 +4,9 @@ import { BackTop, notification, Spin, Tabs, Icon, Card, Switch} from 'antd' import moment from 'moment' import Api from '@/api' -import MainSearch from './mainSearch' -import MainAction from './mainAction' import MainTable from './mainTable' +import MainAction from '@/tabviews/tableshare/actionList' +import MainSearch from '@/tabviews/tableshare/topSearch' import SubTable from '@/tabviews/subtable' import NotFount from '@/components/404' import zhCN from '@/locales/zh-CN/main.js' @@ -556,6 +556,8 @@ {actions && setting.onload !== 'false' ? <MainAction ref="mainButton" + BID="" + type="main" setting={setting} actions={actions} dict={this.state.dict} diff --git a/src/tabviews/commontable/mainSearch/index.jsx b/src/tabviews/commontable/mainSearch/index.jsx deleted file mode 100644 index e65725f..0000000 --- a/src/tabviews/commontable/mainSearch/index.jsx +++ /dev/null @@ -1,260 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Button, Select, DatePicker } from 'antd' -import moment from 'moment' -import './index.scss' - -const {MonthPicker, WeekPicker, RangePicker} = DatePicker - -class MainSearch extends Component { - static propTpyes = { - searchlist: PropTypes.array, // 鎼滅储鏉′欢鍒楄〃 - dict: PropTypes.object // 瀛楀吀椤� - } - - state = { - match: null, // 鎼滅储鏉′欢鍖归厤瑙勫垯 - style: null, - searchlist: null - } - - UNSAFE_componentWillMount () { - let match = {} - let style = {} - let _list = [] - let fieldMap = new Map() - - this.props.searchlist.forEach(item => { - if (fieldMap.has(item.field)) { - item.field = item.field + '@tail@' - } - fieldMap.set(item.field, true) - - match[item.field] = item.match - style[item.field] = item.type - - _list.push(item) - }) - - this.setState({ - match: match, - style: style, - searchlist: _list - }) - } - - getFields() { - const { getFieldDecorator } = this.props.form - const fields = [] - this.state.searchlist.forEach((item, index) => { - if (item.type === 'text') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={6} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, {initialValue: item.initval })(<Input placeholder="" autoComplete="off" />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={6} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, {initialValue: item.initval })( - <Select - showSearch - onChange={this.searchChange} - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - > - {item.options.map(option => - <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'date') { // 鏃堕棿鎼滅储 - fields.push( - <Col span={6} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, {initialValue: item.initval ? moment().subtract(item.initval, 'days') : null })( - <DatePicker onChange={this.searchChange} /> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'datemonth') { - fields.push( - <Col span={6} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, {initialValue: item.initval ? moment().subtract(item.initval, 'month') : null })( - <MonthPicker onChange={this.searchChange} /> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'dateweek') { - fields.push( - <Col span={6} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, {initialValue: item.initval ? moment().subtract(item.initval * 7, 'days') : null })( - <WeekPicker onChange={this.searchChange} /> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'daterange') { - let _defaultValue = [null, null] - - if (item.initval) { - try { - let _initval = JSON.parse(item.initval) - _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')] - } catch { - _defaultValue = [null, null] - } - } - - fields.push( - <Col className="daterange" span={6} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, - { - initialValue: _defaultValue - })( - <RangePicker - placeholder={['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡']} - renderExtraFooter={() => 'extra footer'} - onChange={this.searchChange} - /> - )} - </Form.Item> - </Col> - ) - } - }) - - if (this.props.searchlist.length >= 4) { // 娣诲姞鎼滅储銆侀噸缃寜閽� - fields.push( - <Col span={this.props.searchlist.length % 4 ? 6 : 24} style={{paddingLeft: '112px'}} key="actions"> - <Button type="primary" htmlType="submit"> - {this.props.dict['main.search']} - </Button> - <Button style={{ marginLeft: 8 }} onClick={this.handleReset}> - {this.props.dict['main.reset']} - </Button> - </Col> - ) - } else { - fields.push( - <Col span={6} style={{ paddingTop: '4px' }} key="actions"> - <Button type="primary" htmlType="submit"> - {this.props.dict['main.search']} - </Button> - <Button style={{ marginLeft: 8 }} onClick={this.handleReset}> - {this.props.dict['main.reset']} - </Button> - </Col> - ) - } - - return fields - } - - handleSearch = (e) => { - // 鍥炶溅鎴栫偣鍑绘悳绱� - e.preventDefault() - this.props.form.validateFields((err, values) => { - let searches = this.getFieldsValues(values) - this.props.refreshdata(searches) - }) - } - - searchChange = () => { - this.setState({}, () => { - this.props.form.validateFields((err, values) => { - let searches = this.getFieldsValues(values) - this.props.refreshdata(searches) - }) - }) - } - - handleReset = () => { - // 閲嶇疆 - this.props.form.resetFields() - this.props.form.validateFields((err, values) => { - let searches = this.getFieldsValues(values) - this.props.refreshdata(searches) - }) - } - - getFieldsValues = (values) => { - // 鑾峰彇鎼滅储鏉′欢鍊� - let search = [] - Object.keys(values).forEach(key => { - if (this.state.style[key] === 'daterange') { - let _value = '' - if (values[key].length > 0) { - _value = [moment(values[key][0]).format('YYYY-MM-DD'), moment(values[key][1]).format('YYYY-MM-DD')] - } - search.push({ - type: this.state.style[key], - key: key.replace(/@tail@$/, ''), - value: _value, - match: this.state.match[key] - }) - } else if (this.state.style[key] === 'dateweek') { - let _value = '' - if (values[key]) { - _value = [moment(values[key]).startOf('week').format('YYYY-MM-DD'), moment(values[key]).endOf('week').format('YYYY-MM-DD')] - } - search.push({ - type: this.state.style[key], - key: key.replace(/@tail@$/, ''), - value: _value, - match: this.state.match[key] - }) - } else if (this.state.style[key] === 'date') { - let _value = '' - if (values[key]) { - _value = moment(values[key]).format('YYYY-MM-DD') - } - search.push({ - type: this.state.style[key], - key: key.replace(/@tail@$/, ''), - value: _value, - match: this.state.match[key] - }) - } else if (this.state.style[key] === 'datemonth') { - let _value = '' - if (values[key]) { - _value = moment(values[key]).format('YYYY-MM') - } - search.push({ - type: this.state.style[key], - key: key.replace(/@tail@$/, ''), - value: _value, - match: this.state.match[key] - }) - } else { - search.push({ - type: this.state.style[key], - key: key.replace(/@tail@$/, ''), - value: values[key].replace(/(^\s*|\s*$)/ig, ''), - match: this.state.match[key] - }) - } - }) - return search - } - - render() { - return ( - <Form className="ant-advanced-search-form commontable-main-search" onSubmit={this.handleSearch}> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/tabviews/commontable/mainSearch/index.scss b/src/tabviews/commontable/mainSearch/index.scss deleted file mode 100644 index 703756e..0000000 --- a/src/tabviews/commontable/mainSearch/index.scss +++ /dev/null @@ -1,19 +0,0 @@ -.ant-advanced-search-form.commontable-main-search { - padding: 0px 24px 20px; - border-bottom: 1px solid #d9d9d9; - .ant-form-item { - display: flex; - margin-bottom: 10px; - } - .ant-form-item-control-wrapper { - flex: 1; - } - .ant-form-item-label { - width: 100px; - text-overflow: ellipsis; - } - .daterange .ant-calendar-picker-input { - padding: 4px 20px 4px 5px; - font-size: 13px; - } -} \ No newline at end of file diff --git a/src/tabviews/commontable/mutilform/index.jsx b/src/tabviews/commontable/mutilform/index.jsx deleted file mode 100644 index a2aacd7..0000000 --- a/src/tabviews/commontable/mutilform/index.jsx +++ /dev/null @@ -1,443 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, InputNumber, Select, DatePicker, notification } from 'antd' -import moment from 'moment' -import Utils from '@/utils/utils.js' -import './index.scss' - -const {MonthPicker} = DatePicker - -class MainSearch extends Component { - static propTpyes = { - action: PropTypes.object, // 鎸夐挳淇℃伅銆佽〃鍗曞垪琛� - dict: PropTypes.object, // 瀛楀吀椤� - data: PropTypes.any, // 琛ㄦ牸鏁版嵁 - configMap: PropTypes.object, // 鎸夐挳鍙婁笅鎷夎〃鍗曢厤缃俊鎭泦 - inputSubmit: PropTypes.func // input鍥炶溅鎻愪氦 - } - - state = { - datatype: null, - readtype: null, - formlist: [] - } - - componentDidMount () { - const { data } = this.props - let action = JSON.parse(JSON.stringify(this.props.action)) - - let datatype = {} - let readtype = {} - let formlist = [] - if (action.groups.length > 0) { - action.groups.forEach(group => { - if (group.sublist.length === 0) return - - if (!group.default) { - formlist.push({ - type: 'title', - label: group.label, - uuid: group.uuid - }) - } - - group.sublist.forEach(item => { - datatype[item.field] = item.type - readtype[item.field] = item.readonly === 'true' - formlist.push(item) - }) - }) - } else { - formlist = action.fields.map(item => { - datatype[item.field] = item.type - readtype[item.field] = item.readonly === 'true' - - return item - }) - } - - formlist = formlist.map(item => { - if (item.type === 'select' || item.type === 'link') { - if (item.setAll === 'true') { - item.options.unshift({ - key: Utils.getuuid(), - Value: '', - Text: this.props.dict['main.all'] - }) - } - - if (item.resourceType === '1' && this.props.configMap.hasOwnProperty(item.uuid)) { - item.options = [...item.options, ...this.props.configMap[item.uuid]] - } - - item.oriOptions = item.options - } - - if (!/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) { - item.initval = this.props.data[item.field] - } - - return item - }) - - let error = false - - formlist = formlist.map(item => { - if (item.type === 'link') { - let supItem = formlist.filter(form => form.field === item.linkField)[0] - - if (!supItem && data && data.hasOwnProperty(item.linkField)) { - supItem = {initval: data[item.linkField]} - } - - if (!supItem) { - error = true - } else { - item.options = item.oriOptions.filter(option => option.parentId === supItem.initval) - } - } - - return item - }) - - if (error) { - notification.warning({ - top: 92, - message: '鍏宠仈鑿滃崟璁剧疆閿欒锛�', - duration: 10 - }) - } - - this.setState({ - readtype: readtype, - datatype: datatype, - formlist: formlist - }, () => { - if (action.setting && action.setting.focus) { - try { - let _form = document.getElementById('main-form-box') - let _item = _form.getElementsByTagName('input') - _item = [..._item] - _item.forEach(input => { - if (!input || input.id !== action.setting.focus) return - input.select() - }) - } catch { - console.warn('琛ㄥ崟鑾峰彇澶辫触锛�') - } - } - }) - } - - resetform = (formlist, supfields, index) => { - index++ - let subfields = [] - - supfields.forEach(supfield => { - formlist = formlist.map(item => { - if (item.type === 'link' && item.linkField === supfield.field) { - item.options = item.oriOptions.filter(option => option.parentId === supfield.initval) - item.initval = item.options[0] ? item.options[0].Value : '' - item.hiden = true - - subfields.push(item) - } - return item - }) - }) - - if (subfields.length === 0 || index > 6) { - return formlist - } else { - return this.resetform(formlist, subfields, index) - } - } - - selectChange = (_field, value) => { - let formlist = JSON.parse(JSON.stringify(this.state.formlist)) - - let subfields = [] - formlist = formlist.map(item => { - if (item.type === 'link' && item.linkField === _field.field) { - item.options = item.oriOptions.filter(option => option.parentId === value) - item.initval = item.options[0] ? item.options[0].Value : '' - item.hiden = true - - subfields.push(item) - } - return item - }) - - if (subfields.length === 0) return - - formlist = this.resetform(formlist, subfields, 0) - this.setState({ - formlist: formlist - }, () => { - this.setState({ - formlist: formlist.map(item => { - item.hiden = false - return item - }) - }) - }) - } - - getFields() { - const { getFieldDecorator } = this.props.form - - const fields = [] - let cols = 2 - if (this.props.action.setting && this.props.action.setting.cols) { - cols = parseInt(this.props.action.setting.cols) - if (cols > 3 || cols < 1) { - cols = 2 - } - } - - this.state.formlist.forEach((item, index) => { - if ((!item.field && item.type !== 'title') || item.hiden) return - - if (item.type === 'title') { - fields.push( - <Col span={24} key={index}> - <p>{item.label}</p> - </Col> - ) - } else if (item.type === 'text') { - fields.push( - <Col span={24 / cols} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, { - initialValue: item.initval || '', - rules: [ - { - required: item.required === 'true', - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'number') { // 鏁板瓧 - let min = (item.min || item.min === 0) ? item.min : -Infinity - let max = (item.max || item.max === 0) ? item.max : Infinity - let _initval = item.initval - let precision = (item.decimal || item.decimal === 0) ? item.decimal : null - - fields.push( - <Col span={24 / cols} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, { - initialValue: _initval, - rules: [ - { - required: item.required === 'true', - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })( - precision === null ? - <InputNumber initialValue={_initval} min={min} max={max} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} /> : - <InputNumber initialValue={_initval} min={min} max={max} precision={precision} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} /> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'select' || item.type === 'link') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={24 / cols} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, { - initialValue: item.initval, - rules: [ - { - required: item.required === 'true', - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - onChange={(value) => {this.selectChange(item, value)}} - // getPopupContainer={() => document.getElementById('form-box')} - > - {item.options.map(option => - <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'date') { // 鏃堕棿鎼滅储 - let _initval = this.props.data ? this.props.data[item.field] : '' - if (_initval) { - _initval = moment(_initval, 'YYYY-MM-DD') - } else { - _initval = item.initval ? moment().subtract(item.initval, 'days') : null - } - fields.push( - <Col span={24 / cols} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, { - initialValue: _initval, - rules: [ - { - required: item.required === 'true', - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <DatePicker /> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'datemonth') { - let _initval = this.props.data ? this.props.data[item.field] : '' - if (_initval) { - _initval = moment(_initval, 'YYYY-MM') - } else { - _initval = item.initval ? moment().subtract(item.initval, 'month') : null - } - fields.push( - <Col span={24 / cols} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, { - initialValue: _initval, - rules: [ - { - required: item.required === 'true', - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <MonthPicker /> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'datetime') { - let _initval = this.props.data ? this.props.data[item.field] : '' - if (_initval) { - _initval = moment(_initval, 'YYYY-MM-DD HH:mm:ss') - } else { - _initval = item.initval ? moment().subtract(item.initval, 'days') : null - } - fields.push( - <Col span={24 / cols} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.field, { - initialValue: _initval, - rules: [ - { - required: item.required === 'true', - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - // <DatePicker showTime getCalendarContainer={() => document.getElementById('form-box')} /> - <DatePicker showTime /> - )} - </Form.Item> - </Col> - ) - } - }) - - return fields - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - let search = [] - Object.keys(values).forEach(key => { - if (this.state.datatype[key] === 'datetime') { - let _value = '' - if (values[key]) { - _value = moment(values[key]).format('YYYY-MM-DD HH:mm:ss') - } - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - key: key, - value: _value - }) - } else if (this.state.datatype[key] === 'datemonth') { - let _value = '' - if (values[key]) { - _value = moment(values[key]).format('YYYY-MM') - } - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - key: key, - value: _value - }) - } else if (this.state.datatype[key] === 'date') { - let _value = '' - if (values[key]) { - _value = moment(values[key]).format('YYYY-MM-DD') - } - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - key: key, - value: _value - }) - } else if (this.state.datatype[key] === 'number') { - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - key: key, - value: values[key] - }) - } else { - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - key: key, - value: values[key].replace(/(^\s*|\s*$)/ig, '') - // value: values[key].replace(/[\x00-\xff]+/ig, '') - }) - } - }) - resolve(search) - } else { - reject(err) - } - }) - }) - } - - handleSubmit = (e) => { - e.preventDefault() - this.props.inputSubmit() - } - - render() { - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 8 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - } - } - return ( - <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="main-form-box"> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/tabviews/commontable/mutilform/index.scss b/src/tabviews/commontable/mutilform/index.scss deleted file mode 100644 index 8ca26e5..0000000 --- a/src/tabviews/commontable/mutilform/index.scss +++ /dev/null @@ -1,21 +0,0 @@ -.ant-advanced-search-form.main-form-field { - position: relative; - padding: 0px 24px 20px; - .ant-form-item { - display: flex; - // margin-bottom: 10px; - } - .ant-form-item-control-wrapper { - flex: 1; - } - .ant-form-item-label { - min-width: 100px; - } - .ant-input-number { - width: 100%; - } - p { - color: #1890ff; - border-bottom: 1px solid #d9d9d9; - } -} \ No newline at end of file diff --git a/src/tabviews/home/index.jsx b/src/tabviews/home/index.jsx index cb704df..63af809 100644 --- a/src/tabviews/home/index.jsx +++ b/src/tabviews/home/index.jsx @@ -35,7 +35,7 @@ color: ['#1890ff'], tooltip : { trigger: 'axis', - axisPointer : { // 鍧愭爣杞存寚绀哄櫒锛屽潗鏍囪酱瑙﹀彂鏈夋晥 + axisPointer : { // 鍧愭爣杞存寚绀哄櫒锛屽潗鏍囪酱瑙﹀彂鏈夋晥 type : '' // 榛樿涓虹洿绾匡紝鍙�変负锛�'line' | 'shadow' } }, @@ -316,16 +316,11 @@ } const mapStateToProps = (state) => { - return { - // tabviews: state.tabviews - } + return {} } const mapDispatchToProps = (dispatch) => { - return { - // refreshTabView: (refreshTab) => dispatch(refreshTabView(refreshTab)), - // modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) - } + return {} } export default connect(mapStateToProps, mapDispatchToProps)(Home) \ No newline at end of file diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 323a868..fef8927 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -4,9 +4,9 @@ import { notification, Spin} from 'antd' import moment from 'moment' import Api from '@/api' -import SubSearch from './subSearch' -import SubAction from './subAction' import SubTable from './subTable' +import SubAction from '@/tabviews/tableshare/actionList' +import SubSearch from '@/tabviews/tableshare/topSearch' import NotFount from '@/components/404' import zhCN from '@/locales/zh-CN/main.js' import enUS from '@/locales/en-US/main.js' @@ -498,13 +498,14 @@ {actions && <SubAction ref="subButton" - MenuID={this.props.SupMenuID} - BID={this.props.BID} + type="sub" setting={setting} + actions={actions} + BID={this.props.BID} + dict={this.state.dict} + MenuID={this.props.SupMenuID} refreshdata={this.refreshbyaction} gettableselected={this.gettableselected} - actions={actions} - dict={this.state.dict} /> } {columns && diff --git a/src/tabviews/subtable/subAction/index.jsx b/src/tabviews/subtable/subAction/index.jsx deleted file mode 100644 index d19b11a..0000000 --- a/src/tabviews/subtable/subAction/index.jsx +++ /dev/null @@ -1,810 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import moment from 'moment' -import { Button, Modal, notification, Spin } from 'antd' -import MutilForm from '../mutilform' -import Utils from '@/utils/utils.js' -import Api from '@/api' -import './index.scss' - -const { confirm } = Modal - -class MainAction extends Component { - static propTpyes = { - BID: PropTypes.string, - dict: PropTypes.object, // 瀛楀吀椤� - MenuID: PropTypes.string, - actions: PropTypes.array, // 鎼滅储鏉′欢鍒楄〃 - setting: PropTypes.any - } - - state = { - visible: false, - formdata: null, - tabledata: null, - confirmLoading: false, - execAction: null, - loadingUuid: '', - btnloading: false, - configMap: {} - } - - refreshdata = (item, type) => { - this.props.refreshdata(item, type) - } - - actionTrigger = (item, record) => { - const { setting } = this.props - - let _this = this - let data = this.props.gettableselected() || [] - - if (record) { // 琛ㄦ牸涓Е鍙戞寜閽� - data = [record] - } - - if (item.Ot !== 'notRequired' && data.length === 0) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹� - notification.warning({ - top: 92, - message: this.props.dict['main.action.confirm.selectline'], - duration: 10 - }) - return - } else if (item.Ot === 'requiredSgl' && data.length !== 1) { - // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁 - notification.warning({ - top: 92, - message: this.props.dict['main.action.confirm.selectSingleLine'], - duration: 10 - }) - return - } else if (item.Ot !== 'notRequired' && !setting.primaryKey) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾槸鍚﹁缃富閿� - notification.warning({ - top: 92, - message: '鏈缃富閿紒', - duration: 10 - }) - return - } - - if (item.OpenType === 'prompt') { - confirm({ - title: this.props.dict['main.action.confirm.tip'], - onOk() { - return new Promise(resolve => { - _this.execSubmit(item, data, resolve) - }) - }, - onCancel() {} - }) - } else if (item.OpenType === 'exec') { - this.setState({loadingUuid: item.uuid}) - this.execSubmit(item, data, () => { - this.setState({loadingUuid: ''}) - }) - } else if (item.OpenType === 'pop') { - this.setState({ - execAction: item, - tabledata: data, - btnloading: true - }, () => { - this.improveAction(item) - }) - } else if (item.OpenType === 'excelOut') { - this.setState({loadingUuid: item.uuid}) - this.refreshdata(item, 'excelOut') - } else { - notification.warning({ - top: 92, - message: '瀹屽杽涓�傘�傘��', - duration: 10 - }) - } - } - - execSubmit = (btn, data, _resolve, formdata) => { - const { setting } = this.props - if (btn.intertype === 'inner') { - // 浣跨敤鍐呴儴鎺ュ彛鏃讹紝鍐呴儴鍑芥暟鍜屾暟鎹簮涓嶅彲鍚屾椂涓虹┖, 浣跨敤绯荤粺鍑芥暟鏃讹紝绫诲瀷涓嶅彲涓虹┖ - if (!btn.innerFunc && (!btn.sql || (btn.sql && !btn.sqlType))) { - this.actionSettingError() - _resolve() - return - } - - if ( - btn.Ot === 'notRequired' || - btn.Ot === 'requiredSgl' || - (btn.Ot === 'requiredOnce' && btn.OpenType !== 'pop') || - (btn.OpenType === 'pop' && !btn.innerFunc && btn.sql && btn.sqlType === 'insert') - ) { - let param = { // 绯荤粺瀛樺偍杩囩▼ - func: 'sPC_TableData_InUpDe', - BID: this.props.BID - } - - if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 鏄惁寮规鎴栫洿鎺ユ墽琛� - let ID = '' - if (btn.Ot === 'notRequired') { - - } else if (btn.Ot === 'requiredSgl') { - ID = data[0][setting.primaryKey] - } else if (btn.Ot === 'requiredOnce') { - let ids = data.map(d => { return d[setting.primaryKey]}) - ID = ids.join(',') - } - - param.ID = ID - - if (btn.innerFunc) { - param.func = btn.innerFunc - } else if (btn.sql) { - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting)) // 鏁版嵁婧� - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - } - } else if (btn.OpenType === 'pop') { // 琛ㄥ崟 - if (btn.innerFunc) { - param.func = btn.innerFunc - - formdata.forEach(_data => { - param[_data.key] = _data.value - }) - if (setting.primaryKey) { - if (!param.hasOwnProperty(setting.primaryKey) && data[0] && data[0][setting.primaryKey]) { - param[setting.primaryKey] = data[0][setting.primaryKey] - } - } - if (!param.hasOwnProperty('ID') && setting.primaryKey && data[0] && data[0][setting.primaryKey]) { - param.ID = data[0][setting.primaryKey] - } - } else if (btn.sql && btn.sqlType === 'insert') { - param.ID = Utils.getguid() - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 鏁版嵁婧� - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - } else if (btn.sql) { - param.ID = data[0][setting.primaryKey] - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 鏁版嵁婧� - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - } - } - - - Api.genericInterface(param).then((res) => { - if (res.status) { - this.execSuccess(btn) - } else { - this.execError(res, btn) - } - _resolve() - }) - } else if (btn.Ot === 'required' || (btn.Ot === 'requiredOnce' && btn.OpenType === 'pop')) { - let deffers = data.map(cell => { - let param = { - func: 'sPC_TableData_InUpDe', - BID: this.props.BID - } - - if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 鏄惁寮规鎴栫洿鎺ユ墽琛� - param.ID = cell[setting.primaryKey] - - if (btn.innerFunc) { - param.func = btn.innerFunc - } else if (btn.sql) { - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting)) // 鏁版嵁婧� - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - } - } else if (btn.OpenType === 'pop') { // 琛ㄥ崟 - if (btn.innerFunc) { - param.func = btn.innerFunc - - formdata.forEach(_data => { - param[_data.key] = _data.value - }) - if (!param.hasOwnProperty(setting.primaryKey) && cell[setting.primaryKey]) { - param[setting.primaryKey] = cell[setting.primaryKey] - } - if (!param.hasOwnProperty('ID') && cell[setting.primaryKey]) { - param.ID = cell[setting.primaryKey] - } - } else if (btn.sql) { - param.ID = cell[setting.primaryKey] - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 鏁版嵁婧� - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - } - } - - return new Promise(resolve => { - Api.genericInterface(param).then(res => { - resolve(res) - }) - }) - }) - Promise.all(deffers).then(result => { - let iserror = false - let errorMsg = '' - result.forEach(res => { - if (res.status) { - - } else { - iserror = true - errorMsg = res.message - } - }) - if (!iserror) { - this.execSuccess(btn) - } else { - notification.error({ - top: 92, - message: errorMsg, - duration: 15 - }) - this.refreshdata(btn, 'error') - } - _resolve() - }) - } else { - this.actionSettingError() - _resolve() - return - } - } else if (btn.intertype === 'outer') { - /** *********************璋冪敤澶栭儴鎺ュ彛************************* */ - let param = { - ID: '', - BID: this.props.BID - } - - if (!btn.interface) { // 鎺ュ彛鍦板潃涓嶅瓨鍦ㄦ椂鎶ラ敊 - this.actionSettingError() - _resolve() - return - } - - if (btn.Ot === 'notRequired' || btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') { - // 鑾峰彇id - if (btn.Ot === 'notRequired') { - - } else if (btn.Ot === 'requiredSgl') { - param.ID = data[0][setting.primaryKey] - } else if (btn.Ot === 'requiredOnce') { - let ids = data.map(d => { return d[setting.primaryKey]}) - param.ID = ids.join(',') - } - - new Promise(resolve => { - // 鍐呴儴璇锋眰 - if (btn.innerFunc) { - param.func = btn.innerFunc - // 瀛樺湪鍐呴儴鍑芥暟鏃讹紝鏁版嵁棰勫鐞� - Api.genericInterface(param).then(res => { - if (res.status) { - delete res.ErrCode - delete res.ErrMesg - delete res.message - delete res.status - - res.rduri = btn.interface - // res.method = btn.method - if (btn.outerFunc) { - res.func = btn.outerFunc - } - // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 - resolve(res) - } else { - this.execError(res, btn) - _resolve() - } - }) - } else { - // 涓嶅瓨鍦ㄥ唴閮ㄥ嚱鏁版椂锛岀敓鎴愬閮ㄨ姹傚弬鏁� - param.rduri = btn.interface - // param.method = btn.method - if (btn.outerFunc) { - param.func = btn.outerFunc - } - resolve(param) - } - }).then(res => { - if (!res) return - // 澶栭儴璇锋眰 - return Api.genericInterface(res) - }).then(response => { - // 鍥炶皟璇锋眰 - if (response.status) { - if (btn.callbackFunc) { - // 瀛樺湪鍥炶皟鍑芥暟鏃讹紝璋冪敤 - delete response.ErrCode - delete response.ErrMesg - delete response.message - delete response.status - - response.func = btn.callbackFunc - return Api.genericInterface(response) - } else { - this.execSuccess(btn) - _resolve() - } - } else { - this.execError(response, btn) - _resolve() - } - }).then(res => { - if (!res) return - - if (res.status) { - this.execSuccess(btn) - } else { - this.execError(res, btn) - } - _resolve() - }) - - } else if (btn.Ot === 'required') { - // 閫夋嫨澶氳锛屽惊鐜皟鐢� - - new Promise(resolve => { - // 鍐呴儴璇锋眰 - if (btn.innerFunc) { - let deffers = data.map(cell => { - let _param = { - BID: this.props.BID, - func: btn.innerFunc - } - _param.ID = cell[setting.primaryKey] - return new Promise(resolve => { - Api.genericInterface(_param).then(res => { - resolve(res) - }) - }) - }) - Promise.all(deffers).then(result => { - let iserror = false - let errorMsg = '' - result.forEach(res => { - if (!res.status) { - iserror = true - errorMsg = res.message - } - }) - if (!iserror) { - resolve(result) - } else { - notification.error({ - top: 92, - message: errorMsg, - duration: 15 - }) - this.refreshdata(btn, 'error') - _resolve() - } - }) - } else { - let params = data.map(cell => { - return { - BID: this.props.BID, - ID: cell[setting.primaryKey] - } - }) - resolve(params) - } - }).then(result => { - // 澶栭儴璇锋眰 - if (!result) return - - let deffers = result.map(res => { - delete res.ErrCode - delete res.ErrMesg - delete res.message - delete res.status - - res.rduri = btn.interface - // res.method = btn.method - if (btn.outerFunc) { - res.func = btn.outerFunc - } - return new Promise(resolve => { - Api.genericInterface(res).then(response => { - resolve(response) - }) - }) - }) - return Promise.all(deffers) - - }).then(result => { - // 鍥炶皟璇锋眰 - let iserror = false - let errorMsg = '' - result.forEach(res => { - if (!res.status) { - iserror = true - errorMsg = res.message - } - }) - if (iserror) { - notification.error({ - top: 92, - message: errorMsg, - duration: 15 - }) - this.refreshdata(btn, 'error') - _resolve() - return - } - - if (btn.callbackFunc) { - // 瀛樺湪鍥炶皟鍑芥暟鏃讹紝璋冪敤 - let deffers = result.map(res => { - delete res.ErrCode - delete res.ErrMesg - delete res.message - delete res.status - - res.func = btn.callbackFunc - return new Promise(resolve => { - Api.genericInterface(res).then(response => { - resolve(response) - }) - }) - }) - return Promise.all(deffers) - } else { - _resolve() - this.execSuccess(btn) - } - }).then(result => { - if (!result) return - - let iserror = false - let errorMsg = '' - result.forEach(res => { - if (!res.status) { - iserror = true - errorMsg = res.message - } - }) - if (iserror) { - notification.error({ - top: 92, - message: errorMsg, - duration: 15 - }) - this.refreshdata(btn, 'error') - return - } else { - this.execSuccess(btn) - } - _resolve() - }) - - } else { - this.actionSettingError() - _resolve() - return - } - - } else { - this.actionSettingError() - _resolve() - return - } - } - - execSuccess = (btn) => { - if (btn.OpenType === 'excelOut') { - this.setState({ - loadingUuid: '' - }) - } else { - notification.success({ - top: 92, - message: this.props.dict['main.action.confirm.success'], - duration: 2 - }) - } - - if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') { - this.setState({ - visible: false - }) - } - this.refreshdata(btn, 'success') - } - - execError = (res, btn) => { - if (!res.ErrCode || res.ErrCode === 'E') { - notification.error({ - top: 92, - message: res.message || res.ErrMesg, - duration: 15 - }) - } else if (res.ErrCode === 'E') { - Modal.error({ - title: res.message || res.ErrMesg - }) - } - - if (btn.OpenType === 'excelOut') { - this.setState({ - loadingUuid: '' - }) - } - - this.refreshdata(btn, 'error') - } - - actionSettingError = () => { - notification.warning({ - top: 92, - message: this.props.dict['main.action.settingerror'], - duration: 10 - }) - } - - improveAction = (action) => { - const { configMap, execAction } = this.state - - let _config = configMap[action.uuid] - - if (_config) { - this.setState({ - execAction: {..._config, ...execAction} - }, () => { - this.improveActionForm() - }) - } else { - Api.getSystemCacheConfig({ - func: 'sPC_Get_LongParam', - MenuID: action.uuid - }).then(res => { - let _LongParam = '' - - if (res.status && res.LongParam) { - _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) - try { - _LongParam = JSON.parse(_LongParam) - } catch (e) { - _LongParam = '' - } - } - - if (!res.status) { - notification.warning({ - top: 92, - message: res.message, - duration: 10 - }) - this.setState({ - execAction: null, - tabledata: null, - btnloading: false - }) - } else if (!_LongParam || (action.OpenType === 'pop' && _LongParam.type !== 'Modal')) { - notification.warning({ - top: 92, - message: '鏈幏鍙栧埌鎸夐挳閰嶇疆淇℃伅锛�', - duration: 10 - }) - this.setState({ - execAction: null, - tabledata: null, - btnloading: false - }) - } else { - this.setState({ - configMap: {...configMap, [action.uuid]: _LongParam}, - execAction: {..._LongParam, ...execAction} - }, () => { - this.improveActionForm() - }) - } - }) - } - } - - improveActionForm = () => { - const { configMap, execAction } = this.state - let subfields = [] - - if (execAction.groups.length > 0) { - execAction.groups.forEach(group => { - group.sublist.forEach(field => { - if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1') { - subfields.push(field) - } - }) - }) - } else { - execAction.fields.forEach(field => { - if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1') { - subfields.push(field) - } - }) - } - - if (subfields.length === 0) { - this.setState({ - visible: true, - btnloading: false - }) - return - } - - let deffers = subfields.map(item => { - let arrfield = item.valueField + ',' + item.valueText - - if (item.type === 'link') { - arrfield = arrfield + ',' + item.linkField - } - - let param = { - func: 'sPC_Get_SelectedList', - LText: item.dataSourceSql, - obj_name: 'data', - arr_field: arrfield - } - - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - - return new Promise(resolve => { - Api.getSystemCacheConfig(param).then(res => { - res.search = item - resolve(res) - }) - }) - }) - - let _field = {} - let error = '' - Promise.all(deffers).then(result => { - result.forEach(res => { - if (res.status) { - let options = res.data.map(cell => { - let item = { - key: Utils.getuuid(), - Value: cell[res.search.valueField], - Text: cell[res.search.valueText] - } - - if (res.search.type === 'link') { - item.parentId = cell[res.search.linkField] - } - - return item - }) - - _field[res.search.uuid] = options - } else { - error = res - } - }) - - if (error) { - notification.warning({ - top: 92, - message: error.message, - duration: 10 - }) - } - - this.setState({ - configMap: {...configMap, ..._field} - }, () => { - this.setState({ - visible: true, - btnloading: false - }) - }) - }) - } - - handleOk = () => { - this.formRef.handleConfirm().then(res => { - this.setState({ - confirmLoading: true - }) - this.execSubmit(this.state.execAction, this.state.tabledata, () => { - this.setState({ - confirmLoading: false - }) - }, res) - }, () => {}) - } - - handleCancel = () => { - this.setState({ - visible: false - }) - } - - getModels = () => { - const { execAction } = this.state - - if (!execAction || !this.state.visible) return - - let title = '' - let width = '62vw' - let clickouter = false - let container = document.body - - if (execAction && execAction.setting) { - title = execAction.setting.title - width = execAction.setting.width + 'vw' - - if (execAction.setting.container === 'tab') { - width = execAction.setting.width + '%' - container = () => document.getElementById('commontable' + this.props.MenuID) - } - - if (execAction.setting.clickouter === 'close') { - clickouter = true - } - } - - return ( - <Modal - title={title} - maskClosable={clickouter} - getContainer={container} - wrapClassName='action-modal' - visible={this.state.visible} - width={width} - onOk={this.handleOk} - confirmLoading={this.state.confirmLoading} - onCancel={this.handleCancel} - destroyOnClose - > - <MutilForm - dict={this.props.dict} - action={execAction} - inputSubmit={this.handleOk} - configMap={this.state.configMap} - data={this.state.tabledata[0]} - wrappedComponentRef={(inst) => this.formRef = inst} - /> - </Modal> - ) - } - - render() { - const { loadingUuid, btnloading } = this.state - - return ( - <div className="button-list"> - {this.props.actions.map((item, index) => { - if (loadingUuid === item.uuid) { - return ( - <Button - className={'mk-btn mk-' + item.class} - icon={item.icon} - key={'action' + index} - onClick={() => {this.actionTrigger(item)}} - loading - >{item.label}</Button> - ) - } else { - return ( - <Button - className={'mk-btn mk-' + item.class} - icon={item.icon} - key={'action' + index} - onClick={() => {this.actionTrigger(item)}} - >{item.label}</Button> - ) - } - })} - {this.getModels()} - {btnloading && <Spin size="large" />} - </div> - ) - } -} - -export default MainAction \ No newline at end of file diff --git a/src/tabviews/subtable/subAction/index.scss b/src/tabviews/subtable/subAction/index.scss deleted file mode 100644 index 4a3f9b5..0000000 --- a/src/tabviews/subtable/subAction/index.scss +++ /dev/null @@ -1,41 +0,0 @@ -.subtable .button-list { - padding: 10px 0px 5px; - background: #ffffff; - button { - margin-right: 15px; - margin-bottom: 10px; - } - .ant-spin { - position: fixed; - z-index: 1010; - left: 50vw; - top: calc(50vh - 70px); - } -} -// 璁剧疆妯℃�佹鏍峰紡锛岃瀹氭渶澶ф渶灏忛珮搴︼紝閲嶇疆婊氬姩鏉� -.action-modal { - .ant-modal { - max-width: 95vw; - } - .ant-modal-body { - max-height: calc(100vh - 235px); - min-height: 150px; - overflow-y: auto; - padding-bottom: 35px; - } - .ant-modal-body::-webkit-scrollbar { - width: 10px; - height: 10px; - } - .ant-modal-body::-webkit-scrollbar-thumb { - border-radius: 5px; - box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); - background: rgba(0, 0, 0, 0.13); - } - .ant-modal-body::-webkit-scrollbar-track { - box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); - border-radius: 3px; - border: 1px solid rgba(0, 0, 0, 0.07); - background: rgba(0, 0, 0, 0); - } -} \ No newline at end of file diff --git a/src/tabviews/subtable/subTable/index.jsx b/src/tabviews/subtable/subTable/index.jsx index 5cf6daf..d280f0b 100644 --- a/src/tabviews/subtable/subTable/index.jsx +++ b/src/tabviews/subtable/subTable/index.jsx @@ -41,7 +41,6 @@ } _columns.push(cell) }) - // {item.FieldName === 'MenuNo' ? <Icon onClick={(e) => {this.copycontent(e, record[item.FieldName])}} type="copy"/> : ''} this.setState({columns: _columns}) } diff --git a/src/tabviews/commontable/mainAction/index.jsx b/src/tabviews/tableshare/actionList/index.jsx similarity index 97% rename from src/tabviews/commontable/mainAction/index.jsx rename to src/tabviews/tableshare/actionList/index.jsx index ed6be69..f5ef28f 100644 --- a/src/tabviews/commontable/mainAction/index.jsx +++ b/src/tabviews/tableshare/actionList/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import moment from 'moment' import { Button, Affix, Modal, notification, Spin } from 'antd' -import MutilForm from '../mutilform' +import MutilForm from '@/tabviews/tableshare/mutilform' import Utils from '@/utils/utils.js' import Api from '@/api' import './index.scss' @@ -11,6 +11,8 @@ class MainAction extends Component { static propTpyes = { + BID: PropTypes.string, + type: PropTypes.string, MenuID: PropTypes.string, actions: PropTypes.array, // 鎼滅储鏉′欢鍒楄〃 dict: PropTypes.object, // 瀛楀吀椤� @@ -26,6 +28,10 @@ loadingUuid: '', btnloading: false, configMap: {} + } + + UNSAFE_componentWillMount() { + console.log(this.props.type) } refreshdata = (item, type) => { @@ -120,7 +126,8 @@ (btn.OpenType === 'pop' && !btn.innerFunc && btn.sql && btn.sqlType === 'insert') ) { let param = { // 绯荤粺瀛樺偍杩囩▼ - func: 'sPC_TableData_InUpDe' + func: 'sPC_TableData_InUpDe', + BID: this.props.BID } if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 鏄惁寮规鎴栫洿鎺ユ墽琛� @@ -135,7 +142,6 @@ } param.ID = ID - param.BID = '' if (btn.innerFunc) { param.func = btn.innerFunc @@ -159,18 +165,13 @@ if (!param.hasOwnProperty('ID') && setting.primaryKey && data[0] && data[0][setting.primaryKey]) { param.ID = data[0][setting.primaryKey] } - if (!param.hasOwnProperty('BID')) { - param.BID = '' - } } else if (btn.sql && btn.sqlType === 'insert') { param.ID = Utils.getguid() - param.BID = '' param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 鏁版嵁婧� param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } else if (btn.sql) { param.ID = data[0][setting.primaryKey] - param.BID = '' param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 鏁版嵁婧� param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) @@ -189,12 +190,12 @@ } else if (btn.Ot === 'required' || (btn.Ot === 'requiredOnce' && btn.OpenType === 'pop')) { let deffers = data.map(cell => { let param = { - func: 'sPC_TableData_InUpDe' + func: 'sPC_TableData_InUpDe', + BID: this.props.BID } if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 鏄惁寮规鎴栫洿鎺ユ墽琛� param.ID = cell[setting.primaryKey] - param.BID = '' if (btn.innerFunc) { param.func = btn.innerFunc @@ -218,7 +219,6 @@ } } else if (btn.sql) { param.ID = cell[setting.primaryKey] - param.BID = '' param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 鏁版嵁婧� param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) @@ -263,7 +263,7 @@ /** *********************璋冪敤澶栭儴鎺ュ彛************************* */ let param = { ID: '', - BID: '' + BID: this.props.BID } if (!btn.interface) { // 鎺ュ彛鍦板潃涓嶅瓨鍦ㄦ椂鎶ラ敊 @@ -359,7 +359,7 @@ if (btn.innerFunc) { let deffers = data.map(cell => { let _param = { - BID: '', + BID: this.props.BID, func: btn.innerFunc } _param.ID = cell[setting.primaryKey] @@ -393,7 +393,7 @@ } else { let params = data.map(cell => { return { - BID: '', + BID: this.props.BID, ID: cell[setting.primaryKey] } }) @@ -781,7 +781,7 @@ render() { const { loadingUuid, btnloading } = this.state - if (this.props.setting.actionfixed) { // 鎸夐挳鏄惁鍥哄畾鍦ㄥご閮� + if (this.props.setting.actionfixed && this.props.type === 'main') { // 鎸夐挳鏄惁鍥哄畾鍦ㄥご閮� return ( <Affix offsetTop={48}> <div className="button-list" id={this.props.MenuID + 'mainaction'}> diff --git a/src/tabviews/commontable/mainAction/index.scss b/src/tabviews/tableshare/actionList/index.scss similarity index 100% rename from src/tabviews/commontable/mainAction/index.scss rename to src/tabviews/tableshare/actionList/index.scss diff --git a/src/tabviews/subtable/mutilform/index.jsx b/src/tabviews/tableshare/mutilform/index.jsx similarity index 100% rename from src/tabviews/subtable/mutilform/index.jsx rename to src/tabviews/tableshare/mutilform/index.jsx diff --git a/src/tabviews/subtable/mutilform/index.scss b/src/tabviews/tableshare/mutilform/index.scss similarity index 100% rename from src/tabviews/subtable/mutilform/index.scss rename to src/tabviews/tableshare/mutilform/index.scss diff --git a/src/tabviews/subtable/subSearch/index.jsx b/src/tabviews/tableshare/topSearch/index.jsx similarity index 100% rename from src/tabviews/subtable/subSearch/index.jsx rename to src/tabviews/tableshare/topSearch/index.jsx diff --git a/src/tabviews/subtable/subSearch/index.scss b/src/tabviews/tableshare/topSearch/index.scss similarity index 100% rename from src/tabviews/subtable/subSearch/index.scss rename to src/tabviews/tableshare/topSearch/index.scss diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 3c01a52..5603d4a 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -6,19 +6,19 @@ import HTML5Backend from 'react-dnd-html5-backend' import { Button, Card, Modal, Collapse, notification, Spin, Select, List, Icon, Empty, Switch, Tooltip } from 'antd' import moment from 'moment' -import DragElement from './dragelement' -import TabDragElement from './tabdragelement' -import SourceElement from './dragelement/source' -import Api from '@/api' -import TabForm from './tabform' -import SearchForm from './searchform' import ActionForm from './actionform' -import ColumnForm from './columnform' -import ColspanForm from './colspanform' import SettingForm from './settingform' -import GridBtnForm from './gridbtnform' -import EditCard from './editcard' -import MenuForm from './menuform' +import TabForm from './tabform' +import TabDragElement from './tabdragelement' +import Api from '@/api' +import SearchForm from '@/templates/tableshare/searchform' +import ColumnForm from '@/templates/tableshare/columnform' +import DragElement from '@/templates/tableshare/dragelement' +import ColspanForm from '@/templates/tableshare/colspanform' +import GridBtnForm from '@/templates/tableshare/gridbtnform' +import EditCard from '@/templates/tableshare/editcard' +import MenuForm from '@/templates/tableshare/menuform' +import SourceElement from '@/templates/tableshare/dragelement/source' import zhCN from '@/locales/zh-CN/comtable.js' import enUS from '@/locales/en-US/comtable.js' import Utils from '@/utils/utils.js' diff --git a/src/templates/comtableconfig/menuform/index.jsx b/src/templates/comtableconfig/menuform/index.jsx deleted file mode 100644 index aa09a7c..0000000 --- a/src/templates/comtableconfig/menuform/index.jsx +++ /dev/null @@ -1,97 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select } from 'antd' -import './index.scss' - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - formlist: PropTypes.array - } - - getFields() { - const { getFieldDecorator } = this.props.form - const fields = [] - this.props.formlist.forEach((item, index) => { - if (item.type === 'text') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={24} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={24} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - getPopupContainer={() => document.getElementById('qazxcvbn')} - > - {item.options.map(option => - <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}> - {option.text} - </Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } - }) - return fields - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - resolve(values) - } else { - reject(err) - } - }) - }) - } - - render() { - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 24 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 24 } - } - } - return ( - <Form {...formItemLayout} className="ant-advanced-search-form" id="qazxcvbn"> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/templates/subtableconfig/colspanform/index.jsx b/src/templates/subtableconfig/colspanform/index.jsx deleted file mode 100644 index 912030a..0000000 --- a/src/templates/subtableconfig/colspanform/index.jsx +++ /dev/null @@ -1,173 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, InputNumber, Select, Radio } from 'antd' -import TransferForm from '../transferform' -import './index.scss' - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - columns: PropTypes.array, - card: PropTypes.any - } - - state = { - - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - let targetKeys = this.refs['column-transfer'].state.targetKeys - - delete values.type // 鍒犻櫎type锛屾澶勫�间负'鍚堝苟鍒�'鏂囧瓧 - - let subfield = [] // 鐢ㄤ簬鏌ョ湅鍚堝苟鍒楀瓧娈� - this.props.columns.forEach(col => { - if (col.field && targetKeys.includes(col.uuid)) { - subfield.push(col.field) - } - }) - subfield = subfield.join(', ') - - let _card = {...this.props.card, ...values, sublist: targetKeys, subfield: subfield} - - resolve({ - type: 'columns', - values: _card - }) - } else { - reject(err) - } - }) - }) - } - - render() { - const { getFieldDecorator } = this.props.form - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - } - } - return ( - <Form {...formItemLayout} className="ant-advanced-search-form commontable-column-form" id="columncolspan"> - <Row gutter={24}> - <Col span={12}> - <Form.Item label={this.props.dict['header.form.name']}> - {getFieldDecorator('label', { - initialValue: this.props.card.label, - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['header.form.name'] + '!' - } - ] - })(<Input placeholder="" autoComplete="off" />)} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['header.form.type']}> - {getFieldDecorator('type', { - initialValue: this.props.dict['header.form.colspan'], - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['header.form.type'] + '!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={true}/>)} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['header.form.align']}> - {getFieldDecorator('Align', { - initialValue: this.props.card.Align, - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['header.form.align'] + '!' - } - ] - })( - <Select - getPopupContainer={() => document.getElementById('columncolspan')} - > - <Select.Option value="left">{this.props.dict['header.form.alignLeft']}</Select.Option> - <Select.Option value="right">{this.props.dict['header.form.alignRight']}</Select.Option> - <Select.Option value="center">{this.props.dict['header.form.alignCenter']}</Select.Option> - </Select> - )} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['header.form.columnWidth']}> - {getFieldDecorator('Width', { - initialValue: this.props.card.Width, - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['header.form.columnWidth'] + '!' - } - ] - })(<InputNumber min={1} max={1000} precision={0} />)} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['header.form.Hide']}> - {getFieldDecorator('Hide', { - initialValue: this.props.card.Hide, - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['header.form.Hide'] + '!' - } - ] - })( - <Radio.Group> - <Radio value="true">{this.props.dict['header.form.true']}</Radio> - <Radio value="false">{this.props.dict['header.form.false']}</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['header.form.order']}> - {getFieldDecorator('order', { - initialValue: this.props.card.order, - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['header.form.order'] + '!' - } - ] - })( - <Select - getPopupContainer={() => document.getElementById('columncolspan')} - > - <Select.Option value="vertical">{this.props.dict['header.form.vertical']}</Select.Option> - <Select.Option value="horizontal">{this.props.dict['header.form.horizontal']}</Select.Option> - <Select.Option value="vertical2">{this.props.dict['header.form.vertical2']}</Select.Option> - <Select.Option value="topPicBottomText">{this.props.dict['header.form.topPicBottomText']}</Select.Option> - <Select.Option value="leftPicRightText">{this.props.dict['header.form.leftPicRightText']}</Select.Option> - </Select> - )} - </Form.Item> - </Col> - <Col span={24}> - <TransferForm dict={this.props.dict} columns={this.props.columns} ref="column-transfer" selected={this.props.card.sublist}/> - </Col> - </Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/templates/subtableconfig/colspanform/index.scss b/src/templates/subtableconfig/colspanform/index.scss deleted file mode 100644 index 4f7e976..0000000 --- a/src/templates/subtableconfig/colspanform/index.scss +++ /dev/null @@ -1,9 +0,0 @@ -.ant-advanced-search-form.commontable-column-form { - min-height: 190px; - .ant-form-item { - margin-bottom: 15px; - .ant-input-number { - width: 100%; - } - } -} \ No newline at end of file diff --git a/src/templates/subtableconfig/columnform/index.jsx b/src/templates/subtableconfig/columnform/index.jsx deleted file mode 100644 index c7365a2..0000000 --- a/src/templates/subtableconfig/columnform/index.jsx +++ /dev/null @@ -1,219 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon } from 'antd' -import './index.scss' - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - formlist: PropTypes.any, - card: PropTypes.any - } - - state = { - formlist: null - } - - UNSAFE_componentWillMount () { - let _type = this.props.formlist.filter(form => form.key === 'type')[0].initVal - let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width'] - - if (_type === 'text') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color'] - } else if (_type === 'number') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color'] - } else if (_type === 'textarea') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color'] - } - - this.setState({ - formlist: this.props.formlist.map(item => { - item.hidden = !_options.includes(item.key) - if (item.key === 'matchVal' && (_type === 'text' || _type === 'textarea')) { - item.type = 'text' - } else if (item.key === 'matchVal' && _type === 'number') { - item.type = 'number' - } - return item - }) - }) - } - - typeChange = (key, value) => { - if (key === 'type') { - let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width'] - - if (value === 'text') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color'] - } else if (value === 'number') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color'] - } else if (value === 'textarea') { - _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color'] - } - - this.setState({ - formlist: this.props.formlist.map(item => { - item.hidden = !_options.includes(item.key) - if (item.key === 'matchVal' && (value === 'text' || value === 'textarea')) { - item.type = 'text' - } else if (item.key === 'matchVal' && value === 'number') { - item.type = 'number' - item.initVal = '' - item.hidden = true - } - return item - }) - }, () => { - this.setState({ - formlist: this.props.formlist.map(item => { - if (item.key === 'matchVal' && value === 'number') { - item.hidden = false - } - return item - }) - }) - }) - } - } - - getFields() { - const { getFieldDecorator } = this.props.form - const fields = [] - this.state.formlist.forEach((item, index) => { - if (item.hidden) return - - if (item.type === 'text') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> - <Icon type="question-circle" /> - {item.label} - </Tooltip> : item.label - }> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'number') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<InputNumber min={item.min} max={item.max} precision={item.decimal} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - onChange={(value) => {this.typeChange(item.key, value)}} - getPopupContainer={() => document.getElementById('columnwinter')} - > - {item.options.map(option => - <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}> - {option.text} - </Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'radio') { - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Radio.Group> - { - item.options.map(option => { - return ( - <Radio key={option.MenuID} value={option.MenuID}>{option.text}</Radio> - ) - }) - } - </Radio.Group> - )} - </Form.Item> - </Col> - ) - } - }) - return fields - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - values.id = this.props.card.id - values.uuid = this.props.card.uuid - resolve({ - type: 'columns', - values - }) - } else { - reject(err) - } - }) - }) - } - - render() { - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - } - } - return ( - <Form {...formItemLayout} className="ant-advanced-search-form commontable-column-form" id="columnwinter"> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/templates/subtableconfig/columnform/index.scss b/src/templates/subtableconfig/columnform/index.scss deleted file mode 100644 index 8e195cf..0000000 --- a/src/templates/subtableconfig/columnform/index.scss +++ /dev/null @@ -1,14 +0,0 @@ -.ant-advanced-search-form.commontable-column-form { - min-height: 190px; - .ant-form-item { - margin-bottom: 15px; - .ant-input-number { - width: 100%; - } - } - .anticon-question-circle { - color: #c49f47; - position: relative; - left: -3px; - } -} \ No newline at end of file diff --git a/src/templates/subtableconfig/dragelement/card.jsx b/src/templates/subtableconfig/dragelement/card.jsx deleted file mode 100644 index 00bdafe..0000000 --- a/src/templates/subtableconfig/dragelement/card.jsx +++ /dev/null @@ -1,143 +0,0 @@ -import React from 'react' -import { useDrag, useDrop } from 'react-dnd' -import { Icon, Button, Select, DatePicker, Input } from 'antd' -import moment from 'moment' -import ItemTypes from './itemtypes' -import './index.scss' - -const { MonthPicker, WeekPicker, RangePicker } = DatePicker - -const Card = ({ id, type, card, moveCard, findCard, editCard, delCard, copyCard, hasDrop, showfield }) => { - const originalIndex = findCard(id).index - const [{ isDragging }, drag] = useDrag({ - item: { type: ItemTypes[type], id, originalIndex }, - collect: monitor => ({ - isDragging: monitor.isDragging(), - }), - }) - const [, drop] = useDrop({ - accept: ItemTypes[type], - canDrop: () => true, - drop: (item) => { - if (!item.hasOwnProperty('originalIndex')) { - hasDrop(card) - } - }, - hover({ id: draggedId }) { - if (!draggedId) return - if (draggedId !== id) { - const { index: overIndex } = findCard(id) - moveCard(draggedId, overIndex) - } - }, - }) - const opacity = isDragging ? 0 : 1 - - const edit = () => { - editCard(id) - } - - const del = () => { - delCard(id) - } - - const copy = () => { - copyCard(id) - } - - let _defaultValue = '' // 涓嬫媺鎼滅储銆佹椂闂磋寖鍥寸被鍨嬶紝鍒濆鍊奸渶瑕侀澶勭悊 - - if (type === 'search' && card.type === 'select') { - if (card.initval) { - let _option = card.options.filter(option => option.Value === card.initval)[0] - if (_option) { - _defaultValue = _option.Text || '' - } else { - _defaultValue = '' - } - } else if (card.setAll === 'true') { - _defaultValue = '鍏ㄩ儴' - } - } else if (type === 'search' && card.type === 'daterange') { - _defaultValue = [null, null] - if (card.initval) { - try { - let _initval = JSON.parse(card.initval) - _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')] - } catch { - _defaultValue = [null, null] - } - } - } - - return ( - <div className="page-card" style={type === 'columns' ? { flex: card.Width, opacity: opacity} : { opacity: opacity}}> - <div ref={node => drag(drop(node))}> - {type === 'search' ? - <div className="ant-row ant-form-item"> - <div className="ant-col ant-form-item-label"> - <label title={card.label}>{card.label}</label> - </div> - <div className="ant-col ant-form-item-control-wrapper"> - {card.type === 'text' ? - <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null - } - {(card.type === 'select' || card.type === 'link') ? - <Select defaultValue={_defaultValue}></Select> : null - } - {card.type === 'date' ? - <DatePicker defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null - } - {card.type === 'dateweek' ? - <WeekPicker defaultValue={card.initval ? moment().subtract(card.initval * 7, 'days') : null} /> : null - } - {card.type === 'datemonth' ? - <MonthPicker defaultValue={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null - } - {card.type === 'daterange' ? - <RangePicker - className="data-range" - placeholder={['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡']} - renderExtraFooter={() => 'extra footer'} - defaultValue={_defaultValue} - /> : null - } - <div className="input-mask"></div> - </div> - </div> : null - } - {type === 'action' ? - <Button - className={'mk-btn mk-' + card.class} - icon={card.icon} - key={card.uuid} - > - {card.label}{card.position === 'grid' && <Icon type="table" />} - </Button> : null - } - {type === 'columns' ? - <span className="ant-table-header-column"> - <div className="ant-table-column-sorters" title={card.label} style={{textAlign: card.Align}}> - <span className="ant-table-column-title">{card.label}</span> - {card.IsSort === 'true' ? - <span className="ant-table-column-sorter"> - <Icon type="caret-up" /> - <Icon type="caret-down" /> - </span> : null - } - </div> - {showfield ? - <div className="ant-table-column-fields"> - <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span> - </div> : null - } - </span> : null - } - </div> - <Icon className="edit" type="edit" onClick={edit} /> - <Icon className="edit close" type="close" onClick={del} /> - {type === 'action' ? <Icon className="edit copy" type="copy" onClick={copy} /> : null} - </div> - ) -} -export default Card diff --git a/src/templates/subtableconfig/dragelement/index.jsx b/src/templates/subtableconfig/dragelement/index.jsx deleted file mode 100644 index ae0bbf4..0000000 --- a/src/templates/subtableconfig/dragelement/index.jsx +++ /dev/null @@ -1,255 +0,0 @@ -import React, { useState } from 'react' -import { useDrop } from 'react-dnd' -import update from 'immutability-helper' -import { Col, Icon } from 'antd' -import Utils from '@/utils/utils.js' -import Card from './card' -import ItemTypes from './itemtypes' -import './index.scss' - -const Container = ({list, setting, gridBtn, type, placeholder, handleList, handleMenu, deleteMenu, copyElement, handleGridBtn, showfield }) => { - let target = null - const [cards, setCards] = useState(list) - const moveCard = (id, atIndex) => { - const { card, index } = findCard(id) - const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) - setCards(_cards) - handleList(type, _cards) - } - - const findCard = id => { - const card = cards.filter(c => `${c.uuid}` === id)[0] - return { - card, - index: cards.indexOf(card), - } - } - - const editCard = id => { - const { card } = findCard(id) - handleMenu(card) - } - - const delCard = id => { - const { card } = findCard(id) - deleteMenu({card: card, type: type}) - } - - const copyCard = id => { - const { card } = findCard(id) - let copycard = JSON.parse(JSON.stringify(card)) - copycard.uuid = Utils.getuuid() - copycard.origin = false - copycard.label = copycard.label + '(copy)' - - copycard.originCard = card - - copyElement(copycard) - } - - const hasDrop = (item) => { - target = item - } - - const [, drop] = useDrop({ - accept: ItemTypes[type], - drop(item) { - if (item.hasOwnProperty('originalIndex')) { - return - } - - let newcard = {} - if (item.type === 'search') { - let _match = 'like' - if (item.subType === 'select' || item.subType === 'link') { - _match = '=' - } else if (item.subType === 'date' || item.subType === 'datemonth') { - _match = '>=' - } else if (item.subType === 'dateweek' || item.subType === 'daterange') { - _match = 'between' - } - newcard.uuid = Utils.getuuid() - newcard.label = 'label' - newcard.field = '' - newcard.initval = '' - newcard.type = item.subType - newcard.resourceType = '0' - newcard.options = [] - newcard.dataSource = '' - newcard.setAll = 'false' - newcard.linkField = '' - newcard.valueField = '' - newcard.valueText = '' - newcard.orderBy = '' - newcard.orderType = 'asc' - newcard.match = _match - newcard.display = 'dropdown' - } else if (item.type === 'action') { - newcard.uuid = Utils.getuuid() - newcard.label = 'button' - newcard.innerFunc = '' - newcard.outerFunc = '' - newcard.sql = '' - newcard.sqlType = '' - newcard.Ot = 'requiredSgl' - newcard.OpenType = item.subType - newcard.icon = '' - newcard.class = 'default' - newcard.intertype = 'inner' - newcard.interface = '' - newcard.method = 'POST' - newcard.position = 'toolbar' - newcard.execSuccess = 'grid' - newcard.execError = 'never' - newcard.callbackFunc = '' - - if (item.subType === 'excelIn' || item.subType === 'excelOut') { - // 瀵煎叆鍜屽鍑篹xcel锛屾寜閽悕绉扮洿鎺ヤ负瀵煎叆銆佸鍑� - newcard.label = item.label - } - } else if (item.type === 'columns') { - newcard.uuid = Utils.getuuid() - newcard.Align = 'left' - newcard.label = 'label' - newcard.field = '' - newcard.Hide = 'false' - newcard.IsSort = 'true' - newcard.type = item.subType - newcard.Width = 120 - if (item.subType === 'colspan') { - newcard.sublist = [] - newcard.subfield = [] - newcard.IsSort = 'false' - newcard.order = 'vertical' - } - } - - let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0 - if (target) { - targetId = target.uuid - } - - const { index: overIndex } = findCard(`${targetId}`) - let targetIndex = overIndex - if (!target) { - targetIndex++ - } - if (targetIndex < 0) { - targetIndex = 0 - } - - const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] }) - setCards(_cards) - handleList(type, _cards, newcard) - target = null - } - }) - let columns = [] - let _colCards = [] - - // 杩囨护鍚堝苟鍒� - if (type === 'columns') { - let _hideCol = [] - cards.forEach(col => { - if (col.type === 'colspan' && col.sublist) { - _hideCol = _hideCol.concat(col.sublist) - } - }) - cards.forEach(col => { - if (!_hideCol.includes(col.uuid)) { - _colCards.push(col) - } - }) - } - - // 鏄剧ず鍒楀垎琛� - if (type === 'columns' && _colCards.length > 10) { - let number = Math.ceil(_colCards.length / Math.ceil(_colCards.length / 10)) - for (let i = 0, len = _colCards.length; i < len; i += number) { - columns.push(_colCards.slice(i, i + number)) - } - } else if (type === 'columns') { - columns.push(_colCards) - } - - return ( - <div ref={drop} className="ant-row"> - {type === 'action' && cards.map(card => ( - <Card - key={card.uuid} - id={`${card.uuid}`} - type={type} - card={card} - moveCard={moveCard} - editCard={editCard} - delCard={delCard} - copyCard={copyCard} - findCard={findCard} - hasDrop={hasDrop} - /> - ))} - {type === 'search' && cards.map(card => ( - <Col key={card.uuid} span={6}> - <Card - id={`${card.uuid}`} - type={type} - card={card} - moveCard={moveCard} - editCard={editCard} - delCard={delCard} - findCard={findCard} - hasDrop={hasDrop} - /> - </Col> - ))} - {type === 'columns' && _colCards.length > 0 && - columns.map((column, i) => ( - <div key={i} className="column-box"> - {/* 澶氶�� */} - {i === 0 && setting.tableType === 'checkbox' ? - <div className="page-card" style={{flex: 60}}> - <span className="ant-checkbox-inner"></span> - </div> : null - } - {/* 鍗曢�� */} - {i === 0 && setting.tableType === 'radio' ? - <div className="page-card" style={{flex: 60}}></div> : null - } - {column.map(card => ( - <Card - key={card.uuid} - id={`${card.uuid}`} - type={type} - card={card} - showfield={showfield} - moveCard={moveCard} - editCard={editCard} - delCard={delCard} - findCard={findCard} - hasDrop={hasDrop} - /> - ))} - {i === (columns.length - 1) && gridBtn && gridBtn.display ? - <div className="page-card" style={{flex: gridBtn.Width}}> - <div style={{cursor: 'default'}}> - <span className="ant-table-header-column"> - <div className="ant-table-column-sorters" title={gridBtn.label} style={{textAlign: gridBtn.Align}}> - <span className="ant-table-column-title">{gridBtn.label}</span> - </div> - </span> - </div> - <Icon className="edit" type="edit" onClick={handleGridBtn}/> - </div> : null - } - </div> - )) - } - {cards.length === 0 && - <div className="common-drawarea-placeholder"> - {placeholder} - </div> - } - </div> - ) -} -export default Container diff --git a/src/templates/subtableconfig/dragelement/index.scss b/src/templates/subtableconfig/dragelement/index.scss deleted file mode 100644 index 38776f9..0000000 --- a/src/templates/subtableconfig/dragelement/index.scss +++ /dev/null @@ -1,15 +0,0 @@ -.common-source-item { - display: block; - box-shadow: 0px 0px 2px #bcbcbc; - padding: 0.4rem 0.7rem; - background-color: white; - margin: 0px 0px 10px; - cursor: move; - border-radius: 4px; -} -.common-drawarea-placeholder { - width: 100%; - line-height: 65px; - text-align: center; - color: #bcbcbc; -} \ No newline at end of file diff --git a/src/templates/subtableconfig/dragelement/itemtypes.js b/src/templates/subtableconfig/dragelement/itemtypes.js deleted file mode 100644 index 9ea1f2c..0000000 --- a/src/templates/subtableconfig/dragelement/itemtypes.js +++ /dev/null @@ -1,8 +0,0 @@ -export default { - CARD: 'card', - form: 'form', - search: 'search', - action: 'action', - columns: 'columns', - tab: 'tab' -} diff --git a/src/templates/subtableconfig/dragelement/source.jsx b/src/templates/subtableconfig/dragelement/source.jsx deleted file mode 100644 index ab22158..0000000 --- a/src/templates/subtableconfig/dragelement/source.jsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' -import { useDrag } from 'react-dnd' -import './index.scss' - -const SourceElement = ({content}) => { - const [, drag] = useDrag({ item: content }) - return ( - <div ref={drag} className="common-source-item"> - {content.label} - </div> - ) -} -export default SourceElement \ No newline at end of file diff --git a/src/templates/subtableconfig/editable/index.jsx b/src/templates/subtableconfig/editable/index.jsx deleted file mode 100644 index 4f10603..0000000 --- a/src/templates/subtableconfig/editable/index.jsx +++ /dev/null @@ -1,258 +0,0 @@ -import React, {Component} from 'react' -import { Table, Input, Button, Popconfirm, Form, Icon } from 'antd' -import Utils from '@/utils/utils.js' -import './index.scss' - -const EditableContext = React.createContext() - -const EditableRow = ({ form, index, ...props }) => ( - <EditableContext.Provider value={form}> - <tr {...props} /> - </EditableContext.Provider> -) - -const EditableFormRow = Form.create()(EditableRow) - -class EditableCell extends Component { - state = { - editing: false - } - - toggleEdit = () => { - const editing = !this.state.editing - this.setState({ editing }, () => { - if (editing) { - this.input.focus() - } - }) - } - - save = e => { - const { record, handleSave } = this.props - this.form.validateFields((error, values) => { - handleSave({ ...record, ...values }) - if (error && error[e.currentTarget.id]) { - return - } - this.toggleEdit() - // handleSave({ ...record, ...values }) - }) - } - - renderCell = form => { - this.form = form - const { children, dataIndex, record } = this.props - const { editing } = this.state - return editing ? ( - <Form.Item style={{ margin: 0 }}> - {form.getFieldDecorator(dataIndex, { - rules: [ - { - required: true, - message: 'NOT NULL.', - }, - ], - initialValue: record[dataIndex] - })(<Input ref={node => (this.input = node)} autoComplete="off" onPressEnter={this.save} onBlur={this.save} />)} - </Form.Item> - ) : ( - <div - className="editable-cell-value-wrap" - onClick={this.toggleEdit} - > - {children} - </div> - ) - } - - render() { - const { - editable, - dataIndex, - title, - record, - index, - handleSave, - children, - ...restProps - } = this.props - return ( - <td {...restProps}> - {editable ? ( - <EditableContext.Consumer style={{padding: 0}}>{this.renderCell}</EditableContext.Consumer> - ) : ( - children - )} - </td> - ) - } -} - -class EditTable extends Component { - constructor(props) { - super(props) - let columns = [ - { - title: 'Value', - dataIndex: 'Value', - width: props.type === 'link' ? '27%' : '40%', - editable: true - }, - { - title: 'Text', - dataIndex: 'Text', - width: props.type === 'link' ? '27%' : '40%', - editable: true - }, - { - title: '鎿嶄綔', - align: 'center', - dataIndex: 'operation', - render: (text, record) => - this.state.dataSource.length >= 1 ? ( - <Popconfirm title="Sure to delete?" onConfirm={() => this.handleDelete(record.key)}> - <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> - </Popconfirm> - ) : null, - } - ] - - if (props.type === 'link') { - columns.unshift({ - title: 'ParentID', - dataIndex: 'ParentID', - width: '27%', - editable: true - }) - } - - this.state = { - columns: columns, - dataSource: props.data, - count: props.data.length, - type: props.type - } - } - - handleDelete = key => { - const dataSource = [...this.state.dataSource] - this.setState({ dataSource: dataSource.filter(item => item.key !== key) }) - } - - handleAdd = () => { - const { type, count, dataSource } = this.state - const newData = { - key: Utils.getuuid(), - Value: `${count}`, - Text: `${count}` - } - if (type === 'link') { - newData.ParentID = `${count}` - } - this.setState({ - dataSource: [...dataSource, newData], - count: count + 1 - }) - } - - handleSave = row => { - const newData = [...this.state.dataSource] - const index = newData.findIndex(item => row.key === item.key) - const item = newData[index] - newData.splice(index, 1, { - ...item, - ...row - }) - this.setState({ dataSource: newData }) - } - - resetColumn = (type) => { - let columns = [ - { - title: 'Value', - dataIndex: 'Value', - width: type === 'link' ? '27%' : '40%', - editable: true - }, - { - title: 'Text', - dataIndex: 'Text', - width: type === 'link' ? '27%' : '40%', - editable: true - }, - { - title: '鎿嶄綔', - align: 'center', - dataIndex: 'operation', - render: (text, record) => - this.state.dataSource.length >= 1 ? ( - <Popconfirm title="Sure to delete?" onConfirm={() => this.handleDelete(record.key)}> - <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> - </Popconfirm> - ) : null, - } - ] - - if (type === 'link') { - columns.unshift({ - title: 'ParentID', - dataIndex: 'ParentID', - width: '27%', - editable: true - }) - } - - this.setState({ - columns: columns, - type: type - }) - } - - UNSAFE_componentWillReceiveProps (nextProps) { - if (this.props.type !== nextProps.type) { - this.resetColumn(nextProps.type) - } - } - - render() { - const { dataSource } = this.state - const components = { - body: { - row: EditableFormRow, - cell: EditableCell - } - } - const columns = this.state.columns.map(col => { - if (!col.editable) { - return col - } - return { - ...col, - onCell: record => ({ - record, - editable: col.editable, - dataIndex: col.dataIndex, - title: col.title, - handleSave: this.handleSave, - }) - } - }) - return ( - <div className="common-modal-edit-table"> - <Button onClick={this.handleAdd} type="primary" className="add-row"> - 娣诲姞 - </Button> - <Table - components={components} - rowClassName={() => 'editable-row'} - bordered - dataSource={dataSource} - columns={columns} - pagination={false} - /> - </div> - ) - } -} - -export default EditTable \ No newline at end of file diff --git a/src/templates/subtableconfig/editable/index.scss b/src/templates/subtableconfig/editable/index.scss deleted file mode 100644 index f8f0942..0000000 --- a/src/templates/subtableconfig/editable/index.scss +++ /dev/null @@ -1,36 +0,0 @@ -.common-modal-edit-table { - .add-row { - position: absolute; - z-index: 1; - right: 12px; - top: -40px; - } - .ant-table-thead > tr > th { - padding: 10px 16px; - } - .ant-table-tbody > tr > td { - padding: 0px 16px; - } - .editable-cell-value-wrap { - cursor: pointer; - height: 40px; - width: 100px; - display: table-cell; - vertical-align: middle; - word-wrap: break-word; - word-break: break-word; - .ant-input { - height: 30px; - padding: 0 11px; - } - } - .ant-form-item-control-wrapper { - width: 100%; - } - .ant-table-placeholder { - padding: 5px 16px; - .ant-empty-normal { - margin: 0; - } - } -} diff --git a/src/templates/subtableconfig/editcard/index.jsx b/src/templates/subtableconfig/editcard/index.jsx deleted file mode 100644 index f005744..0000000 --- a/src/templates/subtableconfig/editcard/index.jsx +++ /dev/null @@ -1,152 +0,0 @@ -import React, {Component} from 'react' -import { Row, Col, Icon, Radio, Input, Button } from 'antd' -import './index.scss' - -const { Search } = Input - -class EditCardCell extends Component { - constructor(props) { - super(props) - - let _type = props.card.type - if (props.type === 'columns') { - if (_type === 'date' || _type === 'datetime') { - _type = 'text' - } - } else if (props.type === 'search') { - if (_type === 'number') { - _type = 'text' - } else if (_type === 'datetime') { - _type = 'daterange' - } - } - - this.state = { - card: {...props.card, type: _type}, - type: props.type - } - } - - changeSelect = () => { - const { card } = this.state - this.setState({ - card: {...card, selected: !card.selected} - }, () => { - this.props.changeCard(this.state.card) - }) - } - - changeType = (e) => { - const { card } = this.state - this.setState({ - card: {...card, type: e.target.value} - }, () => { - this.props.changeCard(this.state.card) - }) - } - - render() { - const { card, type } = this.state - return ( - <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} > - <div className="base" onClick={this.changeSelect}> - <Icon type="check" /> - <p title={card.field}>{this.props.dict['header.form.field']}锛� <span>{card.field}</span></p> - <p title={card.label}>{this.props.dict['header.form.name']}锛� <span>{card.label}</span></p> - </div> - {type === 'search' ? - <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}> - <Radio value="text">text</Radio> - <Radio value="select">select</Radio> - <Radio value="daterange">dateRange</Radio> - </Radio.Group> : null - } - {type === 'columns' ? - <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}> - <Radio value="text">text</Radio> - <Radio value="number">number</Radio> - <Radio value="picture">picture</Radio> - </Radio.Group> : null - } - </div> - ) - } -} - -class EditCard extends Component { - constructor(props) { - super(props) - - this.state = { - dataSource: props.data, - selectCards: props.data.filter(item => item.selected), - type: props.type, - searchKey: '', - loading: false - } - } - - changeCard = (item) => { - let cards = JSON.parse(JSON.stringify(this.state.selectCards)) - let isAdd = true - cards = cards.map(card => { - if (card.field === item.field) { - isAdd = false - return item - } else { - return card - } - }) - if (isAdd) { - cards.push(item) - } - this.setState({ - selectCards: cards - }) - } - - reset = () => { - this.setState({ - searchKey: '', - loading: true - }, () => { - this.setState({ - loading: false - }) - }) - } - - render() { - const { dataSource, type, loading } = this.state - - return ( - <div className="common-modal-edit-card"> - <Row className="search-row"> - <Col span={8}> - {!loading ? <Search placeholder={this.props.dict['header.form.field.placeholder']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} - </Col> - <Col span={8}> - <Button onClick={this.reset}> - {this.props.dict['header.reset']} - </Button> - </Col> - </Row> - <Row> - {dataSource.map((item, index) => { - if (item.field.toLowerCase().indexOf(this.state.searchKey.toLowerCase()) >= 0) { - return ( - <Col key={index} span={8}> - <EditCardCell ref={'cellCard' + index} type={type} card={item} dict={this.props.dict} changeCard={this.changeCard} /> - </Col> - ) - } else { - return '' - } - })} - </Row> - </div> - ) - } -} - -export default EditCard \ No newline at end of file diff --git a/src/templates/subtableconfig/editcard/index.scss b/src/templates/subtableconfig/editcard/index.scss deleted file mode 100644 index a504e4a..0000000 --- a/src/templates/subtableconfig/editcard/index.scss +++ /dev/null @@ -1,49 +0,0 @@ -.common-modal-edit-card { - margin-left: -10px; - margin-right: -10px; - .ant-col { - padding: 10px; - .ant-card { - padding: 0px 10px 10px; - p { - margin-bottom: 5px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - label { - margin-right: 15px; - span.ant-radio + * { - padding-right: 0px; - padding-left: 4px; - } - } - .anticon { - position: absolute; - top: 10px; - right: 10px; - opacity: 0.4; - } - .base { - padding-top: 10px; - cursor: pointer; - } - } - .ant-card.selected { - border-color: #1890ff; - box-shadow: 0px 0px 4px #1890ff; - .anticon { - opacity: 1; - color: #1890ff; - } - p { - color: #1890ff; - } - } - } - .search-row { - .ant-col { - padding-top: 0px; - } - } -} diff --git a/src/templates/subtableconfig/gridbtnform/index.jsx b/src/templates/subtableconfig/gridbtnform/index.jsx deleted file mode 100644 index 3f2ffbd..0000000 --- a/src/templates/subtableconfig/gridbtnform/index.jsx +++ /dev/null @@ -1,204 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, InputNumber, Radio } from 'antd' -import './index.scss' - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - card: PropTypes.any - } - - state = { - formlist: [ - { - type: 'text', - key: 'label', - label: this.props.dict['header.form.name'], - initVal: this.props.card.label, - required: true - }, - { - type: 'select', - key: 'Align', - label: this.props.dict['header.form.align'], - initVal: this.props.card.Align, - required: true, - options: [{ - MenuID: 'left', - text: this.props.dict['header.form.alignLeft'] - }, { - MenuID: 'right', - text: this.props.dict['header.form.alignRight'] - }, { - MenuID: 'center', - text: this.props.dict['header.form.alignCenter'] - }] - }, - { - type: 'number', - key: 'Width', - decimal: 0, - label: this.props.dict['header.form.columnWidth'], - initVal: this.props.card.Width, - required: true - }, - { - type: 'select', - key: 'style', - label: this.props.dict['header.form.style'], - initVal: this.props.card.style, - required: true, - options: [{ - MenuID: 'button', - text: this.props.dict['header.form.button'] - }, { - MenuID: 'text', - text: this.props.dict['header.form.text'] - }] - }, - { - type: 'select', - key: 'show', - label: this.props.dict['header.form.order'], - initVal: this.props.card.show, - required: true, - options: [{ - MenuID: 'horizontal', - text: this.props.dict['header.form.horizontal'] - }, { - MenuID: 'vertical', - text: this.props.dict['header.form.vertical'] - }] - } - ] - } - - getFields() { - const { getFieldDecorator } = this.props.form - const fields = [] - this.state.formlist.forEach((item, index) => { - if (item.type === 'text') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'number') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<InputNumber min={1} max={1000} precision={item.decimal} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - getPopupContainer={() => document.getElementById('columnwinter')} - > - {item.options.map(option => - <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}> - {option.text} - </Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'radio') { - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Radio.Group> - { - item.options.map(option => { - return ( - <Radio key={option.MenuID} value={option.MenuID}>{option.text}</Radio> - ) - }) - } - </Radio.Group> - )} - </Form.Item> - </Col> - ) - } - }) - return fields - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - resolve({...this.props.card, ...values}) - } else { - reject(err) - } - }) - }) - } - - render() { - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - } - } - return ( - <Form {...formItemLayout} className="ant-advanced-search-form commontable-column-form" id="columnwinter"> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/templates/subtableconfig/gridbtnform/index.scss b/src/templates/subtableconfig/gridbtnform/index.scss deleted file mode 100644 index 4f7e976..0000000 --- a/src/templates/subtableconfig/gridbtnform/index.scss +++ /dev/null @@ -1,9 +0,0 @@ -.ant-advanced-search-form.commontable-column-form { - min-height: 190px; - .ant-form-item { - margin-bottom: 15px; - .ant-input-number { - width: 100%; - } - } -} \ No newline at end of file diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 692102b..6b3e29e 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -6,17 +6,17 @@ import HTML5Backend from 'react-dnd-html5-backend' import { Button, Card, Modal, Collapse, notification, Spin, Select, List, Icon, Empty, Switch, Tooltip } from 'antd' import moment from 'moment' -import DragElement from './dragelement' -import SourceElement from './dragelement/source' import Api from '@/api' -import SearchForm from './searchform' import ActionForm from './actionform' -import ColumnForm from './columnform' -import ColspanForm from './colspanform' import SettingForm from './settingform' -import GridBtnForm from './gridbtnform' -import EditCard from './editcard' -import MenuForm from './menuform' +import SearchForm from '@/templates/tableshare/searchform' +import ColumnForm from '@/templates/tableshare/columnform' +import DragElement from '@/templates/tableshare/dragelement' +import ColspanForm from '@/templates/tableshare/colspanform' +import GridBtnForm from '@/templates/tableshare/gridbtnform' +import EditCard from '@/templates/tableshare/editcard' +import MenuForm from '@/templates/tableshare/menuform' +import SourceElement from '@/templates/tableshare/dragelement/source' import zhCN from '@/locales/zh-CN/comtable.js' import enUS from '@/locales/en-US/comtable.js' import Utils from '@/utils/utils.js' diff --git a/src/templates/subtableconfig/menuform/index.scss b/src/templates/subtableconfig/menuform/index.scss deleted file mode 100644 index e69de29..0000000 --- a/src/templates/subtableconfig/menuform/index.scss +++ /dev/null diff --git a/src/templates/subtableconfig/searchform/index.jsx b/src/templates/subtableconfig/searchform/index.jsx deleted file mode 100644 index 73d67e2..0000000 --- a/src/templates/subtableconfig/searchform/index.jsx +++ /dev/null @@ -1,341 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, Icon, Radio, notification } from 'antd' -import { dateOptions, matchReg } from '@/utils/option.js' -import EditTable from '../editable' -import './index.scss' - -const { TextArea } = Input - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - formlist: PropTypes.any, // 琛ㄥ崟 - card: PropTypes.object // 鎼滅储鏉′欢淇℃伅 - } - - state = { - openType: null, // 鎼滅储鏉′欢鏄剧ず绫诲瀷 - resourceType: null, // 涓嬫媺鎼滅储鏃讹紝閫夐」鏉ユ簮绫诲瀷 - formlist: null // 琛ㄥ崟 - } - - /** - * @description 琛ㄥ崟棰勫鐞� - * 1銆佹牴鎹〃鍗曠被鍨嬶紝鏄剧ず琛ㄥ崟鍙紪杈戦」 - * 2銆佷笅鎷夐�夋嫨锛屾牴鎹暟鎹簮绫诲瀷鏄剧ず鐩稿叧閰嶇疆 - */ - UNSAFE_componentWillMount () { - const { formlist } = this.props - - let type = formlist.filter(cell => cell.key === 'type')[0].initVal - let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal - let _options = ['label', 'field', 'initval', 'type', 'match'] // 榛樿鏄剧ず椤� - - if ((type === 'select' || type === 'link') && resourceType === '0') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓鸿嚜瀹氫箟璧勬簮 - _options = [..._options, 'resourceType', 'setAll', 'options', 'display'] - } else if ((type === 'select' || type === 'link') && resourceType === '1') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓哄悗鍙版暟鎹簮涓幏鍙� - _options = [..._options, 'resourceType', 'setAll', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display'] - } - - if (type === 'link') { // 鍏宠仈绫诲瀷銆佸鍔犲叧鑱斾笂绾х殑瀛楁鍚� - _options = [..._options, 'linkField'] - } - - this.setState({ - openType: type, - resourceType: resourceType, - formlist: formlist.map(form => { - // 琛ㄥ崟涓哄垵濮嬪�煎瓧娈碉紝涓旀暟鎹被鍨嬪睘浜庢椂闂寸被鍨嬫椂锛岃缃垵濮嬪�间负涓嬫媺閫夋嫨锛屽苟閲嶇疆閫夋嫨椤� - if (form.key === 'initval' && dateOptions.hasOwnProperty(type)) { - form.options = dateOptions[type] - form.type = 'select' - } - // 琛ㄥ崟涓哄尮閰嶅瓧娈垫椂锛屾牴鎹笉鍚岀殑绫诲瀷锛屾樉绀哄搴旂殑鍖归厤瑙勫垯 - if (form.key === 'match') { - if (type === 'text') { - form.options = matchReg.text - } else if (type === 'select' || type === 'link') { - form.options = matchReg.select - } else if (type === 'date') { - form.options = matchReg.date - } else if (type === 'datemonth') { - form.options = matchReg.datemonth - } else if (type === 'dateweek' || type === 'daterange') { - form.options = matchReg.daterange - } - } - form.hidden = !_options.includes(form.key) - return form - }) - }) - } - - /** - * @description 鎼滅储鏉′欢绫诲瀷鍒囨崲 - */ - openTypeChange = (key, value) => { - const { resourceType } = this.state - - if (key === 'type') { - let _options = ['label', 'field', 'initval', 'type', 'match'] - - if ((value === 'select' || value === 'link') && resourceType === '0') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓鸿嚜瀹氫箟璧勬簮 - _options = [..._options, 'resourceType', 'setAll', 'options', 'display'] - } else if ((value === 'select' || value === 'link') && resourceType === '1') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓哄悗鍙版暟鎹簮涓幏鍙� - _options = [..._options, 'resourceType', 'setAll', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display'] - } - - if (value === 'link') { - _options = [..._options, 'linkField'] - } - - this.setState({ - openType: value, - formlist: this.state.formlist.map(form => { - form.hidden = !_options.includes(form.key) // 闅愯棌琛ㄥ崟 - - if (form.key === 'initval') { - if (dateOptions.hasOwnProperty(value)) { // 鏍规嵁鎼滅储鏉′欢绫诲瀷锛岄�夋嫨鍒濆鍊肩殑绫诲瀷鍙婃暟鎹� - form.options = dateOptions[value] - form.type = 'select' - } else { - form.type = 'text' - } - form.initVal = '' // 鎼滅储鏉′欢绫诲瀷鍒囨崲鏃讹紝鍒濆鍊肩疆绌� - form.hidden = true - } else if (form.key === 'match') { // 鎼滅储鏉′欢绫诲瀷鍒囨崲鏃讹紝鍖归厤瑙勫垯绫诲瀷瀵瑰簲鍒囨崲 - if (value === 'text') { - form.options = matchReg.text - } else if (value === 'select' || value === 'link') { - form.options = matchReg.select - } else if (value === 'date') { - form.options = matchReg.date - } else if (value === 'datemonth') { - form.options = matchReg.datemonth - } else if (value === 'dateweek' || value === 'daterange') { - form.options = matchReg.daterange - } - form.hidden = true - } - - return form - }) - }, () => { - this.setState({ - formlist: this.state.formlist.map(form => { - - if (form.key === 'initval') { - form.hidden = false - } else if (form.key === 'match') { - form.initVal = form.options[0].value - form.hidden = false - } - - return form - }) - }) - }) - } - } - - /** - * @description 鏁版嵁婧愮被鍨嬪垏鎹� - */ - onChange = (e, key) => { - const { openType } = this.state - let value = e.target.value - - if (key === 'resourceType') { - let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'setAll', 'display'] - - if (value === '0') { - _options = [..._options, 'options'] - } else if (value === '1') { - _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType'] - } - - if (openType === 'link') { - _options = [..._options, 'linkField'] - } - - this.setState({ - resourceType: value, - formlist: this.state.formlist.map(form => { - form.hidden = !_options.includes(form.key) - return form - }) - }) - } - } - - getFields() { - const { getFieldDecorator } = this.props.form - const fields = [] - this.state.formlist.forEach((item, index) => { - if (item.hidden) return - - if (item.type === 'text') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} - onChange={(value) => {this.openTypeChange(item.key, value)}} - getPopupContainer={() => document.getElementById('commontable-search-form-box')} - > - {item.options.map(option => - <Select.Option id={option.value} title={option.text} key={option.value} value={option.value}> - {item.key === 'icon' && <Icon type={option.text} />} {option.text} - </Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'radio') { - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Radio.Group onChange={(e) => {this.onChange(e, item.key)}}> - { - item.options.map(option => { - return ( - <Radio key={option.value} value={option.value}>{option.text}</Radio> - ) - }) - } - </Radio.Group>, - )} - </Form.Item> - </Col> - ) - - } else if (item.type === 'textarea') { - fields.push( - <Col span={20} offset={4} key={index}> - <Form.Item className="text-area"> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<TextArea rows={4} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'options') { - fields.push( - <Col span={20} offset={4} key={index}> - <EditTable data={item.initVal} type={this.state.openType} ref="editTable"/> - </Col> - ) - } - }) - - return fields - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - let isvalid = true - values.id = this.props.card.id - values.uuid = this.props.card.uuid - // 涓嬫媺鑿滃崟鎴栧叧鑱旇彍鍗� - if ((values.type === 'select' || values.type === 'link') && values.resourceType === '0') { - values.options = this.refs.editTable.state.dataSource - values.dataSource = '' - let emptys = [] - if (values.type === 'select') { - emptys = values.options.filter(op => !(op.Value && op.Text)) - } else { - emptys = values.options.filter(op => !(op.Value && op.Text && op.ParentID)) - } - if (emptys.length > 0) { - isvalid = false - } - } else if ((values.type === 'select' || values.type === 'link') && values.resourceType === '1') { - values.options = [] - } - - if (isvalid) { - resolve({ - type: 'search', - values - }) - } else { - notification.warning({ - top: 92, - message: this.props.dict['header.form.selectItem.error'], - duration: 10 - }) - } - } else { - reject(err) - } - }) - }) - } - - render() { - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 8 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - } - } - return ( - <Form {...formItemLayout} className="ant-advanced-search-form commontable-search-form" id="commontable-search-form-box"> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/templates/subtableconfig/searchform/index.scss b/src/templates/subtableconfig/searchform/index.scss deleted file mode 100644 index 1dc8fa9..0000000 --- a/src/templates/subtableconfig/searchform/index.scss +++ /dev/null @@ -1,13 +0,0 @@ -.ant-advanced-search-form.commontable-search-form { - min-height: 180px; - .ant-col-offset-4 { - padding-left: 6px!important; - padding-bottom: 20px; - } - .ant-form-item.text-area { - margin-bottom: 0px; - .ant-form-item-control-wrapper { - width: 100%; - } - } -} \ No newline at end of file diff --git a/src/templates/subtableconfig/transferform/index.jsx b/src/templates/subtableconfig/transferform/index.jsx deleted file mode 100644 index 57e10ad..0000000 --- a/src/templates/subtableconfig/transferform/index.jsx +++ /dev/null @@ -1,75 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Transfer } from 'antd' -import './index.scss' - -class TransferForm extends Component { - static propTypes = { - columns: PropTypes.array, - selected: PropTypes.array, - dict: PropTypes.object, // 瀛楀吀椤� - } - - state = { - data: [], - targetKeys: [], - selectedKeys: [] - } - - handleChange = (nextTargetKeys, direction, moveKeys) => { - this.setState({ targetKeys: nextTargetKeys }) - } - - handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { - this.setState({ selectedKeys: [...sourceSelectedKeys, ...targetSelectedKeys] }) - } - - UNSAFE_componentWillMount() { - let datas = new Map() - this.props.columns.forEach(item => { - if (item.field) { - datas.set(item.uuid, item) - } - }) - - let selecteds = [] - - this.props.selected.forEach(item => { - if (datas.has(item)) { - selecteds.push(item) - // datas.delete(item) - } - }) - - this.setState({ - data: [...datas.values()].map(item => { - return { - key: item.uuid, - title: item.label, - description: '' - } - }), - targetKeys: selecteds - }) - } - - render() { - const { targetKeys, selectedKeys } = this.state - return ( - <div className="common-table-columns-transfer"> - <Transfer - dataSource={this.state.data} - titles={[this.props.dict['header.form.column.source'], this.props.dict['header.form.column.target']]} - targetKeys={targetKeys} - locale={{itemUnit: this.props.dict['header.form.column.itemUnit'], itemsUnit: this.props.dict['header.form.column.itemsUnit']}} - selectedKeys={selectedKeys} - onChange={this.handleChange} - onSelectChange={this.handleSelectChange} - render={item => item.title} - /> - </div> - ) - } -} - -export default TransferForm diff --git a/src/templates/subtableconfig/transferform/index.scss b/src/templates/subtableconfig/transferform/index.scss deleted file mode 100644 index 35d2ad5..0000000 --- a/src/templates/subtableconfig/transferform/index.scss +++ /dev/null @@ -1,6 +0,0 @@ -.common-table-columns-transfer { - padding-left: 18px; - .ant-transfer-list { - width: 296px; - } -} \ No newline at end of file diff --git a/src/templates/comtableconfig/colspanform/index.jsx b/src/templates/tableshare/colspanform/index.jsx similarity index 100% rename from src/templates/comtableconfig/colspanform/index.jsx rename to src/templates/tableshare/colspanform/index.jsx diff --git a/src/templates/comtableconfig/colspanform/index.scss b/src/templates/tableshare/colspanform/index.scss similarity index 100% rename from src/templates/comtableconfig/colspanform/index.scss rename to src/templates/tableshare/colspanform/index.scss diff --git a/src/templates/comtableconfig/columnform/index.jsx b/src/templates/tableshare/columnform/index.jsx similarity index 100% rename from src/templates/comtableconfig/columnform/index.jsx rename to src/templates/tableshare/columnform/index.jsx diff --git a/src/templates/comtableconfig/columnform/index.scss b/src/templates/tableshare/columnform/index.scss similarity index 100% rename from src/templates/comtableconfig/columnform/index.scss rename to src/templates/tableshare/columnform/index.scss diff --git a/src/templates/comtableconfig/dragelement/card.jsx b/src/templates/tableshare/dragelement/card.jsx similarity index 100% rename from src/templates/comtableconfig/dragelement/card.jsx rename to src/templates/tableshare/dragelement/card.jsx diff --git a/src/templates/comtableconfig/dragelement/index.jsx b/src/templates/tableshare/dragelement/index.jsx similarity index 100% rename from src/templates/comtableconfig/dragelement/index.jsx rename to src/templates/tableshare/dragelement/index.jsx diff --git a/src/templates/comtableconfig/dragelement/index.scss b/src/templates/tableshare/dragelement/index.scss similarity index 100% rename from src/templates/comtableconfig/dragelement/index.scss rename to src/templates/tableshare/dragelement/index.scss diff --git a/src/templates/comtableconfig/dragelement/itemtypes.js b/src/templates/tableshare/dragelement/itemtypes.js similarity index 100% rename from src/templates/comtableconfig/dragelement/itemtypes.js rename to src/templates/tableshare/dragelement/itemtypes.js diff --git a/src/templates/comtableconfig/dragelement/source.jsx b/src/templates/tableshare/dragelement/source.jsx similarity index 100% rename from src/templates/comtableconfig/dragelement/source.jsx rename to src/templates/tableshare/dragelement/source.jsx diff --git a/src/templates/comtableconfig/editable/index.jsx b/src/templates/tableshare/editable/index.jsx similarity index 100% rename from src/templates/comtableconfig/editable/index.jsx rename to src/templates/tableshare/editable/index.jsx diff --git a/src/templates/comtableconfig/editable/index.scss b/src/templates/tableshare/editable/index.scss similarity index 100% rename from src/templates/comtableconfig/editable/index.scss rename to src/templates/tableshare/editable/index.scss diff --git a/src/templates/comtableconfig/editcard/index.jsx b/src/templates/tableshare/editcard/index.jsx similarity index 100% rename from src/templates/comtableconfig/editcard/index.jsx rename to src/templates/tableshare/editcard/index.jsx diff --git a/src/templates/comtableconfig/editcard/index.scss b/src/templates/tableshare/editcard/index.scss similarity index 100% rename from src/templates/comtableconfig/editcard/index.scss rename to src/templates/tableshare/editcard/index.scss diff --git a/src/templates/comtableconfig/gridbtnform/index.jsx b/src/templates/tableshare/gridbtnform/index.jsx similarity index 100% rename from src/templates/comtableconfig/gridbtnform/index.jsx rename to src/templates/tableshare/gridbtnform/index.jsx diff --git a/src/templates/comtableconfig/gridbtnform/index.scss b/src/templates/tableshare/gridbtnform/index.scss similarity index 100% rename from src/templates/comtableconfig/gridbtnform/index.scss rename to src/templates/tableshare/gridbtnform/index.scss diff --git a/src/templates/subtableconfig/menuform/index.jsx b/src/templates/tableshare/menuform/index.jsx similarity index 99% rename from src/templates/subtableconfig/menuform/index.jsx rename to src/templates/tableshare/menuform/index.jsx index f1b576b..3fabaf0 100644 --- a/src/templates/subtableconfig/menuform/index.jsx +++ b/src/templates/tableshare/menuform/index.jsx @@ -11,7 +11,6 @@ getFields() { const { getFieldDecorator } = this.props.form - const fields = [] this.props.formlist.forEach((item, index) => { if (item.type === 'text') { // 鏂囨湰鎼滅储 diff --git a/src/templates/comtableconfig/menuform/index.scss b/src/templates/tableshare/menuform/index.scss similarity index 100% rename from src/templates/comtableconfig/menuform/index.scss rename to src/templates/tableshare/menuform/index.scss diff --git a/src/templates/comtableconfig/searchform/index.jsx b/src/templates/tableshare/searchform/index.jsx similarity index 100% rename from src/templates/comtableconfig/searchform/index.jsx rename to src/templates/tableshare/searchform/index.jsx diff --git a/src/templates/comtableconfig/searchform/index.scss b/src/templates/tableshare/searchform/index.scss similarity index 100% rename from src/templates/comtableconfig/searchform/index.scss rename to src/templates/tableshare/searchform/index.scss diff --git a/src/templates/comtableconfig/transferform/index.jsx b/src/templates/tableshare/transferform/index.jsx similarity index 100% rename from src/templates/comtableconfig/transferform/index.jsx rename to src/templates/tableshare/transferform/index.jsx diff --git a/src/templates/comtableconfig/transferform/index.scss b/src/templates/tableshare/transferform/index.scss similarity index 100% rename from src/templates/comtableconfig/transferform/index.scss rename to src/templates/tableshare/transferform/index.scss -- Gitblit v1.8.0