| | |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Select, Radio, Tooltip, Input, notification } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import { queryPrintSql } from '@/utils/option.js' |
| | | import './index.scss' |
| | | |
| | | const sysTempsIds = ['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok'] |
| | |
| | | this.resetTemps(wxTemps) |
| | | } |
| | | |
| | | let printTemps = sessionStorage.getItem('printTemps') |
| | | printTemps = printTemps ? JSON.parse(printTemps) : [] |
| | | this.checkPrintTemp() |
| | | } |
| | | |
| | | this.setState({printTemps}) |
| | | checkPrintTemp = () => { |
| | | if (!window.GLOB.printTemps) { |
| | | let param = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: Utils.formatOptions(queryPrintSql), |
| | | obj_name: 'data', |
| | | arr_field: 'PN,ID,Images' |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | let temps = (res.data || []).map(temp => { |
| | | return { |
| | | value: temp.ID, |
| | | text: temp.PN |
| | | } |
| | | }) |
| | | |
| | | window.GLOB.printTemps = temps |
| | | |
| | | this.setState({printTemps: temps}) |
| | | }) |
| | | } else { |
| | | this.setState({printTemps: window.GLOB.printTemps || []}) |
| | | } |
| | | } |
| | | |
| | | resetTemps = (wxTemps) => { |