| | |
| | | icp: '', |
| | | bgColor: '', |
| | | lineColor: '', |
| | | website: '' |
| | | website: '', |
| | | style: '' // 默认为黑色,可选为white |
| | | } |
New file |
| | |
| | | .mk-white { |
| | | > .flex-container { |
| | | > .header-container { |
| | | background: #ffffff; |
| | | color: #000000; |
| | | box-shadow: 0 2px 8px #f0f1f2; |
| | | |
| | | > .header-collapse i { |
| | | color: #000000; |
| | | } |
| | | > .header-menu { |
| | | li { |
| | | span { |
| | | color: #000000; |
| | | } |
| | | |
| | | &:hover { |
| | | span { |
| | | color: #06B4F7; |
| | | border-bottom: 4px solid #06B4F7; |
| | | } |
| | | } |
| | | &.active { |
| | | span { |
| | | color: #1890ff; |
| | | border-bottom: 4px solid #1890ff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | > .header-setting span { |
| | | color: #000000; |
| | | } |
| | | > .header-edit-box .dragdashboard { |
| | | background: #ffffff; |
| | | } |
| | | } |
| | | > .side-menu { |
| | | border-right: 1px solid #d9d9d9; |
| | | background: #ffffff; |
| | | > .ant-menu { |
| | | background: #ffffff; |
| | | > .ant-menu-submenu { |
| | | color: #000000; |
| | | background: #ffffff; |
| | | > .ant-menu-submenu-title { |
| | | background: #ffffff; |
| | | &:hover { |
| | | color: #1890ff; |
| | | } |
| | | > .ant-menu-submenu-arrow:before { |
| | | background: #000000; |
| | | } |
| | | > .ant-menu-submenu-arrow:after { |
| | | background: #000000; |
| | | } |
| | | } |
| | | > .ant-menu-sub { |
| | | background: #ffffff; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) inset; |
| | | .ant-menu-item { |
| | | border-bottom: 1px solid #d9d9d9; |
| | | // background-color: #c4ebfd; |
| | | a { |
| | | color: #000000; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | > .ant-menu-submenu.ant-menu-submenu-open { |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | // .ant-menu-inline.ant-menu-sub { |
| | | // background: #ffffff; |
| | | // color: #000000; |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | visible: false, // 修改密码模态框 |
| | | dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, |
| | | confirmLoading: false, |
| | | userName: localStorage.getItem('username'), |
| | | userName: sessionStorage.getItem('User_Name'), |
| | | logourl: window.GLOB.mainlogo || logourl |
| | | } |
| | | |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import DragElement from '../menuelement' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import { sysTemps } from '@/utils/option.js' |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/header.js' |
| | | import enUS from '@/locales/en-US/header.js' |
| | |
| | | const { confirm } = Modal |
| | | const { TabPane } = Tabs |
| | | const { Search } = Input |
| | | const illust = { |
| | | |
| | | const illust = { // 模板图片,用于已使用模板 |
| | | CommonTable: nortable |
| | | } |
| | | let previewList = null |
| | | |
| | | let previewList = null // 初始菜单列表 |
| | | |
| | | class EditMenu extends Component { |
| | | static propTpyes = { |
| | | menulist: PropTypes.any, |
| | | supMenuList: PropTypes.array, |
| | | supMenu: PropTypes.object, |
| | | reload: PropTypes.func, |
| | | exitEdit: PropTypes.func |
| | | reload: PropTypes.func, // 菜单修改后刷新 |
| | | menulist: PropTypes.any, // 三级菜单列表 |
| | | exitEdit: PropTypes.func, // 退出编辑状态 |
| | | supMenu: PropTypes.object, // 对应的上级菜单 |
| | | supMenuList: PropTypes.array // 上级菜单列表,用于三级菜单切换上级菜单 |
| | | } |
| | | |
| | | state = { |
| | | dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, |
| | | show: true, |
| | | show: true, // 控制菜单刷新 |
| | | thawmenulist: null, // 已冻结的二级菜单 |
| | | visible: null, |
| | | title: '', |
| | | type: '', |
| | | tabview: '', // 选择模板窗口(template)、基础表格配置(CommonTable) |
| | | formlist: null, |
| | | type: '', // 操作类型,新建或编辑菜单 |
| | | tabview: '', // 选择模板窗口(template)、基础表格配置(CommonTable)、表单(Modal)、子表(SubTable) |
| | | editMenu: null, // 编辑菜单 |
| | | editAction: null, // 编辑按钮 |
| | | editTab: null, // 编辑标签 |
| | | thawMvisible: false, // 解除冻结模态框 |
| | | confirmLoading: false, // 提交中。。。 |
| | | selectTemp: '', // 选择模板 |
| | | usedTemplates: null, |
| | | menuConfig: '', |
| | | tempSearchKey: '', |
| | | loading: false, |
| | | preview: null, |
| | | pretemplate: null, |
| | | baseTemplates: [{ |
| | | title: '基础表格', |
| | | type: 'CommonTable', |
| | | url: illust['CommonTable'], |
| | | baseconfig: '' |
| | | }] |
| | | usedTemplates: null, // 已使用模板列表 |
| | | tempSearchKey: '', // 菜单名称过滤值 |
| | | loading: false, // 编辑菜单或使用已使用模板时,获取配置信息 |
| | | preview: null, // 图片预览url |
| | | pretemplate: null, // 预览模板 |
| | | sysTemplates: sysTemps // 系统模板 |
| | | } |
| | | |
| | | /** |
| | | * @description 菜单顺序改变时,保存中间状态 |
| | | */ |
| | | handlePreviewList = (List) => { |
| | | // 菜单顺序改变时,保存中间状态 |
| | | previewList = List |
| | | } |
| | | |
| | | /** |
| | | * @description 菜单编辑:修改、删除 |
| | | * 1、菜单修改或删除时,先查看菜单顺序是否改变 |
| | | * 2、菜单删除 |
| | | * 3、菜单编辑,查询菜单配置信息,信息正确,进入对应编辑页面 |
| | | */ |
| | | handleMenu = (menu) => { |
| | | // 菜单编辑:修改、删除 |
| | | const _this = this |
| | | if (previewList && !is(fromJS(previewList), fromJS(this.state.subMenulist))) { |
| | | notification.warning({ |
| | |
| | | try { |
| | | _LongParam = JSON.parse(_LongParam) |
| | | } catch (e) { |
| | | _LongParam = { |
| | | type: 'system', |
| | | setting: {}, |
| | | search: [], |
| | | action: [], |
| | | columns: [] |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | _menu.LongParam = _LongParam |
| | | _menu.ParentID = this.props.supMenu.MenuID |
| | | |
| | | // 检测模板是否存在 |
| | | let _Template = this.state.baseTemplates.filter(temp => temp.type === _menu.PageParam.Template) |
| | | let _Template = this.state.sysTemplates.filter(temp => temp.type === _menu.PageParam.Template) |
| | | |
| | | this.setState({ |
| | | type: 'edit', |
| | | editMenu: _menu, |
| | | loading: false, |
| | | tabview: _Template.length > 0 ? _menu.PageParam.Template : 'template' |
| | | }) |
| | | |
| | | // 模板不存在时错误提示 |
| | | if (_Template.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | }) |
| | | } |
| | | |
| | | useTemplate = (template) => { |
| | | useTemplate = (template, useType) => { |
| | | const { type, editMenu } = this.state |
| | | |
| | | new Promise(resolve => { |
| | | if (useType === 'sys') { |
| | | resolve(true) |
| | | } else { |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: template.uuid |
| | | } |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | resolve(false) |
| | | } else { |
| | | let _config = '' |
| | | if (result.LongParam) { |
| | | try { |
| | | _config = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | _config = JSON.parse(_config) |
| | | _config.type = 'user' |
| | | } catch (e) { |
| | | _config = '' |
| | | } |
| | | } |
| | | |
| | | if (_config) { |
| | | template.baseconfig = _config |
| | | resolve(true) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '模板信息获取失败!', |
| | | duration: 10 |
| | | }) |
| | | resolve(false) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }).then(res => { |
| | | if (!res) { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // 选择模板:添加菜单时 |
| | | if (type === 'add') { |
| | | this.setState({ |
| | | tabview: template.type, |
| | | loading: false, |
| | | editMenu: { |
| | | MenuID: Utils.getuuid(), |
| | | MenuName: '', |
| | |
| | | let _PageParam = {OpenType: editMenu.PageParam.OpenType || 'newtab', Template: template.type} |
| | | |
| | | this.setState({ |
| | | loading: false, |
| | | tabview: template.type, |
| | | editMenu: {...editMenu, LongParam: template.baseconfig, PageParam: _PageParam, type: template.type} |
| | | }) |
| | | } |
| | | document.getElementById('root').style.overflowY = 'hidden' |
| | | }) |
| | | } |
| | | |
| | | getUsedTemplate = () => { |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp'}).then(res => { |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'menu'}).then(res => { |
| | | this.setState({ |
| | | usedTemplates: res.UserTemp.map(temp => { |
| | | let _config = '' |
| | | if (temp.LongParam) { |
| | | _config = window.decodeURIComponent(window.atob(temp.LongParam)) |
| | | try { |
| | | _config = JSON.parse(_config) |
| | | _config.type = 'user' |
| | | } catch (e) { |
| | | _config = '' |
| | | } |
| | | } |
| | | |
| | | return { |
| | | uuid: temp.MenuID, |
| | | title: temp.MenuName, |
| | | type: temp.Template, |
| | | url: illust[temp.Template], |
| | | baseconfig: _config |
| | | url: illust[temp.Template] |
| | | } |
| | | }) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | } else if (type === 'tab') { |
| | | console.log(item) |
| | | if (item.type === 'SubTable') { |
| | | this.setState({ |
| | | editMenu: originMenu, |
| | |
| | | {this.state.tabview === 'template' && <Tabs defaultActiveKey="1"> |
| | | <TabPane tab="系统模板" key="1"> |
| | | <Row> |
| | | {this.state.baseTemplates.map(template => { |
| | | {this.state.sysTemplates.map(template => { |
| | | return ( |
| | | <Col key={template.type} span={8}> |
| | | <Card |
| | | title={template.title}> |
| | | <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template)}}>使用模板</Button> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'sys')}}>使用模板</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | |
| | | title={template.title}> |
| | | <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template)}}>使用模板</Button> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'user')}}>使用模板</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | |
| | | {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} |
| | | {this.state.thawmenulist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawmenulist}/>} |
| | | </Modal> |
| | | {this.state.loading && <Spin style={{position: 'fixed', left: 'calc(50vw - 22px)', top: 'calc(50vh - 70px)'}} size="large" />} |
| | | {this.state.loading && <Spin className="loading-thdmenu" size="large" />} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | > .loading-thdmenu { |
| | | position: fixed; |
| | | left: calc(50vw - 22px); |
| | | top: calc(50vh - 70px); |
| | | z-index: 1100; |
| | | } |
| | | } |
| | |
| | | <Tabs.TabPane |
| | | className="test" |
| | | tab={ |
| | | <span> |
| | | <span className="tab-control"> |
| | | <span className="tab-name" onClick={() => {this.changeTab(view)}}> |
| | | {view.MenuName} |
| | | </span> |
| | |
| | | .ant-tabs-tab { |
| | | padding: 18px 16px 6px; |
| | | cursor: default; |
| | | span i { |
| | | span.tab-control i { |
| | | position: relative; |
| | | left: 7px; |
| | | top: -6px; |
| | |
| | | import '@/assets/css/main.scss' |
| | | import '@/assets/css/action.scss' |
| | | import '@/assets/css/minkeicon.css' |
| | | import '@/assets/css/viewstyle.scss' |
| | | |
| | | if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { |
| | | window.location.replace(window.location.href.split('build/')[0] + 'index.html') |
| | |
| | | ) |
| | | } |
| | | |
| | | document.title = window.GLOB.title || 'MinkeSoft' |
| | | document.title = (window.GLOB && window.GLOB.title) || 'MinkeSoft' |
| | | |
| | | const option = { |
| | | white: 'mk-white' |
| | | } |
| | | |
| | | if (window.GLOB && window.GLOB.style && option[window.GLOB.style]) { |
| | | document.getElementById('root').className = option[window.GLOB.style] |
| | | } |
| | | |
| | | |
| | | |
| | | render(Route) |
| | | |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { BackTop, notification, Spin, Tabs} from 'antd' |
| | | import { BackTop, notification, Spin, Tabs, Icon} from 'antd' |
| | | import moment from 'moment' |
| | | import Api from '@/api' |
| | | import MainSearch from './mainSearch' |
| | |
| | | MenuID: this.props.MenuID |
| | | } |
| | | let result = await Api.getSystemCacheConfig(param) |
| | | if (result.status && result.LongParam) { |
| | | if (result.status) { |
| | | let config = '' |
| | | |
| | | try { // 配置信息解析 |
| | |
| | | |
| | | // 页面配置解析错误时提示 |
| | | if (!config) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['main.page.settingerror'], |
| | | duration: 10 |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true |
| | | }) |
| | | return |
| | | } |
| | |
| | | loading: true |
| | | }, () => { |
| | | this.improveSearch() |
| | | if (config.setting.onload !== 'false') { |
| | | this.loadmaindata() |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | refreshbysearch = (searches) => { |
| | | const { setting } = this.state |
| | | // 搜索条件变化 |
| | | |
| | | if (setting.onload === 'false') { |
| | | this.setState({ |
| | | loading: true, |
| | | pageIndex: 1, |
| | | search: searches, |
| | | setting: {...setting, onload: 'true'} |
| | | }, () => { |
| | | this.loadmaindata() |
| | | }) |
| | | } else { |
| | | this.refs.mainTable.resetTable() |
| | | |
| | | this.setState({ |
| | |
| | | }, () => { |
| | | this.loadmaindata() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | refreshbytable = (pagination, filters, sorter) => { |
| | |
| | | |
| | | render() { |
| | | const { setting, searchlist, actions, columns, loadingview, viewlost, tabviews } = this.state |
| | | console.log(setting) |
| | | |
| | | return ( |
| | | <div className="commontable" id={'commontable' + this.props.MenuID}> |
| | | {loadingview && <Spin size="large" />} |
| | |
| | | dict={this.state.dict} |
| | | /> : null |
| | | } |
| | | {actions && |
| | | {actions && setting.onload !== 'false' && |
| | | <MainAction |
| | | ref="mainButton" |
| | | MenuID={this.props.MenuID} |
| | |
| | | dict={this.state.dict} |
| | | /> |
| | | } |
| | | {columns && |
| | | {columns && setting.onload !== 'false' && |
| | | <MainTable |
| | | ref="mainTable" |
| | | dict={this.state.dict} |
| | |
| | | buttonTrigger={this.buttonTrigger} |
| | | /> |
| | | } |
| | | {setting && setting.tabshow !== 'vertical' && tabviews && tabviews.length > 0 && |
| | | {setting && setting.onload !== 'false' && setting.tabshow !== 'vertical' && tabviews && tabviews.length > 0 && |
| | | <Tabs defaultActiveKey="0" tabPosition="top"> |
| | | {tabviews.map((_tab, index) => ( |
| | | <TabPane tab={ _tab.label } key={`${index}`}> |
| | | {_tab.type === 'SubTable' ? <SubTable SupMenuID={this.props.MenuID} MenuID={this.props.MenuID} BID={this.state.BID} /> : null} |
| | | <TabPane tab={ |
| | | <span> |
| | | {_tab.icon ? <Icon type={_tab.icon} /> : null} |
| | | {_tab.label} |
| | | </span> |
| | | } key={`${index}`}> |
| | | {_tab.type === 'SubTable' ? <SubTable SupMenuID={this.props.MenuID} MenuID={_tab.linkTab} BID={this.state.BID} /> : null} |
| | | </TabPane> |
| | | ))} |
| | | </Tabs> |
| | |
| | | } |
| | | > .ant-tabs { |
| | | padding: 0px 20px; |
| | | .ant-tabs-tab:not(.ant-tabs-tab-active) { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | .ant-back-top { |
| | |
| | | |
| | | export default class NormalTable extends Component { |
| | | static propTpyes = { |
| | | MenuNo: PropTypes.string, // 菜单参数 |
| | | MenuName: PropTypes.string, // 菜单参数 |
| | | MenuID: PropTypes.string // 菜单Id |
| | | BID: PropTypes.string, // 上级数据ID |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | SupMenuID: PropTypes.string // 上级菜单Id |
| | | } |
| | | |
| | | state = { |
| | |
| | | MenuID: this.props.MenuID |
| | | } |
| | | let result = await Api.getSystemCacheConfig(param) |
| | | if (result.status && result.LongParam) { |
| | | if (result.status) { |
| | | let config = '' |
| | | |
| | | try { // 配置信息解析 |
| | |
| | | |
| | | // 页面配置解析错误时提示 |
| | | if (!config) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['main.page.settingerror'], |
| | | duration: 10 |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: this.state.dict['main.page.settingerror'], |
| | | // duration: 10 |
| | | // }) |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true |
| | | // lostmsg: this.state.dict['main.page.settingerror'] |
| | | }) |
| | | return |
| | | } |
| | |
| | | <SubAction |
| | | ref="subButton" |
| | | MenuID={this.props.MenuID} |
| | | BID={this.props.BID} |
| | | setting={setting} |
| | | refreshdata={this.refreshbyaction} |
| | | gettableselected={this.gettableselected} |
| | |
| | | .subtable { |
| | | position: relative; |
| | | min-height: calc(100vh - 94px); |
| | | min-height: 200px; |
| | | padding-top: 16px; |
| | | .box404 { |
| | | padding-top: 30px; |
| | |
| | | } |
| | | } |
| | | > .ant-spin { |
| | | position: fixed; |
| | | left: calc(50vw - 22px); |
| | | top: calc(50vh - 70px); |
| | | position: absolute; |
| | | left: calc(50% - 22px); |
| | | top: 100px; |
| | | } |
| | | } |
| | | .ant-back-top { |
| | |
| | | |
| | | class MainAction extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.string, |
| | | dict: PropTypes.object, // 字典项 |
| | | MenuID: PropTypes.string, |
| | | actions: PropTypes.array, // 搜索条件列表 |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.any |
| | | } |
| | | |
| | |
| | | (btn.OpenType === 'pop' && !btn.innerFunc && btn.sql && btn.sqlType === 'insert') |
| | | ) { |
| | | let param = { // 系统存储过程 |
| | | func: 'sPC_TableData_InUpDe' |
| | | func: 'sPC_TableData_InUpDe', |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | |
| | | } |
| | | |
| | | param.ID = ID |
| | | param.BID = '' |
| | | |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | |
| | | if (!param.hasOwnProperty('ID') && setting.primaryKey && data[0] && data[0][setting.primaryKey]) { |
| | | param.ID = data[0][setting.primaryKey] |
| | | } |
| | | if (!param.hasOwnProperty('BID')) { |
| | | param.BID = '' |
| | | } |
| | | } else if (btn.sql && btn.sqlType === 'insert') { |
| | | param.ID = Utils.getguid() |
| | | param.BID = '' |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | } else if (btn.sql) { |
| | | param.ID = data[0][setting.primaryKey] |
| | | param.BID = '' |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | } else if (btn.Ot === 'required' || (btn.Ot === 'requiredOnce' && btn.OpenType === 'pop')) { |
| | | let deffers = data.map(cell => { |
| | | let param = { |
| | | func: 'sPC_TableData_InUpDe' |
| | | func: 'sPC_TableData_InUpDe', |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | | param.ID = cell[setting.primaryKey] |
| | | param.BID = '' |
| | | |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = cell[setting.primaryKey] |
| | | param.BID = '' |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | /** *********************调用外部接口************************* */ |
| | | let param = { |
| | | ID: '', |
| | | BID: '' |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (!btn.interface) { // 接口地址不存在时报错 |
| | |
| | | if (btn.innerFunc) { |
| | | let deffers = data.map(cell => { |
| | | let _param = { |
| | | BID: '', |
| | | BID: this.props.BID, |
| | | func: btn.innerFunc |
| | | } |
| | | _param.ID = cell[setting.primaryKey] |
| | |
| | | } else { |
| | | let params = data.map(cell => { |
| | | return { |
| | | BID: '', |
| | | BID: this.props.BID, |
| | | ID: cell[setting.primaryKey] |
| | | } |
| | | }) |
| | |
| | | .ant-advanced-search-form.subtable-main-search { |
| | | padding: 0px 0px 20px; |
| | | border-bottom: 1px solid #e9e9e9; |
| | | border-bottom: 1px solid #efefef; |
| | | .ant-form-item { |
| | | display: flex; |
| | | margin-bottom: 10px; |
| | |
| | | delActions: [], // 删除按钮列表 |
| | | funcLoading: false, // 存储过程创建中 |
| | | showColumnName: false, // 显示列字段名控制 |
| | | tabviews: false // 所有标签页 |
| | | tabviews: [] // 所有标签页 |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | }) |
| | | |
| | | // let param = { |
| | | // func: 'sPC_Get_SelectedList', |
| | | // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0', |
| | | // obj_name: 'data', |
| | | // arr_field: 'TbName,Remark' |
| | | // } |
| | | |
| | | // param.LText = Utils.formatOptions(param.LText) |
| | | // param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | // param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | // Api.getSystemConfig(param).then(res => { |
| | | // if (res.status) { |
| | | // this.setState({ |
| | | // tables: res.data |
| | | // }) |
| | | // } else { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: res.message, |
| | | // duration: 10 |
| | | // }) |
| | | // } |
| | | // }) |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | tabviews: res.UserTemp.map(temp => { |
| | | return { |
| | | uuid: temp.MenuID, |
| | | value: temp.MenuID, |
| | | text: temp.MenuName, |
| | | type: temp.Template, |
| | | MenuNo: temp.MenuNo |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | handleList = (type, list, card) => { |
| | |
| | | label: '关联标签', |
| | | initVal: card.linkTab || '', |
| | | required: false, |
| | | options: [{ |
| | | value: '', |
| | | text: '新建' |
| | | }, { |
| | | value: 'jadisfjiasodjIjjaidfoasdf', |
| | | text: '子表1' |
| | | }, { |
| | | value: 'dasjfsioafjiaga', |
| | | text: '子表2' |
| | | }, { |
| | | value: 'jadsifjasgfisag', |
| | | text: '子表3' |
| | | }] |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | } |
| | | }) |
| | | } else if (type === 'tab') { |
| | | if (btn.linkTab) { |
| | | |
| | | } else { |
| | | let _tab = { |
| | | uuid: btn.linkId, |
| | | create: true |
| | | } |
| | | this.props.handleSubConfig(btn, originMenu, _tab, type) |
| | | } |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | // Api.getSystemConfig({ |
| | | // func: 'sPC_Get_LongParam', |
| | | // MenuID: btn.linkId |
| | | // }).then(res => { |
| | | // if (res.status) { |
| | | // this.setState({ |
| | | // loading: false |
| | | // }) |
| | | // let _LongParam = '' |
| | | // if (res.LongParam) { |
| | | // _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) |
| | | // try { |
| | | // _LongParam = JSON.parse(_LongParam) |
| | | // } catch (e) { |
| | | // _LongParam = '' |
| | | // } |
| | | // } |
| | | // console.log(_LongParam) |
| | | // } else { |
| | | // this.setState({ |
| | | // loading: false |
| | | // }) |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: res.message, |
| | | // duration: 10 |
| | | // }) |
| | | // } |
| | | // }) |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: btn.linkTab |
| | | }).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | let _LongParam = '' |
| | | if (res.LongParam) { |
| | | _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) |
| | | try { |
| | | _LongParam = JSON.parse(_LongParam) |
| | | } catch (e) { |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | if (!_LongParam) { |
| | | _LongParam = { |
| | | ...btn, |
| | | uuid: btn.linkTab, |
| | | create: true |
| | | } |
| | | } |
| | | |
| | | this.props.handleSubConfig(btn, originMenu, _LongParam, type) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, () => { |
| | | notification.warning({ |
| | |
| | | {this.state.formtemp === 'tabs' ? |
| | | <TabForm |
| | | type="tabs" |
| | | tabs={this.state.tabviews} |
| | | dict={this.state.dict} |
| | | card={this.state.card} |
| | | formlist={this.state.formlist} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="初始化"> |
| | | {getFieldDecorator('onload', { |
| | | initialValue: data.onload || 'true' |
| | | })( |
| | | <Select> |
| | | <Select.Option value="true">加载数据</Select.Option> |
| | | <Select.Option value="false">不加载数据</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | innerFunc: '', |
| | | interface: '', |
| | | outerFunc: '', |
| | | onload: 'true', |
| | | tabshow: 'horizontal' |
| | | }, |
| | | tables: [], |
| | |
| | | newcard.label = 'tab' |
| | | newcard.icon = '' |
| | | newcard.type = item.subType |
| | | newcard.linkTab = '' |
| | | newcard.linkId = Utils.getuuid() |
| | | newcard.linkTab = Utils.getuuid() |
| | | newcard.supMenu = '' |
| | | |
| | | let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0 |
| | |
| | | |
| | | class MainTab extends Component { |
| | | static propTpyes = { |
| | | tabs: PropTypes.array, // 类型 |
| | | type: PropTypes.string, // 类型 |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.any, // 表单 |
| | |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { formlist } = this.props |
| | | let type = formlist.filter(cell => cell.key === 'type')[0].initVal |
| | | console.log(type) |
| | | |
| | | let type = formlist.filter(cell => cell.key === 'type')[0].initVal |
| | | let _initval = formlist.filter(cell => cell.key === 'linkTab')[0].initVal |
| | | |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === type) |
| | | let initTab = _tabs.filter(tab => tab.uuid === _initval)[0] |
| | | console.log(_tabs) |
| | | this.setState({ |
| | | formlist: formlist |
| | | formlist: formlist.map(item => { |
| | | if (item.key === 'linkTab') { |
| | | item.options = [ |
| | | { |
| | | value: '', |
| | | text: '新建' |
| | | }, |
| | | ..._tabs |
| | | ] |
| | | if (!initTab) { |
| | | item.initVal = '' |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 标签页类型切换 |
| | | */ |
| | | openTypeChange = (key, value) => { |
| | | console.log(value) |
| | | // if (key === 'type') { |
| | | // console.log(value) |
| | | const { formlist } = this.state |
| | | |
| | | // this.setState({ |
| | | // formlist: this.state.formlist.map(form => { |
| | | // return form |
| | | // }) |
| | | // }, () => { |
| | | // this.setState({ |
| | | // formlist: this.state.formlist.map(form => { |
| | | // return form |
| | | // }) |
| | | // }) |
| | | // }) |
| | | // } |
| | | if (key === 'type') { |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === value) |
| | | |
| | | this.setState({ |
| | | formlist: formlist.map(item => { |
| | | if (item.key === 'linkTab') { |
| | | item.options = [ |
| | | { |
| | | value: '', |
| | | text: '新建' |
| | | }, |
| | | ..._tabs |
| | | ] |
| | | item.initVal = '' |
| | | item.hidden = true |
| | | } |
| | | return item |
| | | }) |
| | | }, () => { |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'linkTab') { |
| | | item.hidden = false |
| | | } |
| | | return item |
| | | }) |
| | | }) |
| | | }) |
| | | |
| | | console.log(value) |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(form => { |
| | | return form |
| | | }) |
| | | }, () => { |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(form => { |
| | | return form |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getFields() { |
| | |
| | | onChange={(value) => {this.openTypeChange(item.key, value)}} |
| | | > |
| | | {item.options.map((option, i) => |
| | | <Select.Option id={`${i}`} title={option.text} key={`${i}`} value={option.value}> |
| | | <Select.Option id={'mk' + i} title={option.text} key={'mk' + i} value={option.value}> |
| | | {item.key === 'icon' && i !== 0 ? <Icon type={option.text} /> : option.text} |
| | | </Select.Option> |
| | | )} |
| | |
| | | values.uuid = this.props.card.uuid |
| | | |
| | | if (!values.linkTab) { // 没有关联标签(新建时),创建新标签Id |
| | | values.linkId = Utils.getuuid() |
| | | values.linkTab = Utils.getuuid() |
| | | } |
| | | |
| | | resolve({ |
| | |
| | | _config = JSON.parse(JSON.stringify(Source.baseConfig)) |
| | | if (config.uuid) { |
| | | _config.uuid = config.uuid |
| | | _config.tabName = config.label |
| | | } |
| | | } else { |
| | | _config = JSON.parse(JSON.stringify(config)) |
| | |
| | | import zhCN from '@/locales/zh-CN/share.js' |
| | | import enUS from '@/locales/en-US/share.js' |
| | | import nortable from '@/assets/img/normaltable.jpg' |
| | | |
| | | const _dict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | | export const sysTemps = [ |
| | | { |
| | | title: '基础表格', |
| | | type: 'CommonTable', |
| | | url: nortable, |
| | | baseconfig: '' |
| | | } |
| | | ] |
| | | |
| | | export const dateOptions = { |
| | | date: [ |
| | | {value: '', text: _dict['date.empty']}, |
| | |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('SessionUid', Utils.getuuid()) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | | sessionStorage.setItem('User_Name', res.UserName) |
| | | |
| | | localStorage.setItem('lang', param.lang) |
| | | |
| | | let _url = window.location.href.split('#')[0] |