From 2b46797c3a5868f7f26329da5834c13aae07ad69 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 03 四月 2023 11:59:34 +0800 Subject: [PATCH] Merge branch 'develop' --- src/views/systemproc/proc/index.jsx | 3 src/menu/components/card/cardsimplecomponent/node-wrap/menus/index.jsx | 19 src/templates/zshare/modalform/index.jsx | 13 src/tabviews/formtab/index.jsx | 2 src/menu/components/timeline/normal-timeline/index.jsx | 7 src/tabviews/custom/components/editor/braft-editor/index.jsx | 2 src/mob/components/tabs/antv-tabs/options.jsx | 12 src/menu/components/form/dragtitle/options.jsx | 67 src/tabviews/zshare/settingcomponent/index.jsx | 7 src/templates/zshare/verifycard/customscript/index.jsx | 7 src/tabviews/custom/popview/index.jsx | 5 src/templates/modalconfig/index.jsx | 3 src/views/systemfunc/index.jsx | 15 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 7 src/views/interface/workspace/index.jsx | 18 src/mob/modalconfig/index.jsx | 52 src/tabviews/commontable/index.jsx | 13 src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx | 8 src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 2 src/views/tabledesign/menuform/index.scss | 8 src/views/menudesign/menuform/index.scss | 8 src/tabviews/custom/components/card/cardcellList/index.jsx | 19 src/tabviews/custom/components/card/prop-card/index.jsx | 4 src/menu/components/card/cardcellcomponent/index.jsx | 7 src/menu/components/form/tab-form/index.jsx | 115 - src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 8 src/tabviews/custom/components/table/normal-table/index.jsx | 53 src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx | 8 src/menu/components/carousel/prop-card/index.jsx | 14 src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx | 6 src/tabviews/custom/components/chart/antv-pie/index.jsx | 7 src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 42 src/templates/modalconfig/dragelement/index.scss | 21 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 2 src/components/breadview/index.jsx | 14 src/tabviews/custom/components/editor/braft-editor/index.scss | 10 src/tabviews/zshare/mutilform/index.jsx | 40 src/menu/components/card/prop-card/index.jsx | 30 src/templates/zshare/customscript/index.jsx | 7 src/menu/components/tabs/paste/index.jsx | 12 src/menu/components/timeline/normal-timeline/options.jsx | 44 src/tabviews/custom/components/chart/antv-scatter/index.jsx | 7 src/menu/components/card/cardsimplecomponent/node-wrap/index.jsx | 6 src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 7 src/assets/css/viewstyle.scss | 12 src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 7 src/views/design/header/index.jsx | 96 src/views/pcdesign/menuform/index.scss | 8 src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx | 4 src/menu/components/form/simple-form/options.jsx | 57 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 5 src/menu/components/form/simple-form/index.jsx | 113 - src/menu/components/card/balcony/index.scss | 1 src/api/index.js | 351 --- src/mob/components/formdragelement/index.scss | 65 src/views/mobdesign/menuform/index.scss | 8 src/menu/components/table/edit-table/index.jsx | 14 src/templates/formtabconfig/index.scss | 2 src/menu/components/carousel/data-card/index.jsx | 7 src/mob/components/search/single-search/index.jsx | 2 src/tabviews/custom/components/card/table-card/index.jsx | 7 src/menu/components/form/step-form/index.jsx | 121 - src/views/pcdesign/index.jsx | 43 src/menu/datasource/verifycard/settingform/index.jsx | 18 src/menu/components/share/actioncomponent/index.jsx | 94 + src/tabviews/custom/components/form/step-form/index.jsx | 12 src/tabviews/zshare/pageMessage/index.jsx | 5 src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx | 7 src/views/systemfunc/sidemenu/config.jsx | 115 src/menu/components/form/dragtitle/card.jsx | 14 src/views/login/index.jsx | 12 src/menu/components/card/cardsimplecomponent/node-wrap/menus/columnform/index.jsx | 19 src/tabviews/formtab/actionList/index.jsx | 2 src/menu/components/editor/braft-editor/options.jsx | 12 src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx | 7 src/menu/components/card/table-card/index.jsx | 9 src/menu/components/group/paste/index.jsx | 4 src/tabviews/custom/components/tree/antd-tree/index.jsx | 7 src/tabviews/zshare/normalTable/index.jsx | 3 src/menu/components/share/pasteforms/index.jsx | 178 ++ src/utils/utils-custom.js | 12 src/templates/comtableconfig/updatetable/index.jsx | 214 ++ src/tabviews/zshare/actionList/excelInbutton/index.jsx | 2 src/views/menudesign/menuform/index.jsx | 2 src/menu/components/table/base-table/index.scss | 3 src/menu/components/card/data-card/index.scss | 9 src/views/billprint/index.jsx | 20 src/tabviews/zshare/mutilform/mkVercode/index.jsx | 2 src/locales/en-US/main.js | 26 src/menu/components/editor/braft-editor/index.scss | 9 src/tabviews/zshare/actionList/normalbutton/index.jsx | 99 src/templates/modalconfig/dragelement/card.jsx | 4 src/views/mobdesign/index.jsx | 67 src/views/interface/history/index.jsx | 251 +- src/views/menudesign/index.jsx | 35 src/menu/modulesource/option.jsx | 2 src/tabviews/custom/components/card/data-card/index.jsx | 58 src/api/cacheutils.js | 340 ---- src/menu/components/share/actioncomponent/formconfig.jsx | 24 src/templates/zshare/pasteform/index.jsx | 31 src/menu/components/card/double-data-card/index.jsx | 25 src/menu/components/card/doublecardcomponent/index.jsx | 4 src/menu/pastecontroller/index.jsx | 20 src/menu/components/card/data-card/index.jsx | 25 src/tabviews/custom/components/carousel/prop-card/index.jsx | 7 src/menu/components/share/clockcomponent/settingform/index.jsx | 4 src/views/appmanage/index.jsx | 33 src/menu/components/table/normal-table/index.jsx | 14 src/tabviews/custom/components/card/double-data-card/index.scss | 23 src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx | 7 src/tabviews/custom/components/card/balcony/index.scss | 1 src/components/header/index.jsx | 13 src/views/mobdesign/menuform/index.jsx | 2 src/views/pcdesign/menuform/index.jsx | 2 src/tabviews/custom/components/card/double-data-card/index.jsx | 141 + src/templates/formtabconfig/index.jsx | 32 src/templates/zshare/verifycard/callbackcustomscript/index.jsx | 7 src/views/interface/api/index.js | 116 src/menu/datasource/verifycard/customscript/index.jsx | 7 src/tabviews/custom/components/carousel/data-card/index.jsx | 25 src/templates/sharecomponent/fieldscomponent/index.jsx | 9 src/views/tabledesign/menuform/index.jsx | 2 src/templates/zshare/verifycard/customform/index.jsx | 7 src/menu/components/share/pasteforms/index.scss | 0 src/tabviews/custom/components/chart/custom-chart/index.jsx | 7 src/utils/utils.js | 78 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 7 src/index.js | 2 src/views/sso/index.jsx | 8 src/menu/components/card/balcony/index.jsx | 27 src/menu/components/share/pastecomponent/index.jsx | 2 src/tabviews/custom/components/timeline/normal-timeline/index.scss | 118 + src/components/normalform/modalform/index.jsx | 19 src/locales/zh-CN/main.js | 26 src/templates/zshare/formconfig.jsx | 20 src/templates/zshare/verifycard/index.jsx | 31 src/tabviews/zshare/actionList/printbutton/index.jsx | 131 + src/mob/components/formdragelement/card.jsx | 25 src/menu/components/editor/braft-editor/index.jsx | 4 src/menu/modalconfig/index.jsx | 53 src/tabviews/custom/components/card/balcony/index.jsx | 8 src/menu/components/table/base-table/index.jsx | 16 src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx | 8 143 files changed, 2,523 insertions(+), 2,005 deletions(-) diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js index 1c174d9..265071c 100644 --- a/src/api/cacheutils.js +++ b/src/api/cacheutils.js @@ -3,280 +3,11 @@ */ export default class CacheUtils { /** - * @description 鎵撳紑websql - */ - static openWebSql (db) { - try { - 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))', [], () => { - - }, () => { - // eslint-disable-next-line - throw 'CREATE TABLE ERROR' - }) - tx.executeSql('CREATE TABLE IF NOT EXISTS CONFIGS (menuid varchar(50), userid varchar(50), openEdition varchar(50), webEdition varchar(50), LongParam text, LongParamUser text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50), CDefine4 varchar(50), CDefine5 varchar(50))', [], () => { - - }, () => { - // eslint-disable-next-line - throw 'CREATE TABLE ERROR' - }) - - tx.executeSql('CREATE TABLE IF NOT EXISTS CACHES (menuid varchar(50), CreateDate varchar(50), LongParam text, CDefine1 varchar(50), CDefine2 varchar(50))', [], () => { - - }, () => { - // eslint-disable-next-line - throw 'CREATE TABLE ERROR' - }) - - 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))', [], () => { - - }, () => { - // eslint-disable-next-line - throw 'CREATE TABLE ERROR' - }) - } - }) - // window.GLOB.WebSql.transaction(tx => { - // tx.executeSql('DROP TABLE VERSIONS') - // tx.executeSql('DROP TABLE CONFIGS') - // }) - } catch (e) { - console.warn('WebSql 鍒濆鍖栧け璐ワ紒') - window.GLOB.WebSql = null - - if (window.indexedDB) { - this.openIndexDB(db) - } - } - } - - /** - * @description 娓呯┖鍑芥暟 - */ - static clearFuncs () { - if (window.GLOB.systemType !== '') return - - if (window.GLOB.WebSql) { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql('DELETE FROM FUNCS') - - tx.executeSql(`UPDATE VERSIONS SET createDate='1970-01-01 14:59:09.000' where CDefine1='funcs'`) - }) - } else if (window.GLOB.IndexDB) { - let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs') - objectStore.clear() - - window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version').delete('funcs') - } - } - - /** - * @description 鑾峰彇websql涓繚瀛樹俊鎭増鏈� - */ - static getWebSqlVersion () { - if (!window.GLOB.WebSql) { - return Promise.reject() - } - - 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) => { - console.warn(results) - resolve({version: '', createDate: ''}) - }) - }) - }) - ) - - 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) => { - 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) - }) - }) - } - - /** - * @description 鍒犻櫎websql涓繚瀛樼殑閰嶇疆淇℃伅 - */ - static delWebSqlConfig (keys) { - if (!window.GLOB.WebSql) return - - if (!keys) { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, (tx, results) => { - console.warn(results) - }) - }) - } else { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CONFIGS where menuid in (${keys})`, [], () => {}, (tx, results) => { - console.warn(results) - }) - }) - } - } - - /** - * @description 鍒犻櫎websql涓繚瀛樼殑閰嶇疆淇℃伅 - */ - static delMenuWebSqlConfig (menuId) { - if (!window.GLOB.WebSql || !menuId) return Promise.resolve() - return new Promise(resolve => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CONFIGS where menuid='${menuId}'`, [], () => { - resolve() - }, (tx, results) => { - console.warn(results) - resolve() - }) - }) - }) - } - - /** - * @description 鏇存柊websql涓厤缃俊鎭殑鐗堟湰 - */ - static updateWebSqlversion (version, curTime) { - if (!window.GLOB.WebSql) return - - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM VERSIONS where CDefine1='LongParam'`) - - if (version) { - tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', [version, curTime, 'LongParam'], () => {}, (tx, results) => { - console.warn(results) - }) - } - }) - } - - /** - * @description 鑾峰彇websql涓殑閰嶇疆淇℃伅 - */ - static getWebSqlMenuConfig (MenuID, userid) { - if (!window.GLOB.WebSql || !MenuID || !userid) return Promise.reject() - return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`SELECT * FROM CONFIGS WHERE menuid='${MenuID}' and userid='${userid}'`, [], (tx, results) => { - let paramItem = results.rows[0] - if (paramItem) { - resolve({ - ErrCode: 'S', - ErrMesg: '', - LongParam: paramItem.LongParam, - LongParamUser: paramItem.LongParamUser, - message: '', - open_edition: paramItem.openEdition, - status: true, - web_edition: paramItem.webEdition - }) - } else { - reject() - } - }, (tx, results) => { - console.warn(results) - reject() - }) - }) - }) - } - - /** - * @description 灏嗘暟鎹啓鍏ebsql - */ - static writeInWebSql (data) { - if (!window.GLOB.WebSql || !data) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql('INSERT INTO CONFIGS (menuid, userid, openEdition, webEdition, LongParam, LongParamUser) VALUES (?, ?, ?, ?, ?, ?)', data) - }) - } - - /** - * @description 灏嗙紦瀛樻暟鎹啓鍏ebsql - */ - static writeCacheInWebSql (data) { - if (!window.GLOB.WebSql) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CACHES where menuid='${data[0]}'`) - if (data[2]) { - tx.executeSql('INSERT INTO CACHES (menuid, CreateDate, LongParam) VALUES (?, ?, ?)', data) - } - }) - } - - /** - * @description 鑾峰彇websql涓殑閰嶇疆淇℃伅 - */ - static getWebSqlCacheConfig (MenuID) { - if (!window.GLOB.WebSql) return Promise.resolve() - return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`SELECT * FROM CACHES WHERE menuid='${MenuID}'`, [], (tx, results) => { - resolve(results.rows[0]) - }, (tx, results) => { - console.warn(results) - resolve() - }) - }) - }) - } - - /** - * @description 鍒犻櫎websql涓秴杩�7澶╃殑缂撳瓨淇℃伅 - */ - static delWebSqlCacheConfig (date, type) { - if (!window.GLOB.WebSql) return - window.GLOB.WebSql.transaction(tx => { - if (type === 'all') { - tx.executeSql('DELETE FROM CACHES') - } else { - tx.executeSql(`DELETE FROM CACHES where CreateDate<'${date}'`) - } - }) - } - - /** * @description 鎵撳紑IndexedDB */ static openIndexDB (db) { try { - let request = window.indexedDB.open(db, 2) + let request = window.indexedDB.open(db, 3) request.onerror = () => { console.warn('IndexedDB 鍒濆鍖栧け璐ワ紒') } @@ -296,7 +27,7 @@ if (!window.GLOB.IndexDB.objectStoreNames.contains('caches')) { window.GLOB.IndexDB.createObjectStore('caches', { keyPath: 'menuid' }) } - if (window.GLOB.systemType === '' && !window.GLOB.IndexDB.objectStoreNames.contains('funcs')) { + if (!window.GLOB.IndexDB.objectStoreNames.contains('funcs')) { window.GLOB.IndexDB.createObjectStore('funcs', { keyPath: 'id' }) } } @@ -323,7 +54,6 @@ .get('mksoft') request.onerror = (event) => { - window.GLOB.IndexDB = null console.warn(event) resolve({version: '', createDate: ''}) } @@ -342,16 +72,19 @@ new Promise((resolve) => { let request = window.GLOB.IndexDB.transaction(['configs']).objectStore('configs').openCursor() let menus = [] + let ids = [] 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'}'`) + if (cursor.value.menuid && !ids.includes(cursor.value.menuid)) { + menus.push(`'${cursor.value.menuid}','${cursor.value.open_edition || 'mk'}'`) + ids.push(cursor.value.menuid) + } cursor.continue() } else { resolve(menus) @@ -382,58 +115,21 @@ if (!window.GLOB.IndexDB || !version) return if (!version) { - let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').delete('mksoft') - - request.onerror = () => { - window.GLOB.IndexDB = null - } + window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').delete('mksoft') } 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 - } + objectStore.put(version) } else { - let add = objectStore.add(version) - - add.onerror = () => { - window.GLOB.IndexDB = null - } + objectStore.add(version) } } } - } - - /** - * @description 鍒犻櫎IndexedDB涓繚瀛樼殑閰嶇疆淇℃伅 - */ - static delMenuIndexDBConfig (key) { - if (!window.GLOB.IndexDB || !key) return Promise.resolve() - - return new Promise(resolve => { - let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite') - .objectStore('configs') - .delete(key) - - request.onsuccess = () => { - resolve() - } - request.onerror = () => { - window.GLOB.IndexDB = null - resolve() - } - }) } /** @@ -443,17 +139,9 @@ if (!window.GLOB.IndexDB) return if (!menuids) { - let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').clear() - - request.onerror = () => { - window.GLOB.IndexDB = null - } + window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').clear() } else { let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').openCursor() - - request.onerror = () => { - window.GLOB.IndexDB = null - } request.onsuccess = (e) => { let cursor = e.target.result @@ -470,15 +158,13 @@ /** * @description 鑾峰彇IndexedDB涓殑閰嶇疆淇℃伅 */ - static getIndexDBMenuConfig (MenuID, userid) { - if (!window.GLOB.IndexDB || !MenuID || !userid) return Promise.reject() - let key = MenuID + userid + static getIndexDBMenuConfig (key) { + if (!window.GLOB.IndexDB || !key) return Promise.reject() return new Promise((resolve, reject) => { let request = window.GLOB.IndexDB.transaction(['configs']).objectStore('configs').get(key) request.onerror = () => { - window.GLOB.IndexDB = null reject() } diff --git a/src/api/index.js b/src/api/index.js index bb681d0..a4dd5b9 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -9,21 +9,13 @@ import CacheUtils from './cacheutils' import options from '@/store/options.js' -window.GLOB.WebSql = null window.GLOB.IndexDB = null window.GLOB.OuterToken = {} -const systemMenuKeys = `1581067625930haged11ieaivpavv77k,1581734956310scks442ul2d955g9tu5,1583991994144ndddg0bhh0is6shi0v1,1583979633842550imkchl4qt4qppsiv, - 1585192949946f3et2ts8tn82krmumdf,15855615451212m12ip23vpcm79kloro,1587005717541lov40vg61q7l1rbveon,1590458676585agbbr63t6ihighg2i1g,1602315375262ikd33ii0nii34pt861o,1582771068837vsv54a089lgp45migbg, - 1582777675954ifu05upurs465omoth7,158294809668898cklbv6c5bou8e1fpu,1584676379094iktph45fb8imhg96bql,1584695125339vo5g7iqgfn01qmrd6s2,1584699661372vhmpp9dn9foo0eob722,15848421131551gg04ie8sitsd3f7467, - 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(db) -} else if (window.indexedDB) { +if (window.indexedDB) { CacheUtils.openIndexDB(db) } @@ -304,6 +296,7 @@ * @description 鐧诲綍绯荤粺, 鑾峰彇鐢ㄦ埛淇℃伅 */ getusermsg (username, password, isCloud = false) { + let shim = +sessionStorage.getItem('sys_time_shim') let param = { // func: 'webapi_login', UserName: username, @@ -313,15 +306,8 @@ login_id_address: sessionStorage.getItem('ipAddress') || '', kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), device_id: localStorage.getItem('SessionUid'), - timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + timestamp: moment().add(shim, 'seconds').format('YYYY-MM-DD HH:mm:ss'), appkey: window.GLOB.appkey || '' - } - - let sys_datetime = sessionStorage.getItem('sys_datetime') - let app_datetime = sessionStorage.getItem('app_datetime') - if (sys_datetime && app_datetime) { - let seconds = Math.floor((new Date().getTime() - app_datetime) / 1000) - param.timestamp = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss') } // Type: 'S' 鏃� @@ -363,7 +349,6 @@ delCacheConfig (type = '') { let date = moment().subtract(7, 'days').format('YYYY-MM-DD') - CacheUtils.delWebSqlCacheConfig(date, type) CacheUtils.delIndexDBCacheConfig(date, type) } @@ -372,26 +357,12 @@ let date = moment().format('YYYY-MM-DD') let _data = data ? JSON.stringify(data) : '' - CacheUtils.writeCacheInWebSql([menuid, date, _data]) CacheUtils.writeCacheInIndexDB({menuid, CreateDate: date, LongParam: _data}) } getLCacheConfig (menuid) { return new Promise((resolve, reject) => { - if (window.GLOB.WebSql) { - CacheUtils.getWebSqlCacheConfig(menuid).then(res => { - if (res && res.LongParam) { - let _data = JSON.parse(res.LongParam) - if (_data.length === 0) { - resolve() - } else { - resolve(_data) - } - } else { - resolve() - } - }) - } else if (window.GLOB.IndexDB) { + if (window.GLOB.IndexDB) { CacheUtils.getIndexDBCacheConfig(menuid).then(res => { if (res && res.LongParam) { let _data = JSON.parse(res.LongParam) @@ -411,184 +382,101 @@ } /** - * @description 鑾峰彇绯荤粺鐗堟湰淇℃伅锛屽惎鐢ㄦ垨鏇存柊websql + * @description 鑾峰彇绯荤粺鐗堟湰淇℃伅 */ getAppVersion (reload) { - if (!window.GLOB.WebSql && !window.GLOB.IndexDB) { + if (!window.GLOB.IndexDB) { return Promise.reject() } - let curTime = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - let sys_datetime = sessionStorage.getItem('sys_datetime') - let app_datetime = sessionStorage.getItem('app_datetime') - if (sys_datetime && app_datetime) { - let seconds = Math.floor((new Date().getTime() - app_datetime) / 1000) - 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 - } - } + let shim = +sessionStorage.getItem('sys_time_shim') + let curTime = moment().add(shim, 'seconds').format('YYYY-MM-DD HH:mm:ss') + '.000' - if (window.GLOB.WebSql) { - return new Promise((resolve, reject) => { - CacheUtils.getWebSqlVersion().then(msg => { - let param = { - func: 's_get_app_version', - modifydate: msg.createDate - } + return new Promise((resolve, reject) => { + CacheUtils.getIndexDBVersion().then(msg => { + let param = { + func: 's_get_app_version', + modifydate: msg.createDate + } - param.TypeCharOne = '' - param.typename = '' + param.TypeCharOne = '' + param.typename = '' - if (!msg.createDate && !msg.menuids) { - CacheUtils.updateWebSqlversion('1.00', curTime) - resolve() - return - } else if (!msg.createDate || reload === true) { - param.modifydate = curTime + if (!msg.createDate && !msg.menuids) { + CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) + resolve() + return + } else if (!msg.createDate || reload === true) { + 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) - } 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 => { - if (!res.status) { - reject() - return - } - - let list = res.menu_data || [] - - if (res.menu_del) { - list.push(...res.menu_del) - } - - list = list.map(mid => mid.menuid) - - if (typeof(reload) === 'string' && !list.includes(reload)) { - list.push(reload) - } - - if (list.length > 0) { - let clear = false - list.forEach(mid => { - if (systemMenuKeys.indexOf(mid) > -1) { - clear = true - } - }) - if (clear) { - list = '' - } else { - list = list.map(mid => `'${mid}'`).join(',') - } - CacheUtils.delWebSqlConfig(list) - } - - CacheUtils.updateWebSqlversion(res.app_version || '1.00', curTime) - - resolve() - }) - }, () => { - reject() - }) - }) - } else { - return new Promise((resolve, reject) => { - CacheUtils.getIndexDBVersion().then(msg => { - let param = { - func: 's_get_app_version', - modifydate: msg.createDate } - param.TypeCharOne = '' - param.typename = '' + localStorage.setItem(db, curTime.substr(0, 10)) + } - if (!msg.createDate && !msg.menuids) { - CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) - resolve() + this.getSystemConfig(param).then(res => { + if (!res.status) { + reject() return - } else if (!msg.createDate || reload === true) { - 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 => { - if (!res.status) { - reject() - return - } - - let list = res.menu_data || [] + let list = res.menu_data || [] - if (res.menu_del) { - list.push(...res.menu_del) - } + if (res.menu_del) { + list.push(...res.menu_del) + } - list = list.map(mid => mid.menuid) + list = list.map(mid => mid.menuid) - if (typeof(reload) === 'string' && !list.includes(reload)) { - list.push(reload) - } + if (typeof(reload) === 'string' && !list.includes(reload)) { + list.push(reload) + } - if (list.length > 0) { - let clear = false - list.forEach(mid => { - if (systemMenuKeys.indexOf(mid) > -1) { - clear = true - } - }) - if (clear) { - list = '' + if (list.length > 0) { + let clear = false + let _appkey = window.GLOB.appkey.substr(-10) + let reg = new RegExp(_appkey + '$', 'ig') + + list.forEach(mid => { + if (reg.test(mid)) { + clear = true } - CacheUtils.delIndexDBConfig(list) + }) + if (clear) { + list = '' } + CacheUtils.delIndexDBConfig(list) + } - CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) - - resolve() - }) - }, () => { - reject() + CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) + + resolve() }) + }, () => { + reject() }) - } + }) } /** * @description 鏇存柊绯荤粺鐗堟湰淇℃伅锛屾竻绌洪厤缃俊鎭� */ updateAppVersion () { - CacheUtils.delWebSqlConfig() - CacheUtils.updateWebSqlversion() CacheUtils.delIndexDBConfig() CacheUtils.updateIndexDBversion() - CacheUtils.clearFuncs() + // CacheUtils.clearFuncs() } /** * @description 鍒犻櫎鏌愪釜鑿滃崟閰嶇疆淇℃伅 */ deleteMenuStorage (menuId) { - if (window.GLOB.IndexDB) { - let key = menuId + (sessionStorage.getItem('UserID') || '') - return CacheUtils.delMenuIndexDBConfig(key) - } else { - return CacheUtils.delMenuWebSqlConfig(menuId) - } + CacheUtils.delIndexDBConfig(menuId) } /** @@ -672,7 +560,7 @@ } /** - * @description 鑾峰彇绯荤粺閰嶇疆锛屽彇鍊间紭鍏堢瓑绾ebsql銆佺紦瀛樸�佹湇鍔″櫒 + * @description 鑾峰彇绯荤粺閰嶇疆锛屽彇鍊间紭鍏堢瓑绾ndexDB銆佺紦瀛樸�佹湇鍔″櫒 */ getCacheConfig (param) { param.userid = sessionStorage.getItem('UserID') || '' @@ -696,36 +584,11 @@ } } - let _param = JSON.parse(JSON.stringify(param)) // 缂撳瓨鏍¢獙锛屽幓闄ゆ椂闂村拰鍔犲瘑瀛楃 - delete _param.timestamp - delete _param.secretkey - delete _param.open_key - _param = JSON.stringify(_param) - _param = md5(_param) + let key = md5(param.MenuID + param.userid) - if (window.GLOB.WebSql) { + if (window.GLOB.IndexDB) { return new Promise(resolve => { - CacheUtils.getWebSqlMenuConfig(param.MenuID, param.userid).then(res => { - resolve(res) - }, () => { - param = this.encryptParam(param) - axios({ - url: `${url}${param.func ? '/' + param.func : ''}`, - method: 'post', - data: param - }).then(res => { - if (res.status && window.GLOB.WebSql) { - CacheUtils.writeInWebSql([param.MenuID, param.userid, res.open_edition, res.web_edition, res.LongParam, res.LongParamUser]) - } else if (res.status) { - window.GLOB.CacheMap.set(_param, res) - } - resolve(res) - }) - }) - }) - } else if (window.GLOB.IndexDB) { - return new Promise(resolve => { - CacheUtils.getIndexDBMenuConfig(param.MenuID, param.userid).then(res => { + CacheUtils.getIndexDBMenuConfig(key).then(res => { resolve(res) }, () => { param = this.encryptParam(param) @@ -739,18 +602,18 @@ ...res, userid: param.userid, menuid: param.MenuID, - id: param.MenuID + param.userid + id: key } CacheUtils.writeInIndexDB(msg) } else if (res.status) { - window.GLOB.CacheMap.set(_param, res) + window.GLOB.CacheMap.set(key, res) } resolve(res) }) }) }) - } else if (window.GLOB.CacheMap.has(_param)) { - return Promise.resolve(window.GLOB.CacheMap.get(_param)) + } else if (window.GLOB.CacheMap.has(key)) { + return Promise.resolve(window.GLOB.CacheMap.get(key)) } else { param = this.encryptParam(param) @@ -761,7 +624,7 @@ data: param }).then(res => { if (res.status) { - window.GLOB.CacheMap.set(_param, res) + window.GLOB.CacheMap.set(key, res) } resolve(res) }) @@ -780,16 +643,8 @@ param.appkey = window.GLOB.appkey || '' let _param = md5(JSON.stringify(param)) - - if (window.GLOB.WebSql) { - return new Promise(resolve => { - CacheUtils.getWebSqlMenuConfig(param.MenuID, param.userid).then(res => { - resolve(res) - }, () => { - resolve({ ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false }) - }) - }) - } else if (window.GLOB.CacheMap.has(_param)) { + + if (window.GLOB.CacheMap.has(_param)) { return Promise.resolve(window.GLOB.CacheMap.get(_param)) } else { return Promise.resolve({ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false}) @@ -1078,57 +933,6 @@ } /** - * @description 瀵煎嚭Excel锛屽悗鍙扮敓鎴愭枃浠� - */ - // getExcelOut (param, name) { - // param.userid = sessionStorage.getItem('UserID') - // param.lang = sessionStorage.getItem('lang') || '' - // param.SessionUid = localStorage.getItem('SessionUid') || '' - // param.LoginUID = sessionStorage.getItem('LoginUID') || '' - // param.appkey = window.GLOB.appkey || '' - - // return new Promise(resolve => { - // axios({ - // url: '/webapi/doexcel', - // responseType: 'blob', - // method: 'post', - // data: param - // }).then(res => { - // try { - // const blob = new Blob([res]) - - // if (res.type === 'application/json') { - // const reader = new FileReader() - // reader.onload = e => resolve(JSON.parse(e.target.result)) - // reader.readAsText(blob) - // } else { - // if ('download' in document.createElement('a')) { // 闈濱E涓嬭浇 - // const elink = document.createElement('a') - // elink.download = name - // elink.style.display = 'none' - // elink.href = URL.createObjectURL(blob) - // document.body.appendChild(elink) - // elink.click() - // URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄 - // document.body.removeChild(elink) - // } else { // IE10+涓嬭浇 - // navigator.msSaveBlob(blob, name) - // } - // resolve() - // } - // } catch (e) { - // resolve({ - // ErrCode: 'E', - // ErrMesg: '鏂囦欢瑙f瀽閿欒', - // message: '', - // status: false - // }) - // } - // }) - // }) - // } - - /** * @description 涓婁紶base64 * @param {String} base64 base64鍥剧墖缂栫爜 */ @@ -1240,17 +1044,6 @@ data: data }) } - - // /** - // * @description 鏂囦欢涓婁紶 - // */ - // getFileUpload (param) { - // return axios({ - // url: '/zh-CN/Home/Upload', - // method: 'post', - // data: param - // }) - // } } export default new Api() \ No newline at end of file diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss index 0bd4ba1..26c8c80 100644 --- a/src/assets/css/viewstyle.scss +++ b/src/assets/css/viewstyle.scss @@ -312,17 +312,7 @@ .system-color { color: $color6; } - - .ant-timeline.system { - .ant-timeline-item-tail { - border-color: $color2; - } - } - .mk-time-line-wrap.system { - .mk-timeline-item-tail { - border-color: $color2; - } - } + .custom-tab-form-box .mk-normal-form-title.mkbtn { .form-title { color: $color6; diff --git a/src/components/breadview/index.jsx b/src/components/breadview/index.jsx index 7158fbb..b1f59ca 100644 --- a/src/components/breadview/index.jsx +++ b/src/components/breadview/index.jsx @@ -87,20 +87,20 @@ selectcomponent = (view) => { // 鏍规嵁tab椤典腑鑿滃崟淇℃伅锛岄�夋嫨鎵�闇�鐨勭粍浠� - if (view.type === 'Home') { - return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) - } else if (view.type === 'CommonTable') { - return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) - } else if (view.type === 'BaseTable') { + if (view.type === 'BaseTable') { return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) } else if (view.type === 'CustomPage') { return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) + } else if (view.type === 'Home') { + return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) + } else if (view.type === 'RolePermission') { + return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) + } else if (view.type === 'CommonTable') { + return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) } else if (view.type === 'TreePage') { return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) } else if (view.type === 'CalendarPage') { return (<CalendarPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) - } else if (view.type === 'RolePermission') { - return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) } else if (view.type === 'FormTab') { return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) } else if (view.type === 'iframe') { diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index cfbbe05..94e445b 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -33,7 +33,6 @@ userName: '', fullName: '', logourl: window.GLOB.mainlogo, - appVersion: window.GLOB.appVersion, loginVisible: false, loginLoading: false, avatar: Utils.getrealurl(sessionStorage.getItem('avatar')), @@ -288,8 +287,6 @@ loginVisible: true }) } else { - sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id')) - sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM')) sessionStorage.setItem('isEditState', 'true') this.props.modifyMainMenu(null) @@ -332,8 +329,6 @@ sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '') sessionStorage.setItem('cloudRole_id', res.role_id || '') - sessionStorage.setItem('role_id', res.role_id || '') - sessionStorage.setItem('dataM', res.dataM ? 'true' : '') sessionStorage.setItem('isEditState', 'true') if (param.remember) { @@ -513,7 +508,7 @@ content: '閲嶆柊鍔犺浇搴旂敤淇℃伅', onOk() { return new Promise(resolve => { - if (!window.GLOB.WebSql && !window.GLOB.IndexDB) { + if (!window.GLOB.IndexDB) { notification.warning({ top: 92, message: '鏇存柊澶辫触锛岃鍒锋柊椤甸潰閲嶈瘯锛�', @@ -540,7 +535,7 @@ about = () => { Modal.success({ - title: '绯荤粺鐗堟湰v' + this.state.appVersion + title: '绯荤粺鐗堟湰v' + window.GLOB.appVersion }) } @@ -552,7 +547,7 @@ render () { const { mainMenu, collapse } = this.props - const { thdMenuList, searchkey, debug, menulist, appVersion } = this.state + const { thdMenuList, searchkey, debug, menulist } = this.state const navBar = window.GLOB.navBar const menu = ( @@ -571,7 +566,7 @@ <Menu.Item key="verup" onClick={this.verup}> 椤甸潰鏇存柊 </Menu.Item> - {appVersion ? <Menu.Item key="version" onClick={this.about}> + {window.GLOB.appVersion ? <Menu.Item key="version" onClick={this.about}> 鍏充簬 </Menu.Item> : null} <Menu.Item key="logout" onClick={this.logout}>閫�鍑�</Menu.Item> diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index eb177a9..cae1d70 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -104,6 +104,12 @@ if (!fieldMap.has(key)) return let supItem = fieldMap.get(key) + let supval = supItem.initval + + if (supItem.initval && supItem.type !== 'checkbox' && JSON.stringify(supItem.initval) === '[]') { + supval = '' + } + let fields = [] controlFields[key].forEach(item => { if (!fieldMap.has(item.field)) return @@ -117,15 +123,16 @@ } else if (supItem.hidden) { cell.hidden = true } else if (supItem.type === 'checkbox') { - let vals = [...supItem.initval, ...item.values] + let vals = [...supval, ...item.values] if (vals.length === new Set(vals).size) { cell.hidden = true } } else if (item.notNull) { - cell.hidden = !supItem.initval || JSON.stringify(supItem.initval) === '[]' - } else if (!item.values.includes(supItem.initval)) { + cell.hidden = !supval + } else if (!item.values.includes(supval)) { cell.hidden = true } + fieldMap.set(item.field, cell) fields.push(item) @@ -179,6 +186,10 @@ let reset = (current) => { let val = this.record[current.field] + if (val && current.type !== 'checkbox' && JSON.stringify(val) === '[]') { + val = '' + } + current.controlFields.forEach(cell => { let m = map.get(cell.field) @@ -192,7 +203,7 @@ m.hidden = true } } else if (cell.notNull) { - m.hidden = !val || JSON.stringify(val) === '[]' + m.hidden = !val } else { m.hidden = !cell.values.includes(val) } diff --git a/src/index.js b/src/index.js index d9eb39e..b4541b2 100644 --- a/src/index.js +++ b/src/index.js @@ -45,8 +45,6 @@ } sessionStorage.removeItem('isEditState') -sessionStorage.setItem('role_id', sessionStorage.getItem('localRole_id') || '') -sessionStorage.setItem('dataM', sessionStorage.getItem('localDataM') || '') // 鏂扮郴缁熸枃浠剁疆浜巃dmin涓� ../options.json , { cache: 'no-cache'} diff --git a/src/locales/en-US/main.js b/src/locales/en-US/main.js index 1b18f24..c979dee 100644 --- a/src/locales/en-US/main.js +++ b/src/locales/en-US/main.js @@ -6,37 +6,11 @@ 'main.return': 'Return', 'main.close': 'Close', 'main.cancel': 'Cancel', - 'main.revert.default': 'Restore default Settings', - 'main.copy.success': 'Copy success', - 'main.pagination.of': 'of', - 'main.pagination.items': 'items', - 'main.page.settingerror': '椤甸潰閰嶇疆閿欒锛�', - 'main.datasource.settingerror': '鏁版嵁婧愰厤缃敊璇紒', - 'main.action.settingerror': 'Button setting error!', 'main.action.confirm.tip': 'Do you want to execute?', 'main.action.confirm.success': 'Execute successfully!', 'main.action.confirm.selectline': 'Please select a line!', 'main.action.confirm.selectSingleLine': 'Please select a single row of data!', - 'main.action.primarykey.required': 'Primary key not set!', - 'main.action.primarykey.repetition': 'There are multiple primary keys!', - 'main.action.primarykey.repetitionbid': 'There are multiple BID!', 'main.view.unenabled': '鎶辨瓑锛屾偍璁块棶鐨勯〉闈㈡湭鍚敤锛岃鑱旂郴绠$悊鍛樸��', - 'main.excel.line': 'line', - 'main.excel.column': 'column', - 'main.excel.includekey': ' Contain keywords ', - 'main.excel.content.emptyerror': '鍐呭涓嶅彲涓虹┖', - 'main.excel.content.typeerror': '鍐呭搴斾负鏁板��', - 'main.excel.content.interror': '鍐呭搴斾负鏁存暟', - 'main.excel.content.floaterror': '鍐呭搴斾负娴偣鏁�', - 'main.excel.content.floatIntover': '鏁存暟浣嶈秴鍑鸿寖鍥�', - 'main.excel.content.floatPointover': '灏忔暟浣嶈秴鍑鸿寖鍥�', - 'main.excel.content.date.over': '鏃堕棿涓鸿礋鍊兼垨澶ぇ', - 'main.excel.content.date.formatError': '鏃堕棿鏍煎紡閿欒', - 'main.excel.content.maxlimit': '鍐呭瓒呴暱', - 'main.excel.content.limitmin': '灏忎簬鏈�灏忓��', - 'main.excel.content.limitmax': '澶т簬鏈�澶у��', - 'main.form.link.error': '鑱斿姩鑿滃崟璁剧疆閿欒锛�', - 'main.form.picture.check': '鏌ョ湅鍥剧墖', 'main.role.title': 'The role list', 'form.required.input': 'Please enter the ', 'form.required.select': 'Please select a ' diff --git a/src/locales/zh-CN/main.js b/src/locales/zh-CN/main.js index cf33d24..5fc8412 100644 --- a/src/locales/zh-CN/main.js +++ b/src/locales/zh-CN/main.js @@ -6,37 +6,11 @@ 'main.return': '杩斿洖', 'main.close': '鍏抽棴', 'main.cancel': '鍙栨秷', - 'main.revert.default': '鎭㈠榛樿璁剧疆', - 'main.copy.success': '澶嶅埗鎴愬姛', - 'main.pagination.of': '鍏�', - 'main.pagination.items': '鏉�', - 'main.page.settingerror': '椤甸潰閰嶇疆閿欒锛�', - 'main.datasource.settingerror': '鏁版嵁婧愰厤缃敊璇紒', - 'main.action.settingerror': '鎸夐挳璁剧疆閿欒锛�', 'main.action.confirm.tip': '纭畾瑕佹墽琛屽悧?', 'main.action.confirm.success': '鎵ц鎴愬姛锛�', 'main.action.confirm.selectline': '璇烽�夋嫨琛岋紒', 'main.action.confirm.selectSingleLine': '璇烽�夋嫨鍗曡鏁版嵁锛�', - 'main.action.primarykey.required': '鏈缃富閿紒', - 'main.action.primarykey.repetition': '瀛樺湪澶氫釜涓婚敭锛�', - 'main.action.primarykey.repetitionbid': '瀛樺湪澶氫釜BID锛�', 'main.view.unenabled': '鎶辨瓑锛屾偍璁块棶鐨勯〉闈㈡湭鍚敤锛岃鑱旂郴绠$悊鍛樸��', - 'main.excel.line': '琛�', - 'main.excel.column': '鍒�', - 'main.excel.includekey': '鍚湁鍏抽敭瀛�', - 'main.excel.content.emptyerror': '鍐呭涓嶅彲涓虹┖', - 'main.excel.content.typeerror': '鍐呭搴斾负鏁板��', - 'main.excel.content.interror': '鍐呭搴斾负鏁存暟', - 'main.excel.content.floaterror': '鍐呭搴斾负娴偣鏁�', - 'main.excel.content.floatIntover': '鏁存暟浣嶈秴鍑鸿寖鍥�', - 'main.excel.content.floatPointover': '灏忔暟浣嶈秴鍑鸿寖鍥�', - 'main.excel.content.date.over': '鏃堕棿涓鸿礋鍊兼垨澶ぇ', - 'main.excel.content.date.formatError': '鏃堕棿鏍煎紡閿欒', - 'main.excel.content.maxlimit': '鍐呭瓒呴暱', - 'main.excel.content.limitmin': '灏忎簬鏈�灏忓��', - 'main.excel.content.limitmax': '澶т簬鏈�澶у��', - 'main.form.link.error': '鑱斿姩鑿滃崟璁剧疆閿欒锛�', - 'main.form.picture.check': '鏌ョ湅鍥剧墖', 'main.role.title': '瑙掕壊鍒楄〃', 'form.required.input': '璇疯緭鍏�', 'form.required.select': '璇烽�夋嫨' diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index d495918..9edccef 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -131,10 +131,15 @@ if (card.wrap.datatype === 'static') { card.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } } else if (cell.datatype === 'dynamic' && cell.field) { card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) @@ -162,10 +167,15 @@ card.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } } else if (cell.datatype === 'dynamic' && cell.field && !columns.includes(cell.field)) { card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) @@ -275,6 +285,19 @@ } } + if (_card.wrap.position === 'fixed') { + if (_card.wrap.top && _card.wrap.bottom && _card.wrap.top.indexOf('vh') > -1 && _card.wrap.bottom.indexOf('vh') > -1) { + if (parseFloat(_card.wrap.top) + parseFloat(_card.wrap.bottom) >= 100) { + message.warning('鍏冪礌璺濅笂璺濅笅涔嬪拰瓒呭嚭100%锛屽彲鑳藉鑷村厓绱犳棤娉曟樉绀恒��') + } + } + if (_card.wrap.left && _card.wrap.right && _card.wrap.left.indexOf('vw') > -1 && _card.wrap.right.indexOf('vw') > -1) { + if (parseFloat(_card.wrap.left) + parseFloat(_card.wrap.right) >= 100) { + message.warning('鍏冪礌璺濆乏璺濆彸涔嬪拰瓒呭嚭100%锛屽彲鑳藉鑷村厓绱犳棤娉曟樉绀恒��') + } + } + } + this.updateComponent(_card) } diff --git a/src/menu/components/card/balcony/index.scss b/src/menu/components/card/balcony/index.scss index 3aaefbb..1108b2c 100644 --- a/src/menu/components/card/balcony/index.scss +++ b/src/menu/components/card/balcony/index.scss @@ -7,6 +7,7 @@ background-size: cover; min-height: 30px; display: flex; + overflow: hidden; .check-all { width: 70px; diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 9459118..109dc08 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -283,7 +283,7 @@ * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭� */ handleAction = (card) => { - const { cards } = this.props + const { cards, side } = this.props let usefulFields = sessionStorage.getItem('permFuncField') if (usefulFields) { @@ -322,11 +322,11 @@ }) } else { let anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, cards.uuid) || [] - + this.setState({ actvisible: true, card: card, - formlist: getActionForm(card, functip, cards, usefulFields, modules, anchors) + formlist: getActionForm(card, functip, cards, usefulFields, modules, anchors, side) }) } } @@ -706,6 +706,7 @@ return <VerifyCard card={card} config={cards} + side={side || ''} columns={side === 'sub' ? cards.subColumns : cards.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} /> diff --git a/src/menu/components/card/cardsimplecomponent/node-wrap/index.jsx b/src/menu/components/card/cardsimplecomponent/node-wrap/index.jsx index 1b1c12f..52d1867 100644 --- a/src/menu/components/card/cardsimplecomponent/node-wrap/index.jsx +++ b/src/menu/components/card/cardsimplecomponent/node-wrap/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Modal } from 'antd' -import { MoreOutlined } from '@ant-design/icons' +import { EditOutlined } from '@ant-design/icons' import MenusForm from './menus' @@ -48,12 +48,12 @@ return ( <> - <MoreOutlined style={{color: '#1890ff'}} title="鑺傜偣缁�" onClick={this.trigger}/> + <EditOutlined style={{color: '#1890ff'}} title="鑺傜偣缁�" onClick={this.trigger}/> <Modal title="鑺傜偣缁�" wrapClassName="nodes-field-modal" visible={visible} - width={950} + width={1100} maskClosable={false} onOk={this.submit} onCancel={() => { this.setState({ visible: false })}} diff --git a/src/menu/components/card/cardsimplecomponent/node-wrap/menus/columnform/index.jsx b/src/menu/components/card/cardsimplecomponent/node-wrap/menus/columnform/index.jsx index 8b50c97..b9a2d59 100644 --- a/src/menu/components/card/cardsimplecomponent/node-wrap/menus/columnform/index.jsx +++ b/src/menu/components/card/cardsimplecomponent/node-wrap/menus/columnform/index.jsx @@ -40,25 +40,25 @@ const formItemLayout = { labelCol: { xs: { span: 24 }, - sm: { span: 8 } + sm: { span: 7 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 16 } + sm: { span: 17 } } } return ( <Form {...formItemLayout} className="node-form"> <Row gutter={24}> - <Col span={6}> + <Col span={5}> <Form.Item label="鏍囪瘑"> {getFieldDecorator('sign', { initialValue: '' })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> - <Col span={8}> + <Col span={6}> <Form.Item label="棰滆壊"> {getFieldDecorator('color', { initialValue: '#e8e8e8', @@ -71,7 +71,7 @@ })(<ColorSketch />)} </Form.Item> </Col> - <Col span={7}> + <Col span={5}> <Form.Item label="鍥炬爣"> {getFieldDecorator('icon', { initialValue: '' @@ -80,7 +80,14 @@ )} </Form.Item> </Col> - <Col span={3} className="add"> + <Col span={6}> + <Form.Item label="杩炴帴绾�"> + {getFieldDecorator('linecolor', { + initialValue: '', + })(<ColorSketch allowClear/>)} + </Form.Item> + </Col> + <Col span={2} className="add"> <Button onClick={this.handleConfirm} type="primary" className="mk-green"> 娣诲姞 </Button> diff --git a/src/menu/components/card/cardsimplecomponent/node-wrap/menus/index.jsx b/src/menu/components/card/cardsimplecomponent/node-wrap/menus/index.jsx index 31a0452..5801b94 100644 --- a/src/menu/components/card/cardsimplecomponent/node-wrap/menus/index.jsx +++ b/src/menu/components/card/cardsimplecomponent/node-wrap/menus/index.jsx @@ -27,7 +27,7 @@ editable: true, unique: true, required: false, - width: '25%' + width: '20%' }, { title: '棰滆壊', @@ -35,7 +35,7 @@ inputType: 'color', editable: true, required: true, - width: '25%', + width: '20%', render: (text, record) => <span style={{display: 'inline-block', width: '40px', height: '25px', background: text}}></span> }, { @@ -44,8 +44,8 @@ inputType: 'icon', editable: true, required: false, - width: '25%', - render: (text, record) => record.icon ? <MkIcon type={record.icon}/> : '' + width: '20%', + render: (text, record) => record.icon ? <MkIcon style={{fontSize: '24px'}} type={record.icon}/> : '' }, { title: '杩炴帴绾�', @@ -54,9 +54,18 @@ editable: true, required: false, allowClear: true, - width: '25%', + width: '20%', render: (text, record) => text ? <span style={{display: 'inline-block', width: '40px', height: '25px', background: text}}></span> : null }, + { + title: '澶囨敞', + dataIndex: 'remark', + inputType: 'input', + editable: true, + unique: false, + required: false, + width: '20%' + } ] } diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 92c55a7..03d50c4 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -196,10 +196,15 @@ } card.action.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } }) @@ -207,10 +212,15 @@ let linkbtn = item.setting.linkbtn || '' item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -223,10 +233,15 @@ if (item.setting.type === 'multi' && appType !== 'mob') { item.backElements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -486,7 +501,7 @@ res.$cardType = 'extendCard' res.setting.width = res.setting.width || 6 - let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'] + let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton', 'form'] let elements = [] res.elements && res.elements.forEach(cell => { @@ -617,7 +632,7 @@ {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} </div> <div style={{clear: 'both'}}></div> - {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={85} size="small" showTotal={total => `鍏� ${total} 鏉} pageSize={20} defaultCurrent={1}/> : null} + {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={45} size="small" showTotal={total => `1-10 鍏� ${total} 鏉} showSizeChanger={true} pageSize={10} defaultCurrent={1}/> : null} {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType === 'mob' ? <MobPagination /> : null} {card.wrap.pagestyle === 'more' && card.setting.laypage === 'true' ? <div className="mk-more">鏌ョ湅鏇村<DownOutlined/></div> : null} <div className="component-name"> diff --git a/src/menu/components/card/data-card/index.scss b/src/menu/components/card/data-card/index.scss index 3ccba56..8c298e3 100644 --- a/src/menu/components/card/data-card/index.scss +++ b/src/menu/components/card/data-card/index.scss @@ -51,16 +51,13 @@ right: -30px; font-size: 16px; } + .page-card { + line-height: 55px; + } } .ant-pagination { float: right; margin: 10px; - } - - .model-menu-action-list { - .page-card { - line-height: 55px; - } } .normal-pagination { .am-button::before { diff --git a/src/menu/components/card/double-data-card/index.jsx b/src/menu/components/card/double-data-card/index.jsx index 5e709c6..25728f6 100644 --- a/src/menu/components/card/double-data-card/index.jsx +++ b/src/menu/components/card/double-data-card/index.jsx @@ -191,10 +191,15 @@ } card.action.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } }) @@ -202,10 +207,15 @@ let linkbtn = item.setting.linkbtn || '' item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -217,10 +227,15 @@ item.backElements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -467,7 +482,7 @@ res.$cardType = 'extendCard' res.setting.width = res.setting.width || 6 - let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'] + let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton', 'form'] let elements = [] res.elements && res.elements.forEach(cell => { @@ -612,7 +627,7 @@ })} </div> <div style={{clear: 'both'}}></div> - {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={85} size="small" showTotal={total => `鍏� ${total} 鏉} pageSize={20} defaultCurrent={1}/> : null} + {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={45} size="small" showTotal={total => `1-10 鍏� ${total} 鏉} showSizeChanger={true} pageSize={10} defaultCurrent={1}/> : null} {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType === 'mob' ? <MobPagination /> : null} {card.wrap.pagestyle === 'more' && card.setting.laypage === 'true' ? <div className="mk-more">鏌ョ湅鏇村<DownOutlined/></div> : null} <div className="component-name"> diff --git a/src/menu/components/card/doublecardcomponent/index.jsx b/src/menu/components/card/doublecardcomponent/index.jsx index f6d1544..c5853a4 100644 --- a/src/menu/components/card/doublecardcomponent/index.jsx +++ b/src/menu/components/card/doublecardcomponent/index.jsx @@ -278,7 +278,7 @@ <NormalForm title={'寰幆鍗$墖璁剧疆'} width={950} update={(res) => this.updateSetting(res)} getForms={this.getSettingForms}> <EditOutlined className="edit" title="缂栬緫"/> </NormalForm> - <CopyComponent type="cardcell" card={card}/> + <CopyComponent type="cardcell" card={{...card, backElements: []}}/> <PasteController options={['action', 'customCardElement']} updateConfig={(element, resolve) => this.paste(element, resolve, 'main')} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.changeStyle()} /> </div> @@ -298,7 +298,7 @@ <NormalForm title={'寰幆瀛愬崱鐗囪缃�'} width={950} update={(res) => this.updateSetting(res, 'sub')} getForms={this.getBackSettingForms}> <EditOutlined className="edit" title="缂栬緫"/> </NormalForm> - <CopyComponent type="cardcell" card={card}/> + <CopyComponent type="cardcell" card={{...card, elements: card.backElements, backElements: []}}/> <PasteController options={['action', 'customCardElement']} updateConfig={(element, resolve) => this.paste(element, resolve, 'sub')} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.changeStyle('sub')} /> </div> diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx index 5508f0a..e5931fd 100644 --- a/src/menu/components/card/prop-card/index.jsx +++ b/src/menu/components/card/prop-card/index.jsx @@ -167,10 +167,15 @@ item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -183,10 +188,15 @@ if (item.setting.type === 'multi' && appType !== 'mob') { item.backElements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -226,10 +236,15 @@ let linkbtn = item.setting.linkbtn || '' item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -242,10 +257,15 @@ if (item.setting.type === 'multi' && appType !== 'mob') { item.backElements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -381,7 +401,7 @@ res.setting = res.setting || {} res.setting.width = res.setting.width || 6 - let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'] + let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton', 'form'] let elements = [] res.elements && res.elements.forEach(cell => { diff --git a/src/menu/components/card/table-card/index.jsx b/src/menu/components/card/table-card/index.jsx index 3c014f4..f856cb6 100644 --- a/src/menu/components/card/table-card/index.jsx +++ b/src/menu/components/card/table-card/index.jsx @@ -194,10 +194,15 @@ let linkbtn = item.setting.linkbtn || '' item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (linkbtn && linkbtn === cell.uuid) { linkbtn = '' @@ -359,7 +364,7 @@ res.setting = res.setting || {} res.setting.width = res.setting.width || 6 - let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'] + let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton', 'form'] let elements = [] res.elements && res.elements.forEach(cell => { diff --git a/src/menu/components/carousel/data-card/index.jsx b/src/menu/components/carousel/data-card/index.jsx index 5a1eee0..cc1938a 100644 --- a/src/menu/components/carousel/data-card/index.jsx +++ b/src/menu/components/carousel/data-card/index.jsx @@ -150,10 +150,15 @@ card.subcards.forEach((item, i) => { item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } } else if (cell.datatype === 'dynamic' && cell.field && !columns.includes(cell.field)) { card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) diff --git a/src/menu/components/carousel/prop-card/index.jsx b/src/menu/components/carousel/prop-card/index.jsx index 9b25463..67e23af 100644 --- a/src/menu/components/carousel/prop-card/index.jsx +++ b/src/menu/components/carousel/prop-card/index.jsx @@ -137,10 +137,15 @@ card.subcards.forEach(item => { item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } } else if (cell.datatype === 'dynamic' && cell.field) { card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) @@ -169,10 +174,15 @@ card.subcards.forEach((item, i) => { item.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } } else if (cell.datatype === 'dynamic' && cell.field && !columns.includes(cell.field)) { card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx index 444a206..85d22a1 100644 --- a/src/menu/components/editor/braft-editor/index.jsx +++ b/src/menu/components/editor/braft-editor/index.jsx @@ -199,14 +199,14 @@ let style = {...card.style} return ( - <div className="menu-normal-editor-box" style={style} onClick={this.clickComponent} id={card.uuid}> + <div className={'menu-normal-editor-box ' + (card.wrap.firstTr || '')} style={style} onClick={this.clickComponent} id={card.uuid}> <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <NormalForm title="瀵屾枃鏈缃�" width={750} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> - <CopyComponent type="normaltable" card={card}/> + <CopyComponent type="editor" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> diff --git a/src/menu/components/editor/braft-editor/index.scss b/src/menu/components/editor/braft-editor/index.scss index 8830797..aa55923 100644 --- a/src/menu/components/editor/braft-editor/index.scss +++ b/src/menu/components/editor/braft-editor/index.scss @@ -25,6 +25,15 @@ color: #bcbcbc; } } +.menu-normal-editor-box.light { + .braft-content { + table { + tr:first-child { + background-color:#ffffff; + } + } + } +} .menu-normal-editor-box::after { display: block; content: ' '; diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx index 3c33098..c746b12 100644 --- a/src/menu/components/editor/braft-editor/options.jsx +++ b/src/menu/components/editor/braft-editor/options.jsx @@ -118,6 +118,18 @@ }, { type: 'radio', + field: 'firstTr', + label: '琛ㄦ牸棣栬', + initval: wrap.firstTr || 'deep', + tooltip: '瀵屾枃鏈腑table鐨勯琛岃儗鏅鑹层��', + required: false, + options: [ + {value: 'deep', label: '娣辫壊'}, + {value: 'light', label: '娴呰壊'}, + ] + }, + { + type: 'radio', field: 'permission', label: '鏉冮檺楠岃瘉', initval: wrap.permission || 'false', diff --git a/src/menu/components/form/dragtitle/card.jsx b/src/menu/components/form/dragtitle/card.jsx index c8b980c..a2eb77d 100644 --- a/src/menu/components/form/dragtitle/card.jsx +++ b/src/menu/components/form/dragtitle/card.jsx @@ -9,7 +9,7 @@ import './index.scss' const NormalForm = asyncIconComponent(() => import('@/components/normalform')) -const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) +const PasteForms = asyncIconComponent(() => import('@/menu/components/share/pasteforms')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) const Card = ({ id, card, sort, labelSize, active, moveCard, findCard, closeCard, selectCard, updateGroup, pasteForm }) => { @@ -51,6 +51,16 @@ const updateSetting = (res) => { let _card = fromJS(card).toJS() + let buttons = res.buttons + + delete res.buttons + + if (buttons) { + res.prevEnable = buttons.includes('prevEnable') ? 'true' : 'false' + res.subEnable = buttons.includes('subEnable') ? 'true' : 'false' + res.nextEnable = buttons.includes('nextEnable') ? 'true' : 'false' + } + if (res.prevEnable) { _card.prevButton.enable = res.prevEnable delete res.prevEnable @@ -80,7 +90,7 @@ <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="formgroup" card={card}/> - <PasteComponent options={['form', 'forms']} updateConfig={(res) => pasteForm(res, id)} /> + <PasteForms config={card} updateConfig={(res) => pasteForm(res, id)} /> <CloseOutlined className="close" type="close" onClick={close} /> </div> } trigger="hover"> diff --git a/src/menu/components/form/dragtitle/options.jsx b/src/menu/components/form/dragtitle/options.jsx index 81c4435..5ffecf1 100644 --- a/src/menu/components/form/dragtitle/options.jsx +++ b/src/menu/components/form/dragtitle/options.jsx @@ -19,6 +19,18 @@ }) } + let buttons = [] + + if (group.prevButton && group.prevButton.enable === 'true') { + buttons.push('prevEnable') + } + if (!group.subButton.enable || group.subButton.enable === 'true') { + buttons.push('subEnable') + } + if (group.nextButton && group.nextButton.enable === 'true') { + buttons.push('nextEnable') + } + const groupForm = [ { type: 'text', @@ -83,18 +95,32 @@ forbid: appType === 'mob' }, { - type: 'radio', - field: 'prevEnable', - label: '涓婁竴姝�', - initval: group.prevButton ? group.prevButton.enable || 'false' : 'false', - tooltip: '绗竴缁勪笉鏄剧ず銆傛敞锛氶櫎鍏抽棴鍔熻兘澶栥��', + type: 'checkbox', + field: 'buttons', + label: '鎸夐挳缁�', + initval: buttons, + tooltip: '涓婁竴姝ュ湪绗竴缁勪腑涓嶆樉绀猴紝璺宠繃鍦ㄦ渶鍚庝竴缁勪笉鏄剧ず锛屾敞锛氶櫎鍏抽棴鍔熻兘澶栥��', required: false, options: [ - {value: 'true', label: '鏄剧ず'}, - {value: 'false', label: '闅愯棌'}, + {value: 'prevEnable', label: '涓婁竴姝�'}, + {value: 'subEnable', label: '鎻愪氦'}, + {value: 'nextEnable', label: '璺宠繃'}, ], forbid: !group.prevButton }, + // { + // type: 'radio', + // field: 'prevEnable', + // label: '涓婁竴姝�', + // initval: group.prevButton ? group.prevButton.enable || 'false' : 'false', + // tooltip: '绗竴缁勪笉鏄剧ず銆傛敞锛氶櫎鍏抽棴鍔熻兘澶栥��', + // required: false, + // options: [ + // {value: 'true', label: '鏄剧ず'}, + // {value: 'false', label: '闅愯棌'}, + // ], + // forbid: !group.prevButton + // }, { type: 'radio', field: 'subEnable', @@ -104,21 +130,22 @@ options: [ {value: 'true', label: '鏄剧ず'}, {value: 'false', label: '闅愯棌'}, - ] - }, - { - type: 'radio', - field: 'nextEnable', - label: '璺宠繃', - initval: group.nextButton ? group.nextButton.enable || 'false' : 'false', - tooltip: '鏈�鍚庝竴缁勪笉鏄剧ず銆傛敞锛氶櫎鍏抽棴鍔熻兘澶栥��', - required: false, - options: [ - {value: 'true', label: '鏄剧ず'}, - {value: 'false', label: '闅愯棌'}, ], - forbid: !group.nextButton + forbid: !!group.prevButton }, + // { + // type: 'radio', + // field: 'nextEnable', + // label: '璺宠繃', + // initval: group.nextButton ? group.nextButton.enable || 'false' : 'false', + // tooltip: '鏈�鍚庝竴缁勪笉鏄剧ず銆傛敞锛氶櫎鍏抽棴鍔熻兘澶栥��', + // required: false, + // options: [ + // {value: 'true', label: '鏄剧ず'}, + // {value: 'false', label: '闅愯棌'}, + // ], + // forbid: !group.nextButton + // }, ] return groupForm diff --git a/src/menu/components/form/simple-form/index.jsx b/src/menu/components/form/simple-form/index.jsx index 2b1e483..049c02d 100644 --- a/src/menu/components/form/simple-form/index.jsx +++ b/src/menu/components/form/simple-form/index.jsx @@ -23,7 +23,7 @@ const FormAction = asyncComponent(() => import('../formaction')) const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) -const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) +const PasteForms = asyncIconComponent(() => import('@/menu/components/share/pasteforms')) const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) @@ -462,6 +462,8 @@ return } + window.GLOB.formId = res.uuid + if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true @@ -511,93 +513,43 @@ }) } - pasteForm = (res) => { + pasteForm = (forms, res) => { let _config = fromJS(this.state.card).toJS() + + _config.subcards[0].fields = forms if (res.subButton) { let that = this - _config.subcards[0].setting.focus = res.focus - _config.subcards[0].setting.cache = res.cache - _config.subcards[0].setting.align = res.align - _config.subcards[0].setting.enable = res.enable - _config.subcards[0].setting.verticalSpace = res.verticalSpace || '' - _config.wrap.focus = res.focus - _config.wrap.cache = res.cache - _config.wrap.align = res.align - _config.wrap.enable = res.enable - _config.wrap.verticalSpace = res.verticalSpace || '' - - _config.subcards[0].subButton = res.subButton + // _config.subcards[0].setting.focus = res.focus + // _config.subcards[0].setting.cache = res.cache + // _config.subcards[0].setting.align = res.align + // _config.subcards[0].setting.enable = res.enable + // _config.subcards[0].setting.verticalSpace = res.verticalSpace || '' + // _config.wrap.focus = res.focus + // _config.wrap.cache = res.cache + // _config.wrap.align = res.align + // _config.wrap.enable = res.enable + // _config.wrap.verticalSpace = res.verticalSpace || '' - _config.subcards[0].fields = res.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - confirm({ - content: '鏇挎崲琛ㄥ崟鍙婃寜閽厤缃紵', + content: '鏄惁鏇挎崲鎸夐挳閰嶇疆锛�', + okText: '鏄�', + cancelText: '鍚�', onOk() { + _config.subcards[0].subButton = res.subButton + that.updateComponent(_config) }, - onCancel() {} + onCancel() { + that.updateComponent(_config) + } }) - return - } else if (res.fields) { - if (_config.subcards[0].fields.length > 0) { - let that = this - _config.subcards[0].fields = res.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) + } else { + _config.subcards[0].fields = forms - confirm({ - title: '纭畾鏇挎崲琛ㄥ崟鍚楋紵', - content: '鍘熻〃鍗曞皢鍒犻櫎銆�', - onOk() { - that.updateComponent(_config) - }, - onCancel() {} - }) - } else { - _config.subcards[0].fields = res.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - - this.updateComponent(_config) - } - - return + this.updateComponent(_config) } - - let fieldrepet = false // 瀛楁閲嶅 - - _config.subcards[0].fields.forEach(item => { - if (res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) { - fieldrepet = true - } - }) - - if (fieldrepet) { - notification.warning({ - top: 92, - message: '瀛楁宸插瓨鍦紒', - duration: 10 - }) - return - } - _config.subcards[0].fields.push(res) - - this.updateComponent(_config) - - this.handleForm(res) - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) } getWrapForms = () => { @@ -606,6 +558,13 @@ updateWrap = (res) => { let _card = fromJS(this.state.card).toJS() + let buttons = res.buttons + + delete res.buttons + + res.enable = buttons.includes('enable') ? 'true' : 'false' + res.closeEnable = buttons.includes('closeEnable') ? 'true' : 'false' + _card.wrap = res if (res.datatype === 'static') { @@ -621,6 +580,8 @@ _card.subcards[0].setting.align = _card.wrap.align _card.subcards[0].setting.enable = _card.wrap.enable _card.subcards[0].setting.verticalSpace = _card.wrap.verticalSpace + + if (_card.wrap.closeEnable === 'true' && !_card.subcards[0].closeButton) { _card.subcards[0].closeButton = {label: '鍏抽棴', enable: 'true', type: 'close', style: {backgroundColor: '#ffffff', color: 'rgba(0,0,0,0.65)', borderColor: '#d9d9d9', borderWidth: '1px', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px', marginLeft: '10px'}} @@ -671,7 +632,7 @@ <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="simpleform" card={card}/> - <PasteComponent config={card} options={['form', 'forms', 'formgroup']} updateConfig={this.pasteForm} /> + <PasteForms config={card.subcards[0]} update={this.pasteForm} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> diff --git a/src/menu/components/form/simple-form/options.jsx b/src/menu/components/form/simple-form/options.jsx index 2197555..1ace5c6 100644 --- a/src/menu/components/form/simple-form/options.jsx +++ b/src/menu/components/form/simple-form/options.jsx @@ -45,6 +45,15 @@ } } + let buttons = [] + + if (!wrap.enable || wrap.enable === 'true') { + buttons.push('enable') + } + if (wrap.closeEnable === 'true') { + buttons.push('closeEnable') + } + const wrapForm = [ { type: 'text', @@ -135,28 +144,40 @@ forbid: appType === 'mob' }, { - type: 'radio', - field: 'enable', - label: '鎻愪氦', - initval: wrap.enable || 'true', - required: false, - options: [ - {value: 'true', label: '鏄剧ず'}, - {value: 'false', label: '闅愯棌'}, - ] - }, - { - type: 'radio', - field: 'closeEnable', - label: '鍏抽棴', - initval: wrap.closeEnable || 'false', + type: 'checkbox', + field: 'buttons', + label: '鎸夐挳缁�', + initval: buttons, tooltip: '绠$悊绯荤粺涓細鍏抽棴褰撳墠鏍囩锛屽瓙搴旂敤涓负杩斿洖涓婁竴椤点��', required: false, options: [ - {value: 'true', label: '鏄剧ず'}, - {value: 'false', label: '闅愯棌'}, - ] + {value: 'enable', label: '鎻愪氦'}, + {value: 'closeEnable', label: '鍏抽棴'}, + ], }, + // { + // type: 'radio', + // field: 'enable', + // label: '鎻愪氦', + // initval: wrap.enable || 'true', + // required: false, + // options: [ + // {value: 'true', label: '鏄剧ず'}, + // {value: 'false', label: '闅愯棌'}, + // ] + // }, + // { + // type: 'radio', + // field: 'closeEnable', + // label: '鍏抽棴', + // initval: wrap.closeEnable || 'false', + // tooltip: '绠$悊绯荤粺涓細鍏抽棴褰撳墠鏍囩锛屽瓙搴旂敤涓负杩斿洖涓婁竴椤点��', + // required: false, + // options: [ + // {value: 'true', label: '鏄剧ず'}, + // {value: 'false', label: '闅愯棌'}, + // ] + // }, { type: 'radio', field: 'formStyle', diff --git a/src/menu/components/form/step-form/index.jsx b/src/menu/components/form/step-form/index.jsx index 3f37ddf..71a2b3a 100644 --- a/src/menu/components/form/step-form/index.jsx +++ b/src/menu/components/form/step-form/index.jsx @@ -564,6 +564,8 @@ return } + window.GLOB.formId = res.uuid + if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true @@ -617,60 +619,29 @@ if (res.subtype === 'simpleform') { res = res.subcards[0] } - if (res.subButton) { - let card = fromJS(this.state.card).toJS() - res.uuid = Utils.getuuid() - res.sort = card.subcards.length + 1 + let card = fromJS(this.state.card).toJS() - res.fields.forEach(item => { - item.uuid = Utils.getuuid() - }) + res.uuid = Utils.getuuid() + res.sort = card.subcards.length + 1 - if (!res.prevButton) { - res.prevButton = {label: '涓婁竴姝�', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}} - } - if (!res.nextButton) { - res.nextButton = {label: '璺宠繃', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}} - } - - card.subcards.push(res) - - this.setState({ - group: res - }) - this.updateComponent(card) - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) - return - } - - let _config = fromJS(this.state.group).toJS() - let fieldrepet = false // 瀛楁閲嶅 - - _config.fields.forEach(item => { - if (res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) { - fieldrepet = true - } + res.fields.forEach(item => { + item.uuid = Utils.getuuid() }) - if (fieldrepet) { - notification.warning({ - top: 92, - message: '瀛楁宸插瓨鍦紒', - duration: 10 - }) - return + if (!res.prevButton) { + res.prevButton = {label: '涓婁竴姝�', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}} } - _config.fields.push(res) + if (!res.nextButton) { + res.nextButton = {label: '璺宠繃', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}} + } - this.updateGroup(_config) - - this.handleForm(res) + card.subcards.push(res) + + this.setState({ + group: res + }) + this.updateComponent(card) notification.success({ top: 92, @@ -721,58 +692,12 @@ }) } - parseForm = (g, res) => { - let _group = fromJS(g).toJS() - let _confirm = false - - if (res.copyType === 'form') { - let fieldrepet = false // 瀛楁閲嶅 - res.uuid = Utils.getuuid() - - _group.fields.forEach(item => { - if (res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) { - fieldrepet = true - } - }) - - if (fieldrepet) { - notification.warning({ - top: 92, - message: '瀛楁宸插瓨鍦紒', - duration: 10 - }) - return - } - _group.fields.push(res) - } else { - if (_group.fields.length > 0) { - _confirm = true - } - - _group.fields = res.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - } - - if (_confirm) { - let that = this - confirm({ - title: '纭畾鏇挎崲琛ㄥ崟鍚楋紵', - content: '鍘熻〃鍗曞皢鍒犻櫎銆�', - onOk() { - that.updateForms(_group) - }, - onCancel() {} - }) - } else { - this.updateForms(_group) - } - } - - updateForms = (_group) => { + parseForm = (g, forms) => { const { group } = this.state let card = fromJS(this.state.card).toJS() + let _group = fromJS(g).toJS() + + _group.fields = forms card.subcards = card.subcards.map(item => { if (item.uuid === _group.uuid) { @@ -819,7 +744,7 @@ <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="stepform" card={card}/> - <PasteComponent config={card} options={['form', 'formgroup', 'simpleform']} updateConfig={this.pasteForm} /> + <PasteComponent config={card} options={['formgroup', 'simpleform']} updateConfig={this.pasteForm} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index 65b84aa..0d1e4f1 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -569,6 +569,8 @@ return } + window.GLOB.formId = res.uuid + if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true @@ -622,56 +624,25 @@ if (res.subtype === 'simpleform') { res = res.subcards[0] } - if (res.subButton) { - let card = fromJS(this.state.card).toJS() - res.uuid = Utils.getuuid() - res.sort = card.subcards.length + 1 + let card = fromJS(this.state.card).toJS() - res.fields.forEach(item => { - item.uuid = Utils.getuuid() - }) + res.uuid = Utils.getuuid() + res.sort = card.subcards.length + 1 - delete res.prevButton - delete res.nextButton - - card.subcards.push(res) - - this.setState({ - group: res - }) - this.updateComponent(card) - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) - return - } - - let _config = fromJS(this.state.group).toJS() - let fieldrepet = false // 瀛楁閲嶅 - - _config.fields.forEach(item => { - if (res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) { - fieldrepet = true - } + res.fields.forEach(item => { + item.uuid = Utils.getuuid() }) - if (fieldrepet) { - notification.warning({ - top: 92, - message: '瀛楁宸插瓨鍦紒', - duration: 10 - }) - return - } - _config.fields.push(res) + delete res.prevButton + delete res.nextButton - this.updateGroup(_config) - - this.handleForm(res) + card.subcards.push(res) + + this.setState({ + group: res + }) + this.updateComponent(card) notification.success({ top: 92, @@ -722,58 +693,12 @@ }) } - parseForm = (g, res) => { - let _group = fromJS(g).toJS() - let _confirm = false - - if (res.copyType === 'form') { - let fieldrepet = false // 瀛楁閲嶅 - res.uuid = Utils.getuuid() - - _group.fields.forEach(item => { - if (res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) { - fieldrepet = true - } - }) - - if (fieldrepet) { - notification.warning({ - top: 92, - message: '瀛楁宸插瓨鍦紒', - duration: 10 - }) - return - } - _group.fields.push(res) - } else { - if (_group.fields.length > 0) { - _confirm = true - } - - _group.fields = res.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - } - - if (_confirm) { - let that = this - confirm({ - title: '纭畾鏇挎崲琛ㄥ崟鍚楋紵', - content: '鍘熻〃鍗曞皢鍒犻櫎銆�', - onOk() { - that.updateForms(_group) - }, - onCancel() {} - }) - } else { - this.updateForms(_group) - } - } - - updateForms = (_group) => { + parseForm = (g, forms) => { const { group } = this.state let card = fromJS(this.state.card).toJS() + let _group = fromJS(g).toJS() + + _group.fields = forms card.subcards = card.subcards.map(item => { if (item.uuid === _group.uuid) { @@ -820,7 +745,7 @@ <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="tabform" card={card}/> - <PasteComponent config={card} options={['form', 'formgroup', 'simpleform']} updateConfig={this.pasteForm} /> + <PasteComponent config={card} options={['formgroup', 'simpleform']} updateConfig={this.pasteForm} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> diff --git a/src/menu/components/group/paste/index.jsx b/src/menu/components/group/paste/index.jsx index 77f15d1..8db0190 100644 --- a/src/menu/components/group/paste/index.jsx +++ b/src/menu/components/group/paste/index.jsx @@ -20,7 +20,7 @@ pasteSubmit = () => { let appType = sessionStorage.getItem('appType') - let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox'] + let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'normaltable', 'tablecard', 'editor', 'line', 'bar', 'pie', 'scatter', 'sandbox'] let types = { login: '鐧诲綍', navbar: '瀵艰埅鏍�', @@ -53,7 +53,7 @@ return } - res = MenuUtils.resetComponentConfig(res) + res = MenuUtils.resetComponentConfig(res, appType) delete res.copyType diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 135daca..ae74c29 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -9,13 +9,13 @@ * @param {*} usefulFields 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� * @param {*} type 鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡 */ -export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = []) { +export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side) { let appType = sessionStorage.getItem('appType') let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview let printTemps = sessionStorage.getItem('printTemps') printTemps = printTemps ? JSON.parse(printTemps) : [] let setting = config.setting || {} - let columns = config.columns || [] + let columns = side === 'sub' && config.subColumns ? config.subColumns : (config.columns || []) let appMenus = [] let menulist = [] let type = '' @@ -158,6 +158,12 @@ { value: 'pay', text: '鏀粯' }, { value: 'custom', text: '閾炬帴' } ] + } else { + if (card.pageTemplate === 'print') { // 鍘熺被鍨嬫敮鎸� + pageTemps.unshift({ value: 'print', text: '鏍囩鎵撳嵃妯℃澘' }) + } else if (card.pageTemplate === 'billprintTemp') { // 鍘熺被鍨嬫敮鎸� + pageTemps.unshift({ value: 'billprintTemp', text: '鍗曟嵁鎵撳嵃妯℃澘' }) + } } if (type === 'chart' && appType !== 'mob') { @@ -535,7 +541,7 @@ key: 'execSuccess', label: '鎴愬姛鍚�', initVal: card.execSuccess || 'grid', - tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��', + tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��', required: true, options: [{ value: 'never', @@ -558,7 +564,7 @@ key: 'execError', label: '澶辫触鍚�', initVal: card.execError || 'never', - tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��', + tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��', required: true, options: [{ value: 'never', @@ -1194,6 +1200,12 @@ { value: 'custom', text: '鑷畾涔�' } ] + if (card.pageTemplate === 'print') { // 鍘熺被鍨嬫敮鎸� + pageTemps.unshift({ value: 'print', text: '鏍囩鎵撳嵃妯℃澘' }) + } else if (card.pageTemplate === 'billprintTemp') { // 鍘熺被鍨嬫敮鎸� + pageTemps.unshift({ value: 'billprintTemp', text: '鍗曟嵁鎵撳嵃妯℃澘' }) + } + let funTypes = [ { value: 'print', text: '鏍囩鎵撳嵃' }, { value: 'refund', text: '閫�娆�' }, @@ -1516,7 +1528,7 @@ key: 'execSuccess', label: '鎴愬姛鍚�', initVal: card.execSuccess || 'grid', - tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��', + tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��', required: true, options: [{ value: 'never', @@ -1538,7 +1550,7 @@ key: 'execError', label: '澶辫触鍚�', initVal: card.execError || 'never', - tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��', + tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊鍝竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��', required: true, options: [{ value: 'never', diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index 82fe3f2..e4be98c 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -263,6 +263,100 @@ this.actionFormRef.handleConfirm().then(btn => { _actionlist = _actionlist.filter(item => !item.origin || item.uuid === btn.uuid) + if ((btn.OpenType === 'excelIn' || btn.OpenType === 'excelOut') && (!btn.verify || !btn.verify.columns) && (config.subtype === 'basetable' || config.subtype === 'normaltable')) { + let columns = [] + let maps = [] + + if (btn.OpenType === 'excelOut') { + let pushcol = (item) => { + let cell = { + Column: item.field, + Text: item.label, + Width: 20, + abs: 'false', + output: 'true', + required: 'false', + type: 'text', + uuid: Utils.getuuid() + } + + if (item.type === 'number') { + cell.type = 'number' + cell.decimal = item.decimal + } + + columns.push(cell) + } + + config.cols.forEach(item => { + if (item.type === 'colspan' && config.subtype === 'normaltable') { + item.subcols.forEach(cell => { + if (!cell.field || cell.Hide === 'true' || maps.includes(cell.field)) return + maps.push(cell.field) + + pushcol(cell) + }) + } + + if (!item.field || item.Hide === 'true' || maps.includes(item.field)) return + maps.push(item.field) + + pushcol(item) + }) + + btn.verify = btn.verify || {enable: 'false', dataType: 'default', scripts: []} + btn.verify.columns = columns + } else { + let pushcol = (item) => { + let _type = 'Nvarchar(50)' + let _limit = '50' + if (item.type === 'number' && !item.decimal) { + _type = 'Int' + _limit = '' + } else if (item.type === 'number') { + _type = 'Decimal(18,' + item.decimal + ')' + _limit = item.decimal + } + + let _cell = { + uuid: Utils.getuuid(), + Column: item.field, + Text: item.label, + type: _type, + limit: _limit, + import: 'true', + required: 'true' + } + + if (_type !== 'Nvarchar(50)') { + _cell.min = 0 + _cell.max = 999999 + } + + columns.push(_cell) + } + + config.cols.forEach(item => { + if (item.type === 'colspan' && config.subtype === 'normaltable') { + item.subcols.forEach(cell => { + if (!cell.field || cell.Hide === 'true' || maps.includes(cell.field)) return + maps.push(cell.field) + + pushcol(cell) + }) + } + + if (!item.field || item.Hide === 'true' || maps.includes(item.field)) return + maps.push(item.field) + + pushcol(item) + }) + + btn.verify = btn.verify || {sheet: 'Sheet1', default: 'true', range: 1, scripts: [], uniques: []} + btn.verify.columns = columns + } + } + let labelrepet = false _actionlist = _actionlist.map(item => { if (item.uuid !== btn.uuid && item.label === btn.label) { diff --git a/src/menu/components/share/clockcomponent/settingform/index.jsx b/src/menu/components/share/clockcomponent/settingform/index.jsx index 0978f22..f31fb1c 100644 --- a/src/menu/components/share/clockcomponent/settingform/index.jsx +++ b/src/menu/components/share/clockcomponent/settingform/index.jsx @@ -100,7 +100,7 @@ })(<InputNumber min={0} max={500} precision={0} />)} </Form.Item> </Col> : null} - {config.type === 'card' && (config.subtype === 'balcony' || config.subtype === 'propcard') && timer && timer !== '2s' ? <Col span={22}> + {timer && timer !== '2s' ? <Col span={22}> <Form.Item label={ <Tooltip placement="topLeft" title="鍙互鎸囧畾瀛楁鐢ㄤ簬鎺у埗瀹氭椂鍣ㄧ殑鍏抽棴銆�"> <QuestionCircleOutlined className="mk-form-tip" /> @@ -116,7 +116,7 @@ )} </Form.Item> </Col> : null} - {(config.subtype === 'balcony' || config.subtype === 'propcard') && clearField && timer && timer !== '2s' ? <Col span={22}> + {clearField && timer && timer !== '2s' ? <Col span={22}> <Form.Item label={ <Tooltip placement="topLeft" title="褰撳瓧娈靛�间笌鍏抽棴鍊肩浉绛夋椂锛屽叧闂畾鏃跺櫒锛屽涓�煎彲鐢ㄩ�楀彿鍒嗛殧銆�"> <QuestionCircleOutlined className="mk-form-tip" /> diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index 477e3e0..aa7abd3 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -7,7 +7,7 @@ import Utils from '@/utils/utils.js' import MKEmitter from '@/utils/events.js' import asyncComponent from '@/utils/asyncComponent' -import './index.scss' +// import './index.scss' const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) diff --git a/src/menu/components/share/pasteforms/index.jsx b/src/menu/components/share/pasteforms/index.jsx new file mode 100644 index 0000000..6cf98a8 --- /dev/null +++ b/src/menu/components/share/pasteforms/index.jsx @@ -0,0 +1,178 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { fromJS } from 'immutable' +import { Modal, notification, Button } from 'antd' +import { SnippetsOutlined, QuestionCircleOutlined } from '@ant-design/icons' + +import Utils from '@/utils/utils.js' +import asyncComponent from '@/utils/asyncComponent' +import './index.scss' + +const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) + +class PasteForms extends Component { + static propTpyes = { + config: PropTypes.object, // 缁勪欢閰嶇疆 + update: PropTypes.func + } + + state = { + visible: false, + choVisible: false, + result: null + } + + pasteSubmit = () => { + const { config } = this.props + + this.pasteFormRef.handleConfirm().then(res => { + if (res.copyType === 'search' && ['text', 'select', 'multiselect', 'link', 'checkcard', 'date', 'datemonth'].includes(res.type)) { + res.copyType = 'form' + } + + if (!['form', 'forms', 'formgroup', 'simpleform'].includes(res.copyType)) { + notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', duration: 5 }) + return + } + + if (res.copyType === 'form') { + delete res.copyType + res = {fields: [res]} + } + + res.fields = res.fields || [] + res.fields = res.fields.map(item => { + item.uuid = Utils.getuuid() + return item + }) + + let fields = res.fields.map(item => item.field ? item.field.toLowerCase() : '') + + let repeat = false + let forms = [] + if (config.fields) { + forms = fromJS(config.fields).toJS() + forms.forEach(item => { + if (item.field && fields.includes(item.field.toLowerCase())) { + repeat = true + } + }) + } + + if (repeat) { + this.setState({result: res, choVisible: true, visible: false}) + return + } else { + forms.push(...res.fields) + } + + this.props.update(forms, res) + + this.setState({visible: false}) + + notification.success({ + top: 92, + message: '绮樿创鎴愬姛锛�', + duration: 2 + }) + }) + } + + replaceForms = () => { + const { config } = this.props + const { result } = this.state + + let forms = fromJS(config.fields).toJS() + let fields = fromJS(result.fields).toJS() + let repeats = [] + + forms = forms.map(item => { + if (!item.field) return item + + let cell = fields.filter(m => m.field && m.field.toLowerCase() === item.field.toLowerCase())[0] + if (cell) { + repeats.push(cell.field) + return cell + } + + return item + }) + + fields = fields.filter(m => !m.field || !repeats.includes(m.field)) + + forms.push(...fields) + + this.props.update(forms, result) + + this.setState({choVisible: false}) + } + + jumpForms = () => { + const { config } = this.props + const { result } = this.state + + let forms = fromJS(config.fields).toJS() + let fields = fromJS(result.fields).toJS() + let repeats = [] + + forms = forms.map(item => { + if (!item.field) return item + + let cell = fields.filter(m => m.field && m.field.toLowerCase() === item.field.toLowerCase())[0] + if (cell) { + repeats.push(cell.field) + } + + return item + }) + + fields = fields.filter(m => !m.field || !repeats.includes(m.field)) + + forms.push(...fields) + + this.props.update(forms, result) + + this.setState({choVisible: false}) + } + + render() { + const { type } = this.props + const { visible, choVisible } = this.state + + return ( + <div style={{display: 'inline-block'}}> + {type === 'toolbar' ? <Button icon="snippets" style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} >绮樿创</Button> : + <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />} + <Modal + title="绮樿创" + visible={visible} + width={600} + maskClosable={false} + onOk={this.pasteSubmit} + onCancel={() => {this.setState({visible: false})}} + destroyOnClose + > + <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> + </Modal> + <Modal + title="" + visible={choVisible} + width={450} + closable={false} + maskClosable={false} + onCancel={() => {this.setState({choVisible: false, result: null})}} + footer={[ + <Button key="cancel" onClick={() => this.setState({choVisible: false, result: null})}>鍙栨秷</Button>, + <Button key="replace" className="mk-border-purple" style={{color: 'purple'}} onClick={this.replaceForms}>鏇挎崲</Button>, + <Button key="confirm" type="primary" onClick={this.jumpForms}>璺宠繃</Button> + ]} + destroyOnClose + > + <QuestionCircleOutlined style={{color: 'orange', fontSize: '24px', margin: '15px 10px', position: 'relative', top: '2px'}}/>瀛樺湪閲嶅琛ㄥ崟锛岃閫夋嫨澶勭悊鏂瑰紡銆� + </Modal> + </div> + ) + } +} + +export default PasteForms \ No newline at end of file diff --git a/src/menu/components/share/pasteforms/index.scss b/src/menu/components/share/pasteforms/index.scss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/menu/components/share/pasteforms/index.scss diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx index 86ba414..bd16cd3 100644 --- a/src/menu/components/table/base-table/index.jsx +++ b/src/menu/components/table/base-table/index.jsx @@ -191,11 +191,17 @@ } card.action.forEach(cell => { + if (cell.hidden === 'true' || cell.origin) return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } + if (doubleClick === cell.uuid) { doubleClick = '' } @@ -204,11 +210,17 @@ card.cols.forEach(col => { if (col.type === 'action') { col.elements.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } + if (doubleClick === cell.uuid) { doubleClick = '' } diff --git a/src/menu/components/table/base-table/index.scss b/src/menu/components/table/base-table/index.scss index 36252f5..408f2e5 100644 --- a/src/menu/components/table/base-table/index.scss +++ b/src/menu/components/table/base-table/index.scss @@ -48,6 +48,9 @@ min-height: 55px; } } + .model-menu-action-list:not(.length0):not(.length1):not(.length2):not(.length3):not(.length4):not(.length5):not(.length6):not(.length7):not(.length8):not(.length9) { + margin-bottom: 20px; + } .ant-btn.mk-link { padding: 0; 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 fa48a0f..8173efc 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 @@ -101,6 +101,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx index ac0caff..dd661ef 100644 --- a/src/menu/components/table/edit-table/index.jsx +++ b/src/menu/components/table/edit-table/index.jsx @@ -178,20 +178,30 @@ } card.action.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } }) card.cols.forEach(col => { if (col.type === 'action') { col.elements.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } }) } else if (col.type === 'custom') { diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index 873c345..898bda5 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -218,10 +218,15 @@ } card.action.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (doubleClick === cell.uuid) { doubleClick = '' @@ -231,10 +236,15 @@ card.cols.forEach(col => { if (col.type === 'action') { col.elements.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } if (doubleClick === cell.uuid) { doubleClick = '' diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx index 346f029..9391b7c 100644 --- a/src/menu/components/tabs/paste/index.jsx +++ b/src/menu/components/tabs/paste/index.jsx @@ -19,7 +19,7 @@ visible: false } - resetconfig = (item) => { + resetconfig = (item, appType) => { if (item.type === 'tabs') { item.uuid = MenuUtils.getuuid() item.setting.name = item.setting.name + MenuUtils.getSignName() @@ -29,7 +29,7 @@ tab.uuid = MenuUtils.getuuid() tab.components = tab.components.map(cell => { - cell = this.resetconfig(cell) + cell = this.resetconfig(cell, appType) return cell }) }) @@ -39,12 +39,12 @@ item.name = item.setting.name item.components = item.components.map(cell => { - cell = MenuUtils.resetComponentConfig(cell) + cell = MenuUtils.resetComponentConfig(cell, appType) return cell }) } else { - item = MenuUtils.resetComponentConfig(item) + item = MenuUtils.resetComponentConfig(item, appType) } return item @@ -53,7 +53,7 @@ pasteSubmit = () => { const { Tab } = this.props let appType = sessionStorage.getItem('appType') - let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox'] + let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'editor', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox'] let types = { login: '鐧诲綍', navbar: '瀵艰埅鏍�', @@ -83,7 +83,7 @@ return } - res = this.resetconfig(res) + res = this.resetconfig(res, appType) delete res.copyType diff --git a/src/menu/components/timeline/normal-timeline/index.jsx b/src/menu/components/timeline/normal-timeline/index.jsx index 79df605..826bfae 100644 --- a/src/menu/components/timeline/normal-timeline/index.jsx +++ b/src/menu/components/timeline/normal-timeline/index.jsx @@ -132,10 +132,15 @@ card.subcards.forEach(col => { col.elements.forEach(cell => { if (cell.eleType === 'button') { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } } else if (cell.datatype === 'dynamic' && cell.field && !columns.includes(cell.field)) { card.errors.push({ level: 1, detail: `鍗$墖涓姩鎬佸瓧娈碘��${cell.field}鈥濇棤鏁坄}) diff --git a/src/menu/components/timeline/normal-timeline/options.jsx b/src/menu/components/timeline/normal-timeline/options.jsx index 8d0ddb9..01c6e41 100644 --- a/src/menu/components/timeline/normal-timeline/options.jsx +++ b/src/menu/components/timeline/normal-timeline/options.jsx @@ -56,6 +56,8 @@ {field: 'mode', values: ['vertical']}, {field: 'hmode', values: ['horizontal']}, {field: 'label', values: ['vertical']}, + {field: 'iconSize', values: ['horizontal']}, + {field: 'dotSign', values: ['horizontal']}, ] }, { @@ -112,6 +114,35 @@ ] }, { + type: 'radio', + field: 'dotSign', + label: '鑺傜偣娓叉煋', + initval: wrap.dotSign || 'background', + tooltip: '鑺傜偣鐨勬覆鏌撴柟寮忥紝鍦ㄨ妭鐐圭粍涓缃殑棰滆壊娓叉煋鍥炬爣杩樻槸娓叉煋鑳屾櫙鑹层��', + required: false, + options: [ + {value: 'background', label: '鑳屾櫙鑹�'}, + {value: 'icon', label: '鍥炬爣'}, + ] + }, + { + type: 'select', + field: 'iconSize', + label: '鍥炬爣澶у皬', + initval: wrap.iconSize || '', + tooltip: '鍥炬爣鍙湪鑺傜偣缁勪腑娣诲姞銆�', + required: false, + options: [ + {value: '', label: '榛樿(14px)'}, + {value: 'size16', label: '16px'}, + {value: 'size18', label: '18px'}, + {value: 'size20', label: '20px'}, + {value: 'size22', label: '22px'}, + {value: 'size24', label: '24px'}, + {value: 'adaptive', label: '鑷�傚簲'}, + ] + }, + { type: 'select', field: 'label', label: '鏍囩', @@ -143,6 +174,19 @@ forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' }, { + type: 'radio', + field: 'empty', + label: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + skip: true, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx index 85de3e6..bca6509 100644 --- a/src/menu/datasource/verifycard/customscript/index.jsx +++ b/src/menu/datasource/verifycard/customscript/index.jsx @@ -140,6 +140,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx index de02f21..3295cea 100644 --- a/src/menu/datasource/verifycard/settingform/index.jsx +++ b/src/menu/datasource/verifycard/settingform/index.jsx @@ -97,6 +97,10 @@ values.onload = 'true' } + if (values.interType === 'system' && values.onload === 'false') { + values.sync = 'false' + } + // 鏁版嵁婧愬墠绔獙璇� if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) { let _quot = values.dataresource.match(/'{1}/g) @@ -127,6 +131,14 @@ notification.warning({ top: 92, message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/', + duration: 5 + }) + reject() + return + } else if (/,,/ig.test(values.dataresource)) { + notification.warning({ + top: 92, + message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', duration: 5 }) reject() @@ -460,9 +472,9 @@ </Form.Item> </Col> : null} {/* 1銆佷笉鍒嗛〉涓斾笉瀛樺湪涓婄骇妯″潡 */} - {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' ? <Col span={8}> + {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' && setting.onload !== 'false' ? <Col span={8}> <Form.Item label={ - <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細浠呭湪浣跨敤绯荤粺鍑芥暟锛屼笖鍒濆鍖栧姞杞芥暟鎹椂鏈夋晥锛屽垎椤佃姹傛椂鏃犳晥銆�'}> + <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細濡傝彍鍗曟湭浣跨敤鍚庣缂撳瓨锛屽垯鏌ヨ璇彞澶т簬8000瀛楃鏃舵棤鏁堛��'}> <QuestionCircleOutlined className="mk-form-tip" /> 鍚屾鏌ヨ </Tooltip> @@ -516,7 +528,7 @@ {getFieldDecorator('onload', { initialValue: setting.onload || 'true' })( - <Radio.Group> + <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'onload')}}> <Radio value="true">鍔犺浇</Radio> <Radio value="false">涓嶅姞杞�</Radio> </Radio.Group> diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx index c0da35b..0448d06 100644 --- a/src/menu/modalconfig/index.jsx +++ b/src/menu/modalconfig/index.jsx @@ -21,7 +21,7 @@ const { Panel } = Collapse const { confirm } = Modal const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) -const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) +const PasteForms = asyncComponent(() => import('@/menu/components/share/pasteforms')) const DragElement = asyncComponent(() => import('@/templates/modalconfig/dragelement')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) @@ -257,6 +257,8 @@ return } + window.GLOB.formId = res.uuid + if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true @@ -456,44 +458,8 @@ }) } - plusFields = (items, type) => { + plusFields = (items) => { let _config = fromJS(this.state.config).toJS() - - if (type === 'forms') { - if (_config.fields.length > 0) { - let that = this - _config.fields = items.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - - confirm({ - title: '纭畾鏇挎崲琛ㄥ崟鍚楋紵', - content: '鍘熻〃鍗曞皢鍒犻櫎銆�', - onOk() { - that.setState({ - config: _config - }) - }, - onCancel() {} - }) - } else { - _config.fields = items.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - - this.setState({ - config: _config - }) - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) - } - return - } _config.fields.push(...items) @@ -503,6 +469,15 @@ if (items.length === 1 && items[0].focus) { this.handleForm(items[0]) } + }) + } + + pasteFields = (items) => { + let _config = fromJS(this.state.config).toJS() + _config.fields = items + + this.setState({ + config: _config }) } @@ -562,7 +537,7 @@ <Card title="琛ㄥ崟閰嶇疆" bordered={false} extra={ <div> <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button> - <EditComponent options={['form', 'forms']} type="formboard" config={this.state.config} plusFields={this.plusFields}/> + <PasteForms type="toolbar" config={config} update={this.pasteFields}/> <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>杩斿洖</Button> </div> diff --git a/src/menu/modulesource/option.jsx b/src/menu/modulesource/option.jsx index 696b3a5..e914933 100644 --- a/src/menu/modulesource/option.jsx +++ b/src/menu/modulesource/option.jsx @@ -66,7 +66,7 @@ { type: 'menu', url: indent, component: 'antvG6', subtype: 'indentTree', title: '缂╄繘鏂囦欢鏍�', width: 24 }, { type: 'menu', url: kapmap, component: 'antvG6', subtype: 'kapmap', title: '鐭ヨ瘑鍥捐氨鏍�', width: 24 }, { type: 'menu', url: chart, component: 'chart', subtype: 'custom', title: '鑷畾涔夊浘琛�', width: 24, forbid: ['billPrint'] }, - { type: 'menu', url: Editor, component: 'editor', subtype: 'brafteditor', title: '瀵屾枃鏈�', width: 24, forbid: ['billPrint'] }, + { type: 'menu', url: Editor, component: 'editor', subtype: 'brafteditor', title: '瀵屾枃鏈�', width: 24 }, { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '鑷畾涔�', width: 24 }, { type: 'menu', url: group, component: 'group', subtype: 'normalgroup', title: '鍒嗙粍', width: 24, forbid: ['billPrint'] }, { type: 'menu', url: Iframe, component: 'iframe', subtype: 'iframe', title: 'iframe', width: 24, forbid: ['billPrint'] }, diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx index d816e9d..5179037 100644 --- a/src/menu/pastecontroller/index.jsx +++ b/src/menu/pastecontroller/index.jsx @@ -18,9 +18,7 @@ visible: false } - resetconfig = (item) => { - let appType = sessionStorage.getItem('appType') - + resetconfig = (item, appType) => { if (item.type === 'tabs') { item.uuid = MenuUtils.getuuid() item.setting.name = item.setting.name + MenuUtils.getSignName() @@ -34,7 +32,7 @@ } tab.components = tab.components.map(cell => { - cell = this.resetconfig(cell) + cell = this.resetconfig(cell, appType) return cell }) }) @@ -44,11 +42,11 @@ item.name = item.setting.name item.components = item.components.map(cell => { - cell = MenuUtils.resetComponentConfig(cell) + cell = MenuUtils.resetComponentConfig(cell, appType) return cell }) } else { - item = MenuUtils.resetComponentConfig(item) + item = MenuUtils.resetComponentConfig(item, appType) } return item @@ -56,16 +54,16 @@ pasteSubmit = () => { let appType = sessionStorage.getItem('appType') - let options = ['tabs', 'timeline', 'datacard', 'propcard', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'iframe', 'sandbox'] + let options = ['tabs', 'timeline', 'datacard', 'propcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'editor', 'pie', 'scatter', 'iframe', 'sandbox'] if (appType === 'mob') { if (sessionStorage.getItem('editMenuType') !== 'popview') { - options.push('menubar', 'topbar') + options.push('menubar', 'topbar', 'singleSearch') } else { - options.push('menubar') + options.push('menubar', 'singleSearch') } } else { - options.push('editable', 'antvG6', 'tree', 'dashboard', 'chart') + options.push('editable', 'mainsearch', 'antvG6', 'tree', 'dashboard', 'chart') } this.pasteFormRef.handleConfirm().then(res => { @@ -78,7 +76,7 @@ return } - res = this.resetconfig(res) + res = this.resetconfig(res, appType) // delete res.copyType diff --git a/src/mob/components/formdragelement/card.jsx b/src/mob/components/formdragelement/card.jsx index 1ca1c3b..e019a9f 100644 --- a/src/mob/components/formdragelement/card.jsx +++ b/src/mob/components/formdragelement/card.jsx @@ -79,10 +79,8 @@ formItem = (<div className={'am-list-item input ' + (card.place || '')}><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className={'am-input-control ' + card.cursor}>{card.initval ? card.initval : <span style={{color: '#bcbcbc'}}>{card.placeholder || <span style={{color: 'transparent'}}>input</span>}</span> }</div>{card.scan && card.scan !== 'false' ? <div className="am-list-extra"><ScanOutlined /></div> : null}</div></div>) } else if (card.type === 'number') { formItem = (<div className={'am-list-item input ' + (card.place || '')}><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className={'am-input-control ' + card.cursor}>{card.initval || 0}</div>{card.placeholder ? <div className="am-list-extra" style={{color: '#999999', width: 'auto', lineHeight: 1.5, height: '22px'}}>{card.placeholder}</div> : null}</div></div>) - } else if (card.type === 'number') { - formItem = (<div className="am-list-item input"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className={'am-input-control ' + card.cursor}>{card.initval || <span style={{color: 'transparent'}}>input</span>}</div></div></div>) } else if (card.type === 'select' || card.type === 'link' || card.type === 'cascader') { - formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{selectval || '璇烽�夋嫨'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>) + formItem = (<div className={'am-list-item picker ' + (card.place || '')}><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{selectval || '璇烽�夋嫨'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>) } else if (card.type === 'date') { let format = 'YYYY-MM-DD' if (card.precision === 'hour') { @@ -92,14 +90,14 @@ } else if (card.precision === 'second') { format = 'YYYY-MM-DD HH:mm:ss' } - formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'days').format(format) : '璇烽�夋嫨'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>) + formItem = (<div className={'am-list-item picker ' + (card.place || '')}><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'days').format(format) : '璇烽�夋嫨'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>) } else if (card.type === 'datemonth') { - formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'month').format('YYYY-MM') : '璇烽�夋嫨'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>) + formItem = (<div className={'am-list-item picker ' + (card.place || '')}><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'month').format('YYYY-MM') : '璇烽�夋嫨'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>) } else if (card.type === 'datetime') { formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{card.initval ? moment().subtract(card.initval, 'days').format('YYYY-MM-DD HH:mm') : '璇烽�夋嫨'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>) } else if (card.type === 'textarea') { let height = (card.maxRows || 2) * 25 - formItem = (<div className="am-list-item check-card"> + formItem = (<div className={'am-list-item check-card ' + (card.place || '')}> <div className="am-list-line"> <div className="am-input-label">{card.label}</div> <div className="am-input-control"> @@ -142,7 +140,7 @@ } formItem = ( - <div className={'am-list-item checkbox mk-radio ' + (card.arrange || '')}> + <div className={'am-list-item checkbox mk-radio ' + (card.arrange || '') + ' ' + (card.place || '')}> <div className="am-list-line"> <div className="am-input-label">{card.label}</div> <div className="am-input-control"> @@ -171,7 +169,7 @@ } formItem = ( - <div className={'am-list-item checkbox ' + (card.arrange || '')}> + <div className={'am-list-item checkbox ' + (card.arrange || '') + ' ' + (card.place || '')}> <div className="am-list-line"> <div className="am-input-label">{card.label}</div> <div className="am-input-control"> @@ -204,7 +202,7 @@ } else if (card.type === 'split') { formItem = <div className="split-line">{card.label}</div> } else if (card.type === 'checkcard') { - formItem = (<div className="am-list-item check-card"> + formItem = (<div className={'am-list-item check-card ' + (card.place || '')}> <div className="am-list-line"> {card.hidelabel !== 'true' ? <div className="am-input-label">{card.label}</div> : null} <div className="am-input-control"> @@ -214,6 +212,12 @@ </div>) } else if (card.type === 'vercode') { formItem = <div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control"><span style={{color: '#bcbcbc'}}>{card.placeholder || ''}</span></div><div className="am-list-extra" style={{width: 'auto', height: 'auto', backgroundColor: '#fafafa', padding: '0 15px'}}>鑾峰彇楠岃瘉鐮�</div></div></div> + } + + let className = `${card.required === 'true' ? 'required' : ''} ${card.type === 'split' ? 'split-wrap' : ''} ${card.splitline === 'false' ? 'no-boder' : ''}` + + if (window.GLOB.formId === card.uuid) { + className += ' actived' } let style = {...card.style} @@ -238,8 +242,7 @@ <div ref={node => drag(drop(node))} style={{ border: '0.5px solid transparent'}} onDoubleClick={edit}> <Form.Item style={style} - // style={{marginTop: card.marginTop || 0, marginBottom: card.marginBottom || 0}} - className={(card.required === 'true' ? ' required' : '') + (card.type === 'split' ? ' split-wrap' : '') + (card.splitline === 'false' ? ' no-boder' : '')} + className={className} > {formItem} <div></div> diff --git a/src/mob/components/formdragelement/index.scss b/src/mob/components/formdragelement/index.scss index 436e4e2..5aeda26 100644 --- a/src/mob/components/formdragelement/index.scss +++ b/src/mob/components/formdragelement/index.scss @@ -88,6 +88,14 @@ } } } + .am-list-item:not(.up_down) { + .am-list-line { + .am-input-label { + width: 28%; + max-width: 120px; + } + } + } .am-list-item.up_down { height: auto; .am-list-line { @@ -107,6 +115,31 @@ } } } + .am-list-item.picker:not(.up_down) { + .am-list-line { + .am-input-control { + padding-right: 0px; + } + } + } + .am-list-item.up_down.picker { + .am-list-line { + .am-input-control { + line-height: 40px; + padding-right: 20px; + } + .am-list-extra { + top: auto; + right: 10px; + bottom: 13px; + } + } + } + .ant-form-item.actived { + .am-input-label { + color: #1890ff; + } + } .am-list-item.check-card { height: auto; .am-list-line { @@ -117,6 +150,16 @@ } .am-input-label { width: auto; + } + } + } + .am-list-item.check-card.left_right { + .am-list-line { + display: flex; + .am-input-label { + width: 28%; + max-width: 120px; + line-height: 1; } } } @@ -225,6 +268,17 @@ } } } + .am-list-item.checkbox.left_right { + .am-list-line { + display: flex; + .ant-checkbox-group { + float: right; + } + .am-input-control { + padding-right: 0px; + } + } + } .am-list-item.checkbox.mk-radio { .ant-checkbox-inner { border-radius: 50%; @@ -302,6 +356,17 @@ content: '*'; } } + .ant-form-item:not(.required) { + .am-input-label::before { + display: inline-block; + margin-right: 4px; + color: transparent; + font-size: 14px; + font-family: SimSun, sans-serif; + line-height: 1; + content: '*'; + } + } .ant-form-item.no-boder { .am-list-line { border-bottom: none; diff --git a/src/mob/components/search/single-search/index.jsx b/src/mob/components/search/single-search/index.jsx index 514a906..323851c 100644 --- a/src/mob/components/search/single-search/index.jsx +++ b/src/mob/components/search/single-search/index.jsx @@ -11,6 +11,7 @@ import './index.scss' const NormalForm = asyncIconComponent(() => import('@/components/normalform')) +const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) class SingleSearchComponent extends Component { static propTpyes = { @@ -133,6 +134,7 @@ <NormalForm title="鎼滅储璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> + <CopyComponent type="singleSearch" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <DeleteOutlined className="close" onClick={() => this.props.deletecomponent(card.uuid)} /> </div> diff --git a/src/mob/components/tabs/antv-tabs/options.jsx b/src/mob/components/tabs/antv-tabs/options.jsx index 21005e5..9c4ddc7 100644 --- a/src/mob/components/tabs/antv-tabs/options.jsx +++ b/src/mob/components/tabs/antv-tabs/options.jsx @@ -151,6 +151,7 @@ options: modules, controlFields: [ {field: 'controlField', notNull: true}, + {field: 'swiper', values: ['']}, ], }, { @@ -162,6 +163,17 @@ required: true }, { + type: 'radio', + field: 'swiper', + label: '婊戝姩鍒囨崲', + initval: setting.swiper || 'false', + required: false, + options: [ + {value: 'false', label: '绂佺敤'}, + {value: 'true', label: '鍚敤'}, + ], + }, + { type: 'text', field: 'selectField', label: '閫変腑瀛楁', diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index 8bcad78..b355b14 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -20,8 +20,8 @@ const { Panel } = Collapse const { confirm } = Modal -const PasteComponent = asyncComponent(() => import('./pastecomponent')) const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) +const PasteForms = asyncComponent(() => import('@/menu/components/share/pasteforms')) const DragElement = asyncComponent(() => import('@/mob/components/formdragelement')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) @@ -61,6 +61,7 @@ } componentDidMount () { + window.GLOB.formId = '' MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('completeSave', this.completeSave) } @@ -253,6 +254,8 @@ return } + window.GLOB.formId = res.uuid + if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true @@ -409,49 +412,12 @@ }) } - insert = (config, type) => { - if (type === 'forms') { - let _config = fromJS(this.state.config).toJS() - - if (_config.fields.length > 0) { - let that = this - _config.fields = config.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - - confirm({ - title: '纭畾鏇挎崲琛ㄥ崟鍚楋紵', - content: '鍘熻〃鍗曞皢鍒犻櫎銆�', - onOk() { - that.setState({ - config: _config - }) - }, - onCancel() {} - }) - } else { - _config.fields = config.fields.map(item => { - item.uuid = Utils.getuuid() - return item - }) - - this.setState({ - config: _config - }) - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) - } - return - } + pasteFields = (items) => { + let _config = fromJS(this.state.config).toJS() + _config.fields = items this.setState({ - config - }, () => { - this.handleForm(config.fields[config.fields.length - 1]) + config: _config }) } @@ -525,7 +491,7 @@ <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>杩斿洖</Button> <Button type="primary" style={{background: '#26C281', border: 'none'}} onClick={this.triggerCopy}>澶嶅埗</Button> - <PasteComponent config={config} updateConfig={this.insert} /> + <PasteForms type="toolbar" config={config} update={this.pasteFields}/> <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button> <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> </div> diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index a1c9987..f1a4fa3 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -4,8 +4,6 @@ import { notification, Spin, Tabs, Switch, Row, Col, Modal } from 'antd' import Api from '@/api' -import zhCN from '@/locales/zh-CN/main.js' -import enUS from '@/locales/en-US/main.js' import Utils from '@/utils/utils.js' import options from '@/store/options.js' import UtilsDM from '@/utils/utils-datamanage.js' @@ -41,7 +39,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, ContainerId: Utils.getuuid(), // 鑿滃崟澶栧眰html Id BID: null, // 椤甸潰璺宠浆鏃舵惡甯D loadingview: true, // 椤甸潰鍔犺浇涓� @@ -111,7 +108,7 @@ this.setState({ loadingview: false, viewlost: true, - lostmsg: this.state.dict['main.view.unenabled'] + lostmsg: '鎶辨瓑锛屾偍璁块棶鐨勯〉闈㈡湭鍚敤锛岃鑱旂郴绠$悊鍛樸��' }) return } @@ -1198,7 +1195,6 @@ setting={setting} actions={actions} columns={columns} - dict={this.state.dict} MenuID={MenuID} selectedData={selectedData} /> @@ -1214,7 +1210,6 @@ setting={setting} columns={columns} pageSize={pageSize} - dict={this.state.dict} data={this.state.data} total={this.state.total} loading={this.state.loading} @@ -1262,7 +1257,6 @@ setting={setting} actions={actions} columns={columns} - dict={this.state.dict} MenuID={MenuID} selectedData={selectedData} /> @@ -1278,7 +1272,6 @@ setting={setting} columns={columns} pageSize={pageSize} - dict={this.state.dict} data={this.state.data} total={this.state.total} loading={this.state.loading} @@ -1313,8 +1306,8 @@ } {setting && window.GLOB.breakpoint ? <DebugTable /> : null} {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null} - {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} - {!window.GLOB.mkHS && setting ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts || []}/> : null} + {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config}/> : null} + {!window.GLOB.mkHS && setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} </div> ) diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index 724f839..1697e66 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -86,7 +86,7 @@ if (_config.wrap.position === 'fixed' || _config.wrap.position === 'absolute') { _config.style.position = _config.wrap.position - _config.style.zIndex = 3 + _config.style.zIndex = _config.wrap.position === 'fixed' ? 3 : 2 _config.style.left = _config.wrap.left || '' _config.style.right = _config.wrap.right || '' _config.style.top = _config.wrap.top || '' @@ -94,7 +94,7 @@ _config.style.transform = _config.wrap.transform || '' _config.style.width = _config.wrap.realwidth || '' } else { - _config.style.zIndex = 3 + _config.style.zIndex = 1 _config.style.left = _config.wrap.left || '' _config.style.right = _config.wrap.right || '' _config.style.top = _config.wrap.top || '' @@ -364,9 +364,9 @@ loading: false }) - if (config.timer && config.clearField) { + if (config.timer && config.clearField && result.data && result.data[0]) { let vals = (config.clearValue || '').split(',') - if (vals.includes(_data[config.clearField])) { + if (vals.includes(result.data[0][config.clearField])) { this.timer && this.timer.stop() } } diff --git a/src/tabviews/custom/components/card/balcony/index.scss b/src/tabviews/custom/components/card/balcony/index.scss index 11921aa..d13e2fa 100644 --- a/src/tabviews/custom/components/card/balcony/index.scss +++ b/src/tabviews/custom/components/card/balcony/index.scss @@ -5,6 +5,7 @@ background-size: cover; position: relative; display: flex; + overflow: hidden; >.check-all { width: 70px; diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 5171fb0..185042e 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -409,7 +409,8 @@ return null } - if (typeof(val) === 'number') { + if (!isNaN(val) && val !== '') { + val = +val if (card.round) { val = Math.round(val * card.round) / card.round } @@ -695,7 +696,7 @@ } else if (card.eleType === 'formula') { let val = 0 let _style = card.style ? {...card.style} : {} - + if (card.$sync) { if (card.eval === 'false') { val = '' @@ -725,7 +726,7 @@ let reg = new RegExp('@' + key + '@', 'ig') _val = _val.replace(reg, data[key]) }) - + if (card.eval !== 'false') { try { // eslint-disable-next-line @@ -737,14 +738,18 @@ val = _val === undefined ? '' : _val } - + if (val === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� return null } if (val !== '') { if (val && typeof(val) === 'string') { - val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') + val = val.replace(/\n/ig, '<br/>') + if (!/<(span|div|p|a|img)\s/g.test(val)) { + val = val.replace(/\s/ig, ' ') + } + val = <span dangerouslySetInnerHTML={{__html: val}}></span> } @@ -752,10 +757,10 @@ let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> } else { - val = `${card.prefix || ''}${val}${card.postfix || ''}` + val = <>{card.prefix || ''}{val}{card.postfix || ''}</> } } - + let className = '' if (card.marks) { let mark = getMark(card.marks, data, _style) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 95fde61..f4023d3 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -31,6 +31,8 @@ config: null, // 鍥捐〃閰嶇疆淇℃伅 search: null, // 鎼滅储鏉′欢 pageIndex: 1, // 椤电爜 + pageSize: 10, + pageOptions: [], activeKey: '', // 閫変腑鍗� selectKeys: [], // 澶氶�夋椂閫変腑鍗$墖 selectedData: [], // 閫変腑鏁版嵁锛岀敤浜庡伐鍏锋爮鎸夐挳 @@ -157,7 +159,19 @@ this.loaded = _data !== null + let pageOptions = ['10', '25', '50', '100', '500', '1000'] + + if (_config.wrap.pagestyle === 'page') { + let size = (_config.setting.pageSize || 10) + '' + if (!pageOptions.includes(size)) { + pageOptions.push(size) + pageOptions = pageOptions.sort((a, b) => a - b) + } + } + this.setState({ + pageSize: _config.setting.pageSize || 10, + pageOptions, supComs, selected, precards, @@ -588,7 +602,7 @@ async loadData (id, type) { const { mainSearch } = this.props - const { config, arr_field, pageIndex, search, BID, BData, selected } = this.state + const { config, arr_field, pageIndex, pageSize, search, BID, BData, selected } = this.state if (config.setting.supModule && !BID && config.wrap.supKey !== 'false') { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� this.loaded = true @@ -641,13 +655,13 @@ } let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID) let result = await Api.genericInterface(param) if (result.status) { let start = 1 if (config.setting.laypage) { - start = config.setting.pageSize * (pageIndex - 1) + 1 + start = pageSize * (pageIndex - 1) + 1 } this.loaded = true @@ -712,6 +726,13 @@ total: result.total, loading: false }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false @@ -736,7 +757,7 @@ */ async loadLinedata (id) { const { mainSearch } = this.props - const { config, arr_field, pageIndex, search, BID, BData } = this.state + const { config, arr_field, pageIndex, pageSize, search, BID, BData } = this.state let searches = fromJS(search).toJS() if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢 @@ -753,7 +774,7 @@ }) let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID, id) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, id) let result = await Api.genericInterface(param) if (result.status) { @@ -798,9 +819,9 @@ } loadMore = () => { - const { total, pageIndex, loading, config } = this.state + const { total, pageIndex, pageSize, loading } = this.state - if (loading || config.setting.pageSize * pageIndex >= total) { + if (loading || pageSize * pageIndex >= total) { return } @@ -824,8 +845,8 @@ } nextPage = () => { - const { config, pageIndex, total } = this.state - let _total = config.setting.pageSize * pageIndex + const { pageIndex, pageSize, total } = this.state + let _total = pageSize * pageIndex if (_total >= total) return @@ -848,6 +869,15 @@ this.setState({ search: list, pageIndex: 1 + }, () => { + this.loadData() + }) + } + + pageSizeChange = (current, size) => { + this.setState({ + pageIndex: current, + pageSize: size }, () => { this.loadData() }) @@ -899,14 +929,14 @@ } render() { - const { config, precards, nextcards, loading, data, pageIndex, total, card, activeKey, BID, BData, selectedData, selectKeys } = this.state + const { config, precards, nextcards, loading, data, pageIndex, pageSize, total, card, activeKey, BID, BData, selectedData, selectKeys } = this.state if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null let _total = 0 let switchable = false - if (config.wrap.pagestyle === 'switch' && config.pageable && config.setting.laypage && total > config.setting.pageSize && data) { - _total = config.setting.pageSize * pageIndex + if (config.wrap.pagestyle === 'switch' && config.pageable && config.setting.laypage && total > pageSize && data) { + _total = pageSize * pageIndex switchable = true } @@ -986,8 +1016,8 @@ {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null} {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} </div> - {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={t => `鍏� ${t} 鏉} pageSize={config.setting.pageSize} onChange={this.changePageIndex} current={pageIndex}/> : null} - {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} + {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={(t, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} + {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> ) } diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index 3599a92..e50b913 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -7,8 +7,6 @@ import Api from '@/api' import Utils from '@/utils/utils.js' import UtilsDM from '@/utils/utils-datamanage.js' -import preImg from '@/assets/img/prev.png' -import nextImg from '@/assets/img/next.png' import MKEmitter from '@/utils/events.js' import TimerTask from '@/utils/timer-task.js' import asyncComponent from '@/utils/asyncComponent' @@ -30,6 +28,8 @@ config: null, // 鍥捐〃閰嶇疆淇℃伅 search: null, // 鎼滅储鏉′欢 pageIndex: 1, // 椤电爜 + pageSize: 10, + pageOptions: [], activeKey: '', // 閫変腑鍗� selectKeys: [], // 澶氶�夋椂閫変腑鍗$墖 selectedData: [], // 閫変腑鏁版嵁锛岀敤浜庡伐鍏锋爮鎸夐挳 @@ -136,8 +136,19 @@ } _config.setting.sub_field = subconfig.columns.map(col => col.field).join(',') + let pageOptions = ['10', '25', '50', '100', '500', '1000'] + + if (_config.wrap.pagestyle === 'page') { + let size = (_config.setting.pageSize || 10) + '' + if (!pageOptions.includes(size)) { + pageOptions.push(size) + pageOptions = pageOptions.sort((a, b) => a - b) + } + } this.setState({ + pageSize: _config.setting.pageSize || 10, + pageOptions, selected, precards, nextcards, @@ -183,23 +194,28 @@ Api.getLCacheConfig(config.uuid).then(res => { if (!res || this.loaded) return let _data = res.map((item, index) => { + let children = [] + if (item[config.setting.subdata]) { let _children = item[config.setting.subdata] delete item[config.setting.subdata] - item.children = _children.map((cell, i) => { + _children.forEach((cell, i) => { cell.key = i cell.$$uuid = cell[config.setting.subKey] || '' + cell.$$parentId = item[config.setting.primaryKey] || '' cell.$$BID = item[config.setting.primaryKey] || '' cell.$$BData = {...item} cell.$Index = i + 1 + '' - return cell + if (cell.$$uuid) { + children.push(cell) + } }) - } else { - item.children = [] } + + item.children = children item.key = index item.$$uuid = item[config.setting.primaryKey] || '' @@ -260,7 +276,7 @@ if (position === 'line') { if (lines && lines.length === 1) { - this.loadLinedata(lines[0].$$uuid) + this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid) } else { this.loadData(id) } @@ -453,7 +469,7 @@ async loadData (id, type) { const { mainSearch } = this.props - const { config, arr_field, pageIndex, search, BID, BData, selected, card } = this.state + const { config, arr_field, pageIndex, pageSize, search, BID, BData, selected, card } = this.state if (config.setting.supModule && !BID && config.wrap.supKey !== 'false') { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� this.loaded = true @@ -504,13 +520,13 @@ } let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID) let result = await Api.genericInterface(param) if (result.status) { let start = 1 if (config.setting.laypage) { - start = config.setting.pageSize * (pageIndex - 1) + 1 + start = pageSize * (pageIndex - 1) + 1 } this.loaded = true @@ -535,23 +551,28 @@ if (type === 'plus') { let _data = (this.state.data || []).concat(result.data || []) data = _data.map((item, index) => { + let children = [] + if (item[config.setting.subdata]) { let _children = item[config.setting.subdata] delete item[config.setting.subdata] - - item.children = _children.map((cell, i) => { + + _children.forEach((cell, i) => { cell.key = i cell.$$uuid = cell[config.setting.subKey] || '' + cell.$$parentId = item[config.setting.primaryKey] || '' cell.$$BID = item[config.setting.primaryKey] || '' cell.$$BData = {...item} cell.$Index = i + 1 + '' - return cell + if (cell.$$uuid) { + children.push(cell) + } }) - } else { - item.children = [] } + + item.children = children item.key = index item.$$uuid = item[config.setting.primaryKey] || '' @@ -569,23 +590,28 @@ }) } else { data = result.data.map((item, index) => { + let children = [] + if (item[config.setting.subdata]) { let _children = item[config.setting.subdata] delete item[config.setting.subdata] - item.children = _children.map((cell, i) => { + _children.forEach((cell, i) => { cell.key = i cell.$$uuid = cell[config.setting.subKey] || '' + cell.$$parentId = item[config.setting.primaryKey] || '' cell.$$BID = item[config.setting.primaryKey] || '' cell.$$BData = {...item} cell.$Index = i + 1 + '' - return cell + if (cell.$$uuid) { + children.push(cell) + } }) - } else { - item.children = [] } + + item.children = children item.key = index item.$$uuid = item[config.setting.primaryKey] || '' @@ -617,6 +643,13 @@ total: result.total, loading: false }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false @@ -641,7 +674,7 @@ */ async loadLinedata (id) { const { mainSearch } = this.props - const { config, arr_field, pageIndex, search, BID, BData } = this.state + const { config, arr_field, pageIndex, pageSize, search, BID, BData } = this.state let searches = fromJS(search).toJS() if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢 @@ -658,7 +691,7 @@ }) let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID, id) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, id) let result = await Api.genericInterface(param) if (result.status) { @@ -669,23 +702,28 @@ try { data = data.map(item => { if (item[config.setting.primaryKey] === _data[config.setting.primaryKey]) { + let children = [] + if (_data[config.setting.subdata]) { let _children = _data[config.setting.subdata] delete _data[config.setting.subdata] - _data.children = _children.map((cell, i) => { + _children.forEach((cell, i) => { cell.key = i cell.$$uuid = cell[config.setting.subKey] || '' + cell.$$parentId = _data[config.setting.primaryKey] || '' cell.$$BID = _data[config.setting.primaryKey] || '' cell.$$BData = {..._data} cell.$Index = i + 1 + '' - return cell + if (cell.$$uuid) { + children.push(cell) + } }) - } else { - _data.children = [] } + + _data.children = children _data.key = item.key _data.$$uuid = _data[config.setting.primaryKey] || '' @@ -721,9 +759,9 @@ } loadMore = () => { - const { total, pageIndex, loading, config } = this.state + const { total, pageIndex, pageSize, loading } = this.state - if (loading || config.setting.pageSize * pageIndex >= total) { + if (loading || pageSize * pageIndex >= total) { return } @@ -731,31 +769,6 @@ pageIndex: pageIndex + 1 }, () => { this.loadData('', 'plus') - }) - } - - prevPage = () => { - const { pageIndex } = this.state - - if (pageIndex === 1) return - - this.setState({ - pageIndex: pageIndex - 1 - }, () => { - this.loadData() - }) - } - - nextPage = () => { - const { config, pageIndex, total } = this.state - let _total = config.setting.pageSize * pageIndex - - if (_total >= total) return - - this.setState({ - pageIndex: pageIndex + 1 - }, () => { - this.loadData() }) } @@ -771,6 +784,15 @@ this.setState({ search: list, pageIndex: 1 + }, () => { + this.loadData() + }) + } + + pageSizeChange = (current, size) => { + this.setState({ + pageIndex: current, + pageSize: size }, () => { this.loadData() }) @@ -853,16 +875,9 @@ } render() { - const { config, precards, nextcards, loading, data, pageIndex, total, card, activeKey, BID, BData, selectedData, selectKeys, subcard, subconfig, wrapStyle, opens } = this.state + const { config, precards, nextcards, loading, data, pageIndex, pageSize, total, card, activeKey, BID, BData, selectedData, selectKeys, subcard, subconfig, wrapStyle, opens } = this.state if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null - - let _total = 0 - let switchable = false - if (config.wrap.pagestyle === 'switch' && config.pageable && config.setting.laypage && total > config.setting.pageSize && data) { - _total = config.setting.pageSize * pageIndex - switchable = true - } let extendData = {$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'} @@ -903,7 +918,6 @@ /> : null } <div className={`data-zoom ${config.wrap.wrapClass}`}> - {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null} <Row className={'card-row-list '}> {precards.map((item, index) => ( <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> @@ -960,11 +974,10 @@ </Col> ))} </Row> - {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null} {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} </div> - {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={t => `鍏� ${t} 鏉} pageSize={config.setting.pageSize} onChange={this.changePageIndex} current={pageIndex}/> : null} - {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} + {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={(t, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} + {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> ) } diff --git a/src/tabviews/custom/components/card/double-data-card/index.scss b/src/tabviews/custom/components/card/double-data-card/index.scss index f483742..d19f2f3 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.scss +++ b/src/tabviews/custom/components/card/double-data-card/index.scss @@ -80,29 +80,6 @@ background-repeat: no-repeat; background-size: cover; } - .prev-page { - width: 20px; - div { - height: 100%; - display: table; - div { - display: table-cell; - vertical-align: middle; - } - } - img { - width: 15px; - padding: 0 2px; - height: 70px; - cursor: pointer; - } - } - .prev-page.disabled { - img { - cursor: not-allowed; - opacity: 0.4; - } - } .card-row-list::after { content: ' '; display: block; diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index aac9321..651bd23 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -421,9 +421,9 @@ } }) - if (config.timer && config.clearField) { + if (config.timer && config.clearField && result.data && result.data[0]) { let vals = (config.clearValue || '').split(',') - if (vals.includes(_data[config.clearField])) { + if (vals.includes(result.data[0][config.clearField])) { this.timer && this.timer.stop() } } diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index ed5623f..47aab12 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -338,6 +338,13 @@ total: result.total, loading: false }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 4dbe6e2..590bc98 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -294,19 +294,28 @@ Api.writeCacheConfig(config.uuid, result.data || '') } + let data = result.data.map((item, index) => { + item.key = index + item.$$uuid = item[config.setting.primaryKey] || '' + item.$$BID = BID || '' + item.$$BData = BData || '' + item.$Index = index + 1 + return item + }) + this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.$$uuid = item[config.setting.primaryKey] || '' - item.$$BID = BID || '' - item.$$BData = BData || '' - item.$Index = index + 1 - return item - }), + data: data, loading: false }, () => { this.openModal(result.ErrCode) }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index 6698d56..bfeba28 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -330,6 +330,13 @@ this.openModal(result.ErrCode) } }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false 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 7e4180a..c76b83c 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -548,6 +548,13 @@ this.data = result.data || [] this.handleData() } + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index 1544237..5a584b0 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -299,6 +299,13 @@ this.setState({ loading: false }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 17e24f5..46e5ccf 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -259,6 +259,13 @@ this.data = result.data || [] this.handleData() } + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index b418e31..abc0f0c 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -290,6 +290,13 @@ this.data = result.data || [] this.handleData() } + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/chart/custom-chart/index.jsx b/src/tabviews/custom/components/chart/custom-chart/index.jsx index fb81260..f2b717e 100644 --- a/src/tabviews/custom/components/chart/custom-chart/index.jsx +++ b/src/tabviews/custom/components/chart/custom-chart/index.jsx @@ -280,6 +280,13 @@ this.data = result.data || [] this.handleData() } + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx index 434ed5d..a4084ac 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.jsx +++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx @@ -222,7 +222,7 @@ if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null return ( - <div className="custom-braft-editor-box" id={'anchor' + config.uuid} style={config.style}> + <div className={'custom-braft-editor-box ' + (config.wrap.firstTr || '')} id={'anchor' + config.uuid} style={config.style}> {loading ? <div className="loading-mask"> <div className="ant-spin-blur"></div> diff --git a/src/tabviews/custom/components/editor/braft-editor/index.scss b/src/tabviews/custom/components/editor/braft-editor/index.scss index 5bbfc97..1829c88 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.scss +++ b/src/tabviews/custom/components/editor/braft-editor/index.scss @@ -28,6 +28,16 @@ } } +.custom-braft-editor-box.light { + .braft-content { + table { + tr:first-child { + background-color:#ffffff; + } + } + } +} + .custom-braft-editor-box::after { content: ' '; display: block; diff --git a/src/tabviews/custom/components/form/step-form/index.jsx b/src/tabviews/custom/components/form/step-form/index.jsx index 83349ad..561a5b7 100644 --- a/src/tabviews/custom/components/form/step-form/index.jsx +++ b/src/tabviews/custom/components/form/step-form/index.jsx @@ -98,8 +98,8 @@ let _group = config.subcards[0] - if (_data && config.wrap.statusControl && _data[config.wrap.statusControl]) { - let _status = _data[config.wrap.statusControl] + if (_data && config.wrap.statusControl && _data[config.wrap.statusControl] !== undefined) { + let _status = _data[config.wrap.statusControl] + '' let _groups = config.subcards.filter(item => item.setting.status === _status)[0] _group = _groups || _group @@ -172,8 +172,8 @@ _data.$$uuid = _data[config.setting.primaryKey] || '' - if (config.wrap.statusControl && _data[config.wrap.statusControl]) { - let _status = _data[config.wrap.statusControl] + if (config.wrap.statusControl && _data[config.wrap.statusControl] !== undefined) { + let _status = _data[config.wrap.statusControl] + '' let _groups = config.subcards.filter(item => item.setting.status === _status)[0] _group = _groups || _group } @@ -313,8 +313,8 @@ _group = config.subcards[0] } - if (config.wrap.statusControl && _data[config.wrap.statusControl]) { - let _status = _data[config.wrap.statusControl] + if (config.wrap.statusControl && _data[config.wrap.statusControl] !== undefined) { + let _status = _data[config.wrap.statusControl] + '' let _groups = config.subcards.filter(item => item.setting.status === _status)[0] _group = _groups || _group } diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 8c85c47..3aea5ea 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -1995,7 +1995,7 @@ pageSizeOptions: pageOptions, showSizeChanger: true, total: this.props.total || 0, - showTotal: (total, range) => `${range[0]}-${range[1]} ${this.state.dict['main.pagination.of']} ${total} ${this.state.dict['main.pagination.items']}` + showTotal: (total, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉 } } diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index b4ec245..0dca1df 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -256,35 +256,44 @@ start = pageSize * (pageIndex - 1) + 1 } - this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.$$uuid = item[setting.primaryKey] || '' - item.$$key = '' + item.key + item.$$uuid - item.$$BID = BID || '' - item.$$BData = BData || '' - item.$Index = start + index + '' + let data = result.data.map((item, index) => { + item.key = index + item.$$uuid = item[setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid + item.$$BID = BID || '' + item.$$BData = BData || '' + item.$Index = start + index + '' - if (config.absFields) { - config.absFields.forEach(f => { - if (!isNaN(item[f])) { - item[f] = Math.abs(item[f]) - } - }) - } - - if (setting.controlField) { - if (setting.controlVal.includes(item[setting.controlField])) { - item.$disabled = true + if (config.absFields) { + config.absFields.forEach(f => { + if (!isNaN(item[f])) { + item[f] = Math.abs(item[f]) } + }) + } + + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true } - - return item - }), + } + + return item + }) + + this.setState({ + data: data, selectedData: [], total: result.total, loading: false }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index 463c865..1905369 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -83,6 +83,15 @@ card = _config.subcards[0] + if (_config.wrap.dotSign === 'adaptive') { + try { + let cl = Math.floor(document.body.clientWidth * _config.width / 24 / 320) + _config.wrap.dotSign = ['', 'size16', 'size18', 'size20', 'size22', 'size24', 'size24', 'size24', 'size24'][cl] + } catch(e) { + _config.wrap.dotSign = 'size20' + } + } + this.setState({ card, sync: _sync, @@ -294,17 +303,26 @@ Api.writeCacheConfig(config.uuid, result.data || '') } + let data = result.data.map((item, index) => { + item.key = index + item.$$uuid = item[config.setting.primaryKey] || '' + item.$$BID = BID || '' + item.$$BData = BData || '' + item.$Index = index + 1 + '' + return item + }) + this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.$$uuid = item[config.setting.primaryKey] || '' - item.$$BID = BID || '' - item.$$BData = BData || '' - item.$Index = index + 1 + '' - return item - }), + data: data, loading: false }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false @@ -445,7 +463,7 @@ </div> <div className="mk-timeline-item-head"> <div className="mk-timeline-item-tail" style={linebg}></div> - <div className={'mk-dot ' + (dot ? 'mk-dot-icon' : '')} style={{background: color}}> + <div className={'mk-dot ' + (dot ? 'mk-dot-icon' : '')} style={{background: color, color: color}}> {dot} </div> </div> @@ -454,7 +472,7 @@ return (<div className="mk-time-line-item" key={data.$Index}> <div className="mk-timeline-item-head"> <div className="mk-timeline-item-tail" style={linebg}></div> - <div className={'mk-dot ' + (dot ? 'mk-dot-icon' : '')} style={{background: color}}> + <div className={'mk-dot ' + (dot ? 'mk-dot-icon' : '')} style={{background: color, color: color}}> {dot} </div> </div> @@ -470,6 +488,8 @@ render() { const { config, loading, data, description } = this.state + if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null + return ( <div className="normal-timeline-box" id={'anchor' + config.uuid} style={{...config.style}}> {loading ? @@ -482,7 +502,7 @@ {config.wrap.direction !== 'horizontal' && data && data.length > 0 ? <Timeline mode={config.wrap.mode} className={'card-row-list ' + (config.wrap.line || '')} style={{height: config.wrap.contentHeight}}> {data.map(item => this.getnodes(item))} </Timeline> : null} - {config.wrap.direction === 'horizontal' && data && data.length > 0 ? <div className={'mk-time-line-wrap card-row-list ' + (config.wrap.line || '')} style={{height: config.wrap.contentHeight}}> + {config.wrap.direction === 'horizontal' && data && data.length > 0 ? <div className={`mk-time-line-wrap card-row-list ${config.wrap.line || ''} ${config.wrap.iconSize || ''} ${config.wrap.dotSign || ''}`} style={{height: config.wrap.contentHeight}}> {data.map(item => this.getMknodes(item))} </div> : null} {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}> diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.scss b/src/tabviews/custom/components/timeline/normal-timeline/index.scss index 38ef5b9..7e0945c 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.scss +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.scss @@ -114,14 +114,15 @@ } .mk-timeline-item-head { position: relative; - height: 20px; + height: 24px; text-align: center; .mk-dot { position: absolute; background: #e8e8e8; - padding: 5px; - display: inline-block; - border-radius: 20px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 100%; z-index: 1; top: 50%; left: 50%; @@ -130,26 +131,125 @@ .anticon { font-size: 14px; color: #ffffff; - width: 16px; - height: 16px; - vertical-align: top; } + } + .mk-dot:not(.mk-dot-icon) { + padding: 5px; } .mk-dot-icon { width: 24px; height: 24px; - padding: 4px; } } .mk-timeline-item-tail { position: absolute; - top: 10px; + top: 50%; left: 0px; width: 100%; transform: translate(50%, -1px); border-top: 2px solid #e8e8e8; } } + + .mk-time-line-wrap.icon { + .mk-timeline-item-head { + .mk-dot { + background: #f8f8f8!important; + } + .mk-dot-icon { + color: inherit; + .anticon { + color: inherit; + } + } + } + } + + .mk-time-line-wrap.size16 { + .mk-timeline-item-head { + height: 28px; + .mk-dot { + .anticon { + font-size: 16px; + } + } + .mk-dot-icon { + width: 28px; + height: 28px; + } + } + } + + .mk-time-line-wrap.size18 { + .mk-timeline-item-head { + height: 32px; + .mk-dot { + .anticon { + font-size: 18px; + } + } + .mk-dot-icon { + width: 32px; + height: 32px; + } + } + } + + .mk-time-line-wrap.size20 { + .mk-timeline-item-head { + height: 36px; + .mk-dot { + .anticon { + font-size: 20px; + } + } + .mk-dot-icon { + width: 36px; + height: 36px; + } + } + } + + .mk-time-line-wrap.size22 { + .mk-timeline-item-head { + height: 40px; + .mk-dot { + .anticon { + font-size: 22px; + } + } + .mk-dot-icon { + width: 40px; + height: 40px; + } + } + } + + .mk-time-line-wrap.size24 { + .mk-timeline-item-head { + height: 44px; + .mk-dot { + .anticon { + font-size: 24px; + } + } + .mk-dot-icon { + width: 44px; + height: 44px; + } + } + } + + .mk-time-line-wrap.system { + .mk-timeline-item-tail { + border-color: var(--mk-sys-color2); + } + } + .ant-timeline.system { + .ant-timeline-item-tail { + border-color: var(--mk-sys-color2); + } + } } .normal-timeline-box::after { diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 6b287c2..922eba9 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -270,6 +270,13 @@ }, () => { this.handleData() }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } } else { this.setState({ loading: false diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 6149fc0..7c3ba68 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -380,6 +380,7 @@ cell.logLabel = item.$menuname + '-' + cell.label cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = Tab.$MenuID cell.$tabId = Tab.uuid cell.$toolbtn = true @@ -424,6 +425,7 @@ cell.Ot = cell.Ot || 'requiredSgl' cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = Tab.$MenuID cell.$tabId = Tab.uuid if (!mutil && cell.syncComponentId === item.setting.supModule) { @@ -464,6 +466,7 @@ cell.Ot = cell.Ot || 'requiredSgl' cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = Tab.$MenuID cell.$tabId = Tab.uuid if (!mutil && cell.syncComponentId === item.setting.supModule) { @@ -510,6 +513,7 @@ cell.logLabel = item.$menuname + '-' + cell.label cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = Tab.$MenuID cell.$tabId = Tab.uuid if (cell.syncComponentId === item.wrap.supModule) { @@ -549,6 +553,7 @@ cell.Ot = cell.Ot || 'requiredSgl' cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid + cell.$MenuID = Tab.$MenuID cell.$tabId = Tab.uuid if (cell.syncComponentId === item.setting.supModule) { diff --git a/src/tabviews/formtab/actionList/index.jsx b/src/tabviews/formtab/actionList/index.jsx index 87e516a..9b97235 100644 --- a/src/tabviews/formtab/actionList/index.jsx +++ b/src/tabviews/formtab/actionList/index.jsx @@ -327,7 +327,7 @@ actionSettingError = () => { notification.warning({ top: 92, - message: this.props.dict['main.action.settingerror'], + message: '鎸夐挳璁剧疆閿欒锛�', duration: 5 }) } diff --git a/src/tabviews/formtab/index.jsx b/src/tabviews/formtab/index.jsx index 98691d1..dcc0d1d 100644 --- a/src/tabviews/formtab/index.jsx +++ b/src/tabviews/formtab/index.jsx @@ -224,7 +224,7 @@ } else if (item.resourceType === '1' && !item.dataSource) { notification.warning({ top: 92, - message: item.label + ': ' + this.state.dict['main.datasource.settingerror'], + message: item.label + ': 鏁版嵁婧愰厤缃敊璇紒', duration: 5 }) } diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index b8e80e2..4935f6f 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -186,13 +186,11 @@ sessionStorage.setItem('Full_Name', res.FullName) sessionStorage.setItem('avatar', res.icon || '') sessionStorage.setItem('dataM', res.dataM ? 'true' : '') - sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') sessionStorage.setItem('debug', res.debug || '') sessionStorage.setItem('role_id', res.role_id || '') sessionStorage.setItem('departmentcode', res.departmentcode || '') 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) diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index b632588..9623d2d 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -296,7 +296,7 @@ }) } - let result = getExcelInSql(btn, data, this.state.dict, (this.props.BID || ''), this.state.primaryId) + let result = getExcelInSql(btn, data, (this.props.BID || ''), this.state.primaryId) if (result.errors) { notification.warning({ diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index be05ea6..b96ad92 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -922,6 +922,11 @@ menuname: btn.logLabel } + if (btn.verify.dataType !== 'custom' && setting.sub_field) { + arr_field = arr_field + ',' + setting.sub_field + param.arr_field = arr_field + } + // 鏁版嵁绠$悊鏉冮檺 if (sessionStorage.getItem('dataM') === 'true') { param.dataM = 'Y' diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 4b9f777..65f734e 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1962,8 +1962,9 @@ const { btn } = this.props const { btnconfig, autoMatic } = this.state - if (res.message && /^@speak@/.test(res.message)) { - res.message = res.message.replace('@speak@', '') + let sign = '' + if (/^@speak@/i.test(res.message)) { + res.message = res.message.replace(/^@speak@/i, '') let val = res.message.match(/<<.*>>/) res.message = res.message.replace(/\s*<<.*>>\s*/g, '') val = val ? val[0].replace(/<<|>>/g, '') : '' @@ -1977,6 +1978,9 @@ if (!res.message) { res.ErrCode = '-1' } + } else if (/@close_tab@|@close_popup@|@goback@/i.test(res.message)) { + sign = res.message.match(/@close_tab@|@close_popup@|@goback@/i)[0].toLowerCase() + res.message = res.message.replace(/@close_tab@|@close_popup@|@goback@/i, '') } if ((res.ErrCode === 'S' || !res.ErrCode) || autoMatic) { // 鎵ц鎴愬姛 @@ -2032,9 +2036,9 @@ return } - if (btn.execSuccess === 'closetab') { + if (btn.execSuccess === 'closetab' || sign === '@close_tab@') { MKEmitter.emit('closeTabView', btn.$MenuID) - } else if (btn.execSuccess === 'closepoptab') { + } else if (btn.execSuccess === 'closepoptab' || sign === '@close_popup@') { MKEmitter.emit('popclose') } else if (btn.execSuccess !== 'never') { MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, id, this.state.selines) @@ -2350,12 +2354,13 @@ * 2銆乪xcel瀵煎嚭锛屽け璐ュ悗鍙栨秷瀵煎嚭鎸夐挳鍔犺浇涓姸鎬� * 3銆侀�氱煡涓诲垪琛ㄥ埛鏂� */ - execError = (res) => { + execError = (res = {}) => { const { btn } = this.props const { btnconfig, autoMatic } = this.state - if (res.message && /^@speak@/.test(res.message)) { - res.message = res.message.replace('@speak@', '') + let sign = '' + if (/^@speak@/i.test(res.message)) { + res.message = res.message.replace(/^@speak@/i, '') let val = res.message.match(/<<.*>>/) res.message = res.message.replace(/\s*<<.*>>\s*/g, '') val = val ? val[0].replace(/<<|>>/g, '') : '' @@ -2369,6 +2374,9 @@ if (!res.message) { res.ErrCode = '-1' } + } else if (/@close_tab@|@close_popup@|@goback@/i.test(res.message)) { + sign = res.message.match(/@close_tab@|@close_popup@|@goback@/i)[0].toLowerCase() + res.message = res.message.replace(/@close_tab@|@close_popup@|@goback@/i, '') } if (res.ErrCode === 'E' && !autoMatic) { @@ -2416,7 +2424,9 @@ MKEmitter.emit('mkFC', 'focus', btnconfig.setting.errFocus) } - if (btn.execError === 'closepoptab') { + if (sign === '@close_tab@') { + MKEmitter.emit('closeTabView', btn.$MenuID) + } else if (btn.execError === 'closepoptab' || sign === '@close_popup@') { MKEmitter.emit('popclose') } else if (btn.execError !== 'never') { MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines) @@ -2576,49 +2586,50 @@ btnconfig.fields.forEach(item => { if (!item.field) return + let _item = { key: item.field, readin: item.readin !== 'false' && item.readin !== 'top', fieldlen: item.fieldlength || 50, writein: item.writein !== 'false', - type: item.type - } - - let _initval = item.initval - let _readin = item.readin !== 'false' - let _format = item.precision || 'day' // 鏃堕棿鏍煎紡鍖� - - if (item.type === 'funcvar') { - _initval = '' - _readin = false - _item.readin = false - } else if (item.type === 'linkMain') { - _readin = false - _item.readin = false - } else if (item.type === 'date') { - if (_format !== 'day') { - _format = 'YYYY-MM-DD HH:mm:ss' - } else { - _format = 'YYYY-MM-DD' - } - } else if (item.type === 'datetime') { - _item.type = 'date' - _format = 'YYYY-MM-DD HH:mm:ss' + type: item.type, + value: item.initval } let key = item.field.toLowerCase() + let _readin = item.readin !== 'false' - if (_item.type === 'linkMain' && BData.hasOwnProperty(key)) { - _initval = BData[key] - } else if (_readin && _data.hasOwnProperty(key)) { - _initval = _data[key] - } else if (_item.type === 'date' && _initval) { - _initval = moment().subtract(_initval, 'days').format(_format) - } else if (_item.type === 'datemonth' && _initval) { - _initval = moment().subtract(_initval, 'month').format('YYYY-MM') + if (_item.type === 'date') { // 鏃堕棿鍏煎 + _item.precision = item.precision || 'day' + } else if (_item.type === 'datetime') { + _item.type = 'date' + _item.precision = 'second' + } else if (['funcvar', 'linkMain'].includes(_item.type)) { + _readin = false + _item.readin = false + } else if (['select', 'link', 'radio'].includes(_item.type)) { // 閫変腑绗竴椤� + if (/^\s*\$first\s*$/.test(_item.value)) { + _item.value = '' + + if (item.resourceType === '0' && item.options[0] && item.options[0].Value) { + _item.value = item.options[0].Value + } + } } - _item.value = _initval === undefined ? '' : _initval + if (_item.type === 'funcvar') { + _item.value = '' + } else if (_item.type === 'linkMain' && BData.hasOwnProperty(key)) { + _item.value = BData[key] + } else if (_readin && _data.hasOwnProperty(key)) { + _item.value = _data[key] + } else if (_item.type === 'date' && _item.value) { + _item.value = moment().subtract(_item.value, 'days').format(_item.precision === 'day' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss') + } else if (_item.type === 'datemonth' && _item.value) { + _item.value = moment().subtract(_item.value, 'month').format('YYYY-MM') + } + + _item.value = _item.value === undefined ? '' : _item.value if (_item.type === 'number' || item.declare === 'decimal') { _item.type = 'number' @@ -2640,10 +2651,10 @@ _item.value = _item.value.slice(-item.fieldlength) } } - } else if (_item.type.indexOf('date') > -1) { - if (item.declareType === 'nvarchar(50)') { - _item.type = 'text' - } + } else if (_item.type === 'datemonth') { + _item.type = 'text' + } else if (_item.type === 'date') { + _item.type = item.declareType === 'nvarchar(50)' ? 'text' : 'date' } else if (_item.type === 'rate') { let count = item.rateCount || 5 _item.value = parseInt(_item.value) diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index c8302d8..0dceae9 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -1967,7 +1967,7 @@ actionSettingError = () => { notification.warning({ top: 92, - message: this.state.dict['main.action.settingerror'], + message: '鎸夐挳璁剧疆閿欒锛�', duration: 5 }) } @@ -2115,62 +2115,87 @@ btnconfig.fields.forEach(item => { if (!item.field) return - let _readin = item.readin !== 'false' - let _initval = item.initval - if (item.type === 'linkMain' || item.type === 'funcvar') { - _readin = false - } - - if (item.type === 'linkMain' && BData.hasOwnProperty(item.field.toLowerCase())) { - _initval = BData[item.field.toLowerCase()] - } else if (_readin && _data.hasOwnProperty(item.field.toLowerCase())) { - _initval = _data[item.field.toLowerCase()] - } else if (item.type === 'date' && _initval) { - _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD') - } else if (item.type === 'datemonth' && _initval) { - _initval = moment().subtract(_initval, 'month').format('YYYY-MM') - } else if (item.type === 'datetime' && _initval) { - _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD HH:mm:ss') - } - - let _fieldlen = item.fieldlength || 50 - if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { - _fieldlen = item.fieldlength || 512 - } else if (item.type === 'number') { - _fieldlen = item.decimal ? item.decimal : 0 - } else if (item.type === 'rate') { - item.rateCount = item.rateCount || 5 - let allowHalf = item.allowHalf === 'true' - - if (allowHalf) { - _initval = parseFloat(_initval) - if (_initval % 0.5 !== 0) { - _initval = parseInt(_initval) - } - } else { - _initval = parseInt(_initval) - } - - if (isNaN(_initval) || _initval < 0) { - _initval = 0 - } else if (_initval > item.rateCount) { - _initval = item.rateCount - } - } - - if (_initval === undefined) { - _initval = '' - } - - result.push({ + let _item = { key: item.field, - readonly: item.readonly === 'true', readin: item.readin !== 'false' && item.readin !== 'top', - fieldlen: _fieldlen, + fieldlen: item.fieldlength || 50, + writein: item.writein !== 'false', type: item.type, - value: _initval - }) + value: item.initval + } + + let key = item.field.toLowerCase() + let _readin = item.readin !== 'false' + + if (_item.type === 'date') { // 鏃堕棿鍏煎 + _item.precision = item.precision || 'day' + } else if (_item.type === 'datetime') { + _item.type = 'date' + _item.precision = 'second' + } else if (['funcvar', 'linkMain'].includes(_item.type)) { + _readin = false + _item.readin = false + } else if (['select', 'link', 'radio'].includes(_item.type)) { // 閫変腑绗竴椤� + if (/^\s*\$first\s*$/.test(_item.value)) { + _item.value = '' + + if (item.resourceType === '0' && item.options[0] && item.options[0].Value) { + _item.value = item.options[0].Value + } + } + } + + if (_item.type === 'funcvar') { + _item.value = '' + } else if (_item.type === 'linkMain' && BData.hasOwnProperty(key)) { + _item.value = BData[key] + } else if (_readin && _data.hasOwnProperty(key)) { + _item.value = _data[key] + } else if (_item.type === 'date' && _item.value) { + _item.value = moment().subtract(_item.value, 'days').format(_item.precision === 'day' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss') + } else if (_item.type === 'datemonth' && _item.value) { + _item.value = moment().subtract(_item.value, 'month').format('YYYY-MM') + } + + _item.value = _item.value === undefined ? '' : _item.value + + if (_item.type === 'number' || item.declare === 'decimal') { + _item.type = 'number' + _item.fieldlen = item.decimal || 0 + } else if (['text', 'textarea', 'linkMain'].includes(_item.type)) { + _item.value = _item.value + '' + _item.value = _item.value.replace(/\t*|\v*/g, '') // 鍘婚櫎鍒惰〃绗� + + if (item.interception !== 'false') { // 鍘婚櫎棣栧熬绌烘牸 + _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') + } + if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲 + _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) + } + if (_item.type === 'text' && item.lenControl && item.lenControl !== 'limit') { + if (item.lenControl === 'left') { + _item.value = _item.value.substr(0, item.fieldlength) + } else { + _item.value = _item.value.slice(-item.fieldlength) + } + } + } else if (_item.type === 'datemonth') { + _item.type = 'text' + } else if (_item.type === 'date') { + _item.type = item.declareType === 'nvarchar(50)' ? 'text' : 'date' + } else if (_item.type === 'rate') { + let count = item.rateCount || 5 + _item.value = parseInt(_item.value) + + if (isNaN(_item.value) || _item.value < 0) { + _item.value = 0 + } else if (_item.value > count) { + _item.value = count + } + } + + result.push(_item) }) if (btnconfig.setting.display === 'exec') { diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index a1ea659..35287d8 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -117,7 +117,7 @@ } delete item.field return true - } else if (item.type === 'date') { // 鏃堕棿鎼滅储 + } else if (item.type === 'date') { item.precision = item.precision || 'day' } else if (item.type === 'datetime') { item.type = 'date' @@ -174,6 +174,19 @@ if (item.empty === 'hidden' && item.oriOptions.length === 0) { item.hidden = true + } + if (item.type === 'checkcard' && item.readonly && item.unchecked === 'hidden') { + let selectKeys = item.initval + if (item.multiple === 'true') { + selectKeys = selectKeys ? selectKeys.split(',') : [] + item.options = item.options.filter(item => selectKeys.includes(item.$value)) + } else { + item.options = item.options.filter(item => selectKeys === item.$value) + } + item.oriOptions = fromJS(item.options).toJS() + if (item.options.length === 0) { + item.hidden = true + } } } @@ -464,7 +477,7 @@ } if (['select', 'link', 'radio'].includes(item.type)) { // 閫変腑绗竴椤� - if (typeof(item.initval) === 'string' && item.initval.indexOf('$first') > -1) { + if (/^\s*\$first\s*$/.test(item.initval)) { item.$first = true item.initval = '' } @@ -824,6 +837,21 @@ if (item.empty === 'hidden' && item.oriOptions.length > 0) { item.hidden = false } + if (item.type === 'checkcard' && item.readonly && item.unchecked === 'hidden') { + let selectKeys = item.initval + if (item.multiple === 'true') { + selectKeys = selectKeys ? selectKeys.split(',') : [] + item.options = item.options.filter(item => selectKeys.includes(item.$value)) + } else { + item.options = item.options.filter(item => selectKeys === item.$value) + } + item.oriOptions = fromJS(item.options).toJS() + if (item.options.length === 0) { + item.hidden = true + } else { + item.hidden = false + } + } } return item @@ -1054,10 +1082,10 @@ _item.value = _item.value.slice(-item.fieldlength) } } - } else if (item.type.indexOf('date') > -1) { - if (item.declareType === 'nvarchar(50)') { - _item.type = 'text' - } + } else if (item.type === 'datemonth') { + _item.type = 'text' + } else if (item.type === 'date') { + _item.type = item.declareType === 'nvarchar(50)' ? 'text' : 'date' } else if (item.type === 'vercode') { _item.type = 'text' forms.push({ diff --git a/src/tabviews/zshare/mutilform/mkVercode/index.jsx b/src/tabviews/zshare/mutilform/mkVercode/index.jsx index ae8fb99..dfa614b 100644 --- a/src/tabviews/zshare/mutilform/mkVercode/index.jsx +++ b/src/tabviews/zshare/mutilform/mkVercode/index.jsx @@ -77,7 +77,7 @@ let n_id = (() => { let uuid = [] let timestamp = new Date().getTime() - let _options = '0123456789abcdefghigklmnopqrstuv' + let _options = '01234567890123456789012345678901' for (let i = 0; i < 19; i++) { uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) } diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index e08b2cb..2f6d9ab 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -42,7 +42,6 @@ tableId: PropTypes.string, // 鍒楄〃Id statFValue: PropTypes.any, // 鍚堣瀛楁鏁版嵁 pageSize: PropTypes.any, // 姣忛〉鏁版嵁 - dict: PropTypes.object, // 瀛楀吀椤� MenuID: PropTypes.string, // 鑿滃崟Id setting: PropTypes.object, // 琛ㄦ牸鍏ㄥ眬璁剧疆锛歵ableType锛堣〃鏍兼槸鍚﹀彲閫夈�佸崟閫夈�佸閫夛級銆乧olumnfixed锛堝垪鍥哄畾锛夈�乤ctionfixed锛堟寜閽浐瀹氾級 pickup: PropTypes.any, // 鏁版嵁鏀惰捣 @@ -1251,7 +1250,7 @@ pageSizeOptions: pageOptions, showSizeChanger: true, total: this.props.total || 0, - showTotal: (total, range) => `${range[0]}-${range[1]} ${this.props.dict['main.pagination.of']} ${total} ${this.props.dict['main.pagination.items']}` + showTotal: (total, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉 } } diff --git a/src/tabviews/zshare/pageMessage/index.jsx b/src/tabviews/zshare/pageMessage/index.jsx index 60db458..4ca2a3b 100644 --- a/src/tabviews/zshare/pageMessage/index.jsx +++ b/src/tabviews/zshare/pageMessage/index.jsx @@ -15,7 +15,6 @@ class PageMessage extends Component { static propTpyes = { BID: PropTypes.any, // 鐖剁骇Id锛岀敤浜庢煡璇笅鎷夐�夋嫨椤� - dict: PropTypes.object, // 瀛楀吀 } state = { @@ -314,7 +313,7 @@ render() { - const { menu, dict } = this.props + const { menu } = this.props const { debug, visible, data } = this.state return ( @@ -333,7 +332,7 @@ visible={visible} onCancel={() => this.setState({visible: false})} footer={[ - <Button key="close" onClick={() => this.setState({visible: false})}>{dict['main.close']}</Button> + <Button key="close" onClick={() => this.setState({visible: false})}>鍏抽棴</Button> ]} destroyOnClose > diff --git a/src/tabviews/zshare/settingcomponent/index.jsx b/src/tabviews/zshare/settingcomponent/index.jsx index 2f137ee..70fbc77 100644 --- a/src/tabviews/zshare/settingcomponent/index.jsx +++ b/src/tabviews/zshare/settingcomponent/index.jsx @@ -14,7 +14,6 @@ class CustomSetting extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀琛� config: PropTypes.object, // 椤甸潰閰嶇疆淇℃伅 shortcuts: PropTypes.any, // 鑷畾涔夎缃� } @@ -525,9 +524,9 @@ visible={visible} onCancel={() => { this.setState({ visible: false }) }} footer={[ - <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{this.props.dict['main.revert.default']}</Button>, - <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{this.props.dict['main.cancel']}</Button>, - <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{this.props.dict['main.submit']}</Button> + <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>鎭㈠榛樿璁剧疆</Button>, + <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>鍙栨秷</Button>, + <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>鎻愪氦</Button> ]} destroyOnClose > diff --git a/src/templates/comtableconfig/updatetable/index.jsx b/src/templates/comtableconfig/updatetable/index.jsx index ffe2380..647404a 100644 --- a/src/templates/comtableconfig/updatetable/index.jsx +++ b/src/templates/comtableconfig/updatetable/index.jsx @@ -21,6 +21,7 @@ state = {} delButtons = [] + baseMsg = {} shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) @@ -52,8 +53,14 @@ } execUpdate = (_resolve) => { - const { config } = this.props + const config = fromJS(this.props.config).toJS() this.delButtons = [] + this.baseMsg = { + fstMenuId: config.fstMenuId, + parentId: config.ParentId, + MenuName: config.MenuName, + MenuNo: config.MenuNo, + } let _config = { version: 1.0, @@ -80,13 +87,14 @@ let formActions = [] let popActions = [] let errors = [] + let formTabs = [] let mainTb = {name: '涓昏〃', uuid: Utils.getuuid(), useMSearch: 'false', isMain: true} let oldtabs = { mainTable: mainTb.uuid } - let tbl = this.getTable(config, mainTb, errors, formActions, popActions, oldtabs) + let tbl = this.getTable(config, mainTb, errors, formActions, formTabs, popActions, oldtabs) if (config.autoMatic && config.autoMatic.enable === 'true') { if (tbl.action.filter(item => item.uuid === config.autoMatic.action && (['pop', 'prompt', 'exec'].includes(item.OpenType) || (item.OpenType === 'funcbutton' && item.funcType === 'print'))).length === 0) { @@ -183,7 +191,7 @@ _config.components = _config.components.map(item => { if (item.type === 'tabs') { item.subtabs = item.subtabs.map(tab => { - tab.components[0] = this.getTable(menus[tab.components[0].linkTab], tab.components[0], errors, formActions, popActions, oldtabs) + tab.components[0] = this.getTable(menus[tab.components[0].linkTab], tab.components[0], errors, formActions, formTabs, popActions, oldtabs) return tab }) @@ -191,14 +199,14 @@ return item }) - this.setPopView(_resolve, _config, formActions, popActions, errors) + this.setPopView(_resolve, _config, formActions, formTabs, popActions, errors) }) } else { - this.setPopView(_resolve, _config, formActions, popActions, errors) + this.setPopView(_resolve, _config, formActions, formTabs, popActions, errors) } } - setPopView = (_resolve, _config, formActions, popActions, errors) => { + setPopView = (_resolve, _config, formActions, formTabs, popActions, errors) => { if (popActions.length > 0) { let defers = popActions.map((item, i) => { return new Promise((resolve) => { @@ -260,7 +268,7 @@ MenuName: btn.label, tables: _config.tables || [], Template: 'BaseTable', - components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], + components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions, formTabs)], viewType: 'popview', style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } } @@ -284,7 +292,7 @@ MenuName: btn.label, tables: _config.tables || [], Template: 'BaseTable', - components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], + components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions, formTabs)], viewType: 'popview', style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } } @@ -309,7 +317,7 @@ MenuName: btn.label, tables: _config.tables || [], Template: 'BaseTable', - components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], + components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions, formTabs)], viewType: 'popview', style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } } @@ -333,7 +341,7 @@ MenuName: btn.label, tables: _config.tables || [], Template: 'BaseTable', - components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions)], + components: [this.getTable(menus[btn.uuid], mainTb, errors, formActions, formTabs)], viewType: 'popview', style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } } @@ -346,14 +354,14 @@ } }) - this.setPopForm(_resolve, _config, formActions, errors) + this.setPopForm(_resolve, _config, formActions, formTabs, errors) }) } else { - this.setPopForm(_resolve, _config, formActions, errors) + this.setPopForm(_resolve, _config, formActions, formTabs, errors) } } - setPopForm = (_resolve, _config, formActions, errors) => { + setPopForm = (_resolve, _config, formActions, formTabs, errors) => { if (formActions.length > 0) { let defers = formActions.map((item, i) => { return new Promise((resolve) => { @@ -477,10 +485,10 @@ } }) - this.saveConfig(_resolve, _config, errors) + this.saveConfig(_resolve, _config, errors, formTabs) }) } else { - this.saveConfig(_resolve, _config, errors) + this.saveConfig(_resolve, _config, errors, formTabs) } } @@ -518,7 +526,7 @@ }) } - saveConfig = (_resolve, _config, errors) => { + saveConfig = (_resolve, _config, errors, formTabs) => { let err = errors.join('锛�') let _this = this @@ -529,17 +537,17 @@ content: '', onOk() { return new Promise(resolve => { - _this.saveNewMenu(resolve, _config) + _this.saveNewMenu(resolve, _config, formTabs) }) }, onCancel() {} }) } else { - this.saveNewMenu(_resolve, _config) + this.saveNewMenu(_resolve, _config, formTabs) } } - saveNewMenu = (_resolve, _config) => { + saveNewMenu = (_resolve, _config, formTabs) => { _config.components.forEach(item => { if (item.type === 'tabs') { item.subtabs.forEach(tab => { @@ -558,6 +566,20 @@ }) tab.components[0].$tables = getTables(tab.components[0]) + + tab.components[0].errors = [] + let columns = tab.components[0].columns.map(c => c.field) + if (tab.components[0].setting.interType === 'system' && tab.components[0].setting.execute !== 'false' && !tab.components[0].setting.dataresource) { + tab.components[0].errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'}) + } else if (tab.components[0].setting.interType === 'system' && tab.components[0].setting.execute === 'false' && tab.components[0].scripts.filter(script => script.status !== 'false').length === 0) { + tab.components[0].errors.push({ level: 0, detail: '鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'}) + } else if (!tab.components[0].setting.primaryKey) { + tab.components[0].errors.push({ level: 0, detail: '鏈缃富閿紒'}) + } else if (!columns.includes(tab.components[0].setting.primaryKey)) { + tab.components[0].errors.push({ level: 0, detail: '涓婚敭宸插け鏁堬紒'}) + } else if (!tab.components[0].setting.supModule) { + tab.components[0].errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'}) + } }) } else { item.action.forEach(btn => { @@ -575,35 +597,6 @@ }) item.$tables = getTables(item) - } - }) - - let tbs = [] - _config.components.forEach(item => { - if (item.type === 'tabs') { - item.subtabs.forEach(tab => { - if (tab.components[0].$tables) { - tbs.push(...tab.components[0].$tables) - } - - tab.components[0].errors = [] - let columns = tab.components[0].columns.map(c => c.field) - if (tab.components[0].setting.interType === 'system' && tab.components[0].setting.execute !== 'false' && !tab.components[0].setting.dataresource) { - tab.components[0].errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'}) - } else if (tab.components[0].setting.interType === 'system' && tab.components[0].setting.execute === 'false' && tab.components[0].scripts.filter(script => script.status !== 'false').length === 0) { - tab.components[0].errors.push({ level: 0, detail: '鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'}) - } else if (!tab.components[0].setting.primaryKey) { - tab.components[0].errors.push({ level: 0, detail: '鏈缃富閿紒'}) - } else if (!columns.includes(tab.components[0].setting.primaryKey)) { - tab.components[0].errors.push({ level: 0, detail: '涓婚敭宸插け鏁堬紒'}) - } else if (!tab.components[0].setting.supModule) { - tab.components[0].errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'}) - } - }) - } else { - if (item.$tables) { - tbs.push(...item.$tables) - } item.errors = [] let columns = item.columns.map(c => c.field) @@ -621,10 +614,100 @@ } }) - this.submitConfig(_resolve, _config, tbs) + // if (formTabs.length > 0) { + // this.transformTabs(_resolve, _config, formTabs) + // } else { + this.submitConfig(_resolve, _config) + // } } - submitConfig = (_resolve, config, tbs) => { + transformTabs = (_resolve, _config, formTabs) => { + let tab = formTabs.shift() + + Api.getSystemConfig({ + func: 'sPC_Get_LongParam', + MenuID: tab.uuid + }).then(res => { + if (res.status) { + let _LongParam = '' + if (res.LongParam) { + try { + _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) + } catch (e) { + console.warn('Parse Failure') + _LongParam = '' + } + } + + if (_LongParam && (_LongParam.type === 'FormTab' || _LongParam.Template === 'FormTab') && _LongParam.enabled) { + if (!_LongParam.tabgroups) { + _LongParam.tabgroups = [] + } else if (typeof(_LongParam.tabgroups[0]) === 'string') { + let _tabgroups = [] + _LongParam.tabgroups.forEach(groupId => { + let _group = { + uuid: groupId, + sublist: fromJS(_LongParam[groupId]).toJS() + } + + delete _LongParam[groupId] + + _tabgroups.push(_group) + }) + + _LongParam.tabgroups = _tabgroups + } + + _LongParam.tabgroups = _LongParam.tabgroups.filter(group => group.sublist.length > 0) + + _LongParam.tabgroups.forEach(group => { + group.sublist = group.sublist.map(tab => { + if (tab.supMenu === 'mainTable') { + tab.supMenu = '' + } + return tab + }) + }) + + _LongParam.action = _LongParam.action.map(item => { + if (item.intertype === 'inner' && !item.innerFunc) { + item.intertype = 'system' + } + return item + }) + + delete _LongParam.funcs + delete _LongParam.tables + } else { + _config.components[0].action = _config.components[0].action.filter(btn => btn.uuid !== tab.uuid) + } + } else { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + _resolve() + } + }) + } + + submitConfig = (_resolve, config) => { + let tbs = [] + config.components.forEach(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + if (tab.components[0].$tables) { + tbs.push(...tab.components[0].$tables) + } + }) + } else { + if (item.$tables) { + tbs.push(...item.$tables) + } + } + }) + let arr = [] tbs = tbs.filter(tb => { let _tb = tb.toLowerCase() @@ -734,7 +817,7 @@ }) } - getTable = (config, newCon, errors, formActions, popActions, oldtabs) => { + getTable = (config, newCon, errors, formActions, formTabs, popActions, oldtabs) => { let _card = { uuid: newCon.uuid, type: 'table', @@ -759,7 +842,7 @@ return _card } - if (newCon.supModule && oldtabs[newCon.supModule]) { + if (oldtabs && newCon.supModule && oldtabs[newCon.supModule]) { _card.setting.supModule = [oldtabs[newCon.supModule]] } else { _card.setting.supModule = ['empty'] @@ -983,6 +1066,9 @@ if (_btn.intertype === 'inner' && !_btn.innerFunc) { _btn.intertype = 'system' } + if ((_btn.intertype === 'outer' || _btn.intertype === 'custom') && !_btn.procMode) { // 鍏煎澶栭儴鍑芥暟鐩翠紶绫诲瀷 + _btn.procMode = !_btn.innerFunc ? 'none' : 'inner' + } if (_btn.funcType === 'print' && _btn.execMode) { _btn.OpenType = 'funcbutton' } else if (_btn.OpenType === 'blank') { @@ -1029,7 +1115,29 @@ popActions.push({origin: btn.uuid, linkTab: btn.linkTab || '', uuid: _btn.uuid, name: newCon.name, label: btn.label}) } else if (_btn.OpenType === 'tab') { - if (btn.tabTemplate === 'FormTab' || !btn.linkmenu || btn.linkmenu.length !== 3) { + if (btn.tabTemplate === 'FormTab') { + if (newCon.isMain !== true) { + errors.push(newCon.name + '涓寜閽��' + btn.label + '銆嬩笉鍦ㄦ敮鎸�') + return + } + + delete _btn.tabTemplate + + _btn.MenuID = 'tab' + md5(btn.uuid).substr(3) + _btn.MenuName = this.baseMsg.MenuName + '-' + btn.label + _btn.MenuNo = this.baseMsg.MenuNo + '_' + _btn.MenuID.substr(-4).toUpperCase() + _btn.hidden = _btn.hidden || 'false' + _btn.tabType = 'CustomPage' + _btn.linkmenu = [this.baseMsg.fstMenuId, this.baseMsg.parentId, _btn.MenuID] + + let _tab = {...btn} + + _tab.MenuID = _btn.MenuID + _tab.MenuNo = _btn.MenuNo + _tab.MenuName = _btn.MenuName + + formTabs.push(_tab) + } else if (!btn.linkmenu || btn.linkmenu.length !== 3) { errors.push(newCon.name + '涓寜閽��' + btn.label + '銆嬩笉鍦ㄦ敮鎸�') return diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index a3e43f0..d9b92c4 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -362,18 +362,23 @@ _formfields = [..._formfields, ...group.sublist] }) - _inputfields = _formfields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) - _tabfields = _formfields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) - - if (card.linkSubField && card.linkSubField.length > 0) { - let fields = _inputfields.map(item => item.field) - card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) - } - let uniq = new Map() uniq.set(card.field, true) _formfields.forEach(item => { + if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) { + _inputfields.push({ + field: item.field, + label: item.label + }) + } + if (card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) { + _tabfields.push({ + field: item.field, + label: item.label + }) + } + if (item.type !== 'select' && item.type !== 'link') return if (item.field && !uniq.has(item.field)) { uniq.set(item.field, true) @@ -388,6 +393,11 @@ }) } }) + + if (card.linkSubField && card.linkSubField.length > 0) { + let fields = _inputfields.map(item => item.field) + card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) + } if (menu.LongParam) { menu.LongParam.columns.forEach(col => { @@ -1564,9 +1574,6 @@ </div> } style={{ width: '100%' }}> <SettingOutlined onClick={this.changeSetting} /> - {/* <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃悳绱€�嬩腑锛岄�夋嫨瀵瑰簲鎼滅储妗嗘嫋鑷虫澶勬坊鍔狅紱鎴栫偣鍑绘寜閽�婃坊鍔犳悳绱㈡潯浠躲�嬫壒閲忔坊鍔狅紝閫夋嫨鎵归噺娣诲姞鏃讹紝闇�鎻愬墠閫夋嫨浣跨敤琛ㄣ��"> - <QuestionCircleOutlined style={{position: 'relative', color: '#c49f47', left: '5px', top: '20px'}} /> - </Tooltip> */} <Collapse activeKey={config.groups.map(group => group.uuid)} expandIconPosition={'right'} @@ -1597,9 +1604,6 @@ ))} </Collapse> <div className="action-list"> - {/* <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃寜閽�嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬寜閽嫋鑷虫澶勬坊鍔狅紝濡傞�夋嫨鎸夐挳绫诲瀷涓鸿〃鍗曘�佹柊鏍囩椤电瓑鍚湁閰嶇疆椤甸潰鐨勬寜閽紝鍙湪宸︿晶宸ュ叿鏍�-鎸夐挳-鍙厤缃寜閽锛岀偣鍑绘寜閽畬鎴愮浉鍏抽厤缃�傛敞锛氬綋璁剧疆鎸夐挳鏄剧ず浣嶇疆涓鸿〃鏍兼椂锛屾樉绀哄垪浼氬鍔犳搷浣滃垪銆�"> - <QuestionCircleOutlined style={{position: 'absolute', color: '#c49f47', left: '5px', top: '5px'}} /> - </Tooltip> */} <DragElement type="action" list={this.state.config.action} diff --git a/src/templates/formtabconfig/index.scss b/src/templates/formtabconfig/index.scss index d555524..cb73f81 100644 --- a/src/templates/formtabconfig/index.scss +++ b/src/templates/formtabconfig/index.scss @@ -124,7 +124,7 @@ >.ant-collapse { border-radius: 0; border: 0; - margin-top: 30px; + margin-top: 45px; .ant-collapse-header { cursor: default; border-radius: 0; diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx index dad19c1..84118ae 100644 --- a/src/templates/modalconfig/dragelement/card.jsx +++ b/src/templates/modalconfig/dragelement/card.jsx @@ -158,6 +158,10 @@ _label = ' ' } + if (window.GLOB.formId === card.uuid) { + className += ' actived' + } + return ( <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> diff --git a/src/templates/modalconfig/dragelement/index.scss b/src/templates/modalconfig/dragelement/index.scss index df834a2..1c12c6c 100644 --- a/src/templates/modalconfig/dragelement/index.scss +++ b/src/templates/modalconfig/dragelement/index.scss @@ -33,6 +33,11 @@ line-height: 1; } } + .ant-form-item.actived { + .mk-form-label { + color: #1890ff; + } + } .mk-form-label::after { content: ':'; position: relative; @@ -161,4 +166,18 @@ .page-card { margin-bottom: 5px; } -} \ No newline at end of file +} +// .modal-fields-row.copy { +// z-index: 3; +// } +// .modal-fields-row.copy::before { +// content: ' '; +// display: block; +// position: fixed; +// left: 0; +// right: 0; +// top: 0; +// bottom: 0; +// background: rgba(0,0,0,0.2); +// z-index: 2; +// } \ No newline at end of file diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index b4d6d8b..7d746e8 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -126,6 +126,7 @@ } componentDidMount() { + window.GLOB.formId = '' MKEmitter.addListener('submitStyle', this.getStyle) document.onkeydown = (event) => { let e = event || window.event @@ -391,6 +392,8 @@ _config.fields = _config.fields.filter(item => !item.origin) + window.GLOB.formId = res.uuid + if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { this.setState({ sqlVerifing: true diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx index a83f4a9..7724f6c 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx @@ -87,7 +87,7 @@ message: '璇疯緭鍏ュ瓧娈�!' } ] - })(<Input placeholder="" autoComplete="off" />)} + })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleConfirm}/>)} </Form.Item> </Col> <Col span={6}> @@ -100,7 +100,7 @@ message: '璇疯緭鍏ュ悕绉�!' } ] - })(<Input placeholder="" autoComplete="off" />)} + })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleConfirm}/>)} </Form.Item> </Col> <Col span={6}> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index a4e6142..149c255 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -115,6 +115,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx index e3159f8..76d36ee 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx @@ -48,7 +48,7 @@ message: '璇疯緭鍏ュ瓧娈�!' } ] - })(<Input placeholder="" autoComplete="off" />)} + })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleConfirm}/>)} </Form.Item> </Col> <Col span={5}> @@ -61,7 +61,7 @@ message: '璇疯緭鍏ュ悕绉�!' } ] - })(<Input placeholder="" autoComplete="off" />)} + })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleConfirm}/>)} </Form.Item> </Col> <Col span={5}> @@ -74,7 +74,7 @@ message: '璇疯緭鍏ュ垪瀹�!' } ] - })(<InputNumber min={5} max={200} precision={0} />)} + })(<InputNumber min={5} max={200} precision={0} onPressEnter={this.handleConfirm}/>)} </Form.Item> </Col> <Col span={6}> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx index 09adfd9..b76445a 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx @@ -163,6 +163,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx index 0159b4e..09e0fe5 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx @@ -76,6 +76,14 @@ }) reject() return + } else if (/,,/ig.test(values.dataresource)) { + notification.warning({ + top: 92, + message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', + duration: 5 + }) + reject() + return } let error = Utils.verifySql(values.dataresource) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 76e6878..e307490 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -691,6 +691,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index 0aa6042..3066fac 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -263,9 +263,16 @@ const { type } = this.props const { fields } = this.state + let label = '鎵归噺娣诲姞' + if (type === 'search') { + label = '娣诲姞鎼滅储' + } else if (type === 'columns') { + label = '娣诲姞鏄剧ず鍒�' + } + return ( <div className="quickly-add"> - <Button type="primary" block onClick={this.queryField}>鎵归噺娣诲姞</Button> + <Button type="primary" block onClick={this.queryField}>{label}</Button> {/* 鏍规嵁瀛楁鍚嶆坊鍔犳樉绀哄垪鍙婃悳绱㈡潯浠� */} <Modal wrapClassName="model-table-fieldmanage-modal" diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx index 1a6de21..6b8f830 100644 --- a/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx @@ -90,6 +90,14 @@ }) reject() return + } else if (/,,/ig.test(values.dataresource)) { + notification.warning({ + top: 92, + message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', + duration: 5 + }) + reject() + return } let error = Utils.verifySql(values.dataresource) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 323f052..9a7fd02 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -119,6 +119,14 @@ }) reject() return + } else if (/,,/ig.test(values.dataresource)) { + notification.warning({ + top: 92, + message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', + duration: 5 + }) + reject() + return } let error = Utils.verifySql(values.dataresource) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx index 2f679b7..fbfb050 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx @@ -265,6 +265,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx index ab38ac2..0a21e7d 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx @@ -108,6 +108,14 @@ }) reject() return + } else if (/,,/ig.test(values.dataresource)) { + notification.warning({ + top: 92, + message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', + duration: 5 + }) + reject() + return } let error = Utils.verifySql(values.dataresource) diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx index bdd9c1d..2cc6298 100644 --- a/src/templates/zshare/customscript/index.jsx +++ b/src/templates/zshare/customscript/index.jsx @@ -231,6 +231,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 635f5a6..786a6be 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2595,6 +2595,10 @@ card.precision = 'second' } + if (!card.place && appType === 'mob') { + card.place = ['checkbox', 'radio', 'checkcard', 'textarea'].includes(card.type) ? 'up_down' : 'left_right' + } + let options = card.options || [] if (['select', 'radio', 'link'].includes(card.type) && card.setAll === 'true') { // 鍏煎 options.unshift({ @@ -3369,6 +3373,20 @@ }] }, { + type: 'radio', + key: 'unchecked', + label: '鏈�変腑椤�', + initVal: card.unchecked || 'show', + tooltip: '濡傛灉娌℃湁閫変腑椤癸紝璇ヨ〃鍗曞皢琚殣钘忋��', + options: [{ + value: 'show', + text: '鏄剧ず' + }, { + value: 'hidden', + text: '闅愯棌' + }] + }, + { type: 'color', key: 'backgroundColor', label: '鑳屾櫙鑹�', @@ -3494,7 +3512,7 @@ key: 'place', label: '鎺掑垪', initVal: card.place || 'left_right', - tooltip: '鎻愮ず鏂囧瓧涓庤緭鍏ユ鐨勪綅缃叧绯汇�傛敞锛氶�夋嫨鍣ㄣ�佹棩鏈熻〃鍗曞湪琛ㄥ崟鏍峰紡涓洪槾褰辨椂鏈夋晥', + tooltip: '鎻愮ず鏂囧瓧涓庤緭鍏ユ鐨勪綅缃叧绯汇��', forbid: appType !== 'mob', options: [{ value: 'left_right', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 84fd387..cae1bd2 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -22,17 +22,17 @@ text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl', 'inputType'], number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom'], select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'], - checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'arrange', 'marginTop', 'marginBottom'], - radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'setAll', 'emptyText', 'splitline', 'arrange', 'marginTop', 'marginBottom'], - checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'width', 'multiple', 'splitline', 'marginTop', 'marginBottom'], + checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'arrange', 'marginTop', 'marginBottom'], + radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'setAll', 'emptyText', 'splitline', 'arrange', 'marginTop', 'marginBottom'], + checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'place', 'width', 'multiple', 'splitline', 'marginTop', 'marginBottom'], multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown'], link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'], fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'], switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'], - datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'splitline', 'place', 'marginTop', 'marginBottom'], + datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'place', 'marginTop', 'marginBottom'], datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], - textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom'], + textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'place', 'count', 'placeholder', 'marginTop', 'marginBottom'], cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'marginTop', 'marginBottom', 'separator'], color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'colorType', 'extra', 'marginTop', 'marginBottom'], rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'color', 'rateCount', 'character', 'place'], @@ -230,6 +230,9 @@ if (sessionStorage.getItem('appType') === 'mob') { shows.push('hidelabel') } + if (this.record.readonly === 'true' && this.record.hidden !== 'true') { + shows.push('unchecked') + } } else if (['date', 'datemonth', 'datetime'].includes(type)) { reOptions.initval = dateOptions[type] reTypes.initval = 'select' diff --git a/src/templates/zshare/pasteform/index.jsx b/src/templates/zshare/pasteform/index.jsx index 2facaa2..f44b6bb 100644 --- a/src/templates/zshare/pasteform/index.jsx +++ b/src/templates/zshare/pasteform/index.jsx @@ -55,12 +55,31 @@ } } } catch (e) { - notification.warning({ - top: 92, - message: '瑙f瀽閿欒', - duration: 5 - }) - _config = '' + // 閫氳繃sql璇彞娣诲姞瀛楁闆� + if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig.test(values.config)) { + _config = { + key: 'datasourcefield', + type: 'array', + data: [] + } + + let list = values.config.match(/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig) + + list.forEach(item => { + _config.data.push({ + datatype: item.split(/\s+/)[1], + field: item.split(/\s+/)[0], + label: item.split(/\s+/)[0], + }) + }) + } else { + notification.warning({ + top: 92, + message: '瑙f瀽閿欒', + duration: 5 + }) + _config = '' + } } if (_config) { diff --git a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx index 4fe7e4e..94bdc6e 100644 --- a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx +++ b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx @@ -71,6 +71,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/templates/zshare/verifycard/customform/index.jsx b/src/templates/zshare/verifycard/customform/index.jsx index 32a9516..f7194b4 100644 --- a/src/templates/zshare/verifycard/customform/index.jsx +++ b/src/templates/zshare/verifycard/customform/index.jsx @@ -90,6 +90,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql) diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index 4c4a094..1244f5f 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -101,6 +101,13 @@ duration: 5 }) return + } else if (/,,/ig.test(values.sql)) { + notification.warning({ + top: 92, + message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', + duration: 5 + }) + return } let error = Utils.verifySql(values.sql, 'customscript') diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index b2be305..12f861b 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -545,7 +545,11 @@ let _invalid = _verify.invalid if (!_invalid) { // 閫夋嫨琛屾椂锛屽け鏁堥獙璇侀粯璁ゅ紑鍚� - _invalid = card.Ot !== 'notRequired' ? 'true' : 'false' + if (config.setting && config.setting.maxScript && config.setting.maxScript >= 300) { + _invalid = 'false' + } else { + _invalid = card.Ot !== 'notRequired' ? 'true' : 'false' + } } if (card.sqlType === 'custom') { // 鑷畾涔夐獙璇佹椂锛屼笉浣跨敤榛樿sql _verify.default = 'false' @@ -674,6 +678,27 @@ fieldArr.push('bid') + let verIndex = _fields.findIndex(item => item.type === 'vercode') + if (verIndex > -1) { + _fields = fromJS(_fields).toJS() + _fields.splice(verIndex, 0, { + type: 'text', + fieldlength: 50, + writein: 'false', + field: 'mk_timestamp' + }, { + type: 'text', + fieldlength: 50, + writein: 'false', + field: 'mk_send_type' + }, { + type: 'text', + fieldlength: 50, + writein: 'false', + field: 'mk_n_id' + }) + } + _fields = _fields.filter(_f => _f.field) _fields.forEach(_f => { if (_f.field.toLowerCase() === 'bid') { @@ -789,6 +814,10 @@ let _updatesql = '' let _primaryKey = config.setting.primaryKey || 'id' + if (this.props.side === 'sub') { + _primaryKey = config.setting.subKey || 'id' + } + if (card.sqlType === 'insert' || card.sqlType === 'insertOrUpdate') { let keys = [] let values = [] diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index c07d64c..823cb11 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -709,7 +709,7 @@ * @description 閲嶇疆缁勪欢閰嶇疆 * @return {String} item 缁勪欢淇℃伅 */ - static resetComponentConfig = (item) => { + static resetComponentConfig = (item, appType) => { if (item.type === 'navbar') { return item } @@ -743,6 +743,16 @@ if (item.wrap.autoExec) { item.wrap.autoExec = md5(commonId + item.wrap.autoExec) } + + if (appType !== 'mob') { + if (item.wrap.pagestyle === 'slide') { + item.wrap.pagestyle = 'page' + } + } else { + if (item.wrap.pagestyle === 'switch') { + item.wrap.pagestyle = 'page' + } + } item.subcards.forEach(card => { card.uuid = this.getuuid() diff --git a/src/utils/utils.js b/src/utils/utils.js index 09aede5..3350032 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -856,10 +856,9 @@ * @description 鑾峰彇excel瀵煎叆鍙傛暟 * @return {Object} item 鎸夐挳淇℃伅 * @return {Array} data excel鏁版嵁 - * @return {Object} dict 瀛楀吀椤� * @return {String} BID 涓婄骇Id */ -export function getExcelInSql (item, data, dict, BID, primaryId) { +export function getExcelInSql (item, data, BID, primaryId) { let btn = item.verify let keys = ['delete', 'drop', 'insert', 'truncate', 'update'] let userName = sessionStorage.getItem('User_Name') || '' @@ -956,7 +955,7 @@ let val = item[col.Column] !== undefined ? item[col.Column] : '' let _colindex = cols[cindex] || (cindex + 1) - let _position = (_topline + lindex + 1) + dict['main.excel.line'] + ' ' + _colindex + dict['main.excel.column'] + ' ' + let _position = (_topline + lindex + 1) + '琛� ' + _colindex + '鍒� ' if (/^Nvarchar/ig.test(col.type)) { if (typeof(val) === 'number') { @@ -966,54 +965,54 @@ val = val.replace(/(^\s*$)|\t*|\v*|'*/ig, '') if (!val && col.required === 'true') { // 蹇呭~鏍¢獙 - errors.push(_position + dict['main.excel.content.emptyerror']) + errors.push(_position + '鍐呭涓嶅彲涓虹┖') } else if (col.limit && val.length > col.limit) { // 闀垮害鏍¢獙 - errors.push(_position + dict['main.excel.content.maxlimit']) + errors.push(_position + '鍐呭瓒呴暱') } else { // 鍏抽敭瀛楁牎楠� keys.forEach(key => { let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig') if (_patten.test(val)) { - errors.push(_position + dict['main.excel.includekey'] + key) + errors.push(_position + '鍚湁鍏抽敭瀛�' + key) } }) } } else if (/^int/ig.test(col.type)) { if (!val && val !== 0) { - errors.push(_position + dict['main.excel.content.emptyerror']) + errors.push(_position + '鍐呭涓嶅彲涓虹┖') } else { let _val = val + '' if (!/^(([^0][0-9]+|0)$)|^(([1-9]+)$)/.test(_val)) { // 妫�楠屾槸鍚︿负鏁存暟 - errors.push(_position + dict['main.excel.content.interror']) + errors.push(_position + '鍐呭搴斾负鏁存暟') } else if ((col.min || col.min === 0) && val < col.min) { // 鏈�灏忓�兼楠� - errors.push(_position + dict['main.excel.content.limitmin']) + errors.push(_position + '灏忎簬鏈�灏忓��') } else if ((col.max || col.max === 0) && val > col.max) { // 鏈�澶у�兼楠� - errors.push(_position + dict['main.excel.content.limitmax']) + errors.push(_position + '澶т簬鏈�澶у��') } } } else if (/^Decimal/ig.test(col.type)) { if (!val && val !== 0) { - errors.push(_position + dict['main.excel.content.emptyerror']) + errors.push(_position + '鍐呭涓嶅彲涓虹┖') } else { let _val = val + '' let _vals = _val.split('.') if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(_val)) { // 妫�楠屾槸鍚︿负娴偣鏁� - errors.push(_position + dict['main.excel.content.floaterror']) + errors.push(_position + '鍐呭搴斾负娴偣鏁�') } else if (_vals[0].length > 18) { // 妫�楠屾暣鏁颁綅 - errors.push(_position + dict['main.excel.content.floatIntover']) + errors.push(_position + '鏁存暟浣嶈秴鍑鸿寖鍥�') } else if (_vals[1] && _vals[1].length > col.limit) { // 鏈�灏忓�兼楠� - errors.push(_position + dict['main.excel.content.floatPointover']) + errors.push(_position + '灏忔暟浣嶈秴鍑鸿寖鍥�') } else if ((col.min || col.min === 0) && val < col.min) { // 鏈�灏忓�兼楠� - errors.push(_position + dict['main.excel.content.limitmin']) + errors.push(_position + '灏忎簬鏈�灏忓��') } else if ((col.max || col.max === 0) && val > col.max) { // 鏈�澶у�兼楠� - errors.push(_position + dict['main.excel.content.limitmax']) + errors.push(_position + '澶т簬鏈�澶у��') } } } else if (col.type === 'date') { if (typeof(val) === 'number') { if (val > 2958465 || val <= 0) { // 鏃堕棿杩囧ぇ鎴栧皬浜庣瓑浜�0 - errors.push(_position + dict['main.excel.content.date.over']) + errors.push(_position + '鏃堕棿涓鸿礋鍊兼垨澶ぇ') } else { // 鏃堕棿鏍煎紡鍖� if (val < 60) { // 1900-2-29锛宔xcel涓瓨鍦紝瀹為檯涓嶅瓨鍦� val++ @@ -1023,12 +1022,12 @@ } else if (typeof(val) === 'string') { val = val.replace(/(^\s*$)|\t*|\v*/ig, '') if (!val && col.required === 'true') { // 鏃堕棿蹇呭~鏍¢獙 - errors.push(_position + dict['main.excel.content.emptyerror']) + errors.push(_position + '鍐呭涓嶅彲涓虹┖') } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 鏃堕棿姝e垯鏍¢獙 - errors.push(_position + dict['main.excel.content.date.formatError']) + errors.push(_position + '鏃堕棿鏍煎紡閿欒') } } else { // 鏃堕棿鏍煎紡閿欒 - errors.push(_position + dict['main.excel.content.date.formatError']) + errors.push(_position + '鏃堕棿鏍煎紡閿欒') } } @@ -1708,7 +1707,7 @@ /* 澶辨晥楠岃瘉 */ select @tbid='', @ErrorCode='',@retmsg='' select @tbid='X' from ${datasource} right join (select ID from dbo.SplitComma(@ID@)) sp - on tb.id =sp.id where tb.id is null + on tb.${primaryKey} =sp.id where tb.${primaryKey} is null If @tbid!='' Begin @@ -2254,36 +2253,21 @@ */ export function setGLOBFuncs () { window.GLOB.funcs = [] - if (!window.GLOB.WebSql && !window.GLOB.IndexDB) { + if (!window.GLOB.IndexDB) { return } - if (window.GLOB.WebSql) { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql("SELECT * FROM FUNCS", [], (tx, results) => { - let rows = results.rows - if (!rows || rows.length === 0) return - for (let i = 0; i < rows.length; i++) { - window.GLOB.funcs.push({ - func_code: rows[i].func_code, - key_sql: window.decodeURIComponent(window.atob(rows[i].key_sql)) - }) - } + let objectStore = window.GLOB.IndexDB.transaction('funcs').objectStore('funcs') + + objectStore.openCursor().onsuccess = (event) => { + let cursor = event.target.result + + if (cursor) { + window.GLOB.funcs.push({ + func_code: cursor.value.func_code, + key_sql: window.decodeURIComponent(window.atob(cursor.value.key_sql)) }) - }) - } else { - let objectStore = window.GLOB.IndexDB.transaction('funcs').objectStore('funcs') - - objectStore.openCursor().onsuccess = (event) => { - let cursor = event.target.result - - if (cursor) { - window.GLOB.funcs.push({ - func_code: cursor.value.func_code, - key_sql: window.decodeURIComponent(window.atob(cursor.value.key_sql)) - }) - cursor.continue() - } + cursor.continue() } } } diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index a54a3b7..ff500da 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -508,15 +508,24 @@ let _href = window.location.href.split('#')[0] + 'app_record' let record = localStorage.getItem(_href) record = record ? JSON.parse(record) : null - - if (record) { - if (record.activeId) { - let index = applist.findIndex(item => item.ID === record.activeId) - if (index === -1) { - localStorage.setItem(_href, JSON.stringify({preId: '', activeId: ''})) - } else if (index !== 0) { - applist.unshift(...applist.splice(index, 1)) + + if (record && record.dates) { + let ids = applist.map(item => item.ID) + let reset = false + + Object.keys(record.dates).forEach(key => { + if (!ids.includes(key)) { + delete record.dates[key] + reset = true } + }) + + applist.sort((a, b) => { + return (record.dates[b.ID] || 0) - (record.dates[a.ID] || 0) + }) + + if (reset) { + localStorage.setItem(_href, JSON.stringify(record)) } } } @@ -698,11 +707,11 @@ let record = localStorage.getItem(_href) record = record ? JSON.parse(record) : null - if (!record) { - localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: ''})) + if (!record || !record.dates) { + localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {[selectApp.ID]: new Date().getTime()}})) } else { - if (record.preId === selectApp.ID) { - localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID})) + if (record.preId === selectApp.ID || record.activeId === selectApp.ID) { + localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {...record.dates, [selectApp.ID]: new Date().getTime()}})) } else { localStorage.setItem(_href, JSON.stringify({...record, preId: selectApp.ID})) } diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index b616463..70a2505 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -26,6 +26,7 @@ const NormalTable = asyncComponent(() => import('@/tabviews/custom/components/table/normal-table')) const SandBox = asyncComponent(() => import('@/tabviews/custom/components/code/sand-box')) const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline')) +const BraftEditor = asyncComponent(() => import('@/tabviews/custom/components/editor/braft-editor')) const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony')) const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) @@ -60,7 +61,6 @@ let param = JSON.parse(window.decodeURIComponent(window.atob(params.param))) sessionStorage.setItem('dataM', param.dataM || '') - sessionStorage.setItem('localDataM', param.dataM || '') this.setState({ BID: param.id || '', tempId: param.tempId, @@ -455,13 +455,23 @@ } reload = () => { + const { tempId } = this.state + this.setState({ loadingview: true, pages: null, data: '', config: null }, () => { - this.getMenuParam() + Api.deleteMenuStorage(tempId) + setTimeout(() => { + this.getMenuParam() + }, 50) + // Api.getAppVersion(tempId).then(() => { + // this.getMenuParam() + // }, () => { + // this.getMenuParam() + // }) }) } @@ -874,6 +884,12 @@ <TimeLine config={item} initdata={item.data} mainSearch={[]}/> </Col> ) + } else if (item.type === 'editor') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <BraftEditor config={item} initdata={item.data} mainSearch={[]}/> + </Col> + ) } else if (item.type === 'antvG6') { return ( <Col span={item.width} style={style} key={item.uuid}> diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx index 39078cd..2155478 100644 --- a/src/views/design/header/index.jsx +++ b/src/views/design/header/index.jsx @@ -237,7 +237,7 @@ } setSystemFuncs = () => { - if (!window.GLOB.WebSql && !window.GLOB.IndexDB) { + if (!window.GLOB.IndexDB) { return } this.getfuncTime().then(res => { @@ -256,80 +256,44 @@ } writeFuncs = (funcs) => { - let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + let shim = +sessionStorage.getItem('sys_time_shim') + let timestamp = moment().add(shim, 'seconds').format('YYYY-MM-DD HH:mm:ss') - let sys_datetime = sessionStorage.getItem('sys_datetime') - let app_datetime = sessionStorage.getItem('app_datetime') - if (sys_datetime && app_datetime) { - let seconds = Math.floor((new Date().getTime() - app_datetime) / 1000) - timestamp = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss') - } + let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs') - if (window.GLOB.WebSql) { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql('DELETE FROM FUNCS') + objectStore.clear() - funcs.forEach(item => { - if (!item.key_sql) return - tx.executeSql('INSERT INTO FUNCS (func_code, key_sql) VALUES (?, ?)', [item.func_code, item.key_sql]) - }) - tx.executeSql(`UPDATE VERSIONS SET createDate='${timestamp}' where CDefine1='funcs'`) - }) - } else { - let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs') + funcs.forEach(item => { + if (!item.key_sql) return + item.id = item.func_code + objectStore.add(item) + }) - objectStore.clear() - - funcs.forEach(item => { - if (!item.key_sql) return - item.id = item.func_code - objectStore.add(item) - }) - - let funcStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') - funcStore.put({id: 'funcs', version: '1.0', createDate: timestamp}) - } + let funcStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') + funcStore.put({id: 'funcs', version: '1.0', createDate: timestamp}) } getfuncTime = () => { return new Promise((resolve, reject) => { - if (window.GLOB.WebSql) { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql("SELECT * FROM VERSIONS where CDefine1='funcs'", [], (tx, results) => { - let rows = results.rows - if (rows.length === 0) { - tx.executeSql('DELETE FROM FUNCS') - tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', ['1.0', '1970-01-01 14:59:09.000', 'funcs']) - resolve({createDate: '1970-01-01 14:59:09.000'}) - } else { - resolve(rows[0]) - } - }, (tx, results) => { + let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') + let request = objectStore.get('funcs') + + request.onerror = (event) => { + console.warn(event) + reject() + } + + request.onsuccess = () => { + if (request.result) { + resolve(request.result) + } else { + let add = objectStore.add({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'}) + + add.onerror = () => { reject() - console.warn(results) - }) - }) - } else { - let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') - let request = objectStore.get('funcs') - - request.onerror = (event) => { - console.warn(event) - reject() - } - - request.onsuccess = () => { - if (request.result) { - resolve(request.result) - } else { - let add = objectStore.add({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'}) - - add.onerror = () => { - reject() - } - add.onsuccess = () => { - resolve({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'}) - } + } + add.onsuccess = () => { + resolve({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'}) } } } diff --git a/src/views/interface/api/index.js b/src/views/interface/api/index.js index 59f4941..37b374b 100644 --- a/src/views/interface/api/index.js +++ b/src/views/interface/api/index.js @@ -1,25 +1,30 @@ import axios from 'axios' import md5 from 'md5' import jsSHA from 'jssha' -import { notification } from 'antd' -window.GLOB.WebSql = null +window.GLOB.IndexDB = null -if (window.openDatabase) { - let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' +let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' +let db = `mk_inter${service}` + +if (window.indexedDB) { try { - window.GLOB.WebSql = openDatabase(`mkdb${service}`, '1', 'mk-pc-database', 50 * 1024 * 1024) - window.GLOB.WebSql.transaction(tx => { - tx.executeSql('CREATE TABLE IF NOT EXISTS INTERFACES (uuid varchar(50), createDate varchar(50), method varchar(50), interface text, params text, headers text, active varchar(50), raw text, formData text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50), CDefine4 varchar(50), CDefine5 text)', [], () => { - - }, () => { - // eslint-disable-next-line - throw 'CREATE TABLE ERROR' - }) - }) + let request = window.indexedDB.open(db, 1) + request.onerror = () => { + console.warn('IndexedDB 鍒濆鍖栧け璐ワ紒') + } + request.onsuccess = () => { + window.GLOB.IndexDB = request.result + } + request.onupgradeneeded = (event) => { + window.GLOB.IndexDB = event.target.result + if (!window.GLOB.IndexDB.objectStoreNames.contains('interfaces')) { + window.GLOB.IndexDB.createObjectStore('interfaces', { keyPath: 'id' }) + } + } } catch (e) { - console.warn('WebSql 鍒濆鍖栧け璐ワ紒') - window.GLOB.WebSql = null + console.warn('IndexedDB 鍒濆鍖栧け璐ワ紝鍘嗗彶璁板綍灏嗘棤娉曟煡璇㈡垨淇敼锛�') + window.GLOB.IndexDB = null } } @@ -102,73 +107,46 @@ return axios(config) } - writeInWebSql (data) { - if (!window.GLOB.WebSql) { - notification.warning({ top: 92, message: 'WebSql寮�鍚け璐ワ紒', duration: 5 }) - return - } - return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`INSERT INTO INTERFACES (uuid, createDate, method, interface, params, headers, active, raw, formData) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, data, (tx, results) => { - resolve(results) - }, () => { - resolve() - }) - }) - }) + writeInIndexDB (data) { + if (!window.GLOB.IndexDB) return + + window.GLOB.IndexDB.transaction(['interfaces'], 'readwrite').objectStore('interfaces').add(data) } getInterfaces () { - if (!window.GLOB.WebSql) { - notification.warning({ top: 92, message: 'WebSql寮�鍚け璐ワ紒', duration: 5 }) - return - } + if (!window.GLOB.IndexDB) return Promise.resolve() + return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`SELECT * FROM INTERFACES`, [], (tx, results) => { - // let paramItem = results.rows[0] - resolve(results) - }, () => { - window.GLOB.WebSql = null - reject() - }) - }) + let request = window.GLOB.IndexDB.transaction(['interfaces']).objectStore('interfaces').openCursor() + let list = [] + + request.onsuccess = (e) => { + let cursor = e.target.result + if (cursor) { + if (cursor.value) { + list.push(cursor.value) + } + cursor.continue() + } else { + resolve(list) + } + } }) } - delInterface (uuid) { - if (!window.GLOB.WebSql) { - notification.warning({ top: 92, message: 'WebSql寮�鍚け璐ワ紒', duration: 5 }) - return - } - return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM INTERFACES where uuid = '${uuid}'`, [], (tx, results) => { - resolve(results) - }, () => { - resolve() - }) - }) - }) + delInterface (id) { + if (!window.GLOB.IndexDB) return + + window.GLOB.IndexDB.transaction(['interfaces'], 'readwrite').objectStore('interfaces').delete(id) } /** * @description 娓呯┖鎺ュ彛璋冪敤璁板綍 */ clearInterfaces () { - if (!window.GLOB.WebSql) { - notification.warning({ top: 92, message: 'WebSql寮�鍚け璐ワ紒', duration: 5 }) - return - } - return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM INTERFACES`, [], (tx, results) => { - resolve(results) - }, () => { - resolve() - }) - }) - }) + if (!window.GLOB.IndexDB) return + + window.GLOB.IndexDB.transaction(['interfaces'], 'readwrite').objectStore('interfaces').clear() } } diff --git a/src/views/interface/history/index.jsx b/src/views/interface/history/index.jsx index 0db24fe..c9c9143 100644 --- a/src/views/interface/history/index.jsx +++ b/src/views/interface/history/index.jsx @@ -22,69 +22,13 @@ componentDidMount() { MKEmitter.addListener('insertInterface', this.insertInterface) setTimeout(() => { - Api.getInterfaces().then(res => { - if (!res || !res.rows) return - - let rows = [...res.rows] - rows.sort((a,b) => { - return a.createDate < b.createDate ? 1 : -1 - }) - - let list = [] - let item = null - - rows.forEach(m => { - let date = m.createDate.substring(0, 10) - - if (m.params) { - try { - m.params = JSON.parse(m.params) - } catch (e) { - m.params = [] - } - } else { - m.params = [] - } - - if (m.headers) { - try { - m.headers = JSON.parse(m.headers) - } catch (e) { - m.headers = [] - } - } else { - m.headers = [] - } - - if (m.formData) { - try { - m.formData = JSON.parse(m.formData) - } catch (e) { - m.formData = [] - } - } else { - m.formData = [] - } - - if (item && item.date !== date) { - list.push(item) - item = null - } - - if (!item) { - item = {date, sublist: []} - item.sublist.push(m) - } else if (item && item.date === date) { - item.sublist.push(m) - } - }) - - if (item) { - list.push(item) - } - - this.setState({list, historys: fromJS(list).toJS()}) - }) + if (window.GLOB.IndexDB) { + this.getHistory() + } else { + setTimeout(() => { + this.getHistory() + }, 1000) + } }, 200) } @@ -103,91 +47,136 @@ confirm({ content: 'Are you sure you want to clear all your history requests?', onOk() { - Api.clearInterfaces().then(res => { - if (res && res.rows.length === 0) { - _this.setState({list: [], historys: []}) - Modal.success({ - title: '娓呴櫎鎴愬姛銆�' - }) - } else { - Modal.error({ - title: '娓呴櫎澶辫触锛佽鍒锋柊閲嶈瘯銆�' - }) - } - }) + Api.clearInterfaces() + + _this.setState({list: [], historys: []}) }, onCancel() {} }) } - delete = (m) => { - const { searchKey } = this.state - Api.delInterface(m.uuid).then(res => { - if (res) { - let list = this.state.list.filter(item => { - item.sublist = item.sublist.filter(cell => cell.uuid !== m.uuid) - - return item.sublist.length > 0 - }) + getHistory = () => { + Api.getInterfaces().then(res => { + if (!res) return - let historys = fromJS(list).toJS() - if (searchKey) { - historys = historys.filter(item => { - item.sublist = item.sublist.filter(cell => cell.interface.indexOf(searchKey) > -1) - - return item.sublist.length > 0 - }) + res.sort((a,b) => { + return a.createDate < b.createDate ? 1 : -1 + }) + + let list = [] + let item = null + + res.forEach(m => { + let date = m.createDate.substring(0, 10) + + if (m.params) { + try { + m.params = JSON.parse(m.params) + } catch (e) { + m.params = [] + } + } else { + m.params = [] } - this.setState({list, historys}) - } else { - Modal.error({ - title: '鍒犻櫎澶辫触锛佽鍒锋柊閲嶈瘯銆�' - }) + if (m.headers) { + try { + m.headers = JSON.parse(m.headers) + } catch (e) { + m.headers = [] + } + } else { + m.headers = [] + } + + if (m.formData) { + try { + m.formData = JSON.parse(m.formData) + } catch (e) { + m.formData = [] + } + } else { + m.formData = [] + } + + if (item && item.date !== date) { + list.push(item) + item = null + } + + if (!item) { + item = {date, sublist: []} + item.sublist.push(m) + } else if (item && item.date === date) { + item.sublist.push(m) + } + }) + + if (item) { + list.push(item) } + + this.setState({list, historys: fromJS(list).toJS()}) }) } + delete = (m) => { + const { searchKey } = this.state + + Api.delInterface(m.id) + + let list = this.state.list.filter(item => { + item.sublist = item.sublist.filter(cell => cell.id !== m.id) + + return item.sublist.length > 0 + }) + + let historys = fromJS(list).toJS() + if (searchKey) { + historys = historys.filter(item => { + item.sublist = item.sublist.filter(cell => cell.interface.indexOf(searchKey) > -1) + + return item.sublist.length > 0 + }) + } + + this.setState({list, historys}) + } + insertInterface = (item) => { - item.uuid = Utils.getuuid() + item.id = Utils.getuuid() item.createDate = moment().format('YYYY-MM-DD HH:mm:ss') - Api.writeInWebSql([item.uuid, item.createDate, item.method, item.interface, JSON.stringify(item.params), JSON.stringify(item.headers), item.active, item.raw, JSON.stringify(item.formData)]).then(res => { - if (res) { - let list = fromJS(this.state.list).toJS() + Api.writeInIndexDB(item) - if (list[0]) { - if (list[0].date === item.createDate.substring(0, 10)) { - list[0].sublist.unshift(item) - } else { - list.unshift({ - date: item.createDate.substring(0, 10), - sublist: [item] - }) - } - } else { - list.push({ - date: item.createDate.substring(0, 10), - sublist: [item] - }) - } + let list = fromJS(this.state.list).toJS() - let historys = fromJS(list).toJS() - if (this.state.searchKey) { - historys = historys.filter(item => { - item.sublist = item.sublist.filter(cell => cell.interface.indexOf(this.state.searchKey) > -1) - - return item.sublist.length > 0 - }) - } - - this.setState({ list, historys }) + if (list[0]) { + if (list[0].date === item.createDate.substring(0, 10)) { + list[0].sublist.unshift(item) } else { - Modal.error({ - title: '娣诲姞澶辫触锛佽鍒锋柊閲嶈瘯銆�' + list.unshift({ + date: item.createDate.substring(0, 10), + sublist: [item] }) } - }) + } else { + list.push({ + date: item.createDate.substring(0, 10), + sublist: [item] + }) + } + + let historys = fromJS(list).toJS() + if (this.state.searchKey) { + historys = historys.filter(item => { + item.sublist = item.sublist.filter(cell => cell.interface.indexOf(this.state.searchKey) > -1) + + return item.sublist.length > 0 + }) + } + + this.setState({ list, historys }) } use = (m) => { @@ -204,7 +193,7 @@ method: 'POST', params: [], raw: "{\n \"UserName\":\"******\",\n \"Password\":\"******\",\n \"systemType\":\"local\",\n \"Type\":\"鍏挜\",\n \"privatekey\":\"绉侀挜\",\n \"timestamp\":\"" + moment().format('YYYY-MM-DD HH:mm:ss') + "\",\n \"appkey\":\"" + window.GLOB.appkey + "\"\n}", - uuid: 'dologon' + id: 'dologon' } if (window.GLOB.mainSystemApi) { @@ -223,7 +212,7 @@ method: 'POST', params: [], raw: "{\n \"func\":\"******\",\n \"LoginUID\":\"" + (sessionStorage.getItem('LoginUID') || "******") + "\",\n \"UserID\":\"" + (sessionStorage.getItem('UserID') || "******") + "\",\n \"nonc\":\"" + Utils.getguid() + "\",\n \"t\":" + parseInt(new Date().getTime() / 1000) + "\n}", - uuid: 'dologon' + id: 'dologon' } MKEmitter.emit('useInterface', m) } @@ -258,7 +247,7 @@ <div className="list-line" key={index}> <div className="line-title">{item.date}</div> {item.sublist.map(m => ( - <div className="line-item" key={m.uuid}> + <div className="line-item" key={m.id}> <div className="method">POST</div> <div className="inter">{m.interface}</div> <div className="action"> diff --git a/src/views/interface/workspace/index.jsx b/src/views/interface/workspace/index.jsx index 58c0b71..a750938 100644 --- a/src/views/interface/workspace/index.jsx +++ b/src/views/interface/workspace/index.jsx @@ -12,7 +12,7 @@ class WorkSpace extends Component { state = { tabviews: [{ - uuid: Utils.getuuid(), + id: Utils.getuuid(), createDate: '', method: 'POST', interface: '', @@ -39,24 +39,24 @@ } useInterface = (item) => { - item.uuid = Utils.getuuid() + item.id = Utils.getuuid() this.setState({tabviews: [...this.state.tabviews, item]}, () => { - let div = document.getElementById(item.uuid) + let div = document.getElementById(item.id) div && div.click && div.click() }) } handleTabview = (view) => { let tabviews = fromJS(this.state.tabviews).toJS() - tabviews = tabviews.filter(item => item.uuid !== view.uuid) + tabviews = tabviews.filter(item => item.id !== view.id) this.setState({tabviews}, () => { if (tabviews.length > 0) return setTimeout(() => { this.setState({tabviews: [{ - uuid: Utils.getuuid(), + id: Utils.getuuid(), createDate: '', method: 'POST', interface: '', @@ -72,7 +72,7 @@ handleAdd = () => { let item = { - uuid: Utils.getuuid(), + id: Utils.getuuid(), createDate: '', method: 'POST', interface: '', @@ -83,7 +83,7 @@ formData: [] } this.setState({tabviews: [...this.state.tabviews, item]}, () => { - let div = document.getElementById(item.uuid) + let div = document.getElementById(item.id) div && div.click && div.click() }) } @@ -99,7 +99,7 @@ return ( <Tabs.TabPane tab={ - <span className="control" id={view.uuid || ''}> + <span className="control" id={view.id || ''}> <span className="method"> {view.method || 'POST'} </span> @@ -109,7 +109,7 @@ <CloseOutlined onClick={() => this.handleTabview(view)}/> </span> } - key={view.uuid} + key={view.id} > <Request config={view} /> </Tabs.TabPane> diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 0a64ba1..2738aa7 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -91,13 +91,11 @@ sessionStorage.setItem('Full_Name', res.FullName) sessionStorage.setItem('avatar', res.icon || '') sessionStorage.setItem('dataM', res.dataM ? 'true' : '') - sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') sessionStorage.setItem('debug', res.debug || '') sessionStorage.setItem('role_id', res.role_id || '') sessionStorage.setItem('departmentcode', res.departmentcode || '') 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) @@ -195,13 +193,11 @@ sessionStorage.setItem('Full_Name', res.FullName) sessionStorage.setItem('avatar', res.icon || '') sessionStorage.setItem('dataM', res.dataM ? 'true' : '') - sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') sessionStorage.setItem('debug', res.debug || '') sessionStorage.setItem('role_id', res.role_id || '') sessionStorage.setItem('departmentcode', res.departmentcode || '') 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) @@ -246,13 +242,11 @@ sessionStorage.setItem('Full_Name', res.FullName) sessionStorage.setItem('avatar', res.icon || '') sessionStorage.setItem('dataM', res.dataM ? 'true' : '') - sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') sessionStorage.setItem('debug', res.debug || '') sessionStorage.setItem('role_id', res.role_id || '') sessionStorage.setItem('departmentcode', res.departmentcode || '') 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) @@ -631,10 +625,12 @@ } sessionStorage.setItem('home_background', res.index_background_color || '') + + let seconds = 0 if (res.sys_datetime) { - sessionStorage.setItem('sys_datetime', res.sys_datetime) - sessionStorage.setItem('app_datetime', new Date().getTime()) + seconds = Math.floor((new Date(res.sys_datetime).getTime() - new Date().getTime()) / 1000) } + sessionStorage.setItem('sys_time_shim', isNaN(seconds) ? 0 : seconds) // url鏍囬 document.title = systemMsg.platTitle diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index ce3e6e5..e816b50 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -758,6 +758,35 @@ return true } + resetSyncQuery = (components) => { + return components.map(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + tab.components = this.resetSyncQuery(tab.components) + }) + } else if (item.type === 'group') { + item.components = this.resetSyncQuery(item.components) + } else if (item.setting && item.setting.interType === 'system' && item.setting.sync === 'true') { + let sql = '' + if (item.setting.execute !== 'false' && item.setting.dataresource) { + sql = item.setting.dataresource + } + + item.scripts && item.scripts.forEach(script => { + if (script.status === 'false') return + + sql += script.sql + }) + + if (sql.length > 8000) { + item.setting.sync = 'false' + } + } + + return item + }) + } + submitConfig = () => { const { MenuType } = this.state let config = fromJS(this.state.config).toJS() @@ -778,6 +807,10 @@ setTimeout(() => { if (config.enabled && this.verifyConfig()) { config.enabled = false + } + + if (config.cacheUseful !== 'true') { + config.components = this.resetSyncQuery(config.components) } let tbs = [] @@ -1051,7 +1084,7 @@ carousel: '杞挱', tree: '鏍戝舰鍒楄〃', chart: '鑷畾涔夊浘琛�', - editor: '瀵屾枃鏈�', + // editor: '瀵屾枃鏈�', group: '鍒嗙粍', iframe: 'iframe' } diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index bd6d38f..7c8be79 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -432,7 +432,7 @@ }} /> </Form.Item> </Col> - <Col span={24}> + <Col span={24} className="red-font"> <Form.Item label="澶囨敞"> {getFieldDecorator('Remark', { initialValue: config.Remark || '', diff --git a/src/views/menudesign/menuform/index.scss b/src/views/menudesign/menuform/index.scss index fa61282..39343af 100644 --- a/src/views/menudesign/menuform/index.scss +++ b/src/views/menudesign/menuform/index.scss @@ -5,4 +5,12 @@ font-size: 12px; } } + .red-font { + label { + color: red; + } + textarea { + color: red; + } + } } \ No newline at end of file diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 7e740f5..dc5675f 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -1189,6 +1189,18 @@ menus.push(menuObj[cell.openmenu]) } }) + + if (item.subtype === 'dualdatacard') { + card.backElements && card.backElements.forEach(cell => { + if (cell.eleType !== 'button') return + + if (cell.linkmenu && menuObj[cell.linkmenu]) { + menus.push(menuObj[cell.linkmenu]) + } else if (cell.openmenu && menuObj[cell.openmenu]) { + menus.push(menuObj[cell.openmenu]) + } + }) + } }) } else if (item.type === 'balcony') { item.elements && item.elements.forEach(cell => { @@ -1321,6 +1333,35 @@ return _style } + resetSyncQuery = (components) => { + return components.map(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + tab.components = this.resetSyncQuery(tab.components) + }) + } else if (item.type === 'group') { + item.components = this.resetSyncQuery(item.components) + } else if (item.setting && item.setting.interType === 'system' && item.setting.sync === 'true') { + let sql = '' + if (item.setting.execute !== 'false' && item.setting.dataresource) { + sql = item.setting.dataresource + } + + item.scripts && item.scripts.forEach(script => { + if (script.status === 'false') return + + sql += script.sql + }) + + if (sql.length > 8000) { + item.setting.sync = 'false' + } + } + + return item + }) + } + submitConfig = () => { const { adapters } = this.state let config = fromJS(this.state.config).toJS() @@ -1345,6 +1386,10 @@ setTimeout(() => { if (config.enabled && this.verifyConfig()) { config.enabled = false + } + + if (config.cacheUseful !== 'true') { + config.components = this.resetSyncQuery(config.components) } let tbs = [] @@ -1769,12 +1814,22 @@ let config = fromJS(this.state.config).toJS() if (item.type === 'search') { - notification.warning({ - top: 92, - message: '绉诲姩绔悳绱㈢粍浠朵笉鍙矘璐达紒', - duration: 5 - }) - return + if (config.components.filter(card => card.type === 'topbar' && card.wrap.type !== 'navbar').length > 0) { + notification.warning({ + top: 92, + message: '瀵艰埅鏍忎娇鐢ㄤ簡鎼滅储锛屼笉鍙坊鍔犳悳绱㈢粍浠讹紒', + duration: 5 + }) + return + } + if (config.components.filter(card => card.type === 'search').length > 0) { + notification.warning({ + top: 92, + message: '鎼滅储鏉′欢涓嶅彲閲嶅娣诲姞锛�', + duration: 5 + }) + return + } } if (item.type === 'topbar') { diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx index 9846e84..8a6b1b7 100644 --- a/src/views/mobdesign/menuform/index.jsx +++ b/src/views/mobdesign/menuform/index.jsx @@ -331,7 +331,7 @@ )} </Form.Item> </Col> : null} - <Col span={24}> + <Col span={24} className="red-font"> <Form.Item label="澶囨敞"> {getFieldDecorator('Remark', { initialValue: config.Remark || '', diff --git a/src/views/mobdesign/menuform/index.scss b/src/views/mobdesign/menuform/index.scss index 9c0c867..71c35b5 100644 --- a/src/views/mobdesign/menuform/index.scss +++ b/src/views/mobdesign/menuform/index.scss @@ -39,4 +39,12 @@ } } } + .red-font { + label { + color: red; + } + textarea { + color: red; + } + } } \ No newline at end of file diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index c524734..1f071f1 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -1004,6 +1004,16 @@ menus.push(menuObj[cell.openmenu]) } }) + + card.backElements && card.backElements.forEach(cell => { + if (cell.eleType !== 'button') return + + if (cell.linkmenu && menuObj[cell.linkmenu]) { + menus.push(menuObj[cell.linkmenu]) + } else if (cell.openmenu && menuObj[cell.openmenu]) { + menus.push(menuObj[cell.openmenu]) + } + }) }) } else if (item.type === 'balcony') { item.elements && item.elements.forEach(cell => { @@ -1074,6 +1084,35 @@ return true } + resetSyncQuery = (components) => { + return components.map(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + tab.components = this.resetSyncQuery(tab.components) + }) + } else if (item.type === 'group') { + item.components = this.resetSyncQuery(item.components) + } else if (item.setting && item.setting.interType === 'system' && item.setting.sync === 'true') { + let sql = '' + if (item.setting.execute !== 'false' && item.setting.dataresource) { + sql = item.setting.dataresource + } + + item.scripts && item.scripts.forEach(script => { + if (script.status === 'false') return + + sql += script.sql + }) + + if (sql.length > 8000) { + item.setting.sync = 'false' + } + } + + return item + }) + } + submitConfig = () => { let config = fromJS(this.state.config).toJS() @@ -1090,6 +1129,10 @@ config.enabled = false } + if (config.cacheUseful !== 'true') { + config.components = this.resetSyncQuery(config.components) + } + let tbs = [] let roleParam = this.getMenuMessage(tbs) diff --git a/src/views/pcdesign/menuform/index.jsx b/src/views/pcdesign/menuform/index.jsx index 1d7147c..7bc9112 100644 --- a/src/views/pcdesign/menuform/index.jsx +++ b/src/views/pcdesign/menuform/index.jsx @@ -209,7 +209,7 @@ )} </Form.Item> </Col> : null} - <Col span={24}> + <Col span={24} className="red-font"> <Form.Item label="澶囨敞"> {getFieldDecorator('Remark', { initialValue: config.Remark || '', diff --git a/src/views/pcdesign/menuform/index.scss b/src/views/pcdesign/menuform/index.scss index fa61282..39343af 100644 --- a/src/views/pcdesign/menuform/index.scss +++ b/src/views/pcdesign/menuform/index.scss @@ -5,4 +5,12 @@ font-size: 12px; } } + .red-font { + label { + color: red; + } + textarea { + color: red; + } + } } \ No newline at end of file diff --git a/src/views/sso/index.jsx b/src/views/sso/index.jsx index 24c8648..fd3b884 100644 --- a/src/views/sso/index.jsx +++ b/src/views/sso/index.jsx @@ -32,13 +32,11 @@ sessionStorage.setItem('Full_Name', res.FullName) sessionStorage.setItem('avatar', res.icon || '') sessionStorage.setItem('dataM', res.dataM ? 'true' : '') - sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') sessionStorage.setItem('debug', res.debug || '') sessionStorage.setItem('role_id', res.role_id || '') sessionStorage.setItem('departmentcode', res.departmentcode || '') sessionStorage.setItem('organization', res.organization || '') sessionStorage.setItem('mk_user_type', res.mk_user_type || '') - sessionStorage.setItem('localRole_id', res.role_id || '') this.getMessage() } else { @@ -108,10 +106,12 @@ } sessionStorage.setItem('home_background', res.index_background_color || '') + + let seconds = 0 if (res.sys_datetime) { - sessionStorage.setItem('sys_datetime', res.sys_datetime) - sessionStorage.setItem('app_datetime', new Date().getTime()) + seconds = Math.floor((new Date(res.sys_datetime).getTime() - new Date().getTime()) / 1000) } + sessionStorage.setItem('sys_time_shim', isNaN(seconds) ? 0 : seconds) // url鏍囬 document.title = systemMsg.platTitle diff --git a/src/views/systemfunc/index.jsx b/src/views/systemfunc/index.jsx index c0ef10e..6910e9b 100644 --- a/src/views/systemfunc/index.jsx +++ b/src/views/systemfunc/index.jsx @@ -4,6 +4,7 @@ import asyncComponent from '@/utils/asyncComponent' import Header from './header' +import MKEmitter from '@/utils/events.js' import Sidemenu from './sidemenu' // import './index.scss' @@ -12,6 +13,8 @@ class Design extends Component { UNSAFE_componentWillMount() { + sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id')) + sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM')) document.body.className = 'mk-blue-black' sessionStorage.setItem('isEditState', 'true') window.GLOB.mkHS = true @@ -25,6 +28,18 @@ value: false }) } + + componentDidMount () { + MKEmitter.addListener('resetSelectLine', this.resetParentParam) + } + + componentWillUnmount () { + MKEmitter.removeListener('resetSelectLine', this.resetParentParam) + } + + resetParentParam = (MenuID, id, data) => { + window.GLOB.CacheData.set(MenuID, {...data, $BID: id}) + } render () { return ( diff --git a/src/views/systemfunc/sidemenu/config.jsx b/src/views/systemfunc/sidemenu/config.jsx index 9adbd43..e62128f 100644 --- a/src/views/systemfunc/sidemenu/config.jsx +++ b/src/views/systemfunc/sidemenu/config.jsx @@ -12,33 +12,26 @@ MenuName: '鏁版嵁瀛楀吀', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1581734956310scks442ul2d955g9tu5', MenuNo: 'sVersionM', MenuName: '浼犺緭鍙风鐞�', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1583991994144ndddg0bhh0is6shi0v1', MenuNo: 'sVersionQueryM', MenuName: '浼犺緭鍙锋煡璇�', }, { src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1583979633842550imkchl4qt4qppsiv', MenuNo: 'sVersionMUpgrade', MenuName: '鐗堟湰鍗囩骇', - // }, { - // src: '', - // PageParam: {OpenType: 'newtab', Template: 'TabManage'}, - // type: 'TabManage', - // MenuID: 'TabManageView', - // MenuNo: 'TabManage', - // MenuName: '鏍囩椤电鐞�', }, { src: '', PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, @@ -48,60 +41,46 @@ MenuName: '鏍囩鎵撳嵃妯℃澘', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '16044812935562g807p3p12huk8kokmb', MenuNo: 'sPrintTemplate_webM', MenuName: '鍗曟嵁鎵撳嵃妯℃澘', }, { src: '', systems: ['SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1585192949946f3et2ts8tn82krmumdf', MenuNo: 'MyAppManage', MenuName: '绯荤粺UI', }, { src: '', systems: ['SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '15855615451212m12ip23vpcm79kloro', MenuNo: 'sUsersAppM', MenuName: '绯荤粺鐢ㄦ埛绠$悊', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1587005717541lov40vg61q7l1rbveon', MenuNo: 's_custom_scriptM', MenuName: '鑷畾涔夊嚱鏁�', }, { - // src: '', - // PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - // type: 'CommonTable', - // MenuID: '1590458676585agbbr63t6ihighg2i1g', - // MenuNo: 'LdropdownmenuNewM', - // MenuName: '閫氱敤涓嬫媺鑿滃崟', - // }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1602315375262ikd33ii0nii34pt861o', MenuNo: 's_worksflow_roleM', MenuName: '鍏抽敭瑙掕壊绠$悊', - // }, { - // src: '', - // PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - // type: 'CommonTable', - // MenuID: '1606794243739c5ihs58lucpskp3r4s2', - // MenuNo: 's_custom_componentsM', - // MenuName: '鑷畾涔夌粍浠�', }, { src: '', systems: ['production', 'local'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '15827879285193g85m3i2uprektpgmpf', MenuNo: 'bd_mes_techM', MenuName: '宸ヨ壓涓绘暟鎹�', @@ -112,8 +91,8 @@ PageParam: {Icon: 'folder'}, children: [{ src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1582771068837vsv54a089lgp45migbg', MenuNo: 'KUNTitleM', MenuName: '鎺ュ彛涓绘暟鎹�', @@ -154,8 +133,8 @@ MenuName: '鍐欏叆鎺ュ彛', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '15848421131551gg04ie8sitsd3f7467', MenuNo: 'KUNOsMainM', MenuName: '澶栭儴鎺ュ彛', @@ -166,32 +145,18 @@ PageParam: {Icon: 'folder'}, children: [{ src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1589782279158ngr675kk3oksin35sul', MenuNo: 'bd_msn_emailM', MenuName: '閭欢鏈嶅姟鍣�', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1589788042787ffdt9hle4s45k9r1nvs', MenuNo: 'bd_msn_email_tempM', MenuName: '閭欢妯℃澘', - // }, { - // src: '', - // PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - // type: 'CommonTable', - // MenuID: '15900310928174dro07ihfckghpb5h13', - // MenuNo: 'bd_msn_sms_tempM', - // MenuName: '澶т簬鐭俊妯℃澘', - // }, { - // src: '', - // PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - // type: 'CommonTable', - // MenuID: '1599613340050c8nu6rbst9d4emnnbsq', - // MenuNo: 's_sms_qxM', - // MenuName: '濂囦簯鐭俊妯℃澘', }] }, { MenuID: 'systemPayManage', @@ -200,8 +165,8 @@ children: [{ src: '', systems: ['local', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1594095599055qicg2eb642v5qglhnuo', MenuNo: 's_weixin_pay_bdM', MenuName: '寰俊鏀粯', @@ -213,46 +178,46 @@ children: [{ src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1577972969199lei1g0qkvlh4tkc908m', MenuNo: 'sModularM', MenuName: '绯荤粺妯″潡', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1578479100252lfbp29v1kafk4s4q4ig', MenuNo: 'BDLanguagePacksM', MenuName: '璇█鍖�', }, { src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1577971621421tg4v0i1ur8873k7e0ob', MenuNo: 'sSystemParametersM', MenuName: '鎺ュ彛鍦板潃', }, { src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1577929944419lgc5h3hepum765e2k7u', MenuNo: 'sProcExcepM', MenuName: '鎶ラ敊鏃ュ織', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, - type: 'CommonTable', + PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, + type: 'BaseTable', MenuID: '1588493493409k9guqp067d31lu7blsv', MenuNo: 's_job_stepM', MenuName: '璁″垝浠诲姟', }, { src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, - type: 'BaseTable', + PageParam: {OpenType: 'newtab', Template: 'CustomPage'}, + type: 'CustomPage', MenuID: '1670296054432ab9d5c0pf76o93315ag', MenuNo: 's_sys_job_history_M', MenuName: '浠g悊浣滀笟璁板綍', diff --git a/src/views/systemproc/proc/index.jsx b/src/views/systemproc/proc/index.jsx index cad4d02..f5156bb 100644 --- a/src/views/systemproc/proc/index.jsx +++ b/src/views/systemproc/proc/index.jsx @@ -108,7 +108,8 @@ {key: 'alter', reg: /(^|\s)alter\s/ig}, {key: 'object', reg: /(^|\s)object(\s|\()/ig}, {key: 'kill', reg: /(^|\s)kill\s/ig}, - {key: '--', reg: /--/ig} + {key: '--', reg: /--/ig}, + {key: ',,', reg: /,,/ig} ] let error = '' diff --git a/src/views/tabledesign/menuform/index.jsx b/src/views/tabledesign/menuform/index.jsx index 5e16759..0d1dcea 100644 --- a/src/views/tabledesign/menuform/index.jsx +++ b/src/views/tabledesign/menuform/index.jsx @@ -347,7 +347,7 @@ })(<Input placeholder="" autoComplete="off" onChange={this.changeEasyCode}/>)} </Form.Item> </Col> - <Col span={24}> + <Col span={24} className="red-font"> <Form.Item label="澶囨敞"> {getFieldDecorator('Remark', { initialValue: config.Remark || '', diff --git a/src/views/tabledesign/menuform/index.scss b/src/views/tabledesign/menuform/index.scss index fa61282..39343af 100644 --- a/src/views/tabledesign/menuform/index.scss +++ b/src/views/tabledesign/menuform/index.scss @@ -5,4 +5,12 @@ font-size: 12px; } } + .red-font { + label { + color: red; + } + textarea { + color: red; + } + } } \ No newline at end of file -- Gitblit v1.8.0