From a8507cc8c42d17d4fb854594dbf1e084d61912ac Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 18 十月 2022 12:44:22 +0800 Subject: [PATCH] 2022-10-18 --- src/templates/zshare/modalform/index.jsx | 34 src/templates/zshare/editcard/index.jsx | 11 src/tabviews/formtab/index.jsx | 4 src/menu/components/timeline/normal-timeline/index.jsx | 1 src/mob/mobshell/index.jsx | 1 src/menu/components/chart/antv-scatter/chartcompile/index.jsx | 11 src/templates/zshare/verifycard/customscript/index.jsx | 3 src/views/menudesign/printmenuform/index.jsx | 13 src/templates/sharecomponent/chartcomponent/index.jsx | 4 src/menu/components/chart/antv-scatter/index.jsx | 6 src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx | 5 src/menu/components/table/edit-table/columns/editColumn/index.jsx | 14 src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 7 src/menu/datasource/verifycard/index.jsx | 128 + src/templates/formtabconfig/settingform/index.jsx | 33 src/menu/components/card/cardcellcomponent/index.jsx | 27 src/menu/components/form/tab-form/index.jsx | 12 src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 39 src/menu/components/carousel/prop-card/index.jsx | 1 src/templates/zshare/verifycard/uniqueform/index.jsx | 17 src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx | 1 src/menu/components/chart/antv-pie/index.jsx | 6 src/menu/components/editor/braft-editor/editorcontent/index.jsx | 7 src/menu/components/table/edit-table/columns/tableIn/uniqueform/index.jsx | 13 src/menu/components/card/prop-card/index.jsx | 1 src/templates/zshare/customscript/index.jsx | 7 src/templates/sharecomponent/treesettingcomponent/index.jsx | 6 src/menu/components/tabs/paste/index.jsx | 4 src/menu/components/table/edit-table/columns/index.jsx | 8 src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 4 src/menu/components/tabs/table-tabs/options.jsx | 267 ++ src/menu/datasource/verifycard/index.scss | 33 src/templates/comtableconfig/index.jsx | 34 src/menu/components/chart/chart-custom/index.jsx | 6 src/menu/components/form/simple-form/index.jsx | 12 src/mob/components/tabs/tabcomponents/index.jsx | 1 src/api/index.js | 134 src/templates/sharecomponent/cardcomponent/index.jsx | 12 src/menu/sysinterface/index.jsx | 2 src/templates/calendarconfig/calcomponent/calendarform/index.jsx | 21 src/mob/components/search/single-search/index.jsx | 10 src/mob/components/tabs/antv-tabs/index.scss | 1 src/menu/components/table/base-table/columns/editColumn/index.jsx | 13 src/menu/urlfieldcomponent/index.scss | 1 src/views/pcdesign/index.jsx | 25 src/menu/components/tabs/table-tabs/index.scss | 144 + src/menu/datasource/verifycard/settingform/index.jsx | 23 src/templates/sharecomponent/tabscomponent/tabform/index.jsx | 11 src/menu/components/share/actioncomponent/index.jsx | 27 src/templates/modalconfig/menuform/index.jsx | 5 src/templates/modalconfig/source.jsx | 20 src/pc/createview/settingform/index.jsx | 9 src/templates/zshare/editTable/index.jsx | 18 src/components/thawmenu/index.jsx | 2 src/menu/components/share/searchcomponent/index.jsx | 6 src/views/menudesign/homeform/index.jsx | 5 src/pc/components/navbar/normal-navbar/menusetting/index.jsx | 7 src/templates/treepageconfig/index.jsx | 26 src/views/menudesign/menuform/index.jsx | 27 src/menu/datasource/index.jsx | 8 src/menu/components/module/voucher/index.jsx | 1 src/templates/treepageconfig/source.jsx | 6 src/templates/zshare/menuform/index.jsx | 5 src/menu/components/table/base-table/index.scss | 11 src/menu/components/form/formaction/index.jsx | 18 src/templates/formtabconfig/groupform/index.jsx | 3 src/templates/zshare/verifycard/contrastform/index.jsx | 21 src/menu/components/tree/antd-tree/index.jsx | 1 src/views/billprint/index.jsx | 13 src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx | 9 src/menu/tableshell/card.jsx | 34 src/views/menudesign/index.jsx | 12 src/views/tabledesign/tablesource/index.jsx | 14 src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx | 15 src/templates/sharecomponent/actioncomponent/actionform/index.jsx | 50 src/templates/calendarconfig/index.jsx | 28 src/menu/pastecontroller/index.jsx | 4 src/menu/components/card/data-card/index.jsx | 1 src/menu/components/chart/antv-dashboard/index.jsx | 6 src/mob/components/menubar/common-menubar/index.jsx | 1 src/templates/sharecomponent/settingcomponent/index.jsx | 14 src/templates/subtableconfig/source.jsx | 52 src/components/header/index.jsx | 2 src/views/pcdesign/menuform/index.jsx | 13 src/templates/formtabconfig/index.jsx | 56 src/templates/zshare/verifycard/callbackcustomscript/index.jsx | 3 src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx | 13 src/mob/modalconfig/source.jsx | 17 src/tabviews/calendar/index.jsx | 4 src/pc/quotecomponent/index.jsx | 12 src/templates/zshare/editcomponent/index.jsx | 12 src/templates/sharecomponent/fieldscomponent/index.jsx | 11 src/menu/components/code/sandbox/index.jsx | 4 src/templates/zshare/verifycard/customform/index.jsx | 13 src/menu/components/chart/chart-custom/chartcompile/index.jsx | 3 src/templates/calendarconfig/tabcomponent/tabform/index.jsx | 7 src/templates/sharecomponent/settingcalcomponent/index.jsx | 8 src/templates/calendarconfig/calcomponent/index.jsx | 6 src/menu/components/card/balcony/index.jsx | 1 src/menu/components/table/base-table/options.jsx | 108 src/menu/components/chart/antv-pie/chartcompile/index.jsx | 13 src/templates/zshare/verifycard/index.jsx | 38 src/templates/formtabconfig/actionform/index.jsx | 31 src/menu/components/card/cardcellcomponent/formconfig.jsx | 15 src/templates/sharecomponent/actioncomponent/index.jsx | 31 src/components/normalform/index.jsx | 7 src/menu/components/editor/braft-editor/index.jsx | 1 src/menu/stylecombcontrolbutton/index.jsx | 8 src/templates/sharecomponent/tabscomponent/tabdragelement/index.jsx | 4 src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx | 4 src/templates/subtableconfig/menuform/index.jsx | 11 src/menu/components/share/markcomponent/markform/index.jsx | 9 src/menu/components/chart/antv-bar/chartcompile/index.jsx | 13 src/mob/searchconfig/index.jsx | 16 src/menu/components/share/markcomponent/index.jsx | 9 src/menu/components/card/cardcellcomponent/elementform/index.jsx | 19 src/pc/components/navbar/normal-navbar/linksetting/index.jsx | 7 src/templates/sharecomponent/settingcalcomponent/verifycard/columnform/index.jsx | 9 src/menu/components/tabs/antv-tabs/index.scss | 1 src/templates/sharecomponent/columncomponent/markcolumn/index.jsx | 2 src/templates/modalconfig/index.jsx | 43 src/templates/sharecomponent/tablecomponent/index.jsx | 1 src/mob/components/official/index.jsx | 7 src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx | 8 src/mob/modalconfig/index.jsx | 17 src/menu/stylecombcontroller/index.jsx | 112 src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx | 9 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 29 src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 51 src/views/imdesign/menuform/index.jsx | 11 src/menu/components/form/formaction/formconfig.jsx | 37 src/menu/components/share/usercomponent/settingform/index.jsx | 3 src/tabviews/custom/components/card/cardcellList/index.jsx | 1 src/tabviews/custom/components/card/prop-card/index.jsx | 33 src/menu/tableshell/index.jsx | 24 src/mob/components/menubar/normal-menubar/index.jsx | 1 src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx | 37 src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx | 14 src/templates/subtableconfig/index.jsx | 26 src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx | 3 src/tabviews/zshare/mutilform/index.jsx | 24 src/menu/components/share/actioncomponent/actionform/index.jsx | 40 src/menu/components/tabs/table-tabs/dragabletabs.jsx | 129 + src/tabviews/custom/index.jsx | 8 src/menu/components/table/normal-table/columns/index.jsx | 7 src/pc/components/navbar/normal-navbar/index.jsx | 1 src/menu/components/chart/antv-dashboard/chartcompile/index.jsx | 13 src/menu/components/group/groupcomponents/index.jsx | 1 src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx | 26 src/menu/components/form/formaction/actionform/index.jsx | 13 src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx | 13 src/menu/components/table/base-table/columns/editColumn/formconfig.jsx | 75 src/pc/menushell/index.jsx | 1 src/menu/components/tabs/table-tabs/index.jsx | 401 ++++ src/templates/zshare/verifycard/billcodeform/index.jsx | 19 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 6 src/menu/components/chart/antv-bar/index.jsx | 10 src/views/tabledesign/index.jsx | 43 src/menu/components/table/edit-table/index.jsx | 4 src/templates/sharecomponent/tabscomponent/index.jsx | 7 src/menu/components/carousel/data-card/index.jsx | 1 src/templates/zshare/verifycard/index.scss | 5 src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 9 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 9 src/menu/components/form/step-form/index.jsx | 12 src/pc/quotecomponent/settingform/index.jsx | 9 src/templates/comtableconfig/source.jsx | 54 src/menu/components/search/main-search/index.jsx | 11 src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx | 3 src/tabviews/zshare/settingcomponent/editTable/index.jsx | 11 src/views/tabledesign/tablesource/index.scss | 19 src/views/login/index.jsx | 15 src/templates/zshare/createinterface/mutilform/index.jsx | 7 src/mob/components/navbar/normal-navbar/index.jsx | 1 src/utils/utils-datamanage.js | 36 src/menu/picturecontroller/index.jsx | 3 src/menu/components/table/edit-table/columns/tableIn/index.jsx | 10 src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx | 7 src/menu/components/card/table-card/index.jsx | 1 src/utils/utils-custom.js | 23 src/views/main/index.jsx | 2 src/menu/picturecontroller/index.scss | 8 src/views/tabledesign/source.jsx | 177 + src/menu/components/tabs/tabcomponents/index.jsx | 1 src/menu/components/table/normal-table/columns/editColumn/index.jsx | 13 src/templates/formtabconfig/source.jsx | 10 src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 7 src/templates/calendarconfig/source.jsx | 20 src/views/mobdesign/index.jsx | 31 src/menu/datasource/verifycard/columnform/index.jsx | 16 src/templates/zshare/verifycard/voucherform/index.jsx | 15 src/api/cacheutils.js | 312 +- src/templates/zshare/modalform/datatable/index.jsx | 3 src/menu/components/share/actioncomponent/formconfig.jsx | 69 src/tabviews/custom/components/group/normal-group/index.jsx | 2 src/templates/sharecomponent/tablecomponent/index.scss | 3 src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx | 21 src/templates/zshare/createinterface/index.jsx | 10 src/menu/components/table/base-table/columns/index.jsx | 66 src/templates/calendarconfig/tabcomponent/index.jsx | 8 src/views/imdesign/index.jsx | 11 src/menu/components/table/normal-table/index.jsx | 3 src/menu/components/code/sandbox/editorcode/index.jsx | 7 src/views/design/sidemenu/thdmenuplus/index.jsx | 12 src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 24 src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx | 65 src/views/mobdesign/menuform/index.jsx | 15 src/menu/datasource/verifycard/customscript/index.jsx | 5 src/templates/sharecomponent/searchcomponent/index.jsx | 11 src/templates/sharecomponent/columncomponent/index.jsx | 18 src/templates/sharecomponent/columncomponent/colspanform/index.jsx | 49 src/templates/modalconfig/dragelement/index.jsx | 4 src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx | 9 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 17 src/index.js | 4 src/menu/components/share/usercomponent/index.jsx | 7 src/templates/comtableconfig/menuform/index.jsx | 28 src/templates/zshare/createfunc/index.jsx | 1 src/tabviews/custom/components/share/tabtransfer/index.jsx | 2 src/tabviews/debugtable/index.jsx | 10 src/templates/zshare/formconfig.jsx | 339 +- src/tabviews/custom/components/interfaces/interItem/index.jsx | 19 src/pc/createview/index.jsx | 18 src/pc/components/login/normal-login/index.jsx | 1 /dev/null | 162 - src/menu/modalconfig/index.jsx | 23 src/tabviews/custom/components/card/balcony/index.jsx | 5 src/menu/components/table/base-table/index.jsx | 136 - src/tabviews/debugtable/index.scss | 17 src/menu/components/share/normalform/index.jsx | 1 src/menu/menushell/index.jsx | 1 src/utils/option.js | 14 src/templates/sharecomponent/chartgroupcomponent/index.jsx | 9 src/templates/sharecomponent/columncomponent/columnform/index.jsx | 13 234 files changed, 3,053 insertions(+), 2,553 deletions(-) diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js index 3a983a0..ecf5475 100644 --- a/src/api/cacheutils.js +++ b/src/api/cacheutils.js @@ -5,10 +5,9 @@ /** * @description 鎵撳紑websql */ - static openWebSql (sysType) { - let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' + static openWebSql (db) { try { - window.GLOB.WebSql = openDatabase(`mkdb${service}`, '1', 'mk-pc-database', 50 * 1024 * 1024) + window.GLOB.WebSql = openDatabase(db, '1', 'mk-pc-database', 50 * 1024 * 1024) window.GLOB.WebSql.transaction(tx => { tx.executeSql('CREATE TABLE IF NOT EXISTS VERSIONS (version varchar(50), createDate varchar(50), CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => { @@ -23,7 +22,7 @@ throw 'CREATE TABLE ERROR' }) - if (sysType === 'local' && window.GLOB.systemType === '') { + if (window.GLOB.systemType === '') { tx.executeSql('CREATE TABLE IF NOT EXISTS FUNCS (func_code varchar(50), key_sql text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => { }, () => { @@ -45,8 +44,9 @@ /** * @description 娓呯┖鍑芥暟 */ - static clearFuncs (sysType) { - if (sysType !== 'local' || window.GLOB.systemType !== '') return + static clearFuncs () { + if (window.GLOB.systemType !== '') return + if (window.GLOB.WebSql) { window.GLOB.WebSql.transaction(tx => { tx.executeSql('DELETE FROM FUNCS') @@ -57,8 +57,7 @@ let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs') objectStore.clear() - let funcStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') - funcStore.put({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'}) + window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version').delete('funcs') } } @@ -69,32 +68,57 @@ if (!window.GLOB.WebSql) { return Promise.reject() } - return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql("SELECT * FROM VERSIONS where CDefine1='LongParam'", [], (tx, results) => { - if (results.rows.length === 0) { - tx.executeSql('DELETE FROM VERSIONS') - tx.executeSql('DELETE FROM CONFIGS') + + let deffers = [] + + deffers.push( + new Promise((resolve) => { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql("SELECT * FROM VERSIONS where CDefine1='LongParam'", [], (tx, results) => { + if (results.rows[0]) { + resolve(results.rows[0]) + } else { + resolve({version: '', createDate: ''}) + } + }, (tx, results) => { + window.GLOB.WebSql = null + console.warn(results) resolve({version: '', createDate: ''}) - } else { - resolve(results.rows[0]) - } - }, (tx, results) => { - window.GLOB.WebSql = null - reject() - console.warn(results) + }) }) }) - }) - } + ) - /** - * @description 娓呯┖websql涓繚瀛樼殑閰嶇疆淇℃伅 - */ - static clearWebSqlConfig () { - if (!window.GLOB.WebSql) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, () => { window.GLOB.WebSql = null }) + deffers.push( + new Promise((resolve) => { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql(`SELECT * FROM CONFIGS`, [], (tx, results) => { + let menus = [] + for (let i = 0; i < results.rows.length; i++) { + menus.push(`'${results.rows[i].menuid}','${results.rows[i].openEdition || 'mk'}'`) + } + resolve(menus) + }, (tx, results) => { + window.GLOB.WebSql = null + console.warn(results) + resolve([]) + }) + }) + }) + ) + + return new Promise((resolve) => { + Promise.all(deffers).then(res => { + let result = res[0] + + if (result.createDate && !/^\d{4}-\d{2}-\d{2}/.test(result.createDate)) { + result.createDate = '' + } + + result.menuids = res[1].join(';') + + resolve(result) + }) }) } @@ -102,12 +126,19 @@ * @description 鍒犻櫎websql涓繚瀛樼殑閰嶇疆淇℃伅 */ static delWebSqlConfig (keys) { - if (!window.GLOB.WebSql || !keys) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CONFIGS where menuid in (${keys})`, [], () => {}, () => { - window.GLOB.WebSql = null + if (!window.GLOB.WebSql) return + + if (!keys) { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, () => { window.GLOB.WebSql = null }) }) - }) + } else { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql(`DELETE FROM CONFIGS where menuid in (${keys})`, [], () => {}, () => { + window.GLOB.WebSql = null + }) + }) + } } /** @@ -128,38 +159,19 @@ } /** - * @description 鏇存柊websql涓厤缃俊鎭殑淇濆瓨鏃堕棿 - */ - static updateWebSqlTime (curTime) { - if (!window.GLOB.WebSql || !curTime) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`UPDATE VERSIONS SET createDate='${curTime}' where CDefine1='LongParam'`, [], () => {}, () => { - window.GLOB.WebSql = null - }) - }) - } - - /** * @description 鏇存柊websql涓厤缃俊鎭殑鐗堟湰 */ static updateWebSqlversion (version, curTime) { - if (!window.GLOB.WebSql || !curTime || !version) return + if (!window.GLOB.WebSql) return + window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`UPDATE VERSIONS SET version='${version}', createDate='${curTime}' where CDefine1='LongParam'`, [], () => {}, () => { - window.GLOB.WebSql = null - }) - }) - } - - /** - * @description 鍒涘缓websql涓厤缃俊鎭殑鐗堟湰 - */ - static createWebSqlversion (version, curTime) { - if (!window.GLOB.WebSql || !curTime || !version) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', [version, curTime, 'LongParam'], () => {}, () => { - window.GLOB.WebSql = null - }) + tx.executeSql(`DELETE FROM VERSIONS where CDefine1='LongParam'`) + + if (version) { + tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', [version, curTime, 'LongParam'], () => {}, () => { + window.GLOB.WebSql = null + }) + } }) } @@ -208,10 +220,9 @@ /** * @description 鎵撳紑IndexedDB */ - static openIndexDB (sysType) { - let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' + static openIndexDB (db) { try { - let request = window.indexedDB.open(`mkdb${service}`, 1) + let request = window.indexedDB.open(db, 1) request.onerror = () => { console.warn('IndexedDB 鍒濆鍖栧け璐ワ紒') } @@ -228,7 +239,7 @@ objectStore.createIndex('menuid', 'menuid', { unique: false }) objectStore.createIndex('userid', 'userid', { unique: false }) } - if (window.GLOB.systemType === '' && sysType === 'local' && !window.GLOB.IndexDB.objectStoreNames.contains('funcs')) { + if (window.GLOB.systemType === '' && !window.GLOB.IndexDB.objectStoreNames.contains('funcs')) { window.GLOB.IndexDB.createObjectStore('funcs', { keyPath: 'id' }) } } @@ -245,38 +256,66 @@ if (!window.GLOB.IndexDB) { return Promise.reject() } - return new Promise((resolve, reject) => { - let request = window.GLOB.IndexDB.transaction(['version']) - .objectStore('version') - .get('mksoft') - request.onerror = (event) => { - window.GLOB.IndexDB = null - console.warn(event) - reject() - } + let deffers = [] - request.onsuccess = () => { - if (request.result) { - resolve(request.result) - } else { - this.clearIndexDBConfig() + deffers.push( + new Promise((resolve) => { + let request = window.GLOB.IndexDB.transaction(['version']) + .objectStore('version') + .get('mksoft') + + request.onerror = (event) => { + window.GLOB.IndexDB = null + console.warn(event) resolve({version: '', createDate: ''}) } - } + + request.onsuccess = () => { + if (request.result) { + resolve(request.result) + } else { + resolve({version: '', createDate: ''}) + } + } + }) + ) + + deffers.push( + new Promise((resolve) => { + let request = window.GLOB.IndexDB.transaction(['configs']).objectStore('configs').openCursor() + let menus = [] + + request.onerror = () => { + window.GLOB.IndexDB = null + resolve(menus) + } + + request.onsuccess = (e) => { + let cursor = e.target.result + if (cursor) { + menus.push(`'${cursor.value.menuid}','${cursor.value.open_edition || 'mk'}'`) + cursor.continue() + } else { + resolve(menus) + } + } + }) + ) + + return new Promise((resolve) => { + Promise.all(deffers).then(res => { + let result = res[0] + + if (result.createDate && !/^\d{4}-\d{2}-\d{2}/.test(result.createDate)) { + result.createDate = '' + } + + result.menuids = res[1].join(';') + + resolve(result) + }) }) - } - - /** - * @description 娓呯┖IndexedDB涓繚瀛樼殑閰嶇疆淇℃伅 - */ - static clearIndexDBConfig () { - if (!window.GLOB.IndexDB) return - let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').clear() - - request.onerror = () => { - window.GLOB.IndexDB = null - } } /** @@ -285,29 +324,35 @@ static updateIndexDBversion (version) { if (!window.GLOB.IndexDB || !version) return - version.id = 'mksoft' + if (!version) { + let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').delete('mksoft') + + request.onerror = () => { + window.GLOB.IndexDB = null + } + } else { + version.id = 'mksoft' - let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') - let request = objectStore.get('mksoft') - - request.onerror = () => { - window.GLOB.IndexDB = null - } - - request.onsuccess = () => { - if (request.result) { - let put = objectStore.put(version) - - put.onerror = () => { - window.GLOB.IndexDB = null - } - } else { - this.clearIndexDBConfig() - - let add = objectStore.add(version) - - add.onerror = () => { - window.GLOB.IndexDB = null + let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') + let request = objectStore.get('mksoft') + + request.onerror = () => { + window.GLOB.IndexDB = null + } + + request.onsuccess = () => { + if (request.result) { + let put = objectStore.put(version) + + put.onerror = () => { + window.GLOB.IndexDB = null + } + } else { + let add = objectStore.add(version) + + add.onerror = () => { + window.GLOB.IndexDB = null + } } } } @@ -337,24 +382,30 @@ /** * @description 鍒犻櫎IndexedDB涓繚瀛樼殑閰嶇疆淇℃伅-鎵归噺 */ - static delIndexDBConfig (keys) { - if (!window.GLOB.IndexDB || !keys) return + static delIndexDBConfig (menuids) { + if (!window.GLOB.IndexDB) return - let objectStore = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs') + if (!menuids) { + let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').clear() + + request.onerror = () => { + window.GLOB.IndexDB = null + } + } else { + let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').openCursor() + + request.onerror = () => { + window.GLOB.IndexDB = null + } - objectStore.openCursor().onsuccess = (event) => { - let cursor = event.target.result - - if (cursor) { - if (cursor.value && keys.includes(cursor.value.menuid)) { - let request = objectStore.delete(cursor.key) - - request.onerror = () => { - window.GLOB.IndexDB = null + request.onsuccess = (e) => { + let cursor = e.target.result + if (cursor) { + if (menuids.includes(cursor.value.menuid)) { + cursor.delete() } + cursor.continue() } - - cursor.continue() } } } @@ -365,6 +416,7 @@ static getIndexDBMenuConfig (MenuID, userid) { if (!window.GLOB.IndexDB || !MenuID || !userid) return Promise.reject() let key = MenuID + userid + return new Promise((resolve, reject) => { let request = window.GLOB.IndexDB.transaction(['configs']).objectStore('configs').get(key) diff --git a/src/api/index.js b/src/api/index.js index e9e4d99..b320ee1 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -10,16 +10,19 @@ window.GLOB.WebSql = null window.GLOB.IndexDB = null -const systemMenuKeys = `1581067625930haged11ieaivpavv77k,1581734956310scks442ul2d955g9tu5,1583991994144ndddg0bhh0is6shi0v1,1583979633842550imkchl4qt4qppsiv,1578900109100np8aqd0a77q3na46oas,16044812935562g807p3p12huk8kokmb, +const systemMenuKeys = `1581067625930haged11ieaivpavv77k,1581734956310scks442ul2d955g9tu5,1583991994144ndddg0bhh0is6shi0v1,1583979633842550imkchl4qt4qppsiv,1578900109100np8aqd0a77q3na46oas, 1585192949946f3et2ts8tn82krmumdf,15855615451212m12ip23vpcm79kloro,1587005717541lov40vg61q7l1rbveon,1590458676585agbbr63t6ihighg2i1g,1602315375262ikd33ii0nii34pt861o,1582771068837vsv54a089lgp45migbg, 1582777675954ifu05upurs465omoth7,158294809668898cklbv6c5bou8e1fpu,1584676379094iktph45fb8imhg96bql,1584695125339vo5g7iqgfn01qmrd6s2,1584699661372vhmpp9dn9foo0eob722,15848421131551gg04ie8sitsd3f7467, - 1589782279158ngr675kk3oksin35sul,1589788042787ffdt9hle4s45k9r1nvs,15900310928174dro07ihfckghpb5h13,1594095599055qicg2eb642v5qglhnuo,1599613340050c8nu6rbst9d4emnnbsq,1577972969199lei1g0qkvlh4tkc908m, + 1589782279158ngr675kk3oksin35sul,1589788042787ffdt9hle4s45k9r1nvs,1594095599055qicg2eb642v5qglhnuo,1577972969199lei1g0qkvlh4tkc908m,16044812935562g807p3p12huk8kokmb, 1578479100252lfbp29v1kafk4s4q4ig,1577971621421tg4v0i1ur8873k7e0ob,1577929944419lgc5h3hepum765e2k7u,1588493493409k9guqp067d31lu7blsv,15827879285193g85m3i2uprektpgmpf` +let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' +let db = `mkdb${service}` + if (window.openDatabase) { - CacheUtils.openWebSql(options.sysType) + CacheUtils.openWebSql(db) } else if (window.indexedDB) { - CacheUtils.openIndexDB(options.sysType) + CacheUtils.openIndexDB(db) } axios.defaults.crossDomain = true @@ -409,20 +412,38 @@ let app_datetime = sessionStorage.getItem('app_datetime') if (sys_datetime && app_datetime) { let seconds = Math.floor((new Date().getTime() - app_datetime) / 1000) - curTime = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss') + '.000' + let _curTime = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss') + '.000' + if (/^\d{4}-\d{2}-\d{2}/.test(_curTime)) { + curTime = _curTime + } } if (window.GLOB.WebSql) { return new Promise((resolve, reject) => { CacheUtils.getWebSqlVersion().then(msg => { - let modifydate = msg.createDate || curTime - if (modifydate.indexOf('Invalid date') > -1) { - modifydate = curTime - } - let param = { func: 's_get_app_version', - modifydate + modifydate: msg.createDate + } + + param.TypeCharOne = '' + param.typename = '' + + if (!msg.createDate && !msg.menuids) { + CacheUtils.updateWebSqlversion('1.00', curTime) + resolve() + return + } else if (!msg.createDate) { + param.modifydate = curTime + param.menuids = window.btoa(msg.menuids) + } else if (msg.menuids) { + let d = localStorage.getItem(db) + + if (!d || curTime.indexOf(d) === -1) { + param.menuids = window.btoa(msg.menuids) + } + + localStorage.setItem(db, curTime.substr(0, 10)) } this.getSystemConfig(param).then(res => { @@ -430,29 +451,28 @@ reject() return } - let clear = false - let version = '1.00' - - if (res.menu_data && res.menu_data.length > 0) { - res.menu_data.forEach(mid => { + + let list = res.menu_data || [] + + if (res.menu_del) { + list.push(...res.menu_del) + } + + if (list.length > 0) { + let clear = false + list.forEach(mid => { if (systemMenuKeys.indexOf(mid.menuid) > -1) { clear = true } }) - + let keys = list.map(mid => `'${mid.menuid}'`).join(',') if (clear) { - CacheUtils.clearWebSqlConfig() - } else { - let keys = res.menu_data.map(mid => `'${mid.menuid}'`).join(',') - CacheUtils.delWebSqlConfig(keys) + keys = '' } + CacheUtils.delWebSqlConfig(keys) } - - if (msg.version) { - CacheUtils.updateWebSqlTime(curTime) - } else { - CacheUtils.createWebSqlversion(version, curTime) - } + + CacheUtils.updateWebSqlversion(res.app_version || '1.00', curTime) resolve() }) @@ -463,13 +483,29 @@ } else { return new Promise((resolve, reject) => { CacheUtils.getIndexDBVersion().then(msg => { - let modifydate = msg.createDate || curTime - if (modifydate.indexOf('Invalid date') > -1) { - modifydate = curTime - } let param = { func: 's_get_app_version', - modifydate + modifydate: msg.createDate + } + + param.TypeCharOne = '' + param.typename = '' + + if (!msg.createDate && !msg.menuids) { + CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) + resolve() + return + } else if (!msg.createDate) { + param.modifydate = curTime + param.menuids = window.btoa(msg.menuids) + } else if (msg.menuids) { + let d = localStorage.getItem(db) + + if (!d || curTime.indexOf(d) === -1) { + param.menuids = window.btoa(msg.menuids) + } + + localStorage.setItem(db, curTime.substr(0, 10)) } this.getSystemConfig(param).then(res => { @@ -477,25 +513,28 @@ reject() return } - let clear = false - let version = '1.00' - if (res.menu_data && res.menu_data.length > 0) { - res.menu_data.forEach(mid => { + let list = res.menu_data || [] + + if (res.menu_del) { + list.push(...res.menu_del) + } + + if (list.length > 0) { + let clear = false + list.forEach(mid => { if (systemMenuKeys.indexOf(mid.menuid) > -1) { clear = true } }) - + let keys = list.map(mid => mid.menuid) if (clear) { - CacheUtils.clearIndexDBConfig() - } else { - let keys = res.menu_data.map(mid => `'${mid.menuid}'`) - CacheUtils.delIndexDBConfig(keys) + keys = '' } + CacheUtils.delIndexDBConfig(keys) } - CacheUtils.updateIndexDBversion({version: version, createDate: curTime}) + CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) resolve() }) @@ -510,12 +549,11 @@ * @description 鏇存柊绯荤粺鐗堟湰淇℃伅锛屾竻绌洪厤缃俊鎭� */ updateAppVersion () { - let curTime = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - CacheUtils.clearWebSqlConfig() - CacheUtils.updateWebSqlversion('1.00', curTime) - CacheUtils.clearIndexDBConfig() - CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) - CacheUtils.clearFuncs(options.sysType) + CacheUtils.delWebSqlConfig() + CacheUtils.updateWebSqlversion() + CacheUtils.delIndexDBConfig() + CacheUtils.updateIndexDBversion() + CacheUtils.clearFuncs() } /** diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 03f6d5c..48a84e0 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -482,7 +482,7 @@ componentDidMount () { // 鑾峰彇绯荤粺鐨勭増鏈俊鎭紝寤舵椂鏌ヨ setTimeout(() => { - Api.getAppVersion().then(() => {}, () => {}) + Api.getAppVersion() }, 1000) // Api.genericInterface({ // func: 's_get_fcc_account_data', diff --git a/src/components/normalform/index.jsx b/src/components/normalform/index.jsx index 5ef4c9d..c587960 100644 --- a/src/components/normalform/index.jsx +++ b/src/components/normalform/index.jsx @@ -3,8 +3,6 @@ import { is, fromJS } from 'immutable' import { Modal } from 'antd' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import ModalForm from './modalform' class NormalFormComponent extends Component { @@ -17,7 +15,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, formlist: [] } @@ -62,7 +59,7 @@ render () { const { title, width, children, double } = this.props - const { visible, dict, formlist } = this.state + const { visible, formlist } = this.state return ( <> @@ -73,7 +70,7 @@ visible={visible} width={width} maskClosable={false} - okText={dict['model.confirm']} + okText="纭畾" onOk={this.submit} onCancel={this.cancel} destroyOnClose diff --git a/src/components/thawmenu/index.jsx b/src/components/thawmenu/index.jsx index 843b8da..dbf1672 100644 --- a/src/components/thawmenu/index.jsx +++ b/src/components/thawmenu/index.jsx @@ -61,7 +61,7 @@ if (targetKeys.length === 0) { notification.warning({ top: 92, - message: this.state.dict['form.required.select'] + this.state.dict['model.menu'], + message: '璇烽�夋嫨鑿滃崟', duration: 5 }) return diff --git a/src/index.js b/src/index.js index 208e800..87b94e7 100644 --- a/src/index.js +++ b/src/index.js @@ -79,7 +79,9 @@ GLOB.accessToken = {} GLOB.mkHS = false - if (config.externalDatabase + '' !== 'false' && config.externalDatabase !== undefined) { + if (sessionStorage.getItem('externalDatabase')) { + GLOB.externalDatabase = `[${sessionStorage.getItem('externalDatabase')}]..` + } else if (config.externalDatabase + '' !== 'false' && config.externalDatabase !== undefined) { GLOB.externalDatabase = config.externalDatabase ? `[${config.externalDatabase}]..` : '' } else { GLOB.externalDatabase = null diff --git a/src/locales/en-US/mob.js b/src/locales/en-US/mob.js deleted file mode 100644 index c5f7804..0000000 --- a/src/locales/en-US/mob.js +++ /dev/null @@ -1,27 +0,0 @@ -export default { - 'mob.login': '鐧诲綍', - 'mob.confirm': '纭畾', - 'mob.submit': '鎻愪氦', - 'mob.cancel': '鍙栨秷', - 'mob.edit': '缂栬緫', - 'mob.logout': '閫�鍑�', - 'mob.return': '杩斿洖', - 'mob.name': '鍚嶇О', - 'mob.param': '鍙傛暟', - 'mob.enable': '鍚�', - 'mob.disable': '鍋�', - 'mob.save': '淇濆瓨', - 'mob.style': 'Style', - 'mob.menu': '鑿滃崟', - 'mob.menu.first': '涓�绾�', - 'mob.menu.second': '浜岀骇', - 'mob.menu.opentype': '鎵撳紑鏂瑰紡', - 'mob.menu.easycode': '鍔╄鐮�', - 'mob.component': '缁勪欢', - 'mob.status.open': '鍚敤', - 'mob.status.change': '鍒囨崲', - 'mob.query.delete': '纭畾鍒犻櫎鍚楋紵', - 'mob.logout.hint': '鎮ㄧ‘瀹氳閫�鍑哄悧?', - 'mob.required.input': '璇疯緭鍏�', - 'mob.required.select': '璇烽�夋嫨', -} \ No newline at end of file diff --git a/src/locales/en-US/model.js b/src/locales/en-US/model.js deleted file mode 100644 index 644baf0..0000000 --- a/src/locales/en-US/model.js +++ /dev/null @@ -1,162 +0,0 @@ -export default { - 'model.confirm': 'Ok', - 'model.submit': 'Submit', - 'model.delete': 'Delete', - 'model.cancel': 'Cancel', - 'model.edit': 'Edit', - 'model.copy': 'Copy', - 'model.back': 'Return', - 'model.save': 'Save', - 'model.notsave': 'Don\'t save', - 'model.close': 'Close', - 'model.notclose': 'Don\'t close', - 'header.reset': 'Reset', - 'model.enable': 'Enable', - 'model.disable': 'Disable', - 'model.required': 'Required', - 'model.import': 'Import ', - 'model.export': 'Export ', - 'model.hidden': 'Hidden', - 'model.length': 'Length', - 'model.sort': 'Sort', - 'model.true': 'True', - 'model.false': 'False', - 'model.add': 'Add ', - 'model.batchAdd': 'BatchAdd', - 'model.update': 'Update ', - 'model.thaw': 'Thaw ', - 'model.menu': 'Menu ', - 'model.name': 'Name', - 'model.icon': 'Icon', - 'model.param': 'Param', - 'model.super': 'The superior ', - 'model.openway': 'Open ', - 'model.new': 'New ', - 'model.window': 'Window', - 'model.empty': 'Empty', - 'model.pay': 'Pay', - 'model.operation': 'Action', - 'model.switch.open': 'Open', - 'model.switch.close': 'Close', - 'model.menu.level1': 'Level 1 menu', - 'model.menu.level2': 'Level 2 menu', - 'model.menu.level3': 'Level 3 menu', - 'model.menu.basemsg': 'Please complete the basic information !', - 'header.menu.basedata': 'The basic information', - 'header.menu.table.add': 'Add tables', - 'header.menu.config.placeholder': 'Configuration has been modified, do you want to save configuration information ?', - 'header.menu.config.notsave': 'The menu has not been saved, please save the menu configuration first锛�', - 'header.menu.config.update': 'Menu configuration has been modified, please save锛�', - 'header.menu.form': 'The form', - 'header.menu.group.add': 'Add a group', - 'header.menu.search': 'Search', - 'header.menu.action': 'Button', - 'header.menu.column': 'Column', - 'header.menu.tabName': 'Tag name', - 'header.menu.Remark': 'Note', - 'header.menu.tab': 'Tab', - 'model.menu.tab.subtable': 'Child table', - 'header.menu.datasource': 'The data source', - 'header.menu.maintable': 'The main table', - 'header.menu.query': 'The query', - 'header.form.modal.placeholder': 'Please add the form', - 'model.form.width': 'Width', - 'header.form.title': 'Title', - 'model.form.field': 'Field', - 'header.form.innerFunc': 'Internal func', - 'header.form.outerFunc': 'External function', - 'header.form.callbackFunc': 'Callback function', - 'model.form.afterSuccess': 'Success', - 'model.form.afterError': 'Failure', - 'header.form.refresh': 'Refresh', - 'header.form.refresh.never': 'Don\'t refresh', - 'header.form.refresh.grid': 'Refresh the table', - 'header.form.popClose': 'Label closing', - 'header.form.toolbar': 'The toolbar', - 'header.form.grid': 'Table', - 'header.form.intertype': 'Interface type', - 'header.form.interface': 'Address of the interface', - 'header.form.sysInterface': 'The system interface', - 'model.interface.system': '绯荤粺', - 'model.interface.inner': 'Internal', - 'model.interface.outer': 'External', - 'header.form.pageTemplate': 'The page template', - 'model.form.type': 'Type', - 'model.form.text': 'Text', - 'header.form.description': '鎻忚堪', - 'model.form.textarea': 'Multiline text', - 'header.form.funcvar': '鍑芥暟鍙橀噺', - 'model.form.picture': 'Picture', - 'model.form.number': 'Number', - 'header.form.letter': '瀛楁瘝', - 'model.form.colspan': 'The columns of the merger', - 'model.form.select': 'Select', - 'model.form.multiselect': 'Multi-select', - 'model.form.href': 'Link', - 'model.form.link': 'Linkage menu', - 'model.form.linkform': 'Linkage form', - 'model.form.datemonth': 'Date(Month)', - 'model.form.daterange': 'Date(Range)', - 'model.form.dategroup': 'Date(Group)', - 'header.form.initval': 'Initial Value', - 'header.form.decimal': '灏忔暟浣�', - 'header.form.format': '鏍煎紡鍖�', - 'header.form.prefix': '鍓嶇紑', - 'header.form.postfix': '鍚庣紑', - 'header.form.isRequired': '琛岃缃�', - 'header.form.notRequired': '涓嶉�夋嫨琛�', - 'header.form.requiredSgl': '閫夋嫨鍗曡', - 'header.form.required': '閫夋嫨澶氳', - 'header.form.requiredOnce': '澶氳鎷兼帴', - 'header.form.openType': '鎵撳紑鏂瑰紡', - 'header.form.pop': '寮圭獥', - 'model.form.popform': 'Popup form', - 'model.form.popview': 'Pop-up tag', - 'model.form.tab': 'The tag page', - 'header.form.linkTab': '鍏宠仈鏍囩', - 'header.form.subTab': '涓嬬骇鏍囩', - 'header.form.supTab': '涓婄骇鏍囩', - 'header.form.equalTab': '鍚岀骇鏍囩', - 'header.form.currenttab': '褰撳墠鑿滃崟', - 'model.form.excelIn': 'Import excel', - 'model.form.excelOut': 'Export excel', - 'model.form.newpage': 'The new page', - 'model.form.newpage.type': 'Page type', - 'model.pageUrl': 'Page address', - 'model.form.prompt': 'Prompt', - 'model.form.exec': 'Direct execution', - 'model.form.paramJoint': 'Joint param', - 'model.form.align': 'Alignment', - 'model.form.alignLeft': 'The left', - 'model.form.alignRight': 'The Right', - 'model.form.alignCenter': 'The center', - 'model.form.columnWidth': 'Column width', - 'header.form.custom': '鑷畾涔�', - 'header.form.datasource': '鏁版嵁婧�', - 'model.form.tablename': 'Table name', - 'header.form.action.type': '鎿嶄綔绫诲瀷', - 'header.form.action.insert': '娣诲姞', - 'header.form.action.update': '淇敼', - 'header.form.action.audit': '瀹℃牳', - 'header.form.match': '鍖归厤妯″紡', - 'header.form.matchVal': '鍖归厤鍊�', - 'header.form.asc': '姝e簭', - 'header.form.desc': '鍊掑簭', - 'header.form.dropdown': '涓嬫媺鑿滃崟', - 'header.form.button': '鎸夐挳', - 'model.form.style': '椋庢牸', - 'model.form.color': 'Color', - 'model.query.delete': '纭畾鍒犻櫎鍚�?', - 'header.form.status.change': '鐘舵�佸垏鎹�', - 'model.form.funcbutton': 'Function button', - 'model.form.execMode': 'Mode', - 'header.form.paste': '绮樿创', - 'header.form.ratio': '姣斾緥', - 'header.form.blacklist': '榛戝悕鍗�', - 'model.form.linkmenu': 'Association', - 'model.action': '鎸夐挳', - 'form.required.input': 'Please enter the ', - 'form.required.select': 'Please select a ', - 'form.required.add': 'Please add ', - 'model.tooltip.func.innerface': '鍑芥暟鍚嶇О闇�浠ableField绛夊瓧绗﹀紑濮�;', -} \ No newline at end of file diff --git a/src/locales/zh-CN/mob.js b/src/locales/zh-CN/mob.js deleted file mode 100644 index 107ba2c..0000000 --- a/src/locales/zh-CN/mob.js +++ /dev/null @@ -1,27 +0,0 @@ -export default { - 'mob.login': '鐧诲綍', - 'mob.confirm': '纭畾', - 'mob.submit': '鎻愪氦', - 'mob.cancel': '鍙栨秷', - 'mob.edit': '缂栬緫', - 'mob.logout': '閫�鍑�', - 'mob.return': '杩斿洖', - 'mob.name': '鍚嶇О', - 'mob.param': '鍙傛暟', - 'mob.enable': '鍚�', - 'mob.disable': '鍋�', - 'mob.save': '淇濆瓨', - 'mob.style': '鏍峰紡', - 'mob.menu': '鑿滃崟', - 'mob.menu.first': '涓�绾�', - 'mob.menu.second': '浜岀骇', - 'mob.menu.opentype': '鎵撳紑鏂瑰紡', - 'mob.menu.easycode': '鍔╄鐮�', - 'mob.component': '缁勪欢', - 'mob.status.open': '鍚敤', - 'mob.status.change': '鍒囨崲', - 'mob.query.delete': '纭畾鍒犻櫎鍚楋紵', - 'mob.logout.hint': '鎮ㄧ‘瀹氳閫�鍑哄悧?', - 'mob.required.input': '璇疯緭鍏�', - 'mob.required.select': '璇烽�夋嫨', -} \ No newline at end of file diff --git a/src/locales/zh-CN/model.js b/src/locales/zh-CN/model.js deleted file mode 100644 index 518e6de..0000000 --- a/src/locales/zh-CN/model.js +++ /dev/null @@ -1,162 +0,0 @@ -export default { - 'model.confirm': '纭畾', - 'model.submit': '鎻愪氦', - 'model.delete': '鍒犻櫎', - 'model.cancel': '鍙栨秷', - 'model.edit': '缂栬緫', - 'model.copy': '澶嶅埗', - 'model.back': '杩斿洖', - 'model.save': '淇濆瓨', - 'model.notsave': '涓嶄繚瀛�', - 'model.close': '鍏抽棴', - 'model.notclose': '涓嶅叧闂�', - 'header.reset': '閲嶇疆', - 'model.enable': '鍚�', - 'model.disable': '鍋�', - 'model.required': '蹇呭~', - 'model.import': '瀵煎叆', - 'model.export': '瀵煎嚭', - 'model.hidden': '闅愯棌', - 'model.length': '闀垮害', - 'model.sort': '鎺掑簭', - 'model.true': '鏄�', - 'model.false': '鍚�', - 'model.add': '娣诲姞', - 'model.batchAdd': '鎵归噺娣诲姞', - 'model.update': '淇敼', - 'model.thaw': '瑙e喕', - 'model.menu': '鑿滃崟', - 'model.name': '鍚嶇О', - 'model.icon': '鍥炬爣', - 'model.param': '鍙傛暟', - 'model.super': '涓婄骇', - 'model.openway': '鎵撳紑鏂瑰紡', - 'model.new': '鏂�', - 'model.window': '绐楀彛', - 'model.empty': '绌�', - 'model.pay': '鏀粯', - 'model.operation': '鎿嶄綔', - 'model.switch.open': '寮�', - 'model.switch.close': '鍏�', - 'model.menu.level1': '涓�绾ц彍鍗�', - 'model.menu.level2': '浜岀骇鑿滃崟', - 'model.menu.level3': '涓夌骇鑿滃崟', - 'model.menu.basemsg': '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', - 'header.menu.basedata': '鍩烘湰淇℃伅', - 'header.menu.table.add': '娣诲姞琛ㄥ悕', - 'header.menu.config.placeholder': '閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛�', - 'header.menu.config.notsave': '鑿滃崟灏氭湭淇濆瓨锛岃鍏堜繚瀛樿彍鍗曢厤缃紒', - 'header.menu.config.update': '鑿滃崟閰嶇疆宸蹭慨鏀癸紝璇蜂繚瀛橈紒', - 'header.menu.form': '琛ㄥ崟', - 'header.menu.group.add': '娣诲姞鍒嗙粍', - 'header.menu.search': '鎼滅储', - 'header.menu.action': '鎸夐挳', - 'header.menu.column': '鏄剧ず鍒�', - 'header.menu.tabName': '鏍囩鍚嶇О', - 'header.menu.Remark': '澶囨敞', - 'header.menu.tab': '鏍囩椤�', - 'model.menu.tab.subtable': '瀛愯〃', - 'header.menu.datasource': '鏁版嵁鏉ユ簮', - 'header.menu.maintable': '涓昏〃', - 'header.menu.query': '鏌ヨ', - 'header.form.modal.placeholder': '璇锋坊鍔犺〃鍗�', - 'model.form.width': '瀹藉害', - 'header.form.title': '鏍囬', - 'model.form.field': '瀛楁', - 'header.form.innerFunc': '鍐呴儴鍑芥暟', - 'header.form.outerFunc': '澶栭儴鍑芥暟', - 'header.form.callbackFunc': '鍥炶皟鍑芥暟', - 'model.form.afterSuccess': '鎴愬姛鍚�', - 'model.form.afterError': '澶辫触鍚�', - 'header.form.refresh': '鍒锋柊', - 'header.form.refresh.never': '涓嶅埛鏂�', - 'header.form.refresh.grid': '鍒锋柊琛ㄦ牸', - 'header.form.popClose': '鍏抽棴鍚�', - 'header.form.toolbar': '宸ュ叿鏍�', - 'header.form.grid': '琛ㄦ牸', - 'header.form.intertype': '鎺ュ彛绫诲瀷', - 'header.form.interface': '鎺ュ彛鍦板潃', - 'header.form.sysInterface': '绯荤粺鎺ュ彛', - 'model.interface.system': '绯荤粺', - 'model.interface.inner': '鍐呴儴', - 'model.interface.outer': '澶栭儴', - 'header.form.pageTemplate': '椤甸潰妯℃澘', - 'model.form.type': '绫诲瀷', - 'model.form.text': '鏂囨湰', - 'header.form.description': '鎻忚堪', - 'model.form.textarea': '澶氳鏂囨湰', - 'header.form.funcvar': '鍑芥暟鍙橀噺', - 'model.form.picture': '鍥剧墖', - 'model.form.number': '鏁板瓧', - 'header.form.letter': '瀛楁瘝', - 'model.form.colspan': '鍚堝苟鍒�', - 'model.form.select': '涓嬫媺閫夋嫨', - 'model.form.multiselect': '涓嬫媺澶氶��', - 'model.form.href': '閾炬帴', - 'model.form.link': '鑱斿姩鑿滃崟', - 'model.form.linkform': '鍏宠仈琛ㄥ崟', - 'model.form.datemonth': '鏃ユ湡锛堟湀锛�', - 'model.form.daterange': '鏃ユ湡锛堝尯闂达級', - 'model.form.dategroup': '鏃ユ湡锛堢粍鍚堬級', - 'header.form.initval': '鍒濆鍊�', - 'header.form.decimal': '灏忔暟浣�', - 'header.form.format': '鏍煎紡鍖�', - 'header.form.prefix': '鍓嶇紑', - 'header.form.postfix': '鍚庣紑', - 'header.form.isRequired': '琛岃缃�', - 'header.form.notRequired': '涓嶉�夋嫨琛�', - 'header.form.requiredSgl': '閫夋嫨鍗曡', - 'header.form.required': '閫夋嫨澶氳', - 'header.form.requiredOnce': '澶氳鎷兼帴', - 'header.form.openType': '鎵撳紑鏂瑰紡', - 'header.form.pop': '寮圭獥', - 'model.form.popform': '寮圭獥锛堣〃鍗曪級', - 'model.form.popview': '寮圭獥锛堟爣绛撅級', - 'model.form.tab': '鏍囩椤�', - 'header.form.linkTab': '鍏宠仈鏍囩', - 'header.form.subTab': '涓嬬骇鏍囩', - 'header.form.supTab': '涓婄骇鏍囩', - 'header.form.equalTab': '鍚岀骇鏍囩', - 'header.form.currenttab': '褰撳墠鑿滃崟', - 'model.form.excelIn': '瀵煎叆Excel', - 'model.form.excelOut': '瀵煎嚭Excel', - 'model.form.newpage': '鏂伴〉闈�', - 'model.form.newpage.type': '椤甸潰绫诲瀷', - 'model.pageUrl': '椤甸潰鍦板潃', - 'model.form.prompt': '鎻愮ず妗�', - 'model.form.exec': '鐩存帴鎵ц', - 'model.form.paramJoint': '鎷兼帴鍙傛暟', - 'model.form.align': '瀵归綈鏂瑰紡', - 'model.form.alignLeft': '宸﹀榻�', - 'model.form.alignRight': '鍙冲榻�', - 'model.form.alignCenter': '灞呬腑', - 'model.form.columnWidth': '鍒楀', - 'header.form.custom': '鑷畾涔�', - 'header.form.datasource': '鏁版嵁婧�', - 'model.form.tablename': '琛ㄥ悕', - 'header.form.action.type': '鎿嶄綔绫诲瀷', - 'header.form.action.insert': '娣诲姞', - 'header.form.action.update': '淇敼', - 'header.form.action.audit': '瀹℃牳', - 'header.form.match': '鍖归厤妯″紡', - 'header.form.matchVal': '鍖归厤鍊�', - 'header.form.asc': '姝e簭', - 'header.form.desc': '鍊掑簭', - 'header.form.dropdown': '涓嬫媺鑿滃崟', - 'header.form.button': '鎸夐挳', - 'model.form.style': '椋庢牸', - 'model.form.color': '棰滆壊', - 'model.query.delete': '纭畾鍒犻櫎鍚�?', - 'header.form.status.change': '鐘舵�佸垏鎹�', - 'model.form.funcbutton': '鍔熻兘鎸夐挳', - 'model.form.execMode': '鎵ц鏂瑰紡', - 'header.form.paste': '绮樿创', - 'header.form.ratio': '姣斾緥', - 'header.form.blacklist': '榛戝悕鍗�', - 'model.form.linkmenu': '鍏宠仈鑿滃崟', - 'model.action': '鎸夐挳', - 'form.required.input': '璇疯緭鍏�', - 'form.required.select': '璇烽�夋嫨', - 'form.required.add': '璇锋坊鍔�', - 'model.tooltip.func.innerface': '鍑芥暟鍚嶇О闇�浠ableField绛夊瓧绗﹀紑濮�;', -} \ No newline at end of file diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index 0fc9a44..114c9ba 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -44,7 +44,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index 8964a75..fa8a097 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -30,7 +30,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, // 缁勪欢淇℃伅 formlist: PropTypes.any, // 琛ㄥ崟淇℃伅 card: PropTypes.any, // 鎸夐挳淇℃伅 @@ -361,7 +360,7 @@ rules: [ { required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, @@ -386,7 +385,7 @@ rules: [ { required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<TextArea autoSize={{minRows: 2}} disabled={item.readonly} placeholder={item.placeholder || ''} />)} @@ -406,7 +405,7 @@ initialValue: item.initVal, rules: [{ required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }] })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} </Form.Item> @@ -425,7 +424,7 @@ initialValue: item.initVal || '', rules: [{ required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' }] })( <Select @@ -458,7 +457,7 @@ initialValue: item.initVal || '', rules: [{ required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' }] })( <MkEditIcon /> @@ -479,7 +478,7 @@ initialValue: item.initVal, rules: [{ required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' }] })( <Radio.Group onChange={(e) => {this.onChange(e, item.key)}} disabled={item.readonly}> @@ -502,7 +501,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -529,7 +528,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -552,7 +551,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index ab7b202..02e8d29 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -1,8 +1,3 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - /** * @description 鑾峰彇鍏冪礌閰嶇疆淇℃伅 * @param {*} card @@ -535,15 +530,15 @@ { type: 'radio', key: 'joint', - label: Formdict['model.form.paramJoint'], + label: '鎷兼帴鍙傛暟', initVal: card.joint || 'true', required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -555,10 +550,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index c00048b..2cb20e5 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -3,8 +3,6 @@ import { is, fromJS } from 'immutable' import { Modal, Button } from 'antd' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import asyncComponent from '@/utils/asyncComponent' import { getCardCellForm } from './formconfig' import { getActionForm } from '@/menu/components/share/actioncomponent/formconfig' @@ -34,7 +32,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 @@ -293,8 +290,9 @@ } let ableField = usefulFields.join(', ') + let msg = `鍑芥暟鍚嶇О闇�浠�${ableField}绛夊瓧绗﹀紑濮�;` let functip = <div> - <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> + <p style={{marginBottom: '5px'}}>{msg}</p> </div> let supId = '' @@ -465,11 +463,11 @@ */ deleteElement = (card) => { const { cardCell, side } = this.props - const { dict, elements, appType } = this.state + const { elements, appType } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + '鍏冪礌鍚楋紵', + content: '纭畾鍒犻櫎鍏冪礌鍚楋紵', onOk() { let _elements = elements.filter(item => item.uuid !== card.uuid) @@ -642,14 +640,12 @@ getVerify = (card) => { const { cards } = this.props - const { dict } = this.state if (!card) return null if (['pop', 'prompt', 'exec', 'form'].includes(card.OpenType)) { return <VerifyCard card={card} - dict={dict} config={cards} columns={cards.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} @@ -657,21 +653,18 @@ } else if (card.OpenType === 'excelIn') { return <VerifyExcelIn card={card} - dict={dict} columns={cards.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'excelOut') { return <VerifyExcelOut card={card} - dict={dict} config={cards} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') { return <VerifyPrint card={card} - dict={dict} columns={cards.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> @@ -680,7 +673,7 @@ render() { const { cards, cardCell } = this.props - const { elements, visible, actvisible, profVisible, card, dict, record } = this.state + const { elements, visible, actvisible, profVisible, card, record } = this.state return ( <div className="model-menu-card-cell-list"> @@ -709,7 +702,6 @@ destroyOnClose > <ElementForm - dict={dict} card={card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -725,14 +717,13 @@ maskClosable={false} onCancel={this.editModalCancel} footer={[ - record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, - <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" onClick={this.handleActionSubmit}>{dict['model.confirm']}</Button> + record && record.intertype === 'inner' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null, + <Button key="cancel" onClick={this.editModalCancel}>鍙栨秷</Button>, + <Button key="confirm" type="primary" onClick={this.handleActionSubmit}>纭畾</Button> ]} destroyOnClose > <ActionForm - dict={dict} type={cards.type === 'balcony' ? '' : 'card'} card={card} formlist={this.state.formlist} @@ -748,7 +739,7 @@ visible={profVisible} width={'90vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { if (this.verifyRef.handleCancel) { diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 97156e8..74ab7e1 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -51,7 +51,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: true, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: true, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx index e79cbe6..d379bfc 100644 --- a/src/menu/components/card/prop-card/index.jsx +++ b/src/menu/components/card/prop-card/index.jsx @@ -49,7 +49,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: true, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/menu/components/card/table-card/index.jsx b/src/menu/components/card/table-card/index.jsx index 0775056..6f24dab 100644 --- a/src/menu/components/card/table-card/index.jsx +++ b/src/menu/components/card/table-card/index.jsx @@ -50,7 +50,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: true, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 12, search: [], name: card.name, diff --git a/src/menu/components/carousel/data-card/index.jsx b/src/menu/components/carousel/data-card/index.jsx index 9d5f891..d4af996 100644 --- a/src/menu/components/carousel/data-card/index.jsx +++ b/src/menu/components/carousel/data-card/index.jsx @@ -46,7 +46,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/menu/components/carousel/prop-card/index.jsx b/src/menu/components/carousel/prop-card/index.jsx index 2c55db0..bb43d43 100644 --- a/src/menu/components/carousel/prop-card/index.jsx +++ b/src/menu/components/carousel/prop-card/index.jsx @@ -47,7 +47,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index 8a3a691..432e43f 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -1,8 +1,3 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - /** * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 * @param {object} card // 鍥捐〃瀵硅薄 @@ -368,10 +363,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.jsx b/src/menu/components/chart/antv-bar/chartcompile/index.jsx index 70b73e8..7feda4a 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/index.jsx @@ -17,7 +17,6 @@ class LineChartDrawerForm extends Component { static propTpyes = { - dict: PropTypes.object, plot: PropTypes.object, config: PropTypes.object, plotchange: PropTypes.func @@ -365,7 +364,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.onSubmit}/>)} @@ -386,7 +385,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.onSubmit}/>)} @@ -407,7 +406,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -436,7 +435,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -787,7 +786,7 @@ {config.name ? <div className="mk-com-name">{config.name} - 缂栬緫</div> : null} <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}> <TabPane tab="缁勪欢璁剧疆" key="base"> - <NormalForm dict={this.props.dict} formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> + <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> </TabPane> <TabPane tab="鍥捐〃璁剧疆" key="normal"> <Form {...formItemLayout}> @@ -816,7 +815,7 @@ </Form.Item> </Form> </Col> : null} - {datatype === 'statistics' ? <Button className="color-add mk-green" onClick={this.addColor}>{this.props.dict['model.add']}</Button> : null} + {datatype === 'statistics' ? <Button className="color-add mk-green" onClick={this.addColor}>娣诲姞</Button> : null} {datatype === 'statistics' ? <EditTable actions={['edit', 'move', 'del']} data={plot.colors || []} columns={ramp ==='true' ? rampStatColorColumns : statColorColumns} onChange={this.changeColor}/> : null} {datatype !== 'statistics' ? <EditTable actions={['edit']} data={plot.colors || []} columns={ramp ==='true' ? rampColorColumns : colorColumns} onChange={this.changeColor}/> : null} </div> diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index ca91e00..51de3eb 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -12,8 +12,6 @@ import { resetStyle, getTables } from '@/utils/utils-custom.js' import Utils from '@/utils/utils.js' import { chartColors } from '@/utils/option.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) @@ -33,7 +31,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, appType: sessionStorage.getItem('appType'), eventListener: null @@ -75,7 +72,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: card.type === 'bar' ? true : false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: _plot.width, name: _plot.name, subtype: card.subtype, @@ -671,7 +667,7 @@ } view1.axis('value', yc) - view1.legend(false) + // view1.legend(false) if (plot.mutilBar !== 'stack') { let _chart = view1 @@ -798,7 +794,7 @@ view2.data(dv.rows) - view2.legend(false) + // view2.legend(false) fields.forEach(item => { if (item.chartType === 'bar' && !Bar_axis.length) { @@ -1363,7 +1359,7 @@ <div className="mk-popover-control"> {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null} {appType !== 'mob' ? <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton}/> : null} - <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> + <ChartCompileForm config={card} plotchange={this.updateComponent}/> <CopyComponent type="line" card={card}/> <PasteComponent config={card} options={['action', 'search']} updateConfig={this.updateComponent} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> diff --git a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx index f60d210..453f22e 100644 --- a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx @@ -1,8 +1,3 @@ -// import zhCN from '@/locales/zh-CN/model.js' -// import enUS from '@/locales/en-US/model.js' - -// const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - /** * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 * @param {object} card // 鍥捐〃瀵硅薄 diff --git a/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx b/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx index 1bc8301..dd69b91 100644 --- a/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-dashboard/chartcompile/index.jsx @@ -17,7 +17,6 @@ class LineChartDrawerForm extends Component { static propTpyes = { - dict: PropTypes.object, plot: PropTypes.object, config: PropTypes.object, plotchange: PropTypes.func @@ -88,7 +87,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.onSubmit}/>)} @@ -109,7 +108,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.onSubmit}/>)} @@ -130,7 +129,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -159,7 +158,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -311,7 +310,7 @@ {config.name ? <div className="mk-com-name">{config.name} - 缂栬緫</div> : null} <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}> <TabPane tab="缁勪欢璁剧疆" key="base"> - <NormalForm dict={this.props.dict} formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> + <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> </TabPane> <TabPane tab="鍥捐〃璁剧疆" key="normal"> <Form {...formItemLayout}> @@ -320,7 +319,7 @@ </TabPane> {plot ? <TabPane tab="棰滆壊璁剧疆" key="color"> <div> - <Button className="color-add mk-green" onClick={this.addColor}>{this.props.dict['model.add']}</Button> + <Button className="color-add mk-green" onClick={this.addColor}>娣诲姞</Button> <EditTable actions={['edit', 'move', 'del']} data={plot.colors || []} columns={colorColumns} onChange={this.changeColor}/> </div> </TabPane> : null} diff --git a/src/menu/components/chart/antv-dashboard/index.jsx b/src/menu/components/chart/antv-dashboard/index.jsx index 2e5d021..b05efaa 100644 --- a/src/menu/components/chart/antv-dashboard/index.jsx +++ b/src/menu/components/chart/antv-dashboard/index.jsx @@ -9,8 +9,6 @@ import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' import { resetStyle, getTables } from '@/utils/utils-custom.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) @@ -65,7 +63,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, appType: sessionStorage.getItem('appType'), eventListener: null @@ -118,7 +115,6 @@ format: card.subtype === 'ratioboard' ? 'array' : 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: _plot.width, name: _plot.name, subtype: card.subtype, @@ -538,7 +534,7 @@ <div className="menu-dashboard-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> + <ChartCompileForm config={card} plotchange={this.updateComponent}/> <CopyComponent type="dashboard" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <ClockComponent config={card} updateConfig={this.updateComponent}/> diff --git a/src/menu/components/chart/antv-pie/chartcompile/index.jsx b/src/menu/components/chart/antv-pie/chartcompile/index.jsx index e1a7d47..1a2ad2d 100644 --- a/src/menu/components/chart/antv-pie/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-pie/chartcompile/index.jsx @@ -17,7 +17,6 @@ class LineChartDrawerForm extends Component { static propTpyes = { - dict: PropTypes.object, plot: PropTypes.object, config: PropTypes.object, plotchange: PropTypes.func @@ -114,7 +113,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.onSubmit}/>)} @@ -135,7 +134,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.onSubmit}/>)} @@ -156,7 +155,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -185,7 +184,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -337,7 +336,7 @@ {config.name ? <div className="mk-com-name">{config.name} - 缂栬緫</div> : null} <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}> <TabPane tab="缁勪欢璁剧疆" key="base"> - <NormalForm dict={this.props.dict} formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> + <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> </TabPane> <TabPane tab="鍥捐〃璁剧疆" key="normal"> <Form {...formItemLayout}> @@ -346,7 +345,7 @@ </TabPane> {plot ? <TabPane tab="棰滆壊璁剧疆" key="color"> <div> - <Button className="color-add mk-green" onClick={this.addColor}>{this.props.dict['model.add']}</Button> + <Button className="color-add mk-green" onClick={this.addColor}>娣诲姞</Button> <EditTable actions={['edit', 'move', 'del']} data={plot.colors || []} columns={colorColumns} onChange={this.changeColor}/> </div> </TabPane> : null} diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx index 88d312e..d8aa2b3 100644 --- a/src/menu/components/chart/antv-pie/index.jsx +++ b/src/menu/components/chart/antv-pie/index.jsx @@ -11,8 +11,6 @@ import asyncIconComponent from '@/utils/asyncIconComponent' import { resetStyle, getTables } from '@/utils/utils-custom.js' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) @@ -30,7 +28,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, appType: sessionStorage.getItem('appType'), eventListener: null @@ -68,7 +65,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: _plot.width, name: _plot.name, subtype: card.subtype, @@ -696,7 +692,7 @@ <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null} - <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> + <ChartCompileForm config={card} plotchange={this.updateComponent}/> <CopyComponent type="pie" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <ClockComponent config={card} updateConfig={this.updateComponent}/> diff --git a/src/menu/components/chart/antv-scatter/chartcompile/index.jsx b/src/menu/components/chart/antv-scatter/chartcompile/index.jsx index d618b15..245d259 100644 --- a/src/menu/components/chart/antv-scatter/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-scatter/chartcompile/index.jsx @@ -14,7 +14,6 @@ class LineChartDrawerForm extends Component { static propTpyes = { - dict: PropTypes.object, plot: PropTypes.object, config: PropTypes.object, plotchange: PropTypes.func @@ -66,7 +65,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.onSubmit}/>)} @@ -87,7 +86,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.onSubmit}/>)} @@ -108,7 +107,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -137,7 +136,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -256,7 +255,7 @@ {config.name ? <div className="mk-com-name">{config.name} - 缂栬緫</div> : null} <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}> <TabPane tab="缁勪欢璁剧疆" key="base"> - <NormalForm dict={this.props.dict} formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> + <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> </TabPane> <TabPane tab="鍥捐〃璁剧疆" key="normal"> <Form {...formItemLayout}> diff --git a/src/menu/components/chart/antv-scatter/index.jsx b/src/menu/components/chart/antv-scatter/index.jsx index 21f09bc..bfc607a 100644 --- a/src/menu/components/chart/antv-scatter/index.jsx +++ b/src/menu/components/chart/antv-scatter/index.jsx @@ -10,8 +10,6 @@ import asyncIconComponent from '@/utils/asyncIconComponent' import { resetStyle, getTables } from '@/utils/utils-custom.js' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) @@ -31,7 +29,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, appType: sessionStorage.getItem('appType'), eventListener: null @@ -62,7 +59,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: _plot.width, name: _plot.name, subtype: card.subtype, @@ -382,7 +378,7 @@ <div className="mk-popover-control"> {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null} {appType !== 'mob' ? <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton}/> : null} - <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> + <ChartCompileForm config={card} plotchange={this.updateComponent}/> <CopyComponent type="line" card={card}/> <PasteComponent config={card} options={['action', 'search']} updateConfig={this.updateComponent}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> diff --git a/src/menu/components/chart/chart-custom/chartcompile/index.jsx b/src/menu/components/chart/chart-custom/chartcompile/index.jsx index fd2e219..5ab0fa2 100644 --- a/src/menu/components/chart/chart-custom/chartcompile/index.jsx +++ b/src/menu/components/chart/chart-custom/chartcompile/index.jsx @@ -14,7 +14,6 @@ class CustomChartDrawerForm extends Component { static propTpyes = { - dict: PropTypes.object, plot: PropTypes.object, config: PropTypes.object, plotchange: PropTypes.func @@ -105,7 +104,7 @@ {config.name ? <div className="mk-com-name">{config.name} - 缂栬緫</div> : null} <Tabs activeKey={view} onChange={this.changeTab}> <TabPane tab="缁勪欢璁剧疆" key="base"> - <NormalForm dict={this.props.dict} formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> + <NormalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> </TabPane> {plot ? <TabPane tab="JS" key="JS"> {plot.chartType === 'antv' ? <div>鍏ュ弬锛欳hart銆� DataSet銆� wrap锛坉om鑺傜偣锛夈�乨ata銆� config</div> : <div>鍏ュ弬锛歟charts銆� DataSet銆� wrap锛坉om鑺傜偣锛夈�� data銆� config</div>} diff --git a/src/menu/components/chart/chart-custom/index.jsx b/src/menu/components/chart/chart-custom/index.jsx index ea9e578..4a1590c 100644 --- a/src/menu/components/chart/chart-custom/index.jsx +++ b/src/menu/components/chart/chart-custom/index.jsx @@ -12,8 +12,6 @@ import asyncIconComponent from '@/utils/asyncIconComponent' import { resetStyle, getTables } from '@/utils/utils-custom.js' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) @@ -30,7 +28,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, appType: sessionStorage.getItem('appType'), } @@ -55,7 +52,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: _plot.width, name: _plot.name, subtype: card.subtype, @@ -262,7 +258,7 @@ <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null} - <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> + <ChartCompileForm config={card} plotchange={this.updateComponent}/> <CopyComponent type="line" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <ClockComponent config={card} updateConfig={this.updateComponent}/> diff --git a/src/menu/components/code/sandbox/editorcode/index.jsx b/src/menu/components/code/sandbox/editorcode/index.jsx index a1de4bf..45acab3 100644 --- a/src/menu/components/code/sandbox/editorcode/index.jsx +++ b/src/menu/components/code/sandbox/editorcode/index.jsx @@ -4,8 +4,6 @@ import { Modal, Tabs, message } from 'antd' import { FormOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -19,7 +17,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, html: '', css: '', @@ -75,7 +72,7 @@ } render () { - const { visible, dict, html, css, js } = this.state + const { visible, html, css, js } = this.state return ( <div style={{display: 'inline-block'}}> @@ -86,7 +83,7 @@ visible={visible} width={950} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose diff --git a/src/menu/components/code/sandbox/index.jsx b/src/menu/components/code/sandbox/index.jsx index 4e713af..4f4d644 100644 --- a/src/menu/components/code/sandbox/index.jsx +++ b/src/menu/components/code/sandbox/index.jsx @@ -9,8 +9,6 @@ import { resetStyle } from '@/utils/utils-custom.js' import MKEmitter from '@/utils/events.js' import getWrapForm from './options' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' @@ -29,7 +27,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, back: false } @@ -43,7 +40,6 @@ type: card.type, tabId: card.tabId || '', parentId: card.parentId || '', - dataName: card.dataName || '', format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� diff --git a/src/menu/components/editor/braft-editor/editorcontent/index.jsx b/src/menu/components/editor/braft-editor/editorcontent/index.jsx index 40aa871..b6a6afc 100644 --- a/src/menu/components/editor/braft-editor/editorcontent/index.jsx +++ b/src/menu/components/editor/braft-editor/editorcontent/index.jsx @@ -4,8 +4,6 @@ import { Modal } from 'antd' import { FormOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -18,7 +16,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, html: null } @@ -54,7 +51,7 @@ render () { const { config } = this.props - const { visible, dict, html } = this.state + const { visible, html } = this.state if (!config) return null @@ -68,7 +65,7 @@ visible={visible} width={950} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx index 4949f0c..bcb095f 100644 --- a/src/menu/components/editor/braft-editor/index.jsx +++ b/src/menu/components/editor/braft-editor/index.jsx @@ -41,7 +41,6 @@ type: card.type, tabId: card.tabId || '', parentId: card.parentId || '', - dataName: card.dataName || '', format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� diff --git a/src/menu/components/form/formaction/actionform/index.jsx b/src/menu/components/form/formaction/actionform/index.jsx index 306130a..b67cad8 100644 --- a/src/menu/components/form/formaction/actionform/index.jsx +++ b/src/menu/components/form/formaction/actionform/index.jsx @@ -11,7 +11,6 @@ class ActionForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, // 琛ㄥ崟淇℃伅 card: PropTypes.any, // 鎸夐挳淇℃伅 inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -255,7 +254,7 @@ rules: [ { required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, ..._rules ] @@ -285,7 +284,7 @@ rules: [ { required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={0} max={10000} precision={0} onPressEnter={this.handleSubmit}/>)} @@ -306,7 +305,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -341,7 +340,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -367,7 +366,7 @@ rules: [ { required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<TextArea rows={2} readOnly={item.readonly}/>)} @@ -388,7 +387,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx index f27f8b5..5295788 100644 --- a/src/menu/components/form/formaction/formconfig.jsx +++ b/src/menu/components/form/formaction/formconfig.jsx @@ -1,8 +1,3 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - /** * @description 鑾峰彇琛ㄥ崟鎸夐挳閰嶇疆淇℃伅 * @param {*} card 缂栬緫鎸夐挳 @@ -63,18 +58,18 @@ { type: 'radio', key: 'intertype', - label: Formdict['header.form.intertype'], + label: '鎺ュ彛绫诲瀷', initVal: card.intertype || 'system', required: true, options: [{ value: 'system', - text: Formdict['model.interface.system'] + text: '绯荤粺' }, { value: 'inner', - text: Formdict['model.interface.inner'] + text: '鍐呴儴' }, { value: 'outer', - text: Formdict['model.interface.outer'] + text: '澶栭儴' }, { value: 'custom', text: '鑷畾涔�' @@ -100,31 +95,31 @@ { type: 'radio', key: 'sqlType', - label: Formdict['header.form.action.type'], + label: '鎿嶄綔绫诲瀷', initVal: card.sqlType || '', required: true, options: [{ value: 'insert', - text: Formdict['header.form.action.insert'] + text: '娣诲姞' }, { value: 'update', - text: Formdict['header.form.action.update'] + text: '淇敼' }, { value: 'audit', - text: Formdict['header.form.action.audit'] + text: '瀹℃牳' }] }, { type: 'text', key: 'sql', - label: Formdict['model.form.tablename'], + label: '琛ㄥ悕', initVal: card.sql || tableName || '', required: true }, { type: 'text', key: 'innerFunc', - label: Formdict['header.form.innerFunc'], + label: '鍐呴儴鍑芥暟', initVal: card.innerFunc || '', tooltip: functip, fields: usefulFields, @@ -143,28 +138,28 @@ { type: 'text', key: 'url', - label: Formdict['model.pageUrl'], + label: '椤甸潰鍦板潃', initVal: card.url || '', required: true }, { type: 'radio', key: 'sysInterface', - label: Formdict['header.form.sysInterface'], + label: '绯荤粺鎺ュ彛', initVal: card.sysInterface || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'text', key: 'outerFunc', - label: Formdict['header.form.outerFunc'], + label: '澶栭儴鍑芥暟', initVal: card.outerFunc || '', required: false, readonly: false @@ -245,7 +240,7 @@ { type: 'text', key: 'callbackFunc', - label: Formdict['header.form.callbackFunc'], + label: '鍥炶皟鍑芥暟', initVal: card.callbackFunc || '', required: true, readonly: false diff --git a/src/menu/components/form/formaction/index.jsx b/src/menu/components/form/formaction/index.jsx index b5ac2d0..f0e70b2 100644 --- a/src/menu/components/form/formaction/index.jsx +++ b/src/menu/components/form/formaction/index.jsx @@ -4,8 +4,6 @@ import { Modal, Button, Popover } from 'antd' import { FontColorsOutlined, EditOutlined, ProfileOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import asyncComponent from '@/utils/asyncComponent' import { getActionForm } from './formconfig' import { resetStyle } from '@/utils/utils-custom.js' @@ -24,7 +22,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 @@ -89,8 +86,9 @@ } let ableField = usefulFields.join(', ') + let msg = `鍑芥暟鍚嶇О闇�浠�${ableField}绛夊瓧绗﹀紑濮�;` let functip = <div> - <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> + <p style={{marginBottom: '5px'}}>{msg}</p> </div> let supId = '' @@ -196,7 +194,7 @@ render() { const { group, config } = this.props - const { visible, profVisible, card, dict } = this.state + const { visible, profVisible, card } = this.state return ( <div className="mk-form-action"> @@ -227,19 +225,18 @@ </Popover> : null} {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} <Modal - title={dict['model.edit']} + title="缂栬緫" visible={visible} width={920} maskClosable={false} onCancel={this.editModalCancel} footer={[ - <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" onClick={this.handleActionSubmit}>{dict['model.confirm']}</Button> + <Button key="cancel" onClick={this.editModalCancel}>鍙栨秷</Button>, + <Button key="confirm" type="primary" onClick={this.handleActionSubmit}>纭畾</Button> ]} destroyOnClose > <ActionForm - dict={dict} card={card} setting={config.setting} formlist={this.state.formlist} @@ -253,7 +250,7 @@ visible={profVisible} width={'90vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { if (this.verifyRef.handleCancel) { @@ -270,7 +267,6 @@ > <VerifyCard card={{...group.subButton, modal: {fields: group.fields}}} - dict={dict} config={config} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} diff --git a/src/menu/components/form/simple-form/index.jsx b/src/menu/components/form/simple-form/index.jsx index 599291c..20e3704 100644 --- a/src/menu/components/form/simple-form/index.jsx +++ b/src/menu/components/form/simple-form/index.jsx @@ -13,8 +13,6 @@ import MKEmitter from '@/utils/events.js' import Utils from '@/utils/utils.js' import getWrapForm from './options' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) @@ -39,7 +37,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), card: null, back: false, @@ -63,7 +60,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, @@ -653,7 +649,7 @@ } render() { - const { card, dict, appType } = this.state + const { card, appType } = this.state return ( <div className="menu-simple-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> @@ -678,7 +674,7 @@ <PlusOutlined className="plus" title="娣诲姞琛ㄥ崟" onClick={this.addForm}/> <FieldsComponent config={card.subcards[0]} type="form" plusFields={this.plusFields} /> <span style={{color: 'red', marginLeft: '30px', cursor: 'pointer'}} onClick={this.clearGroup}>娓呯┖</span> - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(1)}>1鍒�</Button> : null} {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2鍒�</Button> : null} {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3鍒�</Button> : null} @@ -688,7 +684,6 @@ list={card.subcards[0].fields} setting={card.subcards[0].setting} showField={this.state.showField} - placeholder={dict['header.form.modal.placeholder']} handleList={this.handleList} handleForm={this.handleForm} closeForm={this.closeForm} @@ -717,7 +712,7 @@ </div> </div> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={950} maskClosable={false} @@ -727,7 +722,6 @@ destroyOnClose > <ModalForm - dict={this.state.dict} card={this.state.editform} formlist={this.state.formlist} inputSubmit={this.handleSubmit} diff --git a/src/menu/components/form/step-form/index.jsx b/src/menu/components/form/step-form/index.jsx index 00d3501..83e0c76 100644 --- a/src/menu/components/form/step-form/index.jsx +++ b/src/menu/components/form/step-form/index.jsx @@ -13,8 +13,6 @@ import MKEmitter from '@/utils/events.js' import Utils from '@/utils/utils.js' import getWrapForm from './options' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) @@ -39,7 +37,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), card: null, back: false, @@ -64,7 +61,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, @@ -736,7 +732,7 @@ } render() { - const { card, dict, group, appType } = this.state + const { card, group, appType } = this.state return ( <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> @@ -768,7 +764,7 @@ {group ? <div className="form-area"> <PlusOutlined className="plus" title="娣诲姞琛ㄥ崟" onClick={this.addForm}/> <FieldsComponent config={group} type="form" plusFields={this.plusFields} /> - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(1)}>1鍒�</Button> : null} {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2鍒�</Button> : null} {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3鍒�</Button> : null} @@ -778,7 +774,6 @@ list={group.fields} setting={group.setting} showField={this.state.showField} - placeholder={dict['header.form.modal.placeholder']} handleList={this.handleList} handleForm={this.handleForm} closeForm={this.closeForm} @@ -807,7 +802,7 @@ </div> </div> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={950} maskClosable={false} @@ -817,7 +812,6 @@ destroyOnClose > <ModalForm - dict={this.state.dict} card={this.state.editform} formlist={this.state.formlist} inputSubmit={this.handleSubmit} diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index a553bdc..bcc0621 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -13,8 +13,6 @@ import MKEmitter from '@/utils/events.js' import Utils from '@/utils/utils.js' import getWrapForm from '../step-form/options' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) @@ -39,7 +37,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), card: null, back: false, @@ -64,7 +61,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, @@ -762,7 +758,7 @@ } render() { - const { card, dict, group, appType } = this.state + const { card, group, appType } = this.state return ( <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> @@ -796,7 +792,7 @@ <PlusOutlined className="plus" title="娣诲姞琛ㄥ崟" onClick={this.addForm}/> <FieldsComponent config={group} type="form" plusFields={this.plusFields} /> <span style={{color: 'red', marginLeft: '30px', cursor: 'pointer'}} onClick={this.clearGroup}>娓呯┖</span> - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(1)}>1鍒�</Button> : null} {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2鍒�</Button> : null} {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3鍒�</Button> : null} @@ -806,7 +802,6 @@ list={group.fields} setting={group.setting} showField={this.state.showField} - placeholder={dict['header.form.modal.placeholder']} handleList={this.handleList} handleForm={this.handleForm} closeForm={this.closeForm} @@ -835,7 +830,7 @@ </div> </div> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={950} maskClosable={false} @@ -845,7 +840,6 @@ destroyOnClose > <ModalForm - dict={this.state.dict} card={this.state.editform} formlist={this.state.formlist} inputSubmit={this.handleSubmit} diff --git a/src/menu/components/group/groupcomponents/index.jsx b/src/menu/components/group/groupcomponents/index.jsx index 858b5b1..63e02b1 100644 --- a/src/menu/components/group/groupcomponents/index.jsx +++ b/src/menu/components/group/groupcomponents/index.jsx @@ -104,7 +104,6 @@ subtype: item.subtype, config: item.config, width: item.width || 24, - dataName: Utils.getdataName(), name: name, isNew: true // 鏂版坊鍔犳爣蹇楋紝鐢ㄤ簬鍒濆鍖� } diff --git a/src/menu/components/module/voucher/index.jsx b/src/menu/components/module/voucher/index.jsx index ccc29e7..7f230bd 100644 --- a/src/menu/components/module/voucher/index.jsx +++ b/src/menu/components/module/voucher/index.jsx @@ -35,7 +35,6 @@ type: card.type, tabId: card.tabId || '', parentId: card.parentId || '', - dataName: card.dataName || '', format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx index fc79218..d6250e4 100644 --- a/src/menu/components/search/main-search/index.jsx +++ b/src/menu/components/search/main-search/index.jsx @@ -7,8 +7,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getSearchForm } from '@/templates/zshare/formconfig' import { resetStyle } from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' @@ -34,7 +32,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), searchlist: null, // 鎼滅储鏉′欢闆� sqlVerifing: false, // sql楠岃瘉涓� @@ -318,11 +315,10 @@ * @description 鎼滅储鏉′欢鍒犻櫎 */ deleteElement = (cell) => { - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${cell.label} 锛焋, + content: `纭畾鍒犻櫎 - ${cell.label} 锛焋, onOk() { let _card = fromJS(_this.state.card).toJS() _card.search = _card.search.filter(item => item.uuid !== cell.uuid) @@ -406,13 +402,13 @@ } render() { - const { dict, card, visible, sqlVerifing, showField } = this.state + const { card, visible, sqlVerifing, showField } = this.state let _style = resetStyle(card.style) return ( <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> <FieldsComponent config={card} type="search" /> - <Switch checkedChildren={dict['model.switch.open']} size="small" unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> + <Switch checkedChildren="寮�" size="small" unCheckedChildren="鍏�" defaultChecked={showField} onChange={this.onFieldChange} /> <DragElement list={card.search} setting={card.wrap} @@ -447,7 +443,6 @@ destroyOnClose > <SearchForm - dict={dict} card={this.state.editcard} formlist={this.state.formlist} inputSubmit={this.handleSubmit} diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index eb99135..e01e193 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -26,7 +26,6 @@ class ActionForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� type: PropTypes.any, // type涓�"card"鏃讹紝鍙彲閫夊崟琛屾垨涓嶉�夎 setting: PropTypes.object, // 椤甸潰璁剧疆 formlist: PropTypes.any, // 琛ㄥ崟淇℃伅 @@ -77,13 +76,13 @@ record = {} UNSAFE_componentWillMount () { - const { type, dict } = this.props + const { type } = this.props let requireOptions = [ - { value: 'notRequired', text: dict['header.form.notRequired'] }, - { value: 'requiredSgl', text: dict['header.form.requiredSgl'] }, - { value: 'required', text: dict['header.form.required'] }, - { value: 'requiredOnce', text: dict['header.form.requiredOnce'] } + { value: 'notRequired', text: '涓嶉�夋嫨琛�' }, + { value: 'requiredSgl', text: '閫夋嫨鍗曡' }, + { value: 'required', text: '閫夋嫨澶氳' }, + { value: 'requiredOnce', text: '澶氳鎷兼帴' } ] if (type === 'card') { @@ -530,20 +529,20 @@ _fieldval.intertype = 'system' _fieldval.Ot = 'notRequired' - _fieldval.label = this.props.dict['model.form.excelIn'] + _fieldval.label = '瀵煎叆Excel' _fieldval.class = 'dgreen' this.record.Ot = 'notRequired' - this.record.label = this.props.dict['model.form.excelIn'] + this.record.label = '瀵煎叆Excel' this.record.class = 'dgreen' } else if (value === 'excelOut') { _fieldval.intertype = 'system' - _fieldval.label = this.props.dict['model.form.excelOut'] + _fieldval.label = '瀵煎嚭Excel' _fieldval.class = 'dgreen' _fieldval.execSuccess = 'never' this.record.Ot = 'notRequired' - this.record.label = this.props.dict['model.form.excelOut'] + this.record.label = '瀵煎嚭Excel' this.record.class = 'dgreen' this.record.execSuccess = 'never' @@ -568,10 +567,10 @@ } if (value === 'excelIn') { - _fieldval.label = this.props.dict['model.form.excelIn'] + _fieldval.label = '瀵煎叆Excel' _fieldval.class = 'dgreen' } else if (value === 'excelOut') { - _fieldval.label = this.props.dict['model.form.excelOut'] + _fieldval.label = '瀵煎嚭Excel' _fieldval.class = 'dgreen' _fieldval.control = '' this.record.control = '' @@ -701,7 +700,6 @@ } getFields() { - const { dict } = this.props const { getFieldDecorator } = this.props.form const fields = [] @@ -724,7 +722,7 @@ } if (item.type === 'text') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] if (item.key === 'innerFunc') { @@ -769,13 +767,13 @@ content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> } else if (item.type === 'number') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] content = <InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/> } else if (item.type === 'select') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] if (item.extendName) { @@ -810,7 +808,7 @@ } } else if (item.type === 'radio') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Radio.Group onChange={(e) => {this.optionChange(item.key, e.target.value)}}> @@ -818,7 +816,7 @@ </Radio.Group> } else if (item.type === 'checkbox') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Checkbox.Group> @@ -827,13 +825,13 @@ } else if (item.type === 'cascader') { initVal = item.initVal || [] rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Cascader options={item.options || []} expandTrigger="hover" placeholder=""/> } else if (item.type === 'icon') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <MkEditIcon options={['edit', 'hint', 'direction', 'normal', 'data']} allowClear/> @@ -841,7 +839,7 @@ span = 24 className = 'textarea' rules = [ - { required: item.readonly ? false : item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.readonly ? false : item.required, message: '璇疯緭鍏�' + item.label + '!' } ] content = <TextArea rows={2} readOnly={item.readonly}/> diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index a8f146a..5c1870c 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -1,8 +1,5 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { btnCustomClasses } from '@/utils/option.js' -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS /** * @description 鑾峰彇鎸夐挳琛ㄥ崟閰嶇疆淇℃伅 @@ -156,7 +153,7 @@ pageTemps = [ { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, { value: 'billprint', text: '鍗曟嵁鎵撳嵃' }, - { value: 'pay', text: Formdict['model.pay'] }, + { value: 'pay', text: '鏀粯' }, { value: 'custom', text: '閾炬帴' } ] } @@ -225,7 +222,7 @@ { type: 'select', key: 'OpenType', - label: Formdict['header.form.openType'], + label: '鎵撳紑鏂瑰紡', initVal: card.OpenType, required: true, options: opentypes @@ -273,24 +270,24 @@ { type: 'select', key: 'execMode', - label: Formdict['model.form.execMode'], + label: '鎵ц鏂瑰紡', initVal: card.execMode || 'exec', required: true, options: [{ value: 'exec', - text: Formdict['model.form.exec'] + text: '鐩存帴鎵ц' }, { value: 'prompt', - text: Formdict['model.form.prompt'] + text: '鎻愮ず妗�' }, { value: 'pop', - text: Formdict['model.form.popform'] + text: '寮圭獥锛堣〃鍗曪級' }] }, { type: 'radio', key: 'intertype', - label: Formdict['header.form.intertype'], + label: '鎺ュ彛绫诲瀷', initVal: card.intertype || 'system', required: true, options: [] @@ -329,7 +326,7 @@ { type: 'radio', key: 'sqlType', - label: Formdict['header.form.action.type'], + label: '鎿嶄綔绫诲瀷', initVal: card.sqlType || '', required: true, options: [] @@ -344,7 +341,7 @@ { type: 'text', key: 'innerFunc', - label: Formdict['header.form.innerFunc'], + label: '鍐呴儴鍑芥暟', initVal: card.innerFunc || '', tooltip: functip, fields: usefulFields, @@ -362,7 +359,7 @@ { type: 'select', key: 'pageTemplate', - label: Formdict['model.form.newpage.type'], + label: '椤甸潰绫诲瀷', initVal: card.pageTemplate || '', required: true, options: pageTemps @@ -387,28 +384,28 @@ { type: 'textarea', key: 'url', - label: Formdict['model.pageUrl'], + label: '椤甸潰鍦板潃', initVal: card.url || '', required: true }, { type: 'radio', key: 'sysInterface', - label: Formdict['header.form.sysInterface'], + label: '绯荤粺鎺ュ彛', initVal: card.sysInterface || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'text', key: 'outerFunc', - label: Formdict['header.form.outerFunc'], + label: '澶栭儴鍑芥暟', initVal: card.outerFunc || '', required: false, }, @@ -488,14 +485,14 @@ { type: 'text', key: 'callbackFunc', - label: Formdict['header.form.callbackFunc'], + label: '鍥炶皟鍑芥暟', initVal: card.callbackFunc || '', required: true }, { type: 'select', key: 'Ot', - label: Formdict['header.form.isRequired'], + label: '琛岃缃�', initVal: card.Ot || (card.sqlType === 'insert' ? 'notRequired' : 'requiredSgl'), required: true, options: [] @@ -503,13 +500,13 @@ { type: 'select', key: 'execSuccess', - label: Formdict['model.form.afterSuccess'], + label: '鎴愬姛鍚�', initVal: card.execSuccess || 'grid', tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆�', required: true, options: [{ value: 'never', - text: Formdict['header.form.refresh.never'] + text: '涓嶅埛鏂�' }, { value: 'line', text: '鍒锋柊琛�' @@ -526,13 +523,13 @@ { type: 'select', key: 'execError', - label: Formdict['model.form.afterError'], + label: '澶辫触鍚�', initVal: card.execError || 'never', tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮��', required: true, options: [{ value: 'never', - text: Formdict['header.form.refresh.never'] + text: '涓嶅埛鏂�' }, { value: 'line', text: '鍒锋柊琛�' @@ -548,12 +545,12 @@ { type: 'select', key: 'popClose', - label: Formdict['header.form.popClose'], + label: '鍏抽棴鍚�', initVal: card.popClose || 'never', required: true, options: [{ value: 'never', - text: Formdict['header.form.refresh.never'] + text: '涓嶅埛鏂�' }, { value: 'grid', text: '鍒锋柊褰撳墠缁勪欢' @@ -627,7 +624,7 @@ { type: 'icon', key: 'icon', - label: Formdict['model.icon'], + label: '鍥炬爣', initVal: card.icon, required: false, forbid: type === 'datacard' && appType === 'mob', // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽彧鏄剧ず鏂囧瓧 @@ -636,7 +633,7 @@ { type: 'select', key: 'class', - label: Formdict['model.form.color'], + label: '棰滆壊', initVal: card.class, tooltip: '姝ら鑹蹭负鎸夐挳鍒濆鍖栭鑹诧紝鍙湪鏍峰紡璋冩暣涓慨鏀广��', required: false, @@ -646,7 +643,7 @@ { type: 'radio', key: 'color', - label: Formdict['model.form.color'], + label: '棰滆壊', initVal: card.color || 'primary', required: false, forbid: (type !== 'datacard' || appType !== 'mob'), // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽彧鍙缃浐瀹氶鑹� @@ -670,21 +667,21 @@ { type: 'radio', key: 'joint', - label: Formdict['model.form.paramJoint'], + label: '鎷兼帴鍙傛暟', initVal: card.joint || 'true', required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'text', key: 'sheet', - label: Formdict['model.form.tablename'], + label: '琛ㄥ悕', initVal: card.sheet || setting.tableName || '', required: true }, @@ -696,10 +693,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -954,7 +951,7 @@ { type: 'text', key: 'field', - label: Formdict['model.form.field'], + label: '瀛楁', initVal: card.field || '', required: true, readonly: false diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index d7b3e7d..cbddcc2 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -4,8 +4,6 @@ import { Modal, notification, Button } from 'antd' import Utils, { FuncUtils } from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getActionForm } from './formconfig' import asyncSpinComponent from '@/utils/asyncSpinComponent' @@ -31,7 +29,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 @@ -163,8 +160,9 @@ } let ableField = usefulFields.join(', ') + let msg = `鍑芥暟鍚嶇О闇�浠�${ableField}绛夊瓧绗﹀紑濮�;` let functip = <div> - <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> + <p style={{marginBottom: '5px'}}>{msg}</p> </div> if (!ableField) { // 鏃犲瓧娈甸檺鍒� @@ -272,11 +270,11 @@ */ deleteElement = (card) => { const { config } = this.props - const { dict, appType } = this.state + const { appType } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, + content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { let _actionlist = fromJS(_this.state.actionlist).toJS() @@ -448,14 +446,12 @@ getVerify = (card) => { const { config } = this.props - const { dict } = this.state if (!card) return null if (['pop', 'prompt', 'exec'].includes(card.OpenType)) { return <VerifyCard card={card} - dict={dict} config={config} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} @@ -463,28 +459,24 @@ } else if (card.OpenType === 'excelIn') { return <VerifyExcelIn card={card} - dict={dict} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'excelOut') { return <VerifyExcelOut card={card} - dict={dict} config={config} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') { return <VerifyPrint card={card} - dict={dict} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'funcbutton' && card.funcType === 'megvii') { return <VerifyMegvii card={card} - dict={dict} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> @@ -493,7 +485,7 @@ render() { const { config } = this.props - const { actionlist, visible, appType, card, dict, profVisible, record } = this.state + const { actionlist, visible, appType, card, profVisible, record } = this.state return ( <div className={'model-menu-action-list length' + actionlist.length}> @@ -516,14 +508,13 @@ maskClosable={false} onCancel={this.editModalCancel} footer={[ - record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, - <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" onClick={this.handleSubmit}>{dict['model.confirm']}</Button> + record && record.intertype === 'inner' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null, + <Button key="cancel" onClick={this.editModalCancel}>鍙栨秷</Button>, + <Button key="confirm" type="primary" onClick={this.handleSubmit}>纭畾</Button> ]} destroyOnClose > <ActionForm - dict={dict} card={card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -538,7 +529,7 @@ visible={profVisible} width={'90vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { if (this.verifyRef.handleCancel) { diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index 7945663..84c2b73 100644 --- a/src/menu/components/share/markcomponent/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -9,8 +9,6 @@ import MarkForm from './markform' import MkIcon from '@/components/mk-icon' import { minkeIconSystem } from '@/utils/option.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import '@/assets/css/table.scss' import './index.scss' @@ -26,7 +24,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, marks: null, columns: null, visible: false, @@ -326,7 +323,7 @@ } render() { - const { marks, markColumns, visible, options, signs, dict } = this.state + const { marks, markColumns, visible, options, signs } = this.state return ( <div style={{display: 'inline-block'}}> @@ -337,12 +334,12 @@ visible={visible} width={'75vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.markSubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose > - <MarkForm field={this.props.field} dict={dict} signs={signs} columns={options} markChange={this.markChange}/> + <MarkForm field={this.props.field} signs={signs} columns={options} markChange={this.markChange}/> <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>娉細浠庝笂鍒颁笅锛屽尮閰嶇涓�涓鍚堟潯浠剁殑鏍囪銆�</Col> <EditTable actions={['edit', 'move', 'del']} data={marks} columns={markColumns} onChange={(marks) => this.setState({marks})}/> </Modal> diff --git a/src/menu/components/share/markcomponent/markform/index.jsx b/src/menu/components/share/markcomponent/markform/index.jsx index 2809114..f4adc4d 100644 --- a/src/menu/components/share/markcomponent/markform/index.jsx +++ b/src/menu/components/share/markcomponent/markform/index.jsx @@ -8,7 +8,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� field: PropTypes.any, columns: PropTypes.array, // 鍒楀悕闆嗗悎 signs: PropTypes.array, // 鏍囪绫诲瀷 @@ -53,7 +52,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮瀛楁!' + message: '璇烽�夋嫨瀵规瘮瀛楁!' } ] })( @@ -68,7 +67,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮鏂瑰紡!' + message: '璇烽�夋嫨瀵规瘮鏂瑰紡!' } ] })( @@ -100,7 +99,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '棰滆壊!' + message: '璇烽�夋嫨棰滆壊!' } ] })( @@ -115,7 +114,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鏍囪鏂瑰紡!' + message: '璇烽�夋嫨鏍囪鏂瑰紡!' } ] })( diff --git a/src/menu/components/share/normalform/index.jsx b/src/menu/components/share/normalform/index.jsx index f08205e..c8244d9 100644 --- a/src/menu/components/share/normalform/index.jsx +++ b/src/menu/components/share/normalform/index.jsx @@ -11,7 +11,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.array, // 琛ㄥ崟 inputSubmit: PropTypes.func // 鍥炶溅浜嬩欢 } diff --git a/src/menu/components/share/searchcomponent/index.jsx b/src/menu/components/share/searchcomponent/index.jsx index e03d2e9..3136358 100644 --- a/src/menu/components/share/searchcomponent/index.jsx +++ b/src/menu/components/share/searchcomponent/index.jsx @@ -7,8 +7,6 @@ import MKEmitter from '@/utils/events.js' import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getSearchForm } from '@/templates/zshare/formconfig' import SearchForm from '@/templates/sharecomponent/searchcomponent/searchform' @@ -24,7 +22,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, searchlist: null, // 鎼滅储鏉′欢闆� sqlVerifing: false, // sql楠岃瘉涓� visible: false, // 妯℃�佹鎺у埗 @@ -286,7 +283,7 @@ } render() { - const { dict, searchlist, visible, sqlVerifing } = this.state + const { searchlist, visible, sqlVerifing } = this.state return ( <div className={'model-custom-header-search-list search-length' + (searchlist.length)}> @@ -308,7 +305,6 @@ destroyOnClose > <SearchForm - dict={dict} card={this.state.card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} diff --git a/src/menu/components/share/usercomponent/index.jsx b/src/menu/components/share/usercomponent/index.jsx index 429e0a8..07c968b 100644 --- a/src/menu/components/share/usercomponent/index.jsx +++ b/src/menu/components/share/usercomponent/index.jsx @@ -8,8 +8,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' import options from '@/store/options.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import UserForm from './settingform' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -20,7 +18,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, loading: false, name: '', @@ -208,7 +205,7 @@ } render () { - const { visible, dict, loading, name } = this.state + const { visible, loading, name } = this.state return ( <div className="user-component-wrap"> @@ -223,7 +220,7 @@ onCancel={this.cancel} destroyOnClose > - <UserForm dict={dict} name={name} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/> + <UserForm name={name} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/> </Modal> </div> ) diff --git a/src/menu/components/share/usercomponent/settingform/index.jsx b/src/menu/components/share/usercomponent/settingform/index.jsx index d918739..cd66103 100644 --- a/src/menu/components/share/usercomponent/settingform/index.jsx +++ b/src/menu/components/share/usercomponent/settingform/index.jsx @@ -7,7 +7,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� name: PropTypes.string, // 缁勪欢鍚嶇О inputSubmit: PropTypes.func // 鍥炶溅浜嬩欢 } @@ -68,7 +67,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '缁勪欢鍚嶇О!' + message: '璇疯緭鍏ョ粍浠跺悕绉�!' }, { max: 15, diff --git a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx index 547c1c6..7630d36 100644 --- a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx @@ -1,8 +1,3 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - /** * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭� * @param {object} card // 鎼滅储鏉′欢瀵硅薄 @@ -40,19 +35,19 @@ let options = [{ value: 'text', - text: Formdict['model.form.text'] + text: '鏂囨湰' }, { value: 'number', - text: Formdict['model.form.number'] + text: '鏁板瓧' }, { value: 'picture', - text: Formdict['model.form.picture'] + text: '鍥剧墖' }, { value: 'link', - text: Formdict['model.form.href'] + text: '閾炬帴' }, { value: 'textarea', - text: Formdict['model.form.textarea'] + text: '澶氳鏂囨湰' }, { value: 'custom', text: '鑷畾涔夊垪' @@ -89,7 +84,7 @@ { type: 'select', key: 'type', - label: Formdict['model.form.type'], + label: '绫诲瀷', initVal: card.type, required: true, options: options @@ -97,7 +92,7 @@ { type: 'select', key: 'field', - label: Formdict['model.form.field'], + label: '瀛楁', initVal: card.field, required: true, options: fields @@ -105,7 +100,7 @@ { type: 'select', key: 'nameField', - label: Formdict['model.name'] + Formdict['model.form.field'], + label: '鍚嶇О瀛楁', initVal: card.nameField || '', required: false, options: [{uuid: 'empty', field: '', label: '绌�'}, ...fields] @@ -116,67 +111,67 @@ min: 20, max: 1000, decimal: 0, - label: Formdict['model.form.columnWidth'], + label: '鍒楀', initVal: card.Width || 120, required: true }, { type: 'radio', key: 'joint', - label: Formdict['model.form.paramJoint'], + label: '鎷兼帴鍙傛暟', initVal: card.joint || 'true', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Hide', - label: Formdict['model.hidden'], + label: '闅愯棌', initVal: card.Hide || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'IsSort', - label: Formdict['model.sort'], + label: '鎺掑簭', initVal: card.IsSort || (card.isSub ? 'false' : 'true'), required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Align', - label: Formdict['model.form.align'], + label: '瀵归綈鏂瑰紡', initVal: card.Align || 'left', required: true, options: [{ value: 'left', - text: Formdict['model.form.alignLeft'] + text: '宸﹀榻�' }, { value: 'center', - text: Formdict['model.form.alignCenter'] + text: '灞呬腑' }, { value: 'right', - text: Formdict['model.form.alignRight'] + text: '鍙冲榻�' }] }, { @@ -188,10 +183,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -203,10 +198,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -215,14 +210,14 @@ min: 0, max: 18, decimal: 0, - label: Formdict['header.form.decimal'], + label: '灏忔暟浣�', initVal: card.decimal || 0, required: true }, { type: 'select', key: 'format', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.format || 'none', options: [{ value: 'none', @@ -242,7 +237,7 @@ { type: 'select', key: 'textFormat', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.textFormat || 'none', options: [{ value: 'none', @@ -262,7 +257,7 @@ { type: 'text', key: 'prefix', - label: Formdict['header.form.prefix'], + label: '鍓嶇紑', initVal: card.prefix || '', required: false, readonly: false @@ -270,7 +265,7 @@ { type: 'text', key: 'postfix', - label: Formdict['header.form.postfix'], + label: '鍚庣紑', initVal: card.postfix || '', required: false, readonly: false @@ -319,10 +314,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -345,7 +340,7 @@ { type: appType === 'pc' ? 'select' : 'cascader', key: 'linkmenu', - label: Formdict['model.menu'], + label: '鑿滃崟', initVal: card.linkmenu || (appType === 'pc' ? '' : []), required: true, options: menulist, @@ -404,7 +399,7 @@ { type: 'multiselect', key: 'blacklist', - label: Formdict['header.form.blacklist'], + label: '榛戝悕鍗�', initVal: card.blacklist || [], required: false, options: roleList, diff --git a/src/menu/components/table/base-table/columns/editColumn/index.jsx b/src/menu/components/table/base-table/columns/editColumn/index.jsx index 907ebb2..cbb8ac4 100644 --- a/src/menu/components/table/base-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/base-table/columns/editColumn/index.jsx @@ -24,7 +24,6 @@ class NormalTableColumn extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� visible: PropTypes.bool, column: PropTypes.object, fields: PropTypes.array, @@ -188,7 +187,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, ...rules ] @@ -210,7 +209,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(item.unlimit ? <InputNumber onPressEnter={this.handleSubmit}/> : @@ -227,7 +226,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -261,7 +260,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -307,7 +306,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -334,7 +333,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<TextArea rows={2} disabled={item.readonly} placeholder={item.placeholder || ''}/>)} diff --git a/src/menu/components/table/base-table/columns/index.jsx b/src/menu/components/table/base-table/columns/index.jsx index f68b463..a928fa8 100644 --- a/src/menu/components/table/base-table/columns/index.jsx +++ b/src/menu/components/table/base-table/columns/index.jsx @@ -3,13 +3,11 @@ import { is, fromJS } from 'immutable' import { DndProvider, DragSource, DropTarget } from 'react-dnd' import { Table, Popover, Modal, message } from 'antd' -import { PlusOutlined, FileSyncOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons' +import { PlusOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -194,7 +192,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), tableId: '', data: [{uuid: Utils.getuuid()}], @@ -501,61 +498,6 @@ }) } - syncfield = () => { - const { fields } = this.state - let columns = fromJS(this.state.columns).toJS() - - columns = columns.filter(c => !c.origin) - - let keys = columns.map(col => col.field) - - fields.forEach(item => { - if (keys.includes(item.field)) return - - let cell = { uuid: Utils.getuuid(), label: item.label, field: item.field, Align: 'left', Hide: 'false', IsSort: 'true', Width: 120, blacklist: [], postfix: '', prefix: '', linkmenu: [], marks: [], perspective: 'linkmenu' } - - if (/Nvarchar|date/ig.test(item.datatype)) { - cell.type = 'text' - cell.rowspan = 'false' - cell.textFormat = 'none' - } else { - cell.type = 'number' - cell.format = 'none' - cell.sum = 'false' - cell.decimal = item.decimal || 0 - cell.Width = 80 - } - - columns.push(cell) - }) - - const _this = this - - confirm({ - content: '纭畾鍚屾瀛楁闆嗗悧锛�', - onOk() { - _this.setState({columns}, () => { - _this.props.updatecolumn({..._this.props.config, cols: columns}) - }) - }, - onCancel() {} - }) - } - - clear = () => { - const _this = this - - confirm({ - content: '纭畾娓呯┖鏄剧ず鍒楀悧锛�', - onOk() { - _this.setState({columns: []}, () => { - _this.props.updatecolumn({..._this.props.config, cols: []}) - }) - }, - onCancel() {} - }) - } - /** * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 */ @@ -567,7 +509,7 @@ render() { const { config } = this.props - const { fields, card, lineMarks, dict, tableId, appType } = this.state + const { fields, card, lineMarks, tableId, appType } = this.state const components = { header: { cell: DragableHeaderCol @@ -584,8 +526,6 @@ <div className="col-control"> <CopyOutlined title="澶嶅埗鏄剧ず鍒�" onClick={this.copycolumn} /> <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> - <FileSyncOutlined title="鍚屾瀛楁闆�" onClick={this.syncfield} /> - <DeleteOutlined title="娓呯┖鏄剧ず鍒�" onClick={this.clear}/> </div> <DndProvider> <Table @@ -608,7 +548,7 @@ /> {appType === 'mob' && config.setting.laypage !== 'fasle' ? <MobPagination /> : null} </DndProvider> - <EditColumn column={card} dict={dict} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> + <EditColumn column={card} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> </div> ) } diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx index a99bb1c..4979704 100644 --- a/src/menu/components/table/base-table/index.jsx +++ b/src/menu/components/table/base-table/index.jsx @@ -2,11 +2,10 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Popover } from 'antd' -import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' +import { EditOutlined, ToolOutlined, FontColorsOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' -import { resetStyle } from '@/utils/utils-custom.js' import MKEmitter from '@/utils/events.js' import getWrapForm from './options' import Utils from '@/utils/utils.js' @@ -17,16 +16,13 @@ const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const SearchComponent = asyncComponent(() => import('@/templates/sharecomponent/searchcomponent')) const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent')) -const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) -const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) const ColumnComponent = asyncComponent(() => import('./columns')) class TableCardEditComponent extends Component { static propTpyes = { card: PropTypes.object, - deletecomponent: PropTypes.func, updateConfig: PropTypes.func, } @@ -47,21 +43,18 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: true, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: true, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: Utils.getdataName(), - width: 24, search: [ { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text', match: 'like' }, - { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'select', match: 'equal' } + { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'select', match: '=' } ], action: [ { origin: true, uuid: Utils.getuuid(), label: '娣诲姞', intertype: 'system', OpenType: 'pop', execSuccess: 'grid', icon: 'plus', class: 'green', style: {color: 'rgb(255, 255, 255)', background: 'rgb(38, 194, 129)', marginRight: '15px'} }, { origin: true, uuid: Utils.getuuid(), label: '淇敼', intertype: 'system', OpenType: 'pop', execSuccess: 'grid', icon: 'form', class: 'purple', style: {color: 'rgb(255, 255, 255)', background: 'rgb(142, 68, 173)', marginRight: '15px'} }, { origin: true, uuid: Utils.getuuid(), label: '鍒犻櫎', intertype: 'system', OpenType: 'prompt', execSuccess: 'grid', Ot: 'required', icon: 'delete', class: 'danger', style: {color: 'rgb(255, 255, 255)', background: 'rgb(255, 77, 79)', marginRight: '15px'} } ], - name: card.name, subtype: card.subtype, setting: { interType: 'system' }, - wrap: { name: card.name, width: 24, bordered: 'true', tableType: 'checkbox', show: 'true' }, + wrap: { bordered: 'true', tableType: 'checkbox', show: 'true' }, style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' }, columns: [], @@ -72,52 +65,6 @@ ], scripts: [], isNew: true - } - - if (card.config) { - let config = fromJS(card.config).toJS() - - _card.wrap = config.wrap - _card.wrap.name = card.name - _card.style = config.style - _card.headerStyle = config.headerStyle - - _card.setting = config.setting - _card.columns = config.columns - _card.scripts = config.scripts - - let oriUids = {} - _card.action = config.action.map(item => { - let _uuid = Utils.getuuid() - oriUids[item.uuid] = _uuid - item.uuid = _uuid - return item - }) - _card.search = config.search.map(item => { - item.uuid = Utils.getuuid() - return item - }) - _card.cols = config.cols.map(col => { - col.uuid = Utils.getuuid() - if (col.type === 'colspan' && col.subcols) { - col = this.loopCol(col) - } else if (col.type === 'custom' && col.elements) { - col.elements = col.elements.map(cell => { - cell.uuid = Utils.getuuid() - return cell - }) - } else if (col.type === 'action' && col.elements) { - col.elements = col.elements.map(cell => { - cell.uuid = Utils.getuuid() - return cell - }) - } - return col - }) - - if (_card.wrap.doubleClick) { - _card.wrap.doubleClick = oriUids[_card.wrap.doubleClick] || '' - } } this.updateComponent(_card) @@ -186,9 +133,6 @@ * @description 鍗$墖琛屽灞備俊鎭洿鏂帮紙鏁版嵁婧愶紝鏍峰紡绛夛級 */ updateComponent = (card) => { - card.width = card.wrap.width - card.name = card.wrap.name - if (!window.GLOB.styling || !card.errors) { // 鏍峰紡淇敼鏃朵笉鍋氱瓫鏌� card.errors = [] @@ -271,7 +215,7 @@ style.fontSize = card.wrap.fontSize || 14 style.fontWeight = card.wrap.fontWeight || 'normal' - MKEmitter.emit('changeStyle', ['font1', 'background', 'border', 'padding', 'margin', 'shadow'], style, this.getStyle) + MKEmitter.emit('changeStyle', ['font1', 'padding', 'margin'], style, this.getStyle) } getStyle = (style) => { @@ -294,48 +238,6 @@ _card.wrap.fontWeight = fontWeight this.updateComponent(_card) - } - - addColumns = () => { - let card = fromJS(this.state.card).toJS() - - card.cols.push({ focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' }) - - this.setState({card}) - } - - addSearch = () => { - const { card } = this.state - - MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='}, 'simple') - } - - addButton = () => { - const { card } = this.state - - let newcard = {} - newcard.uuid = Utils.getuuid() - newcard.focus = true - - newcard.label = 'label' - newcard.sqlType = '' - newcard.Ot = 'requiredSgl' - newcard.OpenType = 'pop' - newcard.icon = '' - newcard.class = 'green' - newcard.intertype = card.setting.interType || 'system' - newcard.innerFunc = card.setting.innerFunc || '' - newcard.sysInterface = card.setting.sysInterface || '' - newcard.outerFunc = card.setting.outerFunc || '' - newcard.interface = card.setting.interface || '' - newcard.execSuccess = 'grid' - newcard.execError = 'never' - newcard.verify = null - newcard.show = 'button' - newcard.style = {marginRight: '15px'} - - // 娉ㄥ唽浜嬩欢-娣诲姞鎸夐挳 - MKEmitter.emit('addButton', card.uuid, newcard) } setSubConfig = (item) => { @@ -407,34 +309,20 @@ this.updateComponent({...card, wrap: res}) } - clickComponent = (e) => { - if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { - e.stopPropagation() - MKEmitter.emit('clickComponent', this.state.card) - } - } - render() { const { card } = this.state let options = ['action', 'search', 'form', 'cols'] - let _style = resetStyle(card.style) return ( - <div className="menu-normal-table-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> - <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/> + <div className="menu-base-table-edit-box" style={card.style} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <PlusOutlined className="plus" title="娣诲姞鍒�" onClick={this.addColumns}/> - <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> - <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton}/> <NormalForm title="琛ㄦ牸璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="normaltable" card={card}/> <PasteComponent config={card} options={options} updateConfig={this.updateComponent} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> - <UserComponent config={card}/> - <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> <SettingComponent config={card} updateConfig={this.updateComponent} /> </div> } trigger="hover"> @@ -443,20 +331,6 @@ <SearchComponent config={card} updatesearch={this.updateComponent}/> <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> <ColumnComponent config={card} updatecolumn={this.updateComponent}/> - <div className="component-name"> - <div className="center"> - <div className="title">{card.name}</div> - <div className="content"> - {card.errors && card.errors.map((err, index) => { - if (err.level === 0) { - return <span key={index} className="error">{err.detail}</span> - } else { - return <span key={index} className="waring">{err.detail}锛�</span> - } - })} - </div> - </div> - </div> </div> ) } diff --git a/src/menu/components/table/base-table/index.scss b/src/menu/components/table/base-table/index.scss index b558c2a..a58b3c1 100644 --- a/src/menu/components/table/base-table/index.scss +++ b/src/menu/components/table/base-table/index.scss @@ -1,4 +1,4 @@ -.menu-normal-table-edit-box { +.menu-base-table-edit-box { position: relative; box-sizing: border-box; background: #ffffff; @@ -80,13 +80,4 @@ .ant-btn.mk-link { padding: 0; } -} -.menu-normal-table-edit-box::after { - display: block; - content: ' '; - clear: both; -} -.menu-normal-table-edit-box:hover { - z-index: 1; - box-shadow: 0px 0px 4px #1890ff; } diff --git a/src/menu/components/table/base-table/options.jsx b/src/menu/components/table/base-table/options.jsx index c6caecc..6bf71d0 100644 --- a/src/menu/components/table/base-table/options.jsx +++ b/src/menu/components/table/base-table/options.jsx @@ -16,36 +16,36 @@ } const wrapForm = [ - { - type: 'text', - field: 'title', - label: '鏍囬', - initval: wrap.title || '', - required: false - }, - { - type: 'text', - field: 'name', - label: '缁勪欢鍚嶇О', - initval: wrap.name || '', - tooltip: '鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�', - required: true - }, - { - type: 'number', - field: 'width', - label: '瀹藉害', - initval: wrap.width || 24, - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', - min: 1, - max: 24, - precision: 0, - required: true - }, + // { + // type: 'text', + // field: 'title', + // label: '鏍囬', + // initval: wrap.title || '', + // required: false + // }, + // { + // type: 'text', + // field: 'name', + // label: '缁勪欢鍚嶇О', + // initval: wrap.name || '', + // tooltip: '鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�', + // required: true + // }, + // { + // type: 'number', + // field: 'width', + // label: '瀹藉害', + // initval: wrap.width || 24, + // tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + // min: 1, + // max: 24, + // precision: 0, + // required: true + // }, { type: 'number', field: 'height', - label: '楂樺害', + label: '琛ㄦ牸楂樺害', initval: wrap.height || '', tooltip: '琛ㄦ牸楂樺害锛岀┖鍊兼椂楂樺害鑷�傚簲銆�', min: 10, @@ -141,18 +141,18 @@ {value: 'always', label: '鏁版嵁鍔犺浇'}, ] }, - // { - // type: 'radio', - // field: 'show', - // label: '鎼滅储鎸夐挳', - // initval: wrap.show || 'true', - // tooltip: '鎼滅储鏉′欢瀛樺湪鏃讹紝鍙�夋嫨鏄惁鏄剧ず鎼滅储鎸夐挳銆�', - // required: false, - // options: [ - // {value: 'true', label: '鏄剧ず'}, - // {value: 'false', label: '闅愯棌'}, - // ] - // }, + { + type: 'radio', + field: 'mask', + label: '閬僵', + initval: wrap.mask || 'show', + tooltip: '鏁版嵁鍔犺浇鏃讹紝鏄惁鏄剧ず鍔犺浇涓殑閬僵銆�', + required: false, + options: [ + {value: 'show', label: '鏄剧ず'}, + {value: 'hidden', label: '闅愯棌'}, + ] + }, { type: 'color', field: 'borderColor', @@ -161,36 +161,6 @@ tooltip: '榛樿鍊� #e8e8e8銆�', required: false }, - // { - // type: 'color', - // field: 'color', - // label: '瀛椾綋棰滆壊', - // initval: wrap.color || 'rgba(0, 0, 0, 0.65)', - // tooltip: '榛樿鍊� rgba(0, 0, 0, 0.65)銆�', - // required: false - // }, - // { - // type: 'number', - // field: 'fontSize', - // label: '瀛椾綋澶у皬', - // initval: wrap.fontSize || 14, - // min: 12, - // max: 30, - // precision: 0, - // required: false - // }, - // { - // type: 'number', - // field: 'advanceWidth', - // label: '楂樼骇鎼滅储', - // initval: wrap.advanceWidth || 1000, - // tooltip: '楂樼骇鎼滅储寮圭獥鐨勫搴︼紝娉細褰撳搴﹀�煎皬浜�100鏃惰〃绀哄崰绐楀彛鐨勭櫨鍒嗘瘮锛屽ぇ浜�100鏃惰〃绀哄搴︾殑缁濆鍊笺��', - // min: 10, - // max: 3000, - // precision: 0, - // required: false, - // forbid: appType === 'mob' - // }, { type: 'select', field: 'doubleClick', diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index c830e47..bd69d85 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -1,8 +1,3 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - /** * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭� * @param {object} card // 鎼滅储鏉′欢瀵硅薄 @@ -80,7 +75,7 @@ { type: 'select', key: 'type', - label: Formdict['model.form.type'], + label: '绫诲瀷', initVal: card.type, required: true, options: options @@ -88,7 +83,7 @@ { type: 'select', key: 'field', - label: Formdict['model.form.field'], + label: '瀛楁', initVal: card.field, required: true, options: fields @@ -99,53 +94,53 @@ min: 20, max: 1000, precision: 0, - label: Formdict['model.form.columnWidth'], + label: '鍒楀', initVal: card.Width || 120, required: true }, { type: 'radio', key: 'Hide', - label: Formdict['model.hidden'], + label: '闅愯棌', initVal: card.Hide || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'IsSort', - label: Formdict['model.sort'], + label: '鎺掑簭', initVal: card.IsSort || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Align', - label: Formdict['model.form.align'], + label: '瀵归綈鏂瑰紡', initVal: card.Align || 'left', required: true, options: [{ value: 'left', - text: Formdict['model.form.alignLeft'] + text: '宸﹀榻�' }, { value: 'center', - text: Formdict['model.form.alignCenter'] + text: '灞呬腑' }, { value: 'right', - text: Formdict['model.form.alignRight'] + text: '鍙冲榻�' }] }, { @@ -157,10 +152,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -296,10 +291,10 @@ initVal: card.orderType || 'asc', options: [{ value: 'asc', - text: Formdict['header.form.asc'] + text: '姝e簭' }, { value: 'desc', - text: Formdict['header.form.desc'] + text: '鍊掑簭' }] }, { @@ -382,7 +377,7 @@ min: 0, max: 18, precision: 0, - label: Formdict['header.form.decimal'], + label: '灏忔暟浣�', initVal: card.decimal || 0, required: false }, @@ -405,7 +400,7 @@ { type: 'select', key: 'format', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.format || 'none', options: [{ value: 'none', @@ -425,7 +420,7 @@ { type: 'select', key: 'textFormat', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.textFormat || 'none', options: [{ value: 'none', @@ -445,14 +440,14 @@ { type: 'text', key: 'prefix', - label: Formdict['header.form.prefix'], + label: '鍓嶇紑', initVal: card.prefix || '', required: false, }, { type: 'text', key: 'postfix', - label: Formdict['header.form.postfix'], + label: '鍚庣紑', initVal: card.postfix || '', required: false, }, @@ -488,7 +483,7 @@ { type: 'multiselect', key: 'blacklist', - label: Formdict['header.form.blacklist'], + label: '榛戝悕鍗�', initVal: card.blacklist || [], required: false, options: roleList diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index 3997baa..102006c 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -24,7 +24,6 @@ class EdiTableColumn extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� visible: PropTypes.bool, column: PropTypes.object, columns: PropTypes.array, @@ -227,7 +226,6 @@ } getFields() { - const { dict } = this.props const { getFieldDecorator } = this.props.form const { formlist, transfield } = this.state const fields = [] @@ -246,7 +244,7 @@ if (item.type === 'text') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' }, + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, message: formRule.input.message @@ -256,7 +254,7 @@ content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> } else if (item.type === 'number') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] initVal = item.initVal @@ -267,7 +265,7 @@ } } else if (item.type === 'select') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Select showSearch @@ -284,7 +282,7 @@ </Select> } else if (item.type === 'radio') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] initVal = item.initVal @@ -306,13 +304,13 @@ span = 24 className = 'text-area' rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] content = <TextArea rows={item.rows || 2}/> } else if (item.type === 'codemirror') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] span = 24 className = 'text-area' diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index a13f19a..09ab9f2 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -8,8 +8,6 @@ import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -184,7 +182,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), tableId: '', data: [{uuid: Utils.getuuid()}], @@ -546,7 +543,7 @@ render() { const { config } = this.props - const { fields, card, lineMarks, dict, tableId, visible } = this.state + const { fields, card, lineMarks, tableId, visible } = this.state const components = { header: { cell: DragableHeaderCol @@ -632,7 +629,7 @@ }} /> </DndProvider> - <EditColumn column={card} dict={dict} columns={this.state.columns} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> + <EditColumn column={card} columns={this.state.columns} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> <Modal wrapClassName="model-table-action-verify-modal" title={'缂栬緫'} @@ -646,7 +643,6 @@ <TableVerify card={config.submit} setting={config.setting} - dict={dict} cols={config.cols} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} diff --git a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx index 0d6e3ec..4835267 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx @@ -11,7 +11,6 @@ class CustomForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� btn: PropTypes.object, // 鎸夐挳淇℃伅 scripts: PropTypes.array, // 鑷畾涔夎剼鏈垪琛� usefulfields: PropTypes.any, // 鍙敤瀛楁 @@ -334,7 +333,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'sql!' + message: '璇疯緭鍏ql!' } ] })(<CodeMirror />)} diff --git a/src/menu/components/table/edit-table/columns/tableIn/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/index.jsx index 69d1200..144df97 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/index.jsx @@ -21,7 +21,6 @@ class VerifyTableCard extends Component { static propTpyes = { columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, } @@ -154,10 +153,10 @@ <span className="operation-btn" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> <span className="operation-btn" onClick={() => this.handleUpDown(record, 'scripts', 'up')} style={{color: '#1890ff'}}><ArrowUpOutlined /></span> <span className="operation-btn" onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><ArrowDownOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -547,7 +546,7 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col span={8}> - <Form.Item required label={this.props.dict['model.form.tablename']}> + <Form.Item required label="琛ㄥ悕"> <Input value={verify.sheet} placeholder="" autoComplete="off" onChange={(e) => this.onOptionChange(e.target.value, 'sheet')}/> </Form.Item> </Col> @@ -607,7 +606,7 @@ {verify.uniques.length ? <span className="count-tip">{verify.uniques.length}</span> : null} </span> } key="unique"> - <UniqueForm fields={fields} dict={this.props.dict} uniqueChange={this.uniqueChange}/> + <UniqueForm fields={fields} uniqueChange={this.uniqueChange}/> <EditTable actions={['edit', 'move', 'del']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> </TabPane> <TabPane disabled={verify.intertype !== 'system'} tab={ @@ -617,7 +616,6 @@ </span> } key="scripts"> <CustomScript - dict={this.props.dict} btn={verify} usefulfields={fields} scripts={verify.scripts} diff --git a/src/menu/components/table/edit-table/columns/tableIn/uniqueform/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/uniqueform/index.jsx index d9f8038..a83668d 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/uniqueform/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/uniqueform/index.jsx @@ -6,7 +6,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� fields: PropTypes.array, // 琛ㄥ崟瀛楁 uniqueChange: PropTypes.func // 淇敼鍑芥暟 } @@ -56,13 +55,13 @@ <Form {...formItemLayout} className="verify-form" id="verifycard1"> <Row gutter={24}> <Col span={7}> - <Form.Item label={'鍒楀悕'}> + <Form.Item label="鍒楀悕"> {getFieldDecorator('field', { initialValue: [], rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鍒楀悕!' + message: '璇烽�夋嫨鍒楀悕!' } ] })( @@ -78,13 +77,13 @@ </Form.Item> </Col> <Col span={7}> - <Form.Item label={'鎶ラ敊缂栫爜'}> + <Form.Item label="鎶ラ敊缂栫爜"> {getFieldDecorator('errorCode', { initialValue: 'E', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎶ラ敊缂栫爜!' + message: '璇烽�夋嫨鎶ラ敊缂栫爜!' } ] })( @@ -98,13 +97,13 @@ </Form.Item> </Col> <Col span={7}> - <Form.Item label={'楠岃瘉绫诲瀷'}> + <Form.Item label="楠岃瘉绫诲瀷"> {getFieldDecorator('verifyType', { initialValue: 'physical', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '楠岃瘉绫诲瀷!' + message: '璇烽�夋嫨楠岃瘉绫诲瀷!' } ] })( diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx index f74ba6b..029fcd2 100644 --- a/src/menu/components/table/edit-table/index.jsx +++ b/src/menu/components/table/edit-table/index.jsx @@ -10,8 +10,6 @@ import MKEmitter from '@/utils/events.js' import getWrapForm from './options' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' @@ -33,7 +31,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), card: null, back: false @@ -51,7 +48,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: true, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, search: [], action: [], diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx index 1c53e2e..e004eb9 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx @@ -1,8 +1,3 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - /** * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭� * @param {object} card // 鎼滅储鏉′欢瀵硅薄 @@ -89,7 +84,7 @@ { type: 'select', key: 'type', - label: Formdict['model.form.type'], + label: '绫诲瀷', initVal: card.type, required: true, options: options @@ -97,7 +92,7 @@ { type: 'select', key: 'field', - label: Formdict['model.form.field'], + label: '瀛楁', initVal: card.field, required: true, options: fields @@ -105,7 +100,7 @@ { type: 'select', key: 'nameField', - label: Formdict['model.name'] + Formdict['model.form.field'], + label: '鍚嶇О瀛楁', initVal: card.nameField || '', required: false, options: [{uuid: 'empty', field: '', label: '绌�'}, ...fields] @@ -116,67 +111,67 @@ min: 20, max: 1000, decimal: 0, - label: Formdict['model.form.columnWidth'], + label: '鍒楀', initVal: card.Width || 120, required: true }, { type: 'radio', key: 'joint', - label: Formdict['model.form.paramJoint'], + label: '鎷兼帴鍙傛暟', initVal: card.joint || 'true', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Hide', - label: Formdict['model.hidden'], + label: '闅愯棌', initVal: card.Hide || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'IsSort', - label: Formdict['model.sort'], + label: '鎺掑簭', initVal: card.IsSort || (card.isSub ? 'false' : 'true'), required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Align', - label: Formdict['model.form.align'], + label: '瀵归綈鏂瑰紡', initVal: card.Align || 'left', required: true, options: [{ value: 'left', - text: Formdict['model.form.alignLeft'] + text: '宸﹀榻�' }, { value: 'center', - text: Formdict['model.form.alignCenter'] + text: '灞呬腑' }, { value: 'right', - text: Formdict['model.form.alignRight'] + text: '鍙冲榻�' }] }, { @@ -188,10 +183,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -203,10 +198,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -215,14 +210,14 @@ min: 0, max: 18, decimal: 0, - label: Formdict['header.form.decimal'], + label: '灏忔暟浣�', initVal: card.decimal || 0, required: false }, { type: 'select', key: 'format', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.format || 'none', options: [{ value: 'none', @@ -242,7 +237,7 @@ { type: 'select', key: 'textFormat', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.textFormat || 'none', options: [{ value: 'none', @@ -262,7 +257,7 @@ { type: 'text', key: 'prefix', - label: Formdict['header.form.prefix'], + label: '鍓嶇紑', initVal: card.prefix || '', required: false, readonly: false @@ -270,7 +265,7 @@ { type: 'text', key: 'postfix', - label: Formdict['header.form.postfix'], + label: '鍚庣紑', initVal: card.postfix || '', required: false, readonly: false @@ -319,10 +314,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -345,7 +340,7 @@ { type: appType === 'pc' ? 'select' : 'cascader', key: 'linkmenu', - label: Formdict['model.menu'], + label: '鑿滃崟', initVal: card.linkmenu || (appType === 'pc' ? '' : []), required: true, options: menulist, @@ -404,7 +399,7 @@ { type: 'multiselect', key: 'blacklist', - label: Formdict['header.form.blacklist'], + label: '榛戝悕鍗�', initVal: card.blacklist || [], required: false, options: roleList, diff --git a/src/menu/components/table/normal-table/columns/editColumn/index.jsx b/src/menu/components/table/normal-table/columns/editColumn/index.jsx index 907ebb2..cbb8ac4 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx @@ -24,7 +24,6 @@ class NormalTableColumn extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� visible: PropTypes.bool, column: PropTypes.object, fields: PropTypes.array, @@ -188,7 +187,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, ...rules ] @@ -210,7 +209,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(item.unlimit ? <InputNumber onPressEnter={this.handleSubmit}/> : @@ -227,7 +226,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -261,7 +260,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -307,7 +306,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -334,7 +333,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<TextArea rows={2} disabled={item.readonly} placeholder={item.placeholder || ''}/>)} diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index aa68104..f2ef11f 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -8,8 +8,6 @@ import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -200,7 +198,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), tableId: '', data: [{uuid: Utils.getuuid()}], @@ -588,7 +585,7 @@ render() { const { config } = this.props - const { fields, card, lineMarks, dict, tableId, appType } = this.state + const { fields, card, lineMarks, tableId, appType } = this.state const components = { header: { cell: DragableHeaderCol @@ -629,7 +626,7 @@ /> {appType === 'mob' && config.setting.laypage !== 'fasle' ? <MobPagination /> : null} </DndProvider> - <EditColumn column={card} dict={dict} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> + <EditColumn column={card} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> </div> ) } diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index 0983391..4092f00 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -50,11 +50,10 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: true, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: true, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, search: [ { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text', match: 'like' }, - { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'select', match: 'equal' } + { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'select', match: '=' } ], action: [ { origin: true, uuid: Utils.getuuid(), label: '娣诲姞', intertype: 'system', OpenType: 'pop', execSuccess: 'grid', icon: 'plus', class: 'green', style: {color: 'rgb(255, 255, 255)', background: 'rgb(38, 194, 129)', marginRight: '15px'} }, diff --git a/src/menu/components/tabs/antv-tabs/index.scss b/src/menu/components/tabs/antv-tabs/index.scss index 330d975..e45bad8 100644 --- a/src/menu/components/tabs/antv-tabs/index.scss +++ b/src/menu/components/tabs/antv-tabs/index.scss @@ -49,6 +49,7 @@ } .ant-tabs .ant-tabs-top-bar > .ant-tabs-nav-container { + min-height: 40px; >.ant-tabs-tab-next:not(.ant-tabs-tab-arrow-show) + .ant-tabs-nav-wrap > .ant-tabs-nav-scroll > .ant-tabs-nav { width: 100%; > div > .ant-tabs-tab-disabled { diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx index ea3581c..0f6fb9a 100644 --- a/src/menu/components/tabs/paste/index.jsx +++ b/src/menu/components/tabs/paste/index.jsx @@ -31,7 +31,7 @@ if (item.type === 'tabs') { uuids[item.uuid] = MenuUtils.getuuid() item.uuid = uuids[item.uuid] - item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4) + item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.subtabs.forEach(tab => { @@ -51,7 +51,7 @@ } else if (item.type === 'group') { uuids[item.uuid] = MenuUtils.getuuid() item.uuid = uuids[item.uuid] - item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4) + item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.components = item.components.map(cell => { diff --git a/src/menu/components/tabs/tabcomponents/index.jsx b/src/menu/components/tabs/tabcomponents/index.jsx index 1e30e2a..d6bf416 100644 --- a/src/menu/components/tabs/tabcomponents/index.jsx +++ b/src/menu/components/tabs/tabcomponents/index.jsx @@ -135,7 +135,6 @@ subtype: item.subtype, config: item.config, width: item.width || 24, - dataName: Utils.getdataName(), name: name, isNew: true // 鏂版坊鍔犳爣蹇楋紝鐢ㄤ簬鍒濆鍖� } diff --git a/src/menu/components/tabs/table-tabs/dragabletabs.jsx b/src/menu/components/tabs/table-tabs/dragabletabs.jsx new file mode 100644 index 0000000..fbb97de --- /dev/null +++ b/src/menu/components/tabs/table-tabs/dragabletabs.jsx @@ -0,0 +1,129 @@ +import React, { Component } from 'react' +import { Tabs } from 'antd' +import { is, fromJS } from 'immutable' +import { DndProvider, DragSource, DropTarget } from 'react-dnd' + +// Drag & Drop node +class TabNode extends Component { + render() { + const { connectDragSource, connectDropTarget, children } = this.props + + return connectDragSource(connectDropTarget(children)) + } +} + +const cardTarget = { + drop(props, monitor) { + const dragKey = monitor.getItem().index + const hoverKey = props.index + + if (dragKey === hoverKey) { + return; + } + + props.moveTabNode(dragKey, hoverKey) + monitor.getItem().index = hoverKey + } +} + +const cardSource = { + beginDrag(props) { + return { + id: props.id, + index: props.index, + } + } +} + +const WrapTabNode = DropTarget('DND_NODE', cardTarget, connect => ({ + connectDropTarget: connect.dropTarget(), +}))( + DragSource('DND_NODE', cardSource, (connect, monitor) => ({ + connectDragSource: connect.dragSource(), + isDragging: monitor.isDragging(), + }))(TabNode) +) + +class DraggableTabs extends Component { + state = { + order: [] + } + + moveTabNode = (dragKey, hoverKey) => { + const newOrder = this.state.order.slice() + const { children } = this.props + + React.Children.forEach(children, c => { + if (newOrder.indexOf(c.key) === -1) { + newOrder.push(c.key) + } + }) + + const dragIndex = newOrder.indexOf(dragKey) + const hoverIndex = newOrder.indexOf(hoverKey) + + newOrder.splice(dragIndex, 1) + newOrder.splice(hoverIndex, 0, dragKey) + + this.setState({ + order: newOrder + }) + this.props.tabsMove(newOrder) + } + + renderTabBar = (props, DefaultTabBar) => ( + <DefaultTabBar {...props}> + {node => ( + <WrapTabNode key={node.key} index={node.key} moveTabNode={this.moveTabNode}> + {node} + </WrapTabNode> + )} + </DefaultTabBar> + ) + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) || + !is(fromJS(nextProps.children), fromJS(this.props.children)) || + nextProps.tabPosition !== this.props.tabPosition || + nextProps.type !== this.props.type + } + + render() { + const { order } = this.state + const { children, ...resProps } = this.props + const tabs = [] + React.Children.forEach(children, c => { + tabs.push(c) + }) + + const orderTabs = tabs.slice().sort((a, b) => { + const orderA = order.indexOf(a.key) + const orderB = order.indexOf(b.key) + + if (orderA !== -1 && orderB !== -1) { + return orderA - orderB + } + if (orderA !== -1) { + return -1 + } + if (orderB !== -1) { + return 1 + } + + const ia = tabs.indexOf(a) + const ib = tabs.indexOf(b) + + return ia - ib + }) + + return ( + <DndProvider> + <Tabs renderTabBar={this.renderTabBar} {...resProps}> + {orderTabs} + </Tabs> + </DndProvider> + ) + } +} + +export default DraggableTabs \ No newline at end of file diff --git a/src/menu/components/tabs/table-tabs/index.jsx b/src/menu/components/tabs/table-tabs/index.jsx new file mode 100644 index 0000000..a272815 --- /dev/null +++ b/src/menu/components/tabs/table-tabs/index.jsx @@ -0,0 +1,401 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Tabs, Popover, Modal } from 'antd' +import { PlusOutlined, CloseOutlined, EditOutlined, DeleteOutlined, FontColorsOutlined, ToolOutlined } from '@ant-design/icons' + +import MKEmitter from '@/utils/events.js' +import asyncComponent from '@/utils/asyncComponent' +import asyncIconComponent from '@/utils/asyncIconComponent' +import MkIcon from '@/components/mk-icon' +import DraggableTabs from './dragabletabs' +import { resetStyle } from '@/utils/utils-custom.js' +import MenuUtils from '@/utils/utils-custom.js' +import Utils from '@/utils/utils.js' +import { getTabForm, getTabsSetForm } from './options' +import './index.scss' + +const NormalForm = asyncIconComponent(() => import('@/components/normalform')) +const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) +const PasteComponent = asyncIconComponent(() => import('../paste')) +const TabComponents = asyncComponent(() => import('../tabcomponents')) + +const { TabPane } = Tabs +const { confirm } = Modal + +class antvTabs extends Component { + static propTpyes = { + tabs: PropTypes.object, + deletecomponent: PropTypes.func, + updateConfig: PropTypes.func, + } + + state = { + appType: sessionStorage.getItem('appType'), + tabs: null, + editab: null, + defaultActiveKey: '' + } + + UNSAFE_componentWillMount () { + const { tabs } = this.props + + if (tabs.isNew) { + let _tabs = { + uuid: tabs.uuid, + type: tabs.type, + tabId: tabs.tabId || '', + parentId: tabs.parentId || '', + subtype: tabs.subtype, + width: 24, + name: tabs.name, + setting: {width: 24, position: 'top', tabStyle: 'line', name: tabs.name}, + style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, + subtabs: [ + { uuid: Utils.getuuid(), parentId: tabs.uuid, label: 'Tab 1', icon: '', components: [] }, + { uuid: Utils.getuuid(), parentId: tabs.uuid, label: 'Tab 2', icon: '', components: [] }, + { uuid: Utils.getuuid(), parentId: tabs.uuid, label: 'Tab 3', icon: '', components: [] } + ] + } + this.setState({ + defaultActiveKey: _tabs.subtabs[0].uuid, + tabs: _tabs + }) + this.props.updateConfig(_tabs) + } else { + this.setState({ + defaultActiveKey: window.GLOB.TabsMap.get(tabs.uuid) || '', + tabs: fromJS(tabs).toJS() + }) + } + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + + componentDidMount () { + MKEmitter.addListener('submitSearch', this.getSearch) + MKEmitter.addListener('tabsChange', this.handleTabsChange) + MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) + } + + /** + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 + */ + componentWillUnmount () { + this.setState = () => { + return + } + MKEmitter.removeListener('submitSearch', this.getSearch) + MKEmitter.removeListener('tabsChange', this.handleTabsChange) + MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) + } + + updateComponentStyle = (parentId, keys, style) => { + const { tabs } = this.state + + if (tabs.subtabs.findIndex(tab => tab.uuid === parentId) === -1) return + + let _tabs = fromJS(tabs).toJS() + let _tabs_ = fromJS(tabs).toJS() + + let components = [] + _tabs.subtabs.forEach(tab => { + if (tab.uuid === parentId) { + components = tab.components.map(item => { + if (keys.includes(item.uuid)) { + item.style = {...item.style, ...style} + } + return item + }) + tab.components = [] + } + }) + + _tabs_.subtabs = _tabs_.subtabs.map(tab => { + if (tab.uuid === parentId) { + tab.components = components + } + return tab + }) + + this.setState({tabs: _tabs}, () => { + this.updateComponent(_tabs_) + }) + } + + changeStyle = () => { + const { tabs } = this.state + + MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], tabs.style, this.getStyle) + } + + getStyle = (style) => { + let _card = {...this.state.tabs, style} + + this.setState({ + tabs: _card + }) + + this.props.updateConfig(_card) + } + + handleTabsChange = (parentId) => { + const { tabs } = this.state + + if (parentId === tabs.parentId) { + MKEmitter.emit('tabsChange', tabs.uuid) + } + } + + updateComponent = (component) => { + const { tabs } = this.state + + if (!is(fromJS(tabs.setting), fromJS(component.setting)) || !is(fromJS(tabs.style), fromJS(component.style))) { + // 娉ㄥ唽浜嬩欢-鏍囩鍙樺寲锛岄�氱煡鏍囩鍐呭厓绱� + MKEmitter.emit('tabsChange', tabs.uuid) + } + + component.width = component.setting.width + component.name = component.setting.name + + this.setState({ + tabs: component + }) + this.props.updateConfig(component) + } + + updateTabComponent = (tab) => { + let tabs = fromJS(this.state.tabs).toJS() + + tabs.subtabs = tabs.subtabs.map(t => { + if (t.uuid === tab.uuid) { + return tab + } else { + return t + } + }) + + this.setState({tabs}) + this.props.updateConfig(tabs) + } + + delTab = (tab) => { + let tabs = fromJS(this.state.tabs).toJS() + const _this = this + + tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid) + + let uuids = MenuUtils.getDelButtonIds({...tab, type: 'group'}) + + confirm({ + title: '纭畾鍒犻櫎鏍囩锛�', + content: '', + onOk() { + _this.setState({tabs}) + _this.props.updateConfig(tabs) + + if (uuids.length === 0) return + + MKEmitter.emit('delButtons', uuids) + }, + onCancel() {} + }) + } + + moveSwitch = (order) => { + let tabs = fromJS(this.state.tabs).toJS() + let subtab = {} + tabs.subtabs.forEach(item => { + subtab[item.uuid] = item + }) + + tabs.subtabs = [] + + order.forEach(item => { + if (subtab[item]) { + tabs.subtabs.push(subtab[item]) + } + }) + + this.setState({tabs}) + this.props.updateConfig(tabs) + } + + insert = (item, tab) => { + let tabs = fromJS(this.state.tabs).toJS() + + tabs.subtabs.forEach(stab => { + if (stab.uuid === tab.uuid) { + stab.components.push(item) + } + }) + + this.setState({tabs}) + this.props.updateConfig(tabs) + } + + getSearch = (config) => { + const { tabs } = this.state + + if (tabs.uuid !== config.uuid) return + + let _tabs = fromJS(tabs).toJS() + + _tabs.subtabs = _tabs.subtabs.map(t => { + if (t.uuid === config.tabId) { + t.search = config.search + } + return t + }) + + this.setState({ + tabs: _tabs + }) + this.props.updateConfig(_tabs) + } + + setSearch = (tab) => { + const { tabs } = this.state + let card = { + uuid: tabs.uuid, + tabId: tab.uuid, + search: tab.search + } + + if (!card.search) { + card.search = { + floor: 1, + setting: { type: 'title', field: '', title: '', focus: 'true', btn: 'hidden' }, + groups: [], + fields: [] + } + } + MKEmitter.emit('changeSearch', card) + } + + clickComponent = (e) => { + if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { + e.stopPropagation() + MKEmitter.emit('clickComponent', this.state.tabs) + } + } + + getTabForms = (tab) => { + const { tabs } = this.state + + if (!tab) { + tab = { + uuid: '', + parentId: tabs.uuid, + label: '', + icon: '', + components: [] + } + } + + this.setState({ + editab: tab + }) + + return getTabForm(tab, tabs.setting) + } + + updateTab = (res) => { + let tabs = fromJS(this.state.tabs).toJS() + let editab = fromJS(this.state.editab).toJS() + + editab.label = res.label + editab.icon = res.icon + // editab.hasSearch = res.hasSearch || '' + editab.hide = res.hide || 'false' + editab.backgroundColor = res.backgroundColor + editab.controlVal = res.controlVal || '' + editab.selectVal = res.selectVal || '' + editab.blacklist = res.blacklist + + if (editab.uuid) { + tabs.subtabs = tabs.subtabs.map(t => { + if (t.uuid === editab.uuid) { + return editab + } else { + return t + } + }) + } else { + editab.uuid = Utils.getuuid() + tabs.subtabs.push(editab) + } + + this.setState({ + editab: null, + tabs + }) + + this.props.updateConfig(tabs) + } + + getTabsForms = () => { + const { tabs } = this.state + + return getTabsSetForm(tabs.setting, tabs.uuid) + } + + updateTabs = (res) => { + this.updateComponent({...this.state.tabs, setting: res}) + } + + onChange = (key) => { + const { tabs } = this.state + window.GLOB.TabsMap.set(tabs.uuid, key) + } + + render() { + const { tabs, defaultActiveKey } = this.state + let _style = resetStyle(tabs.style) + + return ( + <div className={'menu-tabs-edit-box ' + (tabs.setting.display || '')} style={_style} onClick={this.clickComponent} id={tabs.uuid}> + <DraggableTabs defaultActiveKey={defaultActiveKey} tabBarStyle={{background: tabs.setting.backgroundColor || 'transparent'}} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle} tabsMove={this.moveSwitch} onChange={this.onChange}> + {tabs.subtabs.map(tab => ( + <TabPane tab={ + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <NormalForm title="鏍囩缂栬緫" width={800} update={this.updateTab} getForms={() => this.getTabForms(tab)}> + <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> + </NormalForm> + <PasteComponent Tab={tab} insert={this.insert} /> + <CloseOutlined className="close" onClick={() => this.delTab(tab)} /> + </div> + } trigger="hover"> + <span style={{textDecoration: tab.hide === 'true' ? 'line-through' : 'none'}}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span> + </Popover> + } key={tab.uuid} style={{backgroundColor: tab.backgroundColor || 'transparent'}}> + {/* {appType === 'mob' && tabs.setting.position === 'top' && tabs.setting.display === 'inline-block' && tab.hasSearch === 'icon' ? + <SearchOutlined className="search-icon" onDoubleClick={() => this.setSearch(tab)}/> : null} */} + <TabComponents config={tab} handleList={this.updateTabComponent} deleteCard={this.deleteCard} /> + </TabPane> + ))} + </DraggableTabs> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <NormalForm title="娣诲姞鏍囩" width={800} update={this.updateTab} getForms={() => this.getTabForms()}> + <PlusOutlined className="plus" title="娣诲姞鏍囩"/> + </NormalForm> + <NormalForm title="鏍囩椤佃缃�" width={800} update={this.updateTabs} getForms={this.getTabsForms}> + <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> + </NormalForm> + <CopyComponent type="tabs" card={tabs}/> + <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> + <DeleteOutlined className="close" onClick={() => this.props.deletecomponent(tabs.uuid)} /> + </div> + } trigger="hover"> + <ToolOutlined /> + </Popover> + </div> + ) + } +} + +export default antvTabs \ No newline at end of file diff --git a/src/menu/components/tabs/table-tabs/index.scss b/src/menu/components/tabs/table-tabs/index.scss new file mode 100644 index 0000000..e45bad8 --- /dev/null +++ b/src/menu/components/tabs/table-tabs/index.scss @@ -0,0 +1,144 @@ +.menu-tabs-edit-box { + position: relative; + box-sizing: border-box; + background: #ffffff; + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + + .ant-tabs-top-bar { + margin-bottom: 0; + } + .ant-tabs-top-content { + .tab-shell-inner { + padding-top: 15px; + } + } + .ant-tabs-left-content { + padding-left: 0; + } + .ant-tabs-right-content { + padding-right: 0; + } + .ant-tabs-bottom-bar { + margin-top: 0; + } + + >.anticon-tool { + position: absolute; + z-index: 2; + font-size: 16px; + right: 1px; + top: 1px; + cursor: pointer; + padding: 5px; + background: rgba(255, 255, 255, 0.55); + } + + .ant-tabs.ant-tabs-left, .ant-tabs.ant-tabs-bottom { + .tab-shell-inner { + padding-top: 25px; + } + } + + .ant-tabs-tabpane-active { + min-height: 200px; + } + .tab-shell-inner { + min-height: 100%; + } + + .ant-tabs .ant-tabs-top-bar > .ant-tabs-nav-container { + min-height: 40px; + >.ant-tabs-tab-next:not(.ant-tabs-tab-arrow-show) + .ant-tabs-nav-wrap > .ant-tabs-nav-scroll > .ant-tabs-nav { + width: 100%; + > div > .ant-tabs-tab-disabled { + float: right; + } + } + } + + .ant-tabs .ant-tabs-left-bar .ant-tabs-tab { + text-align: right; + > span { + display: inline-block; + padding: 8px 24px; + } + } + .ant-tabs .ant-tabs-right-bar .ant-tabs-tab { + text-align: left; + > span { + display: inline-block; + padding: 8px 24px; + } + } + .ant-tabs-tab { + padding: 0px!important; + text-align: center; + > span { + display: inline-block; + padding: 12px 16px; + } + } + .ant-tabs-bottom .ant-tabs-bottom-bar .ant-tabs-ink-bar { + top: 0px; + } + .ant-tabs-card { + .ant-tabs-left-bar, .ant-tabs-right-bar { + .ant-tabs-tab { + > span { + padding: 0px 16px; + } + } + .ant-tabs-tab-active { + padding-left: 0px!important; + padding-right: 0px!important; + } + } + + .ant-tabs-card-bar { + .ant-tabs-tab { + > span { + display: inline-block; + padding: 0px 16px; + } + } + } + } + .search-icon { + position: absolute; + top: 10px; + right: 40px; + font-size: 18px; + cursor: pointer; + padding: 3px; + } +} +.menu-tabs-edit-box:hover { + z-index: 1; + box-shadow: 0px 0px 4px #1890ff; +} + +.mob-shell { + .menu-tabs-edit-box.flex { + >.ant-tabs.ant-tabs-top, >.ant-tabs.ant-tabs-bottom { + >.ant-tabs-bar { + >.ant-tabs-nav-container { + >.ant-tabs-nav-wrap { + >.ant-tabs-nav-scroll { + >.ant-tabs-nav { + display: block; + >div { + display: flex; + >.ant-tabs-tab { + flex: 1; + } + } + } + } + } + } + } + } + } +} diff --git a/src/menu/components/tabs/table-tabs/options.jsx b/src/menu/components/tabs/table-tabs/options.jsx new file mode 100644 index 0000000..bc2db9d --- /dev/null +++ b/src/menu/components/tabs/table-tabs/options.jsx @@ -0,0 +1,267 @@ +import MenuUtils from '@/utils/utils-custom.js' + +/** + * @description tab琛ㄥ崟閰嶇疆淇℃伅 + */ +export function getTabForm(tab, setting) { + let appType = sessionStorage.getItem('appType') + let roleList = sessionStorage.getItem('sysRoles') + + if (roleList) { + try { + roleList = JSON.parse(roleList) + } catch (e) { + roleList = [] + } + } else { + roleList = [] + } + + const tabForm = [ + { + type: 'text', + field: 'label', + label: '鍚嶇О', + initval: tab.label || '', + required: true, + focus: true, + }, + { + type: 'mkicon', + field: 'icon', + label: '鍥炬爣', + initval: tab.icon || '', + required: false, + allowClear: true, + }, + // { + // type: 'radio', + // field: 'hasSearch', + // label: '鎼滅储', + // initval: tab.hasSearch || 'false', + // required: false, + // options: [ + // {value: 'false', label: '鏃�'}, + // {value: 'icon', label: '鏈�'}, + // ], + // forbid: appType !== 'mob' || setting.position !== 'top' || setting.display !== 'inline-block', + // span: 22 + // }, + { + type: 'text', + field: 'controlVal', + label: '闅愯棌鏍囪', + initval: tab.controlVal || '', + tooltip: '褰撶鐢ㄥ瓧娈靛�间笌闅愯棌鏍囪鐩哥瓑鏃讹紝鏍囩椤典細闅愯棌銆傛敞锛氬涓�艰鐢ㄩ�楀彿鍒嗛殧銆�', + required: false, + }, + { + type: 'text', + field: 'selectVal', + label: '閫変腑鏍囪', + initval: tab.selectVal || '', + tooltip: '褰撻�変腑瀛楁鍊间笌閫変腑鏍囪鐩哥瓑鏃讹紝鏍囩椤甸粯璁ら�変腑銆�', + required: false + }, + { + type: 'color', + field: 'backgroundColor', + label: '鑳屾櫙(鍐呭鍖�)', + initval: tab.backgroundColor || 'transparent', + required: false, + }, + { + type: 'radio', + field: 'hide', + label: '闅愯棌', + initval: tab.hide || 'false', + required: false, + options: [ + {value: 'false', label: '鍚�'}, + {value: 'true', label: '鏄�'}, + ], + }, + { + type: 'multiselect', + field: 'blacklist', + label: '榛戝悕鍗�', + initval: tab.blacklist || [], + required: false, + options: roleList, + forbid: !!appType, + }, + ] + + return tabForm +} + +/** + * @description tabs琛ㄥ崟閰嶇疆淇℃伅 + */ +export function getTabsSetForm(setting, uuid) { + let appType = sessionStorage.getItem('appType') + let roleList = sessionStorage.getItem('sysRoles') + + let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid) || [] + modules.push({ + value: 'preview', + label: '涓婁竴椤碉紙url鍙傛暟锛�' + }) + + if (roleList) { + try { + roleList = JSON.parse(roleList) + } catch (e) { + roleList = [] + } + } else { + roleList = [] + } + + const tabForm = [ + { + type: 'text', + field: 'name', + label: '缁勪欢鍚嶇О', + initval: setting.name || '', + tooltip: '鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�', + required: true + }, + { + type: 'number', + field: 'width', + label: '瀹藉害', + initval: setting.width || 24, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + min: 1, + max: 24, + precision: 0, + required: true + }, + { + type: 'select', + field: 'position', + label: '鏍囩浣嶇疆', + initval: setting.position || 'top', + required: true, + options: [ + {value: 'top', label: 'top'}, + {value: 'bottom', label: 'bottom'}, + {value: 'left', label: 'left'}, + {value: 'right', label: 'right'}, + ], + controlFields: [ + {field: 'display', values: ['top', 'bottom']}, + ] + }, + { + type: 'radio', + field: 'tabStyle', + label: '椤电鏍峰紡', + initval: setting.tabStyle || 'line', + tooltip: '鏍囩浣嶇疆涓簍op鏃舵湁鏁堬紝榛樿鍊间负line銆�', + required: true, + options: [ + {value: 'line', label: 'line'}, + {value: 'card', label: 'card'}, + ], + }, + { + type: 'radio', + field: 'autoSwitch', + label: '鑷姩鍒囨崲', + initval: setting.autoSwitch || 'false', + tooltip: '瀛樺湪涓や釜鍙婁互涓婃爣绛炬椂鏈夋晥銆�', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], + controlFields: [ + {field: 'interval', values: ['true']}, + {field: 'tabLabel', values: ['true']}, + ] + }, + { + type: 'number', + field: 'interval', + label: '闂撮殧锛坰锛�', + initval: setting.interval || 5, + min: 1, + max: 1000, + precision: 0, + required: true + }, + { + type: 'radio', + field: 'tabLabel', + label: '鏍囩鏍�', + initval: setting.tabLabel || 'show', + required: false, + options: [ + {value: 'show', label: '鏄剧ず'}, + {value: 'hide', label: '闅愯棌'}, + ] + }, + { + type: 'cascader', + field: 'supModule', + label: '涓婄骇缁勪欢', + initval: setting.supModule || [], + tooltip: '鏍囩缁勫彲浠ラ�夋嫨涓婄骇缁勪欢锛屽~鍏ョ鐢ㄥ瓧娈碉紝鐢ㄤ簬鎺у埗鏍囩闅愯棌銆�', + help: '鐢ㄤ簬鎺у埗鏍囩椤甸殣钘忋��', + required: false, + allowClear: true, + options: modules, + controlFields: [ + {field: 'controlField', notNull: true}, + ], + }, + { + type: 'text', + field: 'controlField', + label: '绂佺敤瀛楁', + initval: setting.controlField || '', + tooltip: '鐢ㄤ簬鎺у埗鏍囩闅愯棌鐨勫瓧娈碉紝鍦ㄦ爣绛句腑濉叆闅愯棌鏍囪銆�', + required: true, + }, + { + type: 'text', + field: 'selectField', + label: '閫変腑瀛楁', + initval: setting.selectField || '', + tooltip: '鐢ㄤ簬鎺у埗鏍囩椤靛垵濮嬪寲閫変腑锛屽湪鏍囩涓~鍏ラ�変腑鏍囪锛屾敞锛氭暟鎹簮浜巙rl鍙傛暟銆�', + required: false + }, + { + type: 'color', + field: 'backgroundColor', + label: '鑳屾櫙(鏍囬鏍�)', + initval: setting.backgroundColor || 'transparent', + required: false + }, + { + type: 'radio', + field: 'permission', + label: '鏉冮檺楠岃瘉', + initval: setting.permission || 'false', + required: false, + options: [ + {value: 'true', label: '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ], + forbid: !appType + }, + { + type: 'multiselect', + field: 'blacklist', + label: '榛戝悕鍗�', + initval: setting.blacklist || [], + required: false, + options: roleList, + forbid: !!appType + }, + ] + + return tabForm +} \ No newline at end of file diff --git a/src/menu/components/timeline/normal-timeline/index.jsx b/src/menu/components/timeline/normal-timeline/index.jsx index be03907..547ef31 100644 --- a/src/menu/components/timeline/normal-timeline/index.jsx +++ b/src/menu/components/timeline/normal-timeline/index.jsx @@ -44,7 +44,6 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/menu/components/tree/antd-tree/index.jsx b/src/menu/components/tree/antd-tree/index.jsx index 529cce9..8d2ecb6 100644 --- a/src/menu/components/tree/antd-tree/index.jsx +++ b/src/menu/components/tree/antd-tree/index.jsx @@ -42,7 +42,6 @@ type: card.type, tabId: card.tabId || '', parentId: card.parentId || '', - dataName: card.dataName || '', format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: true, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� diff --git a/src/menu/datasource/index.jsx b/src/menu/datasource/index.jsx index e71780a..e0bb557 100644 --- a/src/menu/datasource/index.jsx +++ b/src/menu/datasource/index.jsx @@ -4,8 +4,6 @@ import { Modal } from 'antd' import { SettingOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import VerifyCard from './verifycard' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -17,7 +15,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), sourcelist: [], mainSearch: [], @@ -205,7 +202,7 @@ render () { const { config } = this.props - const { visible, dict, loading, mainSearch } = this.state + const { visible, loading, mainSearch } = this.state return ( <div className="model-datasource"> @@ -216,14 +213,13 @@ visible={visible} width={'75vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} confirmLoading={loading} onCancel={() => { MKEmitter.emit('modalStatus', false);this.setState({ visible: false }) }} destroyOnClose > <VerifyCard - dict={dict} mainSearch={mainSearch} config={config} wrappedComponentRef={(inst) => this.verifyRef = inst} diff --git a/src/menu/datasource/verifycard/columnform/index.jsx b/src/menu/datasource/verifycard/columnform/index.jsx index b8c3ba5..f977564 100644 --- a/src/menu/datasource/verifycard/columnform/index.jsx +++ b/src/menu/datasource/verifycard/columnform/index.jsx @@ -6,7 +6,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� columnChange: PropTypes.func // 淇敼鍑芥暟 } @@ -27,7 +26,6 @@ } render() { - const { dict } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -44,26 +42,26 @@ <Form {...formItemLayout} className="verify-form" id="verifycard1"> <Row gutter={24}> <Col span={6}> - <Form.Item label={'鍚嶇О'}> + <Form.Item label="鍚嶇О"> {getFieldDecorator('label', { initialValue: '', rules: [ { required: true, - message: dict['form.required.input'] + '鍚嶇О!' + message: '璇疯緭鍏ュ悕绉�!' } ] })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleConfirm}/>)} </Form.Item> </Col> <Col span={6}> - <Form.Item label={'瀛楁'}> + <Form.Item label="瀛楁"> {getFieldDecorator('field', { initialValue: '', rules: [ { required: true, - message: dict['form.required.input'] + '瀛楁!' + message: '璇疯緭鍏ュ瓧娈�!' }, { pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, @@ -74,13 +72,13 @@ </Form.Item> </Col> <Col span={6}> - <Form.Item label={'鏁版嵁绫诲瀷'}> + <Form.Item label="鏁版嵁绫诲瀷"> {getFieldDecorator('datatype', { initialValue: '', rules: [ { required: true, - message: dict['form.required.select'] + '鏁版嵁绫诲瀷!' + message: '璇烽�夋嫨鏁版嵁绫诲瀷!' } ] })( @@ -122,7 +120,7 @@ </Col> <Col span={3} className="add"> <Button onClick={this.handleConfirm} type="primary" className="mk-green"> - {dict['model.add']} + 娣诲姞 </Button> </Col> </Row> diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx index ac493e7..9bd1aaa 100644 --- a/src/menu/datasource/verifycard/customscript/index.jsx +++ b/src/menu/datasource/verifycard/customscript/index.jsx @@ -10,7 +10,6 @@ class CustomForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� defaultsql: PropTypes.string, // 榛樿sql setting: PropTypes.object, // 璁剧疆 searches: PropTypes.array, // 鎼滅储鏉′欢 @@ -256,13 +255,13 @@ </Button> </Col> <Col span={24} className="sql"> - <Form.Item label={'sql'}> + <Form.Item label="sql"> {getFieldDecorator('sql', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'sql!' + message: '璇疯緭鍏ql!' } ] })(<CodeMirror />)} diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index 64a38ce..66a6a93 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { fromJS } from 'immutable' import { Form, Tabs, Popconfirm, notification, Modal, Typography, Spin, message, Button } from 'antd' -import { StopOutlined, CheckCircleOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined } from '@ant-design/icons' +import { StopOutlined, CheckCircleOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined, SnippetsOutlined } from '@ant-design/icons' import moment from 'moment' import Api from '@/api' @@ -12,6 +12,7 @@ import ColForm from './columnform' import CustomScriptsForm from './customscript' import SettingForm from './settingform' +import PasteForm from '@/templates/zshare/pasteform' import SettingUtils from './utils' import MinView from '@/assets/img/minview.png' import './index.scss' @@ -25,7 +26,6 @@ class VerifyCard extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 } @@ -39,6 +39,8 @@ defaultSearch: '', systemScripts: [], visible: false, + pvisible: false, + reload: false, script: null, scriptValue: '', colColumns: [ @@ -146,11 +148,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['model.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.deleteScript(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -694,6 +696,90 @@ }) } + copyDatasource = () => { + const { config } = this.props + const { columns, scripts } = this.state + + if (columns.length === 0) { + notification.warning({ + top: 92, + message: '璇锋坊鍔犲瓧娈甸泦!', + duration: 5 + }) + return + } + + this.settingForm.handleConfirm().then(res => { + delete res.supModule + res.name = config.name + + let source = { + key: 'interface', + type: 'line', + data: {setting: res, columns, scripts, pageable: false, format: 'array', name: res.name, status: 'false', type: 'interface', uuid: '' } + } + + try { + source = window.btoa(window.encodeURIComponent(JSON.stringify(source))) + } catch (e) { + console.warn('Stringify Failure') + source = '' + } + + if (source) { + let oInput = document.createElement('input') + oInput.value = source + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + message.success('澶嶅埗鎴愬姛銆�') + } + }) + } + + pasteSubmit = () => { + const { setting } = this.state + + this.pasteFormRef.handleConfirm().then(res => { + if (res.key !== 'interface') { + notification.warning({ + top: 92, + message: '閰嶇疆绫诲瀷閿欒!', + duration: 5 + }) + return + } else if (res.type !== 'line') { + notification.warning({ + top: 92, + message: '璇风矘璐村崟椤规暟鎹簮!', + duration: 5 + }) + return + } + + if (setting.supModule) { + res.data.setting.supModule = setting.supModule + } + + this.setState({ + scripts: res.data.scripts.map(col => { + col.uuid = Utils.getuuid() + return col + }), + columns: res.data.columns.map(col => { + col.uuid = Utils.getuuid() + return col + }), + setting: res.data.setting, + reload: true, + pvisible: false + }, () => { + this.setState({reload: false}) + }) + }) + } + copyColumns = () => { const { columns } = this.state let m = [] @@ -726,30 +812,36 @@ render() { const { config } = this.props - const { columns, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, script, scriptValue } = this.state + const { columns, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue } = this.state return ( <div className="model-data-source-wrap"> {config.name ? <div className="mk-com-name">{config.name} - 鏁版嵁婧�</div> : null} {loading && <Spin size="large" />} <Tabs activeKey={activeKey} className="data-source-card-box" onChange={this.changeTab}> - <TabPane tab="鏁版嵁婧�" key="setting"> - <SettingForm - dict={this.props.dict} + <TabPane tab={ + <span> + 鏁版嵁婧� + {config.type !== 'interface' ? <CopyOutlined title="澶嶅埗鏁版嵁婧�" className="mk-copy-datasource" onClick={this.copyDatasource}/> : null} + {config.type !== 'interface' ? <SnippetsOutlined title="瀵煎叆鏁版嵁婧�" className="mk-paste-datasource" onClick={() => this.setState({pvisible: true})}/> : null} + </span> + } key="setting"> + {!reload ? <SettingForm config={config} columns={columns} setting={setting} scripts={scripts} wrappedComponentRef={(inst) => this.settingForm = inst} - /> + /> : null} </TabPane> <TabPane tab={ <span> 瀛楁闆� + {columns.length ? <span className="count-tip">{columns.length}</span> : null} <CopyOutlined title="浠ラ�楀彿鎷兼帴褰㈠紡澶嶅埗瀛楁" className="mk-copy-fields" onClick={this.copyColumns}/> </span> } key="columns"> - <ColForm dict={this.props.dict} columnChange={this.columnChange}/> + <ColForm columnChange={this.columnChange}/> <FieldsComponent config={{...config, columns}} type="fields" @@ -779,7 +871,6 @@ searches={searches} defaultsql={defaultsql} initsql={this.state.initsql} - dict={this.props.dict} customScripts={scripts} systemScripts={this.state.systemScripts} scriptsChange={this.scriptsChange} @@ -826,7 +917,7 @@ <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.deleteScript(item) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -846,6 +937,17 @@ </div> <CodeMirror value={scriptValue} onChange={(val) => {this.setState({scriptValue: val})}}></CodeMirror> </Modal> + <Modal + title="绮樿创" + visible={pvisible} + width={600} + maskClosable={false} + onOk={this.pasteSubmit} + onCancel={() => {this.setState({pvisible: false})}} + destroyOnClose + > + <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> + </Modal> </div> ) } diff --git a/src/menu/datasource/verifycard/index.scss b/src/menu/datasource/verifycard/index.scss index 4be45ad..7fcbe7e 100644 --- a/src/menu/datasource/verifycard/index.scss +++ b/src/menu/datasource/verifycard/index.scss @@ -17,9 +17,38 @@ right: -210px; color: rgb(24, 144, 255); display: none; + opacity: 0.4; + transition: opacity 0.2s; } - .ant-tabs-tab-active .mk-copy-fields { - display: inline-block; + .mk-copy-datasource { + position: absolute; + cursor: pointer; + z-index: 1; + top: 19px; + right: -319px; + color: rgb(24, 144, 255); + display: none; + opacity: 0.4; + transition: opacity 0.2s; + } + .mk-paste-datasource { + position: absolute; + cursor: pointer; + z-index: 1; + top: 19px; + right: -355px; + color:purple; + display: none; + opacity: 0.4; + transition: opacity 0.2s; + } + .mk-copy-fields:hover, .mk-copy-datasource:hover, .mk-paste-datasource:hover { + opacity: 1; + } + .ant-tabs-tab-active { + .mk-copy-fields, .mk-copy-datasource, .mk-paste-datasource { + display: inline-block; + } } .count-tip { position: absolute; diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx index f0ff0c4..2630176 100644 --- a/src/menu/datasource/verifycard/settingform/index.jsx +++ b/src/menu/datasource/verifycard/settingform/index.jsx @@ -14,7 +14,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, // 缁勪欢閰嶇疆 setting: PropTypes.object, // 鏁版嵁婧愰厤缃� modules: PropTypes.array, // 鍙粦瀹氱殑涓婄骇缁勪欢 @@ -180,7 +179,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鏁版嵁婧愬悕绉�!' + message: '璇疯緭鍏ユ暟鎹簮鍚嶇О!' } ] })(<Input placeholder={''} autoComplete="off" />)} @@ -193,7 +192,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '琛ㄥ悕!' + message: '璇疯緭鍏ヨ〃鍚�!' }, { max: 50, @@ -214,7 +213,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎺ュ彛绫诲瀷!' + message: '璇烽�夋嫨鎺ュ彛绫诲瀷!' }, ] })( @@ -254,7 +253,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍐呴儴鍑芥暟!' + message: '璇疯緭鍏ュ唴閮ㄥ嚱鏁�!' }, ...innerRules ] @@ -268,7 +267,7 @@ rules: [ { required: setting.sysInterface !== 'true' ? true : false, - message: this.props.dict['form.required.input'] + '鎺ュ彛鍦板潃!' + message: '璇疯緭鍏ユ帴鍙e湴鍧�!' } ] })(<TextArea rows={2} readOnly={setting.sysInterface === 'true'}/>)} @@ -304,7 +303,7 @@ rules: [ { required: setting.execute !== 'false' ? true : false, - message: this.props.dict['form.required.input'] + '鏁版嵁婧�!' + message: '璇疯緭鍏ユ暟鎹簮!' } ] })(<CodeMirror />)} @@ -349,7 +348,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '榛樿鎺掑簭!' + message: '璇疯緭鍏ラ粯璁ゆ帓搴�!' } ] })(<Input placeholder={'ID asc, UID desc'} autoComplete="off" />)} @@ -378,7 +377,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '涓婄骇缁勪欢!' + message: '璇烽�夋嫨涓婄骇缁勪欢!' } ] })( @@ -410,7 +409,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '姣忛〉鏁伴噺!' + message: '璇疯緭鍏ユ瘡椤垫暟閲�!' } ] })(<InputNumber min={1} max={500} precision={0} />)} @@ -468,7 +467,7 @@ )} </Form.Item> </Col> : null} - <Col span={8}> + {/* <Col span={8}> <Form.Item label="浜嬪姟"> {getFieldDecorator('transaction', { initialValue: setting.transaction || 'false' @@ -478,7 +477,7 @@ <Radio value="false">涓嶄娇鐢�</Radio> </Radio.Group>)} </Form.Item> - </Col> + </Col> */} {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}> <Form.Item label="鍒濆鍖栨暟鎹�"> {getFieldDecorator('onload', { diff --git a/src/menu/menushell/index.jsx b/src/menu/menushell/index.jsx index 26e58b6..7f7c73c 100644 --- a/src/menu/menushell/index.jsx +++ b/src/menu/menushell/index.jsx @@ -124,7 +124,6 @@ subtype: item.subtype, config: item.config, width: item.width || 24, - dataName: Utils.getdataName(), name: name, floor: 1, // 缁勪欢鐨勫眰绾� isNew: true // 鏂版坊鍔犳爣蹇楋紝鐢ㄤ簬鍒濆鍖� diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx index abc8389..6b1c9ae 100644 --- a/src/menu/modalconfig/index.jsx +++ b/src/menu/modalconfig/index.jsx @@ -9,8 +9,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getModalForm } from '@/templates/zshare/formconfig' import SourceElement from '@/templates/modalconfig/dragelement/source' @@ -22,7 +20,6 @@ const { Panel } = Collapse const { confirm } = Modal -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) const DragElement = asyncComponent(() => import('@/templates/modalconfig/dragelement')) @@ -36,7 +33,6 @@ } state = { - dict: CommonDict, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆锛屽寘鎷ā鏉跨被鍨嬨�佹ā鎬佹璁剧疆銆佹坊鍔犺〃鍚嶃�佽〃鍗曞垪琛� visible: false, // 琛ㄥ崟缂栬緫妯℃�佹锛屾樉绀烘帶鍒� formlist: null, // 琛ㄥ崟缂栬緫妯℃�佹锛屽彲缂栬緫瀛楁 @@ -479,14 +475,14 @@ } render () { - const { config, dict, saving } = this.state + const { config, saving } = this.state return ( <div className="modal-form-board"> <DndProvider backend={HTML5Backend}> <div className="tools"> <Collapse accordion defaultActiveKey="1" bordered={false}> - <Panel header={dict['header.menu.form']} key="1"> + <Panel header="琛ㄥ崟" key="1"> <div className="search-element"> {SearchItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -500,7 +496,7 @@ <Card title="琛ㄥ崟閰嶇疆" bordered={false} extra={ <div> <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button> - <EditComponent dict={dict} options={['form']} config={this.state.config} plusFields={this.plusFields}/> + <EditComponent options={['form']} config={this.state.config} plusFields={this.plusFields}/> <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>杩斿洖</Button> </div> @@ -513,7 +509,7 @@ <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2鍒�</Button> <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3鍒�</Button> <Button className="mk-cols-change" onClick={() => this.changecols(4)}>4鍒�</Button> - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> </div> <div className="ant-modal-body"> <div className="modal-form"> @@ -521,7 +517,6 @@ list={config.fields} setting={config.setting} showField={this.state.showField} - placeholder={this.state.dict['header.form.modal.placeholder']} handleList={this.handleList} handleForm={this.handleForm} closeForm={this.closeForm} @@ -531,10 +526,10 @@ <div className="ant-modal-footer"> <div> <button type="button" className="ant-btn"> - <span>{this.state.dict['model.cancel']}</span> + <span>鍙栨秷</span> </button> <button type="button" className="ant-btn ant-btn-primary"> - <span>{this.state.dict['model.confirm']}</span> + <span>纭畾</span> </button> </div> <div className="action-mask"></div> @@ -544,7 +539,7 @@ </div> </DndProvider> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={950} maskClosable={false} @@ -554,7 +549,6 @@ destroyOnClose > <ModalForm - dict={this.state.dict} card={this.state.card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -563,7 +557,7 @@ /> </Modal> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.settingVisible} width={850} maskClosable={false} @@ -573,7 +567,6 @@ > <SettingForm config={config} - dict={this.state.dict} isSubTab={!!this.props.editTab} inputSubmit={this.settingSave} wrappedComponentRef={(inst) => this.settingRef = inst} diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx index 074d4f1..9d11f70 100644 --- a/src/menu/pastecontroller/index.jsx +++ b/src/menu/pastecontroller/index.jsx @@ -25,7 +25,7 @@ if (item.type === 'tabs') { uuids[item.uuid] = MenuUtils.getuuid() item.uuid = uuids[item.uuid] - item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4) + item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.subtabs.forEach(tab => { @@ -48,7 +48,7 @@ } else if (item.type === 'group') { uuids[item.uuid] = MenuUtils.getuuid() item.uuid = uuids[item.uuid] - item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4) + item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.components = item.components.map(cell => { diff --git a/src/menu/picturecontroller/index.jsx b/src/menu/picturecontroller/index.jsx index ec99c44..3fa98d4 100644 --- a/src/menu/picturecontroller/index.jsx +++ b/src/menu/picturecontroller/index.jsx @@ -247,8 +247,7 @@ <div style={{display: 'inline-block'}}> <Button className="mk-border-purple" onClick={this.trigger}><PictureOutlined /> 璧勬簮绠$悊</Button> <Modal - title="璧勬簮绠$悊" - wrapClassName="picture-control-model" + wrapClassName="mk-pop-modal picture-control-model" visible={visible} width={1200} maskClosable={false} diff --git a/src/menu/picturecontroller/index.scss b/src/menu/picturecontroller/index.scss index 5cf5400..bfd7271 100644 --- a/src/menu/picturecontroller/index.scss +++ b/src/menu/picturecontroller/index.scss @@ -1,12 +1,4 @@ .picture-control-model { - .ant-modal { - top: 60px; - .ant-modal-body { - max-height: calc(100vh - 120px); - min-height: 510px; - padding: 10px 5px 24px; - } - } .ant-tabs-tabpane { padding-left: 3px; padding-right: 3px; diff --git a/src/menu/stylecombcontrolbutton/index.jsx b/src/menu/stylecombcontrolbutton/index.jsx index 6041a8d..1df5924 100644 --- a/src/menu/stylecombcontrolbutton/index.jsx +++ b/src/menu/stylecombcontrolbutton/index.jsx @@ -60,7 +60,7 @@ if (_type === 'cardcell') { _parent = _p - MKEmitter.emit('changeCombineStyle', ['margin', 'padding', 'border', 'background', 'font']) + MKEmitter.emit('switchMultiStyle', 'open') } else { let getParents = (box) => { box.components.forEach(item => { @@ -86,7 +86,7 @@ getParents(menu) } - MKEmitter.emit('changeCombineStyle', ['margin', 'padding', 'border', 'background']) + MKEmitter.emit('switchMultiStyle', 'open') } document.getElementById(card.uuid).classList.add('selected-control-element') @@ -108,7 +108,7 @@ } if (components.length === 0) { - MKEmitter.emit('closeCombineStyle') + MKEmitter.emit('switchMultiStyle', 'close') sessionStorage.setItem('style-control', 'true') } @@ -134,7 +134,7 @@ document.getElementById(item.uuid).classList.remove('selected-control-element') }) - MKEmitter.emit('closeCombineStyle') + MKEmitter.emit('switchMultiStyle', 'close') this.setState({label: '鎵归噺璋冩暣', parent: null, components: []}) } diff --git a/src/menu/stylecombcontroller/index.jsx b/src/menu/stylecombcontroller/index.jsx index c26c17d..4e06d4f 100644 --- a/src/menu/stylecombcontroller/index.jsx +++ b/src/menu/stylecombcontroller/index.jsx @@ -3,7 +3,6 @@ import { is, fromJS } from 'immutable' import { Collapse, Form, Col, InputNumber, Select, Radio, Drawer, Button } from 'antd' import { - ColumnHeightOutlined, FontSizeOutlined, BoldOutlined, LineHeightOutlined, @@ -44,7 +43,6 @@ } state = { - options: [], style: {}, borposition: 'outer' } @@ -54,8 +52,7 @@ } componentDidMount () { - MKEmitter.addListener('changeCombineStyle', this.initStyle) - MKEmitter.addListener('closeCombineStyle', this.closeStyle) + MKEmitter.addListener('switchMultiStyle', this.switchMultiStyle) } /** @@ -65,24 +62,21 @@ this.setState = () => { return } - MKEmitter.removeListener('changeCombineStyle', this.initStyle) - MKEmitter.removeListener('closeCombineStyle', this.closeStyle) + MKEmitter.removeListener('switchMultiStyle', this.switchMultiStyle) } - closeStyle = () => { - this.setState({ - visible: false, - options: [] - }) - } - - initStyle = (options) => { - this.setState({ - visible: true, - style: {}, - options: options, - borposition: 'outer' - }) + switchMultiStyle = (type) => { + if (type === 'open') { + this.setState({ + visible: true, + style: {}, + borposition: 'outer' + }) + } else { + this.setState({ + visible: false + }) + } } onCloseDrawer = () => { @@ -246,7 +240,6 @@ } render () { - const { options, borposition } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -275,19 +268,8 @@ > <div className="menu-combine-style-controller"> <Form {...formItemLayout}> - <Collapse expandIconPosition="right" destroyInactivePanel={true} defaultActiveKey={options[0]}> - {options.includes('height') ? <Panel header="楂樺害" key="height"> - <Col span={24}> - <Form.Item - colon={false} - label={<ColumnHeightOutlined title="楂樺害" />} - labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } - > - <StyleInput defaultValue={''} options={['px', 'vh', 'vw']} onChange={this.changeHeight}/> - </Form.Item> - </Col> - </Panel> : null} - {options.includes('font') ? <Panel header="瀛椾綋" key="font"> + <Collapse expandIconPosition="right" destroyInactivePanel={true} defaultActiveKey="margin"> + <Panel header="瀛椾綋" key="font"> <Col span={12}> <Form.Item colon={false} label={<FontSizeOutlined title="瀛椾綋澶у皬"/>}> <InputNumber defaultValue={''} min={12} max={100} precision={0} onChange={this.changeFontSize} /> @@ -371,8 +353,8 @@ </Radio.Group> </Form.Item> </Col> - </Panel> : null} - {options.includes('background') ? <Panel header="鑳屾櫙" key="background"> + </Panel> + <Panel header="鑳屾櫙" key="background"> <Col span={24}> <Form.Item colon={false} @@ -382,8 +364,8 @@ <ColorSketch onChange={this.changeBackgroundColor} /> </Form.Item> </Col> - </Panel> : null} - {options.includes('border') ? <Panel header="杈规" key="border"> + </Panel> + <Panel header="杈规" key="border"> <Col span={24}> <Form.Item colon={false} @@ -405,36 +387,12 @@ label={<BorderOuterOutlined title="杈规鏍峰紡"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - {borposition === 'outer' ? <Select defaultValue={'solid'} onChange={this.changeBorderStyle}> + <Select defaultValue={'solid'} onChange={this.changeBorderStyle}> <Option value="solid">瀹炵嚎</Option> <Option value="dotted">鐐瑰垝绾�</Option> <Option value="dashed">铏氱嚎</Option> <Option value="double">鍙岀嚎</Option> - </Select> : null} - {borposition === 'left' ? <Select defaultValue={'solid'} onChange={this.changeBorderStyle}> - <Option value="solid">瀹炵嚎</Option> - <Option value="dotted">鐐瑰垝绾�</Option> - <Option value="dashed">铏氱嚎</Option> - <Option value="double">鍙岀嚎</Option> - </Select> : null} - {borposition === 'right' ? <Select defaultValue={'solid'} onChange={this.changeBorderStyle}> - <Option value="solid">瀹炵嚎</Option> - <Option value="dotted">鐐瑰垝绾�</Option> - <Option value="dashed">铏氱嚎</Option> - <Option value="double">鍙岀嚎</Option> - </Select> : null} - {borposition === 'top' ? <Select defaultValue={'solid'} onChange={this.changeBorderStyle}> - <Option value="solid">瀹炵嚎</Option> - <Option value="dotted">鐐瑰垝绾�</Option> - <Option value="dashed">铏氱嚎</Option> - <Option value="double">鍙岀嚎</Option> - </Select> : null} - {borposition === 'bottom' ? <Select defaultValue={'solid'} onChange={this.changeBorderStyle}> - <Option value="solid">瀹炵嚎</Option> - <Option value="dotted">鐐瑰垝绾�</Option> - <Option value="dashed">铏氱嚎</Option> - <Option value="double">鍙岀嚎</Option> - </Select> : null} + </Select> </Form.Item> </Col> <Col span={24}> @@ -443,11 +401,7 @@ label={<ColumnWidthOutlined title="杈规瀹藉害"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - {borposition === 'outer' ? <StyleInput defaultValue={''} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'left' ? <StyleInput defaultValue={''} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'right' ? <StyleInput defaultValue={''} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'top' ? <StyleInput defaultValue={''} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'bottom' ? <StyleInput defaultValue={''} options={['px']} onChange={this.changeBorderWidth}/> : null} + <StyleInput defaultValue={''} options={['px']} onChange={this.changeBorderWidth}/> </Form.Item> </Col> <Col span={24}> @@ -456,11 +410,7 @@ label={<BgColorsOutlined title="杈规棰滆壊"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - {borposition === 'outer' ? <ColorSketch onChange={this.changeBorderColor} /> : null} - {borposition === 'left' ? <ColorSketch onChange={this.changeBorderColor} /> : null} - {borposition === 'right' ? <ColorSketch onChange={this.changeBorderColor} /> : null} - {borposition === 'top' ? <ColorSketch onChange={this.changeBorderColor} /> : null} - {borposition === 'bottom' ? <ColorSketch onChange={this.changeBorderColor} /> : null} + <ColorSketch onChange={this.changeBorderColor} /> </Form.Item> </Col> <Col span={24}> @@ -472,8 +422,8 @@ <StyleInput defaultValue={'0px'} options={['px', '%']} onChange={(val) => this.changeNormalStyle(val, 'borderRadius')}/> </Form.Item> </Col> - </Panel> : null} - {options.includes('shadow') ? <Panel header="闃村奖" key="shadow"> + </Panel> + <Panel header="闃村奖" key="shadow"> <Col span={24}> <Form.Item colon={false} @@ -483,8 +433,8 @@ <ColorSketch onChange={this.changeShadowColor} /> </Form.Item> </Col> - </Panel> : null} - {options.includes('margin') ? <Panel header="澶栬竟璺�" key="margin"> + </Panel> + <Panel header="澶栬竟璺�" key="margin"> <Col span={24}> <Form.Item colon={false} @@ -521,8 +471,8 @@ <StyleInput defaultValue={''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginRight')}/> </Form.Item> </Col> - </Panel> : null} - {options.includes('padding') ? <Panel header="鍐呰竟璺�" key="padding"> + </Panel> + <Panel header="鍐呰竟璺�" key="padding"> <Col span={24}> <Form.Item colon={false} @@ -559,7 +509,7 @@ <StyleInput defaultValue={''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingRight')}/> </Form.Item> </Col> - </Panel> : null} + </Panel> </Collapse> </Form> <div style={{textAlign: 'right'}}> diff --git a/src/menu/sysinterface/index.jsx b/src/menu/sysinterface/index.jsx index c24c4b0..5269b49 100644 --- a/src/menu/sysinterface/index.jsx +++ b/src/menu/sysinterface/index.jsx @@ -181,7 +181,6 @@ return record }) - this.setState({ interfaces }) this.props.updateConfig({...config, interfaces}) @@ -233,7 +232,6 @@ destroyOnClose > <PlusOutlined key="add-interface" onClick={this.addInterface}/> - {/* <div style={{fontSize: '12px', position: 'relative', top: '20px'}}>娉細鎺ュ彛鎵ц瀹屾垚鍚庯紝浼氳Е鍙戦粯璁や笉鍔犺浇鐨勭粍浠跺埛鏂版暟鎹��</div> */} <EditTable key="manage-interface" actions={['copy']} type="interface" data={interfaces} columns={columns} onChange={this.changeScripts}/> </Modal> </div> diff --git a/src/menu/tableshell/card.jsx b/src/menu/tableshell/card.jsx index aa6116e..0015811 100644 --- a/src/menu/tableshell/card.jsx +++ b/src/menu/tableshell/card.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { useDrag, useDrop } from 'react-dnd' +import { useDrop } from 'react-dnd' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -7,48 +7,24 @@ const AntvTabs = asyncComponent(() => import('@/menu/components/tabs/antv-tabs')) const BaseTable = asyncComponent(() => import('@/menu/components/table/base-table')) -const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { - const originalIndex = findCard(id).index - const [{ isDragging }, drag] = useDrag({ - item: { type: 'menu', id, originalIndex }, - collect: monitor => ({ - isDragging: monitor.isDragging(), - }), - }) +const Card = ({ id, card, delCard, updateConfig }) => { const [, drop] = useDrop({ accept: 'menu', canDrop: () => true, drop: (item) => { - const { id: draggedId, originalIndex } = item - if (originalIndex === undefined) { - item.dropTargetId = id - } else if (draggedId) { - if (draggedId === id) return - const { index: originIndex } = findCard(draggedId) - - if (originIndex === -1) return - - const { index: overIndex } = findCard(id) - - moveCard(draggedId, overIndex) - } + item.dropTargetId = id } }) - let style = { opacity: 1} - if (isDragging) { - style = { opacity: 0.3} - } - const getCardComponent = () => { if (card.type === 'table') { - return (<BaseTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + return (<BaseTable card={card} updateConfig={updateConfig}/>) } else if (card.type === 'tabs') { return (<AntvTabs tabs={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } } return ( - <div className={'ant-col mk-component-card ant-col-' + (card.width || 24)} ref={node => drag(drop(node))} style={style}> + <div className={'ant-col mk-component-card ant-col-' + (card.width || 24)} ref={node => drop(node)}> {getCardComponent()} </div> ) diff --git a/src/menu/tableshell/index.jsx b/src/menu/tableshell/index.jsx index 0346d43..999d732 100644 --- a/src/menu/tableshell/index.jsx +++ b/src/menu/tableshell/index.jsx @@ -11,12 +11,6 @@ const Container = ({menu, handleList }) => { const [cards, setCards] = useState(menu.components) - const moveCard = (id, atIndex) => { - const { card, index } = findCard(id) - const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) - handleList({...menu, components: _cards}) - setCards(_cards) - } if (menu.components.length > cards.length) { setCards(menu.components) @@ -67,30 +61,13 @@ delete item.added // 鍒犻櫎缁勪欢娣诲姞鏍囪 return } - - let name = '' - let names = { - tabs: '鏍囩缁�' - } - let i = 1 - while (!name && names[item.component]) { - let _name = names[item.component] + i - if (menu.components.filter(com => com.name === _name).length === 0) { - name = _name - } - i++ - } - let newcard = { uuid: Utils.getuuid(), type: item.component, subtype: item.subtype, config: item.config, width: item.width || 24, - dataName: Utils.getdataName(), - name: name, - floor: 1, // 缁勪欢鐨勫眰绾� isNew: true // 鏂版坊鍔犳爣蹇楋紝鐢ㄤ簬鍒濆鍖� } @@ -119,7 +96,6 @@ id={card.uuid} key={card.uuid} card={card} - moveCard={moveCard} delCard={deleteCard} findCard={findCard} updateConfig={updateConfig} diff --git a/src/menu/urlfieldcomponent/index.scss b/src/menu/urlfieldcomponent/index.scss index 0a3a73a..0f1ad12 100644 --- a/src/menu/urlfieldcomponent/index.scss +++ b/src/menu/urlfieldcomponent/index.scss @@ -2,6 +2,7 @@ margin-bottom: 15px; .field-plus { line-height: 35px; + padding-left: 16px; >.anticon-plus { color: #26C281; padding: 2px 5px; diff --git a/src/mob/components/menubar/common-menubar/index.jsx b/src/mob/components/menubar/common-menubar/index.jsx index 0c8e7d0..09e5410 100644 --- a/src/mob/components/menubar/common-menubar/index.jsx +++ b/src/mob/components/menubar/common-menubar/index.jsx @@ -41,7 +41,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/mob/components/menubar/normal-menubar/index.jsx b/src/mob/components/menubar/normal-menubar/index.jsx index 796d173..3ccf007 100644 --- a/src/mob/components/menubar/normal-menubar/index.jsx +++ b/src/mob/components/menubar/normal-menubar/index.jsx @@ -46,7 +46,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/mob/components/navbar/normal-navbar/index.jsx b/src/mob/components/navbar/normal-navbar/index.jsx index ab69d33..71a53d9 100644 --- a/src/mob/components/navbar/normal-navbar/index.jsx +++ b/src/mob/components/navbar/normal-navbar/index.jsx @@ -35,7 +35,6 @@ format: 'object', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: card.dataName || '', name: card.name, subtype: card.subtype, setting: { interType: 'system' }, diff --git a/src/mob/components/official/index.jsx b/src/mob/components/official/index.jsx index 65e1ebd..dc25062 100644 --- a/src/mob/components/official/index.jsx +++ b/src/mob/components/official/index.jsx @@ -4,8 +4,6 @@ import { Popover } from 'antd' import { ToolOutlined, EditOutlined, FontColorsOutlined, DeleteOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { resetStyle } from '@/utils/utils-custom.js' import asyncIconComponent from '@/utils/asyncIconComponent' import getWrapForm from './options' @@ -22,10 +20,7 @@ deletecomponent: PropTypes.func } - state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - visible: false, // 妯℃�佹鎺у埗 - } + state = {} /** * @description 鎼滅储鏉′欢鍒濆鍖� diff --git a/src/mob/components/search/single-search/index.jsx b/src/mob/components/search/single-search/index.jsx index 11a0f10..95feec1 100644 --- a/src/mob/components/search/single-search/index.jsx +++ b/src/mob/components/search/single-search/index.jsx @@ -4,8 +4,6 @@ import { Popover, Input, Button } from 'antd' import { ToolOutlined, ScanOutlined, EditOutlined, FontColorsOutlined, DeleteOutlined, SearchOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { resetStyle } from '@/utils/utils-custom.js' import asyncIconComponent from '@/utils/asyncIconComponent' import getWrapForm from './options' @@ -21,13 +19,7 @@ deletecomponent: PropTypes.func } - state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - sqlVerifing: false, // sql楠岃瘉涓� - visible: false, // 妯℃�佹鎺у埗 - showField: false, - editcard: null // 缂栬緫涓厓绱� - } + state = {} /** * @description 鎼滅储鏉′欢鍒濆鍖� diff --git a/src/mob/components/tabs/antv-tabs/index.scss b/src/mob/components/tabs/antv-tabs/index.scss index 32eddf3..e05f050 100644 --- a/src/mob/components/tabs/antv-tabs/index.scss +++ b/src/mob/components/tabs/antv-tabs/index.scss @@ -18,6 +18,7 @@ } .ant-tabs-bar.ant-tabs-top-bar { + min-height: 32px; margin-bottom: 0; } .ant-tabs.ant-tabs-left, .ant-tabs.ant-tabs-bottom { diff --git a/src/mob/components/tabs/tabcomponents/index.jsx b/src/mob/components/tabs/tabcomponents/index.jsx index 84ee423..8cd28e1 100644 --- a/src/mob/components/tabs/tabcomponents/index.jsx +++ b/src/mob/components/tabs/tabcomponents/index.jsx @@ -137,7 +137,6 @@ subtype: item.subtype, config: item.config, width: item.width || 24, - dataName: Utils.getdataName(), name: name, isNew: true // 鏂版坊鍔犳爣蹇楋紝鐢ㄤ簬鍒濆鍖� } diff --git a/src/mob/mobshell/index.jsx b/src/mob/mobshell/index.jsx index 2df7f73..9a40744 100644 --- a/src/mob/mobshell/index.jsx +++ b/src/mob/mobshell/index.jsx @@ -168,7 +168,6 @@ subtype: item.subtype, config: item.config, width: item.width || 24, - dataName: Utils.getdataName(), name: name, floor: 1, // 缁勪欢鐨勫眰绾� isNew: true // 鏂版坊鍔犳爣蹇楋紝鐢ㄤ簬鍒濆鍖� diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index 2476590..ca395cc 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -9,8 +9,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getModalForm } from '@/templates/zshare/formconfig' import SourceElement from '@/templates/modalconfig/dragelement/source' @@ -22,7 +20,6 @@ const { Panel } = Collapse const { confirm } = Modal -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const PasteComponent = asyncComponent(() => import('./pastecomponent')) const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) const DragElement = asyncComponent(() => import('@/mob/components/formdragelement')) @@ -36,7 +33,6 @@ } state = { - dict: CommonDict, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆锛屽寘鎷ā鏉跨被鍨嬨�佹ā鎬佹璁剧疆銆佹坊鍔犺〃鍚嶃�佽〃鍗曞垪琛� visible: false, // 琛ㄥ崟缂栬緫妯℃�佹锛屾樉绀烘帶鍒� formlist: null, // 琛ㄥ崟缂栬緫妯℃�佹锛屽彲缂栬緫瀛楁 @@ -443,14 +439,14 @@ render () { const { btn } = this.props - const { config, dict, saving } = this.state + const { config, saving } = this.state return ( <div className="mob-form-board"> <DndProvider backend={HTML5Backend}> <div className="tools"> <Collapse accordion defaultActiveKey="1" bordered={false}> - <Panel header={dict['header.menu.form']} key="1"> + <Panel header="琛ㄥ崟" key="1"> <div className="search-element"> {SearchItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -466,7 +462,7 @@ <Button onClick={this.cancelConfig}>杩斿洖</Button> <PasteComponent config={config} updateConfig={this.insert} /> <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button> - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> </div> <div className="setting"> <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> @@ -480,7 +476,6 @@ list={config.fields} setting={config.setting} showField={this.state.showField} - placeholder={this.state.dict['header.form.modal.placeholder']} handleList={this.handleList} handleForm={this.handleForm} closeForm={this.closeForm} @@ -492,7 +487,7 @@ </div> </DndProvider> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={950} maskClosable={false} @@ -502,7 +497,6 @@ destroyOnClose > <ModalForm - dict={this.state.dict} card={this.state.card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -511,7 +505,7 @@ /> </Modal> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.settingVisible} width={900} maskClosable={false} @@ -521,7 +515,6 @@ > <SettingForm config={config} - dict={this.state.dict} isSubTab={!!this.props.editTab} inputSubmit={this.settingSave} wrappedComponentRef={(inst) => this.settingRef = inst} diff --git a/src/mob/modalconfig/source.jsx b/src/mob/modalconfig/source.jsx index 5a1a31a..04ed6a4 100644 --- a/src/mob/modalconfig/source.jsx +++ b/src/mob/modalconfig/source.jsx @@ -1,18 +1,13 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - export const SearchItems = [ { type: 'form', - label: CommonDict['model.form.text'], + label: '鏂囨湰', subType: 'text', url: '' }, { type: 'form', - label: CommonDict['model.form.number'], + label: '鏁板瓧', subType: 'number', url: '' }, @@ -24,7 +19,7 @@ }, { type: 'form', - label: CommonDict['model.form.link'], + label: '鑱斿姩鑿滃崟', subType: 'link', url: '' }, @@ -66,13 +61,13 @@ }, { type: 'form', - label: CommonDict['model.form.datemonth'], + label: '鏃ユ湡锛堟湀锛�', subType: 'datemonth', url: '' }, { type: 'form', - label: CommonDict['model.form.textarea'], + label: '澶氳鏂囨湰', subType: 'textarea', url: '' }, @@ -89,7 +84,7 @@ }, { type: 'form', - label: CommonDict['header.form.funcvar'], + label: '鍑芥暟鍙橀噺', subType: 'funcvar', url: '' }, diff --git a/src/mob/searchconfig/index.jsx b/src/mob/searchconfig/index.jsx index ff9ea70..ac35cb7 100644 --- a/src/mob/searchconfig/index.jsx +++ b/src/mob/searchconfig/index.jsx @@ -9,8 +9,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getSearchForm } from '@/templates/zshare/formconfig' import SourceElement from '@/templates/modalconfig/dragelement/source' import SettingForm from './settingform' @@ -35,7 +33,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆锛屽寘鎷ā鏉跨被鍨嬨�佹ā鎬佹璁剧疆銆佹坊鍔犺〃鍚嶃�佽〃鍗曞垪琛� visible: false, // 琛ㄥ崟缂栬緫妯℃�佹锛屾樉绀烘帶鍒� formlist: null, // 琛ㄥ崟缂栬緫妯℃�佹锛屽彲缂栬緫瀛楁 @@ -485,14 +482,14 @@ } render () { - const { dict, group, editGroup, saving } = this.state + const { group, editGroup, saving } = this.state return ( <div className="mob-search-board"> <DndProvider backend={HTML5Backend}> <div className="tools"> <Collapse accordion defaultActiveKey="1" bordered={false}> - <Panel header={dict['header.menu.form']} key="1"> + <Panel header="鎼滅储鏉′欢" key="1"> <div className="search-element"> {SearchItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -506,7 +503,7 @@ <Button onClick={this.cancelConfig}>鍏抽棴</Button> {!group.floor ? <Button onClick={this.returnUp}>杩斿洖涓婄骇</Button> : null} <PasteComponent insert={this.insert} /> - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> </div> <div className="setting"> <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> @@ -546,7 +543,7 @@ </div> </DndProvider> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={850} onCancel={this.editModalCancel} @@ -555,7 +552,6 @@ destroyOnClose > <SearchForm - dict={this.state.dict} card={this.state.card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -563,7 +559,7 @@ /> </Modal> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.settingVisible} width={850} maskClosable={false} @@ -578,7 +574,7 @@ /> </Modal> <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.gVisible} width={600} maskClosable={false} diff --git a/src/pc/components/login/normal-login/index.jsx b/src/pc/components/login/normal-login/index.jsx index cbcc124..683d9dc 100644 --- a/src/pc/components/login/normal-login/index.jsx +++ b/src/pc/components/login/normal-login/index.jsx @@ -38,7 +38,6 @@ type: card.type, tabId: card.tabId || '', parentId: card.parentId || '', - dataName: card.dataName || '', width: card.width || 24, name: card.name, subtype: card.subtype, diff --git a/src/pc/components/navbar/normal-navbar/index.jsx b/src/pc/components/navbar/normal-navbar/index.jsx index 18f8e48..474c8f1 100644 --- a/src/pc/components/navbar/normal-navbar/index.jsx +++ b/src/pc/components/navbar/normal-navbar/index.jsx @@ -34,7 +34,6 @@ let _card = { uuid: card.uuid, type: card.type, - dataName: card.dataName || '', name: card.name, subtype: card.subtype, wrap: { name: card.name, width: card.width || 1200, height: 50 }, diff --git a/src/pc/components/navbar/normal-navbar/linksetting/index.jsx b/src/pc/components/navbar/normal-navbar/linksetting/index.jsx index fa5449b..666593f 100644 --- a/src/pc/components/navbar/normal-navbar/linksetting/index.jsx +++ b/src/pc/components/navbar/normal-navbar/linksetting/index.jsx @@ -4,8 +4,6 @@ import { Modal } from 'antd' import { LinkOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import LinkTable from './linktable' import './index.scss' @@ -16,7 +14,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false } @@ -33,7 +30,7 @@ render () { const { config } = this.props - const { visible, dict } = this.state + const { visible } = this.state return ( <div className="model-link-setting-wrap"> @@ -44,7 +41,7 @@ visible={visible} width={950} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose diff --git a/src/pc/components/navbar/normal-navbar/menusetting/index.jsx b/src/pc/components/navbar/normal-navbar/menusetting/index.jsx index f965b23..5bf9bd1 100644 --- a/src/pc/components/navbar/normal-navbar/menusetting/index.jsx +++ b/src/pc/components/navbar/normal-navbar/menusetting/index.jsx @@ -4,8 +4,6 @@ import { Modal } from 'antd' import { MenuOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MenuTable from './menutable' import './index.scss' @@ -16,7 +14,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false } @@ -34,7 +31,7 @@ render () { const { config } = this.props - const { visible, dict } = this.state + const { visible } = this.state return ( <div className="model-menu-setting-wrap"> @@ -45,7 +42,7 @@ visible={visible} width={950} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose diff --git a/src/pc/createview/index.jsx b/src/pc/createview/index.jsx index 63e233f..44c6198 100644 --- a/src/pc/createview/index.jsx +++ b/src/pc/createview/index.jsx @@ -4,8 +4,6 @@ import { Button, Modal, notification } from 'antd' import moment from 'moment' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import Utils from '@/utils/utils.js' import MenuUtils from '@/utils/utils-custom.js' import SettingForm from './settingform' @@ -18,7 +16,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, loading: false } @@ -161,7 +158,15 @@ } if (_config.components) { - config.components = MenuUtils.resetConfig(_config.components, {}, res.clearMenu === 'true') + let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + if (_config.interfaces && _config.interfaces.length > 0) { + config.interfaces = _config.interfaces.map(inter => { + uuids[inter.uuid] = this.getuuid() + inter.uuid = uuids[inter.uuid] + return inter + }) + } + config.components = MenuUtils.resetConfig(_config.components, uuids, res.clearMenu === 'true') config.tables = _config.tables || [] config.style = _config.style || {} config.statusBarbgColor = _config.statusBarbgColor || '' @@ -198,7 +203,7 @@ render () { const { config } = this.props - const { visible, dict, loading } = this.state + const { visible, loading } = this.state return ( <div className="create-view"> @@ -208,14 +213,13 @@ visible={visible} width={600} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { this.setState({ visible: false }) }} confirmLoading={loading} destroyOnClose > <SettingForm - dict={dict} config={config} wrappedComponentRef={(inst) => this.verifyRef = inst} /> diff --git a/src/pc/createview/settingform/index.jsx b/src/pc/createview/settingform/index.jsx index eb82755..0405709 100644 --- a/src/pc/createview/settingform/index.jsx +++ b/src/pc/createview/settingform/index.jsx @@ -1,15 +1,10 @@ import React, {Component} from 'react' -import PropTypes from 'prop-types' import { Form, Row, Col, Select, Input, Tooltip, Radio } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' import './index.scss' class SettingForm extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - } - state = { appMenus: [], copymenuId: '' @@ -76,7 +71,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鑿滃崟鍚嶇О!' + message: '璇疯緭鍏ヨ彍鍗曞悕绉�!' } ] })(<Input placeholder="" autoComplete="off" />)} @@ -89,7 +84,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鑿滃崟鍙傛暟!' + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' } ] })(<Input placeholder="" autoComplete="off" />)} diff --git a/src/pc/menushell/index.jsx b/src/pc/menushell/index.jsx index 33df2ba..b56f0f6 100644 --- a/src/pc/menushell/index.jsx +++ b/src/pc/menushell/index.jsx @@ -139,7 +139,6 @@ subtype: item.subtype, config: item.config, width: item.width || 24, - dataName: Utils.getdataName(), name: name, floor: 1, // 缁勪欢鐨勫眰绾� isNew: true // 鏂版坊鍔犳爣蹇楋紝鐢ㄤ簬鍒濆鍖� diff --git a/src/pc/quotecomponent/index.jsx b/src/pc/quotecomponent/index.jsx index 1054d31..11a7a0e 100644 --- a/src/pc/quotecomponent/index.jsx +++ b/src/pc/quotecomponent/index.jsx @@ -3,8 +3,6 @@ import { is, fromJS } from 'immutable' import { Button, Modal, notification } from 'antd' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import SettingForm from './settingform' import Api from '@/api' import './index.scss' @@ -16,7 +14,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: false, } @@ -100,23 +97,22 @@ render () { const { config } = this.props - const { visible, dict } = this.state + const { visible } = this.state return ( <div className="quote-wrap"> - <Button icon="appstore" onClick={() => {this.setState({visible: true})}}>缁勪欢寮曠敤</Button> + <Button icon="appstore" onClick={() => {this.setState({visible: true})}}>鍏宠仈鑿滃崟鏍�</Button> <Modal - title="缁勪欢寮曠敤" + title="鍏宠仈鑿滃崟鏍�" visible={visible} width={500} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose > <SettingForm - dict={dict} config={config} wrappedComponentRef={(inst) => this.verifyRef = inst} /> diff --git a/src/pc/quotecomponent/settingform/index.jsx b/src/pc/quotecomponent/settingform/index.jsx index 6ab0f32..14f2f3e 100644 --- a/src/pc/quotecomponent/settingform/index.jsx +++ b/src/pc/quotecomponent/settingform/index.jsx @@ -1,12 +1,7 @@ import React, {Component} from 'react' -import PropTypes from 'prop-types' import { Form, Row, Col, Select } from 'antd' class SettingForm extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - } - state = { appMenus: [] } @@ -61,12 +56,12 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col span={20}> - <Form.Item label="鑿滃崟"> + <Form.Item label="鑿滃崟鏍�"> {getFieldDecorator('menu', { initialValue: '', rules: [{ required: true, - message: '璇烽�夋嫨鑿滃崟!' + message: '璇烽�夋嫨鑿滃崟鏍�!' }] })( <Select> diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx index cd7b465..110ad1f 100644 --- a/src/tabviews/calendar/index.jsx +++ b/src/tabviews/calendar/index.jsx @@ -436,6 +436,10 @@ param.secretkey = Utils.encrypt(param.LText, param.timestamp) param.DateCount = '' + if (window.GLOB.probation) { + param.s_debug_type = 'Y' + } + if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) } diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index e9aa506..c027da2 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -289,6 +289,11 @@ async loadData (hastimer) { const { config, arr_field, BID, BData } = this.state + if (config.wrap.datatype === 'public') { + MKEmitter.emit('reloadData', config.wrap.publicId) + return + } + if (config.wrap.datatype === 'static') { this.setState({ data: {$$BID: BID || '', $$BData: BData, $$empty: true}, diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index df3a4e9..dca2e78 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -12,6 +12,7 @@ import Encrypts from '@/components/encrypts' import './index.scss' +moment.suppressDeprecationWarnings = true const { Paragraph } = Typography const NormalButton = asyncComponent(() => import('@/tabviews/zshare/actionList/normalbutton')) const ExcelInButton = asyncComponent(() => import('@/tabviews/zshare/actionList/excelInbutton')) diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 4f4c46c..69708a2 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -140,6 +140,12 @@ this.checkTopLine() }, 200) } + + if (!_config.wrap.cardType && _data.$$uuid) { + setTimeout(() => { + this.transferLine() + }, 200) + } }) } @@ -199,9 +205,9 @@ this.setState({sync: false, data: _data}, () => { if (selected !== 'false') { - setTimeout(() => { - this.checkTopLine() - }, 200) + this.checkTopLine() + } else if (!config.wrap.cardType && _data.$$uuid) { + this.transferLine() } }) } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { @@ -223,9 +229,9 @@ this.setState({data: _data}, () => { if (selected !== 'false') { - setTimeout(() => { - this.checkTopLine() - }, 200) + this.checkTopLine() + } else { + this.transferLine() } }) } @@ -247,6 +253,14 @@ } MKEmitter.emit('resetSelectLine', config.uuid, primaryId, data) + } + + transferLine = () => { + const { config, data } = this.state + + if (config.wrap.cardType) return + + MKEmitter.emit('resetSelectLine', config.uuid, data.$$uuid || '', data) } /** @@ -314,6 +328,11 @@ const { mainSearch } = this.props const { config, arr_field, BID, BData, selected } = this.state + if (config.wrap.datatype === 'public') { + MKEmitter.emit('reloadData', config.wrap.publicId) + return + } + if (config.wrap.datatype === 'static') { this.setState({ data: {$$BID: BID || '', $$BData: BData, $$empty: true}, @@ -362,6 +381,8 @@ }, () => { if (selected !== 'false') { this.checkTopLine() + } else { + this.transferLine() } }) diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index 4cb466d..2e6524a 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -1178,7 +1178,7 @@ view1.scale('value', c) view1.axis('value', plot.$yc) - view1.legend(false) + // view1.legend(false) let colorIndex = 0 @@ -1312,7 +1312,7 @@ } view2.data(dv.rows) - view2.legend(false) + // view2.legend(false) plot.customs.forEach(item => { if (item.chartType === 'bar' && !plot.Bar_axis) { diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index 9c86c8a..c8e1631 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -58,7 +58,7 @@ if (!item.setting || item.setting.interType !== 'system') return if (!item.format) return - if (item.dataName && (!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && item.setting.sync === 'true') { + if ((!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && item.setting.sync === 'true') { let searchlist = [] if (item.search && item.search.length > 0) { searchlist = Utils.initMainSearch(item.search) diff --git a/src/tabviews/custom/components/interfaces/interItem/index.jsx b/src/tabviews/custom/components/interfaces/interItem/index.jsx index 1cf8c19..9253bd9 100644 --- a/src/tabviews/custom/components/interfaces/interItem/index.jsx +++ b/src/tabviews/custom/components/interfaces/interItem/index.jsx @@ -15,6 +15,8 @@ config: PropTypes.object, // 閰嶇疆淇℃伅 } + loading = false + state = {} componentDidMount () { @@ -27,6 +29,8 @@ setTimeout(() => { this.loadData() }, config.setting.delay) + + MKEmitter.addListener('reloadData', this.reloadData) } shouldComponentUpdate (nextProps, nextState) { return false } @@ -39,15 +43,27 @@ return } this.timer && this.timer.stop() + MKEmitter.removeListener('reloadData', this.reloadData) + } + + reloadData = (publicId) => { + if (this.props.config.uuid !== publicId) return + + this.loadData() } async loadData () { const { config, BID } = this.props + if (this.loading) return + + this.loading = true + let param = UtilsDM.getQueryDataParams(config.setting, config.columns.map(col => col.field).join(','), [], config.setting.order, 1, 1, BID) let result = await Api.genericInterface(param) if (result.status) { + this.loading = false let _data = { $$empty: true } if (result.data && result.data[0]) { @@ -56,8 +72,11 @@ _data.$$loaded = true + window.GLOB.CacheData.set(config.uuid, _data) + MKEmitter.emit('mkPublicData', config.uuid, _data) } else { + this.loading = false this.timer && this.timer.stop() notification.error({ top: 92, diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 1ce33c9..cf08b7d 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -74,7 +74,7 @@ if (!item.setting || item.setting.interType !== 'system') return if (!item.format) return - if (item.dataName && (!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && item.setting.sync === 'true') { + if ((!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && item.setting.sync === 'true') { let searchlist = [] if (item.search && item.search.length > 0) { searchlist = Utils.initMainSearch(item.search) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 2f6eafe..fe59442 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -900,10 +900,14 @@ component.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 - // floor 缁勪欢鐨勫眰绾� // dataName 绯荤粺鐢熸垚鐨勬暟鎹簮鍚嶇О + if (component.setting.sync === 'true') { + component.dataName = Utils.getdataName() + } + + // floor 缁勪欢鐨勫眰绾� // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ - if (params && component.dataName && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') { + if (params && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') { let searchlist = [] if (component.search && component.search.length > 0) { searchlist = Utils.initMainSearch(component.search) diff --git a/src/tabviews/debugtable/index.jsx b/src/tabviews/debugtable/index.jsx index b6833f5..3dcaf14 100644 --- a/src/tabviews/debugtable/index.jsx +++ b/src/tabviews/debugtable/index.jsx @@ -1,7 +1,6 @@ import React, {Component} from 'react' import { is, fromJS } from 'immutable' -import { notification, Table} from 'antd' -import { RedoOutlined } from '@ant-design/icons' +import { notification, Table, Button} from 'antd' import Api from '@/api' import MKEmitter from '@/utils/events.js' @@ -12,7 +11,7 @@ class DebugTable extends Component { state = { columns: [ - {align: 'left', dataIndex: 'Sort', sorter: false, title: 'Sort', width: 120}, + {align: 'left', dataIndex: 'Sort', sorter: false, title: 'Sort', width: 60}, {align: 'left', dataIndex: 'CDefine1', sorter: false, title: '鏂囨湰1', width: 120}, {align: 'left', dataIndex: 'CDefine2', sorter: false, title: '鏂囨湰2', width: 120}, {align: 'left', dataIndex: 'CDefine3', sorter: false, title: '鏂囨湰3', width: 120}, @@ -20,6 +19,7 @@ {align: 'left', dataIndex: 'CDefine5', sorter: false, title: '鏂囨湰5', width: 120}, {align: 'left', dataIndex: 'CDefine6', sorter: false, title: '鏂囨湰6', width: 120}, {align: 'left', dataIndex: 'CDefine7', sorter: false, title: '鏂囨湰7', width: 120}, + {align: 'left', dataIndex: 'createdate', sorter: false, title: 'createDate', width: 120}, ], data: [], loading: false, @@ -28,7 +28,7 @@ execute: true, dataresource: '(select * from s_debug_value_log where createuserid=@userid@) tb' }, - arr_field: 'ID,Sort,CDefine1,CDefine2,CDefine3,CDefine4,CDefine5,CDefine6,CDefine7' + arr_field: 'ID,Sort,CDefine1,CDefine2,CDefine3,CDefine4,CDefine5,CDefine6,CDefine7,createdate' } /** @@ -107,7 +107,7 @@ return ( <div className="debugtable"> - <RedoOutlined className="mk-debug-reload" onClick={() => this.loadmaindata()}/> + <Button className="mk-debug-reload" onClick={() => this.loadmaindata()}>鍒锋柊</Button> <Table size="middle" columns={columns} dataSource={data} pagination={false} loading={loading} scroll={{ x: '100%', y: false }}/> </div> ) diff --git a/src/tabviews/debugtable/index.scss b/src/tabviews/debugtable/index.scss index 773c2c0..0dbe1a4 100644 --- a/src/tabviews/debugtable/index.scss +++ b/src/tabviews/debugtable/index.scss @@ -1,14 +1,19 @@ .debugtable { position: relative; min-height: 200px; - margin: 20px; + padding: 20px; + background: #ffffff; + .ant-table-thead > tr > th { + color: #ffffff; + background: var(--mk-sys-color); + } .mk-debug-reload { - color: var(--mk-sys-color); - position: absolute; - z-index: 1; - top: 5px; - right: 10px; + color: #ffffff; + background: red; + border-color: red; + margin-bottom: 10px; + height: 28px; font-size: 16px; } } diff --git a/src/tabviews/formtab/index.jsx b/src/tabviews/formtab/index.jsx index 339e762..0b54f01 100644 --- a/src/tabviews/formtab/index.jsx +++ b/src/tabviews/formtab/index.jsx @@ -437,6 +437,10 @@ param.secretkey = Utils.encrypt(param.LText, param.timestamp) param.DateCount = '' + if (window.GLOB.probation) { + param.s_debug_type = 'Y' + } + if (!window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) } diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index 01f08c0..af7f8d7 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -197,6 +197,13 @@ sessionStorage.setItem('organization', res.organization || '') sessionStorage.setItem('mk_user_type', res.mk_user_type || '') sessionStorage.setItem('localRole_id', res.role_id || '') + + if (res.paas_externalDatabase) { + sessionStorage.setItem('externalDatabase', res.paas_externalDatabase) + window.GLOB.externalDatabase = `[${res.paas_externalDatabase}]..` + } else { + sessionStorage.removeItem('externalDatabase') + } sessionStorage.removeItem('CloudAvatar') sessionStorage.removeItem('cloudDataM') diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index a64d39f..0450dce 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -765,13 +765,11 @@ let customScript = setting.customScript || '' let _dataresource = setting.dataresource || '' let queryType = setting.queryType - let transaction = setting.transaction if (btn.verify.dataType === 'custom') { defaultSql = btn.verify.defaultSql || 'true' _dataresource = btn.verify.dataresource || '' queryType = btn.verify.queryType - transaction = btn.verify.transaction if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' @@ -920,10 +918,6 @@ if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) - } - - if (transaction === 'true') { - param.func = 'sPC_Get_TableData_try' } return param diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index daa91b3..9555b03 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -258,23 +258,39 @@ if (item.regular) { if (item.regular === 'number') { + let reg = /^[0-9.-]*$/ + if (item.regularExtra) { + reg = new RegExp('^[0-9.-' + item.regularExtra.replace(/\.|-/g, '') + ']*$') + } _rules.push({ - pattern: /^[0-9.-]*$/, + pattern: reg, message: item.regularText || formRule.input.numbermsg }) } else if (item.regular === 'letter') { + let reg = /^[a-zA-Z]*$/ + if (item.regularExtra) { + reg = new RegExp('^[a-zA-Z' + item.regularExtra + ']*$') + } _rules.push({ - pattern: /^[a-zA-Z]*$/, + pattern: reg, message: item.regularText || formRule.input.lettermsg }) } else if (item.regular === 'letter_number') { + let reg = /^[a-zA-Z0-9]*$/ + if (item.regularExtra) { + reg = new RegExp('^[a-zA-Z0-9' + item.regularExtra + ']*$') + } _rules.push({ - pattern: /^[a-zA-Z0-9]*$/, + pattern: reg, message: item.regularText || '璇疯緭鍏ユ暟瀛楁垨瀛楁瘝' }) } else if (item.regular === 'letter&number') { + let reg = /^[a-zA-Z0-9@_.]*$/ + if (item.regularExtra) { + reg = new RegExp('^[a-zA-Z0-9@_.' + item.regularExtra.replace(/\.|_|@/g, '') + ']*$') + } _rules.push({ - pattern: /^[a-zA-Z0-9@_.]*$/, + pattern: reg, message: item.regularText || '璇疯緭鍏ユ暟瀛椼�佸瓧姣嶄互鍙夽_.' }) } else if (item.regular === 'phone') { diff --git a/src/tabviews/zshare/settingcomponent/editTable/index.jsx b/src/tabviews/zshare/settingcomponent/editTable/index.jsx index 818744c..4596721 100644 --- a/src/tabviews/zshare/settingcomponent/editTable/index.jsx +++ b/src/tabviews/zshare/settingcomponent/editTable/index.jsx @@ -3,11 +3,8 @@ import { Table, Form, Select, Cascader } from 'antd' import { EditOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import './index.scss' -let eTDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const EditableContext = React.createContext() const shortkeycode = { 65: 'A', 66: 'B', 67: 'C', 68: 'D', 69: 'E', 70: 'F', 71: 'G', 72: 'H', 73: 'I', 74: 'J', 75: 'K', 76: 'L', 77: 'M', @@ -103,11 +100,11 @@ <EditableContext.Consumer> {form => ( <span onClick={() => this.save(form, record.uuid)} style={{ marginRight: 8 , color: '#1890ff', cursor: 'pointer'}}> - {eTDict['model.save']} + 淇濆瓨 </span> )} </EditableContext.Consumer> - <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>{eTDict['model.cancel']}</span> + <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>鍙栨秷</span> </div> ) : ( <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px'}}> @@ -141,11 +138,11 @@ <EditableContext.Consumer> {form => ( <span onClick={() => this.save(form, record.uuid, record.parentId)} style={{ marginRight: 8 , color: '#1890ff', cursor: 'pointer'}}> - {eTDict['model.save']} + 淇濆瓨 </span> )} </EditableContext.Consumer> - <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>{eTDict['model.cancel']}</span> + <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>鍙栨秷</span> </div> ) : ( <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px'}}> diff --git a/src/templates/calendarconfig/calcomponent/calendarform/index.jsx b/src/templates/calendarconfig/calcomponent/calendarform/index.jsx index 6ee2fa0..2d1f32a 100644 --- a/src/templates/calendarconfig/calcomponent/calendarform/index.jsx +++ b/src/templates/calendarconfig/calcomponent/calendarform/index.jsx @@ -7,7 +7,6 @@ class MainTab extends Component { static propTpyes = { config: PropTypes.object, // 椤甸潰閰嶇疆 - dict: PropTypes.object, // 瀛楀吀椤� calendar: PropTypes.any // 鏃ュ巻閰嶇疆淇℃伅 } @@ -41,13 +40,13 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col span={24}> - <Form.Item label={'寮�濮嬫椂闂�'}> + <Form.Item label="寮�濮嬫椂闂�"> {getFieldDecorator('startfield', { initialValue: calendar.startfield, rules: [ { required: true, - message: this.props.dict['form.required.select'] + '寮�濮嬫椂闂�!' + message: '璇烽�夋嫨寮�濮嬫椂闂�!' } ] })( @@ -60,13 +59,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={'缁撴潫鏃堕棿'}> + <Form.Item label="缁撴潫鏃堕棿"> {getFieldDecorator('endfield', { initialValue: calendar.endfield, rules: [ { required: true, - message: this.props.dict['form.required.select'] + '缁撴潫鏃堕棿!' + message: '璇烽�夋嫨缁撴潫鏃堕棿!' } ] })( @@ -79,13 +78,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={'淇℃伅瀛楁'}> + <Form.Item label="淇℃伅瀛楁"> {getFieldDecorator('remarkfield', { initialValue: calendar.remarkfield, rules: [ { required: true, - message: this.props.dict['form.required.select'] + '淇℃伅瀛楁!' + message: '璇烽�夋嫨淇℃伅瀛楁!' } ] })( @@ -98,13 +97,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={'棰滆壊瀛楁'}> + <Form.Item label="棰滆壊瀛楁"> {getFieldDecorator('colorfield', { initialValue: calendar.colorfield, rules: [ { required: false, - message: this.props.dict['form.required.select'] + '棰滆壊瀛楁!' + message: '璇烽�夋嫨棰滆壊瀛楁!' } ] })( @@ -117,13 +116,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={'鏃ュ巻绛夌骇'}> + <Form.Item label="鏃ュ巻绛夌骇"> {getFieldDecorator('levels', { initialValue: calendar.levels, rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鏃ュ巻绛夌骇!' + message: '璇烽�夋嫨鏃ュ巻绛夌骇!' } ] })( diff --git a/src/templates/calendarconfig/calcomponent/index.jsx b/src/templates/calendarconfig/calcomponent/index.jsx index fd2343c..4a475c3 100644 --- a/src/templates/calendarconfig/calcomponent/index.jsx +++ b/src/templates/calendarconfig/calcomponent/index.jsx @@ -4,8 +4,6 @@ import { Modal } from 'antd' import { EditOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import CalendarForm from './calendarform' import './index.scss' @@ -17,7 +15,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, calendar: null, // 鏃ュ巻璁剧疆 visible: false, // 妯℃�佹鎺у埗 } @@ -66,7 +63,7 @@ render() { const { config } = this.props - const { dict, visible, calendar } = this.state + const { visible, calendar } = this.state return ( <div className="model-calendar-setting"> @@ -83,7 +80,6 @@ destroyOnClose > <CalendarForm - dict={dict} config={config} calendar={calendar} wrappedComponentRef={(inst) => this.calendarRef = inst} diff --git a/src/templates/calendarconfig/index.jsx b/src/templates/calendarconfig/index.jsx index 272e505..72e72cb 100644 --- a/src/templates/calendarconfig/index.jsx +++ b/src/templates/calendarconfig/index.jsx @@ -8,8 +8,6 @@ import moment from 'moment' import Api from '@/api' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import Utils from '@/utils/utils.js' @@ -41,7 +39,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆 visible: false, // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪锛屾ā鎬佹鏄剧ず鎺у埗 fields: null, // 鎼滅储鏉′欢鍙婃樉绀哄垪锛屽彲閫夊瓧娈� @@ -310,7 +307,7 @@ if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) { notification.warning({ top: 92, - message: this.state.dict['model.menu.basemsg'], + message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', duration: 5 }) this.setState({activeKey: '0'}) @@ -568,7 +565,7 @@ if (config.isAdd) { // 鏂板缓鑿滃崟锛屾彁绀鸿彍鍗曞皻鏈繚瀛� notification.warning({ top: 92, - message: this.state.dict['header.menu.config.notsave'], + message: '鑿滃崟灏氭湭淇濆瓨锛岃鍏堜繚瀛樿彍鍗曢厤缃紒', duration: 5 }) } else { @@ -576,7 +573,7 @@ if (!config.fstMenuId || !config.ParentId || !config.MenuName || !config.MenuNo) { notification.warning({ top: 92, - message: this.state.dict['model.menu.basemsg'], + message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', duration: 5 }) this.setState({activeKey: '0'}) @@ -586,7 +583,7 @@ if (!is(fromJS(originMenu), fromJS(config))) { // 鑿滃崟淇℃伅鍙樺寲鏃讹紝鎻愮ず淇濆瓨 notification.warning({ top: 92, - message: this.state.dict['header.menu.config.update'], + message: '鑿滃崟閰嶇疆宸蹭慨鏀癸紝璇蜂繚瀛橈紒', duration: 5 }) return @@ -774,12 +771,11 @@ <div className="tools"> <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> {/* 鍩烘湰淇℃伅 */} - <Panel forceRender={true} header={'鏍囩鍩烘湰淇℃伅'} key="0" id="subtable-basedata"> + <Panel forceRender={true} header="鍩烘湰淇℃伅" key="0" id="subtable-basedata"> {/* 鑿滃崟淇℃伅 */} <MenuForm menu={menu} config={config} - dict={this.state.dict} updatemenu={this.updateconfig} /> {config ? <UrlFieldComponent @@ -794,7 +790,7 @@ /> </Panel> {/* 鎼滅储鏉′欢娣诲姞 */} - <Panel header={this.state.dict['header.menu.search']} key="1"> + <Panel header="鎼滅储" key="1"> <div className="search-element"> {Source.searchItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -812,9 +808,9 @@ </div> } bordered={false} extra={ <div> - <EditComponent dict={this.state.dict} type="table" options={['search', 'form']} config={this.state.config}/> + <EditComponent type="table" options={['search', 'form']} config={this.state.config}/> <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> + <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>鍏抽棴</Button> </div> } style={{ width: '100%' }}> @@ -845,13 +841,13 @@ visible={this.state.closeVisible} onCancel={() => { this.setState({closeVisible: false}) }} footer={[ - <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, - <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>{this.state.dict['model.notsave']}</Button>, - <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> + <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>淇濆瓨</Button>, + <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>涓嶄繚瀛�</Button>, + <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>鍙栨秷</Button> ]} destroyOnClose > - {this.state.dict['header.menu.config.placeholder']} + 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� </Modal> {this.state.loading && <Spin size="large" />} </div> diff --git a/src/templates/calendarconfig/source.jsx b/src/templates/calendarconfig/source.jsx index e009ac0..8e500d9 100644 --- a/src/templates/calendarconfig/source.jsx +++ b/src/templates/calendarconfig/source.jsx @@ -1,8 +1,4 @@ import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS class CalendarBaseData { baseConfig = { @@ -57,7 +53,7 @@ resourceType: '0', options: [], orderType: 'asc', - match: 'equal', + match: '=', }, { origin: true, uuid: Utils.getuuid(), @@ -76,25 +72,25 @@ searchItems = [ { type: 'search', - label: CommonDict['model.form.text'], + label: '鏂囨湰', subType: 'text', url: '' }, { type: 'search', - label: CommonDict['model.form.select'], + label: '涓嬫媺閫夋嫨', subType: 'select', url: '' }, { type: 'search', - label: CommonDict['model.form.multiselect'], + label: '涓嬫媺澶氶��', subType: 'multiselect', url: '' }, { type: 'search', - label: CommonDict['model.form.link'], + label: '鑱斿姩鑿滃崟', subType: 'link', url: '' }, @@ -118,19 +114,19 @@ }, { type: 'search', - label: CommonDict['model.form.datemonth'], + label: '鏃ユ湡锛堟湀锛�', subType: 'datemonth', url: '' }, { type: 'search', - label: CommonDict['model.form.daterange'], + label: '鏃ユ湡锛堝尯闂达級', subType: 'daterange', url: '' }, { type: 'search', - label: CommonDict['model.form.dategroup'], + label: '鏃ユ湡锛堢粍鍚堬級', subType: 'group', url: '' } diff --git a/src/templates/calendarconfig/tabcomponent/index.jsx b/src/templates/calendarconfig/tabcomponent/index.jsx index 42ad0cf..f85bba9 100644 --- a/src/templates/calendarconfig/tabcomponent/index.jsx +++ b/src/templates/calendarconfig/tabcomponent/index.jsx @@ -4,8 +4,6 @@ import { Modal } from 'antd' import { EditOutlined, CloseOutlined, PlusOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getTabForm } from '@/templates/zshare/formconfig' import TabForm from './tabform' import './index.scss' @@ -21,7 +19,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, menu: null, // 鑿滃崟淇℃伅 formlist: null, // 琛ㄥ崟淇℃伅 visible: false // 妯℃�佹鎺у埗 @@ -83,7 +80,7 @@ render() { const { tabviews, config } = this.props - const { dict, visible } = this.state + const { visible } = this.state return ( <div className="model-calendar-tab"> @@ -95,7 +92,7 @@ {/* 璁剧疆鍏ㄥ眬閰嶇疆鍙婂垪琛ㄦ暟鎹簮 */} <Modal wrapClassName="model-calendar-tab-modal" - title={dict['model.edit']} + title="缂栬緫" visible={visible} width={700} maskClosable={false} @@ -105,7 +102,6 @@ > <TabForm tabs={tabviews} - dict={dict} inputSubmit={this.tabSave} formlist={this.state.formlist} wrappedComponentRef={(inst) => this.tabRef = inst} diff --git a/src/templates/calendarconfig/tabcomponent/tabform/index.jsx b/src/templates/calendarconfig/tabcomponent/tabform/index.jsx index b91c74c..0584c22 100644 --- a/src/templates/calendarconfig/tabcomponent/tabform/index.jsx +++ b/src/templates/calendarconfig/tabcomponent/tabform/index.jsx @@ -10,7 +10,6 @@ class MainTab extends Component { static propTpyes = { tabs: PropTypes.array, // 鍙叧鑱旀爣绛鹃泦 - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, // 琛ㄥ崟 inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 } @@ -113,7 +112,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, @@ -134,7 +133,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -167,7 +166,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index f536dba..6717638 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -11,8 +11,6 @@ import Utils from '@/utils/utils.js' import MKEmitter from '@/utils/events.js' import { updateCommonTable } from '@/utils/utils-update.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import asyncComponent from '@/utils/asyncComponent' import SearchComponent from '@/templates/sharecomponent/searchcomponent' @@ -48,7 +46,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, config: null, // 椤甸潰閰嶇疆 formlist: null, // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪琛ㄥ崟瀛楁 menuloading: false, // 鑿滃崟淇濆瓨涓� @@ -299,7 +296,7 @@ if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) { notification.warning({ top: 92, - message: this.state.dict['model.menu.basemsg'], + message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', duration: 5 }) this.setState({activeKey: '0'}) @@ -779,14 +776,14 @@ if (config.isAdd) { // 鏂板缓鑿滃崟锛屾彁绀鸿彍鍗曞皻鏈繚瀛� notification.warning({ top: 92, - message: this.state.dict['header.menu.config.notsave'], + message: '鑿滃崟灏氭湭淇濆瓨锛岃鍏堜繚瀛樿彍鍗曢厤缃紒', duration: 5 }) } else { if (!is(fromJS(originMenu), fromJS(config))) { // 鑿滃崟淇℃伅鍙樺寲鏃讹紝鎻愮ず淇濆瓨 notification.warning({ top: 92, - message: this.state.dict['header.menu.config.update'], + message: '鑿滃崟閰嶇疆宸蹭慨鏀癸紝璇蜂繚瀛橈紒', duration: 5 }) return @@ -1165,12 +1162,11 @@ <div className="tools"> <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> {/* 鍩烘湰淇℃伅 */} - <Panel forceRender={true} header={this.state.dict['header.menu.basedata']} key="0" id="main-basedata"> + <Panel forceRender={true} header="鍩烘湰淇℃伅" key="0" id="main-basedata"> {/* 鑿滃崟淇℃伅 */} <MenuForm menu={menu} config={config} - dict={this.state.dict} updatemenu={this.updateconfig} /> {config ? <UrlFieldComponent @@ -1185,14 +1181,14 @@ /> </Panel> {/* 鎼滅储鏉′欢娣诲姞 */} - <Panel header={this.state.dict['header.menu.search']} key="1"> + <Panel header="鎼滅储" key="1"> <div className="search-element"> {Source.searchItems.map((item, index) => (<SourceElement key={index} content={item}/>))} </div> <FieldsComponent config={config} type="search" /> </Panel> {/* 鎸夐挳娣诲姞 */} - <Panel header={this.state.dict['header.menu.action']} key="2"> + <Panel header="鎸夐挳" key="2"> <div className="search-element"> {Source.actionItems.map((item, index) => (<SourceElement key={index} content={item}/>))} </div> @@ -1220,14 +1216,14 @@ })} </Panel> {/* 娣诲姞鏄剧ず鍒� */} - <Panel header={this.state.dict['header.menu.column']} key="3"> + <Panel header="鏄剧ず鍒�" key="3"> <div className="search-element"> {Source.columnItems.map((item, index) => (<SourceElement key={index} content={item}/>))} </div> <FieldsComponent config={config} type="columns"/> </Panel> {/* 娣诲姞鏍囩 */} - <Panel header={this.state.dict['header.menu.tab']} key="4"> + <Panel header="鏍囩椤�" key="4"> <div className="search-element"> {Source.tabItems.map((item, index) => (<SourceElement key={index} content={item}/>))} </div> @@ -1265,9 +1261,9 @@ <Unattended config={config} updateConfig={this.updateconfig}/> <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> - <EditComponent dict={this.state.dict} type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> - <Switch className="big" checkedChildren={this.state.dict['model.enable']} unCheckedChildren={this.state.dict['model.disable']} checked={this.state.config.enabled} onChange={this.onEnabledChange} /> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> + <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> + <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> + <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>鍏抽棴</Button> </div> } style={{ width: '100%' }}> @@ -1363,13 +1359,13 @@ visible={this.state.closeVisible} onCancel={() => { this.setState({closeVisible: false}) }} footer={[ - <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, - <Button key="notsave" className="mk-btn mk-yellow" onClick={this.notsave}>{this.state.dict['model.notsave']}</Button>, - <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> + <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>淇濆瓨</Button>, + <Button key="notsave" className="mk-btn mk-yellow" onClick={this.notsave}>涓嶄繚瀛�</Button>, + <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>鍙栨秷</Button> ]} destroyOnClose > - {this.state.dict['header.menu.config.placeholder']} + 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� </Modal> {this.state.loading && <Spin size="large" />} </div> diff --git a/src/templates/comtableconfig/menuform/index.jsx b/src/templates/comtableconfig/menuform/index.jsx index cbf66a2..eaa5f4d 100644 --- a/src/templates/comtableconfig/menuform/index.jsx +++ b/src/templates/comtableconfig/menuform/index.jsx @@ -9,7 +9,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, config: PropTypes.object, updatemenu: PropTypes.func @@ -95,7 +94,7 @@ } render() { - const { dict, menu, config } = this.props + const { menu, config } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -112,13 +111,13 @@ <Form {...formItemLayout} className="comtable-menu-form" id="subqazxcvbn"> <Row gutter={24}> <Col span={24}> - <Form.Item label={dict['model.menu.level1']}> + <Form.Item label="涓�绾ц彍鍗�"> {getFieldDecorator('fstMenuId', { initialValue: menu.fstMenuId, rules: [ { required: true, - message: dict['form.required.select'] + dict['model.menu.level1'] + '!' + message: '璇烽�夋嫨涓�绾ц彍鍗�!' } ] })( @@ -133,13 +132,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['model.menu.level2']}> + <Form.Item label="浜岀骇鑿滃崟"> {getFieldDecorator('ParentId', { initialValue: menu.ParentId, rules: [ { required: true, - message: dict['form.required.select'] + dict['model.menu.level2'] + '!' + message: '璇烽�夋嫨浜岀骇鑿滃崟!' } ] })( @@ -154,13 +153,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['model.menu'] + dict['model.name']}> + <Form.Item label="鑿滃崟鍚嶇О"> {getFieldDecorator('MenuName', { initialValue: menu.MenuName, rules: [ { required: true, - message: dict['form.required.input'] + dict['model.menu'] + dict['model.name'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞悕绉�!' }, { max: formRule.input.max, @@ -171,13 +170,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['model.menu'] + dict['model.param']}> + <Form.Item label="鑿滃崟鍙傛暟"> {getFieldDecorator('MenuNo', { initialValue: menu.MenuNo, rules: [ { required: true, - message: dict['form.required.input'] + dict['model.menu'] + dict['model.param'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' }, { max: formRule.input.max, @@ -188,20 +187,19 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['model.openway']}> + <Form.Item label="鎵撳紑鏂瑰紡"> {getFieldDecorator('opentype', { initialValue: menu.PageParam ? menu.PageParam.OpenType : 'newtab', rules: [ { required: true, - message: dict['form.required.select'] + dict['model.openway'] + '!' + message: '璇烽�夋嫨鎵撳紑鏂瑰紡!' } ] })( <Select onChange={(value) => {this.selectChange('opentype', value)}}> - <Select.Option value="newtab">{dict['model.form.tab']}</Select.Option> - <Select.Option value="newpage">{dict['model.form.newpage']}</Select.Option> - {/* <Select.Option value="currenttab">{dict['model.form.currenttab']}</Select.Option> */} + <Select.Option value="newtab">鏍囩椤�</Select.Option> + <Select.Option value="newpage">鏂伴〉闈�</Select.Option> </Select> )} </Form.Item> diff --git a/src/templates/comtableconfig/source.jsx b/src/templates/comtableconfig/source.jsx index 3491275..1b7d5de 100644 --- a/src/templates/comtableconfig/source.jsx +++ b/src/templates/comtableconfig/source.jsx @@ -1,8 +1,4 @@ import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS class CommonTableBaseData { baseConfig = { @@ -49,7 +45,7 @@ resourceType: '0', options: [], orderType: 'asc', - match: 'equal', + match: '=', }, { origin: true, uuid: Utils.getuuid(), @@ -153,7 +149,7 @@ Align: 'center', IsSort: 'false', uuid: Utils.getuuid(), - label: CommonDict['model.operation'], + label: '鎿嶄綔', type: 'action', style: 'button', show: 'horizontal', @@ -195,25 +191,25 @@ searchItems = [ { type: 'search', - label: CommonDict['model.form.text'], + label: '鏂囨湰', subType: 'text', url: '' }, { type: 'search', - label: CommonDict['model.form.select'], + label: '涓嬫媺閫夋嫨', subType: 'select', url: '' }, { type: 'search', - label: CommonDict['model.form.multiselect'], + label: '涓嬫媺澶氶��', subType: 'multiselect', url: '' }, { type: 'search', - label: CommonDict['model.form.link'], + label: '鑱斿姩鑿滃崟', subType: 'link', url: '' }, @@ -237,19 +233,19 @@ }, { type: 'search', - label: CommonDict['model.form.datemonth'], + label: '鏃ユ湡锛堟湀锛�', subType: 'datemonth', url: '' }, { type: 'search', - label: CommonDict['model.form.daterange'], + label: '鏃ユ湡锛堝尯闂达級', subType: 'daterange', url: '' }, { type: 'search', - label: CommonDict['model.form.dategroup'], + label: '鏃ユ湡锛堢粍鍚堬級', subType: 'group', url: '' } @@ -258,55 +254,55 @@ actionItems = [ { type: 'action', - label: CommonDict['model.form.popform'], + label: '寮圭獥锛堣〃鍗曪級', subType: 'pop', url: '' }, { type: 'action', - label: CommonDict['model.form.prompt'], + label: '鎻愮ず妗�', subType: 'prompt', url: '' }, { type: 'action', - label: CommonDict['model.form.exec'], + label: '鐩存帴鎵ц', subType: 'exec', url: '' }, { type: 'action', - label: CommonDict['model.form.excelIn'], + label: '瀵煎叆Excel', subType: 'excelIn', url: '' }, { type: 'action', - label: CommonDict['model.form.excelOut'], + label: '瀵煎嚭Excel', subType: 'excelOut', url: '' }, { type: 'action', - label: CommonDict['model.form.popview'], + label: '寮圭獥锛堟爣绛撅級', subType: 'popview', url: '' }, { type: 'action', - label: CommonDict['model.form.tab'], + label: '鏍囩椤�', subType: 'tab', url: '' }, { type: 'action', - label: CommonDict['model.form.newpage'], + label: '鏂伴〉闈�', subType: 'innerpage', url: '' }, { type: 'action', - label: CommonDict['model.form.funcbutton'], + label: '鍔熻兘鎸夐挳', subType: 'funcbutton', url: '' } @@ -315,37 +311,37 @@ columnItems = [ { type: 'columns', - label: CommonDict['model.form.text'], + label: '鏂囨湰', subType: 'text', url: '' }, { type: 'columns', - label: CommonDict['model.form.number'], + label: '鏁板瓧', subType: 'number', url: '' }, { type: 'columns', - label: CommonDict['model.form.picture'], + label: '鍥剧墖', subType: 'picture', url: '' }, { type: 'columns', - label: CommonDict['model.form.href'], + label: '閾炬帴', subType: 'link', url: '' }, { type: 'columns', - label: CommonDict['model.form.textarea'], + label: '澶氳鏂囨湰', subType: 'textarea', url: '' }, { type: 'columns', - label: CommonDict['model.form.colspan'], + label: '鍚堝苟鍒�', subType: 'colspan', url: '' }, @@ -360,7 +356,7 @@ tabItems = [ { type: 'tabs', - label: CommonDict['model.menu.tab.subtable'], + label: '瀛愯〃', subType: 'SubTable', } ] diff --git a/src/templates/formtabconfig/actionform/index.jsx b/src/templates/formtabconfig/actionform/index.jsx index 2c3ae5b..d275498 100644 --- a/src/templates/formtabconfig/actionform/index.jsx +++ b/src/templates/formtabconfig/actionform/index.jsx @@ -11,7 +11,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, // 琛ㄥ崟淇℃伅 card: PropTypes.any, // 鎸夐挳淇℃伅 tabs: PropTypes.array, // 鎵�鏈夋爣绛鹃〉 @@ -24,37 +23,37 @@ interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮� insertUpdateOptions: [{ value: 'insert', - text: this.props.dict['header.form.action.insert'] + text: '娣诲姞' }, { value: 'update', - text: this.props.dict['header.form.action.update'] + text: '淇敼' }, { value: 'insertOrUpdate', text: '娣诲姞鎴栦慨鏀�' }], returnoptions: [{ // 杩斿洖鍚�-涓嶅埛鏂般�佸埛鏂伴〉闈€�佸埛鏂拌〃鏍� value: 'never', - text: this.props.dict['header.form.refresh.never'] + text: '涓嶅埛鏂�' }, { value: 'grid', - text: this.props.dict['header.form.refresh'] + text: '鍒锋柊' }], currentoptions: [{ // 涓嶈繑鍥炴椂-涓嶅埛鏂般�佸埛鏂� value: 'never', - text: this.props.dict['header.form.refresh.never'] + text: '涓嶅埛鏂�' }, { value: 'refresh', - text: this.props.dict['header.form.refresh'] + text: '鍒锋柊' }], interTypeOptions: [{ value: 'system', - text: this.props.dict['model.interface.system'] + text: '绯荤粺' }, { value: 'inner', - text: this.props.dict['model.interface.inner'] + text: '鍐呴儴' }, { value: 'outer', - text: this.props.dict['model.interface.outer'] + text: '澶栭儴' }, { value: 'custom', text: '鑷畾涔�' @@ -92,10 +91,10 @@ item.options = [ { value: 'prompt', - text: this.props.dict['model.form.prompt'] + text: '鎻愮ず妗�' }, { value: 'exec', - text: this.props.dict['model.form.exec'] + text: '鐩存帴鎵ц' } ] if (card.btnType === 'cancel') { @@ -282,7 +281,7 @@ rules: [ { required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, ..._rules ] @@ -319,7 +318,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -351,7 +350,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -377,7 +376,7 @@ rules: [ { required: item.readonly ? false : !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<TextArea rows={4} readOnly={item.readonly}/>)} diff --git a/src/templates/formtabconfig/groupform/index.jsx b/src/templates/formtabconfig/groupform/index.jsx index 8668b3a..ed21eb8 100644 --- a/src/templates/formtabconfig/groupform/index.jsx +++ b/src/templates/formtabconfig/groupform/index.jsx @@ -8,7 +8,6 @@ class GroupForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� group: PropTypes.object, // 褰撳墠鍒嗙粍 groups: PropTypes.array, // 鎵�鏈夊垎缁� inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -101,7 +100,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍒嗙粍鍚嶇О!' + message: '璇疯緭鍏ュ垎缁勫悕绉�!' }, { max: formRule.input.max, diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index 3717e24..e32a9bf 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -8,8 +8,6 @@ import { QuestionCircleOutlined, RedoOutlined, SettingOutlined, PlusOutlined, DeleteOutlined, EditOutlined, SnippetsOutlined } from '@ant-design/icons' import Api from '@/api' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import Utils, { FuncUtils } from '@/utils/utils.js' import { getModalForm, getActionForm } from '@/templates/zshare/formconfig' import { queryTableSql } from '@/utils/option.js' @@ -43,7 +41,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆 modaltype: '', // 妯℃�佹绫诲瀷锛屾帶鍒舵ā鎬佹鏄剧ず tableColumns: [], // 琛ㄦ牸鏄剧ず鍒� @@ -142,7 +139,7 @@ { type: 'text', key: 'menuName', - label: this.state.dict['model.menu'] + this.state.dict['model.name'], + label: '鑿滃崟鍚嶇О', initVal: menu.MenuName, readonly: true }, @@ -1062,7 +1059,7 @@ }, () => { notification.warning({ top: 92, - message: this.state.dict['model.menu.basemsg'], + message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', duration: 5 }) }) @@ -1530,16 +1527,15 @@ <div className="tools"> <Collapse accordion defaultActiveKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> {/* 鍩烘湰淇℃伅 */} - <Panel forceRender={true} header={this.state.dict['header.menu.basedata']} key="0" id="common-basedata"> + <Panel forceRender={true} header="鍩烘湰淇℃伅" key="0" id="common-basedata"> {/* 鑿滃崟淇℃伅 */} <MenuForm - dict={this.state.dict} formlist={this.state.menuformlist} wrappedComponentRef={(inst) => this.menuformRef = inst} /> </Panel> {/* 鎼滅储鏉′欢娣诲姞 */} - <Panel header={this.state.dict['header.menu.form']} key="1"> + <Panel header="琛ㄥ崟" key="1"> <div className="search-element"> {Source.searchItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -1547,7 +1543,7 @@ </div> </Panel> {/* 鎸夐挳娣诲姞 */} - <Panel header={this.state.dict['header.menu.action']} key="2"> + <Panel header="鎸夐挳" key="2"> <div className="search-element"> {Source.actionItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -1555,7 +1551,7 @@ </div> </Panel> {/* 娣诲姞鏍囩 */} - <Panel header={this.state.dict['header.menu.tab']} key="4"> + <Panel header="鏍囩椤�" key="4"> <div className="search-element"> {Source.tabItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -1593,8 +1589,8 @@ } bordered={false} extra={ <div> <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> - <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> - <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> + <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> + <Button onClick={this.cancelConfig}>杩斿洖</Button> </div> } style={{ width: '100%' }}> <SettingOutlined onClick={this.changeSetting} /> @@ -1617,7 +1613,7 @@ <EditOutlined onClick={() => { this.handleGroup(group) }}/> </span> )}> - {group.isDefault ? <SnippetsOutlined title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> : null} + {group.isDefault ? <SnippetsOutlined title="绮樿创" onClick={() => {this.setState({pasteVisible: true})}} /> : null} <DragElement type="search" groupId={group.uuid} @@ -1665,7 +1661,6 @@ destroyOnClose > <ModalForm - dict={this.state.dict} card={this.state.card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -1674,21 +1669,20 @@ </Modal> {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} <Modal - title={this.state.dict['model.action'] + '-' + this.state.dict['model.edit']} + title="鎸夐挳缂栬緫" visible={modaltype === 'actionEdit'} width={920} maskClosable={false} onCancel={this.editModalCancel} footer={[ this.state.card && this.state.card.btnType !== 'cancel' ? - <CreateFunc key="create" dict={this.state.dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, - <Button key="cancel" onClick={this.editModalCancel}>{this.state.dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['model.confirm']}</Button> + <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null, + <Button key="cancel" onClick={this.editModalCancel}>鍙栨秷</Button>, + <Button key="confirm" type="primary" onClick={this.handleSubmit}>纭畾</Button> ]} destroyOnClose > <ActionForm - dict={this.state.dict} card={this.state.card} tabs={this.state.tabviews} formlist={this.state.formlist} @@ -1702,7 +1696,7 @@ visible={this.state.profileVisible} width={'90vw'} maskClosable={false} - okText={this.state.dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { if (this.verifyRef.handleCancel) { @@ -1721,12 +1715,11 @@ config={this.state.config} columns={this.state.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} - dict={this.state.dict} /> </Modal> {/* 璁剧疆鍏ㄥ眬閰嶇疆鍙婂垪琛ㄦ暟鎹簮 */} <Modal - title={this.state.dict['model.edit']} + title="缂栬緫" visible={this.state.settingVisible} width={700} maskClosable={false} @@ -1736,14 +1729,13 @@ }) }} footer={[ - <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>, - <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>{this.state.dict['model.confirm']}</Button> + <CreateFunc key="create" ref="tableCreatFunc" trigger={this.tableCreatFunc}/>, + <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>鍙栨秷</Button>, + <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>纭畾</Button> ]} destroyOnClose > <SettingForm - dict={this.state.dict} menu={this.props.menu} config={this.state.config} inputSubmit={this.settingSave} @@ -1757,13 +1749,13 @@ visible={this.state.closeVisible} onCancel={() => { this.setState({closeVisible: false}) }} footer={[ - <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, - <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>{this.state.dict['model.notsave']}</Button>, - <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> + <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>淇濆瓨</Button>, + <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>涓嶄繚瀛�</Button>, + <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>鍙栨秷</Button> ]} destroyOnClose > - {this.state.dict['header.menu.config.placeholder']} + 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� </Modal> <Modal title="鍒嗙粍绠$悊" @@ -1776,7 +1768,6 @@ > <GroupForm groups={config.groups} - dict={this.state.dict} group={this.state.editgroup} inputSubmit={this.handleGroupSave} wrappedComponentRef={(inst) => this.groupRef = inst} @@ -1784,7 +1775,7 @@ </Modal> {/* 鎸夐挳閰嶇疆淇℃伅绮樿创澶嶅埗 */} <Modal - title={this.state.dict['header.form.paste']} + title="绮樿创" visible={this.state.pasteVisible} width={600} maskClosable={false} @@ -1793,7 +1784,6 @@ destroyOnClose > <PasteForm - dict={this.state.dict} wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit} /> diff --git a/src/templates/formtabconfig/settingform/index.jsx b/src/templates/formtabconfig/settingform/index.jsx index 3d916d5..bc10e56 100644 --- a/src/templates/formtabconfig/settingform/index.jsx +++ b/src/templates/formtabconfig/settingform/index.jsx @@ -11,7 +11,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, config: PropTypes.object, inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -168,7 +167,7 @@ } render() { - const { dict, menu } = this.props + const { menu } = this.props const { getFieldDecorator } = this.props.form const { interType, setting, datatype, usefulFields } = this.state @@ -196,7 +195,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '琛ㄥ悕!' + message: '璇疯緭鍏ヨ〃鍚�!' }, { max: 50, @@ -221,13 +220,13 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label={dict['header.menu.datasource']}> + <Form.Item label="鏁版嵁鏉ユ簮"> {getFieldDecorator('datatype', { initialValue: setting.datatype || 'query' })( <Radio.Group onChange={this.sourceChange}> - <Radio value="maintable">{dict['header.menu.maintable']}</Radio> - <Radio value="query">{dict['header.menu.query']}</Radio> + <Radio value="maintable">涓昏〃</Radio> + <Radio value="query">鏌ヨ</Radio> </Radio.Group> )} </Form.Item> @@ -240,37 +239,37 @@ </Form.Item> </Col> {datatype === 'query' ? <Col span={12}> - <Form.Item label={dict['header.form.intertype']}> + <Form.Item label="鎺ュ彛绫诲瀷"> {getFieldDecorator('interType', { initialValue: interType })( <Radio.Group onChange={this.onChange}> - <Radio value="inner">{dict['model.interface.inner']}</Radio> - <Radio value="outer">{dict['model.interface.outer']}</Radio> + <Radio value="inner">鍐呴儴</Radio> + <Radio value="outer">澶栭儴</Radio> </Radio.Group> )} </Form.Item> </Col> : null} {datatype === 'query' && interType === 'outer' ? <Col span={12}> - <Form.Item label={dict['header.form.sysInterface']}> + <Form.Item label="绯荤粺鎺ュ彛"> {getFieldDecorator('sysInterface', { initialValue: setting.sysInterface || 'false' })( <Radio.Group onChange={this.onSysChange}> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group> )} </Form.Item> </Col> : null} {datatype === 'query' && interType === 'outer' ? <Col span={12}> - <Form.Item label={dict['header.form.interface']}> + <Form.Item label="鎺ュ彛鍦板潃"> {getFieldDecorator('interface', { initialValue: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''), rules: [ { required: true, - message: dict['form.required.input'] + dict['header.form.interface'] + '!' + message: '璇疯緭鍏ユ帴鍙e湴鍧�!' }, { max: formRule.input.max, @@ -284,7 +283,7 @@ <Form.Item label={ <Tooltip placement="topLeft" overlayClassName="middle" title={`鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屽嚱鏁板悕绉伴渶浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬶紱鏈缃椂浼氳皟鐢ㄧ郴缁熷嚱鏁帮紝浣跨敤绯荤粺鍑芥暟闇�瀹屽杽鏁版嵁婧愩�俙}> <QuestionCircleOutlined className="mk-form-tip" /> - {dict['header.form.innerFunc']} + 鍐呴儴鍑芥暟 </Tooltip> }> {getFieldDecorator('innerFunc', { @@ -305,7 +304,7 @@ <Form.Item help={'鏁版嵁ID锛�' + menu.MenuID} label={ <Tooltip placement="topLeft" title="浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愶紝鑷畾涔夊嚱鏁版椂锛屽彲蹇界暐銆�"> <QuestionCircleOutlined className="mk-form-tip" /> - {'鏁版嵁婧�'} + 鏁版嵁婧� </Tooltip> } className="textarea"> {getFieldDecorator('dataresource', { @@ -314,7 +313,7 @@ </Form.Item> </Col> : null} {datatype === 'query' && interType === 'outer' ? <Col span={12}> - <Form.Item label={dict['header.form.outerFunc']}> + <Form.Item label="澶栭儴鍑芥暟"> {getFieldDecorator('outerFunc', { initialValue: setting.outerFunc || '', rules: [ diff --git a/src/templates/formtabconfig/source.jsx b/src/templates/formtabconfig/source.jsx index e5ddf6c..57eeafd 100644 --- a/src/templates/formtabconfig/source.jsx +++ b/src/templates/formtabconfig/source.jsx @@ -1,8 +1,4 @@ import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS class CommonTableBaseData { baseConfig = { @@ -164,13 +160,13 @@ actionItems = [ { type: 'action', - label: CommonDict['model.form.prompt'], + label: '鎻愮ず妗�', subType: 'prompt', url: '' }, { type: 'action', - label: CommonDict['model.form.exec'], + label: '鐩存帴鎵ц', subType: 'exec', url: '' } @@ -179,7 +175,7 @@ tabItems = [ { type: 'tabs', - label: CommonDict['model.menu.tab.subtable'], + label: '瀛愯〃', subType: 'SubTable', } ] diff --git a/src/templates/modalconfig/dragelement/index.jsx b/src/templates/modalconfig/dragelement/index.jsx index 996ca14..fcfb770 100644 --- a/src/templates/modalconfig/dragelement/index.jsx +++ b/src/templates/modalconfig/dragelement/index.jsx @@ -7,7 +7,7 @@ import Card from './card' import './index.scss' -const Container = ({list, setting, placeholder, handleList, handleForm, closeForm, showField }) => { +const Container = ({list, setting, handleList, handleForm, closeForm, showField }) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -148,7 +148,7 @@ })} {cards.length === 0 && <div className="modal-drawarea-placeholder"> - {placeholder} + 璇锋坊鍔犺〃鍗� </div> } </div> diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index f21d14e..97c1bdd 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -9,8 +9,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getModalForm } from '@/templates/zshare/formconfig' import SourceElement from './dragelement/source' @@ -24,7 +22,6 @@ const { Panel } = Collapse const { confirm } = Modal -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const Versions = asyncComponent(() => import('@/menu/versions')) const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) @@ -51,7 +48,6 @@ state = { menu: null, // 涓婄骇鑿滃崟锛屼笁绾ц彍鍗曟垨鏍囩 - dict: CommonDict, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆锛屽寘鎷ā鏉跨被鍨嬨�佹ā鎬佹璁剧疆銆佹坊鍔犺〃鍚嶃�佽〃鍗曞垪琛� visible: false, // 琛ㄥ崟缂栬緫妯℃�佹锛屾樉绀烘帶鍒� modalformlist: null, // 鍩烘湰淇℃伅琛ㄥ崟瀛楁 @@ -112,7 +108,7 @@ { type: 'text', key: 'supMenu', - label: this.state.dict['model.super'] + this.state.dict['model.menu'], + label: '涓婄骇鑿滃崟', initVal: _menu.MenuName, required: true, readonly: true @@ -751,7 +747,7 @@ render () { const { editAction } = this.props - const { config, dict, openEdition } = this.state + const { config, openEdition } = this.state if (!config) return null @@ -760,11 +756,8 @@ <DndProvider backend={HTML5Backend}> <div className="tools"> <Collapse accordion defaultActiveKey="1" bordered={false}> - <Panel forceRender={true} header={dict['header.menu.basedata']} key="0" id="modal-basedata"> - <MenuForm - dict={dict} - formlist={this.state.modalformlist} - /> + <Panel forceRender={true} header="鍩烘湰淇℃伅" key="0" id="modal-basedata"> + <MenuForm formlist={this.state.modalformlist}/> {/* 琛ㄥ悕娣诲姞 */} <TableComponent config={config} @@ -772,7 +765,7 @@ updatetable={this.updateconfig} /> </Panel> - <Panel header={dict['header.menu.form']} key="1"> + <Panel header="琛ㄥ崟" key="1"> <div className="search-element"> {SearchItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -788,9 +781,9 @@ <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button> <Versions MenuId={editAction.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/> - <EditComponent dict={dict} options={['form']} config={this.state.config} plusFields={this.plusFields}/> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['model.save']}</Button> - <Button onClick={this.cancelConfig}>{dict['model.back']}</Button> + <EditComponent options={['form']} config={this.state.config} plusFields={this.plusFields}/> + <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> + <Button onClick={this.cancelConfig}>杩斿洖</Button> </div> } style={{ width: '100%' }}> <SettingOutlined onClick={this.changeSetting} /> @@ -801,7 +794,7 @@ <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2鍒�</Button> <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3鍒�</Button> <Button className="mk-cols-change" onClick={() => this.changecols(4)}>4鍒�</Button> - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> </div> <div className="ant-modal-body"> <div className="modal-form"> @@ -809,7 +802,6 @@ list={config.fields} setting={config.setting} showField={this.state.showField} - placeholder={dict['header.form.modal.placeholder']} handleList={this.handleList} handleForm={this.handleForm} closeForm={this.closeForm} @@ -819,10 +811,10 @@ <div className="ant-modal-footer"> <div> <button type="button" className="ant-btn"> - <span>{dict['model.cancel']}</span> + <span>鍙栨秷</span> </button> <button type="button" className="ant-btn ant-btn-primary"> - <span>{dict['model.confirm']}</span> + <span>纭畾</span> </button> </div> <div className="action-mask"></div> @@ -832,7 +824,7 @@ </div> </DndProvider> <Modal - title={dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={950} maskClosable={false} @@ -842,7 +834,6 @@ destroyOnClose > <ModalForm - dict={dict} card={this.state.card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -851,7 +842,7 @@ /> </Modal> <Modal - title={dict['model.edit']} + title="缂栬緫" visible={this.state.settingVisible} width={900} maskClosable={false} @@ -873,13 +864,13 @@ visible={this.state.closeVisible} onCancel={() => { this.setState({closeVisible: false}) }} footer={[ - <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} onClick={this.submitConfig}>{dict['model.save']}</Button>, - <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>{dict['model.notsave']}</Button>, - <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{dict['model.cancel']}</Button> + <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} onClick={this.submitConfig}>淇濆瓨</Button>, + <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>涓嶄繚瀛�</Button>, + <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>鍙栨秷</Button> ]} destroyOnClose > - {dict['header.menu.config.placeholder']} + 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� </Modal> <StyleController /> </div> diff --git a/src/templates/modalconfig/menuform/index.jsx b/src/templates/modalconfig/menuform/index.jsx index aa1b4bd..fd92a98 100644 --- a/src/templates/modalconfig/menuform/index.jsx +++ b/src/templates/modalconfig/menuform/index.jsx @@ -5,7 +5,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.array } @@ -22,7 +21,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} @@ -38,7 +37,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/modalconfig/source.jsx b/src/templates/modalconfig/source.jsx index c437d38..7c81e6e 100644 --- a/src/templates/modalconfig/source.jsx +++ b/src/templates/modalconfig/source.jsx @@ -1,8 +1,4 @@ import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS export const BaseConfig = { type: 'Modal', @@ -76,17 +72,17 @@ export const SearchItems = [ { type: 'form', - label: CommonDict['model.form.text'], + label: '鏂囨湰', subType: 'text', }, { type: 'form', - label: CommonDict['model.form.number'], + label: '鏁板瓧', subType: 'number', }, { type: 'form', - label: CommonDict['model.form.select'], + label: '涓嬫媺閫夋嫨', subType: 'select', }, { @@ -96,12 +92,12 @@ }, { type: 'form', - label: CommonDict['model.form.multiselect'], + label: '涓嬫媺澶氶��', subType: 'multiselect', }, { type: 'form', - label: CommonDict['model.form.link'], + label: '鑱斿姩鑿滃崟', subType: 'link', }, { @@ -136,7 +132,7 @@ }, { type: 'form', - label: CommonDict['model.form.datemonth'], + label: '鏃ユ湡锛堟湀锛�', subType: 'datemonth', }, { @@ -151,7 +147,7 @@ }, { type: 'form', - label: CommonDict['model.form.color'], + label: '棰滆壊', subType: 'color', }, { @@ -161,7 +157,7 @@ }, { type: 'form', - label: CommonDict['header.form.funcvar'], + label: '鍑芥暟鍙橀噺', subType: 'funcvar', }, { diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx index 27bd86b..3018953 100644 --- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx @@ -27,7 +27,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� setting: PropTypes.object, // 椤甸潰璁剧疆 formlist: PropTypes.any, // 琛ㄥ崟淇℃伅 card: PropTypes.any, // 鎸夐挳淇℃伅 @@ -39,26 +38,26 @@ formlist: null, // 琛ㄥ崟淇℃伅 requireOptions: [{ value: 'notRequired', - text: this.props.dict['header.form.notRequired'] + text: '涓嶉�夋嫨琛�' }, { value: 'requiredSgl', - text: this.props.dict['header.form.requiredSgl'] + text: '閫夋嫨鍗曡' }, { value: 'required', - text: this.props.dict['header.form.required'] + text: '閫夋嫨澶氳' }, { value: 'requiredOnce', - text: this.props.dict['header.form.requiredOnce'] + text: '澶氳鎷兼帴' }], insertUpdateOptions: [{ value: 'insert', - text: this.props.dict['header.form.action.insert'] + text: '娣诲姞' }, { value: 'update', - text: this.props.dict['header.form.action.update'] + text: '淇敼' }, { value: 'audit', - text: this.props.dict['header.form.action.audit'] + text: '瀹℃牳' }], deleteOptions: [{ value: 'LogicDelete', @@ -68,17 +67,17 @@ text: '鐗╃悊鍒犻櫎' }, { value: 'custom', - text: this.props.dict['header.form.custom'] + text: '鑷畾涔�' }], interTypeOptions: [{ value: 'system', - text: this.props.dict['model.interface.system'] + text: '绯荤粺' }, { value: 'inner', - text: this.props.dict['model.interface.inner'] + text: '鍐呴儴' }, { value: 'outer', - text: this.props.dict['model.interface.outer'] + text: '澶栭儴' }, { value: 'custom', text: '鑷畾涔�' @@ -382,18 +381,18 @@ _fieldval.intertype = 'system' _fieldval.Ot = 'notRequired' - _fieldval.label = this.props.dict['model.form.excelIn'] + _fieldval.label = '瀵煎叆Excel' _fieldval.class = 'dgreen' this.record.Ot = 'notRequired' - this.record.label = this.props.dict['model.form.excelIn'] + this.record.label = '瀵煎叆Excel' this.record.class = 'dgreen' } else if (value === 'excelOut') { _fieldval.intertype = 'system' - _fieldval.label = this.props.dict['model.form.excelOut'] + _fieldval.label = '瀵煎嚭Excel' _fieldval.class = 'dgreen' _fieldval.execSuccess = 'never' this.record.Ot = 'notRequired' - this.record.label = this.props.dict['model.form.excelOut'] + this.record.label = '瀵煎嚭Excel' this.record.class = 'dgreen' this.record.execSuccess = 'never' @@ -416,10 +415,10 @@ } if (value === 'excelIn') { - _fieldval.label = this.props.dict['model.form.excelIn'] + _fieldval.label = '瀵煎叆Excel' _fieldval.class = 'border-dgreen' } else if (value === 'excelOut') { - _fieldval.label = this.props.dict['model.form.excelOut'] + _fieldval.label = '瀵煎嚭Excel' _fieldval.class = 'dgreen' _fieldval.control = '' this.record.control = '' @@ -536,7 +535,6 @@ } getFields() { - const { dict } = this.props const { getFieldDecorator } = this.props.form const fields = [] @@ -551,7 +549,7 @@ if (item.type === 'text') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] if (item.key === 'innerFunc') { @@ -596,13 +594,13 @@ content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> } else if (item.type === 'number') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] content = <InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/> } else if (item.type === 'select') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Select @@ -620,7 +618,7 @@ </Select> } else if (item.type === 'radio') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Radio.Group onChange={(e) => {this.optionChange(item.key, e.target.value)}}> @@ -629,13 +627,13 @@ } else if (item.type === 'cascader') { initVal = item.initVal || [] rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Cascader options={item.options || []} expandTrigger="hover" placeholder=""/> } else if (item.type === 'icon') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <MkEditIcon options={['edit', 'hint', 'direction', 'normal', 'data']} allowClear/> @@ -643,7 +641,7 @@ span = 24 className = 'textarea' rules = [ - { required: item.readonly ? false : item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.readonly ? false : item.required, message: '璇疯緭鍏�' + item.label + '!' } ] content = <TextArea rows={2} readOnly={item.readonly}/> diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx index 026695c..4253f4d 100644 --- a/src/templates/sharecomponent/actioncomponent/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/index.jsx @@ -6,8 +6,6 @@ import Api from '@/api' import Utils, { FuncUtils } from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getActionForm } from '@/templates/zshare/formconfig' import asyncSpinComponent from '@/utils/asyncSpinComponent' @@ -37,7 +35,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 actionlist: null, // 鎸夐挳缁� @@ -426,7 +423,7 @@ Align: 'center', IsSort: 'false', uuid: Utils.getuuid(), - label: this.state.dict['model.operation'], + label: '鎿嶄綔', type: 'action', style: 'button', show: 'horizontal', @@ -626,11 +623,10 @@ */ deleteElement = (card) => { const { config } = this.props - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, + content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { let _actionlist = fromJS(_this.state.actionlist).toJS() @@ -647,7 +643,7 @@ Align: 'center', IsSort: 'false', uuid: Utils.getuuid(), - label: this.state.dict['model.operation'], + label: '鎿嶄綔', type: 'action', style: 'button', show: 'horizontal', @@ -865,14 +861,12 @@ getVerify = (card) => { const { config } = this.props - const { dict } = this.state if (!card) return null if (['pop', 'prompt', 'exec'].includes(card.OpenType)) { return <VerifyCard card={card} - dict={dict} config={config} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} @@ -880,28 +874,24 @@ } else if (card.OpenType === 'excelIn') { return <VerifyExcelIn card={card} - dict={dict} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'excelOut') { return <VerifyExcelOut card={card} - dict={dict} config={config} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') { return <VerifyPrint card={card} - dict={dict} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> } else if (card.OpenType === 'funcbutton' && card.funcType === 'megvii') { return <VerifyMegvii card={card} - dict={dict} columns={config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> @@ -910,7 +900,7 @@ render() { const { config } = this.props - const { actionlist, visible, card, dict, copying, profVisible, record } = this.state + const { actionlist, visible, card, copying, profVisible, record } = this.state return ( <div className="model-table-action-list" style={config.charts && config.charts.length > 1 ? {paddingTop: 25} : null}> @@ -925,22 +915,21 @@ /> {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} <Modal - title={dict['model.action'] + '-' + (card && card.copyType === 'action' ? dict['model.copy'] : dict['model.edit'])} + title={'鎸夐挳-' + (card && card.copyType === 'action' ? '澶嶅埗' : '缂栬緫')} wrapClassName="model-table-action-edit-modal" visible={visible} width={920} maskClosable={false} onCancel={this.editModalCancel} footer={[ - record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, - record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, - <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>{dict['model.confirm']}</Button> + record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, + record && record.intertype === 'inner' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null, + <Button key="cancel" onClick={this.editModalCancel}>鍙栨秷</Button>, + <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>纭畾</Button> ]} destroyOnClose > <ActionForm - dict={dict} card={card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} @@ -955,7 +944,7 @@ visible={profVisible} width={'90vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} onCancel={() => { if (this.verifyRef.handleCancel) { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx index 4ae7e6a..a83f4a9 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx @@ -5,7 +5,6 @@ class ExcelInColumn extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� columnChange: PropTypes.func // 淇敼鍑芥暟 } @@ -63,7 +62,6 @@ } render() { - const { dict } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -80,33 +78,33 @@ <Form {...formItemLayout} className="verify-form"> <Row gutter={24}> <Col span={6}> - <Form.Item label={dict['model.form.field']}> + <Form.Item label="瀛楁"> {getFieldDecorator('Column', { initialValue: '', rules: [ { required: true, - message: dict['form.required.input'] + dict['model.form.field'] + '!' + message: '璇疯緭鍏ュ瓧娈�!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={6}> - <Form.Item label={dict['model.name']}> + <Form.Item label="鍚嶇О"> {getFieldDecorator('Text', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + dict['model.name'] + '!' + message: '璇疯緭鍏ュ悕绉�!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={6}> - <Form.Item label={dict['model.form.type']}> + <Form.Item label="绫诲瀷"> {getFieldDecorator('type', { initialValue: 'Nvarchar(50)' })( @@ -131,25 +129,25 @@ </Form.Item> </Col> <Col span={6}> - <Form.Item label={dict['model.required']}> + <Form.Item label="蹇呭~"> {getFieldDecorator('required', { initialValue: 'true' })( <Radio.Group disabled={this.state.locked}> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group> )} </Form.Item> </Col> <Col span={6}> - <Form.Item style={{marginBottom: 0}} label={dict['model.import']}> + <Form.Item style={{marginBottom: 0}} label="瀵煎叆"> {getFieldDecorator('import', { initialValue: 'true' })( <Radio.Group> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group> )} </Form.Item> @@ -171,7 +169,7 @@ <Col span={6}> <Form.Item style={{marginBottom: 0}} label={' '} colon={false}> <Button onClick={this.handleConfirm} type="primary" className="mk-green"> - {dict['model.add']} + 娣诲姞 </Button> </Form.Item> </Col> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 1361104..bf2bcc7 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -23,7 +23,6 @@ class VerifyCard extends Component { static propTpyes = { columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, } @@ -33,7 +32,7 @@ activeKey: 'basemsg', excelColumns: [ { - title: this.props.dict['model.form.field'], + title: '瀛楁', dataIndex: 'Column', width: '14%', inputType: 'input', @@ -41,14 +40,14 @@ editable: true }, { - title: this.props.dict['model.name'], + title: '鍚嶇О', dataIndex: 'Text', width: '14%', inputType: 'input', editable: true }, { - title: this.props.dict['model.form.type'], + title: '绫诲瀷', dataIndex: 'type', width: '15%', editable: true, @@ -72,20 +71,20 @@ ] }, { - title: this.props.dict['model.required'], + title: '蹇呭~', dataIndex: 'required', width: '10%', editable: true, inputType: 'switch', - render: (text, record) => record.required === 'true' ? this.props.dict['model.true'] : this.props.dict['model.false'] + render: (text, record) => record.required === 'true' ? '鏄�' : '鍚�' }, { - title: this.props.dict['model.import'], + title: '瀵煎叆', dataIndex: 'import', width: '10%', editable: true, inputType: 'switch', - render: (text, record) => record.import !== 'false' ? this.props.dict['model.true'] : this.props.dict['model.false'] + render: (text, record) => record.import !== 'false' ? '鏄�' : '鍚�' }, { title: '鏈�灏忓��', @@ -224,11 +223,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -758,13 +757,13 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col span={8}> - <Form.Item label={this.props.dict['model.form.tablename']}> + <Form.Item label="琛ㄥ悕"> {getFieldDecorator('sheet', { initialValue: verify.sheet || '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.form.tablename'] + '!' + message: '璇疯緭鍏ヨ〃鍚�!' } ] })(<Input placeholder="" autoComplete="off" />)} @@ -799,7 +798,7 @@ {verify.columns.length ? <span className="count-tip">{verify.columns.length}</span> : null} </span> } key="excelcolumn"> - <ColumnForm dict={this.props.dict} columnChange={this.columnChange}/> + <ColumnForm columnChange={this.columnChange}/> <Button className="excel-col-add mk-green" title="娣诲姞鏄剧ず鍒楀瓧娈�" onClick={this.columnFieldInput}> 鍚屾鏄剧ず鍒� </Button> @@ -815,7 +814,7 @@ {verify.uniques.length ? <span className="count-tip">{verify.uniques.length}</span> : null} </span> } key="unique"> - <UniqueForm fields={verify.columns} dict={this.props.dict} uniqueChange={this.uniqueChange}/> + <UniqueForm fields={verify.columns} uniqueChange={this.uniqueChange}/> <EditTable actions={['edit', 'move', 'del', 'status']} data={verify.uniques} columns={uniqueColumns} onChange={this.changeUniques}/> </TabPane> : null} {card.intertype === 'system' ? <TabPane tab={ diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx index bba6819..a6e9bf2 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx @@ -6,7 +6,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� fields: PropTypes.array, // 琛ㄥ崟瀛楁 uniqueChange: PropTypes.func // 淇敼鍑芥暟 } @@ -56,13 +55,13 @@ <Form {...formItemLayout} className="verify-form" id="verifycard1"> <Row gutter={24}> <Col span={7}> - <Form.Item label={'鍒楀悕'}> + <Form.Item label="鍒楀悕"> {getFieldDecorator('field', { initialValue: [], rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鍒楀悕!' + message: '璇烽�夋嫨鍒楀悕!' } ] })( @@ -78,13 +77,13 @@ </Form.Item> </Col> <Col span={7}> - <Form.Item label={'鎶ラ敊缂栫爜'}> + <Form.Item label="鎶ラ敊缂栫爜"> {getFieldDecorator('errorCode', { initialValue: 'E', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎶ラ敊缂栫爜!' + message: '璇烽�夋嫨鎶ラ敊缂栫爜!' } ] })( @@ -98,13 +97,13 @@ </Form.Item> </Col> <Col span={7}> - <Form.Item label={'楠岃瘉绫诲瀷'}> + <Form.Item label="楠岃瘉绫诲瀷"> {getFieldDecorator('verifyType', { initialValue: 'physical', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '楠岃瘉绫诲瀷!' + message: '璇烽�夋嫨楠岃瘉绫诲瀷!' } ] })( diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx index 1cae7b2..e3159f8 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx @@ -5,7 +5,6 @@ class ExcelOutColumn extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� columnChange: PropTypes.func // 淇敼鍑芥暟 } @@ -24,7 +23,6 @@ } render() { - const { dict } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -41,39 +39,39 @@ <Form {...formItemLayout} className="verify-form"> <Row gutter={24}> <Col span={5}> - <Form.Item label={dict['model.form.field']}> + <Form.Item label="瀛楁"> {getFieldDecorator('Column', { initialValue: '', rules: [ { required: true, - message: dict['form.required.input'] + dict['model.form.field'] + '!' + message: '璇疯緭鍏ュ瓧娈�!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={5}> - <Form.Item label={dict['model.name']}> + <Form.Item label="鍚嶇О"> {getFieldDecorator('Text', { initialValue: '', rules: [ { required: true, - message: dict['form.required.input'] + dict['model.name'] + '!' + message: '璇疯緭鍏ュ悕绉�!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={5}> - <Form.Item label={dict['model.form.columnWidth']}> + <Form.Item label="鍒楀"> {getFieldDecorator('Width', { initialValue: 20, rules: [ { required: true, - message: this.props.dict['form.required.input'] + dict['model.form.columnWidth'] + '!' + message: '璇疯緭鍏ュ垪瀹�!' } ] })(<InputNumber min={5} max={200} precision={0} />)} diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx index 066d9e3..c6f8e4e 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx @@ -225,7 +225,7 @@ </Radio.Group>)} </Form.Item> </Col> : null} - {dataType === 'custom' ? <Col span={8}> + {/* {dataType === 'custom' ? <Col span={8}> <Form.Item label="浜嬪姟"> {getFieldDecorator('transaction', { initialValue: setting.transaction || 'false' @@ -235,7 +235,7 @@ <Radio value="false">涓嶄娇鐢�</Radio> </Radio.Group>)} </Form.Item> - </Col> : null} + </Col> : null} */} </Row> </Form> </div> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 0431f00..936a558 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -22,7 +22,6 @@ class VerifyCard extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, card: PropTypes.object, } @@ -34,7 +33,7 @@ defaultscript: '', // 鑷畾涔夎剼鏈� excelColumns: [ { - title: this.props.dict['model.form.field'], + title: '瀛楁', dataIndex: 'Column', inputType: 'input', editable: true, @@ -42,7 +41,7 @@ width: '17%' }, { - title: this.props.dict['model.name'], + title: '鍚嶇О', dataIndex: 'Text', inputType: 'input', editable: true, @@ -50,7 +49,7 @@ width: '17%' }, { - title: this.props.dict['model.form.columnWidth'], + title: '鍒楀', dataIndex: 'Width', inputType: 'number', min: 5, @@ -187,11 +186,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -975,7 +974,7 @@ {verify.columns.length ? <span className="count-tip">{verify.columns.length}</span> : null} </span> } key="columns"> - <ColumnForm dict={this.props.dict} columnChange={this.columnChange}/> + <ColumnForm columnChange={this.columnChange}/> <Button className="excel-col-add mk-green" title="娣诲姞鏄剧ず鍒楀瓧娈�" onClick={this.columnFieldInput}> 鍚屾鏄剧ず鍒� </Button> @@ -1026,7 +1025,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'sql!' + message: '璇疯緭鍏ql!' } ] })(<CodeMirror />)} diff --git a/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx b/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx index 4e65b0c..bc04f46 100644 --- a/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx @@ -10,7 +10,6 @@ class MegviiCard extends Component { static propTpyes = { columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, } diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index 9a08c00..591bbc8 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx @@ -18,7 +18,6 @@ floor: PropTypes.any, // 鏄惁涓哄瓙琛� btnTab: PropTypes.any, // 琛ㄥ崟鏍囩椤碉紙鎸夐挳锛夊弬鏁� config: PropTypes.any, // 琛ㄥ崟鏍囩椤靛弬鏁� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, columns: PropTypes.array } @@ -286,7 +285,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '閾炬帴鍦板潃!' + message: '璇疯緭鍏ラ摼鎺ュ湴鍧�!' } ] })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} @@ -299,7 +298,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '澶勭悊鍑芥暟!' + message: '璇疯緭鍏ュ鐞嗗嚱鏁�!' } ] })( @@ -308,13 +307,13 @@ </Form.Item> </Col> : null} {printMode === 'normal' ? <Col span={8}> - <Form.Item label={'鎵撳嵃妯℃澘'}> + <Form.Item label="鎵撳嵃妯℃澘"> {getFieldDecorator('Template', { initialValue: verify.Template || '', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎵撳嵃妯℃澘!' + message: '璇烽�夋嫨鎵撳嵃妯℃澘!' } ] })( diff --git a/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx b/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx index 0a141c1..1e7f40c 100644 --- a/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx +++ b/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx @@ -8,7 +8,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, card: PropTypes.any, inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -126,7 +125,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, @@ -151,7 +150,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={item.precision || 0} />)} @@ -167,7 +166,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -196,7 +195,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/sharecomponent/cardcomponent/index.jsx b/src/templates/sharecomponent/cardcomponent/index.jsx index 00e2f78..9bf8922 100644 --- a/src/templates/sharecomponent/cardcomponent/index.jsx +++ b/src/templates/sharecomponent/cardcomponent/index.jsx @@ -5,8 +5,6 @@ import { EditOutlined, CloseOutlined, PlusOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getCardDetailForm } from '@/templates/zshare/formconfig' import MkIcon from '@/components/mk-icon' import DragDetail from './dragdetail' @@ -24,7 +22,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, modaltype: '', formlist: null, cardwidth: 0, @@ -273,11 +270,10 @@ deletedetail = (cell) => { const { card } = this.props - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${cell.content} 锛焋, + content: `纭畾鍒犻櫎 - ${cell.content} 锛焋, onOk() { let _details = fromJS(card.details).toJS() @@ -290,11 +286,10 @@ } deleteElem = (type) => { - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + '锛�', + content: '纭畾鍒犻櫎锛�', onOk() { let _subelement = fromJS(_this.props.card.subelement).toJS() _subelement = _subelement.filter(_type => _type !== type) @@ -331,7 +326,7 @@ render() { const { card } = this.props - const { dict, modaltype, cardcell, cardwidth, cardheight } = this.state + const { modaltype, cardcell, cardwidth, cardheight } = this.state let _width = '100%' if (card.bottom && card.bottom.actions.length > 0) { _width = Math.floor((100 / card.bottom.actions.length) * 10000) / 10000 + '%' @@ -463,7 +458,6 @@ destroyOnClose > <CardDetailForm - dict={dict} card={cardcell} inputSubmit={this.handleSubmit} formlist={this.state.formlist} diff --git a/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx b/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx index 92dcaab..c46a8fc 100644 --- a/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx +++ b/src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx @@ -10,7 +10,6 @@ class LineChartDrawerForm extends Component { static propTpyes = { - dict: PropTypes.object, plot: PropTypes.object, config: PropTypes.object, plotchange: PropTypes.func @@ -139,7 +138,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<Input placeholder="" autoComplete="off" disabled={item.readonly}/>)} @@ -160,7 +159,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={item.decimal} />)} @@ -181,7 +180,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -210,7 +209,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -261,7 +260,7 @@ rules: [ { required: enabled === 'true', - message: this.props.dict['form.required.select'] + '褰㈢姸!' + message: '璇烽�夋嫨褰㈢姸!' } ] })( @@ -281,7 +280,7 @@ rules: [ { required: enabled === 'true', - message: this.props.dict['form.required.select'] + '棰滆壊!' + message: '璇烽�夋嫨棰滆壊!' } ] })( diff --git a/src/templates/sharecomponent/chartcomponent/index.jsx b/src/templates/sharecomponent/chartcomponent/index.jsx index 8c356fb..f2a0771 100644 --- a/src/templates/sharecomponent/chartcomponent/index.jsx +++ b/src/templates/sharecomponent/chartcomponent/index.jsx @@ -4,8 +4,6 @@ import { Chart } from '@antv/g2' import DataSet from '@antv/data-set' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import ChartCompileForm from './chartcompile' import './index.scss' @@ -17,7 +15,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, visible: true } @@ -618,7 +615,6 @@ plot={plot} type={plot.chartType} config={this.props.config} - dict={this.state.dict} plotchange={this.plotChange} /> </div> diff --git a/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx b/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx index 0c9ffd3..59cdc1c 100644 --- a/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx +++ b/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx @@ -159,7 +159,6 @@ class ChartForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� MenuID: PropTypes.any, formlist: PropTypes.any, card: PropTypes.any, @@ -308,7 +307,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, @@ -333,7 +332,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={item.decimal} />)} @@ -354,7 +353,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -389,7 +388,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/sharecomponent/chartgroupcomponent/index.jsx b/src/templates/sharecomponent/chartgroupcomponent/index.jsx index 5f7ca72..dcb8f2d 100644 --- a/src/templates/sharecomponent/chartgroupcomponent/index.jsx +++ b/src/templates/sharecomponent/chartgroupcomponent/index.jsx @@ -5,8 +5,6 @@ import { DownOutlined, UpOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getChartViewForm } from '@/templates/zshare/formconfig' import ChartForm from './chartform' @@ -22,7 +20,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, chartlist: null, // 鍥捐〃闆� card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 @@ -206,11 +203,10 @@ */ deletechart = (plot) => { const { config } = this.props - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` ${plot.title} 锛焋, + content: `纭畾鍒犻櫎 ${plot.title} 锛焋, onOk() { let _chartlist = fromJS(_this.state.chartlist).toJS() let _chartview = _this.state.chartview @@ -257,7 +253,7 @@ // 宸插純鐢紝涓嶅湪寮�鏀炬坊鍔犻�氶亾 render() { const { config } = this.props - const { dict, chartlist, modaltype, card, chartview } = this.state + const { chartlist, modaltype, card, chartview } = this.state return ( <div className="model-table-chartview-list"> @@ -283,7 +279,6 @@ destroyOnClose > <ChartForm - dict={dict} card={card} formlist={this.state.formlist} inputSubmit={this.submitChart} diff --git a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx index 0c9be7e..788acdd 100644 --- a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx @@ -9,7 +9,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� columns: PropTypes.array, card: PropTypes.any, inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -80,13 +79,13 @@ <Form {...formItemLayout} style={{minHeight: '190px'}} id="columncolspan"> <Row gutter={24}> <Col span={12}> - <Form.Item label={this.props.dict['model.name']}> + <Form.Item label="鍚嶇О"> {getFieldDecorator('label', { initialValue: card.label, rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.name'] + '!' + message: '璇疯緭鍏ュ悕绉�!' }, { max: formRule.input.max, @@ -97,47 +96,41 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.form.type']}> + <Form.Item label="绫诲瀷"> {getFieldDecorator('type', { - initialValue: this.props.dict['model.form.colspan'], - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.form.type'] + '!' - } - ] + initialValue: '鍚堝苟鍒�' })(<Input placeholder="" autoComplete="off" disabled={true}/>)} </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.form.align']}> + <Form.Item label="瀵归綈鏂瑰紡"> {getFieldDecorator('Align', { initialValue: card.Align, rules: [ { required: true, - message: this.props.dict['form.required.select'] + this.props.dict['model.form.align'] + '!' + message: '璇烽�夋嫨瀵归綈鏂瑰紡!' } ] })( <Select getPopupContainer={() => document.getElementById('columncolspan')} > - <Select.Option value="left">{this.props.dict['model.form.alignLeft']}</Select.Option> - <Select.Option value="right">{this.props.dict['model.form.alignRight']}</Select.Option> - <Select.Option value="center">{this.props.dict['model.form.alignCenter']}</Select.Option> + <Select.Option value="left">宸﹀榻�</Select.Option> + <Select.Option value="right">鍙冲榻�</Select.Option> + <Select.Option value="center">灞呬腑</Select.Option> </Select> )} </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.form.columnWidth']}> + <Form.Item label="鍒楀"> {getFieldDecorator('Width', { initialValue: card.Width, rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.form.columnWidth'] + '!' + message: '璇疯緭鍏ュ垪瀹�!' } ] })(<InputNumber min={1} max={1000} precision={0} onPressEnter={this.handleSubmit} />)} @@ -154,26 +147,20 @@ initialValue: card.unfold || 'false' })( <Radio.Group> - <Radio value="true">{this.props.dict['model.true']}</Radio> - <Radio value="false">{this.props.dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group> )} </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['model.hidden']}> + <Form.Item label="闅愯棌"> {getFieldDecorator('Hide', { - initialValue: card.Hide || 'false', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['model.hidden'] + '!' - } - ] + initialValue: card.Hide || 'false' })( <Radio.Group> - <Radio value="true">{this.props.dict['model.true']}</Radio> - <Radio value="false">{this.props.dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group> )} </Form.Item> @@ -185,7 +172,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎺掑垪!' + message: '璇烽�夋嫨鎺掑垪鏂瑰紡!' } ] })( diff --git a/src/templates/sharecomponent/columncomponent/columnform/index.jsx b/src/templates/sharecomponent/columncomponent/columnform/index.jsx index ec356a5..2c04d33 100644 --- a/src/templates/sharecomponent/columncomponent/columnform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/columnform/index.jsx @@ -19,7 +19,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� MenuID: PropTypes.any, formlist: PropTypes.any, card: PropTypes.any, @@ -171,7 +170,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, ...rules ] @@ -193,7 +192,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<TextArea rows={2} disabled={item.readonly} onPressEnter={this.handleSubmit} />)} @@ -214,7 +213,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(item.unlimit ? <InputNumber onPressEnter={this.handleSubmit}/> : @@ -231,7 +230,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -265,7 +264,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -311,7 +310,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx b/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx index 9fa3613..3891b24 100644 --- a/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx @@ -6,7 +6,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.any, inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 } @@ -16,32 +15,32 @@ { type: 'text', key: 'label', - label: this.props.dict['model.name'], + label: '鍚嶇О', initVal: this.props.card.label, required: true }, { type: 'radio', key: 'Align', - label: this.props.dict['model.form.align'], + label: '瀵归綈鏂瑰紡', initVal: this.props.card.Align, required: true, options: [{ MenuID: 'left', - text: this.props.dict['model.form.alignLeft'] + text: '宸﹀榻�' }, { MenuID: 'right', - text: this.props.dict['model.form.alignRight'] + text: '鍙冲榻�' }, { MenuID: 'center', - text: this.props.dict['model.form.alignCenter'] + text: '灞呬腑' }] }, { type: 'number', key: 'Width', decimal: 0, - label: this.props.dict['model.form.columnWidth'], + label: '鍒楀', initVal: this.props.card.Width, required: true }, @@ -83,7 +82,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, @@ -103,7 +102,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={1} max={1000} precision={item.decimal} />)} @@ -119,7 +118,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -147,7 +146,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx index 52a345f..71179be 100644 --- a/src/templates/sharecomponent/columncomponent/index.jsx +++ b/src/templates/sharecomponent/columncomponent/index.jsx @@ -4,8 +4,6 @@ import { Modal, notification, Switch, message } from 'antd' import { CopyOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getColumnForm } from '@/templates/zshare/formconfig' import ColumnForm from './columnform' @@ -26,7 +24,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, columnlist: null, // 鏄剧ず鍒� showField: true, // 鏄剧ず鍒楀瓧娈� modaltype: '', // 妯℃�佹鎺у埗 @@ -283,11 +280,10 @@ */ deleteElement = (card) => { const { config } = this.props - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, + content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { let _columnlist = fromJS(_this.state.columnlist).toJS() @@ -502,12 +498,12 @@ render() { const { config } = this.props - const { modaltype, columnlist, dict, card } = this.state + const { modaltype, columnlist, card } = this.state return ( <div className="model-table-column-list"> {columnlist && columnlist.length > 0 ? <CopyOutlined className="column-copy" title="copy" onClick={this.copycolumn} /> : null} - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={this.onFieldChange} /> + <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={this.onFieldChange} /> <DragElement list={columnlist} setting={config.setting} @@ -530,7 +526,6 @@ destroyOnClose > <ColumnForm - dict={dict} card={card} MenuID={this.props.menu.MenuID} inputSubmit={this.handleSubmit} @@ -540,7 +535,7 @@ </Modal> {/* 鍚堝苟鍒楃紪杈� */} <Modal - title={dict['model.form.colspan'] + '-' + dict['model.edit']} + title="鍚堝苟鍒�-缂栬緫" visible={modaltype === 'colspan'} width={850} maskClosable={false} @@ -549,7 +544,6 @@ destroyOnClose > <ColspanForm - dict={dict} card={card} inputSubmit={this.handleSubmit} columns={columnlist} @@ -567,7 +561,6 @@ destroyOnClose > <GridBtnForm - dict={dict} inputSubmit={this.handleSubmit} card={config.gridBtn} wrappedComponentRef={(inst) => this.gridBtnFormRef = inst} @@ -580,7 +573,7 @@ visible={modaltype === 'mark'} width={'75vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.markSubmit} onCancel={() => { this.setState({ modaltype: '' }) }} destroyOnClose @@ -588,7 +581,6 @@ <MarkColumn ref="markRef" card={card} - dict={dict} columns={columnlist} /> </Modal> diff --git a/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx b/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx index a7ab159..d6c58f2 100644 --- a/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx +++ b/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx @@ -13,7 +13,6 @@ class MarkColumn extends Component { static propTpyes = { columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, } @@ -219,7 +218,6 @@ return ( <div id="mark-column-box-modal" className=""> <MarkForm - dict={this.props.dict} card={card} columns={columns} markChange={this.markChange} diff --git a/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx b/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx index e98fb1e..94683e2 100644 --- a/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx @@ -8,7 +8,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, // 瀛楁淇℃伅 columns: PropTypes.array, // 鍒楀悕闆嗗悎 markChange: PropTypes.func // 淇敼鍑芥暟 @@ -194,7 +193,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀛楁!' + message: '璇烽�夋嫨瀛楁!' } ] })( @@ -229,7 +228,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮鏂瑰紡!' + message: '璇烽�夋嫨瀵规瘮鏂瑰紡!' } ] })( @@ -257,7 +256,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮瀛楁!' + message: '璇烽�夋嫨瀵规瘮瀛楁!' } ] })( @@ -279,7 +278,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鏍囪鏂瑰紡!' + message: '璇烽�夋嫨鏍囪鏂瑰紡!' } ] })( @@ -321,13 +320,13 @@ </Form.Item> </Col> : null} {signType === 'icon' ? <Col span={6}> - <Form.Item label={'鍥炬爣'}> + <Form.Item label="鍥炬爣"> {getFieldDecorator('icon', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鍥炬爣!' + message: '璇烽�夋嫨鍥炬爣!' } ] })( @@ -344,7 +343,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '棰滆壊!' + message: '璇烽�夋嫨棰滆壊!' } ] })( diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index 26c4cf0..53642ec 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -4,8 +4,6 @@ import { Button, Modal, Empty, notification } from 'antd' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import EditCard from './editcard' import MKEmitter from '@/utils/events.js' @@ -19,7 +17,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, appType: sessionStorage.getItem('appType'), fields: [], // 瀛楁闆� visible: false, // 妯℃�佹鎺у埗 @@ -262,19 +259,19 @@ render() { const { type } = this.props - const { dict, fields } = this.state + const { fields } = this.state return ( <div className="quickly-add"> - <Button type="primary" block onClick={this.queryField}>{dict['model.batchAdd']}</Button> + <Button type="primary" block onClick={this.queryField}>鎵归噺娣诲姞</Button> {/* 鏍规嵁瀛楁鍚嶆坊鍔犳樉绀哄垪鍙婃悳绱㈡潯浠� */} <Modal wrapClassName="model-table-fieldmanage-modal" - title={dict['model.edit']} + title="缂栬緫" visible={this.state.visible} width={'65vw'} maskClosable={false} - cancelText={dict['model.close']} + cancelText="鍏抽棴" onOk={this.addFieldSubmit} onCancel={() => this.setState({ visible: false })} destroyOnClose diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 5f5132c..01a9c35 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -6,8 +6,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getSearchForm } from '@/templates/zshare/formconfig' import asyncComponent from '@/utils/asyncComponent' import MKEmitter from '@/utils/events.js' @@ -27,7 +25,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, searchlist: null, sqlVerifing: false, visible: false, @@ -273,11 +270,10 @@ */ deleteElement = (card) => { const { config } = this.props - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, + content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { let _searchlist = fromJS(_this.state.searchlist).toJS() @@ -350,12 +346,12 @@ render() { const { config } = this.props - const { dict, searchlist, visible, sqlVerifing, card, showField, setVisible } = this.state + const { searchlist, visible, sqlVerifing, card, showField, setVisible } = this.state return ( <div className={'model-table-search-list length' + searchlist.length + (showField ? ' show-field' : '')}> <FieldsComponent config={{uuid: config.uuid, search: searchlist}} type="search" /> - <Switch className="switch-field-show" checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> + <Switch className="switch-field-show" checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={showField} onChange={this.onFieldChange} /> <DragElement list={searchlist} setting={config.wrap || config.setting} @@ -376,7 +372,6 @@ destroyOnClose > <SearchForm - dict={dict} card={this.state.card} formlist={this.state.formlist} inputSubmit={this.handleSubmit} diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 06d7186..c4365b3 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -109,7 +109,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, // 琛ㄥ崟 card: PropTypes.object, // 鎼滅储鏉′欢淇℃伅 inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -267,7 +266,6 @@ } optionChange = (key, value) => { - let oriType = this.record.type this.record[key] = value let _fieldval = {} @@ -292,9 +290,6 @@ if (value === 'checkcard') { this.record.multiple = 'false' _fieldval.multiple = 'false' - _fieldval.ratio = 24 - } else if (oriType === 'checkcard') { - _fieldval.ratio = 6 } if (this.record.options.length > 0) { @@ -437,7 +432,6 @@ getFields() { const { getFieldDecorator } = this.props.form - const { dict } = this.props const { formlist } = this.state const fields = [] @@ -454,7 +448,7 @@ if (item.type === 'text') { let type = this.record.type rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] if (item.key === 'field' || item.key === 'datefield') { rules.push({ @@ -487,7 +481,7 @@ } } else if (item.type === 'number') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] initVal = item.initVal @@ -498,7 +492,7 @@ } } else if (item.type === 'select') { // 涓嬫媺鎼滅储 rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Select @@ -516,7 +510,7 @@ </Select> } else if (item.type === 'radio') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => {this.optionChange(item.key, e.target.value)}}> @@ -528,7 +522,7 @@ </Radio.Group> } else if (item.type === 'codemirror') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] span = 24 className = 'text-area' @@ -550,7 +544,7 @@ if (this.record.linkField) { type = 'link' } - content = <DataTable dict={dict} type={type} display={this.record.display} linkSubFields={[]} transfield={{}} fields={this.record.fields || []} onChange={this.changeOptions}/> + content = <DataTable type={type} display={this.record.display} linkSubFields={[]} transfield={{}} fields={this.record.fields || []} onChange={this.changeOptions}/> } } else if (item.type === 'fields') { span = 24 @@ -560,10 +554,10 @@ { required: item.required, message: '璇锋坊鍔�' + item.label + '!' } ] - content = <FieldsTable dict={dict} onChange={this.changeField}/> + content = <FieldsTable onChange={this.changeField}/> } else if (item.type === 'checkbox') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Checkbox.Group style={{width: '105%'}} options={item.options} onChange={(values) => this.optionChange(item.key, values)}/> @@ -582,7 +576,7 @@ } else if (item.type === 'color') { className = 'color-form-item' rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <ColorSketch allowClear={true}/> diff --git a/src/templates/sharecomponent/settingcalcomponent/index.jsx b/src/templates/sharecomponent/settingcalcomponent/index.jsx index 1d9addf..646acee 100644 --- a/src/templates/sharecomponent/settingcalcomponent/index.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/index.jsx @@ -4,8 +4,6 @@ import { Modal } from 'antd' import { SettingOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import VerifyCard from './verifycard' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -18,7 +16,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, sourcelist: [], visible: false, loading: false, @@ -77,7 +74,7 @@ render () { const { config } = this.props - const { visible, dict, loading } = this.state + const { visible, loading } = this.state return ( <div className="model-datasource"> @@ -87,14 +84,13 @@ visible={visible} width={'75vw'} maskClosable={false} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} confirmLoading={loading} onCancel={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false }) }} destroyOnClose > <VerifyCard - dict={dict} config={config} menuId={this.props.config.uuid} searches={config.search} diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/columnform/index.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/columnform/index.jsx index c8ef7bb..2539ee3 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/columnform/index.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/columnform/index.jsx @@ -6,7 +6,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� columnChange: PropTypes.func // 淇敼鍑芥暟 } @@ -69,7 +68,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍚嶇О!' + message: '璇疯緭鍏ュ悕绉�!' } ] })(<Input placeholder="" autoComplete="off" />)} @@ -82,20 +81,20 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '瀛楁!' + message: '璇疯緭鍏ュ瓧娈�!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={7}> - <Form.Item label={'鏁版嵁绫诲瀷'}> + <Form.Item label="鏁版嵁绫诲瀷"> {getFieldDecorator('datatype', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鏁版嵁绫诲瀷!' + message: '璇烽�夋嫨鏁版嵁绫诲瀷!' } ] })( diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx index 6ff6f95..66977c5 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/index.jsx @@ -21,7 +21,6 @@ class VerifyCard extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, // 鏁版嵁婧愪俊鎭� menuId: PropTypes.string, // 鑿滃崟Id searches: PropTypes.array, // 鎼滅储鏉′欢 @@ -56,10 +55,10 @@ dataIndex: 'operation', render: (text, record) => (<div> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.deleteColumn(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -391,7 +390,6 @@ <TabPane tab="鏁版嵁婧�" key="setting"> <SettingForm menuId={this.props.menuId} - dict={this.props.dict} columns={columns} setting={setting} scripts={scripts} @@ -400,7 +398,6 @@ </TabPane> <TabPane tab="瀛楁闆�" key="columns"> <ColForm - dict={this.props.dict} columnChange={this.columnChange} wrappedComponentRef={(inst) => this.contrastForm = inst} /> @@ -425,7 +422,6 @@ </span> } key="scripts" id="mk-setting-scripts"> <CustomScript - dict={this.props.dict} setting={setting} scripts={scripts} urlFields={config.urlFields} diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx index aa58249..1a6de21 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx @@ -14,7 +14,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menuId: PropTypes.string, // 鑿滃崟Id setting: PropTypes.object, // 鏁版嵁婧愰厤缃� columns: PropTypes.array, // 鍒楄缃� @@ -168,7 +167,7 @@ rules.push({ required: true, - message: this.props.dict['form.required.input'] + '鍐呴儴鍑芥暟!' + message: '璇疯緭鍏ュ唴閮ㄥ嚱鏁�!' }, { pattern: _patten, message: formRule.func.innerMessage @@ -185,7 +184,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '琛ㄥ悕!' + message: '璇疯緭鍏ヨ〃鍚�!' }, { max: 50, @@ -202,7 +201,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎺ュ彛绫诲瀷!' + message: '璇烽�夋嫨鎺ュ彛绫诲瀷!' }, ] })( @@ -243,7 +242,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鎺ュ彛鍦板潃!' + message: '璇疯緭鍏ユ帴鍙e湴鍧�!' }, ] })(<TextArea rows={2}/>)} diff --git a/src/templates/sharecomponent/settingcomponent/index.jsx b/src/templates/sharecomponent/settingcomponent/index.jsx index 72b3c79..85be0a7 100644 --- a/src/templates/sharecomponent/settingcomponent/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/index.jsx @@ -5,8 +5,6 @@ import { SettingOutlined } from '@ant-design/icons' import Utils, { FuncUtils } from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import SettingForm from './settingform' import CreateFunc from '@/templates/zshare/createfunc' @@ -23,7 +21,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, menu: null, // 鑿滃崟淇℃伅 search: null, // 鎼滅储鏉′欢锛屽寘鎷富琛ㄦ悳绱� formlist: null, // 琛ㄥ崟淇℃伅 @@ -177,7 +174,7 @@ render() { const { config } = this.props - const { dict, visible, search, menu, record } = this.state + const { visible, search, menu, record } = this.state return ( <> @@ -190,15 +187,14 @@ maskClosable={false} onCancel={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false, loading: false })}} footer={[ - record && record.interType === 'system' ? <CreateInterface key="interface" loading={this.state.interloading} dict={dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/> : null, - record && record.interType === 'inner' ? <CreateFunc key="create" dict={dict} ref="funcCreatComponent" trigger={this.tableCreatFunc}/> : null, - <Button key="cancel" onClick={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false, loading: false }) }}>{this.state.dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" loading={this.state.loading} onClick={this.settingSave}>{this.state.dict['model.confirm']}</Button> + record && record.interType === 'system' ? <CreateInterface key="interface" loading={this.state.interloading} ref="tableCreatInterface" trigger={this.tableCreatInterface}/> : null, + record && record.interType === 'inner' ? <CreateFunc key="create" ref="funcCreatComponent" trigger={this.tableCreatFunc}/> : null, + <Button key="cancel" onClick={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false, loading: false }) }}>鍙栨秷</Button>, + <Button key="confirm" type="primary" loading={this.state.loading} onClick={this.settingSave}>纭畾</Button> ]} destroyOnClose > <SettingForm - dict={dict} menu={menu} config={config} search={search} diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 5ce74b1..18ba64c 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -17,7 +17,6 @@ class SettingForm extends Component { static propTpyes = { config: PropTypes.object, // 椤甸潰閰嶇疆 - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 setting: PropTypes.object, // 鏁版嵁婧愰厤缃� columns: PropTypes.array, // 鍒楄缃� @@ -190,7 +189,7 @@ } render() { - const { setting, dict, menu, config, columns } = this.props + const { setting, menu, config, columns } = this.props const { getFieldDecorator } = this.props.form const { interType, funcRules, funcTooltip, tableType, controlField, sysInterface } = this.state @@ -215,7 +214,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '琛ㄥ悕!' + message: '璇疯緭鍏ヨ〃鍚�!' }, { max: 50, @@ -230,13 +229,13 @@ </Form.Item> </Col> <Col span={8}> - <Form.Item label={dict['header.form.intertype']}> + <Form.Item label="鎺ュ彛绫诲瀷"> {getFieldDecorator('interType', { initialValue: interType, rules: [ { required: true, - message: dict['form.required.select'] + dict['header.form.intertype'] + '!' + message: '璇烽�夋嫨鎺ュ彛绫诲瀷!' }, ] })( @@ -261,19 +260,19 @@ </Form.Item> </Col> {interType === 'outer' ? <Col span={8}> - <Form.Item label={dict['header.form.sysInterface']}> + <Form.Item label="绯荤粺鎺ュ彛"> {getFieldDecorator('sysInterface', { initialValue: sysInterface, rules: [ { required: true, - message: dict['form.required.select'] + dict['header.form.sysInterface'] + '!' + message: '璇烽�夋嫨绯荤粺鎺ュ彛!' }, ] })( <Radio.Group onChange={(e) => {this.onRadioChange(e, 'sysInterface')}}> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group>)} </Form.Item> </Col> : null} @@ -284,7 +283,7 @@ rules: [ { required: interType === 'outer' && sysInterface === 'true' ? false : true, - message: dict['form.required.input'] + '鎺ュ彛鍦板潃!' + message: '璇疯緭鍏ユ帴鍙e湴鍧�!' }, ] })(<TextArea rows={2} readOnly={interType === 'outer' && sysInterface === 'true'}/>)} @@ -314,7 +313,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '鍐呴儴鍑芥暟!' + message: '璇疯緭鍏ュ唴閮ㄥ嚱鏁�!' }, { max: formRule.func.max, @@ -403,7 +402,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '榛樿鎺掑簭!' + message: '璇疯緭鍏ラ粯璁ゆ帓搴�!' }, { max: formRule.input.max, @@ -419,8 +418,8 @@ initialValue: setting.laypage || 'true' })( <Radio.Group> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group>)} </Form.Item> </Col> @@ -441,8 +440,8 @@ initialValue: setting.actionfixed === 'true' || setting.actionfixed === true ? 'true' : 'false' })( <Radio.Group> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group>)} </Form.Item> </Col> : null} @@ -457,8 +456,8 @@ initialValue: setting.columnfixed === 'true' || setting.columnfixed === true ? 'true' : 'false' })( <Radio.Group> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group>)} </Form.Item> </Col> : null} */} @@ -491,7 +490,7 @@ </Radio.Group>)} </Form.Item> </Col> - <Col span={8}> + {/* <Col span={8}> <Form.Item label="浜嬪姟"> {getFieldDecorator('transaction', { initialValue: setting.transaction || 'false' @@ -501,7 +500,7 @@ <Radio value="false">涓嶄娇鐢�</Radio> </Radio.Group>)} </Form.Item> - </Col> + </Col> */} <Col span={8}> <Form.Item label={ <Tooltip placement="topLeft" title="浣跨敤鎬ラ�熸ā寮忔椂锛岃〃鏍间腑鐨勬爣璁般�佸弻鍑讳簨浠躲�佹牸寮忓寲銆佽鍚堝苟銆佸墠缂�銆佸悗缂�銆佸瓧娈甸�忚绛夋晥鏋滃皢鏃犳晥锛屼笖鏁版嵁閮戒細浠ユ枃鏈牸寮忔樉绀恒��"> diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 3ae2a2c..86caaea 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -20,7 +20,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 config: PropTypes.object, // 椤甸潰閰嶇疆淇℃伅 search: PropTypes.array, // 鎼滅储鏉′欢 @@ -496,7 +495,7 @@ } render() { - const { config, menu, dict } = this.props + const { config, menu } = this.props const { loading, activeKey, setting, defaultSql, columns, scripts, status, visible, script, scriptValue } = this.state return ( @@ -506,7 +505,6 @@ <TabPane tab="鏁版嵁婧�" key="setting"> <DataSource menu={menu} - dict={dict} config={config} columns={columns} setting={setting} @@ -533,7 +531,6 @@ this.setState({visible: true, script: null, scriptValue: ''}) }}/> : null} <CustomScript - dict={dict} setting={setting} scripts={scripts} defaultSql={defaultSql} @@ -582,7 +579,7 @@ <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(item) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> diff --git a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx index 8cdffeb..6305eb8 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx @@ -17,7 +17,6 @@ class CustomForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� setting: PropTypes.object, // 璁剧疆 scripts: PropTypes.array, // 鑷畾涔夎剼鏈垪琛� searches: PropTypes.array, // 鎼滅储鏉′欢 @@ -89,11 +88,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> diff --git a/src/templates/sharecomponent/tablecomponent/index.jsx b/src/templates/sharecomponent/tablecomponent/index.jsx index 77b174e..540dee1 100644 --- a/src/templates/sharecomponent/tablecomponent/index.jsx +++ b/src/templates/sharecomponent/tablecomponent/index.jsx @@ -290,6 +290,7 @@ value="璇烽�夋嫨琛ㄥ悕" onSelect={this.onTableChange} dropdownClassName="mk-tables" + dropdownMatchSelectWidth={false} showArrow={false} getPopupContainer={() => containerId ? document.getElementById(containerId) : document.body} filterOption={(input, option) => { diff --git a/src/templates/sharecomponent/tablecomponent/index.scss b/src/templates/sharecomponent/tablecomponent/index.scss index 407a9e9..92d6c69 100644 --- a/src/templates/sharecomponent/tablecomponent/index.scss +++ b/src/templates/sharecomponent/tablecomponent/index.scss @@ -30,4 +30,7 @@ >.ant-form-item-label { width: 33.33333333%; } +} +.mk-tables { + max-width: 300px; } \ No newline at end of file diff --git a/src/templates/sharecomponent/tabscomponent/index.jsx b/src/templates/sharecomponent/tabscomponent/index.jsx index 43e9a29..1f0b602 100644 --- a/src/templates/sharecomponent/tabscomponent/index.jsx +++ b/src/templates/sharecomponent/tabscomponent/index.jsx @@ -5,8 +5,6 @@ import { QuestionCircleOutlined, ArrowDownOutlined, ArrowUpOutlined, PlusOutlined, DeleteOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { getTabForm } from '@/templates/zshare/formconfig' import TabForm from './tabform' @@ -24,7 +22,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, tabgroups: [], // 鏍囩缁� card: [], // 缂栬緫鏍囩 group: [], // 缂栬緫缁� @@ -385,7 +382,7 @@ } render() { - const { tabgroups, visible, dict } = this.state + const { tabgroups, visible } = this.state return ( <div className="model-table-tab-list"> @@ -407,7 +404,6 @@ handleMenu={(card) => this.handleTab(card, group)} deleteMenu={(card) => this.deleteElement(card, group)} doubleClickCard={this.props.setSubConfig} - placeholder={dict['form.required.add'] + dict['model.form.tab']} /> </div>) })} @@ -422,7 +418,6 @@ destroyOnClose > <TabForm - dict={dict} card={this.state.card} tabs={this.props.tabs} levels={this.state.levels} diff --git a/src/templates/sharecomponent/tabscomponent/tabdragelement/index.jsx b/src/templates/sharecomponent/tabscomponent/tabdragelement/index.jsx index 9d819d5..ac0269f 100644 --- a/src/templates/sharecomponent/tabscomponent/tabdragelement/index.jsx +++ b/src/templates/sharecomponent/tabscomponent/tabdragelement/index.jsx @@ -9,7 +9,7 @@ const { TabPane } = Tabs -const Container = ({list, placeholder, handleList, handleMenu, deleteMenu, doubleClickCard }) => { +const Container = ({list, handleList, handleMenu, deleteMenu, doubleClickCard }) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -102,7 +102,7 @@ </Tabs> {cards.length === 0 ? <div className="commontab-drawarea-placeholder"> - {placeholder} + 璇锋坊鍔犳爣绛� </div> : null } </div> diff --git a/src/templates/sharecomponent/tabscomponent/tabform/index.jsx b/src/templates/sharecomponent/tabscomponent/tabform/index.jsx index efd6bec..a7e0ec3 100644 --- a/src/templates/sharecomponent/tabscomponent/tabform/index.jsx +++ b/src/templates/sharecomponent/tabscomponent/tabform/index.jsx @@ -13,7 +13,6 @@ class MainTab extends Component { static propTpyes = { tabs: PropTypes.array, // 鍙叧鑱旀爣绛鹃泦 - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, // 琛ㄥ崟 levels: PropTypes.any, // 鏍囩鏄剧ず绾у埆 card: PropTypes.object, // 鏍囩椤典俊鎭� @@ -138,7 +137,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, @@ -165,7 +164,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<InputNumber min={item.min} max={item.max} precision={0} />)} @@ -181,7 +180,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -214,7 +213,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -263,7 +262,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/sharecomponent/treesettingcomponent/index.jsx b/src/templates/sharecomponent/treesettingcomponent/index.jsx index 74fb02f..867f295 100644 --- a/src/templates/sharecomponent/treesettingcomponent/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/index.jsx @@ -3,8 +3,6 @@ import { Modal } from 'antd' import { SettingOutlined } from '@ant-design/icons' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import SettingForm from './settingform' import MKEmitter from '@/utils/events.js' @@ -18,7 +16,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, menu: null, // 鑿滃崟淇℃伅 visible: false, // 妯℃�佹鎺у埗 loading: false // 璁剧疆淇℃伅楠岃瘉淇濆瓨涓� @@ -92,7 +89,7 @@ render() { const { config } = this.props - const { dict, visible, loading } = this.state + const { visible, loading } = this.state return ( <div className="model-tree-menu-setting"> @@ -109,7 +106,6 @@ destroyOnClose > <SettingForm - dict={dict} config={config} menu={this.state.menu} inputSubmit={this.settingSave} diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx index 48382e0..075f17b 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx @@ -14,7 +14,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 setting: PropTypes.object, // 鏁版嵁婧愰厤缃� inputSubmit: PropTypes.func // 瑙﹀彂鎻愪氦 @@ -175,7 +174,7 @@ } render() { - const { setting, dict, menu } = this.props + const { setting, menu } = this.props const { getFieldDecorator } = this.props.form const { interType, funcRules, funcTooltip } = this.state @@ -200,7 +199,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '琛ㄥ悕!' + message: '璇疯緭鍏ヨ〃鍚�!' }, { max: 50, @@ -217,7 +216,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '鏍囬!' + message: '璇疯緭鍏ユ爣棰�!' }, { max: formRule.input.max, @@ -228,13 +227,13 @@ </Form.Item> </Col> <Col span={8}> - <Form.Item label={dict['header.form.intertype']}> + <Form.Item label="鎺ュ彛绫诲瀷"> {getFieldDecorator('interType', { initialValue: interType, rules: [ { required: true, - message: dict['form.required.select'] + dict['header.form.intertype'] + '!' + message: '璇烽�夋嫨鎺ュ彛绫诲瀷!' } ] })( @@ -246,19 +245,19 @@ </Form.Item> </Col> {interType === 'outer' ? <Col span={8}> - <Form.Item label={dict['header.form.sysInterface']}> + <Form.Item label="绯荤粺鎺ュ彛"> {getFieldDecorator('sysInterface', { initialValue: setting.sysInterface || 'false', rules: [ { required: true, - message: dict['form.required.select'] + dict['header.form.sysInterface'] + '!' + message: '璇烽�夋嫨绯荤粺鎺ュ彛!' }, ] })( <Radio.Group onChange={(e) => {this.onRadioChange(e, 'sysInterface')}}> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group>)} </Form.Item> </Col> : null} @@ -274,7 +273,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '鍐呴儴鍑芥暟!' + message: '璇疯緭鍏ュ唴閮ㄥ嚱鏁�!' }, { max: formRule.func.max, @@ -292,7 +291,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '鎺ュ彛鍦板潃!' + message: '璇疯緭鍏ユ帴鍙e湴鍧�!' } ] })(<TextArea rows={2}/>)} @@ -328,7 +327,7 @@ </Col> : null} <Col span={8}> <Form.Item label={ - <Tooltip placement="topLeft" title={'鏁版嵁鍊煎瓧娈点��'}> + <Tooltip placement="topLeft" title="鏁版嵁鍊煎瓧娈点��"> <QuestionCircleOutlined className="mk-form-tip" /> Value </Tooltip> @@ -338,7 +337,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + 'Value!' + message: '璇疯緭鍏alue!' }, { pattern: formRule.field.pattern, @@ -363,7 +362,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + 'Label!' + message: '璇疯緭鍏abel!' }, { pattern: formRule.field.pattern, @@ -378,7 +377,7 @@ </Col> <Col span={8}> <Form.Item label={ - <Tooltip placement="topLeft" title={'鐖剁骇瀛楁銆�'}> + <Tooltip placement="topLeft" title="鐖剁骇瀛楁銆�"> <QuestionCircleOutlined className="mk-form-tip" /> Parent </Tooltip> @@ -388,7 +387,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + 'Label!' + message: '璇疯緭鍏abel!' }, { pattern: formRule.field.pattern, @@ -408,7 +407,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '鎺掑簭!' + message: '璇疯緭鍏ユ帓搴�!' }, { max: formRule.input.max, @@ -448,7 +447,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '瀹藉害!' + message: '璇疯緭鍏ュ搴�!' } ] })(<InputNumber min={2} max={12} precision={0} />)} diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx index 8f182b8..664ef5b 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx @@ -16,7 +16,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 config: PropTypes.object, // 椤甸潰閰嶇疆淇℃伅 inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -255,7 +254,6 @@ <TabPane tab="鏁版嵁婧�" key="setting"> <DataSource menu={menu} - dict={this.props.dict} setting={setting} inputSubmit={this.props.inputSubmit} wrappedComponentRef={(inst) => this.settingForm = inst} @@ -268,7 +266,6 @@ </span> } key="scripts" id="mk-setting-scripts"> <CustomScript - dict={this.props.dict} setting={setting} scripts={scripts} defaultSql={this.state.defaultsql} diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 4612793..c3d4de1 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -8,8 +8,6 @@ import moment from 'moment' import Api from '@/api' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import Utils from '@/utils/utils.js' import MKEmitter from '@/utils/events.js' import { updateSubTable } from '@/utils/utils-update.js' @@ -50,7 +48,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆 visible: false, // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪锛屾ā鎬佹鏄剧ず鎺у埗 menuloading: false, // 鑿滃崟淇濆瓨涓� @@ -290,7 +287,7 @@ if (!_config.tabName || !_config.tabNo) { notification.warning({ top: 92, - message: this.state.dict['model.menu.basemsg'], + message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', duration: 5 }) this.setState({activeKey: '0'}) @@ -1037,7 +1034,6 @@ <Panel forceRender={true} header={'鏍囩鍩烘湰淇℃伅'} key="0" id="subtable-basedata"> {/* 鑿滃崟淇℃伅 */} <MenuForm - dict={this.state.dict} config={config} updatemenu={this.updateconfig} /> @@ -1049,7 +1045,7 @@ /> </Panel> {/* 鎼滅储鏉′欢娣诲姞 */} - <Panel header={this.state.dict['header.menu.search']} key="1"> + <Panel header="鎼滅储" key="1"> <div className="search-element"> {Source.searchItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -1058,7 +1054,7 @@ <FieldsComponent config={config} type="search" /> </Panel> {/* 鎸夐挳娣诲姞 */} - <Panel header={this.state.dict['header.menu.action']} key="2"> + <Panel header="鎸夐挳" key="2"> <div className="search-element"> {Source.actionItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -1088,7 +1084,7 @@ })} </Panel> {/* 娣诲姞鏄剧ず鍒� */} - <Panel header={this.state.dict['header.menu.column']} key="3"> + <Panel header="鏄剧ず鍒�" key="3"> <div className="search-element"> {Source.columnItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -1108,10 +1104,10 @@ <div> <Versions MenuId={config.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> - <EditComponent dict={this.state.dict} type="table" options={['search', 'form', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> + <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config.enabled} onChange={this.onEnabledChange} /> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> - <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> + <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> + <Button onClick={this.cancelConfig}>杩斿洖</Button> </div> } style={{ width: '100%' }}> <SettingComponent @@ -1199,13 +1195,13 @@ visible={this.state.closeVisible} onCancel={() => { this.setState({closeVisible: false}) }} footer={[ - <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, - <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>{this.state.dict['model.notsave']}</Button>, - <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> + <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>淇濆瓨</Button>, + <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>涓嶄繚瀛�</Button>, + <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>鍙栨秷</Button> ]} destroyOnClose > - {this.state.dict['header.menu.config.placeholder']} + 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� </Modal> {this.state.loading && <Spin size="large" />} </div> diff --git a/src/templates/subtableconfig/menuform/index.jsx b/src/templates/subtableconfig/menuform/index.jsx index 72f493f..999aa2b 100644 --- a/src/templates/subtableconfig/menuform/index.jsx +++ b/src/templates/subtableconfig/menuform/index.jsx @@ -9,7 +9,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, updatemenu: PropTypes.func } @@ -44,7 +43,7 @@ } render() { - const { dict, config } = this.props + const { config } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -67,7 +66,7 @@ rules: [ { required: true, - message: dict['form.required.input'] + '椤甸潰鍚嶇О!' + message: '璇疯緭鍏ラ〉闈㈠悕绉�!' }, { max: formRule.input.max, @@ -78,13 +77,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['model.menu'] + dict['model.param']}> + <Form.Item label="鑿滃崟鍙傛暟"> {getFieldDecorator('tabNo', { initialValue: config.tabNo, rules: [ { required: true, - message: dict['form.required.input'] + dict['model.menu'] + dict['model.param'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' }, { max: formRule.input.max, @@ -95,7 +94,7 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['header.menu.Remark']}> + <Form.Item label="澶囨敞"> {getFieldDecorator('Remark', { initialValue: config.Remark, rules: [ diff --git a/src/templates/subtableconfig/source.jsx b/src/templates/subtableconfig/source.jsx index bb48d97..ef337b5 100644 --- a/src/templates/subtableconfig/source.jsx +++ b/src/templates/subtableconfig/source.jsx @@ -1,8 +1,4 @@ import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS class SubTableBaseData { baseConfig = { @@ -48,7 +44,7 @@ resourceType: '0', options: [], orderType: 'asc', - match: 'equal', + match: '=', }, { origin: true, uuid: Utils.getuuid(), @@ -152,7 +148,7 @@ Align: 'center', IsSort: 'false', uuid: Utils.getuuid(), - label: CommonDict['model.operation'], + label: '鎿嶄綔', type: 'action', style: 'button', show: 'horizontal', @@ -173,25 +169,25 @@ searchItems = [ { type: 'search', - label: CommonDict['model.form.text'], + label: '鏂囨湰', subType: 'text', url: '' }, { type: 'search', - label: CommonDict['model.form.select'], + label: '涓嬫媺閫夋嫨', subType: 'select', url: '' }, { type: 'search', - label: CommonDict['model.form.multiselect'], + label: '涓嬫媺澶氶��', subType: 'multiselect', url: '' }, { type: 'search', - label: CommonDict['model.form.link'], + label: '鑱斿姩鑿滃崟', subType: 'link', url: '' }, @@ -215,19 +211,19 @@ }, { type: 'search', - label: CommonDict['model.form.datemonth'], + label: '鏃ユ湡锛堟湀锛�', subType: 'datemonth', url: '' }, { type: 'search', - label: CommonDict['model.form.daterange'], + label: '鏃ユ湡锛堝尯闂达級', subType: 'daterange', url: '' }, { type: 'search', - label: CommonDict['model.form.dategroup'], + label: '鏃ユ湡锛堢粍鍚堬級', subType: 'group', url: '' } @@ -236,55 +232,55 @@ actionItems = [ { type: 'action', - label: CommonDict['model.form.popform'], + label: '寮圭獥锛堣〃鍗曪級', subType: 'pop', url: '' }, { type: 'action', - label: CommonDict['model.form.prompt'], + label: '鎻愮ず妗�', subType: 'prompt', url: '' }, { type: 'action', - label: CommonDict['model.form.exec'], + label: '鐩存帴鎵ц', subType: 'exec', url: '' }, { type: 'action', - label: CommonDict['model.form.excelIn'], + label: '瀵煎叆Excel', subType: 'excelIn', url: '' }, { type: 'action', - label: CommonDict['model.form.excelOut'], + label: '瀵煎嚭Excel', subType: 'excelOut', url: '' }, { type: 'action', - label: CommonDict['model.form.popview'], + label: '寮圭獥锛堟爣绛撅級', subType: 'popview', url: '' }, { type: 'action', - label: CommonDict['model.form.tab'], + label: '鏍囩椤�', subType: 'tab', url: '' }, { type: 'action', - label: CommonDict['model.form.newpage'], + label: '鏂伴〉闈�', subType: 'innerpage', url: '' }, { type: 'action', - label: CommonDict['model.form.funcbutton'], + label: '鍔熻兘鎸夐挳', subType: 'funcbutton', url: '' } @@ -293,37 +289,37 @@ columnItems = [ { type: 'columns', - label: CommonDict['model.form.text'], + label: '鏂囨湰', subType: 'text', url: '' }, { type: 'columns', - label: CommonDict['model.form.picture'], + label: '鍥剧墖', subType: 'picture', url: '' }, { type: 'columns', - label: CommonDict['model.form.number'], + label: '鏁板瓧', subType: 'number', url: '' }, { type: 'columns', - label: CommonDict['model.form.href'], + label: '閾炬帴', subType: 'link', url: '' }, { type: 'columns', - label: CommonDict['model.form.textarea'], + label: '澶氳鏂囨湰', subType: 'textarea', url: '' }, { type: 'columns', - label: CommonDict['model.form.colspan'], + label: '鍚堝苟鍒�', subType: 'colspan', url: '' }, diff --git a/src/templates/treepageconfig/index.jsx b/src/templates/treepageconfig/index.jsx index c5da906..a030308 100644 --- a/src/templates/treepageconfig/index.jsx +++ b/src/templates/treepageconfig/index.jsx @@ -9,8 +9,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import asyncComponent from '@/utils/asyncComponent' @@ -33,7 +31,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, config: null, // 椤甸潰閰嶇疆 formlist: null, // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪琛ㄥ崟瀛楁 menuloading: false, // 鑿滃崟淇濆瓨涓� @@ -220,7 +217,7 @@ if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) { notification.warning({ top: 92, - message: this.state.dict['model.menu.basemsg'], + message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', duration: 5 }) this.setState({activeKey: '0'}) @@ -518,7 +515,7 @@ if (config.isAdd) { // menuID涓嶅瓨鍦ㄦ椂锛屼负鏂板缓鑿滃崟锛屾彁绀鸿彍鍗曞皻鏈繚瀛� notification.warning({ top: 92, - message: this.state.dict['header.menu.config.notsave'], + message: '鑿滃崟灏氭湭淇濆瓨锛岃鍏堜繚瀛樿彍鍗曢厤缃紒', duration: 5 }) } else { @@ -526,7 +523,7 @@ if (!config.fstMenuId || !config.ParentId || !config.MenuName || !config.MenuNo) { notification.warning({ top: 92, - message: this.state.dict['model.menu.basemsg'], + message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', duration: 5 }) this.setState({activeKey: '0'}) @@ -537,7 +534,7 @@ if (!is(fromJS(originMenu), fromJS(config))) { notification.warning({ top: 92, - message: this.state.dict['header.menu.config.update'], + message: '鑿滃崟閰嶇疆宸蹭慨鏀癸紝璇蜂繚瀛橈紒', duration: 5 }) return @@ -705,17 +702,16 @@ <div className="tools"> <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> {/* 鍩烘湰淇℃伅 */} - <Panel forceRender={true} header={this.state.dict['header.menu.basedata']} key="0" id="main-basedata"> + <Panel forceRender={true} header="鍩烘湰淇℃伅" key="0" id="main-basedata"> {/* 鑿滃崟淇℃伅 */} <MenuForm menu={menu} config={config} - dict={this.state.dict} updatemenu={this.updateconfig} /> </Panel> {/* 娣诲姞鏍囩 */} - <Panel header={this.state.dict['header.menu.tab']} key="4"> + <Panel header="鏍囩椤�" key="4"> <div className="search-element"> {Source.tabItems.map((item, index) => { return (<SourceElement key={index} content={item}/>) @@ -753,7 +749,7 @@ } bordered={false} extra={ <div> <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> + <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>鍏抽棴</Button> </div> } style={{ width: '100%' }}> @@ -814,13 +810,13 @@ visible={this.state.closeVisible} onCancel={() => { this.setState({closeVisible: false}) }} footer={[ - <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, - <Button key="notsave" className="mk-btn mk-yellow" onClick={this.notsave}>{this.state.dict['model.notsave']}</Button>, - <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> + <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>淇濆瓨</Button>, + <Button key="notsave" className="mk-btn mk-yellow" onClick={this.notsave}>涓嶄繚瀛�</Button>, + <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>鍙栨秷</Button> ]} destroyOnClose > - {this.state.dict['header.menu.config.placeholder']} + 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� </Modal> {this.state.loading && <Spin size="large" />} </div> diff --git a/src/templates/treepageconfig/source.jsx b/src/templates/treepageconfig/source.jsx index 9cd261f..ac4a106 100644 --- a/src/templates/treepageconfig/source.jsx +++ b/src/templates/treepageconfig/source.jsx @@ -1,8 +1,4 @@ import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' - -const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS class CommonTableBaseData { baseConfig = { @@ -48,7 +44,7 @@ tabItems = [ { type: 'tabs', - label: CommonDict['model.menu.tab.subtable'], + label: '瀛愯〃', subType: 'SubTable', } ] diff --git a/src/templates/zshare/createfunc/index.jsx b/src/templates/zshare/createfunc/index.jsx index b37c619..daa034f 100644 --- a/src/templates/zshare/createfunc/index.jsx +++ b/src/templates/zshare/createfunc/index.jsx @@ -9,7 +9,6 @@ class CreateFunc extends Component { static propTypes = { - dict: PropTypes.object, // 瀛楀吀椤� trigger: PropTypes.func } diff --git a/src/templates/zshare/createinterface/index.jsx b/src/templates/zshare/createinterface/index.jsx index e9f01cf..e8a565b 100644 --- a/src/templates/zshare/createinterface/index.jsx +++ b/src/templates/zshare/createinterface/index.jsx @@ -13,7 +13,6 @@ class CreateInterface extends Component { static propTypes = { - dict: PropTypes.object, // 瀛楀吀椤� trigger: PropTypes.func } @@ -171,10 +170,10 @@ required: true, options: [{ value: 'Y', - text: this.props.dict['model.true'] + text: '鏄�' }, { value: 'N', - text: this.props.dict['model.false'] + text: '鍚�' }] }, { type: 'radio', @@ -184,10 +183,10 @@ required: true, options: [{ value: 'Y', - text: this.props.dict['model.true'] + text: '鏄�' }, { value: 'N', - text: this.props.dict['model.false'] + text: '鍚�' }] }] }) @@ -1125,7 +1124,6 @@ destroyOnClose > <MutilForm - dict={this.props.dict} formlist={this.state.formlist} wrappedComponentRef={(inst) => this.FormRef = inst} /> diff --git a/src/templates/zshare/createinterface/mutilform/index.jsx b/src/templates/zshare/createinterface/mutilform/index.jsx index 918e31e..78db75e 100644 --- a/src/templates/zshare/createinterface/mutilform/index.jsx +++ b/src/templates/zshare/createinterface/mutilform/index.jsx @@ -8,7 +8,6 @@ class MainSearch extends Component { static propTpyes = { formlist: PropTypes.array, // 鎸夐挳淇℃伅銆佽〃鍗曞垪琛� - dict: PropTypes.object // 瀛楀吀椤� } state = { @@ -45,7 +44,7 @@ rules: [ { required: item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' } ] })(<Input placeholder="" autoComplete="off"/>)} @@ -61,7 +60,7 @@ rules: [ { required: item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( @@ -91,7 +90,7 @@ rules: [ { required: item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx index c5d3eb8..bd962d5 100644 --- a/src/templates/zshare/customscript/index.jsx +++ b/src/templates/zshare/customscript/index.jsx @@ -17,7 +17,6 @@ class CustomForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� setting: PropTypes.object, // 璁剧疆 scripts: PropTypes.array, // 鑷畾涔夎剼鏈垪琛� searches: PropTypes.array, // 鎼滅储鏉′欢 @@ -76,11 +75,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index 91e86e8..ff2c97f 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -10,13 +10,10 @@ import PasteForm from '@/templates/zshare/pasteform' import asyncComponent from '@/utils/asyncComponent' import CusSwitch from './cusSwitch' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import './index.scss' const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) -let eTDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const EditableContext = React.createContext() const { confirm } = Modal let dragingIndex = -1 @@ -144,7 +141,7 @@ rules: [ { required: required, - message: ['number', 'text', 'input'].includes(inputType) ? `${eTDict['form.required.input']} ${title}!` : `${eTDict['form.required.select']} ${title}!`, + message: ['number', 'text', 'input'].includes(inputType) ? `璇疯緭鍏�${title}!` : `璇烽�夋嫨${title}!`, }, ...rules ], @@ -195,7 +192,7 @@ operation = { title: (<div> - {eTDict['model.operation']} + 鎿嶄綔 <span className="copy-control"> {actions.includes('copy') ? <CopyOutlined title="澶嶅埗" onClick={() => this.copy()} /> : null} {actions.includes('copy') ? <SnippetsOutlined title="绮樿创" onClick={this.paste} /> : null} @@ -212,11 +209,11 @@ <EditableContext.Consumer> {form => ( <span onClick={() => this.save(form, record.uuid)} style={{ marginRight: 8 , color: '#1890ff', cursor: 'pointer'}}> - {eTDict['model.save']} + 淇濆瓨 </span> )} </EditableContext.Consumer> - <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>{eTDict['model.cancel']}</span> + <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>鍙栨秷</span> </div> ) : ( <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px', whiteSpace: 'nowrap'}}> @@ -225,7 +222,7 @@ {actions.includes('status') ? <span className="status" onClick={() => {editingKey === '' && this.handleStatus(record)}}><SwapOutlined /></span> : null} {actions.includes('del') && editingKey === '' ? <Popconfirm overlayClassName="popover-confirm" - title={eTDict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record.uuid) }> <span className="danger"><DeleteOutlined /></span> @@ -402,7 +399,6 @@ uuid: Utils.getuuid() }) } - }) } else if (res.key !== type) { message.warning('閰嶇疆淇℃伅鏍煎紡閿欒锛�') @@ -665,7 +661,7 @@ </DndProvider> {/* 淇℃伅绮樿创 */} <Modal - title={eTDict['header.form.paste']} + title="绮樿创" visible={this.state.visible} width={600} maskClosable={false} @@ -673,7 +669,7 @@ onCancel={() => {this.setState({visible: false})}} destroyOnClose > - <PasteForm dict={eTDict} wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> + <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> </Modal> </div> </EditableContext.Provider> diff --git a/src/templates/zshare/editcard/index.jsx b/src/templates/zshare/editcard/index.jsx index b18e19d..4266f80 100644 --- a/src/templates/zshare/editcard/index.jsx +++ b/src/templates/zshare/editcard/index.jsx @@ -54,8 +54,8 @@ <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} > <div className="base" onClick={this.changeSelect}> <CheckOutlined /> - <p title={card.field}>{this.props.dict['model.form.field']}锛� <span>{card.field}</span></p> - <p title={card.label}>{this.props.dict['model.name']}锛� <span>{card.label}</span></p> + <p title={card.field}>瀛楁锛� <span>{card.field}</span></p> + <p title={card.label}>鍚嶇О锛� <span>{card.label}</span></p> </div> {type === 'search' ? <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}> @@ -123,18 +123,17 @@ } render() { - const { dict } = this.props const { dataSource, type, loading } = this.state return ( <div className="common-modal-edit-card"> <Row className="search-row"> <Col span={8}> - {!loading ? <Search placeholder={dict['form.required.input'] + dict['model.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} + {!loading ? <Search 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> @@ -143,7 +142,7 @@ 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} /> + <EditCardCell ref={'cellCard' + index} type={type} card={item} changeCard={this.changeCard} /> </Col> ) } else { diff --git a/src/templates/zshare/editcomponent/index.jsx b/src/templates/zshare/editcomponent/index.jsx index 3029835..59ef92f 100644 --- a/src/templates/zshare/editcomponent/index.jsx +++ b/src/templates/zshare/editcomponent/index.jsx @@ -8,8 +8,6 @@ import Utils from '@/utils/utils.js' import PasteForm from '@/templates/zshare/pasteform' import TransferForm from '@/templates/zshare/basetransferform' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -23,7 +21,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, thawVisible: false, thawbtnlist: null, pasteVisible: false, @@ -88,13 +85,13 @@ */ thawBtnSubmit = () => { const { thawButtons } = this.props - const { thawbtnlist, dict, targetKeys } = this.state + const { thawbtnlist, targetKeys } = this.state let config = fromJS(this.props.config).toJS() if (targetKeys.length === 0) { notification.warning({ top: 92, - message: dict['form.required.select'] + '瑙e喕鎸夐挳', + message: '璇烽�夋嫨瑙e喕鎸夐挳', duration: 5 }) } else { @@ -200,12 +197,11 @@ render() { const { MenuID } = this.props - const { dict } = this.state return ( <div style={{display: 'inline-block'}}> {MenuID ? <Button className="mk-border-green" onClick={this.handleThaw}><UnlockOutlined /> 瑙e喕鎸夐挳</Button> : null} - <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => this.setState({pasteVisible: true})}><SnippetsOutlined /> {dict['header.form.paste']}</Button> + <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => this.setState({pasteVisible: true})}><SnippetsOutlined /> 绮樿创</Button> {/* 瑙e喕鎸夐挳妯℃�佹 */} <Modal title="瑙e喕鎸夐挳" @@ -219,7 +215,7 @@ </Modal> {/* 鎸夐挳閰嶇疆淇℃伅绮樿创澶嶅埗 */} <Modal - title={dict['header.form.paste']} + title="绮樿创" visible={this.state.pasteVisible} width={600} maskClosable={false} diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index eeb7fbc..4065d94 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -1,8 +1,4 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import { formRule, btnClasses } from '@/utils/option.js' - -const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS /** * @description 鑾峰彇鏍戝舰椤甸潰璁剧疆琛ㄥ崟閰嶇疆淇℃伅 @@ -57,31 +53,31 @@ { type: 'radio', key: 'interType', - label: Formdict['header.form.intertype'], + label: '鎺ュ彛绫诲瀷', initVal: setting.interType || 'inner', required: false, readonly: false, options: [ - { value: 'inner', text: Formdict['model.interface.inner'] }, - { value: 'outer', text: Formdict['model.interface.outer'] } + { value: 'inner', text: '鍐呴儴' }, + { value: 'outer', text: '澶栭儴' } ] }, { type: 'radio', key: 'sysInterface', - label: Formdict['header.form.sysInterface'], + label: '绯荤粺鎺ュ彛', initVal: setting.sysInterface || 'false', required: false, readonly: false, options: [ - { value: 'true', text: Formdict['model.true'] }, - { value: 'false', text: Formdict['model.false'] } + { value: 'true', text: '鏄�' }, + { value: 'false', text: '鍚�' } ] }, { type: 'text', key: 'interface', - label: Formdict['header.form.interface'], + label: '鎺ュ彛鍦板潃', initVal: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''), required: true, readonly: setting.sysInterface === 'true', @@ -95,7 +91,7 @@ { type: 'text', key: 'outerFunc', - label: Formdict['header.form.outerFunc'], + label: '澶栭儴鍑芥暟', initVal: setting.outerFunc || '', required: false, readonly: false, @@ -112,7 +108,7 @@ { type: 'text', key: 'innerFunc', - label: Formdict['header.form.innerFunc'], + label: '鍐呴儴鍑芥暟', initVal: setting.innerFunc || '', tooltip: usefulFields.length ? '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', ') : '', placement: 'bottomLeft', @@ -265,8 +261,8 @@ required: false, readonly: false, options: [ - { value: 'true', text: Formdict['model.true'] }, - { value: 'false', text: Formdict['model.false'] } + { value: 'true', text: '鏄�' }, + { value: 'false', text: '鍚�' } ] }, { @@ -277,8 +273,8 @@ required: false, readonly: false, options: [ - { value: 'true', text: Formdict['model.true'] }, - { value: 'false', text: Formdict['model.false'] } + { value: 'true', text: '鏄�' }, + { value: 'false', text: '鍚�' } ] } ] @@ -324,10 +320,7 @@ text: '鏃ユ湡锛堝ぉ锛�' }, { value: 'datemonth', - text: Formdict['model.form.datemonth'] - // }, { - // value: 'daterange', - // text: Formdict['model.form.daterange'] + text: '鏃ユ湡锛堟湀锛�' }] } else { @@ -390,14 +383,14 @@ { type: 'text', key: 'label', - label: Formdict['model.name'], + label: '鍚嶇О', initVal: card.label || '', required: true }, { type: 'text', key: 'field', - label: Formdict['model.form.field'], + label: '瀛楁', initVal: card.field || '', required: true, options: columns @@ -405,7 +398,7 @@ { type: 'select', key: 'type', - label: Formdict['model.form.type'], + label: '绫诲瀷', initVal: card.type, required: true, options: typeOptions @@ -420,7 +413,7 @@ { type: 'text', key: 'initval', - label: Formdict['header.form.initval'], + label: '鍒濆鍊�', tooltip: '绫诲瀷涓轰笅鎷夎彍鍗曟椂锛屽垵濮嬪�煎簲涓烘暟鎹殑Value鍊硷紙浣跨敤鏁版嵁婧愭椂锛屽簲涓恒�婂�悸峰瓧娈点�嬬殑鍊硷級;绫诲瀷涓烘暟鍊硷紙鍖洪棿锛夋椂锛屽垵濮嬪�间娇鐢ㄩ�楀彿鎷兼帴锛屼緥濡� 3,10', initVal: card.initval, required: false @@ -433,10 +426,10 @@ required: true, options: [{ value: '0', - text: Formdict['header.form.custom'] + text: '鑷畾涔�' }, { value: '1', - text: Formdict['header.form.datasource'] + text: '鏁版嵁婧�' }] }, // { @@ -446,10 +439,10 @@ // initVal: card.setAll || 'true', // options: [{ // value: 'true', - // text: Formdict['model.true'] + // text: '鏄�' // }, { // value: 'false', - // text: Formdict['model.false'] + // text: '鍚�' // }] // }, { @@ -524,7 +517,7 @@ { type: 'codemirror', key: 'dataSource', - label: Formdict['header.form.datasource'], + label: '鏁版嵁婧�', initVal: card.dataSource || '', required: true }, @@ -612,34 +605,19 @@ initVal: card.orderType || 'asc', options: [{ value: 'asc', - text: Formdict['header.form.asc'] + text: '姝e簭' }, { value: 'desc', - text: Formdict['header.form.desc'] + text: '鍊掑簭' }] }, { type: 'select', key: 'match', - label: Formdict['header.form.match'], + label: '鍖归厤妯″紡', initVal: card.match || 'like', required: true, - options: [{ - value: 'like', - text: 'like' - }, { - value: 'equal', - text: 'equal' - }, { - value: 'greater', - text: '>' - }, { - value: 'less', - text: '<' - }, { - value: 'greaterequal', - text: '>=' - }] + options: [] }, { type: 'radio', @@ -659,7 +637,7 @@ key: 'ratio', min: 1, max: 24, - label: Formdict['header.form.ratio'], + label: '姣斾緥', tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', initVal: card.ratio || 6, forbid: appType === 'mob', @@ -699,27 +677,27 @@ { type: 'radio', key: 'required', - label: Formdict['model.required'], + label: '蹇呭~', initVal: card.required || 'false', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Hide', - label: Formdict['model.hidden'], + label: '闅愯棌', initVal: card.Hide || 'false', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -744,10 +722,10 @@ // tooltip: '鏁版嵁鏌ヨ鏃讹紝绫诲瀷瀛楁鏄惁浣滀负鍙傛暟浼犻�掞紝绫诲瀷瀛楁瀵瑰簲鍊间负 {"鏃�": "day", "鍛�": "week", "鏈�": "month", "瀛�": "quarter", "骞�": "year", "鑷畾涔�": "customized"}銆�', // options: [{ // value: 'true', - // text: Formdict['model.true'] + // text: '鏄�' // }, { // value: 'false', - // text: Formdict['model.false'] + // text: '鍚�' // }] // }, { @@ -797,10 +775,10 @@ forbid: appType === 'mob' || position === 'header', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -860,7 +838,7 @@ { type: 'multiselect', key: 'blacklist', - label: Formdict['header.form.blacklist'], + label: '榛戝悕鍗�', initVal: card.blacklist || [], required: false, options: roleList || [], @@ -882,31 +860,31 @@ let opentypes = [ { value: 'pop', - text: Formdict['model.form.popform'] + text: '寮圭獥锛堣〃鍗曪級' }, { value: 'prompt', - text: Formdict['model.form.prompt'] + text: '鎻愮ず妗�' }, { value: 'exec', - text: Formdict['model.form.exec'] + text: '鐩存帴鎵ц' }, { value: 'excelIn', - text: Formdict['model.form.excelIn'] + text: '瀵煎叆Excel' }, { value: 'excelOut', - text: Formdict['model.form.excelOut'] + text: '瀵煎嚭Excel' }, { value: 'popview', - text: Formdict['model.form.popview'] + text: '寮圭獥锛堟爣绛撅級' }, { value: 'tab', - text: Formdict['model.form.tab'] + text: '鏍囩椤�' }, { value: 'innerpage', - text: Formdict['model.form.newpage'] + text: '鏂伴〉闈�' }, { value: 'funcbutton', - text: Formdict['model.form.funcbutton'] + text: '鍔熻兘鎸夐挳' } ] @@ -957,7 +935,7 @@ { type: 'select', key: 'OpenType', - label: Formdict['header.form.openType'], + label: '鎵撳紑鏂瑰紡', initVal: card.OpenType, required: true, options: opentypes @@ -1009,24 +987,24 @@ { type: 'select', key: 'execMode', - label: Formdict['model.form.execMode'], + label: '鎵ц鏂瑰紡', initVal: card.execMode || 'exec', required: true, options: [{ value: 'exec', - text: Formdict['model.form.exec'] + text: '鐩存帴鎵ц' }, { value: 'prompt', - text: Formdict['model.form.prompt'] + text: '鎻愮ず妗�' }, { value: 'pop', - text: Formdict['model.form.popform'] + text: '寮圭獥锛堣〃鍗曪級' }] }, { type: 'radio', key: 'intertype', - label: Formdict['header.form.intertype'], + label: '鎺ュ彛绫诲瀷', initVal: card.intertype || 'system', required: true, options: [] @@ -1052,7 +1030,7 @@ { type: 'radio', key: 'sqlType', - label: Formdict['header.form.action.type'], + label: '鎿嶄綔绫诲瀷', initVal: card.sqlType || '', required: true, options: [] @@ -1060,14 +1038,14 @@ { type: 'text', key: 'sql', - label: Formdict['model.form.tablename'], + label: '琛ㄥ悕', initVal: card.sql || config.setting.tableName || '', required: true }, { type: 'text', key: 'innerFunc', - label: Formdict['header.form.innerFunc'], + label: '鍐呴儴鍑芥暟', initVal: card.innerFunc || '', tooltip: usefulFields.length ? `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬨�俙 : '', fields: usefulFields, @@ -1100,7 +1078,7 @@ { type: 'select', key: 'pageTemplate', - label: Formdict['model.form.newpage.type'], + label: '椤甸潰绫诲瀷', initVal: card.pageTemplate || '', required: true, options: [{ @@ -1114,10 +1092,10 @@ text: '鍗曟嵁鎵撳嵃' }, { value: 'pay', - text: Formdict['model.pay'] + text: '鏀粯' }, { value: 'custom', - text: Formdict['header.form.custom'] + text: '鑷畾涔�' }] }, { @@ -1131,28 +1109,28 @@ { type: 'text', key: 'url', - label: Formdict['model.pageUrl'], + label: '椤甸潰鍦板潃', initVal: card.url || '', required: true }, { type: 'radio', key: 'sysInterface', - label: Formdict['header.form.sysInterface'], + label: '绯荤粺鎺ュ彛', initVal: card.sysInterface || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'text', key: 'outerFunc', - label: Formdict['header.form.outerFunc'], + label: '澶栭儴鍑芥暟', initVal: card.outerFunc || '', required: false, readonly: false @@ -1233,7 +1211,7 @@ { type: 'text', key: 'callbackFunc', - label: Formdict['header.form.callbackFunc'], + label: '鍥炶皟鍑芥暟', initVal: card.callbackFunc || '', required: true, readonly: false @@ -1246,16 +1224,16 @@ required: true, options: [{ value: 'toolbar', - text: Formdict['header.form.toolbar'] + text: '宸ュ叿鏍�' }, { value: 'grid', - text: Formdict['header.form.grid'] + text: '琛ㄦ牸' }] }, { type: 'select', key: 'Ot', - label: Formdict['header.form.isRequired'], + label: '琛岃缃�', initVal: card.Ot || 'requiredSgl', required: true, options: [] @@ -1263,7 +1241,7 @@ { type: 'cascader', key: 'linkmenu', - label: Formdict['model.form.linkmenu'], + label: '鍏宠仈鑿滃崟', initVal: card.linkmenu || [], required: true, options: menulist @@ -1279,7 +1257,7 @@ { type: refresh.length === 0 ? 'radio' : 'select', key: 'execSuccess', - label: Formdict['model.form.afterSuccess'], + label: '鎴愬姛鍚�', initVal: card.execSuccess || 'grid', tooltip: '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺��', required: true, @@ -1298,7 +1276,7 @@ { type: refresh.length === 0 ? 'radio' : 'select', key: 'execError', - label: Formdict['model.form.afterError'], + label: '澶辫触鍚�', initVal: card.execError || 'never', tooltip: '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺��', required: true, @@ -1317,7 +1295,7 @@ { type: refresh.length === 0 ? 'radio' : 'select', key: 'popClose', - label: Formdict['header.form.popClose'], + label: '鍏抽棴鍚�', initVal: card.popClose || 'never', required: true, options: [{ @@ -1346,14 +1324,14 @@ { type: 'icon', key: 'icon', - label: Formdict['model.icon'], + label: '鍥炬爣', initVal: card.icon, required: false }, { type: 'select', key: 'class', - label: Formdict['model.form.color'], + label: '棰滆壊', initVal: card.class, required: false, options: btnClasses @@ -1386,21 +1364,21 @@ { type: 'radio', key: 'joint', - label: Formdict['model.form.paramJoint'], + label: '鎷兼帴鍙傛暟', initVal: card.joint || 'true', required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'text', key: 'sheet', - label: Formdict['model.form.tablename'], + label: '琛ㄥ悕', initVal: card.sheet || config.setting.tableName || '', required: true }, @@ -1412,10 +1390,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -1599,14 +1577,14 @@ { type: 'text', key: 'label', - label: Formdict['model.name'], + label: '鍚嶇О', initVal: card.label, required: true }, { type: 'text', key: 'field', - label: Formdict['model.form.field'], + label: '瀛楁', initVal: card.field, required: true, readonly: false @@ -1614,27 +1592,27 @@ { type: 'select', key: 'type', - label: Formdict['model.form.type'], + label: '绫诲瀷', initVal: card.type, required: true, options: [{ value: 'text', - text: Formdict['model.form.text'] + text: '鏂囨湰' }, { value: 'number', - text: Formdict['model.form.number'] + text: '鏁板瓧' }, { value: 'picture', - text: Formdict['model.form.picture'] + text: '鍥剧墖' }, { value: 'video', text: '瑙嗛' }, { value: 'link', - text: Formdict['model.form.href'] + text: '閾炬帴' }, { value: 'textarea', - text: Formdict['model.form.textarea'] + text: '澶氳鏂囨湰' }, { value: 'index', text: '搴忓彿' @@ -1643,7 +1621,7 @@ { type: 'text', key: 'nameField', - label: Formdict['model.name'] + Formdict['model.form.field'], + label: '鍚嶇О瀛楁', initVal: card.nameField, required: false, readonly: false @@ -1654,67 +1632,67 @@ min: 1, max: 1000, decimal: 0, - label: Formdict['model.form.columnWidth'], + label: '鍒楀', initVal: card.Width, required: true }, { type: 'radio', key: 'joint', - label: Formdict['model.form.paramJoint'], + label: '鎷兼帴鍙傛暟', initVal: card.joint || 'true', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Hide', - label: Formdict['model.hidden'], + label: '闅愯棌', initVal: card.Hide || 'false', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'IsSort', - label: Formdict['model.sort'], + label: '鎺掑簭', initVal: card.IsSort || 'true', required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { type: 'radio', key: 'Align', - label: Formdict['model.form.align'], + label: '瀵归綈鏂瑰紡', initVal: card.Align || 'left', required: true, options: [{ value: 'left', - text: Formdict['model.form.alignLeft'] + text: '宸﹀榻�' }, { value: 'center', - text: Formdict['model.form.alignCenter'] + text: '灞呬腑' }, { value: 'right', - text: Formdict['model.form.alignRight'] + text: '鍙冲榻�' }] }, { @@ -1746,10 +1724,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -1761,10 +1739,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -1773,21 +1751,21 @@ min: 0, max: 18, decimal: 0, - label: Formdict['header.form.decimal'], + label: '灏忔暟浣�', initVal: card.decimal || 0, required: true }, { type: 'number', key: 'fieldlength', - label: Formdict['model.form.field'] + Formdict['model.length'], + label: '瀛楁闀垮害', initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), required: true }, { type: 'select', key: 'format', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.format || 'none', options: [{ value: 'none', @@ -1807,7 +1785,7 @@ { type: 'select', key: 'textFormat', - label: Formdict['header.form.format'], + label: '鏍煎紡鍖�', initVal: card.textFormat || 'none', options: [{ value: 'none', @@ -1827,7 +1805,7 @@ { type: 'text', key: 'prefix', - label: Formdict['header.form.prefix'], + label: '鍓嶇紑', initVal: card.prefix || '', required: false, readonly: false @@ -1835,7 +1813,7 @@ { type: 'text', key: 'postfix', - label: Formdict['header.form.postfix'], + label: '鍚庣紑', initVal: card.postfix || '', tooltipClass: 'middle', required: false, @@ -1885,10 +1863,10 @@ required: false, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -1910,7 +1888,7 @@ { type: 'cascader', key: 'linkmenu', - label: Formdict['model.menu'], + label: '鑿滃崟', initVal: card.linkmenu || [], required: true, options: menulist @@ -1933,7 +1911,7 @@ { type: 'multiselect', key: 'blacklist', - label: Formdict['header.form.blacklist'], + label: '榛戝悕鍗�', initVal: card.blacklist || [], required: false, options: roleList @@ -1985,7 +1963,7 @@ { type: 'text', key: 'title', - label: Formdict['header.form.title'], + label: '鏍囬', initVal: card.title, required: false }, @@ -2011,15 +1989,15 @@ { type: 'radio', key: 'Hide', - label: Formdict['model.hidden'], + label: '闅愯棌', initVal: card.Hide, required: true, options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -2097,7 +2075,7 @@ { type: 'multiselect', key: 'blacklist', - label: Formdict['header.form.blacklist'], + label: '榛戝悕鍗�', initVal: card.blacklist || [], required: false, options: roleList @@ -2287,10 +2265,10 @@ forbid: !['line', 'bar'].includes(card.chartType), options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -2589,7 +2567,7 @@ { type: 'text', key: 'label', - label: Formdict['model.name'], + label: '鍚嶇О', initVal: card.label, required: true, readonly: false @@ -2597,7 +2575,7 @@ { type: 'text', key: 'field', - label: Formdict['model.form.field'], + label: '瀛楁', initVal: card.field || '', required: true, readonly: false @@ -2605,7 +2583,7 @@ { type: 'select', key: 'type', - label: Formdict['model.form.type'], + label: '绫诲瀷', initVal: card.type, required: true, options: _openType @@ -2613,7 +2591,7 @@ { type: 'text', key: 'initval', - label: Formdict['header.form.initval'], + label: '鍒濆鍊�', initVal: initval, required: false }, @@ -2738,10 +2716,10 @@ // initVal: card.setAll || 'false', // options: [{ // value: 'true', - // text: Formdict['model.true'] + // text: '鏄�' // }, { // value: 'false', - // text: Formdict['model.false'] + // text: '鍚�' // }] // }, { @@ -2763,7 +2741,7 @@ { type: 'codemirror', key: 'dataSource', - label: Formdict['header.form.datasource'], + label: '鏁版嵁婧�', initVal: card.dataSource || '', required: true, readonly: false @@ -2831,10 +2809,10 @@ initVal: card.orderType || 'asc', options: [{ value: 'asc', - text: Formdict['header.form.asc'] + text: '姝e簭' }, { value: 'desc', - text: Formdict['header.form.desc'] + text: '鍊掑簭' }] }, { @@ -3022,7 +3000,7 @@ min: 0, max: 18, precision: 0, - label: Formdict['header.form.decimal'], + label: '灏忔暟浣�', initVal: card.decimal || 0, required: true }, @@ -3032,7 +3010,7 @@ min: 1, max: 100000, precision: 0, - label: Formdict['model.form.field'] + Formdict['model.length'], + label: '瀛楁闀垮害', // tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512', initVal: card.fieldlength || _fieldlength, required: true @@ -3113,10 +3091,10 @@ initVal: card.hidden || 'false', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -3126,10 +3104,10 @@ initVal: card.readonly || 'false', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -3139,10 +3117,10 @@ initVal: card.required || 'true', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -3214,10 +3192,10 @@ initVal: card.writein || 'true', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -3279,10 +3257,10 @@ initVal: card.hidelabel || 'false', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -3363,10 +3341,10 @@ tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄�' }, { value: 'false', - text: Formdict['model.false'] + text: '鍚�' }] }, { @@ -3687,6 +3665,15 @@ }, { type: 'text', + key: 'regularExtra', + label: '姝e垯鎵╁睍绗�', + initVal: card.regularExtra || '', + tooltip: '姝e垯楠岃瘉鏃剁殑鑷畾涔夊瓧绗︼紝鍖呮嫭~!@#$%^&*()_+:;{}<>,.-', + required: false, + readonly: false + }, + { + type: 'text', key: 'regularText', label: '姝e垯鎻愮ず', initVal: card.regularText || '', @@ -3802,7 +3789,7 @@ { type: 'multiselect', key: 'blacklist', - label: Formdict['header.form.blacklist'], + label: '榛戝悕鍗�', initVal: card.blacklist || [], required: false, options: roleList, @@ -3825,14 +3812,14 @@ { type: 'text', key: 'label', - label: Formdict['header.menu.tabName'], + label: '鏍囩鍚嶇О', initVal: card.label || '', required: true }, { type: 'select', key: 'linkTab', - label: Formdict['header.form.linkTab'], + label: '鍏宠仈鏍囩', initVal: card.linkTab || '', required: false, options: [] @@ -3840,7 +3827,7 @@ { type: 'icon', key: 'icon', - label: Formdict['model.icon'], + label: '鍥炬爣', initVal: card.icon || '', required: false, forbid: type === 'CalendarPage' @@ -3848,7 +3835,7 @@ { type: 'select', key: 'supMenu', - label: Formdict['header.form.supTab'], + label: '涓婄骇鏍囩', initVal: supMenu, required: false, options: menus, @@ -3857,7 +3844,7 @@ { type: 'mutilselect', key: 'equalTab', - label: Formdict['header.form.equalTab'], + label: '鍚岀骇鏍囩', tooltip: '濡傛灉瀛愭爣绛句腑鍚湁鍒锋柊鍚岀骇鏍囩鐨勬寜閽紝鍦ㄦ澶勬坊鍔犻渶瑕佸埛鏂扮殑鏍囩銆�', initVal: equalTab, required: false, diff --git a/src/templates/zshare/menuform/index.jsx b/src/templates/zshare/menuform/index.jsx index d6bd07f..b3ce1f3 100644 --- a/src/templates/zshare/menuform/index.jsx +++ b/src/templates/zshare/menuform/index.jsx @@ -6,7 +6,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.array } @@ -53,7 +52,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' + message: '璇疯緭鍏�' + item.label + '!' }, { max: formRule.input.max, @@ -73,7 +72,7 @@ rules: [ { required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' + message: '璇烽�夋嫨' + item.label + '!' } ] })( diff --git a/src/templates/zshare/modalform/datatable/index.jsx b/src/templates/zshare/modalform/datatable/index.jsx index 31e23ed..7492418 100644 --- a/src/templates/zshare/modalform/datatable/index.jsx +++ b/src/templates/zshare/modalform/datatable/index.jsx @@ -146,7 +146,6 @@ class EdiDataTable extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� transfield: PropTypes.object, // 瀛楁鍚嶇О type: PropTypes.string, // 鏄惁涓哄叧鑱旇〃鍗� display: PropTypes.string, // 鏁版嵁绫诲瀷锛屾枃鏈�佸浘鐗� @@ -264,7 +263,7 @@ <span className="hide-control" title="鏄剧ず/闅愯棌" onClick={() => {editingKey === '' && this.handleHide(record.key)}}><SwapOutlined /></span> {editingKey === '' ? <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record.key) }> <span className="danger"><DeleteOutlined /></span> diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 9be8093..7b0eb1f 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -46,7 +46,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, standardform: PropTypes.any, card: PropTypes.object, @@ -142,6 +141,9 @@ } if (this.record.regular !== '') { shows.push('regularText') + if (this.record.regular !== 'phone' && this.record.regular !== 'email') { + shows.push('regularExtra') + } } } else if (type === 'number') { reTypes.initval = 'number' @@ -565,7 +567,6 @@ getFields() { const { getFieldDecorator } = this.props.form - const { dict } = this.props const { transfield } = this.state const fields = [] @@ -581,7 +582,7 @@ if (item.type === 'text') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' }, + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' }, { pattern: /^[^']*$/ig, message: '涓嶅彲浣跨敤鑻辨枃鐘舵�佺殑鍗曞紩鍙凤紒' @@ -594,6 +595,11 @@ }, { max: formRule.field.max, message: formRule.field.maxMessage + }) + } else if (item.key === 'regularExtra') { + rules.push({ + pattern: /^[~!@#$%^&*()_+:;{}<>,.-]*$/, + message: '鎵╁睍绗﹀寘鎷瑍!@#$%^&*()_+:;{}<>,.-' }) } else if (item.max) { rules.push({ @@ -610,7 +616,7 @@ content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> } else if (item.type === 'number') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] initVal = item.initVal @@ -621,7 +627,7 @@ } } else if (item.type === 'select') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <Select showSearch @@ -649,7 +655,7 @@ </Select> } else if (item.type === 'radio') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] initVal = item.initVal @@ -662,7 +668,7 @@ </Radio.Group> } else if (item.type === 'checkbox') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] initVal = item.initVal @@ -671,7 +677,7 @@ </Checkbox.Group> } else if (item.type === 'codemirror') { rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] span = 24 className = 'text-area' @@ -685,7 +691,7 @@ span = 24 className = 'text-msg' rules = [ - { required: item.required, message: dict['form.required.input'] + item.label + '!' } + { required: item.required, message: '璇疯緭鍏�' + item.label + '!' } ] content = <TextArea rows={item.rows || 4}/> @@ -716,7 +722,7 @@ if (this.record.linkField) { type = 'link' } - content = <DataTable dict={this.props.dict} type={type} display={this.record.display} linkSubFields={linkSubFields} transfield={transfield} fields={this.record.fields || []} onChange={this.changeOptions}/> + content = <DataTable type={type} display={this.record.display} linkSubFields={linkSubFields} transfield={transfield} fields={this.record.fields || []} onChange={this.changeOptions}/> } } else if (item.type === 'fields') { span = 24 @@ -729,13 +735,13 @@ } else if (item.type === 'color') { className = 'color-form-item' rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <ColorSketch allowClear={true}/> } else if (item.type === 'icon') { rules = [ - { required: item.required, message: dict['form.required.select'] + item.label + '!' } + { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } ] content = <MkEditIcon allowClear /> @@ -877,6 +883,10 @@ values.initval = '' } else if (values.type === 'split') { values.span = 24 + } else if (values.type === 'text') { + if (values.regularExtra) { + values.regularExtra = Array.from(new Set(values.regularExtra.split(''))).join('') + } } ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { diff --git a/src/templates/zshare/verifycard/billcodeform/index.jsx b/src/templates/zshare/verifycard/billcodeform/index.jsx index b8368eb..6aed692 100644 --- a/src/templates/zshare/verifycard/billcodeform/index.jsx +++ b/src/templates/zshare/verifycard/billcodeform/index.jsx @@ -8,7 +8,6 @@ class BillCodeForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� btn: PropTypes.object, // 鎸夐挳淇℃伅 fields: PropTypes.array, // 琛ㄥ崟 billcodes: PropTypes.array, // 琛ㄥ崟 @@ -217,16 +216,16 @@ } return ( - <Form {...formItemLayout} className="verify-form"> + <Form {...formItemLayout} className="verify-form mk-fix-form-height"> <Row gutter={24}> <Col span={7}> - <Form.Item label={this.props.dict['header.form.funcvar']}> + <Form.Item label="鍑芥暟鍙橀噺"> {getFieldDecorator('field', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['header.form.funcvar'] + '!' + message: '璇烽�夋嫨鍑芥暟鍙橀噺!' } ] })( @@ -247,7 +246,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '绫诲瀷!' + message: '璇烽�夋嫨绫诲瀷!' } ] })( @@ -267,7 +266,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍏宠仈瀛楁!' + message: '璇烽�夋嫨鍏宠仈瀛楁!' } ] })( @@ -288,7 +287,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍑瘉绫诲瀷!' + message: '璇烽�夋嫨鍑瘉绫诲瀷!' } ] })( @@ -318,7 +317,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '浣嶆暟!' + message: '璇疯緭鍏ヤ綅鏁�!' } ] })(<InputNumber min={1} max={10} precision={0} />)} @@ -331,7 +330,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍑瘉鏍囪瘑!' + message: '璇烽�夋嫨鍑瘉鏍囪瘑!' } ] })( @@ -360,7 +359,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鏍囪瘑!' + message: '璇疯緭鍏ユ爣璇�!' }, { pattern: /^[a-zA-Z0-9]*$/ig, diff --git a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx index ce8b2f5..e702c44 100644 --- a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx +++ b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx @@ -11,7 +11,6 @@ class CustomForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� btn: PropTypes.object, // 鎸夐挳淇℃伅 initsql: PropTypes.string, // 鍒濆鍖栬剼鏈� usefulfields: PropTypes.string, // 鍙敤瀛楁 @@ -293,7 +292,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'sql!' + message: '璇疯緭鍏ql!' } ] })(<CodeMirror />)} diff --git a/src/templates/zshare/verifycard/contrastform/index.jsx b/src/templates/zshare/verifycard/contrastform/index.jsx index 50cdead..19f4de9 100644 --- a/src/templates/zshare/verifycard/contrastform/index.jsx +++ b/src/templates/zshare/verifycard/contrastform/index.jsx @@ -5,7 +5,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� contrastChange: PropTypes.func // 淇敼鍑芥暟 } @@ -40,26 +39,26 @@ <Form {...formItemLayout} className="verify-form" id="verifycard1"> <Row gutter={24}> <Col span={7}> - <Form.Item label={'鍐呭1'}> + <Form.Item label="鍐呭1"> {getFieldDecorator('frontfield', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍐呭1!' + message: '璇疯緭鍏ュ唴瀹�1!' } ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> <Col span={7}> - <Form.Item label={'杩愮畻绗�'}> + <Form.Item label="杩愮畻绗�"> {getFieldDecorator('operator', { initialValue: '=', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '杩愮畻绗�!' + message: '璇烽�夋嫨杩愮畻绗�!' } ] })( @@ -77,13 +76,13 @@ </Form.Item> </Col> <Col span={7}> - <Form.Item label={'鍐呭2'}> + <Form.Item label="鍐呭2"> {getFieldDecorator('backfield', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍐呭2!' + message: '璇疯緭鍏ュ唴瀹�2!' } ] })(<Input placeholder="" autoComplete="off" />)} @@ -91,17 +90,17 @@ </Col> <Col span={3} className="add"> <Button onClick={this.handleConfirm} type="primary" className="mk-green"> - {this.props.dict['model.add']} + 娣诲姞 </Button> </Col> <Col span={7}> - <Form.Item label={'鎻愮ず淇℃伅'}> + <Form.Item label="鎻愮ず淇℃伅"> {getFieldDecorator('errmsg', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鎻愮ず淇℃伅!' + message: '璇疯緭鍏ユ彁绀轰俊鎭�!' }, { pattern: /^[^']*$/ig, @@ -118,7 +117,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎶ラ敊缂栫爜!' + message: '璇烽�夋嫨鎶ラ敊缂栫爜!' } ] })( diff --git a/src/templates/zshare/verifycard/customform/index.jsx b/src/templates/zshare/verifycard/customform/index.jsx index 1b96426..8938b1c 100644 --- a/src/templates/zshare/verifycard/customform/index.jsx +++ b/src/templates/zshare/verifycard/customform/index.jsx @@ -10,7 +10,6 @@ class CustomForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� btn: PropTypes.object, // 鎸夐挳 usefulfields: PropTypes.string, // 鍙敤瀛楁 initsql: PropTypes.string, // 鍙敤瀛楁 @@ -175,13 +174,13 @@ </Form.Item> </Col> <Col span={21} className="sql"> - <Form.Item label={'sql'}> + <Form.Item label="sql"> {getFieldDecorator('sql', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'sql!' + message: '璇疯緭鍏ql!' } ] })(<CodeMirror />)} @@ -206,7 +205,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '缁撴灉澶勭悊!' + message: '璇烽�夋嫨缁撴灉澶勭悊!' } ] })( @@ -218,13 +217,13 @@ </Form.Item> </Col> <Col span={7}> - <Form.Item label={'鎻愮ず淇℃伅'}> + <Form.Item label="鎻愮ず淇℃伅"> {getFieldDecorator('errmsg', { initialValue: '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鎻愮ず淇℃伅!' + message: '璇疯緭鍏ユ彁绀轰俊鎭�!' }, { pattern: /^[^']*$/ig, @@ -241,7 +240,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎶ラ敊缂栫爜!' + message: '璇烽�夋嫨鎶ラ敊缂栫爜!' } ] })( diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index e5542bd..6535615 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -12,7 +12,6 @@ class CustomForm extends Component { static propTpyes = { type: PropTypes.any, - dict: PropTypes.object, // 瀛楀吀椤� btn: PropTypes.object, // 鎸夐挳淇℃伅 usefulfields: PropTypes.string, // 鍙敤瀛楁 initsql: PropTypes.string, // sql鍓嶇紑 @@ -335,7 +334,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + 'sql!' + message: '璇疯緭鍏ql!' } ] })(<CodeMirror />)} diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 3786e6e..86ece6e 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -33,7 +33,6 @@ static propTpyes = { btnTab: PropTypes.any, // 琛ㄥ崟鏍囩椤碉紙鎸夐挳锛夊弬鏁� config: PropTypes.any, // 琛ㄥ崟鏍囩椤靛弬鏁� - dict: PropTypes.object, // 瀛楀吀椤� card: PropTypes.object, // 鎸夐挳淇℃伅 columns: PropTypes.array } @@ -288,11 +287,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'customverify')} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'customverify')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'customverify')} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'customverify')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'customverify') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -357,11 +356,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -424,11 +423,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'cbscripts')} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'cbscripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'cbscripts')} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'cbscripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'cbscripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -438,7 +437,7 @@ ], orderColumns: [ { - title: this.props.dict['header.form.funcvar'], + title: '鍑芥暟鍙橀噺', dataIndex: 'fieldName', width: '12%', render: (text, record) => (`${record.fieldName || ''}(${record.field})`) @@ -525,11 +524,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'ordercode')} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'ordercode')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'ordercode')} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'ordercode')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record, 'ordercode') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -1532,7 +1531,7 @@ {verify.contrasts.length ? <span className="count-tip">{verify.contrasts.length}</span> : null} </span> } key="contrasts"> - <ContrastForm dict={this.props.dict} contrastChange={this.contrastChange}/> + <ContrastForm contrastChange={this.contrastChange}/> <EditTable actions={['edit', 'move', 'copy', 'del', 'status']} type="contrastverify" data={verify.contrasts} columns={contrastColumns} onChange={(contrasts) => this.setState({verify: {...verify, contrasts}})}/> </TabPane> : null} {verifyInter === 'system' ? <TabPane tab={ @@ -1542,7 +1541,6 @@ </span> } key="customverifys" id="mk-custom-script"> <CustomForm - dict={this.props.dict} btn={this.props.card} initsql={this.state.initsql} usefulfields={this.state.usefulfields} @@ -1562,7 +1560,6 @@ btn={this.props.card} billcodes={verify.billcodes} columns={this.props.columns} - dict={this.props.dict} modular={orderModular} modularDetail={orderModularDetail} orderChange={this.orderChange} @@ -1579,7 +1576,6 @@ <UniqueForm btn={card} fields={card.Ot !== 'requiredOnce' ? uniqueFields : columnsFields} - dict={this.props.dict} uniqueChange={this.uniqueChange} /> <EditTable actions={['edit', 'move', 'del', 'status']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/> @@ -1591,7 +1587,6 @@ </span> } key="voucher"> <VoucherForm - dict={this.props.dict} voucher={voucher} columns={this.props.columns} voucherobj={verify.voucher} @@ -1619,7 +1614,6 @@ }}/> <CustomScript btn={this.props.card} - dict={this.props.dict} initsql={this.state.initsql} customScripts={verify.scripts} defaultsql={this.state.defaultsql} @@ -1638,7 +1632,6 @@ } key="cbScripts" id="mk-callback-script"> <CallBackCustomScript btn={this.props.card} - dict={this.props.dict} initsql={this.state.initsql} customScripts={verify.cbScripts} usefulfields={this.state.usefulfields} @@ -1783,7 +1776,7 @@ <span className="operation-btn" onClick={() => this.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(item, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -1796,7 +1789,6 @@ <CustomScript type="fullscreen" btn={this.props.card} - dict={this.props.dict} initsql={this.state.initsql} customScripts={verify.scripts} defaultsql={this.state.defaultsql} diff --git a/src/templates/zshare/verifycard/index.scss b/src/templates/zshare/verifycard/index.scss index 2f66da6..055f770 100644 --- a/src/templates/zshare/verifycard/index.scss +++ b/src/templates/zshare/verifycard/index.scss @@ -18,6 +18,11 @@ color: #1890ff; font-size: 12px; } + .mk-fix-form-height { + >.ant-row >.ant-col { + height: 64px; + } + } .verify-form { .sql { .ant-col-sm-8 { diff --git a/src/templates/zshare/verifycard/uniqueform/index.jsx b/src/templates/zshare/verifycard/uniqueform/index.jsx index 8566289..556e2d4 100644 --- a/src/templates/zshare/verifycard/uniqueform/index.jsx +++ b/src/templates/zshare/verifycard/uniqueform/index.jsx @@ -5,8 +5,7 @@ class UniqueForm extends Component { static propTpyes = { - btn: PropTypes.object, // 瀛楀吀椤� - dict: PropTypes.object, // 瀛楀吀椤� + btn: PropTypes.object, fields: PropTypes.array, // 琛ㄥ崟瀛楁 uniqueChange: PropTypes.func // 淇敼鍑芥暟 } @@ -55,13 +54,13 @@ <Form {...formItemLayout} className="verify-form" id="verifycard1"> <Row gutter={24}> <Col span={7}> - <Form.Item label={'瀛楁鍚�'}> + <Form.Item label="瀛楁鍚�"> {getFieldDecorator('field', { initialValue: [], rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀛楁鍚�!' + message: '璇烽�夋嫨瀛楁鍚�!' } ] })( @@ -76,13 +75,13 @@ </Form.Item> </Col> {btn.Ot !== 'requiredOnce' ? <Col span={7}> - <Form.Item label={'鎶ラ敊缂栫爜'}> + <Form.Item label="鎶ラ敊缂栫爜"> {getFieldDecorator('errorCode', { initialValue: 'E', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎶ラ敊缂栫爜!' + message: '璇烽�夋嫨鎶ラ敊缂栫爜!' } ] })( @@ -96,13 +95,13 @@ </Form.Item> </Col> : null} {btn.Ot !== 'requiredOnce' ? <Col span={7}> - <Form.Item label={'楠岃瘉绫诲瀷'}> + <Form.Item label="楠岃瘉绫诲瀷"> {getFieldDecorator('verifyType', { initialValue: 'physical', rules: [ { required: true, - message: this.props.dict['form.required.select'] + '楠岃瘉绫诲瀷!' + message: '璇烽�夋嫨楠岃瘉绫诲瀷!' } ] })( @@ -115,7 +114,7 @@ </Col> : null} <Col span={3} className="add"> <Button onClick={this.handleConfirm} className="mk-green"> - {this.props.dict['model.add']} + 娣诲姞 </Button> </Col> </Row> diff --git a/src/templates/zshare/verifycard/voucherform/index.jsx b/src/templates/zshare/verifycard/voucherform/index.jsx index 6341055..7dd3ba2 100644 --- a/src/templates/zshare/verifycard/voucherform/index.jsx +++ b/src/templates/zshare/verifycard/voucherform/index.jsx @@ -6,7 +6,6 @@ class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� voucherobj: PropTypes.object, // 鍑瘉淇℃伅 voucher: PropTypes.array, // 琛ㄥ崟 columns: PropTypes.array, // 琛ㄥ崟 @@ -167,7 +166,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '涓荤被鍨�!' + message: '璇烽�夋嫨涓荤被鍨�!' } ] })( @@ -181,13 +180,13 @@ </Form.Item> </Col> <Col span={11}> - <Form.Item label={'鍑瘉绫诲瀷'}> + <Form.Item label="鍑瘉绫诲瀷"> {getFieldDecorator('VoucherType', { initialValue: voucherobj.VoucherType || (this.state.voucher[0] && this.state.voucher[0].ID) || '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍑瘉绫诲瀷!' + message: '璇烽�夋嫨鍑瘉绫诲瀷!' } ] })( @@ -206,13 +205,13 @@ </Form.Item> </Col> <Col span={11}> - <Form.Item label={'鍑瘉鏍囪瘑'}> + <Form.Item label="鍑瘉鏍囪瘑"> {getFieldDecorator('VoucherTypeOne', { initialValue: voucherobj.VoucherTypeOne || (this.state.voucherDetail[0] && this.state.voucherDetail[0].ModularDetailCode) || '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍑瘉鏍囪瘑!' + message: '璇烽�夋嫨鍑瘉鏍囪瘑!' } ] })( @@ -231,13 +230,13 @@ </Form.Item> </Col> <Col span={11}> - <Form.Item label={'鍏宠仈瀛楁'}> + <Form.Item label="鍏宠仈瀛楁"> {getFieldDecorator('linkField', { initialValue: voucherobj.linkField || (columns[0] && columns[0].field) || '', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍏宠仈瀛楁!' + message: '璇烽�夋嫨鍏宠仈瀛楁!' } ] })( diff --git a/src/utils/option.js b/src/utils/option.js index 2183750..fac69e0 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -1,5 +1,3 @@ -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import nortable from '@/assets/img/normaltable.jpg' // import mainsubtable from '@/assets/img/mainsubtable.jpg' import treepage from '@/assets/img/treepage.jpg' @@ -7,8 +5,6 @@ import customImg from '@/assets/img/custom.jpg' import newpage from '@/assets/img/newpage.jpg' import rolemanage from '@/assets/img/rolemanage.jpg' - -const _dict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS // 琛ㄥ崟鏍¢獙瑙勫垯 export const formRule = { @@ -113,7 +109,7 @@ // 鏃ユ湡榛樿鍊奸�夋嫨鑼冨洿 export const dateOptions = { date: [ - {value: '', text: _dict['model.empty']}, + {value: '', text: '绌�'}, {value: '0', text: '浠婂ぉ'}, {value: 1, text: '鏄ㄥぉ'}, {value: 2, text: '鍓嶅ぉ'}, @@ -136,7 +132,7 @@ {value: -7300, text: '鍚�20骞�'}, ], dateweek: [ - {value: '', text: _dict['model.empty']}, + {value: '', text: '绌�'}, {value: '0', text: '鏈懆'}, {value: 1, text: '涓婂懆'}, {value: 3, text: '鍓嶄笁鍛�'}, @@ -144,7 +140,7 @@ {value: -1, text: '涓嬪懆'} ], datemonth: [ - {value: '', text: _dict['model.empty']}, + {value: '', text: '绌�'}, {value: '0', text: '鏈湀'}, {value: 1, text: '涓婃湀'}, {value: 3, text: '鍓嶄笁鏈�'}, @@ -152,7 +148,7 @@ {value: -1, text: '涓嬫湀'} ], daterange: [ - {value: '', text: _dict['model.empty']}, + {value: '', text: '绌�'}, {value: '[0, 0]', text: '浠婂ぉ'}, {value: '[1, 1]', text: '鏄ㄥぉ'}, {value: '[3, 0]', text: '杩戜笁澶�'}, @@ -167,7 +163,7 @@ {value: 'month', text: '鏈湀'}, ], datetime: [ - {value: '', text: _dict['model.empty']}, + {value: '', text: '绌�'}, {value: '0', text: '褰撳墠'}, {value: 1, text: '鏄ㄥぉ'}, {value: 3, text: '鍓嶄笁澶�'}, diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index fa7a65b..e667b47 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -463,6 +463,10 @@ return cell }) } else if (['card', 'carousel', 'timeline'].includes(item.type) || (item.type === 'table' && item.subtype === 'tablecard')) { + if (item.wrap.datatype === 'public' && uuids[item.wrap.publicId]) { + item.wrap.publicId = uuids[item.wrap.publicId] + } + item.subcards.forEach(card => { card.uuid = this.getuuid() @@ -503,6 +507,9 @@ } }) } else if (item.type === 'balcony') { + if (item.wrap.datatype === 'public' && uuids[item.wrap.publicId]) { + item.wrap.publicId = uuids[item.wrap.publicId] + } if (item.elements) { item.elements = item.elements.map(cell => { cell.uuid = this.getuuid() @@ -693,17 +700,15 @@ } /** - * @description 鏁版嵁婧愬悕绉帮紝鐢ㄤ簬缁熶竴鏌ヨ - * @return {String} name + * @description 缁勪欢鍚嶅姞鍚庣紑 */ - static getdataName () { + static getSignName () { let name = [] let _options = 'abcdefghigklmnopqrstuvwxyz' - for (let i = 0; i < 6; i++) { + for (let i = 0; i < 3; i++) { name.push(_options.substr(Math.floor(Math.random() * 26), 1)) } - name.splice(3, 0, new Date().getTime()) - return name.join('') + return (Math.floor(Math.random()*10) + name.join('')).toUpperCase() } /** @@ -721,12 +726,8 @@ item.uuid = _uuid - if (item.dataName) { - item.dataName = this.getdataName() - } - // 閲嶇疆缁勪欢鍚嶇О - let sign = this.getdataName().toUpperCase().substr(-4) + let sign = this.getSignName() if (item.plot) { // 鍥捐〃 item.plot.name = item.plot.name + sign item.name = item.plot.name diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 2e4dedc..bcbd86f 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -99,9 +99,9 @@ default_sql: setting.execute ? 'true' : 'false' } - if (setting.transaction === 'true') { - param.func = 'sPC_Get_TableData_try' - } + // if (setting.transaction === 'true') { + // param.func = 'sPC_Get_TableData_try' + // } let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' @@ -196,6 +196,10 @@ regoptions.forEach(item => { _customScript = _customScript.replace(item.reg, item.value) }) + if (window.GLOB.breakpoint) { + _customScript = _customScript.replace(/\$breakpoint_proc@/ig, window.GLOB.breakpoint) + param.func = 'sPC_Get_TableData_debug' + } } let LText = '' @@ -269,6 +273,10 @@ param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt('', param.timestamp) + if (window.GLOB.probation) { + param.s_debug_type = 'Y' + } + if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) @@ -295,9 +303,9 @@ default_sql: setting.execute ? 'true' : 'false' } - if (setting.transaction === 'true') { - param.func = 'sPC_Get_TableData_try' - } + // if (setting.transaction === 'true') { + // param.func = 'sPC_Get_TableData_try' + // } let _dataresource = setting.dataresource let _customScript = '' @@ -792,7 +800,7 @@ foreign_key: '', sql: _dataresource, script: _customScript, - transaction: setting.transaction === 'true' + // transaction: setting.transaction === 'true' } } @@ -803,7 +811,7 @@ export function getStructuredParams (params, config, BID) { let LText_field = [] let diffUser = false - let transaction = false + // let transaction = false let loginId = `'${sessionStorage.getItem('LoginUID') || ''}'` let sessionId = `'${localStorage.getItem('SessionUid') || ''}'` let userId = `'${sessionStorage.getItem('UserID') || ''}'` @@ -815,9 +823,9 @@ if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) { diffUser = true } - if (item.transaction) { - transaction = true - } + // if (item.transaction) { + // transaction = true + // } _sql = _sql.replace(/@ID@/ig, `''`) _script = _script.replace(/@ID@/ig, `''`) @@ -851,9 +859,9 @@ BID: BID } - if (transaction) { - param.func = 'sPC_Get_structured_data_try' - } + // if (transaction) { + // param.func = 'sPC_Get_structured_data_try' + // } let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index 881335d..c64ce5d 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -327,9 +327,9 @@ component.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 // floor 缁勪欢鐨勫眰绾� - // dataName 绯荤粺鐢熸垚鐨勬暟鎹簮鍚嶇О // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ - if (component.dataName && component.setting.sync === 'true') { + if (component.setting.sync === 'true') { + component.dataName = Utils.getdataName() let param = this.getDefaultParam(component) _pars.push(param) } else { @@ -426,7 +426,6 @@ foreign_key: '', sql: _dataresource, script: _customScript, - transaction: setting.transaction === 'true' } } @@ -435,7 +434,6 @@ if (!params || params.length === 0) return '' let LText_field = [] - let transaction = false let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' @@ -464,9 +462,6 @@ ${_script} ` } - if (item.transaction) { - transaction = true - } item.columns.forEach(cell => { LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`) @@ -479,10 +474,6 @@ LText: LText.join(' union all '), LText_field: LText_field.join(' union all '), BID: BID || '' - } - - if (transaction) { - param.func = 'sPC_Get_structured_data_try' } param.LText = Utils.formatOptions(param.LText) diff --git a/src/views/design/sidemenu/thdmenuplus/index.jsx b/src/views/design/sidemenu/thdmenuplus/index.jsx index b468df7..3f03d93 100644 --- a/src/views/design/sidemenu/thdmenuplus/index.jsx +++ b/src/views/design/sidemenu/thdmenuplus/index.jsx @@ -233,7 +233,17 @@ config.MenuName = param.MenuName config.MenuNo = param.MenuNo config.easyCode = '' - config.components = MenuUtils.resetConfig(config.components) + + let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + if (config.interfaces && config.interfaces.length > 0) { + config.interfaces = config.interfaces.map(inter => { + uuids[inter.uuid] = this.getuuid() + inter.uuid = uuids[inter.uuid] + return inter + }) + } + + config.components = MenuUtils.resetConfig(config.components, uuids) config.enabled = false param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) diff --git a/src/views/imdesign/index.jsx b/src/views/imdesign/index.jsx index 3092a93..2d6eeab 100644 --- a/src/views/imdesign/index.jsx +++ b/src/views/imdesign/index.jsx @@ -7,8 +7,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/mob.js' -import enUS from '@/locales/en-US/mob.js' import antdEnUS from 'antd/es/locale/en_US' import antdZhCN from 'antd/es/locale/zh_CN' // import MKEmitter from '@/utils/events.js' @@ -36,7 +34,6 @@ class ImDesign extends Component { state = { localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, loading: true, MenuId: '', MenuName: '', @@ -66,7 +63,6 @@ this.setState({ localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS }) this.getAppMessage(param.MenuID) } else if (param.type === 'view') { @@ -469,7 +465,7 @@ } render () { - const { localedict, loading, settingshow, controlshow, dict, MenuId, config, menuloading } = this.state + const { localedict, loading, settingshow, controlshow, MenuId, config, menuloading } = this.state return ( <ConfigProvider locale={localedict}> @@ -487,13 +483,12 @@ <Panel header="鍩烘湰淇℃伅" forceRender key="basedata"> {/* 鑿滃崟淇℃伅 */} {config ? <MenuForm - dict={dict} config={config} MenuId={MenuId} updateConfig={this.updateConfig} /> : null} </Panel> - <Panel header={'椤甸潰鏍峰紡'} key="background"> + <Panel header="椤甸潰鏍峰紡" key="background"> {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} </Panel> </Collapse> @@ -505,7 +500,7 @@ {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} </div> <div className="wrap"> - <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>{dict['mob.save']}</Button> + <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>淇濆瓨</Button> <NormalForm title="鍗虫椂閫氫俊璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <Button type="default" style={{borderColor: 'rgb(64, 169, 255)', color: 'rgb(64, 169, 255)'}}>璁剧疆</Button> </NormalForm> diff --git a/src/views/imdesign/menuform/index.jsx b/src/views/imdesign/menuform/index.jsx index 0fb6e84..58c2ece 100644 --- a/src/views/imdesign/menuform/index.jsx +++ b/src/views/imdesign/menuform/index.jsx @@ -6,7 +6,6 @@ class CustomMenuForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, MenuId: PropTypes.string, adapters: PropTypes.array, @@ -26,7 +25,7 @@ } render() { - const { dict, config } = this.props + const { config } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -43,26 +42,26 @@ <Form {...formItemLayout} className="custom-menu-form"> <Row> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.name']}> + <Form.Item label="鑿滃崟鍚嶇О"> {getFieldDecorator('MenuName', { initialValue: config.MenuName, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞悕绉�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.param']}> + <Form.Item label="鑿滃崟鍙傛暟"> {getFieldDecorator('MenuNo', { initialValue: config.MenuNo, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 61ee006..5f0b0f2 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -89,6 +89,11 @@ sessionStorage.setItem('mk_user_type', res.mk_user_type || '') sessionStorage.setItem('localRole_id', res.role_id || '') + if (res.paas_externalDatabase) { + sessionStorage.setItem('externalDatabase', res.paas_externalDatabase) + window.GLOB.externalDatabase = `[${res.paas_externalDatabase}]..` + } + localStorage.setItem(_href + 'lang', param.lang || 'zh-CN') sessionStorage.setItem('lang', param.lang || 'zh-CN') @@ -194,6 +199,11 @@ sessionStorage.setItem('organization', res.organization || '') sessionStorage.setItem('mk_user_type', res.mk_user_type || '') sessionStorage.setItem('localRole_id', res.role_id || '') + + if (res.paas_externalDatabase) { + sessionStorage.setItem('externalDatabase', res.paas_externalDatabase) + window.GLOB.externalDatabase = `[${res.paas_externalDatabase}]..` + } localStorage.setItem(_href + 'lang', param.lang || 'zh-CN') sessionStorage.setItem('lang', param.lang || 'zh-CN') @@ -240,6 +250,11 @@ sessionStorage.setItem('organization', res.organization || '') sessionStorage.setItem('mk_user_type', res.mk_user_type || '') sessionStorage.setItem('localRole_id', res.role_id || '') + + if (res.paas_externalDatabase) { + sessionStorage.setItem('externalDatabase', res.paas_externalDatabase) + window.GLOB.externalDatabase = `[${res.paas_externalDatabase}]..` + } sessionStorage.removeItem('visitorUserID') sessionStorage.removeItem('visitorLoginUID') diff --git a/src/views/main/index.jsx b/src/views/main/index.jsx index d13a74c..a6d2317 100644 --- a/src/views/main/index.jsx +++ b/src/views/main/index.jsx @@ -25,6 +25,8 @@ MKEmitter.addListener('resetSelectLine', this.resetParentParam) Object.defineProperty(window, 'debug', { + configurable: true, + enumerable: true, set(value) { if (value + '' === 'false') { window.debugger = false diff --git a/src/views/menudesign/homeform/index.jsx b/src/views/menudesign/homeform/index.jsx index db119a5..f865639 100644 --- a/src/views/menudesign/homeform/index.jsx +++ b/src/views/menudesign/homeform/index.jsx @@ -9,7 +9,6 @@ class CustomMenuForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, updateConfig: PropTypes.func } @@ -112,7 +111,7 @@ } render() { - const { dict, config } = this.props + const { config } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -164,7 +163,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '鏃堕暱!' + message: '璇疯緭鍏ユ椂闀�!' } ] })( diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 357f02f..7e761fe 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -12,8 +12,6 @@ import Api from '@/api' import options from '@/store/options.js' import Utils, { setGLOBFuncs } from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/mob.js' -import enUS from '@/locales/en-US/mob.js' // import antdEnUS from 'antd/es/locale/en_US' import antdZhCN from 'antd/es/locale/zh_CN' import MKEmitter from '@/utils/events.js' @@ -55,7 +53,6 @@ class MenuDesign extends Component { state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, MenuType: '', MenuId: '', ParentId: '', @@ -1081,7 +1078,7 @@ } render () { - const { activeKey, comloading, MenuType, dict, MenuId, config, settingshow, ParentId, menuloading, customComponents, eyeopen } = this.state + const { activeKey, comloading, MenuType, MenuId, config, settingshow, ParentId, menuloading, customComponents, eyeopen } = this.state return ( <ConfigProvider locale={_locale}> @@ -1098,7 +1095,6 @@ <Panel header="鍩烘湰淇℃伅" key="basedata"> {/* 鑿滃崟淇℃伅 */} {config && MenuType === 'custom' ? <MenuForm - dict={dict} config={config} MenuId={MenuId} parentId={ParentId} @@ -1107,12 +1103,10 @@ updateConfig={this.updateConfig} /> : null} {config && MenuType === 'home' ? <HomeForm - dict={dict} config={config} updateConfig={this.updateConfig} /> : null} {config && MenuType === 'billPrint' ? <PrintMenuForm - dict={dict} config={config} updateConfig={this.updateConfig} /> : null} @@ -1150,8 +1144,8 @@ <PictureController/> <StyleCombControlButton menu={config} /> <PasteController insert={this.insert} /> - <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> + <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config && config.enabled} onChange={this.onEnabledChange} /> + <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>淇濆瓨</Button> <Button type="default" onClick={this.closeView}>鍏抽棴</Button> </div> } style={{ width: '100%' }}> diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index 05349bb..5f217c5 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -11,7 +11,6 @@ class CustomMenuForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, MenuId: PropTypes.string, MenuName: PropTypes.string, @@ -185,7 +184,7 @@ } render() { - const { dict, MenuName, MenuNo, config } = this.props + const { MenuName, MenuNo, config } = this.props const { menulist, smenulist } = this.state const { getFieldDecorator } = this.props.form const formItemLayout = { @@ -203,13 +202,13 @@ <Form {...formItemLayout} className="custom-menu-form"> <Row> <Col span={24}> - <Form.Item label={dict['mob.menu.first'] + dict['mob.menu']}> + <Form.Item label="涓�绾ц彍鍗�"> {getFieldDecorator('fstMenuId', { initialValue: '', rules: [ { required: true, - message: dict['mob.required.select'] + dict['mob.menu.first'] + dict['mob.menu'] + '!' + message: '璇烽�夋嫨涓�绾ц彍鍗�!' } ] })( @@ -224,13 +223,13 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['mob.menu.second'] + dict['mob.menu']}> + <Form.Item label="浜岀骇鑿滃崟"> {getFieldDecorator('parentId', { initialValue: '', rules: [ { required: true, - message: dict['mob.required.select'] + dict['mob.menu.second'] + dict['mob.menu'] + '!' + message: '璇烽�夋嫨浜岀骇鑿滃崟!' } ] })( @@ -245,26 +244,26 @@ </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.name']}> + <Form.Item label="鑿滃崟鍚嶇О"> {getFieldDecorator('MenuName', { initialValue: MenuName, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞悕绉�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.param']}> + <Form.Item label="鑿滃崟鍙傛暟"> {getFieldDecorator('MenuNo', { initialValue: MenuNo, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} @@ -277,7 +276,7 @@ rules: [ { required: true, - message: dict['form.required.select'] + dict['model.openway'] + '!' + message: '璇烽�夋嫨鎵撳紑鏂瑰紡!' } ] })( @@ -341,7 +340,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '鏃堕暱!' + message: '璇疯緭鍏ユ椂闀�!' } ] })( @@ -350,14 +349,14 @@ </Form.Item> </Col> : null} <Col span={24}> - <Form.Item label={dict['mob.menu.easycode']}> + <Form.Item label="鍔╄鐮�"> {getFieldDecorator('easyCode', { initialValue: config.easyCode })(<Input placeholder="" autoComplete="off" onChange={this.changeEasyCode}/>)} </Form.Item> </Col> <Col span={24}> - <Form.Item label={'闅愯棌鑿滃崟'}> + <Form.Item label="闅愯棌鑿滃崟"> <Switch checkedChildren={'鏄�'} checked={config.hidden === 'true'} unCheckedChildren={'鍚�'} onChange={(value) => { this.selectChange('hidden', value + '') }} /> diff --git a/src/views/menudesign/printmenuform/index.jsx b/src/views/menudesign/printmenuform/index.jsx index 3831b6a..181163f 100644 --- a/src/views/menudesign/printmenuform/index.jsx +++ b/src/views/menudesign/printmenuform/index.jsx @@ -7,7 +7,6 @@ class MainSearch extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, updateConfig: PropTypes.func } @@ -117,7 +116,7 @@ } render() { - const { dict, config } = this.props + const { config } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -140,7 +139,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '鎵撳嵃灏哄!' + message: '璇烽�夋嫨鎵撳嵃灏哄!' } ] })( @@ -159,7 +158,7 @@ rules: [ { required: true, - message: dict['mob.required.select'] + '鎵撳嵃甯冨眬!' + message: '璇烽�夋嫨鎵撳嵃甯冨眬!' } ] })( @@ -177,7 +176,7 @@ rules: [ { required: true, - message: dict['mob.required.select'] + '鎵撳嵃杈硅窛!' + message: '璇烽�夋嫨鎵撳嵃杈硅窛!' } ] })( @@ -207,7 +206,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '棣栭〉鏁�!' + message: '璇疯緭鍏ラ椤垫暟!' } ] })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeFirstCount}/>)} @@ -220,7 +219,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '姣忛〉鏁�!' + message: '璇疯緭鍏ユ瘡椤垫暟!' } ] })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeCount}/>)} diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 7d19e54..384ca4e 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -10,8 +10,6 @@ import Api from '@/api' import Utils, { setGLOBFuncs } from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/mob.js' -import enUS from '@/locales/en-US/mob.js' import antdZhCN from 'antd/es/locale/zh_CN' import MKEmitter from '@/utils/events.js' import MenuUtils from '@/utils/utils-custom.js' @@ -62,7 +60,6 @@ class MobDesign extends Component { state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, loading: true, MenuId: '', MenuName: '', @@ -98,9 +95,6 @@ sessionStorage.setItem('userbind', param.userbind || '') sessionStorage.setItem('instantMessage', param.instantMessage || '') - this.setState({ - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - }) this.getAppMessage(param.MenuID) } else if (param.type === 'view') { window.GLOB.winWidth = 420 @@ -665,7 +659,7 @@ headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false, wrap: {name: 'logo', width: 24, datatype: 'static', cardType: '', blacklist: []}, name: 'logo', floor: 1, switchable: true, - setting:{interType: 'system'}, tabId: '', style:{paddingTop: '8vh', paddingBottom: '10vh'}, dataName: Utils.getuuid(), format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] + setting:{interType: 'system'}, tabId: '', style:{paddingTop: '8vh', paddingBottom: '10vh'}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] }) config.components.push({ @@ -674,7 +668,6 @@ floor: 1, tabId: '', parentId: '', - dataName: '', width: 24, name: '鐢ㄦ埛缁戝畾', subtype: 'bindlogin', @@ -697,7 +690,7 @@ headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false, wrap: {name: 'Power', width: 24, datatype: 'static', cardType: '', blacklist: []}, name: 'Power', floor: 1, switchable: true, - setting:{interType: 'system'}, tabId: '', style:{}, dataName: Utils.getuuid(), format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] + setting:{interType: 'system'}, tabId: '', style:{}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] }) } @@ -811,7 +804,16 @@ } } } else { - config.components = MenuUtils.resetConfig(config.components, {}, urlParam.clearMenu) + let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + if (config.interfaces && config.interfaces.length > 0) { + config.interfaces = config.interfaces.map(inter => { + uuids[inter.uuid] = this.getuuid() + inter.uuid = uuids[inter.uuid] + return inter + }) + } + + config.components = MenuUtils.resetConfig(config.components, uuids, urlParam.clearMenu) config.enabled = false message.success('澶嶅埗鎴愬姛锛屼繚瀛樺悗鐢熸晥銆�') } @@ -1966,7 +1968,7 @@ render () { - const { viewType, comloading, loading, settingshow, controlshow, activeKey, dict, MenuId, config, menuloading, customComponents, adapters, eyeopen } = this.state + const { viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, customComponents, adapters, eyeopen } = this.state return ( <ConfigProvider locale={antdZhCN}> @@ -1985,7 +1987,6 @@ <Panel header="鍩烘湰淇℃伅" forceRender className="basedata" key="basedata"> {/* 鑿滃崟淇℃伅 */} {config ? <MenuForm - dict={dict} config={config} MenuId={MenuId} adapters={adapters} @@ -1997,7 +1998,7 @@ {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> : null} </Panel> {/* 缁勪欢娣诲姞 */} - <Panel header={dict['mob.component']} className="component" key="component"> + <Panel header="缁勪欢" className="component" key="component"> <SourceWrap /> </Panel> <Panel header="鍏冪礌" key="element"> @@ -2018,8 +2019,8 @@ {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} </div> <div className="wrap"> - <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>{dict['mob.save']}</Button> - <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> + <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>淇濆瓨</Button> + <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config && config.enabled} onChange={this.onEnabledChange} /> <ArrowLeftOutlined title="鍚庨��" className="back-view" onClick={this.backView}/> <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 缁勪欢鍚�</Button> <CreateView resetmenu={this.getAppMenus} /> diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx index 60d0442..14fae1f 100644 --- a/src/views/mobdesign/menuform/index.jsx +++ b/src/views/mobdesign/menuform/index.jsx @@ -12,7 +12,6 @@ class CustomMenuForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, MenuId: PropTypes.string, adapters: PropTypes.array, @@ -54,7 +53,7 @@ } render() { - const { dict, config, adapters } = this.props + const { config, adapters } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -71,26 +70,26 @@ <Form {...formItemLayout} className="custom-menu-form"> <Row> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.name']}> + <Form.Item label="鑿滃崟鍚嶇О"> {getFieldDecorator('MenuName', { initialValue: config.MenuName, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞悕绉�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.param']}> + <Form.Item label="鑿滃崟鍙傛暟"> {getFieldDecorator('MenuNo', { initialValue: config.MenuNo, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} @@ -166,7 +165,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '鏃堕暱!' + message: '璇疯緭鍏ユ椂闀�!' } ] })( @@ -239,7 +238,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '鍋滅暀鏃堕棿!' + message: '璇疯緭鍏ュ仠鐣欐椂闂�!' } ] })( diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index 17f63bf..06059cb 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -10,8 +10,6 @@ import Api from '@/api' import Utils, { setGLOBFuncs } from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/mob.js' -import enUS from '@/locales/en-US/mob.js' // import antdEnUS from 'antd/es/locale/en_US' import antdZhCN from 'antd/es/locale/zh_CN' import MKEmitter from '@/utils/events.js' @@ -57,7 +55,6 @@ class MenuDesign extends Component { state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, loading: true, MenuId: '', MenuName: '', @@ -97,9 +94,6 @@ sessionStorage.setItem('kei_no', param.kei_no || '') sessionStorage.setItem('sysBgColor', param.sysBgColor || '#ffffff') - this.setState({ - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS - }) this.getAppMessage(param.MenuID) } else if (param.type === 'view') { this.setState({ @@ -764,7 +758,15 @@ } } } else { - config.components = MenuUtils.resetConfig(config.components, {}, urlParam.clearMenu) + let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + if (config.interfaces && config.interfaces.length > 0) { + config.interfaces = config.interfaces.map(inter => { + uuids[inter.uuid] = this.getuuid() + inter.uuid = uuids[inter.uuid] + return inter + }) + } + config.components = MenuUtils.resetConfig(config.components, uuids, urlParam.clearMenu) config.enabled = false message.success('澶嶅埗鎴愬姛锛屼繚瀛樺悗鐢熸晥銆�') } @@ -1875,7 +1877,7 @@ } render () { - const { loading, comloading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents, eyeopen } = this.state + const { loading, comloading, activeKey, settingshow, controlshow, MenuId, config, menuloading, customComponents, eyeopen } = this.state return ( <ConfigProvider locale={antdZhCN}> @@ -1893,7 +1895,6 @@ <Panel header="鍩烘湰淇℃伅" key="basedata"> {/* 鑿滃崟淇℃伅 */} {config ? <MenuForm - dict={dict} config={config} MenuId={MenuId} updateConfig={this.updateConfig} @@ -1904,7 +1905,7 @@ {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> : null} </Panel> {/* 缁勪欢娣诲姞 */} - <Panel header={dict['mob.component']} key="component"> + <Panel header="缁勪欢" key="component"> <SourceWrap /> </Panel> <Panel header="鍏冪礌" key="element"> @@ -1925,8 +1926,8 @@ {!controlshow ? <DoubleLeftOutlined onClick={() => {sessionStorage.setItem('controlshow', 'true'); this.setState({controlshow: true})}}/> : null} </div> <div className="wrap"> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> - <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> + <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>淇濆瓨</Button> + <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config && config.enabled} onChange={this.onEnabledChange} /> <ArrowLeftOutlined title="鍚庨��" className="back-view" onClick={this.backView}/> <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 缁勪欢鍚�</Button> <CreateView resetmenu={this.getAppMenus} /> diff --git a/src/views/pcdesign/menuform/index.jsx b/src/views/pcdesign/menuform/index.jsx index 8b16673..8dd5777 100644 --- a/src/views/pcdesign/menuform/index.jsx +++ b/src/views/pcdesign/menuform/index.jsx @@ -9,7 +9,6 @@ class CustomMenuForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� config: PropTypes.object, MenuId: PropTypes.string, updateConfig: PropTypes.func @@ -52,7 +51,7 @@ } render() { - const { dict, config } = this.props + const { config } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -69,26 +68,26 @@ <Form {...formItemLayout} className="custom-menu-form"> <Row> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.name']}> + <Form.Item label="鑿滃崟鍚嶇О"> {getFieldDecorator('MenuName', { initialValue: config.MenuName, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞悕绉�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} </Form.Item> </Col> <Col span={24}> - <Form.Item label={dict['mob.menu'] + dict['mob.param']}> + <Form.Item label="鑿滃崟鍙傛暟"> {getFieldDecorator('MenuNo', { initialValue: config.MenuNo, rules: [ { required: true, - message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' + message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' } ] })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} @@ -164,7 +163,7 @@ rules: [ { required: true, - message: dict['mob.required.input'] + '鏃堕暱!' + message: '璇疯緭鍏ユ椂闀�!' } ] })( diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index 9865697..19d5c67 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -11,7 +11,9 @@ import Utils, { setGLOBFuncs } from '@/utils/utils.js' import antdZhCN from 'antd/es/locale/zh_CN' import MKEmitter from '@/utils/events.js' +import SourceElement from '@/templates/zshare/dragsource' import asyncComponent from '@/utils/asyncComponent' +import Source from './source' import '@/assets/css/design.scss' import './index.scss' @@ -22,15 +24,14 @@ const _locale = antdZhCN const MenuForm = asyncComponent(() => import('./menuform')) +const TableSource = asyncComponent(() => import('./tablesource')) const Header = asyncComponent(() => import('@/menu/header')) const MenuShell = asyncComponent(() => import('@/menu/tableshell')) const BgController = asyncComponent(() => import('@/pc/bgcontroller')) const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) const Versions = asyncComponent(() => import('@/menu/versions')) -const SysInterface = asyncComponent(() => import('@/menu/sysinterface')) const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) -const PictureController = asyncComponent(() => import('@/menu/picturecontroller')) const ModalController = asyncComponent(() => import('@/menu/modalconfig/controller')) const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) @@ -90,7 +91,6 @@ MKEmitter.addListener('modalStatus', this.modalStatus) MKEmitter.addListener('changePopview', this.initPopview) MKEmitter.addListener('triggerMenuSave', this.triggerMenuSave) - MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) MKEmitter.addListener('updateCustomComponent', this.updateCustomComponent) setTimeout(() => { if (sessionStorage.getItem('app_custom_components')) { @@ -158,7 +158,6 @@ MKEmitter.removeListener('modalStatus', this.modalStatus) MKEmitter.removeListener('changePopview', this.initPopview) MKEmitter.removeListener('triggerMenuSave', this.triggerMenuSave) - MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent) } @@ -299,28 +298,6 @@ }) }) this.setState({customComponents: coms}) - } - - updateComponentStyle = (parentId, keys, style) => { - const { config } = this.state - - if (config.uuid !== parentId) return - - let components = config.components.map(item => { - if (keys.includes(item.uuid)) { - item.style = {...item.style, ...style} - } - return item - }) - - this.setState({ - config: {...config, components}, - comloading: true - }, () => { - this.setState({ - comloading: false - }) - }) } initPopview = (card, btn) => { @@ -783,6 +760,18 @@ {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null} {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> : null} </Panel> + <Panel header="鎼滅储" key="search"> + {Source.searchItems.map((item, index) => (<SourceElement key={index} content={item}/>))} + </Panel> + <Panel header="鎸夐挳" key="action"> + {Source.actionItems.map((item, index) => (<SourceElement key={index} content={item}/>))} + </Panel> + <Panel header="鏄剧ず鍒�" key="cols"> + {Source.columnItems.map((item, index) => (<SourceElement key={index} content={item}/>))} + </Panel> + <Panel header="缁勪欢" key="component"> + {Source.menuItems.map((item, index) => (<TableSource key={index} item={item}/>))} + </Panel> <Panel header="椤甸潰鏍峰紡" key="background"> {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} </Panel> @@ -795,8 +784,6 @@ <div> <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/> <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> - <SysInterface config={config} updateConfig={this.updateConfig}/> - <PictureController/> <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config && config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>淇濆瓨</Button> <Button type="default" onClick={this.closeView}>鍏抽棴</Button> diff --git a/src/views/tabledesign/source.jsx b/src/views/tabledesign/source.jsx new file mode 100644 index 0000000..248418f --- /dev/null +++ b/src/views/tabledesign/source.jsx @@ -0,0 +1,177 @@ +import NormalTable from '@/assets/mobimg/normal-table.png' + +export default { + searchItems: [ + { + type: 'search', + label: '鏂囨湰', + subType: 'text', + url: '' + }, + { + type: 'search', + label: '涓嬫媺閫夋嫨', + subType: 'select', + url: '' + }, + { + type: 'search', + label: '涓嬫媺澶氶��', + subType: 'multiselect', + url: '' + }, + { + type: 'search', + label: '鑱斿姩鑿滃崟', + subType: 'link', + url: '' + }, + { + type: 'search', + label: '閫夐」鍗�', + subType: 'checkcard', + url: '' + }, + { + type: 'search', + label: '鏃ユ湡锛堝ぉ锛�', + subType: 'date', + url: '' + }, + { + type: 'search', + label: '鏃ユ湡锛堝懆锛�', + subType: 'dateweek', + url: '' + }, + { + type: 'search', + label: '鏃ユ湡锛堟湀锛�', + subType: 'datemonth', + url: '' + }, + { + type: 'search', + label: '鏃ユ湡锛堝尯闂达級', + subType: 'daterange', + url: '' + }, + { + type: 'search', + label: '鏃ユ湡锛堢粍鍚堬級', + subType: 'group', + url: '' + } + ], + actionItems: [ + { + type: 'action', + label: '寮圭獥锛堣〃鍗曪級', + subType: 'pop', + url: '' + }, + { + type: 'action', + label: '鎻愮ず妗�', + subType: 'prompt', + url: '' + }, + { + type: 'action', + label: '鐩存帴鎵ц', + subType: 'exec', + url: '' + }, + { + type: 'action', + label: '瀵煎叆Excel', + subType: 'excelIn', + url: '' + }, + { + type: 'action', + label: '瀵煎嚭Excel', + subType: 'excelOut', + url: '' + }, + { + type: 'action', + label: '寮圭獥锛堟爣绛撅級', + subType: 'popview', + url: '' + }, + { + type: 'action', + label: '鏍囩椤�', + subType: 'tab', + url: '' + }, + { + type: 'action', + label: '鏂伴〉闈�', + subType: 'innerpage', + url: '' + }, + { + type: 'action', + label: '鍔熻兘鎸夐挳', + subType: 'funcbutton', + url: '' + } + ], + columnItems: [ + { + type: 'columns', + label: '鏂囨湰', + subType: 'text', + url: '' + }, + { + type: 'columns', + label: '鏁板瓧', + subType: 'number', + url: '' + }, + { + type: 'columns', + label: '鍥剧墖', + subType: 'picture', + url: '' + }, + { + type: 'columns', + label: '閾炬帴', + subType: 'link', + url: '' + }, + { + type: 'columns', + label: '澶氳鏂囨湰', + subType: 'textarea', + url: '' + }, + { + type: 'columns', + label: '鍚堝苟鍒�', + subType: 'colspan', + url: '' + }, + { + type: 'columns', + label: '搴忓彿', + subType: 'index', + url: '' + } + ], + tabItems: [ + { + type: 'tabs', + label: '瀛愯〃', + subType: 'SubTable', + } + ], + menuItems: [ + { type: 'menu', url: NormalTable, component: 'table', subtype: 'basetable', title: '瀛愯〃' } + ] +} + diff --git a/src/views/tabledesign/tablesource/index.jsx b/src/views/tabledesign/tablesource/index.jsx new file mode 100644 index 0000000..257478a --- /dev/null +++ b/src/views/tabledesign/tablesource/index.jsx @@ -0,0 +1,14 @@ +import React from 'react' +import { useDrag } from 'react-dnd' +import './index.scss' + +const TableElement = ({item}) => { + const [, drag] = useDrag({ item }) + return ( + <div className="menu-source-item"> + <div className="property"><span>{item.title}</span></div> + <img ref={drag} src={item.url} alt=""/> + </div> + ) +} +export default TableElement \ No newline at end of file diff --git a/src/views/tabledesign/tablesource/index.scss b/src/views/tabledesign/tablesource/index.scss new file mode 100644 index 0000000..2e34902 --- /dev/null +++ b/src/views/tabledesign/tablesource/index.scss @@ -0,0 +1,19 @@ +.menu-source-item { + display: inline-block; + width: 100%; + margin-bottom: 15px; + height: auto; + min-height: 70px; + + .property { + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + margin-bottom: 2px; + } + + img { + width: 100%; + cursor: move; + box-shadow: 0px 0px 1px #1890ff; + } +} \ No newline at end of file -- Gitblit v1.8.0