| | |
| | | func: 's_visitor_login', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | SessionUid: _SessionUid, |
| | | TypeCharOne: 'pc' |
| | | TypeCharOne: 'pc', |
| | | kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)) |
| | | } |
| | | |
| | | param.LText = md5(window.btoa(_SessionUid + param.timestamp)) |
| | |
| | | way_no: 'sms_vcode', |
| | | systemType: options.sysType, |
| | | login_city: city, |
| | | login_id_address: ipAddress |
| | | login_id_address: ipAddress, |
| | | kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), |
| | | device_id: localStorage.getItem('SessionUid') |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' |
| | |
| | | systemType: options.sysType, |
| | | Type: 'S', |
| | | login_city: city, |
| | | login_id_address: ipAddress |
| | | login_id_address: ipAddress, |
| | | kei_id: window.btoa(window.encodeURIComponent(window.GLOB.host)), |
| | | device_id: localStorage.getItem('SessionUid') |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | GLOB.linkurl = GLOB.linkurl + 'index.html' |
| | | } |
| | | GLOB.service = _service ? _service + '/' : '' |
| | | GLOB.host = window.location.host + (_service ? '_' + _service : '') |
| | | } else { |
| | | GLOB.linkurl = '' |
| | | GLOB.location = config.host |
| | | GLOB.service = config.service |
| | | GLOB.host = config.host.replace(/http(s)?:\/\//ig, '') + (config.service ? '_' + config.service.replace(/\//ig, '') : '') |
| | | } |
| | | |
| | | let mark = sessionStorage.getItem('system_mark') |
| | |
| | | {field: 'open', values: ['menu', 'link', 'menus']}, |
| | | {field: 'joint', values: ['menu', 'link', 'menus']}, |
| | | {field: 'linkbtn', values: ['button']}, |
| | | {field: 'clickType', values: ['button']}, |
| | | {field: 'menuType', values: ['menus']}, |
| | | {field: 'menus', values: ['menus']}, |
| | | ] |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'clickType', |
| | | label: '触发方式', |
| | | initval: setting.clickType || 'normal', |
| | | required: false, |
| | | options: [ |
| | | {value: 'normal', label: '单击'}, |
| | | {value: 'multi', label: '双击'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'btnControl', |
| | | label: '按钮控制', |
| | | initval: setting.btnControl || 'show', |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import SettingForm from './settingform' |
| | | import { queryTableSql } from '@/utils/option.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | class ReplaceField extends Component { |
| | |
| | | } |
| | | |
| | | submit = () => { |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | this.settingRef.handleConfirm().then(res => { |
| | | this.setState({confirming: true}) |
| | | |
| | | if (res.resource === 'custom') { |
| | | if (res.reType === 'name') { |
| | | let map = {[res.label]: { |
| | | FieldDec: res.label, |
| | | FieldName: res.field, |
| | | datatype: '' |
| | | }} |
| | | |
| | | this.exec(map) |
| | | } else { |
| | | let map = {[res.field]: { |
| | | FieldDec: res.label, |
| | | FieldName: res.field, |
| | | datatype: '' |
| | | }} |
| | | |
| | | this.execLabel(map) |
| | | } |
| | | } else { |
| | | let param = {func: 'sPC_Get_FieldName', TBName: res.table} |
| | | if (options.cloudServiceApi) { // 且存在云端地址 |
| | | param.rduri = options.cloudServiceApi |
| | |
| | | return |
| | | } |
| | | |
| | | if (res.reType === 'name') { |
| | | let map = {} |
| | | |
| | | result.FDName.forEach(item => { |
| | |
| | | } |
| | | map[item.FieldDec] = item |
| | | }) |
| | | |
| | | this.exec(map) |
| | | } else { |
| | | let map = {} |
| | | |
| | | result.FDName.forEach(item => { |
| | | map[item.FieldName] = item |
| | | }) |
| | | |
| | | this.execLabel(map) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | exec = (map) => { |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | if (this.props.type === 'custom') { |
| | | let _replace = (components) => { |
| | |
| | | |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(col => { |
| | | if (map[col.field]) { |
| | | col.field = map[col.field].FieldName |
| | | if (map[col.field].datatype) { |
| | | col.datatype = map[col.field].datatype |
| | | let cell = map[col.field] |
| | | if (cell) { |
| | | col.field = cell.FieldName |
| | | if (cell.datatype) { |
| | | col.datatype = cell.datatype |
| | | } |
| | | } |
| | | return col |
| | |
| | | duration: 3 |
| | | }) |
| | | this.props.updateConfig(config) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('revert') |
| | | }, 500) |
| | | } |
| | | |
| | | execLabel = (map) => { |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | if (this.props.type === 'custom') { |
| | | let _replace = (components) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | tab.components = _replace(tab.components) |
| | | }) |
| | | return item |
| | | } else if (item.type === 'group') { |
| | | item.components = _replace(item.components) |
| | | return item |
| | | } |
| | | |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(col => { |
| | | if (map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (item.search) { |
| | | item.search = item.search.map(col => { |
| | | if (map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | if (item.action) { |
| | | item.action.forEach(m => { |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.cols) { |
| | | let _update = (cols) => { |
| | | return cols.map(col => { |
| | | if (col.type === 'action' && col.elements) { |
| | | col.elements = col.elements.map(m => { |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | return m |
| | | }) |
| | | } else if (col.type === 'colspan') { |
| | | col.subcols = _update(col.subcols) |
| | | } else if (col.field) { |
| | | if (map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | } |
| | | |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | item.cols = _update(item.cols) |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | config.components = _replace(config.components) |
| | | } else if (this.props.type === 'table') { |
| | | config.columns = config.columns.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | |
| | | config.search = config.search.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } else if (this.props.type === 'form') { |
| | | config.fields = config.fields.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.label = map[col.field].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | confirming: false, |
| | | visible: false |
| | | }) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '更新已完成。', |
| | | duration: 3 |
| | | }) |
| | | this.props.updateConfig(config) |
| | | setTimeout(() => { |
| | | MKEmitter.emit('revert') |
| | | }, 500) |
| | | } |
| | | |
| | | render() { |
| | | const { visible, loadingTable, tables, confirming } = this.state |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Tooltip, Select } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { Form, Row, Col, Tooltip, Select, Radio, AutoComplete, Modal } from 'antd' |
| | | import { QuestionCircleOutlined, SwapRightOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | |
| | | // import './index.scss' |
| | | const { confirm } = Modal |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | tables: PropTypes.object |
| | | } |
| | | |
| | | state = {} |
| | | state = { |
| | | resource: 'custom', |
| | | reType: 'field', |
| | | field: '', |
| | | label: '', |
| | | fields: [], |
| | | labels: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | let records = localStorage.getItem('replaceRecord') |
| | | |
| | | if (records) { |
| | | records = JSON.parse(records) |
| | | |
| | | let fields = records.fields || [] |
| | | let labels = records.labels || [] |
| | | |
| | | this.setState({fields, labels, field: fields[0] || '', label: labels[0] || ''}) |
| | | } |
| | | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | if (values.resource === 'custom') { |
| | | let records = localStorage.getItem('replaceRecord') |
| | | |
| | | if (records) { |
| | | records = JSON.parse(records) |
| | | } else { |
| | | records = {fields: [], labels: []} |
| | | } |
| | | |
| | | records.fields.unshift(values.field) |
| | | records.labels.unshift(values.label) |
| | | records.fields = Array.from(new Set(records.fields)) |
| | | records.labels = Array.from(new Set(records.labels)) |
| | | |
| | | localStorage.setItem('replaceRecord', JSON.stringify(records)) |
| | | } |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | }) |
| | | } |
| | | |
| | | clear = () => { |
| | | let _this = this |
| | | confirm({ |
| | | title: '确定清除历史记录吗?', |
| | | content: '', |
| | | onOk() { |
| | | localStorage.removeItem('replaceRecord') |
| | | _this.setState({fields: [], labels: []}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { tables } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { resource, fields, labels, field, label, reType } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | } |
| | | } |
| | | |
| | | let _fields = fields |
| | | if (field) { |
| | | _fields = fields.filter(item => item.toLowerCase().indexOf(field.toLowerCase()) > -1) |
| | | } |
| | | let _labels = labels |
| | | if (label) { |
| | | _labels = labels.filter(item => item.indexOf(label) > -1) |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={20}> |
| | | <Form.Item label="替换来源"> |
| | | {getFieldDecorator('resource', { |
| | | initialValue: 'custom' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({resource: e.target.value})}> |
| | | <Radio value="dict">数据字典</Radio> |
| | | <Radio value="custom">自定义</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={20}> |
| | | <Form.Item label="替换依据"> |
| | | {getFieldDecorator('reType', { |
| | | initialValue: 'field' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({reType: e.target.value})}> |
| | | <Radio value="field">字段 <SwapRightOutlined /> 名称</Radio> |
| | | <Radio value="name">原字段 <SwapRightOutlined /> 新字段</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {resource === 'dict' ? <Col span={20}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="用于字段替换的表名。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | {resource === 'custom' && reType === 'field' ? <Col span={20}> |
| | | <Form.Item label="字段"> |
| | | {getFieldDecorator('field', { |
| | | initialValue: field, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入字段!' |
| | | } |
| | | ] |
| | | })(<AutoComplete dataSource={_fields} autoFocus onSearch={(val) => this.setState({ field: val})} placeholder="" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {resource === 'custom' && reType === 'field' ? <Col span={20}> |
| | | <Form.Item label="名称"> |
| | | {getFieldDecorator('label', { |
| | | initialValue: label, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入名称!' |
| | | } |
| | | ] |
| | | })(<AutoComplete dataSource={_labels} onSearch={(val) => this.setState({ label: val})} placeholder="" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {resource === 'custom' && reType === 'name' ? <Col span={20}> |
| | | <Form.Item label="原字段"> |
| | | {getFieldDecorator('label', { |
| | | initialValue: label, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入名称!' |
| | | } |
| | | ] |
| | | })(<AutoComplete dataSource={_labels} autoFocus onSearch={(val) => this.setState({ label: val})} placeholder="" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {resource === 'custom' && reType === 'name' ? <Col span={20}> |
| | | <Form.Item label="替换为"> |
| | | {getFieldDecorator('field', { |
| | | initialValue: field, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入字段!' |
| | | } |
| | | ] |
| | | })(<AutoComplete dataSource={_fields} onSearch={(val) => this.setState({ field: val})} placeholder="" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {resource === 'custom' && fields.length > 0 ? <Col span={24}> |
| | | <DeleteOutlined onClick={this.clear} style={{float: 'right', fontSize: '18px', marginTop: '-10px', cursor: 'pointer', color: '#ff4d4f'}} title="清空历史记录" /> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | openView = () => { |
| | | const { card, data, cards } = this.props |
| | | |
| | | if (!card.setting.click) return |
| | | |
| | | if (card.setting.click === 'menus' && cards.subtype === 'datacard' && card.$cardType !== 'extendCard') { |
| | | let menu = null |
| | | |
| | |
| | | } |
| | | |
| | | window.open(src) |
| | | } else if (card.setting.click === 'button' && card.setting.linkbtn) { |
| | | } else if (card.setting.click === 'button' && card.setting.clickType !== 'multi' && card.setting.linkbtn) { |
| | | if (data.$$type === 'extendCard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, []) |
| | | } else if (cards.subtype === 'datacard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn') |
| | | } else { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data]) |
| | | } |
| | | } |
| | | } |
| | | |
| | | doubleClick = () => { |
| | | const { card, data, cards } = this.props |
| | | |
| | | if (card.setting.click !== 'button' || card.setting.clickType !== 'multi') return |
| | | |
| | | if (card.setting.linkbtn) { |
| | | if (data.$$type === 'extendCard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, []) |
| | | } else if (cards.subtype === 'datacard') { |
| | |
| | | const { card, data, cards } = this.props |
| | | |
| | | return ( |
| | | <div className={'card-item-box ' + (card.setting.btnControl || '')} style={card.style} onClick={this.openView}> |
| | | <div className={'card-item-box ' + (card.setting.btnControl || '')} style={card.style} onClick={this.openView} onDoubleClick={this.doubleClick}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.elements}/> |
| | | {card.setting.type === 'multi' ? <div className={'back-side ' + card.setting.transform} style={card.backStyle}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.backElements}/> |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.wrap.datatype !== 'static' && _config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } else if ((!_sync || _config.wrap.priKeyType === 'static') && selected !== 'false') { |
| | | setTimeout(() => { |
| | | this.checkTopLine() |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | transfield |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } else if (config.setting.sync === 'true' && _data) { |
| | | this.handleData() |
| | | } |
| | |
| | | title: config.plot.title |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } else if (config.setting.sync === 'true') { |
| | | this.handleData() |
| | | } |
| | |
| | | search: Utils.initMainSearch(config.search) |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } else if (config.setting.sync === 'true' && _data) { |
| | | this.handleData() |
| | | } |
| | |
| | | search: Utils.initMainSearch(config.search), |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } else if (config.setting.sync === 'true' && _data) { |
| | | this.handleData() |
| | | } |
| | |
| | | search: Utils.initMainSearch(config.search) |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } else if (config.setting.sync === 'true' && _data) { |
| | | this.handleData() |
| | | } |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | this.renderView() |
| | | }) |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | arr_field: config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (config.wrap.datatype !== 'static' && config.setting && config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | arr_field: config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (config.wrap.datatype !== 'static' && config.setting && config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | let params = [] |
| | | let delay = 20 |
| | | config.components.forEach(item => { |
| | | if (item.type === 'tabs' || item.type === 'group') return |
| | | |
| | |
| | | } |
| | | } else { |
| | | item.setting.sync = 'false' |
| | | item.setting.delay = delay |
| | | delay += 20 |
| | | } |
| | | }) |
| | | |
| | |
| | | search: Utils.initMainSearch(_config.search) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | | if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }, _config.setting.delay || 0) |
| | | } else if (_config.setting.onload === 'true') { |
| | | this.getStatFieldsValue() |
| | | } |
| | |
| | | search: Utils.initMainSearch(_config.search) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | | if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadmaindata() |
| | | this.getStatFieldsValue() |
| | | }, _config.setting.delay || 0) |
| | | } else if (_config.setting.onload === 'true') { |
| | | this.getStatFieldsValue() |
| | | } |
| | |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } |
| | | }) |
| | | } |
| | |
| | | sync: _sync |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | setTimeout(() => { |
| | | this.loadData(null) |
| | | }, config.setting.delay || 0) |
| | | } else if (config.setting.sync === 'true' && _data) { |
| | | this.handleData() |
| | | } |
| | |
| | | |
| | | // 格式化默认设置 |
| | | formatSetting = (components, params, mainSearch, inherit, regs, balMap) => { |
| | | let delay = 20 |
| | | return components.map(component => { |
| | | if (component.type === 'tabs') { |
| | | component.subtabs = component.subtabs.map(tab => { |
| | |
| | | params.push(getStructDefaultParam(component, searchlist, params.length === 0)) |
| | | } |
| | | } else if (params) { |
| | | // } else if (component.floor === 1) { |
| | | component.setting.sync = 'false' |
| | | component.setting.delay = delay |
| | | delay += 20 |
| | | } |
| | | |
| | | if (balMap.has(component.uuid)) { |