| | |
| | | /** |
| | | * @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))', [], () => { |
| | | |
| | |
| | | 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))', [], () => { |
| | | |
| | | }, () => { |
| | |
| | | /** |
| | | * @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') |
| | |
| | | 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') |
| | | } |
| | | } |
| | | |
| | |
| | | if (!window.GLOB.WebSql) { |
| | | return Promise.reject() |
| | | } |
| | | return new Promise((resolve, 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.length === 0) { |
| | | tx.executeSql('DELETE FROM VERSIONS') |
| | | tx.executeSql('DELETE FROM CONFIGS') |
| | | resolve({version: '', createDate: ''}) |
| | | } else { |
| | | if (results.rows[0]) { |
| | | resolve(results.rows[0]) |
| | | } else { |
| | | resolve({version: '', createDate: ''}) |
| | | } |
| | | }, (tx, results) => { |
| | | window.GLOB.WebSql = null |
| | | reject() |
| | | 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) => { |
| | | 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 = '' |
| | | } |
| | | |
| | | /** |
| | | * @description 清空websql中保存的配置信息 |
| | | */ |
| | | static clearWebSqlConfig () { |
| | | if (!window.GLOB.WebSql) return |
| | | window.GLOB.WebSql.transaction(tx => { |
| | | tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, () => { window.GLOB.WebSql = null }) |
| | | result.menuids = res[1].join(';') |
| | | |
| | | resolve(result) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 删除websql中保存的配置信息 |
| | | */ |
| | | static delWebSqlConfig (keys) { |
| | | if (!window.GLOB.WebSql || !keys) return |
| | | 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 |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * @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 |
| | | window.GLOB.WebSql.transaction(tx => { |
| | | tx.executeSql(`UPDATE VERSIONS SET version='${version}', createDate='${curTime}' where CDefine1='LongParam'`, [], () => {}, () => { |
| | | window.GLOB.WebSql = null |
| | | }) |
| | | }) |
| | | } |
| | | if (!window.GLOB.WebSql) return |
| | | |
| | | /** |
| | | * @description 创建websql中配置信息的版本 |
| | | */ |
| | | static createWebSqlversion (version, curTime) { |
| | | if (!window.GLOB.WebSql || !curTime || !version) 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'], () => {}, () => { |
| | | window.GLOB.WebSql = null |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | /** |
| | | * @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 初始化失败!') |
| | | } |
| | |
| | | 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' }) |
| | | } |
| | | } |
| | |
| | | if (!window.GLOB.IndexDB) { |
| | | return Promise.reject() |
| | | } |
| | | return new Promise((resolve, reject) => { |
| | | |
| | | let deffers = [] |
| | | |
| | | 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) |
| | | reject() |
| | | resolve({version: '', createDate: ''}) |
| | | } |
| | | |
| | | request.onsuccess = () => { |
| | | if (request.result) { |
| | | resolve(request.result) |
| | | } else { |
| | | this.clearIndexDBConfig() |
| | | resolve({version: '', createDate: ''}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | ) |
| | | |
| | | /** |
| | | * @description 清空IndexedDB中保存的配置信息 |
| | | */ |
| | | static clearIndexDBConfig () { |
| | | if (!window.GLOB.IndexDB) return |
| | | let request = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs').clear() |
| | | 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) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | static updateIndexDBversion (version) { |
| | | 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 |
| | | } |
| | | } else { |
| | | version.id = 'mksoft' |
| | | |
| | | let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') |
| | |
| | | window.GLOB.IndexDB = null |
| | | } |
| | | } else { |
| | | this.clearIndexDBConfig() |
| | | |
| | | let add = objectStore.add(version) |
| | | |
| | | add.onerror = () => { |
| | | window.GLOB.IndexDB = null |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @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') |
| | | |
| | | 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) |
| | | 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 |
| | | } |
| | | |
| | | request.onsuccess = (e) => { |
| | | let cursor = e.target.result |
| | | if (cursor) { |
| | | if (menuids.includes(cursor.value.menuid)) { |
| | | cursor.delete() |
| | | } |
| | | cursor.continue() |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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) |
| | | |
| | |
| | | |
| | | 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 |
| | |
| | | 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 => { |
| | |
| | | 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(',') |
| | | keys = '' |
| | | } |
| | | CacheUtils.delWebSqlConfig(keys) |
| | | } |
| | | } |
| | | |
| | | if (msg.version) { |
| | | CacheUtils.updateWebSqlTime(curTime) |
| | | } else { |
| | | CacheUtils.createWebSqlversion(version, curTime) |
| | | } |
| | | CacheUtils.updateWebSqlversion(res.app_version || '1.00', curTime) |
| | | |
| | | resolve() |
| | | }) |
| | |
| | | } 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 => { |
| | |
| | | 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}'`) |
| | | keys = '' |
| | | } |
| | | CacheUtils.delIndexDBConfig(keys) |
| | | } |
| | | } |
| | | |
| | | CacheUtils.updateIndexDBversion({version: version, createDate: curTime}) |
| | | CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) |
| | | |
| | | resolve() |
| | | }) |
| | |
| | | * @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() |
| | | } |
| | | |
| | | /** |
| | |
| | | componentDidMount () { |
| | | // 获取系统的版本信息,延时查询 |
| | | setTimeout(() => { |
| | | Api.getAppVersion().then(() => {}, () => {}) |
| | | Api.getAppVersion() |
| | | }, 1000) |
| | | // Api.genericInterface({ |
| | | // func: 's_get_fcc_account_data', |
| | |
| | | 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')) |
| | |
| | | this.checkTopLine() |
| | | }, 200) |
| | | } |
| | | |
| | | if (!_config.wrap.cardType && _data.$$uuid) { |
| | | setTimeout(() => { |
| | | this.transferLine() |
| | | }, 200) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | if (selected !== 'false') { |
| | | setTimeout(() => { |
| | | this.checkTopLine() |
| | | }, 200) |
| | | } else if (!config.wrap.cardType && _data.$$uuid) { |
| | | this.transferLine() |
| | | } |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | |
| | | |
| | | this.setState({data: _data}, () => { |
| | | if (selected !== 'false') { |
| | | setTimeout(() => { |
| | | this.checkTopLine() |
| | | }, 200) |
| | | } else { |
| | | this.transferLine() |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | 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) |
| | | } |
| | | |
| | | /** |
| | |
| | | }, () => { |
| | | if (selected !== 'false') { |
| | | this.checkTopLine() |
| | | } else { |
| | | this.transferLine() |
| | | } |
| | | }) |
| | | |
| | |
| | | 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' |
| | |
| | | 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}, |
| | |
| | | {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, |
| | |
| | | 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' |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | 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> |
| | | ) |
| | |
| | | .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; |
| | | } |
| | | } |
| | |
| | | }) |
| | | if (window.GLOB.breakpoint) { |
| | | _customScript = _customScript.replace(/\$breakpoint_proc@/ig, window.GLOB.breakpoint) |
| | | param.func = 'sPC_Get_TableData_debug' |
| | | } |
| | | } |
| | | |