| | |
| | | const Home = asyncComponent(() => import('@/tabviews/home')) |
| | | const CustomPage = asyncComponent(() => import('@/tabviews/custom')) |
| | | const CommonTable = asyncComponent(() => import('@/tabviews/commontable')) |
| | | // const BaseTable = asyncComponent(() => import('@/tabviews/basetable')) |
| | | const BaseTable = asyncComponent(() => import('@/tabviews/basetable')) |
| | | const CalendarPage = asyncComponent(() => import('@/tabviews/calendar')) |
| | | const TreePage = asyncComponent(() => import('@/tabviews/treepage')) |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | |
| | | } |
| | | } |
| | | |
| | | changeTemp = (MenuID, Template) => { |
| | | this.setState({ |
| | | tabview: {...this.state.tabview, type: Template} |
| | | }) |
| | | } |
| | | |
| | | selectcomponent = (view) => { |
| | | // 根据tab页中菜单信息,选择所需的组件 |
| | | if (view.type === 'Home') { |
| | | return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'CommonTable') { |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | // } else if (view.type === 'BaseTable') { |
| | | // return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'BaseTable') { |
| | | return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'CustomPage') { |
| | | return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'TreePage') { |
| | | return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'CalendarPage') { |
| | |
| | | const BaseTable = asyncComponent(() => import('@/tabviews/basetable')) |
| | | const CalendarPage = asyncComponent(() => import('@/tabviews/calendar')) |
| | | const TreePage = asyncComponent(() => import('@/tabviews/treepage')) |
| | | // const TabManage = asyncComponent(() => import('@/tabviews/tabmanage')) |
| | | const Iframe = asyncComponent(() => import('@/tabviews/iframe')) |
| | | const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) |
| | | const FormTab = asyncComponent(() => import('@/tabviews/formtab')) |
| | |
| | | }) |
| | | } |
| | | |
| | | changeTemp = (MenuID, Template) => { |
| | | let tabs = fromJS(this.state.tabviews).toJS() |
| | | |
| | | this.setState({ |
| | | tabviews: tabs.map(item => { |
| | | if (item.MenuID === MenuID) { |
| | | item.type = Template |
| | | } |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | selectcomponent = (view) => { |
| | | // 根据tab页中菜单信息,选择所需的组件 |
| | | if (view.type === 'Home') { |
| | | return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'CommonTable') { |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'BaseTable') { |
| | | return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'CustomPage') { |
| | | return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) |
| | | } else if (view.type === 'TreePage') { |
| | | return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'CalendarPage') { |
| | | return (<CalendarPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | // } else if (view.type === 'TabManage') { |
| | | // return (<TabManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'RolePermission') { |
| | | return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'FormTab') { |
| | |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | MKEmitter.removeListener('submitModal', this.handleSave) |
| | | } |
| | | |
| | | revert = () => { |
| | | revert = (id) => { |
| | | if (id && id !== this.props.config.uuid) return |
| | | |
| | | this.setState({ |
| | | actionlist: fromJS(this.props.config.action).toJS() |
| | | }) |
| | |
| | | width: '16%', |
| | | editable: true, |
| | | required: false, |
| | | inputType: 'input' |
| | | inputType: 'input', |
| | | render: (text, record) => { |
| | | if (!text) return '' |
| | | if (record.field && record.field[1] === 'dynamic') { |
| | | return <span title="对比动态值时,对比值无效。" style={{textDecoration: 'line-through'}}>{text}</span> |
| | | } else { |
| | | return text |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '颜色', |
| | |
| | | <AntDesignOutlined className="profile" title="标记" onClick={this.resetMark} /> |
| | | <Modal |
| | | wrapClassName="model-table-column-mark-modal" |
| | | title={'标记设置'} |
| | | title="标记设置" |
| | | visible={visible} |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }], |
| | | forbid: card.isSub |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | label: '字段长度', |
| | | initVal: card.fieldlength || 50, |
| | | required: true |
| | | required: true, |
| | | forbid: card.isSub |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | max: 18, |
| | | decimal: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | initVal: card.decimal === undefined ? 0 : card.decimal, |
| | | required: !card.isSub |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | if (!formlist) return null |
| | | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbidden) return |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | if (item.type === 'text') { |
| | | let rules = [] |
| | |
| | | let config = {...this.props.config, cols: _columns} |
| | | if (btn) { |
| | | config.action = config.action.filter(item => item.uuid !== btn.uuid) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('revert', config.uuid) |
| | | }, 200) |
| | | } |
| | | |
| | | this.props.updatecolumn(config) |
| | |
| | | let config = {...this.props.config, cols: _columns} |
| | | if (btn) { |
| | | config.action = config.action.filter(item => item.uuid !== btn.uuid) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('revert', config.uuid) |
| | | }, 200) |
| | | } |
| | | |
| | | this.props.updatecolumn(config) |
| | |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }], |
| | | forbid: card.isSub |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | max: 18, |
| | | decimal: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal || 0, |
| | | initVal: card.decimal, |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | value: 'linkurl', |
| | | text: '链接' |
| | | }], |
| | | forbidden: appType === 'mob' |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: appType === 'pc' ? 'select' : 'cascader', |
| | |
| | | initVal: card.linkmenu || (appType === 'pc' ? '' : []), |
| | | required: true, |
| | | options: menulist, |
| | | forbidden: appType === 'mob' |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | | required: true, |
| | | forbidden: appType === 'mob' |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initVal: card.linkfields || [], |
| | | required: false, |
| | | options: fields, |
| | | forbidden: appType === 'mob' |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbidden: appType === 'mob' |
| | | forbid: appType === 'mob' |
| | | } |
| | | ] |
| | | } |
| | |
| | | if (!formlist) return null |
| | | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbidden) return |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | if (item.type === 'text') { |
| | | let rules = [] |
| | |
| | | let config = {...this.props.config, cols: _columns} |
| | | if (btn) { |
| | | config.action = config.action.filter(item => item.uuid !== btn.uuid) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('revert', config.uuid) |
| | | }, 200) |
| | | } |
| | | |
| | | this.props.updatecolumn(config) |
| | |
| | | modules: [], |
| | | innerRules: [], |
| | | innertip: '', |
| | | appType: sessionStorage.getItem('appType'), |
| | | ismain: false |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { appType } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.sync = values.sync || 'false' |
| | | |
| | | if (appType === 'mob' && values.useMSearch === 'true') { |
| | | values.syncRefresh = 'true' |
| | | } |
| | | |
| | | // 数据源前端验证 |
| | | if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) { |
| | |
| | | render() { |
| | | const { columns, config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { setting, modules, innerRules, appType, innertip } = this.state |
| | | const { setting, modules, innerRules, innertip } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="系统接口"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="单点登录系统"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 系统接口 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: setting.sysInterface, |
| | | rules: [ |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && !['basetable'].includes(config.subtype) && setting.useMSearch === 'true' && appType !== 'mob' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'外层搜索条件改变时,是否刷新当前组件数据。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 同步刷新 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('syncRefresh', { |
| | | initialValue: setting.syncRefresh || 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* <Col span={8}> |
| | | <Form.Item label="事务"> |
| | | {getFieldDecorator('transaction', { |
| | | initialValue: setting.transaction || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> */} |
| | | {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}> |
| | | <Form.Item label="初始化数据"> |
| | | {getFieldDecorator('onload', { |
| | |
| | | } |
| | | }) |
| | | |
| | | let style = JSON.stringify(menu.style || {}) |
| | | style = style.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | style = JSON.parse(style) |
| | | |
| | | return ( |
| | | <div ref={drop} className="menu-shell-inner" id="menu-shell-inner" style={menu.style}> |
| | | <div ref={drop} className="menu-shell-inner" id="menu-shell-inner" style={style}> |
| | | <div className="ant-row"> |
| | | {cards.map(card => ( |
| | | <Card |
| | |
| | | } |
| | | }) |
| | | |
| | | let style = JSON.stringify(menu.style || {}) |
| | | style = style.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | style = JSON.parse(style) |
| | | |
| | | return ( |
| | | <div ref={drop} className="table-shell-inner" style={menu.style}> |
| | | <div ref={drop} className="table-shell-inner" style={style}> |
| | | <div className="ant-row"> |
| | | {cards.map(card => ( |
| | | <Card |
| | |
| | | } |
| | | }) |
| | | |
| | | let style = JSON.stringify(menu.style || {}) |
| | | style = style.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | style = JSON.parse(style) |
| | | |
| | | return ( |
| | | <div ref={drop} className="mob-shell-inner" id="menu-shell-inner"> |
| | | <div className="ant-row" style={menu.style}> |
| | | <div className="ant-row" style={style}> |
| | | {cards.map(card => ( |
| | | <Card |
| | | id={card.uuid} |
| | |
| | | } |
| | | }) |
| | | |
| | | let style = JSON.stringify(menu.style || {}) |
| | | style = style.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | style = JSON.parse(style) |
| | | |
| | | return ( |
| | | <div ref={drop} className="menu-shell-inner" id="menu-shell-inner" style={menu.style}> |
| | | <div ref={drop} className="menu-shell-inner" id="menu-shell-inner" style={style}> |
| | | <div className="ant-row"> |
| | | {cards.map(card => ( |
| | | <Card |
| | |
| | | Tab: PropTypes.string, // 弹窗标签 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | MenuNo: PropTypes.string, // 菜单参数 |
| | | MenuName: PropTypes.string // 菜单名称 |
| | | MenuName: PropTypes.string, // 菜单名称 |
| | | changeTemp: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | |
| | | try { // 配置信息解析 |
| | | config = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | config = JSON.parse(config) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | | } |
| | | |
| | | // HS不使用自定义设置 |
| | | if (result.LongParamUser && !window.GLOB.mkHS) { |
| | | try { // 配置信息解析 |
| | | let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) |
| | | if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | } |
| | | } |
| | | |
| | | // 页面配置解析错误时提示 |
| | |
| | | return |
| | | } |
| | | |
| | | // 模板错误 |
| | | if (config.Template !== 'BaseTable') { |
| | | if (config.Template === 'CustomPage' || config.Template === 'CommonTable') { |
| | | this.props.changeTemp(MenuID, config.Template) |
| | | } else { |
| | | this.setState({ |
| | | viewlost: true, |
| | | loadingview: false, |
| | | lostmsg: '菜单信息错误,可能原因:1、当前用户无权限;2、打开此菜单的按钮需要更新。' |
| | | }) |
| | | } |
| | | return |
| | | } |
| | | |
| | | // HS不使用自定义设置 |
| | | if (result.LongParamUser && !window.GLOB.mkHS) { |
| | | try { // 配置信息解析 |
| | | let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) |
| | | if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | } |
| | | } |
| | | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let skip = window.GLOB.mkHS |
| | |
| | | param: PropTypes.any, // 其他页面传递的搜索条件等参数 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | MenuNo: PropTypes.string, // 菜单参数 |
| | | MenuName: PropTypes.string // 菜单名称 |
| | | MenuName: PropTypes.string, // 菜单名称 |
| | | changeTemp: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | |
| | | try { // 配置信息解析 |
| | | config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | config.MenuID = MenuID |
| | | config.MenuName = MenuName |
| | | config.setting.MenuName = MenuName |
| | | config.setting.$name = MenuName |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | | } |
| | | |
| | | // 页面配置解析错误时提示 |
| | | if (!config) { |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // 页面未启用时,显示未启用页面 |
| | | if (!config.enabled) { |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true, |
| | | lostmsg: this.state.dict['main.view.unenabled'] |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // 模板错误 |
| | | if (config.Template === 'BaseTable' || config.Template === 'CustomPage') { |
| | | this.props.changeTemp(MenuID, config.Template) |
| | | return |
| | | } |
| | | |
| | | // HS不使用自定义设置 |
| | |
| | | } |
| | | } |
| | | |
| | | // 页面配置解析错误时提示 |
| | | if (!config) { |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // 页面未启用时,显示未启用页面 |
| | | if (!config.enabled) { |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true, |
| | | lostmsg: this.state.dict['main.view.unenabled'] |
| | | }) |
| | | return |
| | | } |
| | | // 信息初始化赋值 |
| | | config.MenuID = MenuID |
| | | config.MenuName = MenuName |
| | | config.setting.MenuName = MenuName |
| | | config.setting.$name = MenuName |
| | | |
| | | // 版本兼容 |
| | | config = updateCommonTable(config) |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.transferLine() |
| | | } |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | }) |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.openModal() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.openModal() |
| | | } |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data, empty: !_data,}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data, empty: _data.length === 0}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.renderView() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data, group: _group, step: _group.sort - 1,}) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data, group: null}, () => { |
| | | this.setState({group: _group}) |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { config } = this.state |
| | | |
| | | if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.reloadtable() |
| | | }) |
| | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { config } = this.state |
| | | |
| | | if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.reloadtable() |
| | | }) |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({pageIndex: 1}, () => { |
| | | this.reloadtable() |
| | | }) |
| | |
| | | }) |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | Tab: PropTypes.string, // 弹窗标签 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | MenuNo: PropTypes.string, // 菜单参数 |
| | | MenuName: PropTypes.string // 菜单名称 |
| | | MenuName: PropTypes.string, // 菜单名称 |
| | | changeTemp: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | config = '' |
| | | } |
| | | |
| | | // HS不使用自定义设置 |
| | | if (result.LongParamUser && !window.GLOB.mkHS) { |
| | | try { // 配置信息解析 |
| | | let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) |
| | | if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | } |
| | | } |
| | | |
| | | // 页面配置解析错误时提示 |
| | | if (!config) { |
| | | this.setState({ |
| | |
| | | lostmsg: this.state.dict['main.view.unenabled'] |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // 模板错误 |
| | | if (config.Template !== 'CustomPage') { |
| | | if (config.Template === 'BaseTable' || config.Template === 'CommonTable') { |
| | | this.props.changeTemp(MenuID, config.Template) |
| | | } else { |
| | | this.setState({ |
| | | viewlost: true, |
| | | loadingview: false, |
| | | lostmsg: '菜单信息错误,可能原因:1、当前用户无权限;2、打开此菜单的按钮需要更新。' |
| | | }) |
| | | } |
| | | |
| | | return |
| | | } |
| | | |
| | | // HS不使用自定义设置 |
| | | if (result.LongParamUser && !window.GLOB.mkHS) { |
| | | try { // 配置信息解析 |
| | | let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) |
| | | if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | } |
| | | } |
| | | |
| | | // 数据缓存设置 |
| | |
| | | component = {...component, ...inherit} |
| | | return component |
| | | } else if (component.wrap && component.wrap.datatype === 'public') { |
| | | component.setting.useMSearch = false |
| | | |
| | | return component |
| | | } |
| | | |
| | | if (component.setting) { |
| | | component.setting.useMSearch = component.setting.useMSearch === 'true' |
| | | component.setting.syncRefresh = (component.setting.useMSearch && component.setting.syncRefresh === 'true') |
| | | } |
| | | |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | | } else if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | component.setting = component.setting || {} |
| | | component.setting.useMSearch = false |
| | | component.setting.syncRefresh = false |
| | | |
| | | return component |
| | | } else if (!component.setting || !component.format) { |
| | | return component |
| | | } |
| | | |
| | | if (!component.setting || !component.format) return component // 1、不使用系统函数时;2、 没有动态数据 数据格式 array 或 object |
| | | component.setting.useMSearch = component.setting.useMSearch === 'true' |
| | | |
| | | if (component.setting.interType !== 'system') { // 不使用系统函数时 |
| | | component.setting.sync = 'false' |
| | | component.setting.laypage = component.setting.laypage === 'true' |
| | |
| | | component = {...component, ...inherit} |
| | | return component |
| | | } else if (component.wrap && component.wrap.datatype === 'public') { |
| | | component.setting.useMSearch = false |
| | | |
| | | return component |
| | | } |
| | | |
| | | if (component.setting) { |
| | | component.setting.useMSearch = component.setting.useMSearch === 'true' |
| | | component.setting.syncRefresh = (component.setting.useMSearch && component.setting.syncRefresh === 'true') |
| | | } |
| | | |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | | } else if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | component.setting = component.setting || {} |
| | | component.setting.useMSearch = false |
| | | component.setting.syncRefresh = false |
| | | |
| | | return component |
| | | } else if (!component.setting || !component.format) { |
| | | return component |
| | | } |
| | | |
| | | if (!component.setting || !component.format) return component // 1、不使用系统函数时;2、 没有动态数据 数据格式 array 或 object |
| | | component.setting.useMSearch = component.setting.useMSearch === 'true' |
| | | |
| | | if (component.setting.interType !== 'system') { // 不使用系统函数时 |
| | | component.setting.sync = 'false' |
| | | component.setting.laypage = component.setting.laypage === 'true' |
| | |
| | | node && node.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'nearest'}) |
| | | } |
| | | |
| | | if (btn.MenuID && Array.isArray(btn.openmenu) && btn.openmenu.length > 0) { |
| | | let newtab = { |
| | | if (btn.openmenu && Array.isArray(btn.openmenu) && btn.openmenu.length > 0) { |
| | | let menuId = btn.openmenu.slice(-1)[0] |
| | | let newtab = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] |
| | | |
| | | if (!newtab && btn.MenuID) { |
| | | newtab = { |
| | | MenuID: btn.MenuID, |
| | | MenuName: btn.MenuName, |
| | | MenuNo: btn.MenuNo, |
| | |
| | | $BID: id |
| | | } |
| | | } |
| | | } else if (!newtab) { |
| | | return |
| | | } |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | MKEmitter.emit('modifyTabs', newtab, 'replace') |
| | |
| | | primaryId: primaryId |
| | | } |
| | | } |
| | | } else if (btn.MenuID || btn.linkmenu) { |
| | | let menuId = btn.MenuID || btn.linkmenu.slice(-1)[0] |
| | | } else if (btn.linkmenu && btn.linkmenu.length > 0) { |
| | | let menuId = btn.linkmenu.slice(-1)[0] |
| | | let menu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] |
| | | |
| | | if (!menu && btn.MenuName && btn.tabType) { |
| | |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | // const UpdateTable = asyncComponent(() => import('./updatetable')) |
| | | const UpdateTable = asyncComponent(() => import('./updatetable')) |
| | | const Unattended = asyncComponent(() => import('@/templates/zshare/unattended')) |
| | | const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) |
| | | const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) |
| | |
| | | <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> |
| | | <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> |
| | | <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> |
| | | {/* <UpdateTable config={config}/> */} |
| | | <UpdateTable config={config}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button> |
| | | <Button onClick={this.cancelConfig}>关闭</Button> |
| | |
| | | import { ArrowUpOutlined } from '@ant-design/icons' |
| | | // import moment from 'moment' |
| | | |
| | | import { colorTransform } from '@/utils/option.js' |
| | | // import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | |
| | | } |
| | | |
| | | let uuids = {} |
| | | let formActions = [] |
| | | let popActions = [] |
| | | |
| | | let tbl = this.getTable(config, uuids) |
| | | let tbl = this.getTable(config, uuids, formActions, popActions) |
| | | |
| | | if (config.autoMatic && config.autoMatic.enable === 'true' && uuids[config.autoMatic.action]) { |
| | | _config.autoMatic = {...config.autoMatic} |
| | | _config.autoMatic.action = uuids[config.autoMatic.action] |
| | | } else { |
| | | _config.autoMatic = {enable: 'false'} |
| | | } |
| | | |
| | | _config.components.push(tbl) |
| | | |
| | | console.log(config) |
| | | console.log(_config) |
| | | |
| | | setTimeout(() => { |
| | | _resolve() |
| | | }, 5000) |
| | | } |
| | | |
| | | getTable = (config, uuids) => { |
| | | getTable = (config, uuids, formActions, popActions) => { |
| | | let _card = { |
| | | uuid: Utils.getuuid(), |
| | | type: 'table', |
| | |
| | | item.uuid = Utils.getuuid() |
| | | return item |
| | | }), |
| | | action: [ |
| | | { origin: true, uuid: Utils.getuuid(), label: '添加', intertype: 'system', OpenType: 'pop', execSuccess: 'grid', icon: 'plus', class: 'green', style: {color: 'rgb(255, 255, 255)', background: 'rgb(38, 194, 129)', marginRight: '15px'} }, |
| | | { origin: true, uuid: Utils.getuuid(), label: '修改', intertype: 'system', OpenType: 'pop', execSuccess: 'grid', icon: 'form', class: 'purple', style: {color: 'rgb(255, 255, 255)', background: 'rgb(142, 68, 173)', marginRight: '15px'} }, |
| | | { origin: true, uuid: Utils.getuuid(), label: '删除', intertype: 'system', OpenType: 'prompt', execSuccess: 'grid', Ot: 'required', icon: 'delete', class: 'danger', style: {color: 'rgb(255, 255, 255)', background: 'rgb(255, 77, 79)', marginRight: '15px'} } |
| | | ], |
| | | action: [], |
| | | subtype: 'basetable', |
| | | setting: { interType: 'system' }, |
| | | wrap: { bordered: 'true', tableType: 'checkbox', show: 'true' }, |
| | | setting: { }, |
| | | wrap: { }, |
| | | style: {}, |
| | | headerStyle: {}, |
| | | columns: [], |
| | | cols: [ |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: '', Hide: 'false', type: 'text', Width: 120 }, |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, |
| | | ], |
| | | cols: [], |
| | | scripts: [] |
| | | } |
| | | |
| | | let _cols = {} |
| | | let _colspan = [] |
| | | let lineMarks = [] |
| | | config.columns.forEach(col => { |
| | | // if (col.type === 'index' || col.field) { |
| | | if (col.type === 'colspan') { |
| | | _colspan.push() |
| | | _colspan.push(col.subfield.split(', ')) |
| | | } |
| | | if (!col.field) return |
| | | |
| | | _cols[col.field] = col |
| | | let _col = fromJS(col).toJS() |
| | | |
| | | if (_col.marks) { |
| | | _col.marks = [] |
| | | col.marks.forEach(m => { |
| | | if (m.signType === 'card') return |
| | | |
| | | let field = [] |
| | | field.push(m.field) |
| | | field.push(m.contrastType) |
| | | |
| | | if (m.contrastField) { |
| | | field.push(m.contrastField) |
| | | } |
| | | let color = '#1890ff' |
| | | if (m.color && m.color[1]) { |
| | | color = colorTransform[m.color[1]] |
| | | } |
| | | let signType = ['font'] |
| | | if (m.signType === 'background') { |
| | | signType = ['background'] |
| | | } else if (m.signType === 'icon') { |
| | | if (m.position === 'back') { |
| | | signType = ['iconback'] |
| | | } else { |
| | | signType = ['iconfront'] |
| | | } |
| | | signType.push(m.iconType) |
| | | signType.push(m.icon) |
| | | } |
| | | |
| | | if (m.signType === 'line') { |
| | | lineMarks.push({ |
| | | $index: lineMarks.length + 1, |
| | | field: field, |
| | | color: color, |
| | | contrastValue: m.contrastValue || '', |
| | | match: m.match, |
| | | signType: ['background'] |
| | | }) |
| | | } else { |
| | | _col.marks.push({ |
| | | $index: _col.marks.length + 1, |
| | | field: field, |
| | | color: color, |
| | | contrastValue: m.contrastValue || '', |
| | | match: m.match, |
| | | signType: signType |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | _cols[col.field] = _col |
| | | }) |
| | | |
| | | _card.cols = [] |
| | | config.columns.forEach(col => { |
| | | if (col.type === 'index' || col.field) { |
| | | _card.cols.push(col) |
| | | if (col.type === 'index') { |
| | | _card.cols.push(fromJS(col).toJS()) |
| | | } else if (col.field && _cols[col.field]) { |
| | | let _col = fromJS(_cols[col.field]).toJS() |
| | | |
| | | if (_colspan.includes(col.field)) { |
| | | _col.Hide = 'true' |
| | | } |
| | | |
| | | _card.cols.push(_col) |
| | | } |
| | | |
| | | if (col.type === 'colspan') { |
| | | let ucol = { |
| | | Align: col.Align, |
| | | Hide: col.Hide, |
| | | label: col.label, |
| | | marks: [], |
| | | isSub: false, |
| | | uuid: col.uuid, |
| | | blacklist: [] |
| | | } |
| | | if (col.unfold === 'true') { |
| | | ucol.type = 'colspan' |
| | | ucol.subcols = [] |
| | | |
| | | col.subfield.split(', ').forEach(sub => { |
| | | if (_cols[sub]) { |
| | | let _col = fromJS(_cols[sub]).toJS() |
| | | _col.Hide = 'false' |
| | | _col.isSub = true |
| | | _col.uuid = Utils.getuuid() |
| | | |
| | | ucol.subcols.push(_col) |
| | | } |
| | | }) |
| | | |
| | | if (ucol.subcols.length > 0) { |
| | | _card.cols.push(ucol) |
| | | } |
| | | } else { |
| | | ucol.Width = 120 |
| | | ucol.type = 'custom' |
| | | ucol.elements = [] |
| | | ucol.style = {paddingTop: '12px', paddingLeft: '8px', paddingBottom: '12px', paddingRight: '8px'} |
| | | |
| | | col.subfield.split(', ').forEach(sub => { |
| | | if (_cols[sub]) { |
| | | let _col = { |
| | | copyable: 'false', |
| | | datatype: 'dynamic', |
| | | eleType: _cols[sub].type !== 'number' ? 'text' : 'number', |
| | | field: sub, |
| | | height: 1, |
| | | innerHeight: 21, |
| | | marks: _cols[sub].marks || null, |
| | | noValue: 'show', |
| | | style: {}, |
| | | width: 24, |
| | | uuid: Utils.getuuid() |
| | | } |
| | | |
| | | ucol.elements.push(_col) |
| | | } |
| | | }) |
| | | |
| | | if (ucol.elements.length > 0) { |
| | | _card.cols.push(ucol) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | _card.lineMarks = lineMarks |
| | | _card.columns = [] |
| | | _card.absFields = [] |
| | | _card.cols.forEach(col => { |
| | |
| | | _card.absFields = null |
| | | } |
| | | |
| | | let colbtns = [] |
| | | let colors = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#666666', default: '#333333' } |
| | | |
| | | config.action.forEach(btn => { |
| | | let _c = btn.class ? btn.class.replace('border-', '') : '' |
| | | let color = colors[_c] || '#1890ff' |
| | | let _btn = fromJS(btn).toJS() |
| | | _btn.uuid = Utils.getuuid() |
| | | delete _btn.position |
| | | delete _btn.linkTab |
| | | |
| | | uuids[btn.uuid] = _btn.uuid |
| | | |
| | | if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.funcType === 'print' && btn.execMode === 'pop')) { |
| | | |
| | | formActions.push({origin: btn.uuid, uuid: _btn.uuid}) |
| | | } else if (btn.OpenType === 'popview') { |
| | | |
| | | popActions.push({origin: btn.uuid, linkTab: btn.linkTab || '', uuid: _btn.uuid}) |
| | | } else if (btn.OpenType === 'tab') { |
| | | if (btn.tabTemplate === 'FormTab' || !btn.linkmenu || btn.linkmenu.length !== 3) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (_btn.tabType === 'CommonTable') { |
| | | _btn.tabType = 'BaseTable' |
| | | } |
| | | |
| | | if (btn.position === 'grid') { |
| | | _btn.eleType = 'button' |
| | | _btn.width = 24 |
| | | _btn.style = {color: color, backgroundColor: 'transparent', borderColor: 'transparent'} |
| | | colbtns.push(_btn) |
| | | } else { |
| | | if (btn.class.indexOf('border') > -1 || btn.class === 'default') { |
| | | _btn.style = {color: color, backgroundColor: '#fff', borderColor: color, marginRight: '15px'} |
| | | } else { |
| | | _btn.style = {color: '#fff', backgroundColor: color, borderColor: color, marginRight: '15px'} |
| | | } |
| | | _card.action.push(_btn) |
| | | } |
| | | }) |
| | | |
| | | if (colbtns.length > 0) { |
| | | _card.cols.push({ |
| | | Align: 'left', |
| | | label: '操作', |
| | | marks: [], |
| | | isSub: false, |
| | | uuid: Utils.getuuid(), |
| | | type: 'action', |
| | | Width: 120, |
| | | elements: colbtns, |
| | | style: {paddingTop: '12px', paddingLeft: '8px', paddingBottom: '12px', paddingRight: '8px'} |
| | | }) |
| | | } |
| | | |
| | | let sets = ['tableName', 'interType', 'sysInterface', 'innerFunc', 'interface', 'proInterface', 'outerFunc', 'dataresource', ['queryType', 'query'], 'primaryKey', 'order', 'execute', ['laypage', 'true'], ['pageSize', 10], ['onload', 'true']] |
| | | let wraps = ['tableType', ['bordered', 'true'], 'actionfixed', ['size', 'middle'], ['selected', 'false'], ['tableMode', 'compatible'], ['mask', 'show'], ['borderColor', '#e8e8e8'], 'height', 'controlField', 'controlVal'] |
| | | // useMSearch supModule |
| | | _card.scripts = config.setting.scripts |
| | | |
| | | sets.forEach(n => { |
| | | if (n === 'interType' && !['system', 'inner', 'outer'].includes(config.setting.interType)) { |
| | | _card.setting.interType = 'system' |
| | | } else if (typeof(n) === 'string') { |
| | | _card.setting[n] = config.setting[n] || '' |
| | | } else { |
| | | _card.setting[n[0]] = config.setting[n[0]] || n[1] |
| | | } |
| | | }) |
| | | wraps.forEach(w => { |
| | | if (typeof(w) === 'string') { |
| | | _card.wrap[w] = config.setting[w] || '' |
| | | } else { |
| | | _card.wrap[w[0]] = config.setting[w[0]] || w[1] |
| | | } |
| | | }) |
| | | |
| | | if (config.setting.doubleClick && uuids[config.setting.doubleClick]) { |
| | | _card.wrap.doubleClick = uuids[config.setting.doubleClick] |
| | | } else { |
| | | _card.wrap.doubleClick = '' |
| | | } |
| | | |
| | | return _card |
| | | } |
| | | |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {datatype === 'query' && interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label="系统接口"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="单点登录系统"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 系统接口 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: setting.sysInterface || 'false' |
| | | })( |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* {dataType === 'custom' ? <Col span={8}> |
| | | <Form.Item label="事务"> |
| | | {getFieldDecorator('transaction', { |
| | | initialValue: setting.transaction || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} */} |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="系统接口"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="单点登录系统"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 系统接口 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: sysInterface, |
| | | rules: [ |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | {/* <Col span={8}> |
| | | <Form.Item label="事务"> |
| | | {getFieldDecorator('transaction', { |
| | | initialValue: setting.transaction || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">使用</Radio> |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> */} |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用急速模式时,表格中的标记、双击事件、格式化、行合并、前缀、后缀、字段透视等效果将无效,且数据都会以文本格式显示。"> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="系统接口"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="单点登录系统"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 系统接口 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: setting.sysInterface || 'false', |
| | | rules: [ |
| | |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | initVal: setting.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |