| | |
| | | } |
| | | .ant-tooltip.middle { |
| | | max-width: 320px!important; |
| | | } |
| | | } |
| | | |
| | | // 关联选择 |
| | | .ant-cascader-menus { |
| | | z-index: 1090!important; |
| | | .ant-cascader-menu::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-cascader-menu::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .ant-cascader-menu::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | |
| | | this.setState({ |
| | | roleList: res.Roles.map(role => { |
| | | return { |
| | | uuid: Utils.getuuid(), |
| | | value: role.RoleID, |
| | | text: role.RoleName |
| | | } |
| | |
| | | 'header.form.maxRows': '最大行数', |
| | | 'header.form.paste': '粘贴', |
| | | 'header.form.ratio': '比例', |
| | | 'header.form.blacklist': '黑名单', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | 'header.form.maxRows': '最大行数', |
| | | 'header.form.paste': '粘贴', |
| | | 'header.form.ratio': '比例', |
| | | 'header.form.blacklist': '黑名单', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import {refreshTabView, modifyTabview} from '@/store/action' |
| | | |
| | | import MainTable from './mainTable' |
| | | import MainAction from '@/tabviews/tableshare/actionList' |
| | | import VerifyCard from '@/tabviews/tableshare/verifycard' |
| | | import MainSearch from '@/tabviews/tableshare/topSearch' |
| | | import NotFount from '@/components/404' |
| | | import './index.scss' |
| | | |
| | | const MainAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | // const MainAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | const SubTable = asyncLoadComponent(() => import('@/tabviews/subtable')) |
| | | const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable')) |
| | | const FormTab = asyncLoadComponent(() => import('@/tabviews/formtab')) |
| | |
| | | MenuID: this.props.MenuID |
| | | } |
| | | let result = await Api.getSystemCacheConfig(param) |
| | | |
| | | if (result.status) { |
| | | let config = '' |
| | | let userConfig = '' |
| | |
| | | config[group] = config[group].filter(tab => permAction[tab.linkTab]) |
| | | }) |
| | | |
| | | // 字段权限黑名单 |
| | | config.search = config.search.filter(item => { |
| | | if (!item.blacklist || item.blacklist.length === 0) return true |
| | | |
| | | let _black = item.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | |
| | | config.columns = config.columns.filter(col => { |
| | | if (!col.field || !col.blacklist || col.blacklist.length === 0) return true |
| | | |
| | | let _black = col.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | |
| | | if (userConfig) { |
| | | config.setting = {...config.setting, ...userConfig.setting} |
| | | let _actions = {} |
| | |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() // 用于字段过滤 |
| | | |
| | | let _actions = [] // 工具栏按钮 |
| | | let _operations = [] // 操作列按钮(存在时) |
| | | let _actions = [] // 工具栏按钮 |
| | | let _operations = [] // 操作列按钮(存在时) |
| | | |
| | | config.action.forEach(item => { |
| | | if (item.execMode) { |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | // if () { // 权限黑名单 |
| | | // col.Hide = 'true' |
| | | // } |
| | | |
| | | _logcolumns.push(col) |
| | | } |
| | |
| | | |
| | | let istrigger = false |
| | | actions.forEach(item => { |
| | | if (!item.shortcut || istrigger) return |
| | | if (!item.shortcut || typeof(item.shortcut) !== 'object' || istrigger) return |
| | | |
| | | if (preKey === item.shortcut && keyCode === item.shortcutkey) { |
| | | if (preKey === item.shortcut[0] && keyCode === item.shortcut[1]) { |
| | | e.preventDefault() |
| | | istrigger = true |
| | | |
| | | this.refs.mainButton.actionTrigger(item) |
| | | } |
| | | }) |
| | |
| | | this.setState({ |
| | | settingVisible: false, |
| | | confirmLoading: false |
| | | }, () => { |
| | | window.GLOB.CacheMap = new Map() |
| | | this.reloadview() |
| | | }) |
| | | }) |
| | | }) |
| | |
| | | /> : null |
| | | } |
| | | {actions && setting.onload !== 'false' ? |
| | | <div style={{minHeight: '45px'}}> |
| | | <div style={{minHeight: '25px'}}> |
| | | <MainAction |
| | | ref="mainButton" |
| | | BID="" |
| | |
| | | actions={actions} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | permRoles={this.props.permRoles} |
| | | logcolumns={this.state.logcolumns} |
| | | ContainerId={this.state.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | |
| | | return { |
| | | tabviews: state.tabviews, |
| | | refreshTab: state.refreshTab, |
| | | permAction: state.permAction |
| | | permAction: state.permAction, |
| | | permRoles: state.permRoles |
| | | } |
| | | } |
| | | |
| | |
| | | position: relative; |
| | | .main-pickup { |
| | | position: absolute; |
| | | right: 20px; |
| | | right: 55px; |
| | | top: -22px; |
| | | z-index: 1; |
| | | } |
| | |
| | | position: absolute; |
| | | z-index: 1; |
| | | right: 20px; |
| | | top: -50px; |
| | | font-size: 16px; |
| | | top: -23px; |
| | | font-size: 18px; |
| | | padding: 3px; |
| | | cursor: pointer; |
| | | } |
| | |
| | | } |
| | | } |
| | | .commontable.pick-control { |
| | | >.button-list { |
| | | .button-list { |
| | | padding-right: 140px; |
| | | } |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | let _arrField = [config.setting.primaryKey] // 字段集 , 默认添加主键 |
| | | |
| | | config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | if (!item.field) return |
| | | |
| | | _arrField.push(item.field) |
| | | }) |
| | | }) |
| | | _arrField = _arrField.join(',') |
| | | |
| | | // 权限过滤 |
| | | if (this.props.param.menuType !== 'HS') { |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | |
| | | config[group] = config[group].filter(tab => permAction[tab.linkTab]) |
| | | }) |
| | | } |
| | | |
| | | let _arrField = [config.setting.primaryKey] // 字段集 , 默认添加主键 |
| | | |
| | | config.groups.forEach(group => { |
| | | group.sublist = group.sublist.filter(item => { |
| | | if (!item.blacklist || item.blacklist.length === 0) { |
| | | _arrField.push(item.field) |
| | | return true |
| | | } |
| | | |
| | | let _black = item.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | _arrField.push(item.field) |
| | | return true |
| | | } |
| | | }) |
| | | }) |
| | | _arrField = _arrField.join(',') |
| | | |
| | | this.setState({ |
| | | config: config, |
| | |
| | | return { |
| | | tabviews: state.tabviews, |
| | | refreshTab: state.refreshTab, |
| | | permAction: state.permAction |
| | | permAction: state.permAction, |
| | | permRoles: state.permRoles |
| | | } |
| | | } |
| | | |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Spin, Modal, Button, Switch} from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import SubTable from './subTable' |
| | | import SubSearch from '@/tabviews/tableshare/topSearch' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import NotFount from '@/components/404' |
| | | 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 SubTable from './subTable' |
| | | import SubAction from '@/tabviews/tableshare/actionList' |
| | | import SubSearch from '@/tabviews/tableshare/topSearch' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | // import asyncComponent from '@/utils/asyncComponent' |
| | | import NotFount from '@/components/404' |
| | | |
| | | import './index.scss' |
| | | |
| | | const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable')) |
| | | const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | // const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | |
| | | class SubTabViewTable extends Component { |
| | | static propTpyes = { |
| | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | |
| | | // 字段权限黑名单 |
| | | config.search = config.search.filter(item => { |
| | | if (!item.blacklist || item.blacklist.length === 0) return true |
| | | |
| | | let _black = item.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | |
| | | config.columns = config.columns.filter(col => { |
| | | if (!col.field || !col.blacklist || col.blacklist.length === 0) return true |
| | | |
| | | let _black = col.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid |
| | |
| | | /> : null |
| | | } |
| | | {actions ? |
| | | <div style={{minHeight: '45px'}}> |
| | | <div style={{minHeight: '25px'}}> |
| | | <SubAction |
| | | ref="subButton" |
| | | type="sub" |
| | |
| | | BData={this.props.BData} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.SupMenuID} |
| | | permRoles={this.props.permRoles} |
| | | logcolumns={this.state.logcolumns} |
| | | ContainerId={this.props.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | | ContainerId={this.props.ContainerId} |
| | | triggerPopview={this.triggerPopview} |
| | | getexceloutparam={this.getexceloutparam} |
| | | gettableselected={this.gettableselected} |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permAction: state.permAction |
| | | permAction: state.permAction, |
| | | permRoles: state.permRoles |
| | | } |
| | | } |
| | | |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Spin} from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import SubTable from '@/tabviews/subtable/subTable' |
| | | import SubSearch from '@/tabviews/tableshare/topSearch' |
| | | import NotFount from '@/components/404' |
| | | 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/asyncComponent' |
| | | import SubTable from '@/tabviews/subtable/subTable' |
| | | import SubAction from '@/tabviews/tableshare/actionList' |
| | | import SubSearch from '@/tabviews/tableshare/topSearch' |
| | | import NotFount from '@/components/404' |
| | | |
| | | import './index.scss' |
| | | |
| | | const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | // const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | |
| | | class SubTabModalTable extends Component { |
| | | static propTpyes = { |
| | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | |
| | | // 字段权限黑名单 |
| | | config.search = config.search.filter(item => { |
| | | if (!item.blacklist || item.blacklist.length === 0) return true |
| | | |
| | | let _black = item.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | |
| | | config.columns = config.columns.filter(col => { |
| | | if (!col.field || !col.blacklist || col.blacklist.length === 0) return true |
| | | |
| | | let _black = col.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid |
| | |
| | | /> : null |
| | | } |
| | | {actions ? |
| | | <div style={{minHeight: '45px'}}> |
| | | <div style={{minHeight: '25px'}}> |
| | | <SubAction |
| | | ref="subtabButton" |
| | | type="subtab" |
| | |
| | | setting={setting} |
| | | actions={actions} |
| | | BID={this.props.BID} |
| | | BData={this.props.BData} |
| | | dict={this.state.dict} |
| | | BData={this.props.BData} |
| | | MenuID={this.props.SupMenuID} |
| | | ContainerId={this.props.ContainerId} |
| | | permRoles={this.props.permRoles} |
| | | refreshdata={this.refreshbyaction} |
| | | ContainerId={this.props.ContainerId} |
| | | gettableselected={this.gettableselected} |
| | | /> |
| | | </div> : null |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permAction: state.permAction |
| | | permAction: state.permAction, |
| | | permRoles: state.permRoles |
| | | } |
| | | } |
| | | |
| | |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | refreshdata: PropTypes.func, // 执行完成后数据刷新 |
| | | triggerPopview: PropTypes.func, // 弹窗标签页触发 |
| | | getexceloutparam: PropTypes.func, // 获取excel导出数据 |
| | | gettableselected: PropTypes.func // 获取表格中数据 |
| | | getexceloutparam: PropTypes.func, // 获取excel导出数据 |
| | | gettableselected: PropTypes.func, // 获取表格中数据 |
| | | permRoles: PropTypes.any // 用户权限列表 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | let printlist = [] |
| | | let templates = [] |
| | | let templates = [btn.verify.Template] |
| | | |
| | | this.setState({loadingUuid: btn.uuid}) |
| | | |
| | | new Promise(resolve => { |
| | | if (btn.intertype === 'inner' && !btn.innerFunc) { |
| | | formdata.TemplateID = btn.verify.Template |
| | | templates.push(btn.verify.Template) |
| | | |
| | | if (btn.Ot === 'notRequired') { |
| | | printlist.push(formdata) |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount > 1) { |
| | | for (let i = 0; i < formdata.printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(formdata))) |
| | | } |
| | | } else { |
| | | printlist.push(formdata) |
| | | } |
| | | } else { |
| | | printlist = data.map(cell => { |
| | | data.forEach(cell => { |
| | | let _cell = {...cell, ...formdata} |
| | | |
| | | return _cell |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount > 1) { |
| | | for (let i = 0; i < formdata.printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(_cell))) |
| | | } |
| | | } else { |
| | | printlist.push(_cell) |
| | | } |
| | | }) |
| | | } |
| | | resolve('getTemp') |
| | | } else { |
| | | this.getprintdata(btn, data, formdata, formlist).then(result => { |
| | | printlist = result.list.map(item => { |
| | | if (item.TemplateID) { |
| | | templates.push(item.TemplateID) |
| | | } else { |
| | | item.TemplateID = btn.verify.Template |
| | | } |
| | | return item |
| | | }) |
| | | result.list.forEach(item => { |
| | | let _cell = item.data |
| | | |
| | | if (_cell.TemplateID) { |
| | | templates.push(_cell.TemplateID) |
| | | } else { |
| | | _cell.TemplateID = btn.verify.Template |
| | | } |
| | | |
| | | if (item.count && typeof(item.count) === 'number' && item.count > 1) { |
| | | for (let i = 0; i < item.count; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(_cell))) |
| | | } |
| | | } else { |
| | | printlist.push(_cell) |
| | | } |
| | | }) |
| | | |
| | | resolve(result.next) |
| | | }) |
| | | } |
| | |
| | | ID: tempId |
| | | } |
| | | |
| | | if (options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi.replace('dostars', 'dostar') |
| | | if (window.GLOB.mainSystemApi) { // 从单点登录服务器取打印配置信息 |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | |
| | | let errorMsg = '' |
| | | result.forEach(res => { |
| | | if (res.status) { |
| | | _list.push(res.data) |
| | | res.data.forEach(_item => { |
| | | _list.push({data: _item, count: res.printCount}) |
| | | }) |
| | | } else { |
| | | errorMsg = res |
| | | } |
| | |
| | | return Api.genericInterface(res) |
| | | }).then(response => { |
| | | if (!response) return |
| | | // 回调请求 |
| | | |
| | | if (response.status) { |
| | | response.data.forEach(_item => { |
| | | _list.push({data: _item, count: response.printCount}) |
| | | }) |
| | | |
| | | // 一次请求成功,进行下一项请求 |
| | | if (params.length === 0) { |
| | | _resolve({next: 'getTemp', list: _list}) |
| | |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | _list.push(res.data) |
| | | res.data.forEach(_item => { |
| | | _list.push({data: _item, count: res.printCount}) |
| | | }) |
| | | |
| | | if (params.length === 0) { |
| | | _resolve({next: 'getTemp', list: _list}) |
| | |
| | | error = '打印模板解析错误!' |
| | | } else { |
| | | let control = configParam.elements.map(element => { |
| | | let _field = element.field |
| | | |
| | | if (_field === 'other_field') { |
| | | _field = element.cusfield || '' |
| | | } |
| | | |
| | | let item = { |
| | | Name: element.name || '', |
| | | Type: element.type, |
| | | Value: element.value || '', |
| | | Field: element.field || '', |
| | | Field: _field, |
| | | Left: element.left, |
| | | Top: element.top, |
| | | Width: element.width, |
| | |
| | | btnloading: false |
| | | }) |
| | | } else { |
| | | if (_LongParam.groups.length > 0) { |
| | | _LongParam.groups.forEach(group => { |
| | | group.sublist = group.sublist.filter(cell => { |
| | | if (!cell.blacklist || cell.blacklist.length === 0) return true |
| | | |
| | | let _black = cell.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | _LongParam.fields = _LongParam.fields.filter(cell => { |
| | | if (!cell.blacklist || cell.blacklist.length === 0) return true |
| | | |
| | | let _black = cell.blacklist.filter(v => { |
| | | return this.props.permRoles.indexOf(v) !== -1 |
| | | }) |
| | | |
| | | if (_black.length > 0) { |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | configMap: {...configMap, [action.uuid]: _LongParam}, |
| | | execAction: {..._LongParam, ...execAction} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Button, Input } from 'antd' |
| | | import { Form, Row, Col, Select, Button, Input, Cascader } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const shortkeycode = { |
| | | 65: 'A', |
| | | 66: 'B', |
| | | 67: 'C', |
| | | 68: 'D', |
| | | 69: 'E', |
| | | 70: 'F', |
| | | 71: 'G', |
| | | 72: 'H', |
| | | 73: 'I', |
| | | 74: 'J', |
| | | 75: 'K', |
| | | 76: 'L', |
| | | 77: 'M', |
| | | 78: 'N', |
| | | 79: 'O', |
| | | 80: 'P', |
| | | 81: 'Q', |
| | | 82: 'R', |
| | | 83: 'S', |
| | | 84: 'T', |
| | | 85: 'U', |
| | | 86: 'V', |
| | | 87: 'W', |
| | | 88: 'X', |
| | | 89: 'Y', |
| | | 90: 'Z' |
| | | } |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | state = { |
| | | editItem: null, // 编辑元素 |
| | | shortcut: '' |
| | | shortcutOptions: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let keys = ['shift', 'ctrl', 'alt'] |
| | | let _options = [] |
| | | |
| | | keys.forEach(item => { |
| | | let _op = { |
| | | value: item, |
| | | label: item, |
| | | children: [] |
| | | } |
| | | Object.keys(shortkeycode).forEach(key => { |
| | | if (item === 'ctrl' && (key === '67' || key === '86')) return |
| | | if (item === 'alt' && key === '65') return |
| | | |
| | | _op.children.push({ |
| | | value: +key, |
| | | label: shortkeycode[key] |
| | | }) |
| | | }) |
| | | |
| | | _options.push(_op) |
| | | }) |
| | | |
| | | this.setState({ |
| | | shortcutOptions: _options |
| | | }) |
| | | } |
| | | |
| | | edit = (record) => { |
| | | this.setState({ |
| | | editItem: record, |
| | | shortcut: record.shortcut || '' |
| | | editItem: record |
| | | }, () => { |
| | | let item = { |
| | | label: record.label, |
| | | shortcut: record.shortcut |
| | | let _shortcut = record.shortcut || [] |
| | | |
| | | if (typeof(record.shortcut) !== 'object') { |
| | | _shortcut = [] |
| | | } |
| | | |
| | | if (record.shortcut) { |
| | | item.shortcutkey = record.shortcutkey |
| | | let item = { |
| | | label: record.label, |
| | | shortcut: _shortcut |
| | | } |
| | | |
| | | if (record.OpenType === 'funcbutton' && record.funcType === 'print') { |
| | | item.printer = record.printer || '' |
| | | } |
| | |
| | | values.uuid = this.state.editItem ? this.state.editItem.uuid : '' |
| | | |
| | | this.props.actionChange(values) |
| | | |
| | | this.setState({ |
| | | editItem: null, |
| | | shortcut: '' |
| | | editItem: null |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ |
| | | shortcut: '', |
| | | shortcut: [], |
| | | label: '' |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | shortcutChange = (value) => { |
| | | this.setState({ |
| | | shortcut: value |
| | | }, () => { |
| | | let shortkey = this.props.form.getFieldValue('shortcutkey') |
| | | |
| | | if (shortkey && ((value === 'alt' && shortkey === 65) || (value === 'ctrl' && (shortkey === 67 || shortkey === 86))) ) { |
| | | this.props.form.setFieldsValue({ |
| | | shortcutkey: '' |
| | | }) |
| | | } |
| | | }) |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verifycard1"> |
| | | <Row gutter={24}> |
| | | <Col span={7}> |
| | | <Col span={10}> |
| | | <Form.Item label={'名称'}> |
| | | {getFieldDecorator('label', { |
| | | initialValue: '', |
| | | })(<Input placeholder="" autoComplete="off" disabled />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={10}> |
| | | <Form.Item label={'快捷键'}> |
| | | {getFieldDecorator('shortcut', { |
| | | initialValue: [] |
| | | })( |
| | | <Cascader |
| | | displayRender={label => label.join(' + ')} |
| | | options={this.state.shortcutOptions} |
| | | /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={4} className="add"> |
| | | <Form.Item label=" " colon={false} > |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | </Button> |
| | | </Form.Item> |
| | | </Col> |
| | | {hasprint ? |
| | | <Col span={7}> |
| | | <Col span={10}> |
| | | <Form.Item label={'打印机'}> |
| | | {getFieldDecorator('printer', { |
| | | initialValue: '', |
| | |
| | | </Form.Item> |
| | | </Col> : null |
| | | } |
| | | <Col span={7}> |
| | | <Form.Item label={'快捷键'}> |
| | | {getFieldDecorator('shortcut', { |
| | | initialValue: '' |
| | | })( |
| | | <Select onChange={(value) => {this.shortcutChange(value)}}> |
| | | <Select.Option value=""> 空 </Select.Option> |
| | | <Select.Option value="shift"> shift </Select.Option> |
| | | <Select.Option value="ctrl"> ctrl </Select.Option> |
| | | <Select.Option value="alt"> alt </Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {hasprint ? <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | </Button> |
| | | </Col> : null} |
| | | {this.state.shortcut ? |
| | | <Col span={7}> |
| | | <Form.Item label={'组合键'}> |
| | | {getFieldDecorator('shortcutkey', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择组合键!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select> |
| | | <Select.Option value=""> 空 </Select.Option> |
| | | {this.state.shortcut !== 'alt' ? <Select.Option value={65}> A </Select.Option> : null} |
| | | <Select.Option value={66}> B </Select.Option> |
| | | {this.state.shortcut !== 'ctrl' ? <Select.Option value={67}> C </Select.Option> : null} |
| | | <Select.Option value={68}> D </Select.Option> |
| | | <Select.Option value={69}> E </Select.Option> |
| | | <Select.Option value={70}> F </Select.Option> |
| | | <Select.Option value={71}> G </Select.Option> |
| | | <Select.Option value={72}> H </Select.Option> |
| | | <Select.Option value={73}> I </Select.Option> |
| | | <Select.Option value={74}> J </Select.Option> |
| | | <Select.Option value={75}> K </Select.Option> |
| | | <Select.Option value={76}> L </Select.Option> |
| | | <Select.Option value={77}> M </Select.Option> |
| | | <Select.Option value={78}> N </Select.Option> |
| | | <Select.Option value={79}> O </Select.Option> |
| | | <Select.Option value={80}> P </Select.Option> |
| | | <Select.Option value={81}> Q </Select.Option> |
| | | <Select.Option value={82}> R </Select.Option> |
| | | <Select.Option value={83}> S </Select.Option> |
| | | <Select.Option value={84}> T </Select.Option> |
| | | <Select.Option value={85}> U </Select.Option> |
| | | {this.state.shortcut !== 'ctrl' ? <Select.Option value={86}> V </Select.Option> : null} |
| | | <Select.Option value={87}> W </Select.Option> |
| | | <Select.Option value={88}> X </Select.Option> |
| | | <Select.Option value={89}> Y </Select.Option> |
| | | <Select.Option value={90}> Z </Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null |
| | | } |
| | | {!hasprint ? <Col span={3} className="add"> |
| | | <Button onClick={this.handleConfirm} type="primary" className="add-row"> |
| | | 确定 |
| | | </Button> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | { |
| | | title: '名称', |
| | | dataIndex: 'label', |
| | | width: '20%' |
| | | width: '25%' |
| | | }, |
| | | { |
| | | title: '快捷键', |
| | | dataIndex: 'shortcut', |
| | | width: '20%' |
| | | }, |
| | | { |
| | | title: '组合键', |
| | | dataIndex: 'shortcutkey', |
| | | width: '20%', |
| | | render: (text, record) => keycode[text] || '' |
| | | width: '25%', |
| | | render: (text, record) => { |
| | | if (!record.shortcut || typeof(record.shortcut) !== 'object') return '' |
| | | let _text = keycode[record.shortcut[1]] |
| | | |
| | | return record.shortcut[0] + ' + ' + _text |
| | | } |
| | | }, |
| | | { |
| | | title: '打印机', |
| | | dataIndex: 'printer', |
| | | width: '20%' |
| | | width: '30%' |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { config } = this.props |
| | | |
| | | |
| | | this.setState({ |
| | | config: JSON.parse(JSON.stringify(config)) |
| | | }) |
| | |
| | | |
| | | _config.action = _config.action.map(cell => { |
| | | if (item.uuid === cell.uuid) { |
| | | |
| | | cell.printer = cell.printer || data.defaultPrinter |
| | | cell.printers = printers.map(print => { |
| | | return { |
| | |
| | | } |
| | | } |
| | | .add { |
| | | padding-top: 4px; |
| | | padding-top: 0px; |
| | | } |
| | | .ant-input-disabled { |
| | | color: rgba(0, 0, 0, 0.75); |
| | | cursor: default; |
| | | } |
| | | } |
| | | .custom-table .ant-empty { |
| | |
| | | * @description 搜索条件编辑,获取搜索条件表单信息 |
| | | */ |
| | | handleSearch = (card) => { |
| | | const { menu } = this.props |
| | | |
| | | this.setState({ |
| | | modaltype: 'search', |
| | | card: card, |
| | | formlist: getSearchForm(card) |
| | | formlist: getSearchForm(card, menu.roleList) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 显示列与合并列编辑,获取表单信息 |
| | | */ |
| | | handleColumn = (card) => { |
| | | const { menu } = this.props |
| | | |
| | | if (card.type !== 'colspan') { |
| | | this.setState({ |
| | | modaltype: 'columns', |
| | | card: card, |
| | | formlist: getColumnForm(card) |
| | | formlist: getColumnForm(card, menu.roleList) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | }) |
| | | } |
| | | |
| | | let roleList = [] |
| | | if (menu.roleList && menu.roleList.length > 0) { |
| | | roleList = menu.roleList.map(role => { |
| | | return { |
| | | uuid: role.uuid, |
| | | field: role.value, |
| | | label: role.text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | modaltype: 'search', |
| | | card: card, |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields) |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false, roleList) |
| | | }) |
| | | } |
| | | |
| | |
| | | card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) |
| | | } |
| | | |
| | | let roleList = [] |
| | | if (menu.roleList && menu.roleList.length > 0) { |
| | | roleList = menu.roleList.map(role => { |
| | | return { |
| | | uuid: role.uuid, |
| | | field: role.value, |
| | | label: role.text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | modalType: type, |
| | | card: card, |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab) |
| | | formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab, roleList) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 搜索条件编辑,获取搜索条件表单信息 |
| | | */ |
| | | handleSearch = (card) => { |
| | | const { menu } = this.props |
| | | |
| | | this.setState({ |
| | | modaltype: 'search', |
| | | card: card, |
| | | formlist: getSearchForm(card) |
| | | formlist: getSearchForm(card, menu.roleList) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 显示列与合并列编辑,获取表单信息 |
| | | */ |
| | | handleColumn = (card) => { |
| | | const { menu } = this.props |
| | | |
| | | if (card.type !== 'colspan') { |
| | | this.setState({ |
| | | modaltype: 'columns', |
| | | card: card, |
| | | formlist: getColumnForm(card) |
| | | formlist: getColumnForm(card, menu.roleList) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _type = this.props.formlist.filter(form => form.key === 'type')[0].initVal |
| | | let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength'] |
| | | let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist'] |
| | | |
| | | if (_type === 'text') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } else if (_type === 'number') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist'] |
| | | } else if (_type === 'textarea') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | |
| | | typeChange = (key, value) => { |
| | | if (key === 'type') { |
| | | let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength'] |
| | | let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist'] |
| | | |
| | | if (value === 'text') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } else if (value === 'number') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'match', 'matchVal', 'color', 'blacklist'] |
| | | } else if (value === 'textarea') { |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'matchVal', 'color', 'fieldlength', 'blacklist'] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'multiselect') { // 多选 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {item.options.map((option, i) => |
| | | <Select.Option id={i} key={i} value={option.value}>{option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | |
| | | hasProfile = true |
| | | } else if (card.OpenType === 'excelIn' || card.OpenType === 'excelOut') { |
| | | hasProfile = true |
| | | } else if (card.funcType === 'print') { |
| | | hasProfile = true |
| | | } |
| | | } |
| | | |
| | |
| | | * @description 获取搜索条件表单配置信息 |
| | | * @param {*} card |
| | | */ |
| | | export function getSearchForm (card) { |
| | | export function getSearchForm (card, roleList = []) { |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | initVal: '', |
| | | required: false, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | } |
| | | ] |
| | | } |
| | |
| | | * @description 获取显示列表单配置信息 |
| | | * @param {*} card |
| | | */ |
| | | export function getColumnForm (card) { |
| | | export function getColumnForm (card, roleList = []) { |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | label: Formdict['header.form.field.length'], |
| | | initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | } |
| | | ] |
| | | } |
| | |
| | | * @param {*} card |
| | | * @param {*} inputfields |
| | | */ |
| | | export function getModalForm (card, inputfields, linkableFields, linksupFields, subtable = false) { |
| | | export function getModalForm (card, inputfields, linkableFields, linksupFields, subtable = false, roleList = []) { |
| | | let _openType = [] |
| | | let _fieldlength = 50 |
| | | |
| | |
| | | label: Formdict['header.form.linkForm'], |
| | | initVal: card.linkSubField || [], |
| | | options: inputfields |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | | } |
| | | ] |
| | | } |
| | |
| | | |
| | | let type = formlist.filter(cell => cell.key === 'type')[0].initVal |
| | | let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal |
| | | let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio'] // 默认显示项 |
| | | let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist'] // 默认显示项 |
| | | |
| | | if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') { // 下拉选择类型、选项为自定义资源 |
| | | _options = [..._options, 'resourceType', 'options', 'display', 'quick'] |
| | |
| | | const { resourceType } = this.state |
| | | |
| | | if (key === 'type') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio'] |
| | | let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist'] |
| | | |
| | | if ((value === 'multiselect' || value === 'select' || value === 'link') && resourceType === '0') { // 下拉选择类型、选项为自定义资源 |
| | | _options = [..._options, 'resourceType', 'options', 'display', 'quick'] |
| | |
| | | let value = e.target.value |
| | | |
| | | if (key === 'resourceType') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display', 'ratio'] |
| | | let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display', 'ratio', 'blacklist'] |
| | | |
| | | if (value === '0') { |
| | | _options = [..._options, 'options', 'quick'] |
| | |
| | | <EditTable data={item.initVal} type={this.state.openType} ref="editTable"/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'multiselect') { // 多选 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {item.options.map((option, i) => |
| | | <Select.Option id={i} key={i} value={option.value}>{option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin'] // 默认显示项 |
| | | let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'] // 默认显示项 |
| | | |
| | | if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') { // 选择类型、自定义资源 |
| | | _options = [..._options, 'resourceType', 'options', 'quick'] |
| | | } else if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '1') { // 选择类型、数据源 |
| | | _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database'] |
| | | } else if (type === 'number') { |
| | | _options = ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin'] |
| | | _options = ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist'] |
| | | } else if (type === 'fileupload') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength', 'blacklist'] |
| | | } else if (type === 'textarea') { |
| | | _options = [..._options, 'fieldlength', 'maxRows'] |
| | | } else if (type === 'text') { |
| | |
| | | } else if (type === 'link') { // 关联类型、增加关联字段 |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (type === 'funcvar') { // 设置为函数变量时,不需要其他信息 |
| | | _options = ['label', 'field', 'type'] |
| | | _options = ['label', 'field', 'type', 'blacklist'] |
| | | } else if (type === 'linkMain') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist'] |
| | | } |
| | | |
| | | if (type !== 'funcvar' && type !== 'linkMain') { |
| | |
| | | openTypeChange = (key, value) => { |
| | | |
| | | if (key === 'type') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin'] |
| | | let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'] |
| | | |
| | | if ((value === 'multiselect' || value === 'select' || value === 'link') && this.state.resourceType === '0') { // 选择类型、自定义资源 |
| | | _options = [..._options, 'resourceType', 'options', 'quick'] |
| | | } else if ((value === 'multiselect' || value === 'select' || value === 'link') && this.state.resourceType === '1') { // 选择类型、数据源 |
| | | _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database'] |
| | | } else if (value === 'number') { |
| | | _options = ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin'] |
| | | _options = ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist'] |
| | | } else if (value === 'fileupload') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength', 'blacklist'] |
| | | } else if (value === 'textarea') { |
| | | _options = [..._options, 'fieldlength', 'maxRows'] |
| | | } else if (value === 'text') { |
| | |
| | | } else if (value === 'link') { |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (value === 'funcvar') { |
| | | _options = ['label', 'field', 'type'] |
| | | _options = ['label', 'field', 'type', 'blacklist'] |
| | | } else if (value === 'linkMain') { |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength'] |
| | | _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist'] |
| | | } |
| | | |
| | | if (value !== 'funcvar' && value !== 'linkMain') { |
| | |
| | | const { openType } = this.state |
| | | let value = e.target.value |
| | | if (key === 'resourceType') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden', 'readin'] |
| | | let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden', 'readin', 'blacklist'] |
| | | if (value === '0') { |
| | | _options = [..._options, 'options', 'quick'] |
| | | } else if (value === '1') { |
| | |
| | | import './index.scss' |
| | | |
| | | const LoginForm = asyncComponent(() => import('./loginform')) |
| | | const Action = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | // const Action = asyncComponent(() => import('@/tabviews/tableshare/actionList')) |
| | | const iszhCN = !localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN' |
| | | |
| | | class Login extends Component { |
| | |
| | | |
| | | async loginsubmit (param) { |
| | | // 登录提交 |
| | | // let password = this.md5Password(param.password) |
| | | // let result = await Api.loginsystem(param.username, param.password) |
| | | // if (!result.IsError) { |
| | | let res = await Api.getusermsg(param.username, param.password) |
| | | if (res.status) { |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | |
| | | isDisabled: false |
| | | }) |
| | | } |
| | | // } else { |
| | | // message.warning(result.Message) |
| | | // this.setState({ |
| | | // isDisabled: false |
| | | // }) |
| | | // } |
| | | } |
| | | |
| | | componentDidMount () { |
| | |
| | | } |
| | | <p dangerouslySetInnerHTML={{ __html: this.state.ICP.replace(/\s/ig, ' ') }}></p> |
| | | </div> |
| | | {this.state.loaded ? <div style={{position: 'fixed', bottom: '-1000px'}}><Action setting={{}} actions={[]} /></div> : null } |
| | | {/* {this.state.loaded ? <div style={{position: 'fixed', bottom: '-1000px'}}><Action setting={{}} actions={[]} /></div> : null } */} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | |
| | | _fields.push({ |
| | | value: item.FieldName, |
| | | text: item.FieldDec, |
| | | text: item.FieldDec + '(' + item.FieldName + ')', |
| | | type: item.FieldType |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | _fields.push({ |
| | | value: 'other_field', |
| | | text: '其他', |
| | | type: '' |
| | | }) |
| | | |
| | | this.setState({ |
| | | fields: _fields |
| | | }) |
| | |
| | | formlist: PropTypes.array // input回车提交 |
| | | } |
| | | |
| | | state = { |
| | | formlist: null, |
| | | type: 'box' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | this.setState({ |
| | | formlist: this.props.formlist |
| | | }) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (!is(fromJS(this.props.editItem), fromJS(nextProps.editItem))) { |
| | | this.setState({}, () => { |
| | | let fieldsvalue = {} |
| | | let isCusField = false |
| | | let type = 'box' |
| | | |
| | | nextProps.formlist.forEach(item => { |
| | | if (item.type === 'title') { |
| | | type = item.class |
| | | } |
| | | |
| | | if (!item.key) return |
| | | |
| | | if (item.key === 'field' && item.initval === 'other_field') { |
| | | isCusField = true |
| | | } |
| | | fieldsvalue[item.key] = item.initval |
| | | }) |
| | | this.props.form.setFieldsValue(fieldsvalue) |
| | | |
| | | this.setState({ |
| | | type: type, |
| | | formlist: nextProps.formlist.map(item => { |
| | | if (item.key === 'cusfield' && isCusField) { |
| | | item.hidden = false |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }, () => { |
| | | if (!isCusField) { |
| | | delete fieldsvalue.cusfield |
| | | } |
| | | this.props.form.setFieldsValue(fieldsvalue) |
| | | }) |
| | | |
| | | }) |
| | | } |
| | | } |
| | |
| | | width: option.width, |
| | | height: option.height |
| | | }) |
| | | } else if (item.key === 'field') { |
| | | if (value === 'other_field') { |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'cusfield') { |
| | | item.hidden = false |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'cusfield') { |
| | | item.hidden = true |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | this.handleSubmit() |
| | | } |
| | |
| | | delete _param.uuid |
| | | delete _param.url |
| | | |
| | | if (_param.field !== 'other_field') { |
| | | delete _param.cusfield |
| | | } |
| | | |
| | | this.props.form.setFieldsValue(_param) |
| | | } |
| | | |
| | | getFields() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { type, formlist } = this.state |
| | | const fields = [] |
| | | |
| | | this.props.formlist.forEach((item, index) => { |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden) return |
| | | |
| | | if (item.type === 'title') { |
| | | fields.push( |
| | |
| | | ) |
| | | } else if (item.type === 'text') { |
| | | let _rules = [] |
| | | if (item.regular) { |
| | | if (item.regular === 'number') { |
| | | _rules = [{ |
| | | pattern: /^[0-9]*$/ig, |
| | | message: formRule.input.numbermsg |
| | | }] |
| | | } else if (item.regular === 'letter') { |
| | | _rules = [{ |
| | | pattern: /^[a-zA-Z]*$/ig, |
| | | message: formRule.input.lettermsg |
| | | }] |
| | | } else if (item.regular === 'letter&number') { |
| | | _rules = [{ |
| | | pattern: /^[a-zA-Z0-9]*$/ig, |
| | | message: formRule.input.letternummsg |
| | | }] |
| | | } |
| | | if (item.key === 'value' && type === 'barcode') { |
| | | _rules = [{ |
| | | pattern: /^[a-zA-Z0-9]*$/ig, |
| | | message: '条码值必须为数字或字母!' |
| | | }] |
| | | } |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | message: '请输入' + item.label + '字段!' |
| | | }, |
| | | { |
| | | max: 512, |
| | |
| | | item.align = 'left' |
| | | item.vertialAlign = 'top' |
| | | } else if (type === 'barcode') { |
| | | item.value = '' |
| | | item.url = url |
| | | item.barcodeType = 'code128' |
| | | item.barcodeWidth = Math.floor(width * 0.6) |
| | |
| | | item.barcodeLabel = 'true' |
| | | item.fontSize = Math.floor(12 * (boxwidth / 210)) |
| | | } else if (type === 'qrcode') { |
| | | item.value = '' |
| | | item.url = url |
| | | item.qrcodeType = 'qrcode' |
| | | item.qrcodeWidth = Math.floor(height * 0.6) |
| | |
| | | type: 'title', |
| | | label: '类型', |
| | | initval: '文本', |
| | | class: 'text', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | initval: item.field || '', |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'cusfield', |
| | | label: '自定义', |
| | | initval: item.cusfield || '', |
| | | required: true, |
| | | hidden: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | type: 'title', |
| | | label: '类型', |
| | | initval: '条形码', |
| | | class: 'barcode', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'value', |
| | | label: '内容', |
| | | initval: item.value || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'field', |
| | | label: '关联字段', |
| | | initval: item.field, |
| | | required: true, |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'cusfield', |
| | | label: '自定义', |
| | | initval: item.cusfield || '', |
| | | required: true, |
| | | hidden: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | type: 'title', |
| | | label: '类型', |
| | | initval: '二维码', |
| | | class: 'qrcode', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'value', |
| | | label: '内容', |
| | | initval: item.value || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'field', |
| | | label: '关联字段', |
| | | initval: item.field, |
| | | required: true, |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'cusfield', |
| | | label: '自定义', |
| | | initval: item.cusfield || '', |
| | | required: true, |
| | | hidden: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | type: 'title', |
| | | label: '类型', |
| | | initval: '图片', |
| | | class: 'image', |
| | | required: false |
| | | }, |
| | | { |