| | |
| | | min-height: calc(100vh - 300px); |
| | | overflow-y: auto; |
| | | .ant-empty { |
| | | margin: 15vh 8px; |
| | | margin: 5vh 8px; |
| | | } |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && this.scriptsForm.props.form.getFieldValue('sql') !== ' ') { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && this.scriptsForm.props.form.getFieldValue('sql') !== ' ') { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | const { activeKey, setting, preScripts, cbScripts } = this.state |
| | | |
| | | let _loading = false |
| | | if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { |
| | | if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | const { activeKey } = this.state |
| | | |
| | | let _loading = false |
| | | if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { |
| | | if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | min-height: calc(100vh - 300px); |
| | | overflow-y: auto; |
| | | .ant-empty { |
| | | margin: 15vh 8px; |
| | | margin: 5vh 8px; |
| | | } |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | this.setState({activeKey: 'scripts'}) |
| | | } |
| | | |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | this.setState({activeKey: 'scripts'}) |
| | | } |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | const { activeKey, setting, scripts, preScripts, cbScripts } = this.state |
| | | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | const { activeKey, search, arr_field, setting } = this.state |
| | | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.preScriptsForm && this.preScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.preScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.cbScriptsForm && this.cbScriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.cbScriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | let _loading = false |
| | | let msg = '' |
| | | if (this.customForm && this.customForm.state.editItem) { |
| | | _loading = true |
| | | msg = '自定义验证' |
| | | } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.customForm.props.form.getFieldValue('sql'))) { |
| | | msg = '自定义验证' |
| | | } else if (this.orderForm && this.orderForm.state.editItem) { |
| | | _loading = true |
| | | msg = '单号生成' |
| | | } else if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } |
| | | |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && this.scriptsForm.props.form.getFieldValue('sql') !== ' ') { |
| | | _loading = true |
| | | } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && this.customForm.props.form.getFieldValue('sql') !== ' ') { |
| | | _loading = true |
| | | msg = '自定义脚本' |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | msg = '自定义脚本' |
| | | } |
| | | |
| | | if (verify.noteEnable === 'true' && !verify.noteCode) { // 开启短信时,需要模板编码 |
| | |
| | | verify.noteCode = '' |
| | | } |
| | | |
| | | if (_loading) { |
| | | if (msg) { |
| | | confirm({ |
| | | content: `存在未保存项,确定提交吗?`, |
| | | content: msg + '未保存,确定提交吗?', |
| | | onOk() { |
| | | resolve(verify) |
| | | }, |
| | |
| | | {editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null} |
| | | {/* 进入编辑按钮 */} |
| | | {!editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' ? |
| | | {/* {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' ? |
| | | <a href="#/mobmanage" target="_blank" className="mobile" type="edit"> 应用管理 <Icon type="arrow-right" /></a> : null |
| | | } |
| | | } */} |
| | | {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '首页' }))) */} |
| | | {!editLevel && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? |
| | | <a className="home-edit" href={`#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=`} target="_blank" rel="noopener noreferrer"> |
| | |
| | | import React, {Component} from 'react' |
| | | // import { fromJS } from 'immutable' |
| | | import { Spin, notification, Button, Table, Modal } from 'antd' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Button, Table, Modal, ConfigProvider } from 'antd' |
| | | import moment from 'moment' |
| | | import enUS from 'antd/es/locale/en_US' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | const _locale = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | const Header = asyncComponent(() => import('@/mob/header')) |
| | | const MutilForm = asyncComponent(() => import('./mutilform')) |
| | | const SubMutilForm = asyncComponent(() => import('./submutilform')) |
| | | |
| | | class AppManage extends Component { |
| | | state = { |
| | | loading: false, |
| | | applist: [], |
| | | appsublist: [], |
| | | columns: [ |
| | | { title: '应用名称', dataIndex: 'remark', key: 'remark', align: 'center' }, |
| | | { title: '应用编码', dataIndex: 'kei_no', key: 'kei_no', align: 'center' }, |
| | |
| | | }, |
| | | { |
| | | title: '权限管理', dataIndex: 'role_type', key: 'role_type', align: 'center', |
| | | render: (text, record) => text === 'false' ? '不需要' : '需要' |
| | | render: (text, record) => text === 'false' ? '不启用' : '启用' |
| | | }, |
| | | { |
| | | title: '短连接', dataIndex: 'link_type', key: 'link_type', align: 'center', |
| | |
| | | |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | applist: result.data.map(item => { |
| | | let selectApp = null |
| | | let applist = result.data.map(item => { |
| | | item.sublist = item.data_detail || [] |
| | | item.sublist = item.sublist.map(cell => { |
| | | cell.ID = cell.d_id |
| | | return cell |
| | | }) |
| | | |
| | | if (this.state.selectApp && this.state.selectApp.ID === item.ID) { |
| | | selectApp = item |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | loading: false, |
| | | applist: applist, |
| | | selectApp |
| | | }) |
| | | |
| | | } else { |
| | |
| | | } |
| | | |
| | | deleteApp = (record) => { |
| | | console.log(record) |
| | | const _this = this |
| | | |
| | | confirm({ |
| | | content: '确定删除《' + record.remark + '》吗?', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | let param = { |
| | | func: 's_kei_del', |
| | | ID: record.ID, |
| | | kei_no: record.kei_no |
| | | } |
| | | |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '删除成功!', |
| | | duration: 5 |
| | | }) |
| | | |
| | | _this.setState({ |
| | | selectedRowKeys: [], |
| | | selectedSubRowKeys: [], |
| | | selectApp: null, |
| | | selectSubApp: null, |
| | | loading: true |
| | | }) |
| | | _this.getAppList() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | resolve() |
| | | }, () => { |
| | | resolve() |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | deleteSubApp = (record) => { |
| | | console.log(record) |
| | | const { selectApp } = this.state |
| | | const _this = this |
| | | |
| | | let param = { |
| | | func: 's_kei_addupt', |
| | | ID: selectApp.ID, |
| | | exec_type: 'y', |
| | | remark: selectApp.remark, |
| | | kei_no: selectApp.kei_no, |
| | | LText: '' |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | let sublist = fromJS(selectApp.sublist).toJS() |
| | | sublist = sublist.filter(item => item.ID !== record.ID) |
| | | |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | | confirm({ |
| | | content: '确定删除该子应用吗?', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '操作成功!', |
| | | duration: 5 |
| | | }) |
| | | |
| | | _this.setState({ |
| | | selectedSubRowKeys: [], |
| | | selectSubApp: null, |
| | | loading: true |
| | | }) |
| | | _this.getAppList() |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | resolve() |
| | | }, () => { |
| | | resolve() |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | jumpApp = (item) => { |
| | |
| | | * @description 点击整行,触发切换, 判断是否可选,单选或多选,进行对应操作 |
| | | */ |
| | | changeRow = (record) => { |
| | | this.setState({ selectedRowKeys: [record.ID], selectApp: record, appsublist: record.sublist || [] }) |
| | | this.setState({ selectedRowKeys: [record.ID], selectApp: record }) |
| | | } |
| | | |
| | | /** |
| | | * @description 点击整行,触发切换, 判断是否可选,单选或多选,进行对应操作 |
| | | */ |
| | | changeSubRow = (record) => { |
| | | console.log(record) |
| | | this.setState({ selectedSubRowKeys: [record.ID], selectSubApp: record }) |
| | | } |
| | | |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择需要编辑的子应用!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (!this.state.selectApp) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择应用!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | if (visible === 'edit' && selectApp.sublist && selectApp.sublist.length > 0) { |
| | | if (visible === 'edit') { |
| | | param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | |
| | | }) |
| | | |
| | | this.setState({ |
| | | selectedRowKeys: [], |
| | | selectedSubRowKeys: [], |
| | | selectApp: null, |
| | | selectSubApp: null, |
| | | confirmloading: false, |
| | | visible: false, |
| | | loading: true |
| | |
| | | } |
| | | |
| | | submitSubCard = () => { |
| | | const { card } = this.state |
| | | const { selectApp, subVisible, selectSubApp } = this.state |
| | | |
| | | this.submobcardRef.handleConfirm().then(res => { |
| | | if (subVisible === 'plus' && selectApp.sublist.filter(item => item.typename === res.typename).length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '应用类型已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({ |
| | | confirmloading: true |
| | | }) |
| | | |
| | | let param = { |
| | | func: 's_kei_addupt', |
| | | ID: card ? card.uuid : Utils.getuuid(), |
| | | TypeName: res.type, |
| | | remark: res.name, |
| | | kei_no: res.keiNo |
| | | ID: selectApp.ID, |
| | | exec_type: 'y', |
| | | remark: selectApp.remark, |
| | | kei_no: selectApp.kei_no, |
| | | LText: '' |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | let sublist = fromJS(selectApp.sublist).toJS() |
| | | if (subVisible === 'plus') { |
| | | sublist.unshift({ |
| | | ID: Utils.getuuid(), |
| | | ...res |
| | | }) |
| | | } else { |
| | | res.ID = selectSubApp.ID |
| | | sublist = sublist.map(item => { |
| | | if (item.ID !== res.ID) { |
| | | return item |
| | | } else { |
| | | return res |
| | | } |
| | | }) |
| | | } |
| | | |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: card ? '修改成功!' : '添加成功!', |
| | | message: '操作成功!', |
| | | duration: 5 |
| | | }) |
| | | |
| | | this.setState({ |
| | | selectedSubRowKeys: [], |
| | | selectSubApp: null, |
| | | confirmloading: false, |
| | | visible: false, |
| | | subVisible: false, |
| | | loading: true |
| | | }) |
| | | this.getAppList() |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { loading, visible, subVisible, columns, applist, appsublist, selectedRowKeys, selectedSubRowKeys, subcolumns, selectApp, selectSubApp } = this.state |
| | | const { loading, visible, subVisible, columns, applist, selectedRowKeys, selectedSubRowKeys, subcolumns, selectApp, selectSubApp } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-app-manage"> |
| | | <ConfigProvider locale={_locale}> |
| | | <Header view="manage" /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | |
| | | <Table |
| | | rowKey="ID" |
| | | columns={subcolumns} |
| | | dataSource={appsublist} |
| | | dataSource={selectApp ? selectApp.sublist : []} |
| | | pagination={false} |
| | | rowSelection={{ type: 'radio', selectedRowKeys: selectedSubRowKeys, onChange: this.onSubChange }} |
| | | onRow={(record) => ({ onClick: () => {this.changeSubRow(record)} })} |
| | |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <MutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> |
| | | <SubMutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> |
| | | </Modal> |
| | | </ConfigProvider> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Select, Radio } from 'antd' |
| | | import { Form, Row, Col, Select, Radio } from 'antd' |
| | | import './index.scss' |
| | | |
| | | class MainSearch extends Component { |
| | |
| | | <Form {...formItemLayout} className="mob-card-edit-form"> |
| | | <Row gutter={24}> |
| | | <Col span={24}> |
| | | <Form.Item label="应用名"> |
| | | {getFieldDecorator('name', { |
| | | initialValue: card ? card.name : '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入应用名!' |
| | | }, { |
| | | max: 20, |
| | | message: '应用名不可超过20个字符!' |
| | | }] |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="应用类型"> |
| | | {getFieldDecorator('type', { |
| | | initialValue: card ? card.type : 'mob', |
| | | {getFieldDecorator('typename', { |
| | | initialValue: card ? card.typename : 'mob', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Select> |
| | | <Select.Option value="mob">移动端</Select.Option> |
| | | <Select disabled={type === 'edit'}> |
| | | <Select.Option value="mob">移动端(包括android、ios)</Select.Option> |
| | | <Select.Option value="pc">PC端</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="应用编码"> |
| | | {getFieldDecorator('keiNo', { |
| | | initialValue: card ? card.keiNo : '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入应用编码!' |
| | | }, { |
| | | pattern: /^[a-zA-Z_]*$/ig, |
| | | message: '应用编码只允许包含大小写字母及_!' |
| | | }, { |
| | | max: 20, |
| | | message: '应用编码不可超过20个字符!' |
| | | }] |
| | | })(<Input placeholder="" disabled={type === 'edit'} autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | <Form.Item label="语言"> |
| | | {getFieldDecorator('lang', { |
| | | initialValue: card ? card.lang || 'zh-CN' : 'zh-CN' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="zh-CN">中文</Radio> |
| | | <Radio value="en-US">英文</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="登录"> |
| | | {getFieldDecorator('login_types', { |
| | | initialValue: card ? card.login_types || 'true' : 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">需要</Radio> |
| | | <Radio value="false">不需要</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="权限管理"> |
| | | {getFieldDecorator('role_manage', { |
| | | initialValue: card ? card.role_manage || 'false' : 'false', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选择是否启用权限管理!' |
| | | }] |
| | | {getFieldDecorator('role_type', { |
| | | initialValue: card ? card.role_type || 'true' : 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">启用</Radio> |
| | | <Radio value="false">不启用</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="短连接"> |
| | | {getFieldDecorator('link_type', { |
| | | initialValue: card ? card.link_type || 'true' : 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">启用</Radio> |