From 12c4dd8bb0bb4c523dcf2fbb81191a7f3556a430 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 15 一月 2020 12:50:22 +0800 Subject: [PATCH] 2020-01-15 --- src/components/header/index.scss | 2 src/templates/comtableconfig/actionform/index.jsx | 6 src/assets/css/viewstyle.scss | 4 src/templates/formtabconfig/settingform/index.jsx | 125 +-- src/assets/css/action.scss | 4 src/templates/tableshare/dragelement/index.jsx | 8 src/templates/formtabconfig/index.jsx | 1 src/templates/comtableconfig/index.jsx | 1268 +++++++++-------------------------- src/tabviews/tableshare/actionList/index.jsx | 9 src/templates/comtableconfig/tabdragelement/index.jsx | 15 src/templates/tableshare/searchform/index.jsx | 7 src/locales/zh-CN/comtable.js | 9 src/templates/tableshare/formconfig.js | 669 ++++++++++++++++++ 13 files changed, 1,074 insertions(+), 1,053 deletions(-) diff --git a/src/assets/css/action.scss b/src/assets/css/action.scss index 51ae314..35586dd 100644 --- a/src/assets/css/action.scss +++ b/src/assets/css/action.scss @@ -31,8 +31,8 @@ } .mk-default:hover, .mk-dashed:hover { - color: #096dd9; - border-color: #096dd9; + color: #1890ff; + border-color: #1890ff; } // 绾㈣壊 diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss index d4d9dab..02b146b 100644 --- a/src/assets/css/viewstyle.scss +++ b/src/assets/css/viewstyle.scss @@ -16,8 +16,8 @@ &:hover { span { - color: #06B4F7; - border-bottom: 4px solid #06B4F7; + color: #1890ff; + border-bottom: 4px solid #1890ff; } } &.active { diff --git a/src/components/header/index.scss b/src/components/header/index.scss index fdcee77..e5c0df8 100644 --- a/src/components/header/index.scss +++ b/src/components/header/index.scss @@ -69,7 +69,7 @@ &.active { color: #ffffff; span { - border-bottom: 4px solid #06b4f7; + border-bottom: 4px solid #1890ff; } } } diff --git a/src/locales/zh-CN/comtable.js b/src/locales/zh-CN/comtable.js index 4d89eb6..017eb3a 100644 --- a/src/locales/zh-CN/comtable.js +++ b/src/locales/zh-CN/comtable.js @@ -172,6 +172,15 @@ 'header.form.request.method': '璇锋眰鏂瑰紡', 'header.form.readonly': '鏄惁鍙', 'header.form.field.required': '鏄惁蹇呭~', + 'header.modal.search.edit': '鎼滅储鏉′欢-缂栬緫', + 'header.modal.action.edit': '鎸夐挳-缂栬緫', + 'header.modal.action.copy': '鎸夐挳-澶嶅埗', + 'header.modal.column.edit': '鏄剧ず鍒�-缂栬緫', + 'header.modal.colspan.edit': '鍚堝苟鍒�-缂栬緫', + 'header.modal.gridbtn.edit': '鎿嶄綔鍒�-缂栬緫', + 'header.modal.tabs.edit': '鏍囩-缂栬緫', + 'header.modal.func.innerface': '鍐呴儴鎺ュ彛: 鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屽嚱鏁板悕绉伴渶浠ableField绛夊瓧绗﹀紑濮嬶紱鏈缃椂浼氳皟鐢ㄧ郴缁熷嚱鏁帮紝浣跨敤绯荤粺鍑芥暟闇�瀹屽杽鏁版嵁婧愬強鎿嶄綔绫诲瀷;', + 'header.modal.func.outface': '澶栭儴鎺ュ彛: 鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屾彁浜ゆ暟鎹粡杩囧唴閮ㄥ嚱鏁板鐞嗗悗锛屼紶鍏ュ閮ㄦ帴鍙o紝鏈缃椂锛屾暟鎹細鐩存帴浼犲叆澶栭儴鎺ュ彛銆�', 'form.required.input': '璇疯緭鍏�', 'form.required.select': '璇烽�夋嫨' } \ No newline at end of file diff --git a/src/tabviews/tableshare/actionList/index.jsx b/src/tabviews/tableshare/actionList/index.jsx index baf03ed..ecab41d 100644 --- a/src/tabviews/tableshare/actionList/index.jsx +++ b/src/tabviews/tableshare/actionList/index.jsx @@ -109,7 +109,14 @@ duration: 10 }) } else if (item.OpenType === 'outerpage') { - console.log(item) + let url = item.url + if (item.Ot === 'requiredSgl' && setting.primaryKey) { + url = url + '?ID=' + data[0][setting.primaryKey] + } else if (item.Ot !== 'notRequired' && !setting.primaryKey) { + let ids = data.map(_data => _data[setting.primaryKey]).join(',') + url = url + '?ID=' + ids + } + window.open(url) } else { notification.warning({ top: 92, diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index 529d81a..d20dd80 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/src/templates/comtableconfig/actionform/index.jsx @@ -488,7 +488,6 @@ 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 values.verify = this.props.card.verify || null @@ -512,10 +511,7 @@ duration: 10 }) } else { - resolve({ - type: 'action', - values - }) + resolve(values) } } else { reject(err) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index ba0c819..feacc6b 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -1,16 +1,22 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import {connect} from 'react-redux' +import { connect } from 'react-redux' import { is, fromJS } from 'immutable' import { DndProvider } from 'react-dnd' 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 Api from '@/api' +import Utils from '@/utils/utils.js' +import zhCN from '@/locales/zh-CN/comtable.js' +import enUS from '@/locales/en-US/comtable.js' +import { getSearchForm, getActionForm, getColumnForm } from '@/templates/tableshare/formconfig' + import ActionForm from './actionform' import SettingForm from './settingform' 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' @@ -20,9 +26,6 @@ import VerifyCard from '@/templates/tableshare/verifycard' 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' import Source from './source' import './index.scss' @@ -52,12 +55,8 @@ fields: null, // 鎼滅储鏉′欢鍙婃樉绀哄垪锛屽彲閫夊瓧娈� menuformlist: null, // 鍩烘湰淇℃伅琛ㄥ崟瀛楁 formlist: null, // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪琛ㄥ崟瀛楁 - formtemp: '', // 琛ㄥ崟绫诲瀷锛屾樉绀哄垪銆佹寜閽�佹悳绱㈡潯浠� + modaltype: '', // 妯℃�佹绫诲瀷锛屾帶鍒舵ā鎬佹鏄剧ず card: null, // 缂栬緫鍏冪礌 - searchloading: false, // 鎼滅储鏉′欢鍔犺浇涓� - actionloading: false, // 鎸夐挳鍔犺浇涓� - columnsloading: false, // 鏄剧ず鍒楀姞杞戒腑 - tabloading: false, // 鏍囩椤靛姞杞戒腑 menuloading: false, // 鑿滃崟淇濆瓨涓� menucloseloading: false, // 鑿滃崟鍏抽棴鏃讹紝閫夋嫨淇濆瓨 loading: false, // 鍔犺浇涓紝椤甸潰spin @@ -68,6 +67,7 @@ originMenu: null, // 鍘熷鑿滃崟 originActions: null, // 鍘熷鎸夐挳淇℃伅锛屼娇鐢ㄥ凡鏈夌敤鎴锋ā鏉� delActions: [], // 鍒犻櫎鎸夐挳鍒楄〃 + copyActions: [], // 鍒犻櫎鎸夐挳鍒楄〃 funcLoading: false, // 瀛樺偍杩囩▼鍒涘缓涓� showColumnName: false, // 鏄剧ず鍒楀瓧娈靛悕鎺у埗 tabviews: [], // 鎵�鏈夋爣绛鹃〉 @@ -294,732 +294,75 @@ } } + /** + * @description 鍏冪礌娣诲姞鎴栨嫋鍔ㄦ椂椤哄簭鍙樺寲 + */ handleList = (type, list, card) => { const { config } = this.state if (type === 'tabs') { // 鏍囩椤佃皟鏁撮『搴忔垨娣诲姞鍏冪礌 if (list.length > config[card.groupId].length) { list = list.filter(item => !item.origin) - - this.setState({ - tabloading: true, - config: {...config, [card.groupId]: list } - }, () => { - // 鍒锋柊瀵瑰簲鐨勯厤缃俊鎭� - this.setState({ - tabloading: false - }) - this.handleTab(card) - }) - } else { - this.setState({config: {...config, [card.groupId]: list}}) + this.handleTab(card) } + + this.setState({config: {...config, [card.groupId]: list}}) } else { if (list.length > config[type].length) { list = list.filter(item => !item.origin) - - this.setState({ - [type + 'loading']: true, - config: {...config, [type]: list } - }, () => { - // 鍒锋柊瀵瑰簲鐨勯厤缃俊鎭� - this.setState({ - [type + 'loading']: false - }) - - if (type === 'search') { - this.handleSearch(card) - } else if (type === 'action') { - this.handleAction(card) - } else if (type === 'columns') { - this.handleColumn(card) - } else if (type === 'tabs') { - this.handleTab(card) - } - }) - } else { - this.setState({config: {...config, [type]: list}}) + if (type === 'search') { + this.handleSearch(card) + } else if (type === 'action') { + this.handleAction(card) + } else if (type === 'columns') { + this.handleColumn(card) + } } + + this.setState({ + config: {...config, [type]: list } + }) } } + /** + * @description 鎼滅储鏉′欢缂栬緫锛岃幏鍙栨悳绱㈡潯浠惰〃鍗曚俊鎭� + */ handleSearch = (card) => { this.setState({ - visible: true, - formtemp: 'search', - modalTitle: '缂栬緫-鎼滅储鏉′欢', + modaltype: 'search', card: card, - formlist: [ - { - type: 'text', - key: 'label', - label: this.state.dict['header.form.name'], - initVal: card.label || '', - required: true, - readonly: false - }, - { - type: 'text', - key: 'field', - label: this.state.dict['header.form.field'], - initVal: card.field || '', - tooltip: '瀛楁鍚嶅彲浠ヤ娇鐢ㄩ�楀彿鍒嗛殧锛岃繘琛屽瀛楁缁煎悎鎼滅储锛屾敞锛氱患鍚堟悳绱粎鍦ㄦ枃鏈被鍨嬫椂鏈夋晥', - tooltipClass: 'middle', - required: true, - readonly: false - }, - { - type: 'select', - key: 'type', - label: this.state.dict['header.form.type'], - initVal: card.type, - required: true, - options: [{ - value: 'text', - text: this.state.dict['header.form.text'] - }, { - value: 'select', - text: this.state.dict['header.form.select'] - }, { - value: 'multiselect', - text: this.state.dict['header.form.multiselect'] - }, { - value: 'link', - text: this.state.dict['header.form.link'] - }, { - value: 'date', - text: this.state.dict['header.form.dateday'] - }, { - value: 'dateweek', - text: this.state.dict['header.form.dateweek'] - }, { - value: 'datemonth', - text: this.state.dict['header.form.datemonth'] - }, { - value: 'daterange', - text: this.state.dict['header.form.daterange'] - }] - }, - { - type: 'text', - key: 'initval', - label: this.state.dict['header.form.initval'], - initVal: card.initval, - required: false - }, - { - type: 'radio', - key: 'resourceType', - label: this.state.dict['header.form.resourceType'], - initVal: card.resourceType || '0', - required: true, - options: [{ - value: '0', - text: this.state.dict['header.form.custom'] - }, { - value: '1', - text: this.state.dict['header.form.datasource'] - }] - }, - { - type: 'radio', - key: 'setAll', - label: this.state.dict['header.form.setAll'], - initVal: card.setAll || 'false', - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'textarea', - key: 'dataSource', - label: this.state.dict['header.form.datasource'], - initVal: card.dataSource || '', - required: true, - readonly: false - }, - { - type: 'options', - key: 'options', - label: '', - initVal: card.options || [], - required: true, - readonly: false - }, - { - type: 'text', - key: 'linkField', - label: this.state.dict['header.form.linkField'], - initVal: card.linkField || '', - required: true, - readonly: false - }, - { - type: 'text', - key: 'valueField', - label: this.state.dict['header.form.valueField'], - initVal: card.valueField || '', - required: true, - readonly: false - }, - { - type: 'text', - key: 'valueText', - label: this.state.dict['header.form.valueText'], - initVal: card.valueText || '', - required: true, - readonly: false - }, - { - type: 'text', - key: 'orderBy', - label: this.state.dict['header.form.orderBy'], - initVal: card.orderBy || '', - required: false, - readonly: false - }, - { - type: 'select', - key: 'orderType', - label: this.state.dict['header.form.orderType'], - initVal: card.orderType || 'asc', - options: [{ - value: 'asc', - text: this.state.dict['header.form.asc'] - }, { - value: 'desc', - text: this.state.dict['header.form.desc'] - }] - }, - { - type: 'select', - key: 'match', - label: this.state.dict['header.form.match'], - initVal: card.match || 'like', - required: true, - options: [{ - value: 'like', - text: 'like' - }, { - value: 'equal', - text: 'equal' - }, { - value: 'greater', - text: '>' - }, { - value: 'less', - text: '<' - }, { - value: 'greaterequal', - text: '>=' - }] - }, - { - type: 'select', - key: 'display', - label: this.state.dict['header.form.display'], - initVal: card.display || 'dropdown', - required: true, - options: [{ - value: 'dropdown', - text: this.state.dict['header.form.dropdown'] - }, { - value: 'button', - text: this.state.dict['header.form.button'] - }] - } - ] + formlist: getSearchForm(card) }) } + /** + * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭� + */ handleAction = (card, type) => { let ableField = this.props.permFuncField.join(', ') + let functip = <div> + <p style={{marginBottom: '5px'}}>{this.state.dict['header.modal.func.innerface'].replace('@ableField', ableField)}</p> + <p>{this.state.dict['header.modal.func.outface']}</p> + </div> + this.setState({ - visible: true, - formtemp: 'action', - modalTitle: type === 'copy' ? '澶嶅埗-鎸夐挳' : '缂栬緫-鎸夐挳', + modaltype: type === 'copy' ? 'actionCopy' : 'actionEdit', card: card, - formlist: [ - { - type: 'text', - key: 'label', - label: this.state.dict['header.form.name'], - initVal: card.label, - required: true, - readonly: false - }, - { - type: 'select', - key: 'OpenType', - label: this.state.dict['header.form.openType'], - initVal: card.OpenType, - required: true, - options: [{ - value: 'pop', - text: this.state.dict['header.form.popform'] - }, { - value: 'prompt', - text: this.state.dict['header.form.prompt'] - }, { - value: 'exec', - text: this.state.dict['header.form.exec'] - }, { - value: 'excelIn', - text: this.state.dict['header.form.excelIn'] - }, { - value: 'excelOut', - text: this.state.dict['header.form.excelOut'] - }, { - value: 'popview', - text: this.state.dict['header.form.popview'] - }, { - value: 'tab', - text: this.state.dict['header.form.tab'] - }, { - value: 'blank', - text: this.state.dict['header.form.blank'] - }, { - value: 'innerpage', - text: this.state.dict['header.form.newpage.inner'] - }, { - value: 'outerpage', - text: this.state.dict['header.form.newpage.outer'] - }] - }, { - type: 'select', - key: 'tabType', - label: this.state.dict['header.form.tabType'], - initVal: card.tabType || 'SubTable', - required: true, - options: [{ - value: 'SubTable', - text: this.state.dict['header.menu.tab.subtable'] - }] - }, - { - type: 'select', - key: 'linkTab', - label: '鍏宠仈鏍囩', - initVal: card.linkTab || '', - required: false, - options: [] - }, - { - type: 'select', - key: 'pageTemplate', - label: this.state.dict['header.form.pageTemplate'], - initVal: card.pageTemplate || '', - required: true, - options: [] - }, - { - type: 'text', - key: 'url', - label: this.state.dict['header.form.newpage.url'], - initVal: card.url || '', - required: true - }, - { - type: 'radio', - key: 'intertype', - label: this.state.dict['header.form.intertype'], - initVal: card.intertype || 'inner', - required: true, - options: [{ - value: 'inner', - text: this.state.dict['header.form.interface.inner'] - }, { - value: 'outer', - text: this.state.dict['header.form.interface.outer'] - }] - }, - { - type: 'text', - key: 'innerFunc', - label: this.state.dict['header.form.innerFunc'], - initVal: card.innerFunc || '', - tooltip: <div> - <p>鍐呴儴鎺ュ彛: 鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屽嚱鏁板悕绉伴渶浠ableField}绛夊瓧绗﹀紑濮嬶紱鏈缃椂浼氳皟鐢ㄧ郴缁熷嚱鏁帮紝浣跨敤绯荤粺鍑芥暟闇�瀹屽杽鏁版嵁婧愬強鎿嶄綔绫诲瀷;</p> - <p>澶栭儴鎺ュ彛: 鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屾彁浜ゆ暟鎹粡杩囧唴閮ㄥ嚱鏁板鐞嗗悗锛屼紶鍏ュ閮ㄦ帴鍙o紝鏈缃椂锛屾暟鎹細鐩存帴浼犲叆澶栭儴鎺ュ彛銆�</p> - </div>, - fields: this.props.permFuncField, - tooltipClass: 'middle', - required: false, - readonly: false - }, - { - type: 'radio', - key: 'sysInterface', - label: this.state.dict['header.form.sysInterface'], - initVal: card.sysInterface || 'false', - required: true, - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'text', - key: 'outerFunc', - label: this.state.dict['header.form.outerFunc'], - initVal: card.outerFunc || '', - required: false, - readonly: false - }, - { - type: 'text', - key: 'interface', - label: this.state.dict['header.form.interface'], - initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : (card.interface || ''), - required: true, - readonly: card.sysInterface === 'true' - }, - { - type: 'text', - key: 'callbackFunc', - label: this.state.dict['header.form.callbackFunc'], - initVal: card.callbackFunc || '', - required: false, - readonly: false - }, - { - type: 'select', - key: 'position', - label: this.state.dict['header.form.position'], - initVal: card.position || 'toolbar', - required: true, - options: [{ - value: 'toolbar', - text: this.state.dict['header.form.toolbar'] - }, { - value: 'grid', - text: this.state.dict['header.form.grid'] - }] - }, - { - type: 'select', - key: 'Ot', - label: this.state.dict['header.form.isRequired'], - initVal: card.Ot || 'requiredSgl', - required: true, - options: [] - }, - { - type: 'select', - key: 'tabTemplate', - label: '鏍囩妯℃澘', - initVal: card.tabTemplate || 'formTab', - required: true, - options: [{ - value: 'formTab', - text: '甯︽爣绛捐〃鍗�' - }] - }, - { - type: 'select', - key: 'execSuccess', - label: this.state.dict['header.form.execSuccess'], - initVal: card.execSuccess || 'never', - required: true, - options: [{ - value: 'never', - text: this.state.dict['header.form.refresh.never'] - }, { - value: 'grid', - text: this.state.dict['header.form.refresh.grid'] - }, { - value: 'view', - text: this.state.dict['header.form.refresh.view'] - }] - }, - { - type: 'select', - key: 'execError', - label: this.state.dict['header.form.execError'], - initVal: card.execError || 'never', - required: true, - options: [{ - value: 'never', - text: this.state.dict['header.form.refresh.never'] - }, { - value: 'grid', - text: this.state.dict['header.form.refresh.grid'] - }, { - value: 'view', - text: this.state.dict['header.form.refresh.view'] - }] - }, - { - type: 'select', - key: 'popClose', - label: this.state.dict['header.form.popClose'], - initVal: card.popClose || 'never', - required: true, - options: [{ - value: 'never', - text: this.state.dict['header.form.refresh.never'] - }, { - value: 'grid', - text: this.state.dict['header.form.refresh.grid'] - }, { - value: 'view', - text: this.state.dict['header.form.refresh.view'] - }] - }, - { - type: 'select', - key: 'icon', - label: this.state.dict['header.form.icon'], - initVal: card.icon, - required: false, - options: [] - }, - { - type: 'select', - key: 'class', - label: this.state.dict['header.form.class'], - initVal: card.class, - required: false, - options: [] - }, - { - type: 'text', - key: 'sql', - label: this.state.dict['header.form.datasource'], - initVal: card.sql || this.state.config.setting.tableName || '', - tooltip: this.state.dict['header.form.actionhelp.datasource'], - required: false - }, - { - type: 'select', - key: 'sqlType', - label: this.state.dict['header.form.action.type'], - initVal: card.sqlType || '', - tooltip: this.state.dict['header.form.actionhelp.sqlType'], - required: false, - options: [] - } - ] + formlist: getActionForm(card, functip, this.state.config, this.props.permFuncField) }) } handleColumn = (card) => { if (card.type !== 'colspan') { this.setState({ - visible: true, - formtemp: 'columns', - modalTitle: '缂栬緫-鏄剧ず鍒�', + modaltype: 'columns', card: card, - formlist: [ - { - type: 'text', - key: 'label', - label: this.state.dict['header.form.name'], - initVal: card.label, - required: true - }, - { - type: 'text', - key: 'field', - label: this.state.dict['header.form.field'], - initVal: card.field, - required: true, - readonly: false - }, - { - type: 'select', - key: 'type', - label: this.state.dict['header.form.type'], - initVal: card.type, - required: true, - options: [{ - value: 'text', - text: this.state.dict['header.form.text'] - }, { - value: 'number', - text: this.state.dict['header.form.number'] - }, { - value: 'picture', - text: this.state.dict['header.form.picture'] - }, { - value: 'textarea', - text: this.state.dict['header.form.textarea'] - }] - }, - { - type: 'select', - key: 'Align', - label: this.state.dict['header.form.align'], - initVal: card.Align, - required: true, - options: [{ - value: 'left', - text: this.state.dict['header.form.alignLeft'] - }, { - value: 'right', - text: this.state.dict['header.form.alignRight'] - }, { - value: 'center', - text: this.state.dict['header.form.alignCenter'] - }] - }, - { - type: 'radio', - key: 'Hide', - label: this.state.dict['header.form.Hide'], - initVal: card.Hide, - required: true, - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'radio', - key: 'IsSort', - label: this.state.dict['header.form.IsSort'], - initVal: card.IsSort, - required: true, - options: [{ - value: 'true', - text: this.state.dict['header.form.true'] - }, { - value: 'false', - text: this.state.dict['header.form.false'] - }] - }, - { - type: 'number', - key: 'Width', - min: 1, - max: 1000, - decimal: 0, - label: this.state.dict['header.form.columnWidth'], - initVal: card.Width, - required: true - }, - { - type: 'number', - key: 'decimal', - min: 0, - max: 18, - decimal: 0, - label: this.state.dict['header.form.decimal'], - initVal: card.decimal, - required: false - }, - { - type: 'select', - key: 'format', - label: this.state.dict['header.form.format'], - initVal: card.format || '', - options: [{ - value: '', - text: this.state.dict['header.form.empty'] - }, { - value: 'thdSeparator', - text: this.state.dict['header.form.thdSeparator'] - }], - required: false - }, - { - type: 'text', - key: 'prefix', - label: this.state.dict['header.form.prefix'], - initVal: card.prefix || '', - required: false, - readonly: false - }, - { - type: 'text', - key: 'postfix', - label: this.state.dict['header.form.postfix'], - initVal: card.postfix || '', - // tooltip: '鍚庣紑鍊艰缃负"\\n",琛ㄧず鎹㈣', - tooltipClass: 'middle', - required: false, - readonly: false - }, - { - type: 'select', - key: 'match', - label: this.state.dict['header.form.match'], - initVal: card.match || '', - options: [{ - value: '', - text: this.state.dict['header.form.empty'] - }, { - value: '>', - text: '>' - }, { - value: '<', - text: '<' - }, { - value: '>=', - text: '>=' - }, { - value: '<=', - text: '<=' - }], - required: false - }, - { - type: 'text', - key: 'matchVal', - min: -Infinity, - max: Infinity, - decimal: 0, - label: this.state.dict['header.form.matchVal'], - initVal: card.matchVal || '', - required: false, - readonly: false - }, - { - type: 'select', - key: 'color', - label: this.state.dict['header.form.color'], - initVal: card.color || '', - options: [{ - value: '', - text: this.state.dict['header.form.empty'] - }, { - value: 'red', - text: '绾㈣壊锛堝唴瀹癸級' - }, { - value: 'redbg', - text: '绾㈣壊锛堣儗鏅級' - }, { - value: 'orange', - text: '姗欒壊锛堝唴瀹癸級' - }, { - value: 'orangebg', - text: '姗欒壊锛堣儗鏅級' - }, { - value: 'green', - text: '缁胯壊锛堝唴瀹癸級' - }, { - value: 'greenbg', - text: '缁胯壊锛堣儗鏅級' - }], - required: false - } - ] + formlist: getColumnForm(card) }) } else { this.setState({ - visible: true, - formtemp: 'columns', - modalTitle: '缂栬緫-鍚堝苟鍒�', + modaltype: 'colspan', card: card }) } @@ -1067,9 +410,7 @@ } this.setState({ - visible: true, - formtemp: 'tabs', - modalTitle: '缂栬緫-鏍囩椤�', + modaltype: 'tabs', card: card, formlist: [ { @@ -1135,28 +476,53 @@ handleGridBtn = () => { this.setState({ - visible: true, - formtemp: 'gridbtn', - modalTitle: '缂栬緫-鎿嶄綔鍒�', + modaltype: 'gridbtn' }) } /** * @description 鎼滅储銆佹寜閽�佹樉绀哄垪淇敼鍚庢彁浜や繚瀛� - * 1銆佹悳绱㈡潯浠朵繚瀛橈紝褰撶被鍨嬩负涓嬫媺妗嗕笖瀛樺湪鏁版嵁婧愭椂锛屽皢鏌ヨ鏉′欢鎷兼帴涓簊ql锛屽苟鐢╞ase64杞爜 - * 2銆佹寜閽寘鎷甯哥紪杈戝拰澶嶅埗锛屽鍒舵椂,鎸夐挳鍒楁湯灏炬坊鍔� + * 1銆佹悳绱㈡潯浠朵繚瀛� + * 2銆佹寜閽寘鎷甯哥紪杈戝拰澶嶅埗锛屽鍒舵椂,鏈熬娣诲姞,濡傛寜閽负琛ㄥ崟锛堜繚瀛樿嚦鏁版嵁搴擄級锛屽鍒舵寜閽甶d瀛樹簬澶嶅埗鍒楄〃锛堢偣鍑讳笉淇濆瓨鏃跺垹闄わ級 * 3銆佹坊鍔犳垨缂栬緫鍒楋紝淇濆瓨鏃讹紝濡傛寜閽綅缃缃负琛ㄦ牸锛屽垯淇敼鎿嶄綔鍒楁樉绀虹姸鎬� */ handleSubmit = () => { const { menu } = this.props - const { card } = this.state - let _config = JSON.parse(JSON.stringify(this.state.config)) + const { config, card, modaltype } = this.state - if (this.state.formtemp !== 'gridbtn') { - this.formRef.handleConfirm().then(res => { - let isupdate = false + if (modaltype === 'search') { + this.searchFormRef.handleConfirm().then(res => { + let _search = config.search.map(item => { + if (item.uuid === res.uuid) { + return res + } else { + return item + } + }) + _search = _search.filter(item => !item.origin) - if (res.type === 'action' && card.originCard && res.values.OpenType === 'pop') { + this.setState({ + config: {...config, search: _search}, + modaltype: '' + }) + }) + } else if (modaltype === 'actionEdit' || modaltype === 'actionCopy') { + this.actionFormRef.handleConfirm().then(res => { + let _action = config.action.map(item => { + if (item.uuid === res.uuid) { + return res + } else { + return item + } + }) + _action = _action.filter(item => !item.origin) + + if (modaltype === 'actionCopy') { + _action.push(res) + } + + // 澶嶅埗鎸夐挳鍓嶅悗鐨嗕负琛ㄥ崟鏃讹紝澶嶅埗琛ㄥ崟閰嶇疆淇℃伅锛宨d瀛樹簬澶嶅埗鍒楄〃 + if (res.OpenType === 'pop' && card.originCard && card.originCard.OpenType === 'pop') { Api.getSystemConfig({ func: 'sPC_Get_LongParam', MenuID: card.originCard.uuid @@ -1165,10 +531,10 @@ let param = { func: 'sPC_ButtonParam_AddUpt', ParentID: menu.MenuID, - MenuID: res.values.uuid, + MenuID: res.uuid, MenuNo: menu.MenuNo, Template: 'Modal', - MenuName: res.values.label, + MenuName: res.label, PageParam: JSON.stringify({Template: 'Modal'}), LongParam: result.LongParam } @@ -1179,105 +545,129 @@ message: response.message, duration: 10 }) + } else { + this.setState({ + copyActions: [...this.state.copyActions, res.uuid] + }) } }) } }) } - - if (res.type !== 'tabs') { - _config[res.type] = _config[res.type].map(item => { - if (item.uuid === res.values.uuid) { - isupdate = true - return res.values - } else { - return item - } - }) - _config[res.type] = _config[res.type].filter(item => !item.origin) - - if (!isupdate) { // 鎿嶄綔涓嶆槸淇敼锛屾坊鍔犲厓绱犺嚦鍒楄〃 - _config[res.type].push(res.values) - } - } else { // 鏍囩椤电殑娣诲姞涓庝慨鏀� - _config[res.values.groupId] = _config[res.values.groupId].map(item => { - if (item.uuid === res.values.uuid) { - isupdate = true - return res.values - } else { - return item - } - }) - _config[res.values.groupId] = _config[res.values.groupId].filter(item => !item.origin) - - if (!isupdate) { // 鎿嶄綔涓嶆槸淇敼锛屾坊鍔犲厓绱犺嚦鍒楄〃 - _config[res.values.groupId].push(res.values) - } - } - - - if (res.type === 'action') { - let gridbtn = _config.action.filter(act => act.position === 'grid') - let _display = false - - if (gridbtn.length > 0) { - _display = true - } - - if (_config.gridBtn) { - _config.gridBtn.display = _display - } else { - _config.gridBtn = { - display: _display, - Align: 'center', - IsSort: 'false', - uuid: Utils.getuuid(), - label: this.state.dict['header.form.column.action'], - type: 'action', - style: 'button', - show: 'horizontal', - Width: 120 - } + + // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒� + let _hasGridbtn = _action.filter(act => act.position === 'grid').length > 0 + let _gridBtn = {...config.gridBtn} + + if (_gridBtn) { + _gridBtn.display = _hasGridbtn + } else { + _gridBtn = { + display: _hasGridbtn, + Align: 'center', + IsSort: 'false', + uuid: Utils.getuuid(), + label: this.state.dict['header.form.column.action'], + type: 'action', + style: 'button', + show: 'horizontal', + Width: 120 } } this.setState({ - config: _config, - searchloading: true, - actionloading: true, - columnsloading: true, - tabloading: true, - visible: false - }, () => { - this.setState({ - searchloading: false, - actionloading: false, - columnsloading: false, - tabloading: false - }) + config: {...config, action: _action, gridBtn: _gridBtn}, + modaltype: '' }) }) - } else { - this.formRef.handleConfirm().then(res => { - _config.gridBtn = res + } else if (modaltype === 'columns' || modaltype === 'colspan') { + this.columnFormRef.handleConfirm().then(res => { + let _columns = config.columns.map(item => { + if (item.uuid === res.uuid) { + return res + } else { + return item + } + }) + _columns = _columns.filter(item => !item.origin) this.setState({ - config: _config, - visible: false + config: {...config, columns: _columns}, + modaltype: '' + }) + }) + } else if (modaltype === 'gridbtn') { + this.gridBtnFormRef.handleConfirm().then(res => { + this.setState({ + config: {...config, gridBtn: res}, + modaltype: '' + }) + }) + } else if (modaltype === 'tabs') { + this.tabsFormRef.handleConfirm().then(res => { + let isupdate = false + let _tabgroup = config[res.values.groupId].map(item => { + if (item.uuid === res.values.uuid) { + isupdate = true + return res.values + } else { + return item + } + }) + _tabgroup = _tabgroup.filter(item => !item.origin) + + if (!isupdate) { // 鎿嶄綔涓嶆槸淇敼锛屾坊鍔犲厓绱犺嚦鍒楄〃 + _tabgroup.push(res.values) + } + + this.setState({ + config: {...config, [res.values.groupId]: _tabgroup}, + modaltype: '' }) }) } } + editModalCancel = () => { + const { config, card, modaltype } = this.state + + if (card.focus) { + let _config = null + if (modaltype === 'search') { + let _search = config.search.filter(item => item.uuid !== card.uuid) + _config = {...config, search: _search} + } else if (modaltype === 'actionEdit') { + let _action = config.action.filter(item => item.uuid !== card.uuid) + _config = {...config, action: _action} + } else if (modaltype === 'columns' || modaltype === 'colspan') { + let _columns = config.columns.filter(item => item.uuid !== card.uuid) + _config = {...config, columns: _columns} + } else { + _config = config + } + + this.setState({ + card: null, + config: _config, + modaltype: '' + }) + } else { + this.setState({ + card: null, + modaltype: '' + }) + } + } + /** - * @description 鍒涘缓鎸夐挳瀛樺偍杩囩▼ + * @description 鎸夐挳-鍒涘缓瀛樺偍杩囩▼ */ creatFunc = () => { const { menu } = this.props let _config = JSON.parse(JSON.stringify(this.state.config)) - this.formRef.handleConfirm().then(res => { - let btn = res.values // 鎸夐挳淇℃伅 + this.actionFormRef.handleConfirm().then(res => { + let btn = res // 鎸夐挳淇℃伅 let newLText = '' // 鍒涘缓瀛樺偍杩囩▼sql let DelText = '' // 鍒犻櫎瀛樺偍杩囩▼sql let isExit = false // 瀛樺偍杩囩▼鏄惁瀛樺湪 @@ -1359,6 +749,7 @@ }).then(res => { // 鑾峰彇浜戠鍙婃湰鍦帮紝鏄惁宸插瓨鍦ㄨ瀛樺偍杩囩▼鐨勪俊鎭� if (res === false) return res + if (res !== false) return false let sysDefer = new Promise(resolve => { Api.getSystemConfig({ @@ -1568,12 +959,7 @@ this.setState({ config: _config, - actionloading: true, funcLoading: false - }, () => { - this.setState({ - actionloading: false - }) }) }) }) @@ -1827,20 +1213,9 @@ }) } - let refreshtype = element.type + 'loading' - - if (/^tab/.test(refreshtype)) { - refreshtype = 'tabloading' - } - _this.setState({ config: _config, - delActions: [..._this.state.delActions, element.card.uuid], - [refreshtype]: true - }, () => { - _this.setState({ - [refreshtype]: false - }) + delActions: [..._this.state.delActions, element.card.uuid] }) }, onCancel() {} @@ -1877,11 +1252,6 @@ profileVisible: false, config: config, card: '', - actionloading: true - }, () => { - this.setState({ - actionloading: false - }) }) } @@ -2008,16 +1378,7 @@ MenuName: res.menuName, MenuNo: res.menuNo, ParentID: res.parentId - }, - searchloading: true, - actionloading: true, - columnsloading: true - }, () => { - this.setState({ - searchloading: false, - actionloading: false, - columnsloading: false - }) + } }) this.props.reloadmenu() @@ -2111,6 +1472,9 @@ if (response === false || response === 'copy') return response if (response.status) { + this.setState({ + copyActions: [] + }) return 'copy' } else { notification.warning({ @@ -2545,13 +1909,6 @@ this.setState({ config: {...config, setting: res}, settingVisible: false, - columnsloading: true, - tabloading: true - }, () => { - this.setState({ - columnsloading: false, - tabloading: false - }) }) }) } @@ -2721,12 +2078,7 @@ _config[newgroup] = [] _this.setState({ - config: _config, - tabloading: true - }, () => { - _this.setState({ - tabloading: false - }) + config: _config }) }, onCancel() {} @@ -2747,19 +2099,26 @@ delete _config[groupId] _this.setState({ - config: _config, - tabloading: true - }, () => { - _this.setState({ - tabloading: false - }) + config: _config }) }, onCancel() {} }) } + notsave = () => { + this.state.copyActions.forEach(item => { + let _param = { + func: 'sPC_MainMenu_Del', + MenuID: item + } + Api.getSystemConfig(_param) + }) + this.props.handleConfig('') + } + render () { + const { modaltype } = this.state const configAction = this.state.config.action.filter(_action => !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab') ) @@ -2911,33 +2270,29 @@ <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃悳绱€�嬩腑锛岄�夋嫨瀵瑰簲鎼滅储妗嗘嫋鑷虫澶勬坊鍔狅紱鎴栫偣鍑绘寜閽�婃坊鍔犳悳绱㈡潯浠躲�嬫壒閲忔坊鍔狅紝閫夋嫨鎵归噺娣诲姞鏃讹紝闇�鎻愬墠閫夋嫨浣跨敤琛ㄣ��"> <Icon type="question-circle" /> </Tooltip> - {!this.state.searchloading ? - <DragElement - type="search" - list={this.state.config.search} - handleList={this.handleList} - handleMenu={this.handleSearch} - deleteMenu={this.deleteElement} - placeholder={this.state.dict['header.form.search.placeholder']} - /> : null - } + <DragElement + type="search" + list={this.state.config.search} + handleList={this.handleList} + handleMenu={this.handleSearch} + deleteMenu={this.deleteElement} + placeholder={this.state.dict['header.form.search.placeholder']} + /> </div> <div className="action-list"> <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃寜閽�嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬寜閽嫋鑷虫澶勬坊鍔狅紝濡傞�夋嫨鎸夐挳绫诲瀷涓鸿〃鍗曘�佹柊鏍囩椤电瓑鍚湁閰嶇疆椤甸潰鐨勬寜閽紝鍙湪宸︿晶宸ュ叿鏍�-鎸夐挳-鍙厤缃寜閽锛岀偣鍑绘寜閽畬鎴愮浉鍏抽厤缃�傛敞锛氬綋璁剧疆鎸夐挳鏄剧ず浣嶇疆涓鸿〃鏍兼椂锛屾樉绀哄垪浼氬鍔犳搷浣滃垪銆�"> <Icon type="question-circle" /> </Tooltip> - {!this.state.actionloading ? - <DragElement - type="action" - list={this.state.config.action} - handleList={this.handleList} - handleMenu={this.handleAction} - copyElement={(val) => this.handleAction(val, 'copy')} - deleteMenu={this.deleteElement} - profileMenu={this.profileAction} - placeholder={this.state.dict['header.form.action.placeholder']} - /> : null - } + <DragElement + type="action" + list={this.state.config.action} + handleList={this.handleList} + handleMenu={this.handleAction} + copyElement={(val) => this.handleAction(val, 'copy')} + deleteMenu={this.deleteElement} + profileMenu={this.profileAction} + placeholder={this.state.dict['header.form.action.placeholder']} + /> </div> {/* 鏄剧ず鍒� */} <div className="column-list"> @@ -2945,23 +2300,21 @@ <Icon type="question-circle" /> </Tooltip> <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showColumnName} onChange={this.onColumnNameChange} /> - {!this.state.columnsloading ? - <DragElement - type="columns" - list={this.state.config.columns} - setting={this.state.config.setting} - gridBtn={this.state.config.gridBtn} - handleList={this.handleList} - handleMenu={this.handleColumn} - deleteMenu={this.deleteElement} - handleGridBtn={this.handleGridBtn} - showfield={this.state.showColumnName} - placeholder={this.state.dict['header.form.column.placeholder']} - /> : null - } + <DragElement + type="columns" + list={this.state.config.columns} + setting={this.state.config.setting} + gridBtn={this.state.config.gridBtn} + handleList={this.handleList} + handleMenu={this.handleColumn} + deleteMenu={this.deleteElement} + handleGridBtn={this.handleGridBtn} + showfield={this.state.showColumnName} + placeholder={this.state.dict['header.form.column.placeholder']} + /> </div> {/* 鏍囩缁� */} - {!this.state.tabloading && this.state.config.tabgroups.map((groupId, index) => { + {this.state.config.tabgroups.map((groupId, index) => { return ( <div key={index} className="tab-list"> {index === 0 ? <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃爣绛鹃〉銆嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬爣绛鹃〉鎷栬嚦姝ゅ娣诲姞銆�"> @@ -2983,70 +2336,107 @@ </Card> </div> </DndProvider> - {/* 缂栬緫鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪 */} + {/* 缂栬緫鎼滅储鏉′欢 */} <Modal - title={this.state.modalTitle} - visible={this.state.visible} + title={this.state.dict['header.modal.search.edit']} + visible={modaltype === 'search'} width={700} - onCancel={() => { this.setState({ visible: false }) }} + onOk={this.handleSubmit} + onCancel={this.editModalCancel} + destroyOnClose + > + <SearchForm + dict={this.state.dict} + card={this.state.card} + formlist={this.state.formlist} + wrappedComponentRef={(inst) => this.searchFormRef = inst} + /> + </Modal> + {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} + <Modal + title={modaltype === 'actionEdit' ? this.state.dict['header.modal.action.edit'] : this.state.dict['header.modal.action.copy']} + visible={modaltype === 'actionEdit' || modaltype === 'actionCopy'} + width={700} + onCancel={this.editModalCancel} footer={[ - this.state.formtemp === 'action' ? - <Button key="delete" className="mk-btn mk-purple" onClick={this.creatFunc} loading={this.state.funcLoading}>{this.state.dict['header.menu.func.create']}</Button> : null, - <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{this.state.dict['header.cancel']}</Button>, + modaltype === 'actionEdit' ? <Button key="delete" className="mk-btn mk-purple" onClick={this.creatFunc} loading={this.state.funcLoading}>{this.state.dict['header.menu.func.create']}</Button> : null, + <Button key="cancel" onClick={this.editModalCancel}>{this.state.dict['header.cancel']}</Button>, <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['header.confirm']}</Button> ]} destroyOnClose > - {this.state.formtemp === 'search' ? - <SearchForm - dict={this.state.dict} - formlist={this.state.formlist} - card={this.state.card} - wrappedComponentRef={(inst) => this.formRef = inst} - /> : null - } - {this.state.formtemp === 'action' ? - <ActionForm - dict={this.state.dict} - card={this.state.card} - tabs={this.state.tabviews} - formlist={this.state.formlist} - wrappedComponentRef={(inst) => this.formRef = inst} - /> : null - } - {this.state.formtemp === 'columns' && this.state.card.type !== 'colspan' ? - <ColumnForm - dict={this.state.dict} - card={this.state.card} - formlist={this.state.formlist} - wrappedComponentRef={(inst) => this.formRef = inst} - /> : null - } - {this.state.formtemp === 'columns' && this.state.card.type === 'colspan' ? - <ColspanForm - dict={this.state.dict} - card={this.state.card} - columns={this.state.config.columns} - wrappedComponentRef={(inst) => this.formRef = inst} - /> : null - } - {this.state.formtemp === 'gridbtn' ? - <GridBtnForm - dict={this.state.dict} - card={this.state.config.gridBtn} - wrappedComponentRef={(inst) => this.formRef = inst} - /> : null - } - {this.state.formtemp === 'tabs' ? - <TabForm - type="tabs" - tabs={this.state.tabviews} - dict={this.state.dict} - card={this.state.card} - formlist={this.state.formlist} - wrappedComponentRef={(inst) => this.formRef = inst} - /> : null - } + <ActionForm + dict={this.state.dict} + card={this.state.card} + tabs={this.state.tabviews} + formlist={this.state.formlist} + wrappedComponentRef={(inst) => this.actionFormRef = inst} + /> + </Modal> + {/* 鏄剧ず鍒楃紪杈� */} + <Modal + title={this.state.dict['header.modal.column.edit']} + visible={modaltype === 'columns'} + width={700} + onOk={this.handleSubmit} + onCancel={this.editModalCancel} + destroyOnClose + > + <ColumnForm + dict={this.state.dict} + card={this.state.card} + formlist={this.state.formlist} + wrappedComponentRef={(inst) => this.columnFormRef = inst} + /> + </Modal> + {/* 鍚堝苟鍒楃紪杈� */} + <Modal + title={this.state.dict['header.modal.colspan.edit']} + visible={modaltype === 'colspan'} + width={700} + onOk={this.handleSubmit} + onCancel={this.editModalCancel} + destroyOnClose + > + <ColspanForm + dict={this.state.dict} + card={this.state.card} + columns={this.state.config.columns} + wrappedComponentRef={(inst) => this.columnFormRef = inst} + /> + </Modal> + {/* 鍚堝苟鍒楃紪杈� */} + <Modal + title={this.state.dict['header.modal.gridbtn.edit']} + visible={modaltype === 'gridbtn'} + width={700} + onOk={this.handleSubmit} + onCancel={this.editModalCancel} + destroyOnClose + > + <GridBtnForm + dict={this.state.dict} + card={this.state.config.gridBtn} + wrappedComponentRef={(inst) => this.gridBtnFormRef = inst} + /> + </Modal> + {/* 鏍囩缂栬緫 */} + <Modal + title={this.state.dict['header.modal.tabs.edit']} + visible={modaltype === 'tabs'} + width={700} + onOk={this.handleSubmit} + onCancel={this.editModalCancel} + destroyOnClose + > + <TabForm + type="tabs" + tabs={this.state.tabviews} + dict={this.state.dict} + card={this.state.card} + formlist={this.state.formlist} + wrappedComponentRef={(inst) => this.tabsFormRef = inst} + /> </Modal> {/* 鏍规嵁瀛楁鍚嶆坊鍔犳樉绀哄垪鍙婃悳绱㈡潯浠� */} <Modal @@ -3120,7 +2510,7 @@ onCancel={() => { this.setState({closeVisible: false}) }} footer={[ <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['header.save']}</Button>, - <Button key="confirm" className="mk-btn mk-yellow" onClick={() => {this.props.handleConfig('')}}>{this.state.dict['header.notsave']}</Button>, + <Button key="notsave" className="mk-btn mk-yellow" onClick={this.notsave}>{this.state.dict['header.notsave']}</Button>, <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['header.cancel']}</Button> ]} destroyOnClose diff --git a/src/templates/comtableconfig/tabdragelement/index.jsx b/src/templates/comtableconfig/tabdragelement/index.jsx index 5f50bde..0c9d518 100644 --- a/src/templates/comtableconfig/tabdragelement/index.jsx +++ b/src/templates/comtableconfig/tabdragelement/index.jsx @@ -1,6 +1,7 @@ import React, { useState } from 'react' import { useDrop } from 'react-dnd' import update from 'immutability-helper' +import { is, fromJS } from 'immutable' import { Tabs, Icon } from 'antd' import Utils from '@/utils/utils.js' import Card from './card' @@ -13,12 +14,13 @@ const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) - if (!card) return - const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) - setCards(_cards) handleList(type, _cards) + } + + if (!is(fromJS(cards), fromJS(list))) { + setCards(list) } const findCard = id => { @@ -58,15 +60,10 @@ 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 } diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index c09e724..b0db875 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -2624,7 +2624,6 @@ dict={this.state.dict} menu={this.props.menu} config={this.state.config} - columns={this.state.config.columns} usefulFields={this.props.permFuncField} wrappedComponentRef={(inst) => this.settingRef = inst} /> diff --git a/src/templates/formtabconfig/settingform/index.jsx b/src/templates/formtabconfig/settingform/index.jsx index 24ce02c..adbd0b7 100644 --- a/src/templates/formtabconfig/settingform/index.jsx +++ b/src/templates/formtabconfig/settingform/index.jsx @@ -10,24 +10,44 @@ static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, - data: PropTypes.object, config: PropTypes.object, - columns: PropTypes.array, usefulFields: PropTypes.array } state = { - interType: this.props.data.interType || 'inner', - columns: this.props.columns.filter(item => item.field && item.type !== 'colspan'), + interType: null, + columns: null, currentTabs: null, selectTabs: [] } UNSAFE_componentWillMount() { - const { config, data } = this.props + const { config, menu } = this.props + console.log(menu) + console.log(config) let _tabs = [] let _select = [] let _tabMap = new Map() + let _columns = [] + let _interType = 'inner' + let _setting = config.setting + + try { + _columns = menu.LongParam.columns.filter(item => item.field && item.type !== 'colspan') + // config.groups.forEach(group => { + // if (group.isDefault) { + // _columns.push() + // } + // group.sublist + // }) + _interType = menu.LongParam.setting.interType + } catch { + notification.warning({ + top: 92, + message: '鑿滃崟淇℃伅閿欒锛�', + duration: 10 + }) + } config.tabgroups.forEach(groupname => { config[groupname].forEach(tab => { @@ -38,7 +58,7 @@ }) }) - data.subtabs && data.subtabs.forEach(tabId => { + _setting.subtabs && _setting.subtabs.forEach(tabId => { if (_tabMap.has(tabId)) { _select.push(tabId) } @@ -46,7 +66,10 @@ this.setState({ currentTabs: _tabs, - selectTabs: _select + selectTabs: _select, + columns: _columns, + interType: _interType, + setting: _setting }) } @@ -81,16 +104,15 @@ } selectChange = (val) => { - // let _order = this.props.form.getFieldValue('order') this.props.form.setFieldsValue({ order: `${val} desc` }) } render() { - const { data, dict, menu, usefulFields } = this.props + const { dict, menu, usefulFields } = this.props const { getFieldDecorator } = this.props.form - const { interType, columns, selectTabs } = this.state + const { interType, columns, selectTabs, setting } = this.state const formItemLayout = { labelCol: { @@ -103,7 +125,7 @@ } } - let primaryKey = data.primaryKey + let primaryKey = setting.primaryKey if (primaryKey) { let field = columns.filter(column => column.field === primaryKey) if (field.length !== 1) { @@ -123,7 +145,7 @@ <Col span={12}> <Form.Item label="琛ㄥ悕"> {getFieldDecorator('tableName', { - initialValue: data.tableName, + initialValue: setting.tableName, rules: [ { required: true, @@ -138,24 +160,9 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label="琛ㄦ牸灞炴��"> - {getFieldDecorator('tableType', { - initialValue: data.tableType - })( - <Select - getPopupContainer={() => document.getElementById('commontable-setting-form')} - > - <Select.Option value="">涓嶅彲閫�</Select.Option> - <Select.Option value="radio">鍗曢��</Select.Option> - <Select.Option value="checkbox">澶氶��</Select.Option> - </Select> - )} - </Form.Item> - </Col> - <Col span={12}> <Form.Item label={dict['header.form.intertype']}> {getFieldDecorator('interType', { - initialValue: data.interType || 'inner' + initialValue: setting.interType || 'inner' })( <Radio.Group onChange={this.onChange}> <Radio value="inner">{dict['header.form.interface.inner']}</Radio> @@ -167,7 +174,7 @@ {interType === 'outer' ? <Col span={12}> <Form.Item label={dict['header.form.interface']}> {getFieldDecorator('interface', { - initialValue: data.interface || '', + initialValue: setting.interface || '', rules: [ { required: true, @@ -189,7 +196,7 @@ </Tooltip> }> {getFieldDecorator('innerFunc', { - initialValue: data.innerFunc || '', + initialValue: setting.innerFunc || '', rules: [ { pattern: _patten, @@ -210,26 +217,14 @@ </Tooltip> } className="textarea"> {getFieldDecorator('dataresource', { - initialValue: data.dataresource + initialValue: setting.dataresource })(<TextArea rows={4} />)} </Form.Item> </Col> : null} - <Col span={12}> - <Form.Item label="鍥哄畾鎸夐挳"> - {getFieldDecorator('actionfixed', { - initialValue: data.actionfixed ? 'true' : 'false' - })( - <Select> - <Select.Option value="true">鏄�</Select.Option> - <Select.Option value="false">鍚�</Select.Option> - </Select> - )} - </Form.Item> - </Col> {interType === 'outer' ? <Col span={12}> <Form.Item label={dict['header.form.outerFunc']}> {getFieldDecorator('outerFunc', { - initialValue: data.outerFunc || '', + initialValue: setting.outerFunc || '', rules: [ { pattern: formRule.func.pattern, @@ -242,18 +237,7 @@ })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> : null} - <Col span={12}> - <Form.Item label="鍥哄畾鍒�"> - {getFieldDecorator('columnfixed', { - initialValue: data.columnfixed ? 'true' : 'false' - })( - <Select> - <Select.Option value="true">鏄�</Select.Option> - <Select.Option value="false">鍚�</Select.Option> - </Select> - )} - </Form.Item> - </Col> + <Col span={12}> <Form.Item label="涓婚敭"> {getFieldDecorator('primaryKey', { @@ -270,35 +254,6 @@ {columns.map((option, index) => <Select.Option id={option.uuid} title={option.label} key={index} value={option.field}>{option.label}</Select.Option> )} - </Select> - )} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label="榛樿鎺掑簭"> - {getFieldDecorator('order', { - initialValue: data.order || (primaryKey ? primaryKey + ' desc' : ''), - rules: [ - { - required: true, - message: dict['form.required.input'] + '榛樿鎺掑簭瀛楁!' - }, - { - max: formRule.input.max, - message: formRule.input.message - } - ] - })(<Input placeholder="ID asc, UID desc" autoComplete="off" />)} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label="鍒濆鍖�"> - {getFieldDecorator('onload', { - initialValue: data.onload || 'true' - })( - <Select> - <Select.Option value="true">鍔犺浇鏁版嵁</Select.Option> - <Select.Option value="false">涓嶅姞杞芥暟鎹�</Select.Option> </Select> )} </Form.Item> diff --git a/src/templates/tableshare/dragelement/index.jsx b/src/templates/tableshare/dragelement/index.jsx index 17f483d..31ed8ae 100644 --- a/src/templates/tableshare/dragelement/index.jsx +++ b/src/templates/tableshare/dragelement/index.jsx @@ -1,5 +1,6 @@ import React, { useState } from 'react' import { useDrop } from 'react-dnd' +import { is, fromJS } from 'immutable' import update from 'immutability-helper' import { Col, Icon } from 'antd' import Utils from '@/utils/utils.js' @@ -14,10 +15,12 @@ const moveCard = (id, atIndex) => { const { card, index } = findCard(id) const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) - setCards(_cards) handleList(type, _cards) } + if (!is(fromJS(cards), fromJS(list))) { + setCards(list) + } const findCard = id => { const card = cards.filter(c => `${c.uuid}` === id)[0] return { @@ -47,6 +50,7 @@ copycard.uuid = Utils.getuuid() copycard.origin = false copycard.label = copycard.label + '(copy)' + copycard.focus = true copycard.originCard = card @@ -135,7 +139,7 @@ targetIndex++ const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] }) - setCards(_cards) + handleList(type, _cards, newcard) target = null } diff --git a/src/templates/tableshare/formconfig.js b/src/templates/tableshare/formconfig.js new file mode 100644 index 0000000..08380d8 --- /dev/null +++ b/src/templates/tableshare/formconfig.js @@ -0,0 +1,669 @@ +import zhCN from '@/locales/zh-CN/comtable.js' +import enUS from '@/locales/en-US/comtable.js' + +const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS + +/** + * @description 鑾峰彇鎼滅储鏉′欢琛ㄥ崟閰嶇疆淇℃伅 + * @param {*} card + */ +export function getSearchForm (card) { + return [ + { + type: 'text', + key: 'label', + label: Formdict['header.form.name'], + initVal: card.label || '', + required: true, + readonly: false + }, + { + type: 'text', + key: 'field', + label: Formdict['header.form.field'], + initVal: card.field || '', + tooltip: '瀛楁鍚嶅彲浠ヤ娇鐢ㄩ�楀彿鍒嗛殧锛岃繘琛屽瀛楁缁煎悎鎼滅储锛屾敞锛氱患鍚堟悳绱粎鍦ㄦ枃鏈被鍨嬫椂鏈夋晥', + tooltipClass: 'middle', + required: true, + readonly: false + }, + { + type: 'select', + key: 'type', + label: Formdict['header.form.type'], + initVal: card.type, + required: true, + options: [{ + value: 'text', + text: Formdict['header.form.text'] + }, { + value: 'select', + text: Formdict['header.form.select'] + }, { + value: 'multiselect', + text: Formdict['header.form.multiselect'] + }, { + value: 'link', + text: Formdict['header.form.link'] + }, { + value: 'date', + text: Formdict['header.form.dateday'] + }, { + value: 'dateweek', + text: Formdict['header.form.dateweek'] + }, { + value: 'datemonth', + text: Formdict['header.form.datemonth'] + }, { + value: 'daterange', + text: Formdict['header.form.daterange'] + }] + }, + { + type: 'text', + key: 'initval', + label: Formdict['header.form.initval'], + initVal: card.initval, + required: false + }, + { + type: 'radio', + key: 'resourceType', + label: Formdict['header.form.resourceType'], + initVal: card.resourceType || '0', + required: true, + options: [{ + value: '0', + text: Formdict['header.form.custom'] + }, { + value: '1', + text: Formdict['header.form.datasource'] + }] + }, + { + type: 'radio', + key: 'setAll', + label: Formdict['header.form.setAll'], + initVal: card.setAll || 'false', + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] + }, + { + type: 'textarea', + key: 'dataSource', + label: Formdict['header.form.datasource'], + initVal: card.dataSource || '', + required: true, + readonly: false + }, + { + type: 'options', + key: 'options', + label: '', + initVal: card.options || [], + required: true, + readonly: false + }, + { + type: 'text', + key: 'linkField', + label: Formdict['header.form.linkField'], + initVal: card.linkField || '', + required: true, + readonly: false + }, + { + type: 'text', + key: 'valueField', + label: Formdict['header.form.valueField'], + initVal: card.valueField || '', + required: true, + readonly: false + }, + { + type: 'text', + key: 'valueText', + label: Formdict['header.form.valueText'], + initVal: card.valueText || '', + required: true, + readonly: false + }, + { + type: 'text', + key: 'orderBy', + label: Formdict['header.form.orderBy'], + initVal: card.orderBy || '', + required: false, + readonly: false + }, + { + type: 'select', + key: 'orderType', + label: Formdict['header.form.orderType'], + initVal: card.orderType || 'asc', + options: [{ + value: 'asc', + text: Formdict['header.form.asc'] + }, { + value: 'desc', + text: Formdict['header.form.desc'] + }] + }, + { + type: 'select', + key: 'match', + label: Formdict['header.form.match'], + initVal: card.match || 'like', + required: true, + options: [{ + value: 'like', + text: 'like' + }, { + value: 'equal', + text: 'equal' + }, { + value: 'greater', + text: '>' + }, { + value: 'less', + text: '<' + }, { + value: 'greaterequal', + text: '>=' + }] + }, + { + type: 'select', + key: 'display', + label: Formdict['header.form.display'], + initVal: card.display || 'dropdown', + required: true, + options: [{ + value: 'dropdown', + text: Formdict['header.form.dropdown'] + }, { + value: 'button', + text: Formdict['header.form.button'] + }] + } + ] +} + +/** + * @description 鑾峰彇鎸夐挳琛ㄥ崟閰嶇疆淇℃伅 + * @param {*} card 缂栬緫鎸夐挳 + * @param {*} functip 鐢熸垚瀛樺偍杩囩▼鎻愮ず + * @param {*} config 椤甸潰閰嶇疆 + * @param {*} permFuncField 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� + */ +export function getActionForm (card, functip, config, permFuncField) { + return [ + { + type: 'text', + key: 'label', + label: Formdict['header.form.name'], + initVal: card.label, + required: true, + readonly: false + }, + { + type: 'select', + key: 'OpenType', + label: Formdict['header.form.openType'], + initVal: card.OpenType, + required: true, + options: [{ + value: 'pop', + text: Formdict['header.form.popform'] + }, { + value: 'prompt', + text: Formdict['header.form.prompt'] + }, { + value: 'exec', + text: Formdict['header.form.exec'] + }, { + value: 'excelIn', + text: Formdict['header.form.excelIn'] + }, { + value: 'excelOut', + text: Formdict['header.form.excelOut'] + }, { + value: 'popview', + text: Formdict['header.form.popview'] + }, { + value: 'tab', + text: Formdict['header.form.tab'] + }, { + value: 'blank', + text: Formdict['header.form.blank'] + }, { + value: 'innerpage', + text: Formdict['header.form.newpage.inner'] + }, { + value: 'outerpage', + text: Formdict['header.form.newpage.outer'] + }] + }, { + type: 'select', + key: 'tabType', + label: Formdict['header.form.tabType'], + initVal: card.tabType || 'SubTable', + required: true, + options: [{ + value: 'SubTable', + text: Formdict['header.menu.tab.subtable'] + }] + }, + { + type: 'select', + key: 'linkTab', + label: '鍏宠仈鏍囩', + initVal: card.linkTab || '', + required: false, + options: [] + }, + { + type: 'select', + key: 'pageTemplate', + label: Formdict['header.form.pageTemplate'], + initVal: card.pageTemplate || '', + required: true, + options: [] + }, + { + type: 'text', + key: 'url', + label: Formdict['header.form.newpage.url'], + initVal: card.url || '', + required: true + }, + { + type: 'radio', + key: 'intertype', + label: Formdict['header.form.intertype'], + initVal: card.intertype || 'inner', + required: true, + options: [{ + value: 'inner', + text: Formdict['header.form.interface.inner'] + }, { + value: 'outer', + text: Formdict['header.form.interface.outer'] + }] + }, + { + type: 'text', + key: 'innerFunc', + label: Formdict['header.form.innerFunc'], + initVal: card.innerFunc || '', + tooltip: functip, + fields: permFuncField, + tooltipClass: 'middle', + required: false, + readonly: false + }, + { + type: 'radio', + key: 'sysInterface', + label: Formdict['header.form.sysInterface'], + initVal: card.sysInterface || 'false', + required: true, + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] + }, + { + type: 'text', + key: 'outerFunc', + label: Formdict['header.form.outerFunc'], + initVal: card.outerFunc || '', + required: false, + readonly: false + }, + { + type: 'text', + key: 'interface', + label: Formdict['header.form.interface'], + initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : (card.interface || ''), + required: true, + readonly: card.sysInterface === 'true' + }, + { + type: 'text', + key: 'callbackFunc', + label: Formdict['header.form.callbackFunc'], + initVal: card.callbackFunc || '', + required: false, + readonly: false + }, + { + type: 'select', + key: 'position', + label: Formdict['header.form.position'], + initVal: card.position || 'toolbar', + required: true, + options: [{ + value: 'toolbar', + text: Formdict['header.form.toolbar'] + }, { + value: 'grid', + text: Formdict['header.form.grid'] + }] + }, + { + type: 'select', + key: 'Ot', + label: Formdict['header.form.isRequired'], + initVal: card.Ot || 'requiredSgl', + required: true, + options: [] + }, + { + type: 'select', + key: 'tabTemplate', + label: '鏍囩妯℃澘', + initVal: card.tabTemplate || 'formTab', + required: true, + options: [{ + value: 'formTab', + text: '甯︽爣绛捐〃鍗�' + }] + }, + { + type: 'select', + key: 'execSuccess', + label: Formdict['header.form.execSuccess'], + initVal: card.execSuccess || 'never', + required: true, + options: [{ + value: 'never', + text: Formdict['header.form.refresh.never'] + }, { + value: 'grid', + text: Formdict['header.form.refresh.grid'] + }, { + value: 'view', + text: Formdict['header.form.refresh.view'] + }] + }, + { + type: 'select', + key: 'execError', + label: Formdict['header.form.execError'], + initVal: card.execError || 'never', + required: true, + options: [{ + value: 'never', + text: Formdict['header.form.refresh.never'] + }, { + value: 'grid', + text: Formdict['header.form.refresh.grid'] + }, { + value: 'view', + text: Formdict['header.form.refresh.view'] + }] + }, + { + type: 'select', + key: 'popClose', + label: Formdict['header.form.popClose'], + initVal: card.popClose || 'never', + required: true, + options: [{ + value: 'never', + text: Formdict['header.form.refresh.never'] + }, { + value: 'grid', + text: Formdict['header.form.refresh.grid'] + }, { + value: 'view', + text: Formdict['header.form.refresh.view'] + }] + }, + { + type: 'select', + key: 'icon', + label: Formdict['header.form.icon'], + initVal: card.icon, + required: false, + options: [] + }, + { + type: 'select', + key: 'class', + label: Formdict['header.form.class'], + initVal: card.class, + required: false, + options: [] + }, + { + type: 'text', + key: 'sql', + label: Formdict['header.form.datasource'], + initVal: card.sql || config.setting.tableName || '', + tooltip: Formdict['header.form.actionhelp.datasource'], + required: false + }, + { + type: 'select', + key: 'sqlType', + label: Formdict['header.form.action.type'], + initVal: card.sqlType || '', + tooltip: Formdict['header.form.actionhelp.sqlType'], + required: false, + options: [] + } + ] +} + +/** + * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭� + * @param {*} card + */ +export function getColumnForm (card) { + return [ + { + type: 'text', + key: 'label', + label: Formdict['header.form.name'], + initVal: card.label, + required: true + }, + { + type: 'text', + key: 'field', + label: Formdict['header.form.field'], + initVal: card.field, + required: true, + readonly: false + }, + { + type: 'select', + key: 'type', + label: Formdict['header.form.type'], + initVal: card.type, + required: true, + options: [{ + value: 'text', + text: Formdict['header.form.text'] + }, { + value: 'number', + text: Formdict['header.form.number'] + }, { + value: 'picture', + text: Formdict['header.form.picture'] + }, { + value: 'textarea', + text: Formdict['header.form.textarea'] + }] + }, + { + type: 'select', + key: 'Align', + label: Formdict['header.form.align'], + initVal: card.Align, + required: true, + options: [{ + value: 'left', + text: Formdict['header.form.alignLeft'] + }, { + value: 'right', + text: Formdict['header.form.alignRight'] + }, { + value: 'center', + text: Formdict['header.form.alignCenter'] + }] + }, + { + type: 'radio', + key: 'Hide', + label: Formdict['header.form.Hide'], + initVal: card.Hide, + required: true, + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] + }, + { + type: 'radio', + key: 'IsSort', + label: Formdict['header.form.IsSort'], + initVal: card.IsSort, + required: true, + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] + }, + { + type: 'number', + key: 'Width', + min: 1, + max: 1000, + decimal: 0, + label: Formdict['header.form.columnWidth'], + initVal: card.Width, + required: true + }, + { + type: 'number', + key: 'decimal', + min: 0, + max: 18, + decimal: 0, + label: Formdict['header.form.decimal'], + initVal: card.decimal, + required: false + }, + { + type: 'select', + key: 'format', + label: Formdict['header.form.format'], + initVal: card.format || '', + options: [{ + value: '', + text: Formdict['header.form.empty'] + }, { + value: 'thdSeparator', + text: Formdict['header.form.thdSeparator'] + }], + required: false + }, + { + type: 'text', + key: 'prefix', + label: Formdict['header.form.prefix'], + initVal: card.prefix || '', + required: false, + readonly: false + }, + { + type: 'text', + key: 'postfix', + label: Formdict['header.form.postfix'], + initVal: card.postfix || '', + tooltipClass: 'middle', + required: false, + readonly: false + }, + { + type: 'select', + key: 'match', + label: Formdict['header.form.match'], + initVal: card.match || '', + options: [{ + value: '', + text: Formdict['header.form.empty'] + }, { + value: '>', + text: '>' + }, { + value: '<', + text: '<' + }, { + value: '>=', + text: '>=' + }, { + value: '<=', + text: '<=' + }], + required: false + }, + { + type: 'text', + key: 'matchVal', + min: -Infinity, + max: Infinity, + decimal: 0, + label: Formdict['header.form.matchVal'], + initVal: card.matchVal || '', + required: false, + readonly: false + }, + { + type: 'select', + key: 'color', + label: Formdict['header.form.color'], + initVal: card.color || '', + options: [{ + value: '', + text: Formdict['header.form.empty'] + }, { + value: 'red', + text: '绾㈣壊锛堝唴瀹癸級' + }, { + value: 'redbg', + text: '绾㈣壊锛堣儗鏅級' + }, { + value: 'orange', + text: '姗欒壊锛堝唴瀹癸級' + }, { + value: 'orangebg', + text: '姗欒壊锛堣儗鏅級' + }, { + value: 'green', + text: '缁胯壊锛堝唴瀹癸級' + }, { + value: 'greenbg', + text: '缁胯壊锛堣儗鏅級' + }], + required: false + } + ] +} \ No newline at end of file diff --git a/src/templates/tableshare/searchform/index.jsx b/src/templates/tableshare/searchform/index.jsx index 0fc9570..63aeea8 100644 --- a/src/templates/tableshare/searchform/index.jsx +++ b/src/templates/tableshare/searchform/index.jsx @@ -293,7 +293,6 @@ </Form.Item> </Col> ) - } else if (item.type === 'textarea') { fields.push( <Col span={20} offset={4} key={index}> @@ -328,7 +327,6 @@ 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 === 'multiselect' || values.type === 'select' || values.type === 'link') && values.resourceType === '0') { @@ -348,10 +346,7 @@ } if (isvalid) { - resolve({ - type: 'search', - values - }) + resolve(values) } else { notification.warning({ top: 92, -- Gitblit v1.8.0