| | |
| | | * @description 登录系统, 获取用户信息 |
| | | */ |
| | | getusermsg (username, password, isCloud = false) { |
| | | let shim = +sessionStorage.getItem('sys_time_shim') |
| | | let param = { |
| | | // func: 'webapi_login', |
| | | UserName: username, |
| | |
| | | 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' 时 |
| | |
| | | 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) => { |
| | |
| | | {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"> |
| | |
| | | })} |
| | | </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"> |
| | |
| | | return |
| | | } |
| | | |
| | | res = MenuUtils.resetComponentConfig(res) |
| | | res = MenuUtils.resetComponentConfig(res, appType) |
| | | |
| | | delete res.copyType |
| | | |
| | |
| | | visible: false |
| | | } |
| | | |
| | | resetconfig = (item) => { |
| | | resetconfig = (item, appType) => { |
| | | if (item.type === 'tabs') { |
| | | item.uuid = MenuUtils.getuuid() |
| | | item.setting.name = item.setting.name + MenuUtils.getSignName() |
| | |
| | | tab.uuid = MenuUtils.getuuid() |
| | | |
| | | tab.components = tab.components.map(cell => { |
| | | cell = this.resetconfig(cell) |
| | | cell = this.resetconfig(cell, appType) |
| | | return cell |
| | | }) |
| | | }) |
| | |
| | | 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 |
| | |
| | | return |
| | | } |
| | | |
| | | res = this.resetconfig(res) |
| | | res = this.resetconfig(res, appType) |
| | | |
| | | delete res.copyType |
| | | |
| | |
| | | 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() |
| | |
| | | } |
| | | |
| | | tab.components = tab.components.map(cell => { |
| | | cell = this.resetconfig(cell) |
| | | cell = this.resetconfig(cell, appType) |
| | | return cell |
| | | }) |
| | | }) |
| | |
| | | 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 |
| | |
| | | return |
| | | } |
| | | |
| | | res = this.resetconfig(res) |
| | | res = this.resetconfig(res, appType) |
| | | |
| | | // delete res.copyType |
| | | |
| | |
| | | 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; |
| | |
| | | return null |
| | | } |
| | | |
| | | if (typeof(val) === 'number') { |
| | | if (!isNaN(val) && val !== '') { |
| | | val = +val |
| | | if (card.round) { |
| | | val = Math.round(val * card.round) / card.round |
| | | } |
| | |
| | | config: null, // 图表配置信息 |
| | | search: null, // 搜索条件 |
| | | pageIndex: 1, // 页码 |
| | | pageSize: 10, |
| | | pageOptions: [], |
| | | activeKey: '', // 选中卡 |
| | | selectKeys: [], // 多选时选中卡片 |
| | | selectedData: [], // 选中数据,用于工具栏按钮 |
| | |
| | | |
| | | 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, |
| | |
| | | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | */ |
| | | 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) { // 主表搜索条件 |
| | |
| | | }) |
| | | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | 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 |
| | | |
| | |
| | | this.setState({ |
| | | search: list, |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | |
| | | pageSizeChange = (current, size) => { |
| | | this.setState({ |
| | | pageIndex: current, |
| | | pageSize: size |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | |
| | |
| | | {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> |
| | | ) |
| | | } |
| | |
| | | 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' |
| | |
| | | config: null, // 图表配置信息 |
| | | search: null, // 搜索条件 |
| | | pageIndex: 1, // 页码 |
| | | pageSize: 10, |
| | | pageOptions: [], |
| | | activeKey: '', // 选中卡 |
| | | selectKeys: [], // 多选时选中卡片 |
| | | selectedData: [], // 选中数据,用于工具栏按钮 |
| | |
| | | } |
| | | |
| | | _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, |
| | |
| | | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | */ |
| | | 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) { // 主表搜索条件 |
| | |
| | | }) |
| | | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | |
| | |
| | | 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() |
| | | }) |
| | | } |
| | | |
| | |
| | | this.setState({ |
| | | search: list, |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | |
| | | pageSizeChange = (current, size) => { |
| | | this.setState({ |
| | | pageIndex: current, |
| | | pageSize: size |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | } |
| | | |
| | | 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'} |
| | | |
| | |
| | | /> : 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}> |
| | |
| | | </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> |
| | | ) |
| | | } |
| | |
| | | * @description 重置组件配置 |
| | | * @return {String} item 组件信息 |
| | | */ |
| | | static resetComponentConfig = (item) => { |
| | | static resetComponentConfig = (item, appType) => { |
| | | if (item.type === 'navbar') { |
| | | return item |
| | | } |
| | |
| | | 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() |
| | |
| | | } |
| | | |
| | | writeFuncs = (funcs) => { |
| | | let timestamp = moment().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 shim = +sessionStorage.getItem('sys_time_shim') |
| | | let timestamp = moment().add(shim, 'seconds').format('YYYY-MM-DD HH:mm:ss') |
| | | |
| | | // if (window.GLOB.WebSql) { |
| | | // window.GLOB.WebSql.transaction(tx => { |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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 |