| | |
| | | width={visible !== 'system' ? 600 : 1000} |
| | | closable={false} |
| | | maskClosable={false} |
| | | okText="确定" |
| | | cancelText="取消" |
| | | onOk={this.popSubmit} |
| | | onCancel={() => {this.setState({visible: ''})}} |
| | | destroyOnClose |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, Modal, notification } from 'antd' |
| | | // import moment from 'moment' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | // import Utils from '@/utils/utils.js' |
| | | import SettingForm from './settingform' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | |
| | | } |
| | | |
| | | verifySubmit = () => { |
| | | const { MenuID } = this.props |
| | | |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | let param = { |
| | | func: 's_sVersionDetail_CloudAdd', |
| | | kei_no: sessionStorage.getItem('kei_no'), |
| | | kei_no_detail: sessionStorage.getItem('typename'), |
| | | lang: sessionStorage.getItem('lang'), |
| | | BID: res.VersionName, |
| | | VType: 'mob_menu', |
| | | TrdMenuID: MenuID |
| | | } |
| | | |
| | | this.setState({ |
| | | // loading: true, |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '操作成功!', |
| | | duration: 3 |
| | | }) |
| | | this.setState({ |
| | | loading: false, |
| | | visible: false |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | sm: { span: 18 } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={20}> |
| | | <Col span={22}> |
| | | <Form.Item label="传输号"> |
| | | {getFieldDecorator('VersionName', { |
| | | initialValue: '', |
| | |
| | | })( |
| | | <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> |
| | | {translist.map(option => |
| | | <Select.Option key={option.VersionName} value={option.VersionName}>{option.ProgramName}</Select.Option> |
| | | <Select.Option key={option.VersionName} value={option.VersionName}>{`${option.ProgramName}(${option.VersionName})`}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | |
| | | |
| | | let errorMsg = '' |
| | | let _temps = {} |
| | | let images = [] |
| | | |
| | | result.forEach(res => { |
| | | if (res.status && !errorMsg) { |
| | |
| | | status: false |
| | | } |
| | | } else { |
| | | images = [...images, ..._temp.imgs] |
| | | _temps[res.tempId] = _temp |
| | | } |
| | | } else if (!errorMsg) { |
| | |
| | | }) |
| | | |
| | | if (!errorMsg) { |
| | | if (images.length > 0) { |
| | | let errorUrls = [] |
| | | images.forEach(url => { |
| | | let img = new Image() |
| | | img.onerror = () => { |
| | | errorUrls.push(url) |
| | | } |
| | | img.src = url |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | if (errorUrls.length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '模板中图片 ' + errorUrls.join(',') + ' 已失效!', |
| | | duration: 5 |
| | | }) |
| | | Object.keys(_temps).forEach(key => { |
| | | _temps[key].config.ReportHeader.Control = _temps[key].config.ReportHeader.Control.map(item => { |
| | | if (item.Type === 'image' && errorUrls.includes(item.Value)) { |
| | | item.Value = '' |
| | | } |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | this.execPrint(printlist, _temps, formdata) |
| | | }, 500) |
| | | } else { |
| | | this.execPrint(printlist, _temps, formdata) |
| | | } |
| | | } else { |
| | | this.execError(errorMsg) |
| | | } |
| | |
| | | let _configparam = '' // 打印配置信息 |
| | | let fields = [] // 模板中所需字段 |
| | | let nonEFields = [] // 非空字段 |
| | | let imgs = [] |
| | | |
| | | if (!res.ConfigParam) { |
| | | error = '未获取到打印模板信息!' |
| | |
| | | if (!configParam) { |
| | | error = '打印模板解析错误!' |
| | | } else { |
| | | |
| | | let control = configParam.elements.map(element => { |
| | | let _field = element.field |
| | | |
| | |
| | | item.ImageWidth = element.imgWidth |
| | | item.ImageHeight = element.imgHeight |
| | | item.Trimming = '' |
| | | if (element.productValue && window.GLOB.systemType === 'production') { |
| | | item.Value = element.productValue |
| | | imgs.push(item.Value) |
| | | } else if (item.Value) { |
| | | imgs.push(item.Value) |
| | | } |
| | | } else if (item.Type === 'text') { |
| | | item.FontFamily = element.fontFamily |
| | | item.FontSize = element.fontSize |
| | |
| | | error: error, |
| | | config: _configparam, |
| | | fields: fields, |
| | | nonEFields: nonEFields |
| | | nonEFields: nonEFields, |
| | | imgs: imgs |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | submitScript = () => { |
| | | // const { selectTran } = this.state |
| | | const { selectTran } = this.state |
| | | |
| | | this.scriptRef.handleConfirm().then(res => { |
| | | this.setState({ |
| | | confirmloading: true |
| | | }) |
| | | // let param = {} |
| | | // s_sVersionDetail_Add |
| | | // s_sVersionDetail_CloudAdd |
| | | |
| | | // Api.getCloudConfig(param).then(result => { |
| | | // if (result.status) { |
| | | // notification.success({ |
| | | // top: 92, |
| | | // message: '操作成功!', |
| | | // duration: 3 |
| | | // }) |
| | | // this.setState({ |
| | | // scriptIndex: 1, |
| | | // confirmloading: false, |
| | | // scriptVisible: false |
| | | // }, () => { |
| | | // this.getScriptList() |
| | | // }) |
| | | // } else { |
| | | // this.setState({ |
| | | // confirmloading: false |
| | | // }) |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: result.message, |
| | | // duration: 5 |
| | | // }) |
| | | // } |
| | | // }, () => { |
| | | // this.setState({ |
| | | // confirmloading: false |
| | | // }) |
| | | // }) |
| | | let kei_no = res.appId.split(',')[1] |
| | | let lang = res.subAppId.split(',')[1] |
| | | let kei_no_detail = res.subAppId.split(',')[2] |
| | | |
| | | let param = { |
| | | func: 's_sVersionDetail_CloudAdd', |
| | | kei_no: kei_no, |
| | | kei_no_detail: kei_no_detail, |
| | | lang: lang, |
| | | BID: selectTran.ID |
| | | } |
| | | |
| | | if (res.VType === 'subapp') { |
| | | param.VType = 'mob_menu' |
| | | param.TrdMenuID = '' |
| | | param.upid = md5(window.GLOB.appkey + kei_no + kei_no_detail + lang) |
| | | } else if (res.VType === 'view') { |
| | | param.VType = 'mob_menu' |
| | | param.TrdMenuID = res.viewId |
| | | } else if (res.VType === 'role') { |
| | | param.VType = 'mob_roletree' |
| | | param.upid = md5(window.GLOB.appkey + kei_no + kei_no_detail + lang) |
| | | } |
| | | |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '操作成功!', |
| | | duration: 3 |
| | | }) |
| | | this.setState({ |
| | | scriptIndex: 1, |
| | | confirmloading: false, |
| | | scriptVisible: false |
| | | }, () => { |
| | | this.getScriptList() |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | confirmloading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }, () => { |
| | | this.setState({ |
| | | confirmloading: false |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | <Select onChange={this.changeType}> |
| | | <Select.Option value="subapp">子应用</Select.Option> |
| | | <Select.Option value="view">页面</Select.Option> |
| | | <Select.Option value="role">权限树</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, InputNumber, Select } from 'antd' |
| | | import { Form, Row, Col, Input, InputNumber, Select, Tooltip, Icon } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import FileUpload from '@/tabviews/zshare/fileupload' |
| | | // import FileUpload from '@/tabviews/zshare/fileupload' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const FileUpload = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | |
| | | }) |
| | | } |
| | | } |
| | | this.handleSubmit() |
| | | } |
| | | |
| | | updateImg = (val) => { |
| | | this.props.form.setFieldsValue({ value: val }) |
| | | this.handleSubmit() |
| | | } |
| | | |
| | |
| | | } else if (item.type === 'fileupload') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={ |
| | | item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initval || '', |
| | | rules: [ |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <FileUpload config={{ |
| | | initval: item.initval || '', |
| | | suffix: '', |
| | | maxfile: 1, |
| | | fileType: 'text' |
| | | }} onChange={this.updateImg} /> |
| | | <FileUpload type="picture" placement="right" onChange={this.handleSubmit} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | } else if (item.type === 'textarea') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={item.label} > |
| | | <Form.Item label={ |
| | | item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initval || '', |
| | | rules: [ |
| | |
| | | // width: 89.5%; |
| | | // } |
| | | // } |
| | | .mk-source-wrap { |
| | | >.ant-radio-group { |
| | | >.ant-radio-button-wrapper:last-child { |
| | | display: none; |
| | | } |
| | | >.ant-radio-button-wrapper:not(:first-child) { |
| | | border-radius: 0 4px 4px 0; |
| | | } |
| | | } |
| | | } |
| | | .anticon-question-circle { |
| | | color: #c49f47; |
| | | margin-right: 3px; |
| | | } |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'productValue', |
| | | label: '正式地址', |
| | | initval: item.productValue || '', |
| | | tooltip: '正式系统使用的图片,为空时使用图片地址。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'field', |
| | | label: '关联字段', |
| | |
| | | } else { |
| | | this.cachesketch(context, resolve) |
| | | } |
| | | } |
| | | } |
| | | image.onerror = () => { |
| | | context.restore() // 重置画布 |
| | | if (elements.length > 0) { |
| | | this.sketchothers(context, elements, selectId, ratio, resolve) |
| | | } else { |
| | | this.cachesketch(context, resolve) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | const { confirm } = Modal |
| | | const { TreeNode } = Tree |
| | | // const { Paragraph } = Typography |
| | | const { Search } = Input |
| | | |
| | | const _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |