| | |
| | | refreshtabs: null, // 需要刷新的标签集 |
| | | confirmLoading: false,// 自定义设置模态框加载中 |
| | | settingVisible: false,// 自定义设置模态框 |
| | | triggerBtn: null // 点击表格中或快捷键触发的按钮 |
| | | triggerBtn: null, // 点击表格中或快捷键触发的按钮 |
| | | tabActive: null // 标签页展开控制 |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | } |
| | | |
| | | let _tabActive = {} // 筛选展开的tab页 |
| | | |
| | | config.tabgroups.forEach(groupId => { |
| | | if (!config[groupId] || config[groupId].length === 0) return |
| | | _tabActive[groupId] = config[groupId][0].uuid |
| | | }) |
| | | |
| | | let _arrField = [] // 字段集 |
| | | let _columns = [] // 显示列 |
| | | let _logcolumns = [] // 日志显示列 |
| | |
| | | this.setState({ |
| | | loadingview: false, |
| | | config: config, |
| | | tabActive: _tabActive, |
| | | userConfig: userConfig, |
| | | setting: config.setting, |
| | | searchlist: config.search, |
| | |
| | | } |
| | | |
| | | setShortcut = () => { |
| | | const { actions, userConfig } = this.state |
| | | const { actions, userConfig, config } = this.state |
| | | if (!userConfig) return |
| | | |
| | | document.onkeydown = (event) => { |
| | |
| | | e.preventDefault() |
| | | istrigger = true |
| | | |
| | | this.setState({ |
| | | triggerBtn: { |
| | | uuid: new Date().getTime(), |
| | | parentId: key, |
| | | button: {...item, uuid: btnkey}, |
| | | data: null |
| | | let _groupId = '' |
| | | let _ActiveTabId = '' |
| | | config.tabgroups.forEach(groupId => { |
| | | if (!config[groupId] || config[groupId].length === 0) return |
| | | |
| | | let _tab = config[groupId].filter(tab => tab.uuid === key)[0] |
| | | if (_tab) { |
| | | _groupId = groupId |
| | | _ActiveTabId = _tab.uuid |
| | | } |
| | | }) |
| | | |
| | | if (this.state.tabActive[_groupId] === _ActiveTabId) { |
| | | this.setState({ |
| | | triggerBtn: { |
| | | uuid: new Date().getTime(), |
| | | parentId: key, |
| | | button: {...item, uuid: btnkey}, |
| | | data: null |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | tabActive: {...this.state.tabActive, [_groupId]: _ActiveTabId} |
| | | }, () => { |
| | | this.setState({ |
| | | triggerBtn: { |
| | | uuid: new Date().getTime(), |
| | | parentId: key, |
| | | button: {...item, uuid: btnkey}, |
| | | data: null |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { view, setting, searchlist, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig } = this.state |
| | | const { view, setting, searchlist, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig, tabActive } = this.state |
| | | |
| | | return ( |
| | | <div> |
| | |
| | | if (config[group].length === 0) return null |
| | | |
| | | return ( |
| | | <Tabs defaultActiveKey="0" key={group}> |
| | | {config[group].map((_tab, index) => { |
| | | <Tabs activeKey={tabActive[group]} key={group} onChange={(key) => this.setState({tabActive: {...tabActive, [group]: key}})}> |
| | | {config[group].map(_tab => { |
| | | return ( |
| | | <TabPane tab={ |
| | | <span> |
| | | {_tab.icon ? <Icon type={_tab.icon} /> : null} |
| | | {_tab.label} |
| | | </span> |
| | | } key={`${index}`}> |
| | | } key={_tab.uuid}> |
| | | {_tab.type === 'SubTable' ? |
| | | <SubTable |
| | | Tab={_tab} |
| | | menuType="main" |
| | | MenuID={_tab.linkTab} |
| | | userConfig={userConfig ? userConfig[_tab.linkTab] : null} |
| | | userConfig={userConfig ? userConfig[_tab.uuid] : null} |
| | | triggerBtn={triggerBtn} |
| | | SupMenuID={this.props.MenuID} |
| | | refreshtabs={this.state.refreshtabs} |
| | |
| | | } |
| | | |
| | | let _fieldlen = item.fieldlength || 50 |
| | | if (item.type === 'textarea' || item.type === 'fileupload') { |
| | | if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { |
| | | _fieldlen = item.fieldlength || 512 |
| | | } else if (item.type === 'number') { |
| | | _fieldlen = item.decimal ? item.decimal : 0 |
| | |
| | | this.loadmaindata(nextProps.BID, 'refresh') |
| | | } else if (this.state.config && nextProps.refreshtabs && nextProps.refreshtabs.includes(this.props.Tab.uuid)) { |
| | | this.reloadtable() |
| | | } else if (nextProps.triggerBtn && !is(fromJS(this.props.triggerBtn), fromJS(nextProps.triggerBtn)) && nextProps.triggerBtn.parentId === this.props.MenuID) { |
| | | } else if (nextProps.triggerBtn && !is(fromJS(this.props.triggerBtn), fromJS(nextProps.triggerBtn)) && nextProps.triggerBtn.parentId === this.props.Tab.uuid) { |
| | | let trigger = nextProps.triggerBtn |
| | | |
| | | trigger.parentId = this.props.MenuID |
| | | |
| | | this.setState({ |
| | | triggerBtn: nextProps.triggerBtn |
| | | triggerBtn: trigger |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | let _fieldlen = item.fieldlength || 50 |
| | | if (item.type === 'textarea' || item.type === 'fileupload') { |
| | | if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { |
| | | _fieldlen = item.fieldlength || 512 |
| | | } else if (item.type === 'number') { |
| | | _fieldlen = item.decimal ? item.decimal : 0 |
| | |
| | | }).then(response => { |
| | | if (!response) return |
| | | |
| | | response = {"status":true,"message":"","ErrCode":"","ErrMesg":"","CpCode":"YTO","InsideBill":"202003261727348572C0D0C2C0E444FD0B42A","PrintData":"{\"data\":{\"CpCode\":\"YTO\",\"WayBillCode\":\"YT2045589280491\",\"InsideBill\":\"19042003260002\",\"RecvInfo\":\"张先生 137147852 \\r\\n河北省保定市竞秀区001\",\"SendInfo\":\"宝时得科技(中国)有限公司 0512-65152888-5147 \\r\\n宝时得科技(中国)有限公司(B区)苏州工业园区东旺路18号\",\"BigShot\":\"176保定\",\"GatherCenterCode\":\"311911\",\"GatherCenterName\":\"\",\"CustomData\":\"wu800*2\\\\r\\\\n\",\"Pin\":\"\"},\"templateURL\":\"http://css.positecgroup.com/template/yto.srt\",\"ectype\":\"jdpop\"}","CustomData":""} |
| | | if (response.status) { |
| | | _list.push(response) |
| | | |
| | |
| | | } |
| | | |
| | | let _fieldlen = item.fieldlength || 50 |
| | | if (item.type === 'textarea' || item.type === 'fileupload') { |
| | | if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { |
| | | _fieldlen = item.fieldlength || 512 |
| | | } else if (item.type === 'number') { |
| | | _fieldlen = item.decimal ? item.decimal : 0 |
| | |
| | | } |
| | | |
| | | let _fieldlen = item.fieldlength || 50 |
| | | if (item.type === 'textarea' || item.type === 'fileupload') { |
| | | if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { |
| | | _fieldlen = item.fieldlength || 512 |
| | | } else if (item.type === 'number') { |
| | | _fieldlen = item.decimal ? item.decimal : 0 |
| | |
| | | } |
| | | .ant-table-tbody > tr > td .content { |
| | | p { |
| | | margin-bottom: 5px; |
| | | margin-bottom: 2px; |
| | | } |
| | | span { |
| | | display: inline-block; |
| | |
| | | .ant-advanced-search-form.top-search { |
| | | padding: 0px 24px 20px; |
| | | padding: 0px 24px 10px; |
| | | border-bottom: 1px solid #efefef; |
| | | .ant-form-item { |
| | | display: flex; |
| | |
| | | if (!res.LongParam) return |
| | | |
| | | let subconfig = '' |
| | | let subUserConfig = userConfig ? userConfig[res.tab.linkTab] : '' |
| | | let subUserConfig = userConfig ? userConfig[res.tab.uuid] : '' |
| | | |
| | | try { |
| | | subconfig = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | |
| | | } |
| | | |
| | | menuParam.push({ |
| | | uuid: res.tab.linkTab, |
| | | uuid: res.tab.uuid, |
| | | linkTab: res.tab.linkTab, |
| | | label: res.tab.label, |
| | | setting: {tableType: subconfig.setting.tableType}, |
| | | action: subconfig.action.map(item => { |
| | |
| | | if (!item.verify || !item.verify.linkUrl) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '打印按钮《' + item.label + '》设置错误!', |
| | | message: '按钮《' + item.label + '》设置错误!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | .edit { |
| | | position: absolute; |
| | | right: 100px; |
| | | right: 50px; |
| | | top: -5px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | } |
| | | .edit.close { |
| | | right: 60px; |
| | | right: 10px; |
| | | color: #ff4d4f; |
| | | } |
| | | .edit.copy { |
| | | right: 80px; |
| | | right: 30px; |
| | | color: #26C281; |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | if (card.type === 'textarea' || card.type === 'fileupload') { |
| | | if (card.type === 'textarea' || card.type === 'fileupload' || card.type === 'multiselect') { |
| | | _fieldlength = 512 |
| | | } |
| | | |
| | |
| | | form.show = false |
| | | } else if (form.key === 'fieldlength') { |
| | | form.initVal = 50 |
| | | if (value === 'textarea' || value === 'fileupload') { |
| | | if (value === 'textarea' || value === 'fileupload' || value === 'multiselect') { |
| | | form.initVal = 512 |
| | | } |
| | | form.show = false |
| | |
| | | dict: PropTypes.object // 字典项 |
| | | } |
| | | |
| | | componentDidMount () { |
| | | try { |
| | | let _form = document.getElementById('config') |
| | | if (_form && _form.select) { |
| | | _form.select() |
| | | } |
| | | } catch { |
| | | console.warn('Form focusing error!') |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | |
| | | if (form.key === 'match') { |
| | | if (type === 'text') { |
| | | form.options = matchReg.text |
| | | } else if (type === 'multiselect' || type === 'select' || type === 'link') { |
| | | } else if (type === 'multiselect') { |
| | | form.options = matchReg.multiselect |
| | | } else if (type === 'select' || type === 'link') { |
| | | form.options = matchReg.select |
| | | } else if (type === 'date') { |
| | | form.options = matchReg.date |
| | |
| | | } else if (form.key === 'match') { // 搜索条件类型切换时,匹配规则类型对应切换 |
| | | if (value === 'text') { |
| | | form.options = matchReg.text |
| | | } else if (value === 'multiselect' || value === 'select' || value === 'link') { |
| | | } else if (value === 'multiselect') { |
| | | form.options = matchReg.multiselect |
| | | } else if (value === 'select' || value === 'link') { |
| | | form.options = matchReg.select |
| | | } else if (value === 'date') { |
| | | form.options = matchReg.date |
| | |
| | | value: '=', |
| | | text: '=' |
| | | }], |
| | | multiselect: [{ |
| | | value: 'like', |
| | | text: 'like' |
| | | }, { |
| | | value: 'not like', |
| | | text: 'not like' |
| | | }], |
| | | select: [{ |
| | | value: '=', |
| | | text: '=' |
| | |
| | | |
| | | searchText += item.key + ' ' + item.match + ' \'' + str + item.value + str + '\'' |
| | | } else if (item.type === 'multiselect') { |
| | | let str = item.match === '=' ? '' : '%' |
| | | let options = item.value.map(val => { |
| | | return item.key + ' ' + item.match + ' \'' + str + val + str + '\'' |
| | | }) |
| | | |
| | | searchText += '(' + options.join(' OR ') + ')' |
| | | searchText += `'${item.value}' ` + item.match + ' \'%\'+' + item.key + '+\'%\'' |
| | | } else if (item.type === 'date') { |
| | | let _val = item.value |
| | | let timetail = ' 00:00:00.000' |
| | |
| | | searchText += '(' + item.key + ' ' + item.match + ' \'' + item.value + '\')' |
| | | } |
| | | }) |
| | | |
| | | return searchText |
| | | } |
| | | |
| | |
| | | auth: true |
| | | }) |
| | | } |
| | | |
| | | // let link = document.querySelector("link[rel*='icon']") || document.createElement('link') |
| | | // link.type = 'image/x-icon' |
| | | // link.rel = 'shortcut icon' |
| | | // link.href = 'http://www.stackoverflow.com/favicon.ico' |
| | | // document.getElementsByTagName('head')[0].appendChild(link) |
| | | } |
| | | |
| | | render () { |