企通学配置自定义
This commit is contained in:
parent
26f19c3283
commit
a7a0de166e
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { WeaTools } from 'ecCom';
|
||||||
|
|
||||||
|
|
||||||
|
export const getQtxConfigInfo = (params) => {
|
||||||
|
return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/getCardButtonTable', 'GET', params);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,176 @@
|
||||||
|
import React from 'react'
|
||||||
|
import * as mobx from 'mobx'
|
||||||
|
import {
|
||||||
|
inject,
|
||||||
|
observer
|
||||||
|
} from 'mobx-react'
|
||||||
|
import {
|
||||||
|
WeaTop, WeaFormItem, WeaTable, WeaRightMenu, WeaHelpfulTip,
|
||||||
|
WeaNewScroll, WeaSearchGroup, WeaLocaleProvider, WeaTab, WeaTableEdit
|
||||||
|
} from 'ecCom'
|
||||||
|
import {
|
||||||
|
Row, Col, Button, Modal, message, Input, Dropdown, Icon, Menu
|
||||||
|
} from 'antd'
|
||||||
|
import { WeaSwitch } from 'comsMobx'
|
||||||
|
import {
|
||||||
|
i18n
|
||||||
|
} from '../../public/i18n';
|
||||||
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
|
const toJS = mobx.toJS;
|
||||||
|
const confirm = Modal.confirm;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@inject('qtxConfig')
|
||||||
|
@observer
|
||||||
|
export default class QtxConfig extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
const {
|
||||||
|
qtxConfig
|
||||||
|
} = this.props;
|
||||||
|
qtxConfig.initList();
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
const {
|
||||||
|
qtxConfig
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
if (this.props.location.key !== nextProps.location.key) {
|
||||||
|
qtxConfig.initList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getDropMenuDatas() {
|
||||||
|
const {
|
||||||
|
qtxConfig
|
||||||
|
} = this.props, {
|
||||||
|
rightMenu
|
||||||
|
} = qtxConfig
|
||||||
|
|
||||||
|
let menus = [];
|
||||||
|
toJS(rightMenu).map((item, index) => {
|
||||||
|
let obj = {
|
||||||
|
key: item.menuFun,
|
||||||
|
icon: <i className={`${item.menuIcon}`} />,
|
||||||
|
content: item.menuName,
|
||||||
|
}
|
||||||
|
menus.push(obj);
|
||||||
|
})
|
||||||
|
return menus;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTopMenuBtns() {
|
||||||
|
const {
|
||||||
|
qtxConfig
|
||||||
|
} = this.props, {
|
||||||
|
topMenu
|
||||||
|
} = qtxConfig
|
||||||
|
|
||||||
|
let btns = [];
|
||||||
|
topMenu.map((item, i) => {
|
||||||
|
btns.push(<Button type='primary' onClick={() => { this[item.menuFun] && this[item.menuFun](); }}>{item.menuName}</Button>);
|
||||||
|
});
|
||||||
|
return btns;
|
||||||
|
}
|
||||||
|
|
||||||
|
save = () => {
|
||||||
|
const {
|
||||||
|
qtxConfig
|
||||||
|
} = this.props;
|
||||||
|
//qtxConfig.saveQuickSearchInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
login = () => {
|
||||||
|
window.open("/api/bs/hrmorganization/config/ssoLogin", "_blank")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
getFormItems = () => {
|
||||||
|
const { qtxConfig } = this.props;
|
||||||
|
const { configFields, configForm } = qtxConfig;
|
||||||
|
const arr = [];
|
||||||
|
const formParams = configForm.getFormParams();
|
||||||
|
const { isFormInit } = configForm;
|
||||||
|
isFormInit && configFields.map((field, index) => {
|
||||||
|
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} offset={1}>
|
||||||
|
<div style={{ marginTop: 20 }}>
|
||||||
|
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
|
||||||
|
label={`${field.label}`}
|
||||||
|
labelCol={{ span: `${field.labelcol}` }}
|
||||||
|
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||||
|
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={configForm} formParams={formParams} />}
|
||||||
|
{<WeaHelpfulTip
|
||||||
|
style={{"marginLeft":"20px"}}
|
||||||
|
ecId={`${this && this.props && this.props.ecId || ""}_WeaHelpfulTip@4vdvfp@${index}`}
|
||||||
|
title="未启用的情况下,企通学配置信息将从qtx_sso_login.properties配置文件中读取!" />}
|
||||||
|
</WeaFormItem>
|
||||||
|
</div>
|
||||||
|
</Col>)
|
||||||
|
})
|
||||||
|
|
||||||
|
return <Row>{arr}</Row>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { qtxConfig: store } = this.props;
|
||||||
|
const { editTableData } = store, {
|
||||||
|
datas, columns, selectedData, loading
|
||||||
|
} = editTableData;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div ref='page' style={{ height: '100%' }}>
|
||||||
|
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||||
|
datas={this.getDropMenuDatas()}
|
||||||
|
onClick={key => { this[key] && this[key]() }}
|
||||||
|
>
|
||||||
|
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||||
|
title={"企通学配置自定义"}
|
||||||
|
icon={<i className='icon-coms-hrm' />}
|
||||||
|
iconBgcolor='#217346'
|
||||||
|
loading={true}
|
||||||
|
buttons={this.getTopMenuBtns()}
|
||||||
|
showDropIcon={true}
|
||||||
|
dropMenuDatas={this.getDropMenuDatas()}
|
||||||
|
onDropMenuClick={(key) => { this[key] && this[key]() }}
|
||||||
|
>
|
||||||
|
|
||||||
|
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@ddy3vv`} needTigger={false} showGroup={true} title={getLabel(82751, "基础设置")}>
|
||||||
|
{this.getFormItems()}
|
||||||
|
</WeaSearchGroup>
|
||||||
|
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@s8pupj`} needTigger={false} showGroup={true} title={getLabel(-1, "数据库设置")}>
|
||||||
|
<WeaTableEdit
|
||||||
|
ecId={`${this && this.props && this.props.ecId || ""}_WeaTableEdit@7rorir`}
|
||||||
|
draggable
|
||||||
|
deleteConfirm
|
||||||
|
showCopy={false}
|
||||||
|
title=""
|
||||||
|
columns={toJS(columns)}
|
||||||
|
datas={toJS(datas)}
|
||||||
|
selectedData={!loading && toJS(selectedData)}
|
||||||
|
onChange={e => store.setTableEditDatas(e)}
|
||||||
|
/>
|
||||||
|
</WeaSearchGroup>
|
||||||
|
</WeaTop>
|
||||||
|
</WeaRightMenu>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -34,6 +34,7 @@ import ManagerDetach from "./components/detach/ManagerDetach";
|
||||||
import ColumnSetting from "./components/columnSetting";
|
import ColumnSetting from "./components/columnSetting";
|
||||||
import PersonnelResume from "./components/resource/PersonnelResume";
|
import PersonnelResume from "./components/resource/PersonnelResume";
|
||||||
import QuickSearch from "./components/fieldDefinedSet/QuickSearch";
|
import QuickSearch from "./components/fieldDefinedSet/QuickSearch";
|
||||||
|
import QtxConfig from "./components/fieldDefinedSet/QtxConfig";
|
||||||
|
|
||||||
import stores from "./stores";
|
import stores from "./stores";
|
||||||
import "./style/index";
|
import "./style/index";
|
||||||
|
|
@ -106,6 +107,7 @@ const Routes = (
|
||||||
<Route key="columnSetting" path="columnSetting" component={ColumnSetting} />
|
<Route key="columnSetting" path="columnSetting" component={ColumnSetting} />
|
||||||
<Route key="personnelResume" path="personnelResume/:id" component={PersonnelResume} />
|
<Route key="personnelResume" path="personnelResume/:id" component={PersonnelResume} />
|
||||||
<Route key="quickSearch" path="quickSearch" component={QuickSearch} />
|
<Route key="quickSearch" path="quickSearch" component={QuickSearch} />
|
||||||
|
<Route key="qtxConfig" path="qtxConfig" component={QtxConfig} />
|
||||||
</Route>
|
</Route>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {ManagerDetachStore} from "./managerDetach";
|
||||||
import {ColumnSetting} from './columnSetting';
|
import {ColumnSetting} from './columnSetting';
|
||||||
import {PersonnelResumeStore} from './personnelResume';
|
import {PersonnelResumeStore} from './personnelResume';
|
||||||
import { QuickSearchStore } from "./quickSearch";
|
import { QuickSearchStore } from "./quickSearch";
|
||||||
|
import { QtxConfigStore } from "./qtxConfig";
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
@ -60,5 +61,6 @@ module.exports = {
|
||||||
managerDetach: new ManagerDetachStore(),
|
managerDetach: new ManagerDetachStore(),
|
||||||
columnSetting: new ColumnSetting(),
|
columnSetting: new ColumnSetting(),
|
||||||
personnelResume:new PersonnelResumeStore(),
|
personnelResume:new PersonnelResumeStore(),
|
||||||
quickSearch:new QuickSearchStore()
|
quickSearch:new QuickSearchStore(),
|
||||||
|
qtxConfig: new QtxConfigStore()
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
import {
|
||||||
|
observable,
|
||||||
|
action,
|
||||||
|
computed, extendObservable
|
||||||
|
} from 'mobx';
|
||||||
|
import * as mobx from 'mobx';
|
||||||
|
import * as API from '../apis/qtxConfig';
|
||||||
|
import {
|
||||||
|
WeaForm
|
||||||
|
} from 'comsMobx';
|
||||||
|
import {
|
||||||
|
Modal,
|
||||||
|
message,
|
||||||
|
} from 'antd'
|
||||||
|
import {
|
||||||
|
i18n
|
||||||
|
} from '../public/i18n';
|
||||||
|
import { WeaLocaleProvider } from 'ecCom';
|
||||||
|
|
||||||
|
const toJS = mobx.toJS;
|
||||||
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
|
|
||||||
|
export class QtxConfigStore {
|
||||||
|
|
||||||
|
@observable configForm = new WeaForm();
|
||||||
|
@observable editTableData = {
|
||||||
|
datas: [],
|
||||||
|
columns: [],
|
||||||
|
loading: true,
|
||||||
|
selectedData: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
@observable configFields = [
|
||||||
|
{
|
||||||
|
domkey: ['isopenconfig'],
|
||||||
|
conditionType: 'SWITCH',
|
||||||
|
label: getLabel('-1', "是否开启数据库配置"),
|
||||||
|
labelcol: 5,
|
||||||
|
fieldcol: 19,
|
||||||
|
viewAttr: 3,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
@action("初始化页面") initList = () => {
|
||||||
|
this.configForm.initFormFields([{ items: this.configFields.slice() }]);
|
||||||
|
this.getQtxConfigInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
@action clearConfigData = () => {
|
||||||
|
this.editTableData.datas = [];
|
||||||
|
this.editTableData.columns = [];
|
||||||
|
this.editTableData.loading = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@action("数据获取") getQtxConfigInfo = () => {
|
||||||
|
this.clearConfigData();
|
||||||
|
API.getQtxConfigInfo().then(action(({ code, data, msg }) => {
|
||||||
|
if (code == 200) {
|
||||||
|
const { columns, datas } = data;
|
||||||
|
extendObservable(this.editTableData, {
|
||||||
|
datas: datas,
|
||||||
|
columns: columns,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
// this.configForm.updateFields({
|
||||||
|
// isquicksearch: data.setting.isquicksearch,
|
||||||
|
// });
|
||||||
|
} else {
|
||||||
|
message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
setTableEditDatas = (e) => {
|
||||||
|
debugger;
|
||||||
|
if(e.length > 1) {
|
||||||
|
e.pop();
|
||||||
|
message.error("默认只能添加一条配置数据!!!")
|
||||||
|
}
|
||||||
|
extendObservable(this.editTableData, {
|
||||||
|
datas: e
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@action("保存页面") saveQtxConfigInfo = () => {
|
||||||
|
// let datas = this.quickSearchData.datas;
|
||||||
|
// datas.map((data, index) => {
|
||||||
|
// data.orderid = index
|
||||||
|
// });
|
||||||
|
|
||||||
|
// let formparm = this.configForm.getFormParams();
|
||||||
|
// if (!this.checkQuickSearchData()) {
|
||||||
|
// message.error(getLabel('387954', "条件字段不能重复"));
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// let id = this.quickSearchData.setting.id;
|
||||||
|
// if (id == null) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// API.saveQuickSearchInfo({
|
||||||
|
// id: id,
|
||||||
|
// data: JSON.stringify(datas), ...formparm
|
||||||
|
// }).then(({ code, data, msg }) => {
|
||||||
|
// if (code == 200) {
|
||||||
|
// message.success(getLabel(83551, '保存成功!'));
|
||||||
|
// this.qcSelectedRowKeys = [];
|
||||||
|
// this.getQuickSearchInfo();
|
||||||
|
// } else {
|
||||||
|
// message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// this.quickSearchData.setting.id = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**===========================buttons=========================== */
|
||||||
|
rightMenu = [
|
||||||
|
{
|
||||||
|
"isBatch": "0",
|
||||||
|
"isTop": "1",
|
||||||
|
"menuFun": "save",
|
||||||
|
"menuIcon": "icon-coms-Preservation",
|
||||||
|
"menuName": "保存",
|
||||||
|
"type": "BTN_save"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"isBatch": "0",
|
||||||
|
"isTop": "0",
|
||||||
|
"menuFun": "login",
|
||||||
|
"menuIcon": "icon-coms-link",
|
||||||
|
"menuName": "单点登录",
|
||||||
|
"type": "BTN_link"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
topMenu = [
|
||||||
|
{
|
||||||
|
"isBatch": "1",
|
||||||
|
"isTop": "1",
|
||||||
|
"menuFun": "save",
|
||||||
|
"menuIcon": "icon-coms-Preservation",
|
||||||
|
"menuName": "保存",
|
||||||
|
"type": "BTN_save"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"isBatch": "1",
|
||||||
|
"isTop": "1",
|
||||||
|
"menuFun": "login",
|
||||||
|
"menuIcon": "icon-coms-link",
|
||||||
|
"menuName": "单点登录",
|
||||||
|
"type": "BTN_link"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -129,10 +129,6 @@ export class QuickSearchStore {
|
||||||
this.quickSearchData.datas = datas;
|
this.quickSearchData.datas = datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
@action setQuickSearchData = (datas) => {
|
|
||||||
this.quickSearchData.datas = datas;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**============================quickdetail===================== */
|
/**============================quickdetail===================== */
|
||||||
@action("设置") openQuickSearchDetail = (record) => {
|
@action("设置") openQuickSearchDetail = (record) => {
|
||||||
this.quickSearchDetailVisable = true;
|
this.quickSearchDetailVisable = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue