| | |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | let _rduri = '' |
| | | if (sessionStorage.getItem('isEditState') === 'true' && options.cloudServiceApi) { // 编辑状态,且存在云端地址 |
| | | _rduri = options.cloudServiceApi |
| | | param.rduri = options.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') |
| | | param.SessionUid = sessionStorage.getItem('CloudSessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | _rduri = window.GLOB.mainSystemApi |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | param.nonc = Utils.getuuid() |
| | | |
| | | let keys = Object.keys(param).sort() |
| | | keys = keys.filter(key => key !== 'rduri') |
| | | let values = keys.map(key => key + param[key]).join('') |
| | | param.sign = md5(values) |
| | | param.t = new Date().getTime() |
| | | |
| | | if (_rduri) { |
| | | param.rduri = _rduri |
| | | } |
| | | |
| | | return axios({ |
| | | url: '/webapi/dostars', |
| | |
| | | * @param {Boolean} SSO 是否为单点登录地址 |
| | | */ |
| | | getSystemCacheConfig (param, SSO = true) { |
| | | param.userid = sessionStorage.getItem('UserID') |
| | | param.userid = sessionStorage.getItem('UserID') || '' |
| | | param.lang = localStorage.getItem('lang') || '' |
| | | param.SessionUid = sessionStorage.getItem('SessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (window.GLOB.mainSystemApi && SSO) { |
| | | if (sessionStorage.getItem('isEditState') === 'true' && SSO) { // 编辑状态,单点登录服务器为云端 |
| | | if (options.cloudServiceApi) { // 存在云端地址时,使用云端系统参数 |
| | | param.rduri = options.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | param.SessionUid = sessionStorage.getItem('CloudSessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } |
| | | } else if (window.GLOB.mainSystemApi && SSO) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | |
| | | param.SessionUid = sessionStorage.getItem('SessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | |
| | | // if (param.func === 'RolesAdd') { // 角色添加时,传appkey(外部接口统一添加) |
| | | // param.appkey = window.GLOB.appkey || '' |
| | | // } |
| | | if (sessionStorage.getItem('isEditState') === 'true' && param.rduri === options.cloudServiceApi) { // HS下菜单 |
| | | param.userid = sessionStorage.getItem('CloudUserID') |
| | | param.SessionUid = sessionStorage.getItem('CloudSessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } |
| | | |
| | | param.nonc = Utils.getuuid() |
| | | |
| | |
| | | MenuNo: 'sDatasM', |
| | | MenuName: '数据字典', |
| | | text: '数据字典' |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, |
| | | type: 'ManageTable', |
| | | MenuID: '1578900109100np8aqd0a77q3na46oas', |
| | | MenuNo: 'sPrintTemplateM', |
| | | MenuName: '打印模板', |
| | | text: '打印模板' |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, |
| | | type: 'ManageTable', |
| | | MenuID: '1581734956310scks442ul2d955g9tu5', |
| | | MenuNo: 'sVersionM', |
| | | MenuName: '传输号管理', |
| | | text: '传输号管理' |
| | | }] |
| | | }] |
| | | this.setState({ |
| | |
| | | 'header.form.pagination': '分页', |
| | | 'header.form.regular': '正则校验', |
| | | 'header.form.quickadd': '快捷添加', |
| | | 'header.form.funcbutton': '功能按钮', |
| | | 'header.form.funcType': '功能类型', |
| | | 'header.form.func.changeuser': '切换用户', |
| | | 'header.form.func.print': '打印', |
| | | 'header.form.execMode': '执行方式', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | 'header.form.pagination': '分页', |
| | | 'header.form.regular': '正则校验', |
| | | 'header.form.quickadd': '快捷添加', |
| | | 'header.form.funcbutton': '功能按钮', |
| | | 'header.form.funcType': '功能类型', |
| | | 'header.form.func.changeuser': '切换用户', |
| | | 'header.form.func.print': '打印', |
| | | 'header.form.execMode': '执行方式', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | import moment from 'moment' |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | |
| | | |
| | | class MainAction extends Component { |
| | | static propTpyes = { |
| | | menuType: PropTypes.any, // 菜单类型,普通菜单或HS |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | primaryId: PropTypes.string, // 主键 |
| | | actions: PropTypes.array, // 按钮组 |
| | |
| | | // 外部请求 |
| | | _outParam = JSON.parse(JSON.stringify(res)) |
| | | |
| | | if (btn.sysInterface === 'true') { |
| | | res.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | if (this.props.menuType === 'HS') { |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | } |
| | | } else { |
| | | res.rduri = btn.interface |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | |
| | | if (btn.outerFunc) { |
| | |
| | | return group |
| | | }) |
| | | |
| | | let error = false |
| | | |
| | | _groups = _groups.map(group => { |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.type === 'link') { |
| | | let supItem = _formlist.filter(form => form.field === item.linkField)[0] |
| | | |
| | | // 关联显示列中的字段值,通过该值过滤下拉选项 |
| | | if (!supItem && data && data.hasOwnProperty(item.linkField)) { |
| | | supItem = {initval: data[item.linkField]} |
| | | } |
| | | |
| | | if (!supItem) { |
| | | error = true |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到表单《' + item.label + '》关联字段!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | item.options = item.oriOptions.filter(option => option.parentId === supItem.initval) |
| | | } |
| | |
| | | |
| | | return group |
| | | }) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '关联菜单设置错误!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | readtype: readtype, |
| | |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | |
| | | import FormGroup from './formgroup' |
| | | import FormAction from './actionList' |
| | |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | | menuType: PropTypes.any, // 菜单类型,普通菜单或HS |
| | | // MenuNo: PropTypes.string, // 菜单参数 |
| | | // MenuName: PropTypes.string, // 菜单参数 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | |
| | | // } |
| | | |
| | | // 权限过滤 |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | if (this.props.menuType !== 'HS') { |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | } |
| | | // config.tabgroups.forEach(group => { |
| | | // if (!config[group]) return |
| | | // config[group] = config[group].filter(tab => permAction[tab.uuid]) |
| | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | } else { |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | if (this.props.menuType === 'HS') { |
| | | if (setting.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (setting.sysInterface !== 'true') { |
| | | param.rduri = setting.interface |
| | | } |
| | | } else { |
| | | param.rduri = setting.interface |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = setting.interface |
| | | } |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' // 调用外部接口增加appkey |
| | |
| | | } |
| | | {hasform ? |
| | | <FormAction |
| | | menuType={this.props.menuType} |
| | | logcolumns={[]} |
| | | setting={setting} |
| | | actions={actions} |
| | |
| | | {_tab.type === 'SubTable' ? |
| | | <SubTable |
| | | Tab={_tab} |
| | | menuType={this.props.menuType} |
| | | MenuID={_tab.linkTab} |
| | | SupMenuID={this.props.MenuID} |
| | | refreshtabs={this.state.refreshtabs} |
| | |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | import {refreshTabView, modifyTabview} from '@/store/action' |
| | | |
| | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | } else { |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | if (setting.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (setting.sysInterface !== 'true') { |
| | | param.rduri = setting.interface |
| | | } |
| | | |
| | |
| | | ref="mainButton" |
| | | BID="" |
| | | type="main" |
| | | menuType="HS" |
| | | setting={setting} |
| | | actions={actions} |
| | | dict={this.state.dict} |
| | |
| | | } key={`${index}`}> |
| | | {_tab.type === 'SubTable' ? |
| | | <SubTable |
| | | menuType="HS" |
| | | Tab={_tab} |
| | | MenuID={_tab.linkTab} |
| | | SupMenuID={this.props.MenuID} |
| | |
| | | > |
| | | {<SubTabTable |
| | | BID={''} |
| | | menuType="HS" |
| | | SupMenuID={this.props.MenuID} |
| | | MenuID={this.state.popAction.linkTab} |
| | | BData={this.state.BIDs['mainTabledata'] || ''} |
| | |
| | | </Modal> |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | </div> : null} |
| | | {view === 'formtab' ? <FormTab MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null} |
| | | {view === 'formtab' ? <FormTab menuType="HS" MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import './index.scss' |
| | | |
| | | const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) |
| | | |
| | | class SubTabViewTable extends Component { |
| | | static propTpyes = { |
| | | menuType: PropTypes.any, // 菜单类型,普通菜单或HS |
| | | Tab: PropTypes.object, // 标签信息 |
| | | BID: PropTypes.string, // 上级数据ID |
| | | BData: PropTypes.any, // 上级数据 |
| | |
| | | let colMap = new Map() |
| | | |
| | | // 权限过滤 |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | if (this.props.menuType !== 'HS') { |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | } |
| | | |
| | | // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid |
| | | config.columns.forEach(col => { |
| | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | } else { |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | if (this.props.menuType === 'HS') { |
| | | if (setting.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (setting.sysInterface !== 'true') { |
| | | param.rduri = setting.interface |
| | | } |
| | | } else { |
| | | param.rduri = setting.interface |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = setting.interface |
| | | } |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' // 调用外部接口增加appkey |
| | |
| | | <SubAction |
| | | ref="subButton" |
| | | type="sub" |
| | | menuType={this.props.menuType} |
| | | setting={setting} |
| | | actions={actions} |
| | | Tab={this.props.Tab} |
| | |
| | | > |
| | | {<SubTabTable |
| | | BID={this.props.BID} |
| | | menuType={this.props.menuType} |
| | | BData={this.props.BData} |
| | | SupMenuID={this.props.MenuID} |
| | | ContainerId={this.props.ContainerId} |
| | |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import './index.scss' |
| | | |
| | | class SubTabModalTable extends Component { |
| | | static propTpyes = { |
| | | menuType: PropTypes.any, // 菜单类型,普通菜单或HS |
| | | ID: PropTypes.string, // 上级数据ID |
| | | BID: PropTypes.string, // 上上级数据ID |
| | | BData: PropTypes.any, // 上上级数据 |
| | |
| | | let colMap = new Map() |
| | | |
| | | // 权限过滤 |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | if (this.props.menuType !== 'HS') { |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | } |
| | | |
| | | // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid |
| | | config.columns.forEach(col => { |
| | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | } else { |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | if (this.props.menuType === 'HS') { |
| | | if (setting.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (setting.sysInterface !== 'true') { |
| | | param.rduri = setting.interface |
| | | } |
| | | } else { |
| | | param.rduri = setting.interface |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = setting.interface |
| | | } |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' // 调用外部接口增加appkey |
| | |
| | | <SubAction |
| | | ref="subtabButton" |
| | | type="subtab" |
| | | menuType={this.props.menuType} |
| | | setting={setting} |
| | | actions={actions} |
| | | BID={this.props.BID} |
| | |
| | | import MutilForm from '@/tabviews/tableshare/mutilform' |
| | | import ExcelIn from '../excelin' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | |
| | | |
| | | class MainAction extends Component { |
| | | static propTpyes = { |
| | | menuType: PropTypes.any, // 菜单类型,普通菜单或HS |
| | | BID: PropTypes.string, // 主表ID |
| | | BData: PropTypes.any, // 主表数据 |
| | | Tab: PropTypes.any, // 如果当前元素为标签时,tab为标签信息 |
| | |
| | | window.open(url) |
| | | } else if (item.OpenType === 'tab' || item.OpenType === 'blank') { |
| | | this.props.triggerPopview(item, data) |
| | | } else if (item.OpenType === 'funcbutton') { |
| | | if (item.funcType === 'changeuser') { |
| | | this.changeUser(item, data) |
| | | } else if (item.funcType === 'print') { |
| | | this.triggerPrint(item, data) |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | duration: 10 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 触发打印 |
| | | */ |
| | | triggerPrint = (item, data) => { |
| | | // socket = new WebSocket('ws://127.0.0.1:13529') |
| | | |
| | | // // 打开Socket |
| | | // socket.onopen = function(event) { |
| | | // // 监听消息 |
| | | // socket.onmessage = function(event) |
| | | // { |
| | | // //取打印机信息的返回是在这里,所以第一次的打印比较麻烦,看是不是可以在调打印前先判断你有没有存打印机名 |
| | | // //,没有就调getPrinters来取打印机去设置,要是调了打印再调取打印机,第一条打印任务就要在这里重发,就太麻烦了 |
| | | // //提前取打印机就只能用127.0.0.1:13529来取,这个地址就要写死了 |
| | | // console.log('Client received a message',event); |
| | | // }; |
| | | |
| | | // // 监听Socket的关闭 |
| | | // socket.onclose = function(event) |
| | | // { |
| | | // console.log('Client notified socket has closed',event); |
| | | // }; |
| | | |
| | | // }; |
| | | } |
| | | |
| | | /** |
| | | * @description 切换用户 |
| | | */ |
| | | changeUser = (btn, data) => { |
| | | const { setting } = this.props |
| | | |
| | | let param = { |
| | | BID: this.props.BID, |
| | | func: 'webapi_ChangeUser', |
| | | appkey: window.GLOB.appkey || '', |
| | | rduri: window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } |
| | | |
| | | param[setting.primaryKey] = data[0][setting.primaryKey] |
| | | |
| | | confirm({ |
| | | title: this.props.dict['main.action.confirm.tip'], |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(param).then(res => { |
| | | resolve() |
| | | if (res.status) { |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('SessionUid', Utils.getuuid()) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | | sessionStorage.setItem('User_Name', res.UserName) |
| | | |
| | | window.location.reload() |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 15 |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | // 外部请求 |
| | | _outParam = JSON.parse(JSON.stringify(res)) |
| | | |
| | | if (btn.sysInterface === 'true') { |
| | | res.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | if (this.props.menuType === 'HS') { |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | } |
| | | } else { |
| | | res.rduri = btn.interface |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | |
| | | // res.method = btn.method |
| | | if (btn.outerFunc) { |
| | | res.func = btn.outerFunc |
| | |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | | } else if (res.Relogin === 'true') { // 切换用户功能 |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('SessionUid', Utils.getuuid()) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | | sessionStorage.setItem('User_Name', res.UserName) |
| | | // } else if (res.Relogin === 'true') { // 切换用户功能 |
| | | // sessionStorage.setItem('avatar', res.icon || '') |
| | | // sessionStorage.setItem('UserID', res.UserID) |
| | | // sessionStorage.setItem('SessionUid', Utils.getuuid()) |
| | | // sessionStorage.setItem('LoginUID', res.LoginUID) |
| | | // sessionStorage.setItem('User_Name', res.UserName) |
| | | |
| | | window.location.reload() |
| | | return |
| | | // window.location.reload() |
| | | // return |
| | | } |
| | | |
| | | if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') { |
| | |
| | | // 外部请求 |
| | | _outParam = JSON.parse(JSON.stringify(res)) |
| | | |
| | | if (btn.sysInterface === 'true') { |
| | | res.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | if (this.props.menuType === 'HS') { |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | } |
| | | } else { |
| | | res.rduri = btn.interface |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | |
| | | if (btn.outerFunc) { |
| | |
| | | }) |
| | | } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 使用外部函数 |
| | | let param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search) |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | |
| | | if (this.props.menuType === 'HS') { |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | } |
| | | } else { |
| | | param.rduri = btn.interface |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' |
| | |
| | | delete res.message |
| | | delete res.status |
| | | |
| | | if (btn.sysInterface === 'true') { |
| | | res.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | if (this.props.menuType === 'HS') { |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | } |
| | | } else { |
| | | res.rduri = btn.interface |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | |
| | | if (btn.outerFunc) { |
| | |
| | | |
| | | } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 使用外部函数 |
| | | param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search, true, pageIndex, pageSize) |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | |
| | | if (this.props.menuType === 'HS') { |
| | | if (btn.sysInterface === 'true' && options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | param.rduri = btn.interface |
| | | } |
| | | } else { |
| | | param.rduri = btn.interface |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | } |
| | | |
| | | |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | |
| | | let colwidth = [] |
| | | |
| | | let hidecolumns = [] |
| | | |
| | | let verifyColumn = {} // 记录验证信息中的Excel列配置 |
| | | if (btn.verify && btn.verify.columns && btn.verify.columns.length > 0) { |
| | | btn.verify.columns.forEach(col => { |
| | | verifyColumn[col.Column] = col |
| | | }) |
| | | } |
| | | |
| | | logcolumns.forEach(col => { |
| | | if (col.Hide === 'true') { |
| | | hidecolumns.push(col.field) |
| | | return |
| | | } |
| | | if (!data[0].hasOwnProperty(col.field)) return |
| | | if (_topRow[col.field]) return |
| | | |
| | | if (verifyColumn[col.field]) { // 优先使用验证信息中的列设置 |
| | | _header.push(col.field) |
| | | _topRow[col.field] = verifyColumn[col.field].Text |
| | | |
| | | colwidth.push({width: verifyColumn[col.field].Width}) |
| | | } else { |
| | | _header.push(col.field) |
| | | _topRow[col.field] = col.label |
| | | |
| | | let _colwidth = Math.floor(col.Width / 6) |
| | | |
| | | if (!_colwidth || _colwidth < 5) { |
| | | _colwidth = 5 |
| | | } |
| | | |
| | | colwidth.push({width: _colwidth}) |
| | | } |
| | | }) |
| | | |
| | |
| | | colwidth.push({width: col.Width}) |
| | | }) |
| | | } |
| | | |
| | | logcolumns.forEach(col => { |
| | | if (col.Hide === 'true') return |
| | | if (!data[0].hasOwnProperty(col.field)) return |
| | | if (_topRow[col.field]) return |
| | | |
| | | _header.push(col.field) |
| | | _topRow[col.field] = col.label |
| | | |
| | | let _colwidth = Math.floor(col.Width / 6) |
| | | |
| | | if (!_colwidth || _colwidth < 5) { |
| | | _colwidth = 5 |
| | | } |
| | | |
| | | colwidth.push({width: _colwidth}) |
| | | }) |
| | | |
| | | Object.keys(data[0]).forEach(key => { |
| | | if (hidecolumns.includes(key)) return |
| | |
| | | return item |
| | | }) |
| | | |
| | | let error = false |
| | | |
| | | formlist = formlist.map(item => { |
| | | if (item.type === 'link') { |
| | | let supItem = formlist.filter(form => form.field === item.linkField)[0] |
| | | |
| | | // 关联显示列中的字段值,通过该值过滤下拉选项 |
| | | if (!supItem && data && data.hasOwnProperty(item.linkField)) { |
| | | supItem = {initval: data[item.linkField]} |
| | | } |
| | | |
| | | if (!supItem) { |
| | | error = true |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到表单《' + item.label + '》关联字段!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | item.options = item.oriOptions.filter(option => option.parentId === supItem.initval) |
| | | } |
| | |
| | | |
| | | return item |
| | | }) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.props.dict['main.form.link.error'], |
| | | duration: 10 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | readtype: readtype, |
| | |
| | | _list.push(item) |
| | | }) |
| | | |
| | | let error = false |
| | | |
| | | _list = _list.map(item => { |
| | | if (item.type === 'link') { |
| | | let supItem = _list.filter(form => form.field === item.linkField)[0] |
| | | |
| | | if (!supItem) { |
| | | error = true |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到搜索条件《' + item.label + '》关联字段!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | item.options = item.oriOptions.filter(option => option.parentId === supItem.initval) |
| | | } |
| | |
| | | |
| | | return item |
| | | }) |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '关联菜单设置错误!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | match: match, |
| | |
| | | formlist: null, // 表单信息 |
| | | openType: null, // 打开方式 |
| | | interType: null, // 接口类型:内部、外部 |
| | | funcType: null, // 功能类型 |
| | | position: null, // 按钮位置 |
| | | reqOptionSgl: [{ |
| | | value: 'requiredSgl', |
| | |
| | | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _opentype = '' |
| | | let _intertype = '' |
| | | let _position = '' |
| | | let _tabType = '' |
| | | let _options = null |
| | | let _opentype = '' // 打开方式 |
| | | let _intertype = '' // 接口类型 |
| | | let _position = '' // 按钮位置 |
| | | let _tabType = '' // 按钮为弹窗(标签)时,标签的类型 |
| | | let _funcType = '' // 功能按钮类型 |
| | | let _options = null // 选项列表 |
| | | |
| | | this.props.formlist.forEach(form => { |
| | | if (form.key === 'OpenType') { |
| | | _opentype = form.initVal |
| | | if (this.props.card.execMode) { // 转换打印时打开方式 |
| | | _opentype = 'funcbutton' |
| | | } else { |
| | | _opentype = form.initVal |
| | | } |
| | | } else if (form.key === 'intertype') { |
| | | _intertype = form.initVal |
| | | } else if (form.key === 'position') { |
| | | _position = form.initVal |
| | | } else if (form.key === 'tabType') { |
| | | _tabType = form.initVal |
| | | } else if (form.key === 'funcType') { |
| | | _funcType = form.initVal |
| | | } |
| | | }) |
| | | |
| | |
| | | } else { |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } |
| | | } else if (_opentype === 'funcbutton') { |
| | | if (!_funcType) { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (_funcType === 'changeuser') { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (_funcType === 'print') { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } |
| | | } else { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | |
| | | openType: _opentype, |
| | | interType: _intertype, |
| | | position: _position, |
| | | funcType: _funcType, |
| | | formlist: this.props.formlist.map(item => { |
| | | if (item.key === 'class') { |
| | | item.options = btnClasses |
| | |
| | | }, |
| | | ..._tabs |
| | | ] |
| | | } else if (item.key === 'OpenType') { |
| | | item.initVal = _opentype |
| | | } |
| | | |
| | | item.hidden = !_options.includes(item.key) |
| | | return item |
| | | }) |
| | |
| | | */ |
| | | openTypeChange = (key, value) => { |
| | | if (key === 'OpenType') { |
| | | let _options = [] |
| | | let _options = null |
| | | if (value === 'innerpage') { |
| | | _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position'] |
| | | } else if (value === 'outerpage') { |
| | |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } |
| | | } else if (value === 'funcbutton') { |
| | | if (!this.state.funcType) { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (this.state.funcType === 'changeuser') { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (this.state.funcType === 'print') { |
| | | if (this.state.interType === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } |
| | | } else { |
| | | if (this.state.interType === 'inner') { |
| | |
| | | }, |
| | | ..._tabs |
| | | ] |
| | | _fieldval.linkTab = '' |
| | | } |
| | | return item |
| | | }) |
| | | }, () => { |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | } else if (key === 'funcType') { |
| | | let _options = null |
| | | if (!value) { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (value === 'changeuser') { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (value === 'print') { |
| | | if (this.state.interType === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | |
| | | if (item.hidden) return item |
| | | |
| | | if (item.key === 'Ot' && value === 'print') { |
| | | item.options = this.state.reqOptionsMutil |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } |
| | | } else if (openType === 'funcbutton') { |
| | | if (value === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } else { |
| | | if (value === 'inner') { |
| | |
| | | values.Ot = 'notRequired' |
| | | } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id |
| | | values.linkTab = Utils.getuuid() |
| | | } else if (values.OpenType === 'funcbutton' && values.funcType === 'print') { // 转换打印时打开方式 |
| | | values.OpenType = values.execMode |
| | | } |
| | | |
| | | if (values.innerFunc === '' && values.sql === '') { |
| | |
| | | card: '', |
| | | }) |
| | | }) |
| | | } else if (card.execMode) { |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | |
| | | config.action = config.action.map(item => { |
| | | if (item.uuid === card.uuid) { |
| | | item.verify = res |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | profileVisible: false, |
| | | config: config, |
| | | card: '', |
| | | }) |
| | | }) |
| | | } else { |
| | | let _verify = this.verifyRef.state.verify |
| | | |
| | |
| | | } |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | | |
| | | let localParam = JSON.parse(JSON.stringify(param)) |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | |
| | | this.props.reloadmenu() |
| | | |
| | | this.submitAction(btnParam, tabParam) |
| | | |
| | | localParam.func = 'sPC_TrdMenu_AddUpt_For_Local' |
| | | delete localParam.LongParam |
| | | delete localParam.PageParam |
| | | delete localParam.Template |
| | | delete localParam.Sort |
| | | |
| | | Api.getLocalConfig(localParam) |
| | | } else { |
| | | this.setState({ |
| | | menuloading: false, |
| | |
| | | <VerifyCardExcelIn |
| | | card={this.state.card} |
| | | dict={this.state.dict} |
| | | columns={this.state.config.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | |
| | | } |
| | | |
| | | handleSearch = (card) => { |
| | | const {menu} = this.props |
| | | const { config } = this.state |
| | | let _inputfields = [] |
| | | let _linkableFields = [] |
| | | let _formfields = [] |
| | | |
| | | // 设置下拉菜单可关联字段 |
| | | config.groups.forEach(group => { |
| | | let sublist = group.sublist.filter(item => item.type === 'text' || item.type === 'number') |
| | | _inputfields = [..._inputfields, ...sublist] |
| | | |
| | | let suplist = group.sublist.filter(item => item.type === 'select' || item.type === 'link') |
| | | _formfields = [..._formfields, ...suplist] |
| | | }) |
| | | |
| | | if (card.linkSubField && card.linkSubField.length > 0) { |
| | |
| | | card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) |
| | | } |
| | | |
| | | let uniq = new Map() |
| | | _formfields.forEach(item => { |
| | | if (item.field && !uniq.has(item.field)) { |
| | | uniq.set(item.field, true) |
| | | |
| | | _linkableFields.push({ |
| | | value: item.field, |
| | | text: item.label + ' (表单)' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (menu.LongParam) { |
| | | menu.LongParam.columns.forEach(col => { |
| | | if (col.field && !uniq.has(col.field)) { |
| | | uniq.set(col.field, true) |
| | | |
| | | _linkableFields.push({ |
| | | value: col.field, |
| | | text: col.label + ' (显示列)' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | modaltype: 'search', |
| | | card: card, |
| | | formlist: getModalForm(card, _inputfields) |
| | | formlist: getModalForm(card, _inputfields, _linkableFields) |
| | | }) |
| | | } |
| | | |
| | |
| | | * 3、设置编辑参数项-formlist |
| | | */ |
| | | handleForm = (card) => { |
| | | const {menu, tabConfig, subTabConfig} = this.props |
| | | |
| | | const { config } = this.state |
| | | let _inputfields = [] |
| | | let _linkableFields = [] |
| | | let _formfields = [] |
| | | |
| | | // 设置下拉菜单可关联字段 |
| | | // 设置下拉菜单可关联字段(上级与下级) |
| | | if (config.groups.length > 0) { |
| | | config.groups.forEach(group => { |
| | | let sublist = group.sublist.filter(item => item.type === 'text' || item.type === 'number') |
| | | _inputfields = [..._inputfields, ...sublist] |
| | | |
| | | let suplist = group.sublist.filter(item => item.type === 'select' || item.type === 'link') |
| | | _formfields = [..._formfields, ...suplist] |
| | | }) |
| | | } else { |
| | | _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number') |
| | | |
| | | _formfields = config.fields.filter(item => item.type === 'select' || item.type === 'link') |
| | | } |
| | | |
| | | let uniq = new Map() |
| | | _formfields.forEach(item => { |
| | | if (item.field && !uniq.has(item.field)) { |
| | | uniq.set(item.field, true) |
| | | |
| | | _linkableFields.push({ |
| | | value: item.field, |
| | | text: item.label + ' (表单)' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (subTabConfig) { |
| | | subTabConfig.columns.forEach(col => { |
| | | if (col.field && !uniq.has(col.field)) { |
| | | uniq.set(col.field, true) |
| | | |
| | | _linkableFields.push({ |
| | | value: col.field, |
| | | text: col.label + ' (显示列)' |
| | | }) |
| | | } |
| | | }) |
| | | } else if (tabConfig) { |
| | | tabConfig.columns.forEach(col => { |
| | | if (col.field && !uniq.has(col.field)) { |
| | | uniq.set(col.field, true) |
| | | |
| | | _linkableFields.push({ |
| | | value: col.field, |
| | | text: col.label + ' (显示列)' |
| | | }) |
| | | } |
| | | }) |
| | | } else if (menu.LongParam) { |
| | | menu.LongParam.columns.forEach(col => { |
| | | if (col.field && !uniq.has(col.field)) { |
| | | uniq.set(col.field, true) |
| | | |
| | | _linkableFields.push({ |
| | | value: col.field, |
| | | text: col.label + ' (显示列)' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (card.linkSubField && card.linkSubField.length > 0) { |
| | | let fields = _inputfields.map(item => item.field) |
| | | card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getModalForm(card, _inputfields, !!this.props.editTab) |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, !!this.props.editTab) |
| | | }) |
| | | } |
| | | |
| | |
| | | card: '' |
| | | }) |
| | | }) |
| | | } else if (card.execMode) { |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | |
| | | config.action = config.action.map(item => { |
| | | if (item.uuid === card.uuid) { |
| | | item.verify = res |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | profileVisible: false, |
| | | config: config, |
| | | card: '', |
| | | }) |
| | | }) |
| | | } else { |
| | | let _verify = this.verifyRef.state.verify |
| | | |
| | |
| | | <VerifyCardExcelIn |
| | | card={this.state.card} |
| | | dict={this.state.dict} |
| | | columns={this.state.config.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | |
| | | }, { |
| | | value: 'outerpage', |
| | | text: Formdict['header.form.newpage.outer'] |
| | | }, { |
| | | value: 'funcbutton', |
| | | text: Formdict['header.form.funcbutton'] |
| | | }] |
| | | }, { |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'funcType', |
| | | label: Formdict['header.form.funcType'], |
| | | initVal: card.funcType || '', |
| | | required: true, |
| | | options: [{ |
| | | value: 'changeuser', |
| | | text: Formdict['header.form.func.changeuser'] |
| | | }, { |
| | | value: 'print', |
| | | text: Formdict['header.form.func.print'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'execMode', |
| | | label: Formdict['header.form.execMode'], |
| | | initVal: card.execMode || 'exec', |
| | | required: true, |
| | | options: [{ |
| | | value: 'exec', |
| | | text: Formdict['header.form.exec'] |
| | | }, { |
| | | value: 'prompt', |
| | | text: Formdict['header.form.prompt'] |
| | | }, { |
| | | value: 'pop', |
| | | text: Formdict['header.form.popform'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'tabType', |
| | | label: Formdict['header.form.tabType'], |
| | |
| | | * @param {*} card |
| | | * @param {*} inputfields |
| | | */ |
| | | export function getModalForm (card, inputfields, subtable = false) { |
| | | export function getModalForm (card, inputfields, linkableFields, subtable = false) { |
| | | let _openType = [] |
| | | let _fieldlength = 50 |
| | | |
| | |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | type: 'select', |
| | | key: 'linkField', |
| | | label: Formdict['header.form.linkField'], |
| | | initVal: card.linkField || '', |
| | | required: true, |
| | | readonly: false |
| | | readonly: false, |
| | | options: linkableFields |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Tabs, Row, Col, Radio, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Tooltip } from 'antd' |
| | | import { Form, Tabs, Row, Col, Radio, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Tooltip, Input, Select } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | orderModular: [], |
| | | orderModularDetail: [], |
| | | voucher: [], |
| | | templates: [], |
| | | selectimg: '', |
| | | voucherDetail: [], |
| | | uniqueColumns: [ |
| | | { |
| | |
| | | customverifys: _verify.customverifys || [], |
| | | billcodes: _verify.billcodes || [], |
| | | voucher: _verify.voucher || {enabled: false}, |
| | | scripts: _verify.scripts || [] |
| | | scripts: _verify.scripts || [], |
| | | Template: _verify.Template || '' |
| | | } |
| | | }) |
| | | |
| | |
| | | voucherDetail: result[1].data |
| | | }) |
| | | }) |
| | | |
| | | if (this.props.card.execMode) { |
| | | let _sql = `select ID,Images,PrintTempNO+PrintTempName as PN from sPrintTemplate |
| | | where appkey= @appkey@ and Deleted=0 |
| | | union select ID,Images,a.PrintTempNO+PrintTempName as PN |
| | | from (select * from sPrintTemplate where appkey= '' and Deleted=0 ) a |
| | | left join (select PrintTempNO from sPrintTemplate where appkey= @appkey@ and Deleted=0 ) b |
| | | on a.PrintTempNO=b.PrintTempNO |
| | | left join (select Srcid from sPrintTemplate_Log where appkey='' and apicode= @appkey@ and Deleted=0 ) c |
| | | on a.ID=c.Srcid where b.PrintTempNO is null and c.Srcid is null` |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: Utils.formatOptions(_sql), |
| | | obj_name: 'data', |
| | | arr_field: 'PN,ID,Images' |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | if (res.status) { |
| | | let temps = res.data.map(temp => { |
| | | return { |
| | | value: temp.ID, |
| | | text: temp.PN, |
| | | img: temp.Images |
| | | } |
| | | }) |
| | | |
| | | let Template = this.state.verify.Template |
| | | let selectimg = '' |
| | | let selectTemp = temps.filter(temp => temp.value === Template)[0] |
| | | |
| | | if (!selectTemp) { |
| | | Template = '' |
| | | } else { |
| | | selectimg = selectTemp.img |
| | | } |
| | | |
| | | this.setState({ |
| | | selectimg: selectimg, |
| | | templates: temps, |
| | | verify: { |
| | | ...this.state.verify, |
| | | Template: Template |
| | | } |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | uniqueChange = (values) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | changeTemplate = (val) => { |
| | | const { templates } = this.state |
| | | |
| | | let temp = templates.filter(temp => temp.value === val)[0] |
| | | |
| | | this.setState({ |
| | | selectimg: temp.img |
| | | }) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { verify } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | let _verify = {...verify, ...values} |
| | | |
| | | resolve(_verify) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '链接地址与打印模板不可为空!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const { verify, fields, uniqueColumns, contrastColumns, customColumns, orderColumns, scriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | <TabPane tab="基础验证" key="1"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={12}> |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="bottomLeft" title={'默认sql执行顺序为自定义脚本之前'}> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={8}> |
| | | <Form.Item label={'账期验证'}> |
| | | <Radio.Group value={verify.accountdate} onChange={(e) => {this.onOptionChange(e, 'accountdate')}}> |
| | | <Radio value="true">开启</Radio> |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={8}> |
| | | <Form.Item label={'失效验证'}> |
| | | <Radio.Group value={verify.invalid} onChange={(e) => {this.onOptionChange(e, 'invalid')}}> |
| | | <Radio value="true">开启</Radio> |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | {this.props.card.execMode ? <Col span={8}> |
| | | <Form.Item label={'链接地址'}> |
| | | {getFieldDecorator('linkUrl', { |
| | | initialValue: verify.linkUrl || '127.0.0.1:13529', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '链接地址!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {this.props.card.execMode ? <Col span={8}> |
| | | <Form.Item label={'打印模板'}> |
| | | {getFieldDecorator('Template', { |
| | | initialValue: verify.Template || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '打印模板!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select onChange={this.changeTemplate}> |
| | | {this.state.templates.map((option, key) => |
| | | <Select.Option id={key} key={key} value={option.value}> |
| | | {option.text} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {this.state.selectimg ? <Col span={9}> |
| | | <img style={{width: '90%', marginBottom: '25px'}} src={this.state.selectimg} alt=""/> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | </TabPane> |
| | |
| | | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | | columns: PropTypes.array, // 显示列 |
| | | dict: PropTypes.object, // 字典项 |
| | | card: PropTypes.object, |
| | | } |
| | |
| | | range: _verify.range || 0, |
| | | columns: _columns, |
| | | scripts: _verify.scripts || [] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | columnFieldInput = () => { |
| | | const { columns } = this.props |
| | | const { verify } = this.state |
| | | |
| | | let _columns = JSON.parse(JSON.stringify(verify.columns)) |
| | | |
| | | let _cols = _columns.map(col => col.Column ) |
| | | |
| | | columns.forEach(col => { |
| | | if (col.field && !_cols.includes(col.field)) { |
| | | let _type = 'Nvarchar(50)' |
| | | let _limit = '50' |
| | | if (col.type === 'number' && col.decimal === 0) { |
| | | _type = 'Int' |
| | | _limit = '' |
| | | } else if (col.type === 'number') { |
| | | _type = 'Decimal(18,' + col.decimal + ')' |
| | | _limit = col.decimal |
| | | } |
| | | |
| | | let _cell = { |
| | | uuid: col.uuid, |
| | | Column: col.field, |
| | | Text: col.label, |
| | | type: _type, |
| | | limit: _limit, |
| | | required: 'true' |
| | | } |
| | | |
| | | if (_type !== 'Nvarchar(50)') { |
| | | _cell.min = 0 |
| | | _cell.max = 999999 |
| | | } |
| | | |
| | | _columns.push(_cell) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | verify: { |
| | | ...verify, |
| | | columns: _columns |
| | | } |
| | | }) |
| | | } |
| | |
| | | columnChange={this.columnChange} |
| | | wrappedComponentRef={(inst) => this.columnForm = inst} |
| | | /> |
| | | <Button className="excel-col-add" title="添加显示列字段" onClick={this.columnFieldInput} type="primary"> |
| | | 快捷添加 |
| | | </Button> |
| | | <Table |
| | | bordered |
| | | rowKey="uuid" |
| | |
| | | padding: 0 5px; |
| | | cursor: pointer; |
| | | } |
| | | .ant-tabs-tabpane { |
| | | position: relative; |
| | | .excel-col-add { |
| | | position: absolute; |
| | | right: 0; |
| | | top: 90px; |
| | | } |
| | | } |
| | | } |