From e657b7ed2c047af4b54cbc26e5ac66cb7656dbb5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 12 十月 2022 12:13:05 +0800 Subject: [PATCH] 2022-10-12 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 1 src/tabviews/custom/components/card/prop-card/index.jsx | 28 ++ src/utils/utils-datamanage.js | 1 src/api/cacheutils.js | 312 ++++++++++++++++++++-------------- src/api/index.js | 134 +++++++++----- src/tabviews/debugtable/index.jsx | 10 src/components/header/index.jsx | 2 src/tabviews/debugtable/index.scss | 17 + 8 files changed, 309 insertions(+), 196 deletions(-) diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js index 3a983a0..ecf5475 100644 --- a/src/api/cacheutils.js +++ b/src/api/cacheutils.js @@ -5,10 +5,9 @@ /** * @description 鎵撳紑websql */ - static openWebSql (sysType) { - let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' + static openWebSql (db) { try { - window.GLOB.WebSql = openDatabase(`mkdb${service}`, '1', 'mk-pc-database', 50 * 1024 * 1024) + window.GLOB.WebSql = openDatabase(db, '1', 'mk-pc-database', 50 * 1024 * 1024) window.GLOB.WebSql.transaction(tx => { tx.executeSql('CREATE TABLE IF NOT EXISTS VERSIONS (version varchar(50), createDate varchar(50), CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => { @@ -23,7 +22,7 @@ throw 'CREATE TABLE ERROR' }) - if (sysType === 'local' && window.GLOB.systemType === '') { + if (window.GLOB.systemType === '') { tx.executeSql('CREATE TABLE IF NOT EXISTS FUNCS (func_code varchar(50), key_sql text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => { }, () => { @@ -45,8 +44,9 @@ /** * @description 娓呯┖鍑芥暟 */ - static clearFuncs (sysType) { - if (sysType !== 'local' || window.GLOB.systemType !== '') return + static clearFuncs () { + if (window.GLOB.systemType !== '') return + if (window.GLOB.WebSql) { window.GLOB.WebSql.transaction(tx => { tx.executeSql('DELETE FROM FUNCS') @@ -57,8 +57,7 @@ let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs') objectStore.clear() - let funcStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') - funcStore.put({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'}) + window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version').delete('funcs') } } @@ -69,32 +68,57 @@ if (!window.GLOB.WebSql) { return Promise.reject() } - return new Promise((resolve, reject) => { - window.GLOB.WebSql.transaction(tx => { - tx.executeSql("SELECT * FROM VERSIONS where CDefine1='LongParam'", [], (tx, results) => { - if (results.rows.length === 0) { - tx.executeSql('DELETE FROM VERSIONS') - tx.executeSql('DELETE FROM CONFIGS') + + let deffers = [] + + deffers.push( + new Promise((resolve) => { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql("SELECT * FROM VERSIONS where CDefine1='LongParam'", [], (tx, results) => { + if (results.rows[0]) { + resolve(results.rows[0]) + } else { + resolve({version: '', createDate: ''}) + } + }, (tx, results) => { + window.GLOB.WebSql = null + console.warn(results) resolve({version: '', createDate: ''}) - } else { - resolve(results.rows[0]) - } - }, (tx, results) => { - window.GLOB.WebSql = null - reject() - console.warn(results) + }) }) }) - }) - } + ) - /** - * @description 娓呯┖websql涓繚瀛樼殑閰嶇疆淇℃伅 - */ - static clearWebSqlConfig () { - if (!window.GLOB.WebSql) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, () => { window.GLOB.WebSql = null }) + deffers.push( + new Promise((resolve) => { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql(`SELECT * FROM CONFIGS`, [], (tx, results) => { + let menus = [] + for (let i = 0; i < results.rows.length; i++) { + menus.push(`'${results.rows[i].menuid}','${results.rows[i].openEdition || 'mk'}'`) + } + resolve(menus) + }, (tx, results) => { + window.GLOB.WebSql = null + console.warn(results) + resolve([]) + }) + }) + }) + ) + + return new Promise((resolve) => { + Promise.all(deffers).then(res => { + let result = res[0] + + if (result.createDate && !/^\d{4}-\d{2}-\d{2}/.test(result.createDate)) { + result.createDate = '' + } + + result.menuids = res[1].join(';') + + resolve(result) + }) }) } @@ -102,12 +126,19 @@ * @description 鍒犻櫎websql涓繚瀛樼殑閰嶇疆淇℃伅 */ static delWebSqlConfig (keys) { - if (!window.GLOB.WebSql || !keys) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`DELETE FROM CONFIGS where menuid in (${keys})`, [], () => {}, () => { - window.GLOB.WebSql = null + if (!window.GLOB.WebSql) return + + if (!keys) { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, () => { window.GLOB.WebSql = null }) }) - }) + } else { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql(`DELETE FROM CONFIGS where menuid in (${keys})`, [], () => {}, () => { + window.GLOB.WebSql = null + }) + }) + } } /** @@ -128,38 +159,19 @@ } /** - * @description 鏇存柊websql涓厤缃俊鎭殑淇濆瓨鏃堕棿 - */ - static updateWebSqlTime (curTime) { - if (!window.GLOB.WebSql || !curTime) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`UPDATE VERSIONS SET createDate='${curTime}' where CDefine1='LongParam'`, [], () => {}, () => { - window.GLOB.WebSql = null - }) - }) - } - - /** * @description 鏇存柊websql涓厤缃俊鎭殑鐗堟湰 */ static updateWebSqlversion (version, curTime) { - if (!window.GLOB.WebSql || !curTime || !version) return + if (!window.GLOB.WebSql) return + window.GLOB.WebSql.transaction(tx => { - tx.executeSql(`UPDATE VERSIONS SET version='${version}', createDate='${curTime}' where CDefine1='LongParam'`, [], () => {}, () => { - window.GLOB.WebSql = null - }) - }) - } - - /** - * @description 鍒涘缓websql涓厤缃俊鎭殑鐗堟湰 - */ - static createWebSqlversion (version, curTime) { - if (!window.GLOB.WebSql || !curTime || !version) return - window.GLOB.WebSql.transaction(tx => { - tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', [version, curTime, 'LongParam'], () => {}, () => { - window.GLOB.WebSql = null - }) + tx.executeSql(`DELETE FROM VERSIONS where CDefine1='LongParam'`) + + if (version) { + tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', [version, curTime, 'LongParam'], () => {}, () => { + window.GLOB.WebSql = null + }) + } }) } @@ -208,10 +220,9 @@ /** * @description 鎵撳紑IndexedDB */ - static openIndexDB (sysType) { - let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' + static openIndexDB (db) { try { - let request = window.indexedDB.open(`mkdb${service}`, 1) + let request = window.indexedDB.open(db, 1) request.onerror = () => { console.warn('IndexedDB 鍒濆鍖栧け璐ワ紒') } @@ -228,7 +239,7 @@ objectStore.createIndex('menuid', 'menuid', { unique: false }) objectStore.createIndex('userid', 'userid', { unique: false }) } - if (window.GLOB.systemType === '' && sysType === 'local' && !window.GLOB.IndexDB.objectStoreNames.contains('funcs')) { + if (window.GLOB.systemType === '' && !window.GLOB.IndexDB.objectStoreNames.contains('funcs')) { window.GLOB.IndexDB.createObjectStore('funcs', { keyPath: 'id' }) } } @@ -245,38 +256,66 @@ if (!window.GLOB.IndexDB) { return Promise.reject() } - return new Promise((resolve, reject) => { - let request = window.GLOB.IndexDB.transaction(['version']) - .objectStore('version') - .get('mksoft') - request.onerror = (event) => { - window.GLOB.IndexDB = null - console.warn(event) - reject() - } + let deffers = [] - request.onsuccess = () => { - if (request.result) { - resolve(request.result) - } else { - this.clearIndexDBConfig() + deffers.push( + new Promise((resolve) => { + let request = window.GLOB.IndexDB.transaction(['version']) + .objectStore('version') + .get('mksoft') + + request.onerror = (event) => { + window.GLOB.IndexDB = null + console.warn(event) resolve({version: '', createDate: ''}) } - } + + request.onsuccess = () => { + if (request.result) { + resolve(request.result) + } else { + resolve({version: '', createDate: ''}) + } + } + }) + ) + + deffers.push( + new Promise((resolve) => { + let request = window.GLOB.IndexDB.transaction(['configs']).objectStore('configs').openCursor() + let menus = [] + + request.onerror = () => { + window.GLOB.IndexDB = null + resolve(menus) + } + + request.onsuccess = (e) => { + let cursor = e.target.result + if (cursor) { + menus.push(`'${cursor.value.menuid}','${cursor.value.open_edition || 'mk'}'`) + cursor.continue() + } else { + resolve(menus) + } + } + }) + ) + + return new Promise((resolve) => { + Promise.all(deffers).then(res => { + let result = res[0] + + if (result.createDate && !/^\d{4}-\d{2}-\d{2}/.test(result.createDate)) { + result.createDate = '' + } + + result.menuids = res[1].join(';') + + resolve(result) + }) }) - } - - /** - * @description 娓呯┖IndexedDB涓繚瀛樼殑閰嶇疆淇℃伅 - */ - static clearIndexDBConfig () { - if (!window.GLOB.IndexDB) return - let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').clear() - - request.onerror = () => { - window.GLOB.IndexDB = null - } } /** @@ -285,29 +324,35 @@ static updateIndexDBversion (version) { if (!window.GLOB.IndexDB || !version) return - version.id = 'mksoft' + if (!version) { + let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').delete('mksoft') + + request.onerror = () => { + window.GLOB.IndexDB = null + } + } else { + version.id = 'mksoft' - let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') - let request = objectStore.get('mksoft') - - request.onerror = () => { - window.GLOB.IndexDB = null - } - - request.onsuccess = () => { - if (request.result) { - let put = objectStore.put(version) - - put.onerror = () => { - window.GLOB.IndexDB = null - } - } else { - this.clearIndexDBConfig() - - let add = objectStore.add(version) - - add.onerror = () => { - window.GLOB.IndexDB = null + let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') + let request = objectStore.get('mksoft') + + request.onerror = () => { + window.GLOB.IndexDB = null + } + + request.onsuccess = () => { + if (request.result) { + let put = objectStore.put(version) + + put.onerror = () => { + window.GLOB.IndexDB = null + } + } else { + let add = objectStore.add(version) + + add.onerror = () => { + window.GLOB.IndexDB = null + } } } } @@ -337,24 +382,30 @@ /** * @description 鍒犻櫎IndexedDB涓繚瀛樼殑閰嶇疆淇℃伅-鎵归噺 */ - static delIndexDBConfig (keys) { - if (!window.GLOB.IndexDB || !keys) return + static delIndexDBConfig (menuids) { + if (!window.GLOB.IndexDB) return - let objectStore = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs') + if (!menuids) { + let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').clear() + + request.onerror = () => { + window.GLOB.IndexDB = null + } + } else { + let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').openCursor() + + request.onerror = () => { + window.GLOB.IndexDB = null + } - objectStore.openCursor().onsuccess = (event) => { - let cursor = event.target.result - - if (cursor) { - if (cursor.value && keys.includes(cursor.value.menuid)) { - let request = objectStore.delete(cursor.key) - - request.onerror = () => { - window.GLOB.IndexDB = null + request.onsuccess = (e) => { + let cursor = e.target.result + if (cursor) { + if (menuids.includes(cursor.value.menuid)) { + cursor.delete() } + cursor.continue() } - - cursor.continue() } } } @@ -365,6 +416,7 @@ static getIndexDBMenuConfig (MenuID, userid) { if (!window.GLOB.IndexDB || !MenuID || !userid) return Promise.reject() let key = MenuID + userid + return new Promise((resolve, reject) => { let request = window.GLOB.IndexDB.transaction(['configs']).objectStore('configs').get(key) diff --git a/src/api/index.js b/src/api/index.js index c5353f8..4189263 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -10,16 +10,19 @@ window.GLOB.WebSql = null window.GLOB.IndexDB = null -const systemMenuKeys = `1581067625930haged11ieaivpavv77k,1581734956310scks442ul2d955g9tu5,1583991994144ndddg0bhh0is6shi0v1,1583979633842550imkchl4qt4qppsiv,1578900109100np8aqd0a77q3na46oas,16044812935562g807p3p12huk8kokmb, +const systemMenuKeys = `1581067625930haged11ieaivpavv77k,1581734956310scks442ul2d955g9tu5,1583991994144ndddg0bhh0is6shi0v1,1583979633842550imkchl4qt4qppsiv,1578900109100np8aqd0a77q3na46oas, 1585192949946f3et2ts8tn82krmumdf,15855615451212m12ip23vpcm79kloro,1587005717541lov40vg61q7l1rbveon,1590458676585agbbr63t6ihighg2i1g,1602315375262ikd33ii0nii34pt861o,1582771068837vsv54a089lgp45migbg, 1582777675954ifu05upurs465omoth7,158294809668898cklbv6c5bou8e1fpu,1584676379094iktph45fb8imhg96bql,1584695125339vo5g7iqgfn01qmrd6s2,1584699661372vhmpp9dn9foo0eob722,15848421131551gg04ie8sitsd3f7467, - 1589782279158ngr675kk3oksin35sul,1589788042787ffdt9hle4s45k9r1nvs,15900310928174dro07ihfckghpb5h13,1594095599055qicg2eb642v5qglhnuo,1599613340050c8nu6rbst9d4emnnbsq,1577972969199lei1g0qkvlh4tkc908m, + 1589782279158ngr675kk3oksin35sul,1589788042787ffdt9hle4s45k9r1nvs,1594095599055qicg2eb642v5qglhnuo,1577972969199lei1g0qkvlh4tkc908m,16044812935562g807p3p12huk8kokmb, 1578479100252lfbp29v1kafk4s4q4ig,1577971621421tg4v0i1ur8873k7e0ob,1577929944419lgc5h3hepum765e2k7u,1588493493409k9guqp067d31lu7blsv,15827879285193g85m3i2uprektpgmpf` +let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' +let db = `mkdb${service}` + if (window.openDatabase) { - CacheUtils.openWebSql(options.sysType) + CacheUtils.openWebSql(db) } else if (window.indexedDB) { - CacheUtils.openIndexDB(options.sysType) + CacheUtils.openIndexDB(db) } axios.defaults.crossDomain = true @@ -374,20 +377,38 @@ let app_datetime = sessionStorage.getItem('app_datetime') if (sys_datetime && app_datetime) { let seconds = Math.floor((new Date().getTime() - app_datetime) / 1000) - curTime = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss') + '.000' + let _curTime = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss') + '.000' + if (/^\d{4}-\d{2}-\d{2}/.test(_curTime)) { + curTime = _curTime + } } if (window.GLOB.WebSql) { return new Promise((resolve, reject) => { CacheUtils.getWebSqlVersion().then(msg => { - let modifydate = msg.createDate || curTime - if (modifydate.indexOf('Invalid date') > -1) { - modifydate = curTime - } - let param = { func: 's_get_app_version', - modifydate + modifydate: msg.createDate + } + + param.TypeCharOne = '' + param.typename = '' + + if (!msg.createDate && !msg.menuids) { + CacheUtils.updateWebSqlversion('1.00', curTime) + resolve() + return + } else if (!msg.createDate) { + msg.createDate = 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 => { @@ -395,29 +416,28 @@ reject() return } - let clear = false - let version = '1.00' - - if (res.menu_data && res.menu_data.length > 0) { - res.menu_data.forEach(mid => { + + let list = res.menu_data || [] + + if (res.menu_del) { + list.push(...res.menu_del) + } + + if (list.length > 0) { + let clear = false + list.forEach(mid => { if (systemMenuKeys.indexOf(mid.menuid) > -1) { clear = true } }) - + let keys = list.map(mid => `'${mid.menuid}'`).join(',') if (clear) { - CacheUtils.clearWebSqlConfig() - } else { - let keys = res.menu_data.map(mid => `'${mid.menuid}'`).join(',') - CacheUtils.delWebSqlConfig(keys) + keys = '' } + CacheUtils.delWebSqlConfig(keys) } - - if (msg.version) { - CacheUtils.updateWebSqlTime(curTime) - } else { - CacheUtils.createWebSqlversion(version, curTime) - } + + CacheUtils.updateWebSqlversion(res.app_version || '1.00', curTime) resolve() }) @@ -428,13 +448,29 @@ } else { return new Promise((resolve, reject) => { CacheUtils.getIndexDBVersion().then(msg => { - let modifydate = msg.createDate || curTime - if (modifydate.indexOf('Invalid date') > -1) { - modifydate = curTime - } let param = { func: 's_get_app_version', - modifydate + modifydate: msg.createDate + } + + param.TypeCharOne = '' + param.typename = '' + + if (!msg.createDate && !msg.menuids) { + CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) + resolve() + return + } else if (!msg.createDate) { + msg.createDate = 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 => { @@ -442,25 +478,28 @@ reject() return } - let clear = false - let version = '1.00' - if (res.menu_data && res.menu_data.length > 0) { - res.menu_data.forEach(mid => { + let list = res.menu_data || [] + + if (res.menu_del) { + list.push(...res.menu_del) + } + + if (list.length > 0) { + let clear = false + list.forEach(mid => { if (systemMenuKeys.indexOf(mid.menuid) > -1) { clear = true } }) - + let keys = list.map(mid => mid.menuid) if (clear) { - CacheUtils.clearIndexDBConfig() - } else { - let keys = res.menu_data.map(mid => `'${mid.menuid}'`) - CacheUtils.delIndexDBConfig(keys) + keys = '' } + CacheUtils.delIndexDBConfig(keys) } - CacheUtils.updateIndexDBversion({version: version, createDate: curTime}) + CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) resolve() }) @@ -475,12 +514,11 @@ * @description 鏇存柊绯荤粺鐗堟湰淇℃伅锛屾竻绌洪厤缃俊鎭� */ updateAppVersion () { - let curTime = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - CacheUtils.clearWebSqlConfig() - CacheUtils.updateWebSqlversion('1.00', curTime) - CacheUtils.clearIndexDBConfig() - CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) - CacheUtils.clearFuncs(options.sysType) + CacheUtils.delWebSqlConfig() + CacheUtils.updateWebSqlversion() + CacheUtils.delIndexDBConfig() + CacheUtils.updateIndexDBversion() + CacheUtils.clearFuncs() } /** diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 03f6d5c..48a84e0 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -482,7 +482,7 @@ componentDidMount () { // 鑾峰彇绯荤粺鐨勭増鏈俊鎭紝寤舵椂鏌ヨ setTimeout(() => { - Api.getAppVersion().then(() => {}, () => {}) + Api.getAppVersion() }, 1000) // Api.genericInterface({ // func: 's_get_fcc_account_data', diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 8989e73..8b3d7ad 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -12,6 +12,7 @@ import Encrypts from '@/components/encrypts' import './index.scss' +moment.suppressDeprecationWarnings = true const { Paragraph } = Typography const NormalButton = asyncComponent(() => import('@/tabviews/zshare/actionList/normalbutton')) const ExcelInButton = asyncComponent(() => import('@/tabviews/zshare/actionList/excelInbutton')) diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index cd6a645..69708a2 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -140,6 +140,12 @@ this.checkTopLine() }, 200) } + + if (!_config.wrap.cardType && _data.$$uuid) { + setTimeout(() => { + this.transferLine() + }, 200) + } }) } @@ -199,9 +205,9 @@ this.setState({sync: false, data: _data}, () => { if (selected !== 'false') { - setTimeout(() => { - this.checkTopLine() - }, 200) + this.checkTopLine() + } else if (!config.wrap.cardType && _data.$$uuid) { + this.transferLine() } }) } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { @@ -223,9 +229,9 @@ this.setState({data: _data}, () => { if (selected !== 'false') { - setTimeout(() => { - this.checkTopLine() - }, 200) + this.checkTopLine() + } else { + this.transferLine() } }) } @@ -247,6 +253,14 @@ } MKEmitter.emit('resetSelectLine', config.uuid, primaryId, data) + } + + transferLine = () => { + const { config, data } = this.state + + if (config.wrap.cardType) return + + MKEmitter.emit('resetSelectLine', config.uuid, data.$$uuid || '', data) } /** @@ -367,6 +381,8 @@ }, () => { if (selected !== 'false') { this.checkTopLine() + } else { + this.transferLine() } }) diff --git a/src/tabviews/debugtable/index.jsx b/src/tabviews/debugtable/index.jsx index b6833f5..3dcaf14 100644 --- a/src/tabviews/debugtable/index.jsx +++ b/src/tabviews/debugtable/index.jsx @@ -1,7 +1,6 @@ import React, {Component} from 'react' import { is, fromJS } from 'immutable' -import { notification, Table} from 'antd' -import { RedoOutlined } from '@ant-design/icons' +import { notification, Table, Button} from 'antd' import Api from '@/api' import MKEmitter from '@/utils/events.js' @@ -12,7 +11,7 @@ class DebugTable extends Component { state = { columns: [ - {align: 'left', dataIndex: 'Sort', sorter: false, title: 'Sort', width: 120}, + {align: 'left', dataIndex: 'Sort', sorter: false, title: 'Sort', width: 60}, {align: 'left', dataIndex: 'CDefine1', sorter: false, title: '鏂囨湰1', width: 120}, {align: 'left', dataIndex: 'CDefine2', sorter: false, title: '鏂囨湰2', width: 120}, {align: 'left', dataIndex: 'CDefine3', sorter: false, title: '鏂囨湰3', width: 120}, @@ -20,6 +19,7 @@ {align: 'left', dataIndex: 'CDefine5', sorter: false, title: '鏂囨湰5', width: 120}, {align: 'left', dataIndex: 'CDefine6', sorter: false, title: '鏂囨湰6', width: 120}, {align: 'left', dataIndex: 'CDefine7', sorter: false, title: '鏂囨湰7', width: 120}, + {align: 'left', dataIndex: 'createdate', sorter: false, title: 'createDate', width: 120}, ], data: [], loading: false, @@ -28,7 +28,7 @@ execute: true, dataresource: '(select * from s_debug_value_log where createuserid=@userid@) tb' }, - arr_field: 'ID,Sort,CDefine1,CDefine2,CDefine3,CDefine4,CDefine5,CDefine6,CDefine7' + arr_field: 'ID,Sort,CDefine1,CDefine2,CDefine3,CDefine4,CDefine5,CDefine6,CDefine7,createdate' } /** @@ -107,7 +107,7 @@ return ( <div className="debugtable"> - <RedoOutlined className="mk-debug-reload" onClick={() => this.loadmaindata()}/> + <Button className="mk-debug-reload" onClick={() => this.loadmaindata()}>鍒锋柊</Button> <Table size="middle" columns={columns} dataSource={data} pagination={false} loading={loading} scroll={{ x: '100%', y: false }}/> </div> ) diff --git a/src/tabviews/debugtable/index.scss b/src/tabviews/debugtable/index.scss index 773c2c0..0dbe1a4 100644 --- a/src/tabviews/debugtable/index.scss +++ b/src/tabviews/debugtable/index.scss @@ -1,14 +1,19 @@ .debugtable { position: relative; min-height: 200px; - margin: 20px; + padding: 20px; + background: #ffffff; + .ant-table-thead > tr > th { + color: #ffffff; + background: var(--mk-sys-color); + } .mk-debug-reload { - color: var(--mk-sys-color); - position: absolute; - z-index: 1; - top: 5px; - right: 10px; + color: #ffffff; + background: red; + border-color: red; + margin-bottom: 10px; + height: 28px; font-size: 16px; } } diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 26da2ab..d4780ee 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -198,6 +198,7 @@ }) if (window.GLOB.breakpoint) { _customScript = _customScript.replace(/\$breakpoint_proc@/ig, window.GLOB.breakpoint) + param.func = 'sPC_Get_TableData_debug' } } -- Gitblit v1.8.0