0 ? '#54D3A2' : '#FF0000',marginLeft: 270 }} className='hrm-import-error-tip'>
+ 0 ? 'check' : 'cross'} style={{ color: '#fff',fontSize: 18 }} />
+
;
+ const tip = index}
+ getColumns={c => this.reRenderColumns(c)}
+ />
+ return
+
0) && failnum > 0) ? {marginTop: 20} : {marginTop: height/2 -30}}>{icon}{tip}
+
{resultTable}
+
+ }
+
+ getImportProcessInfo = () => {
+ const {
+ hrmImportCommon
+ } = this.props, {
+ resultDialog
+ } = hrmImportCommon, {
+ datas,
+ importStatus
+ } = resultDialog;
+
+ const columns = [{
+ "title": getLabel(27592, '行'),
+ "width": "15%",
+ "dataIndex": "rownum"
+ }, {
+ "title": getLabel(602, '状态'),
+ "width": "15%",
+ "dataIndex": "status",
+ render: (text, record, index) => {
+ return {text=='1' ? getLabel(15242, '成功') : getLabel(498, '失败')}
+ }
+ }, {
+ "title": getLabel(24960, '提示信息'),
+ "width": "70%",
+ "dataIndex": "message",
+ render: (text, record, index) => {
+ // return {text}
+ return {text}
+ }
+ }];
+
+ const loadingTip = (importStatus !== 'over' || importStatus !== 'error') && ;
+
+ const processTable =
+
+ return
+
{loadingTip}
+
{processTable}
+
+ }
+
+ render() {
+ const {
+ hrmImportCommon
+ } = this.props, {
+ resultDialog,
+ logDialog,
+ setResultInfoDialogVisible,
+ hasErrorInfo,
+ setScoll
+ } = hrmImportCommon, {
+ title,
+ visible,
+ importStatus,
+ errorInfo,
+ loading
+ } = resultDialog, {
+ width,
+ height
+ } = this.state;
+
+ return (
+
+ setResultInfoDialogVisible(false)}
+ buttons={this.getButtons()}
+ style={{width: width, height: height}}
+ onChangeHeight={(h) => this.setState({height: h})}
+ >
+
+ setScoll(com)}>
+ {
+ !loading && (hasErrorInfo(errorInfo) ? this.getErrorInfo(errorInfo) :
+ (importStatus == 'over' || importStatus == 'error' ) ? this.getResultInfo() : this.getImportProcessInfo() )
+ }
+
+
+
+ {logDialog.visible && }
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/hrm/importRelatedComponet/index.js b/pc4backstage/pc4public/hrm/importRelatedComponet/index.js
new file mode 100644
index 0000000..19bec36
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/importRelatedComponet/index.js
@@ -0,0 +1,268 @@
+import {
+ inject,
+ observer
+} from 'mobx-react';
+import {
+ WeaUpload,
+ WeaDialog,
+ WeaSelect,
+ WeaNewScroll,
+ WeaMoreButton,
+ WeaSearchGroup,
+ WeaLocaleProvider,
+} from 'ecCom'
+import {
+ Row,
+ Col,
+ Spin,
+ Button,
+} from 'antd'
+import {
+ WeaSwitch
+} from 'comsMobx';
+import {
+ IEVersion
+} from '../util/pure-util'
+import{addContentPath} from '../../../pc4mobx/hrm/util/index.js'
+import '../style/import.css'
+const getLabel = WeaLocaleProvider.getLabel;
+
+import ImportResult from './ImportResult'
+import ImportHistory from './ImportHistory'
+
+@observer
+export default class Import extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ width: 870,
+ height: 510,
+ list: [],
+ upStatus: '',
+ }
+ }
+
+ getForm = () => {
+ const {
+ hrmImportCommon
+ } = this.props, {
+ importDialog
+ } = hrmImportCommon, {
+ condition,
+ form,
+ } = importDialog, {
+ isFormInit
+ } = form;
+
+ let _arr = [];
+ isFormInit && condition.map((c, i) => {
+ let arr = [];
+ if (i == 0) { //基本信息
+ c.items.map((field, index) => {
+ let key = field.domkey[0];
+ let url = field.value ? field.value : '';
+ arr.push({
+ com: (
+
+
+
+
+
+
+ {field.label.length > 14 ? `${field.label.slice(0, 14)}...` : field.label}:
+
+ {this.getElements(key, url,field)}
+
+
+
+
+ ),
+ colSpan: 1,
+ })
+ })
+ }
+ if (i == 1) { //导入说明
+ c.items.map((field, index) => {
+ let p = field.value;
+ let url = field.link ? field.link : '';
+ arr.push({
+ com: (
+
+
+ 8) ? 3 : 6}}>
+
{index + 1}
+
+
+
+ {this.getImportInstructions(p, url, index)}
+
+
+ ),
+ colSpan: 1
+ })
+ })
+ }
+ _arr.push(
)
+ });
+ return _arr;
+ }
+
+ getElements = (key, url, field) => {
+ const {
+ hrmImportCommon
+ } = this.props, {
+ setExcelFileNo,
+ importDialog,
+ setSelectedValue
+ } = hrmImportCommon, {
+ templetName,
+ selectedValue,
+ form,
+ } = importDialog, {
+ upStatus,
+ list
+ } = this.state;
+
+ let dom;
+ if (key == 'templet') {
+ dom = this.getTempletElement(url, selectedValue, templetName);
+ } else if (key == 'excelfile') {
+ dom = (
+
+ {this.setState({list:list}); setExcelFileNo(id)}}
+ onUploading={status => this.handleUploading(status)}
+ >
+
+
+
+
+ { list.length == 0 ?
{getLabel(384040, '未选择任何文件')}
: list.map(file =>
{file.filename}
) }
+
+
)
+ } else {
+ dom =
+ }
+ return dom;
+ }
+
+ getImportInstructions = (val, url, index) => {
+ const {
+ hrmImportCommon
+ } = this.props, {
+ importDialog
+ } = hrmImportCommon, {
+ templetName,
+ selectedValue,
+ } = importDialog;
+
+ let p;
+ if (index == 0) {
+ let dom = this.getTempletElement(url, selectedValue, templetName);
+ p = ({getLabel(383083, '请先下载模板')}:{dom}
);
+ } else {
+ p = ({val}
);
+ }
+ return p;
+ }
+
+ getTempletElement = (url, selectedValue, templetName) => {
+ const {
+ importDialog
+ } = this.props.hrmImportCommon, {
+ form
+ } = importDialog;
+
+ const keyField = form.getFormParams().keyField;
+ let dom;
+ let urlArr = url.split(';');
+ if (urlArr.length > 1) {
+ if (keyField == 'workcode') {
+ dom = {templetName};
+ } else {
+ dom = {templetName};
+ }
+ } else {
+ dom = {templetName};
+ }
+ return dom
+ }
+
+ handleUploading = (status) => {
+ this.setState({
+ upStatus: status
+ });
+
+ if (status == 'uploading') {
+ this.setState({
+ list: []
+ });
+ }
+ }
+
+ getButtons = () => {
+ const {
+ hrmImportCommon
+ } = this.props, {
+ submitExcel,
+ queryRecord,
+ importDialog,
+ } = hrmImportCommon, {
+ upStatus
+ } = this.state;
+
+ return [
+ (),
+ (),
+ ()
+ ];
+ }
+
+ render() {
+ const {
+ hrmImportCommon
+ } = this.props, {
+ importDialog,
+ resultDialog,
+ recordDialog,
+ setImportDialogVisible
+ } = hrmImportCommon, {
+ visible,
+ title,
+ loading
+ } = importDialog, {
+ width,
+ height,
+ } = this.state;
+
+ return (
+
+ setImportDialogVisible(false) }
+ buttons={this.getButtons()}
+ style={{width: width, height: height}}
+ onChangeHeight={(h) => this.setState({height: h})}
+ >
+
+
+ {this.getForm()}
+
+
+
+ {resultDialog.visible && }
+ {recordDialog.visible && }
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/hrm/otherSetting/FormInfo.js b/pc4backstage/pc4public/hrm/otherSetting/FormInfo.js
new file mode 100644
index 0000000..f3494e1
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/otherSetting/FormInfo.js
@@ -0,0 +1,110 @@
+import {
+ inject,
+ observer,
+} from 'mobx-react'
+import {
+ toJS
+} from 'mobx'
+import {
+ WeaFormItem,
+ WeaLocaleProvider
+} from 'ecCom'
+import {
+ Spin,
+ Button
+} from 'antd'
+import {
+ WeaSwitch
+} from 'comsMobx'
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject('hrmOtherSetting')
+@observer
+export default class OtherSetting extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ componentDidMount() {
+ const {
+ hrmOtherSetting
+ } = this.props, {
+ getFormInfo
+ } = hrmOtherSetting;
+
+ getFormInfo();
+ }
+
+ componentWillUnmount() {
+ const {
+ hrmOtherSetting
+ } = this.props, {
+ refreshFormInfo
+ } = hrmOtherSetting;
+
+ refreshFormInfo();
+ }
+
+ getForm = () => {
+ const {
+ hrmOtherSetting
+ } = this.props, {
+ formInfo,
+ synchro,
+ hasSynchroRight,
+ } = hrmOtherSetting, {
+ form,
+ conditions,
+ } = formInfo, {
+ isFormInit,
+ } = form;
+
+ let arr = [];
+ isFormInit && conditions.map(c => {
+ const len = c.items.length;
+ c.items.map((field, index) => {
+ const {
+ domkey
+ } = field;
+
+ arr.push( 1) ? 8 : 9}}
+ wrapperCol={{span: 8}}
+ error={form.getError(field)}
+ tipPosition="bottom"
+ style={(index == 0) ? {marginTop:30} : {}}
+ >
+
+ {
+ (domkey[0] === 'defaultLinkMode' && hasSynchroRight) && (
+
+
)
+ }
+ )
+ })
+ })
+ return {arr}
+ }
+
+ render() {
+ const {
+ hrmOtherSetting,
+ } = this.props, {
+ formInfo,
+ } = hrmOtherSetting, {
+ date,
+ loading,
+ } = formInfo;
+
+ return (
+ {loading ?
+
+
+ :
+ {this.getForm()}
+
+ }
+
)
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/hrm/otherSetting/index.js b/pc4backstage/pc4public/hrm/otherSetting/index.js
new file mode 100644
index 0000000..2c26bb3
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/otherSetting/index.js
@@ -0,0 +1,84 @@
+import React from 'react'
+import {
+ toJS
+} from 'mobx'
+import {
+ inject,
+ observer,
+} from 'mobx-react'
+import {
+ WeaAlertPage,
+} from 'ecCom'
+import {
+ Spin,
+} from 'antd'
+import {
+ i18n
+} from '../i18n';
+import FormInfo from './FormInfo';
+import '../style/otherSetting.less'
+
+@inject('hrmOtherSetting')
+@observer
+export default class OtherSetting extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ componentDidMount() {
+ const {
+ hrmOtherSetting
+ } = this.props, {
+ getAuth
+ } = hrmOtherSetting;
+
+ getAuth();
+ }
+
+ componentWillUnmount() {
+ const {
+ hrmOtherSetting
+ } = this.props, {
+ closeAuth
+ } = hrmOtherSetting;
+
+ closeAuth();
+ }
+
+ render() {
+ const {
+ hrmOtherSetting
+ } = this.props, {
+ main,
+ } = hrmOtherSetting, {
+ authorized,
+ loading
+ } = main;
+
+ if (!authorized) {
+ return (
+
+ {loading ?
+
+
+ :
+
+
+ {i18n.message.authFailed()}
+
+
+
+ }
+
+ )
+ } else {
+ return (
+
+
+
+ )
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/hrm/style/import.css b/pc4backstage/pc4public/hrm/style/import.css
new file mode 100644
index 0000000..3bcd8fc
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/style/import.css
@@ -0,0 +1,64 @@
+.hrm-import-wrap{
+ width: 90%;
+ height: 100%;
+ margin-left: 5%;
+ padding-top: 30px;
+}
+
+.hrm-import-table-th .ant-table-tbody>tr>td, .ant-table-thead>tr>th{
+ padding: 8px 8px;
+ color: #666;
+}
+
+.hrm-import-table-th .ant-table-thead>tr>th{
+ background-color: #F0F6F6;
+}
+
+.hrm-import-table-th .ant-table{
+ border-radius: 0;
+}
+
+.hrm-import-table-th .ant-table table{
+ border-radius: 0;
+}
+
+.hrm-import-loading .ant-spin.ant-spin-show-text .ant-spin-text{
+ float: right;
+ margin-left: 20px;
+ padding-top: 2px
+}
+
+.hrm-import-error-tip{
+ width: 30px;
+ height: 30px;
+ border-radius: 25px;
+ padding: 6px;
+ margin-left: 230px;
+ margin-right: 10px;
+ display: inline-block;
+ background-color: rgb(255, 0, 0);
+}
+
+.hrm-import-ant-table .ant-table-tbody>tr>td, .ant-table-thead>tr>th{
+ padding: 8px 8px;
+}
+
+.hrm-import-link{
+ color: #B4B4B4;
+}
+
+.hrm-import-link:hover{
+ color: #FFF;
+}
+
+.hrm-import-circle{
+ width: 20px;
+ height: 20px;
+ padding-left: 6px;
+ background-color: #D8D8D8;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ -ms-border-radius: 10px;
+ -o-border-radius: 10px;
+ border-radius: 10px;
+}
diff --git a/pc4backstage/pc4public/hrm/style/otherSetting.less b/pc4backstage/pc4public/hrm/style/otherSetting.less
new file mode 100644
index 0000000..8b1dae7
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/style/otherSetting.less
@@ -0,0 +1,18 @@
+.otherSetting{
+ .wea-select{
+ width: auto !important;
+
+ .wea-helpful-tip{
+ right: auto !important;
+ }
+ }
+ .wea-switch {
+ .wea-helpful-tip{
+ right: -30px !important;
+ }
+ }
+ .synchro{
+ display: inline;
+ margin-left: 25px;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/hrm/uploadAvatar/index.js b/pc4backstage/pc4public/hrm/uploadAvatar/index.js
new file mode 100644
index 0000000..a4195ee
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/uploadAvatar/index.js
@@ -0,0 +1,75 @@
+import { Icon } from 'antd';
+import isEmpty from 'lodash/isEmpty';
+import { WeaUpload } from 'ecCom';
+import isArray from 'lodash/isArray';
+import './index.less';
+import { i18n } from '../../../pc4mobx/hrm/public/i18n';
+
+class Main extends React.Component {
+ static defaultProps={
+ tip: i18n.label.pictureSizeSuggestedInfo,
+ }
+ constructor(props) {
+ super(props);
+ this.state = {
+ value: props.value || '',
+ };
+ }
+ componentWillReceiveProps(nextProps) {
+ if ('value' in this.props && this.state.value !== nextProps.value) {
+ this.setState({ value: nextProps.value });
+ }
+ }
+ close() {
+ let { domkey } = this.props;
+ this.setState({ value: '' });
+ this.props.onChange && this.props.onChange('', domkey);
+ }
+ onChange(id, datas) {
+ let { domkey } = this.props; // 每个WeaSwitch的key
+ let value = '';
+ if (isArray(datas) && !isEmpty(datas)) {
+ let data = datas.pop();
+ value = data.fileidCode;
+ } else {
+ value = datas.fileidCode;
+ }
+ this.setState({ value });
+ this.props.onChange && this.props.onChange(value, domkey);
+ }
+ render() {
+ const { tip, nohelpful } = this.props;
+ const { value } = this.state;
+ return (
+
+ {
+ isEmpty(value) &&
+
+
+
+
+ {
+ nohelpful ? '' // 需不需要后面的提示
+ :
+ ({`${tip()}400*600`})
+ }
+
+ }
+ {
+ !isEmpty(value) &&
+
+

+
+
+ }
+
+ );
+ }
+}
+export default Main;
diff --git a/pc4backstage/pc4public/hrm/uploadAvatar/index.less b/pc4backstage/pc4public/hrm/uploadAvatar/index.less
new file mode 100644
index 0000000..2fbad6a
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/uploadAvatar/index.less
@@ -0,0 +1,42 @@
+.hrm-upload-avatar {
+ padding: 10px 0;
+
+ .icon-coms-AddTo {
+ font-size: 50px;
+ cursor:pointer;
+ }
+
+ .hrm-upload-wrapper {
+ position: relative;
+ .tip {
+ position: absolute;
+ top: 50%;
+ left: 70px;
+ margin-top: -6px;
+ }
+ }
+
+ .hrm-avatar {
+ position: relative;
+ // width: 250px;
+ cursor:pointer;
+
+ img {
+ width: 100%;
+ }
+
+ .anticon-cross-circle-o {
+ position: absolute;
+ font-size: 18px;
+ top: -9px;
+ right: -9px;
+ color: #fff;
+ background-color: #4CB1FC;
+ border-radius: 9px;
+
+ &:hover {
+ background-color: red;
+ }
+ }
+ }
+}
diff --git a/pc4backstage/pc4public/hrm/util/pure-util.js b/pc4backstage/pc4public/hrm/util/pure-util.js
new file mode 100644
index 0000000..414aad5
--- /dev/null
+++ b/pc4backstage/pc4public/hrm/util/pure-util.js
@@ -0,0 +1,35 @@
+const IEVersion = () => {
+ let userAgent = navigator.userAgent; // 取得浏览器的userAgent字符串
+ let isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1; // 判断是否IE<11浏览器
+ let isEdge = userAgent.indexOf('Edge') > -1 && !isIE; // 判断是否IE的Edge浏览器
+ let isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
+ if (isIE) {
+ let reIE = new RegExp('MSIE (\\d+\\.\\d+);');
+ reIE.test(userAgent);
+ let fIEVersion = parseFloat(RegExp.$1);
+ if (fIEVersion == 7) {
+ return 7;
+ } else if (fIEVersion == 8) {
+ return 8;
+ } else if (fIEVersion == 9) {
+ return 9;
+ } else if (fIEVersion == 10) {
+ return 10;
+ }
+ return 6; // IE版本<=7
+ } else if (isEdge) {
+ return 'edge'; // edge
+ } else if (isIE11) {
+ return 11; // IE11
+ }
+ return -1; // 不是ie浏览器
+};
+
+const jumpToHrmCard = (id) => {
+ window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${id}`);
+};
+
+export {
+ IEVersion,
+ jumpToHrmCard,
+};
diff --git a/pc4backstage/pc4public/index.js b/pc4backstage/pc4public/index.js
new file mode 100644
index 0000000..61879ca
--- /dev/null
+++ b/pc4backstage/pc4public/index.js
@@ -0,0 +1,36 @@
+/*
+ * @Descripttion:
+ * @version:
+ * @Author: kl2018
+ * @Date: 2020-06-28 09:19:35
+ * @LastEditors: kl2018
+ * @LastEditTime: 2020-08-06 14:08:09
+ */
+import {
+ Route,
+} from 'react-router';
+
+// 个性化设置
+import WeaCustomSetting from './common/wea-custom-setting/';
+import WeaHrmGroup from './hrm/hrm-group/';
+// 个性化设置
+import store from './stores/';
+
+import {
+ WeaLocaleProvider,
+} from 'ecCom';
+
+const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'hrm,customsetting,portal,odoc');
+
+const CustomSettingRoute = (
+
+);
+
+module.exports = {
+ Route: CustomSettingRoute,
+ store,
+ com: {
+ WeaCustomSetting,
+ WeaHrmGroup,
+ },
+};
diff --git a/pc4backstage/pc4public/message/index.js b/pc4backstage/pc4public/message/index.js
new file mode 100644
index 0000000..e998906
--- /dev/null
+++ b/pc4backstage/pc4public/message/index.js
@@ -0,0 +1,63 @@
+// react
+import React from 'react';
+import { render } from 'react-dom';
+// react-router
+import { createHashHistory } from 'History';
+import { Router, Route, useRouterHistory, IndexRedirect } from 'react-router';
+// mobx
+import { Provider } from 'mobx-react';
+// mobx-react-router
+import { syncHistoryWithStore, RouterStore } from 'mobx-react-router';
+
+import { WeaForm } from 'comsMobx';
+import { WeaAlertPage, WeaLocaleProvider, WeaTools } from 'ecCom';
+
+// components
+import Entrance from './router/Entrance';
+// import Content from "./router/Content"
+
+const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'common');
+// style
+import './style';
+
+// stores
+const routing = new RouterStore();
+const stores = {
+ routing,
+ weaFormStore: new WeaForm(),
+};
+
+const browserHistory = useRouterHistory(createHashHistory)({
+ queryKey: '_key',
+ basename: '/',
+});
+
+const history = syncHistoryWithStore(browserHistory, stores.routing);
+
+const AuthPage = () => (
+
+ 对不起,您暂时没有权限!
+
+);
+
+const onEnter = (nextState, replace, callback) => {
+ window.ssoChecked = false;
+ WeaTools.checkSSO('', false).then(() => {
+ getLocaleLabel(nextState, replace, callback);
+ });
+};
+const Root = () => (
+
+
+
+ {/* */}
+
+
+
+);
+
+try {
+ render(, document.getElementById('container'), () => { });
+} catch (e) {
+ window.console ? console.log('出错了: ', e) : alert(`出错了:${e}`);
+}
diff --git a/pc4backstage/pc4public/message/router/Content.js b/pc4backstage/pc4public/message/router/Content.js
new file mode 100644
index 0000000..606df55
--- /dev/null
+++ b/pc4backstage/pc4public/message/router/Content.js
@@ -0,0 +1,51 @@
+import React from 'react';
+import { Modal, Spin } from 'antd';
+import {
+ WeaLocaleProvider,
+ WeaDialog,
+ WeaBrowser,
+ WeaTools,
+} from 'ecCom';
+import loadjs from 'loadjs';
+import { Button } from 'antd';
+import $ from '$';
+
+export default class Home extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ };
+ }
+
+ getFrameParams() {
+ let url = window.location.href;
+ if (window.frameElement) {
+ url = window.frameElement.src;
+ }
+ let urlParams = url.slice(url.indexOf('?') + 1).split('&');
+ let params = [];
+ urlParams.forEach((element) => {
+ let datas = element.split('=');
+ params[datas[0]] = datas[1];
+ });
+ let host = url.slice(0, url.indexOf('/spa/'));
+ params.host = host;
+ return params;
+ }
+
+ componentDidMount() {
+ }
+
+ componentWillUnmount() {
+ }
+
+ render() {
+ return (
+
+
+
+ );
+ }
+}
+
diff --git a/pc4backstage/pc4public/message/router/Entrance.js b/pc4backstage/pc4public/message/router/Entrance.js
new file mode 100644
index 0000000..c66b4a0
--- /dev/null
+++ b/pc4backstage/pc4public/message/router/Entrance.js
@@ -0,0 +1,539 @@
+import React from 'react';
+import { Icon, Row, Col, Button, Pagination } from 'antd';
+import {
+ WeaLocaleProvider,
+ WeaNewScroll,
+ WeaTools,
+ WeaDialog,
+ WeaTab,
+ WeaInput,
+ WeaDatePicker
+} from 'ecCom';
+import { WeaMessageCenter } from 'comsMobx';
+import '../style/search.css';
+
+const SingleMessage = WeaMessageCenter.SingleMessage;
+const getLabel = WeaLocaleProvider.getLabel;
+
+export default class Entrance extends React.Component {
+ constructor(props) {
+ super(props);
+
+ const params = this.getFrameParams();
+
+ this.state = {
+ syncComponent: () => null,
+ msgList: [],
+ refresh: false,
+ loading: true,
+ tabFlag: '0',
+ tabData: [],
+ tabSelectedKey: '0',
+ msgid: '0',
+ current: '0',
+ maxtime: '0',
+ mintime: '0',
+ newGetMsgList: [],
+ typeId: params.typeId,
+
+ searchDialogVisible: false,
+ searchParams: {
+ searchValue: "",
+ fromDate: "",
+ toDate: "",
+ pageSize: 20,
+ page: 1
+ },
+ searchListDatas: [],
+ searchListTotal: '',
+ showHighLight: false,
+ searchLoading: false,
+ changePage: 1
+ };
+
+ this.searchListScroll = null;
+ this.getMsgList = this.getMsgList.bind(this);
+ this.getMsgTypeTabs = this.getMsgTypeTabs.bind(this);
+ }
+
+ componentDidMount() {
+ let params = { id: this.state.typeId };
+
+ this.getMsgTypeTabs(params);
+
+ if (window.em) {
+ em.ready(() => {
+ em.pageVisible((visible) => {
+ if (visible) {
+ this.setState({ refresh: true }, () => {
+ this.getMsgList(0, 0, 0,
+ () => {
+ WeaTools.callApi('/api/msgcenter/homepage/setMsgRead', 'GET', params);
+ }, true, true, true);
+ });
+ }
+ });
+ });
+ } else {
+ console && console.log('em未加载');
+ }
+ }
+
+ getMsgTypeTabs(params) {
+ const { tabData, typeId, current, msgid, mintime, tabSelectedKey } = this.state;
+ let typeParams = { typeId };
+ WeaTools.callApi('/api/msgcenter/homepage/GetMsgTypeTabs', 'GET', typeParams).then((res) => {
+ if (res.datas.length) {
+ let datas = JSON.parse(
+ JSON.stringify(res.datas)
+ .replace(/id/g, 'viewcondition')
+ .replace(/tabName/g, 'title'),
+ );
+ this.setState({
+ tabData: datas,
+ tabFlag: '1',
+ tabSelectedKey: datas[0].viewcondition,
+ });
+ }
+ }).finally(() => {
+ this.getMsgList(
+ tabData.length ? tabSelectedKey : current,
+ msgid,
+ mintime,
+ () => {
+ this.scroll.refs.weaBaron.scrollToLast();
+ WeaTools.callApi('/api/msgcenter/homepage/setMsgRead', 'GET', params);
+ },
+ false, false, true,
+ );
+ });
+ }
+
+ uniqueByKey = (arr,u_key) => {
+ let map = new Map()
+ arr.forEach(item => {
+ if (!map.has(item[u_key])){
+ map.set(item[u_key],item)
+ }
+ })
+ return [...map.values()]
+ }
+
+ getMsgList(
+ index,
+ msgid1,
+ mintime1,
+ cb,
+ scroll = false,
+ isUpdateMaxTime = true,
+ isInit = false,
+ ) {
+ let bizstate = '';
+ // 有分页
+ if (this.state.tabFlag === '1') {
+ this.state.tabData.forEach((item) => {
+ if (
+ item.viewcondition === this.state.tabSelectedKey &&
+ item.msgStateId
+ ) {
+ bizstate = item.msgStateId;
+ }
+ });
+ }
+
+ this.setState({ loading: true });
+ let params = {
+ id: index,
+ pagesize: 20,
+ msgid: msgid1,
+ mintime: mintime1,
+ bizstate,
+ ismobile: 1,
+ };
+
+ if (this.state.typeId) {
+ params.typeId = this.state.typeId;
+ }
+
+ params.selectState = '';
+ if (this.state.tabData.length && params.bizstate) {
+ const filterSelect = this.state.tabData.filter(item => item.msgStateId === params.bizstate);
+
+ params.selectState = filterSelect[0] ? filterSelect[0].selectState : '';
+ }
+
+ WeaTools.callApi('/api/msgcenter/homepage/getMsgList', 'POST', params).then((res) => {
+ if (res.data) {
+ let msgList = [];
+ let allKeyArr = [];
+
+ if (isInit && res.data.length === 0) {
+ if (this.state.tabFlag === '1') {
+ this.state.tabData.forEach((item) => {
+ if (!item.msgStateId) {
+ allKeyArr.push(item.viewcondition);
+ }
+ });
+ this.setState({ tabSelectedKey: allKeyArr[0] || this.state.tabData[0].viewcondition }, () => {
+ this.getMsgList(this.state.tabSelectedKey, msgid1, mintime1, cb, scroll, isUpdateMaxTime);
+ });
+ }
+ this.setState({ loading: false });
+ return;
+ }
+
+ if (this.state.refresh) {
+ msgList = res.data.length > 0 ? res.data : [];
+ } else {
+ msgList = [...res.data, ...this.state.msgList];
+ }
+
+ setTimeout(() => {
+ this.setState({ loading: false });
+ }, 300);
+ this.setState({
+ mintime: res.mintime,
+ msgid: res.msgid,
+ refresh: false,
+ newGetMsgList: res.data,
+ msgList: this.uniqueByKey(msgList, 'messageid')
+ }, () => {
+ if (scroll) {
+ const msgNode = document.getElementsByClassName('wea-messageCenter-singleItem');
+ let scrollHeight = 0;
+
+ if (msgNode && msgNode.length > 0 && res.data.length > 0) {
+ for (let i = 0; i < res.data.length; i++) {
+ scrollHeight += msgNode[i].offsetHeight;
+ }
+ }
+
+ // console.log(this.scroll.refs);
+ window.scroll = this.scroll;
+ window.scroll.refs.weaBaron.getScroller().scrollTop = scrollHeight;
+ // this.scroll.refs.weaBaron.scroll(4000);
+ }
+ });
+
+ if (isUpdateMaxTime) {
+ this.setState({
+ maxtime: res.maxtime,
+ });
+ }
+ if (cb && typeof cb === 'function') {
+ cb(res);
+ }
+ // this.getMsgCount(this.state.mintime);
+ }
+ });
+ }
+
+ getFrameParams() {
+ let url = window.location.href;
+ try {
+ if (window.frameElement) {
+ url = window.frameElement.src;
+ }
+ } catch (error) {
+
+ }
+ let urlParams = url.slice(url.indexOf('?') + 1).split('&');
+ let params = [];
+ urlParams.forEach((element) => {
+ let datas = element.split('=');
+ params[datas[0]] = datas[1];
+ });
+ let host = url.slice(0, url.indexOf('/spa/'));
+ params.host = host;
+ return params;
+ }
+
+ updateSyncCom(com) {
+ this.setState(
+ {
+ syncComponent: com,
+ },
+ () => {
+ this.forceUpdate();
+ },
+ );
+ }
+
+ getSearchMsgList = (pageSet = false) => {
+ const { searchParams, typeId: id, changePage } = this.state;
+
+ this.setState({
+ searchLoading: true,
+ searchParams: {
+ ...searchParams,
+ page: pageSet ? changePage : 1,
+ },
+ changePage: pageSet ? changePage : 1,
+ });
+
+ WeaTools.callApi("/api/msgcenter/homepage/getSearchMsgList", "POST", { ...searchParams, id, page: pageSet ? changePage : 1 }).then(res => {
+ if (res.status) {
+ this.setState({
+ searchListDatas: res.data,
+ searchListTotal: res.count,
+ showHighLight: true
+ }, () => {
+ this.setState({ searchLoading: false });
+ setTimeout(() => {
+ this.searchListScroll &&
+ this.searchListScroll.refs.weaBaron.scrollToLast()
+ }, 100);
+ });
+ }
+ });
+ };
+
+ renderDialog = () => {
+ const { searchDialogVisible, searchParams, searchListDatas, searchListTotal, showHighLight, searchLoading } = this.state;
+ const cls = "wea-messageCenter-search-dialog";
+ return (
+ this.setState({ searchDialogVisible: false })}
+ hasScroll
+ >
+
+
+
+
+ {
+ this.setState({
+ searchParams: { ...searchParams, title: value },
+ showHighLight: false,
+ changePage: 1
+ });
+ }}
+ />
+
+
+
+
+
+ this.setState({
+ searchParams: { ...searchParams, fromDate: value },
+ changePage: 1
+ })
+ }
+ />
+
+
+
+ this.setState({
+ searchParams: { ...searchParams, toDate: value },
+ changePage: 1
+ })
+ }
+ />
+
+
+
+
+
+
+
+
+ {
+ searchLoading ? (
+
+ ) : (
+ Array.isArray(searchListDatas) && searchListDatas.length > 0 ? (
+
+ {
+ this.searchListScroll = e;
+ }}
+ height={430}
+ >
+
+ {searchListDatas.map(data => {
+ return (
+
+ );
+ })}
+
+
+ `${getLabel("83698", "共")}${searchListTotal}${getLabel(
+ "128218",
+ "条"
+ )}`}
+ pageSize={searchParams.pageSize}
+ current={searchParams.page}
+ defaultCurrent={searchParams.page}
+ onShowSizeChange={(page, pageSize) =>
+ this.setState(
+ { searchParams: { ...searchParams, page, pageSize }, changePage: page },
+ () => this.getSearchMsgList()
+ )
+ }
+ onChange={v =>
+ this.setState(
+ { searchParams: { ...searchParams, page: v }, changePage: v },
+ () => this.getSearchMsgList(true)
+ )
+ }
+ />
+
+ ) : (
+
{getLabel("529411", "暂无匹配消息数据")}
+ )
+ )
+ }
+
+
+ );
+ };
+
+ render() {
+ return (
+
+
+
+
+ {
+ this.setState({ tabSelectedKey: v, refresh: true }, () => {
+ this.getMsgList(this.state.current, 0, 0, null, true);
+ });
+ }}
+ buttons={[
+
+ this.setState({
+ searchDialogVisible: true,
+ searchParams: {
+ title: '',
+ fromDate: "",
+ toDate: "",
+ pageSize: 20,
+ page: 1
+ },
+ changePage: 1
+ }, () => {
+ this.getSearchMsgList()
+ setTimeout(() => {
+ const doms = document.getElementsByClassName('wea-messageCenter-search-dialog')
+ if(doms[0]) {
+ doms[0].style.zIndex = '999999 !important'
+ }
+ }, 1000)
+ })
+ }
+ />
+ ]}
+ />
+
+
(this.scroll = e)}
+ height={'100%'}
+ >
+ {this.state.msgList.length === 0 && !this.state.loading ? (
+
+
+
+
+
+
+ {getLabel(502494, '暂无消息')}
+
+
+ ) : (
+
+
+ {this.state.loading ? (
+
+ ) : (
+
+ {this.state.newGetMsgList.length > 2 ? (
+ {
+ this.getMsgList(
+ this.state.current,
+ this.state.msgid,
+ this.state.mintime,
+ null,
+ true,
+ false,
+ );
+ }}
+ >
+
+ {getLabel(384653, '点击加载更多')}
+
+ ) : (
+ {getLabel(390064, '没有更多啦')}
+ )}
+
+ )}
+
+
+ )}
+ {this.state.msgList.length > 0 &&
+ this.state.msgList.map(data => (
+ this.updateSyncCom(com)}
+ />
+ ))}
+
+
+ {this.renderDialog()}
+
+ );
+ }
+}
+
diff --git a/pc4backstage/pc4public/message/style/index.js b/pc4backstage/pc4public/message/style/index.js
new file mode 100644
index 0000000..5b98c49
--- /dev/null
+++ b/pc4backstage/pc4public/message/style/index.js
@@ -0,0 +1,2 @@
+const req = require.context('./', true, /^\.\/\w+\.less$/);
+req.keys().forEach(path => req(path));
diff --git a/pc4backstage/pc4public/message/style/index.less b/pc4backstage/pc4public/message/style/index.less
new file mode 100644
index 0000000..0439bdf
--- /dev/null
+++ b/pc4backstage/pc4public/message/style/index.less
@@ -0,0 +1,118 @@
+html,
+body,
+#container {
+ overflow: hidden;
+ width: 100%;
+ height: 100%;
+ background-color: #f3f7fe;
+
+ .wea-message-entrance {
+ width: 100%;
+ height: 100%;
+
+ //padding-left: 30px;
+ padding-bottom: 12px;
+
+ .wea-messageCenter-singleItem {
+ //margin-right: 30px;
+ }
+
+ &.has-tab {
+ padding-top: 48px;
+ }
+
+ .sticky-top-tab {
+ position: absolute;
+ z-index: 9999;
+ margin-right: -30px;
+ background: #fff;
+ width: 100%;
+ top: 0;
+ }
+
+ .click-look-more {
+ margin-top: 10px;
+ text-align: center;
+ color: #00a9ff;
+ span {
+ font-size: 14px;
+ }
+ a {
+ margin-left: 5px;
+ color: #00a9ff;
+ font-size: 12px;
+ }
+ .no-more {
+ font-size: 12px;
+ color: #9e9f9f;
+ position: relative;
+ &::after,
+ &::before {
+ content: " ";
+ display: block;
+ width: 100px;
+ height: 1px;
+ position: absolute;
+ top: 9px;
+ background: #9e9f9f;
+ left: -112px;
+ opacity: 0.5;
+ }
+ &::after {
+ left: 70px;
+ }
+ }
+ }
+ }
+
+ .wea-messageCenter-search-dialog {
+ z-index: 999999;
+ .ant-modal-header{
+ .prel {
+ .wea-dialog-icon {
+ display: none;
+ }
+ .text-elli {
+ padding-left: 0 !important;
+ }
+ }
+ }
+ &-content {
+ text-align: center;
+ &-search {
+ margin: 10px 40px;
+ .ant-input {
+ max-height: 30px;
+ }
+ .ant-col-6 {
+ .wea-input-normal {
+ width: 100% !important;
+ }
+ }
+ }
+ &-list {
+ //max-height: 430px;
+ //overflow: scroll;
+ }
+ &-nodata {
+ margin-top: 10%;
+ text-align: center;
+ font-size: 13px;
+ color: #7e8181;
+ }
+ .ant-pagination {
+ display: inline-block;
+ margin-top: 15px;
+ }
+ .anticon-loading {
+ margin-top: 15%;
+ font-size: 25px;
+ color: #268ac7;
+ }
+ }
+ }
+}
+
+.wea-messageCenter-search-dialog {
+ z-index: 999999;
+}
diff --git a/pc4backstage/pc4public/message/style/search.css b/pc4backstage/pc4public/message/style/search.css
new file mode 100644
index 0000000..7f27745
--- /dev/null
+++ b/pc4backstage/pc4public/message/style/search.css
@@ -0,0 +1,3 @@
+.wea-messageCenter-search-dialog {
+ z-index: 999999;
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/odoc/privateGroupSetingComponent.js b/pc4backstage/pc4public/odoc/privateGroupSetingComponent.js
new file mode 100644
index 0000000..36f9e86
--- /dev/null
+++ b/pc4backstage/pc4public/odoc/privateGroupSetingComponent.js
@@ -0,0 +1,147 @@
+import React, { Component, Fragment } from 'react';
+import { observer, inject } from 'mobx-react';
+import { WeaDialog, WeaLocaleProvider } from 'ecCom';
+import { WeaTableNew, WeaLogView } from 'comsMobx';
+import { Button } from 'antd';
+import { toJS } from 'mobx';
+
+
+import './style/publicGroup.less';
+
+const { getLabel } = WeaLocaleProvider;
+const { WeaTable } = WeaTableNew;
+const WeaLogViewComp = WeaLogView.Component;
+
+@inject('odoc_privateGroupStore')
+@observer
+class PrivateGroupSetingComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.getDropMenuDatas = this.getDropMenuDatas.bind(this);
+ this.getTopBtn = this.getTopBtn.bind(this);
+ }
+
+ componentDidMount () {
+ const { odoc_privateGroupStore } = this.props;
+ odoc_privateGroupStore.getTableData();
+ // odoc_privateGroupStore.getCommReceiveItems();
+ // odoc_privateGroupStore.getPrivateReceiveLogType();
+
+ // 高级搜索
+ odoc_privateGroupStore.getPanelForm();
+ odoc_privateGroupStore.odoConditionForm.reset();
+ }
+ componentWillUnmount () {
+ const { odoc_privateGroupStore } = this.props;
+ odoc_privateGroupStore.rowSelection([]);
+ }
+
+ render () {
+ const { odoc_privateGroupStore } = this.props;
+ const { tableStore, selectedRowKeys, logVisible, logStore, logType, logSmallType, creatDialogVisible, odocForm,
+ loading, isCreat, onOperatesClick, creatDialogHide, onCheck, rowSelection,
+ logHide, clickRowKey } = odoc_privateGroupStore;
+ const dialogTitle = isCreat ? getLabel(390079, '新建私人组') : getLabel(390315, '编辑私人组');
+ return (
+
+
+ this.getColumns(cols)}
+ rowSelection={{
+ selectedRowKeys,
+ onChange: rowSelection,
+ }}
+ onOperatesClick={onOperatesClick}
+ />
+ logHide()}
+ logStore={logStore}
+ logType={logType}
+ logSmallType={logSmallType}
+ targetId={clickRowKey}
+ />
+
+ creatDialogHide()}
+ draggable={true}
+ maskClosable={true}
+ style={{ width: 500 }}
+ className="publicGroupDialogForm"
+ buttons={[]}
+ >
+ {odocForm.render()}
+
+
+
+
+
+ );
+ }
+
+ getTopBtn () {
+ const { creatDialogShow, selectedRowKeys, loading, showConfirm } = this.props.odoc_privateGroupStore;
+ const disabled = !(toJS(selectedRowKeys).length > 0);
+ const btns = [
+ ,
+ ,
+ ];
+ return btns;
+ }
+
+ getDropMenuDatas () {
+ const { creatDialogShow, selectedRowKeys, logShow, showConfirm } = this.props.odoc_privateGroupStore;
+ const disabled = !(selectedRowKeys.length > 0);
+ const dropMenuDatas = [
+ {
+ key: '1',
+ disabled: false,
+ icon: ,
+ content: getLabel('365', '新建'),
+ onClick: () => creatDialogShow(),
+ },
+ {
+ key: '2',
+ disabled,
+ icon: ,
+ content: getLabel(32136, '批量删除'),
+ onClick: () => showConfirm(),
+ },
+ {
+ key: '3',
+ disabled: false,
+ icon: ,
+ content: '日志',
+ onClick: () => logShow(),
+ },
+ ];
+ return dropMenuDatas;
+ }
+
+ // 自定义列
+ getColumns (columns) {
+ const { onOperatesClick } = this.props.odoc_privateGroupStore;
+ return columns.map((col) => {
+ if (col.dataIndex == 'receiveunitname') {
+ return {
+ ...col,
+ title: col.title,
+ render (text, record) {
+ return (
+ onOperatesClick(record, '', '', '0')}>{text}
+ );
+ },
+ };
+ }
+ return col;
+ });
+ }
+}
+
+export default PrivateGroupSetingComponent;
diff --git a/pc4backstage/pc4public/odoc/style/publicGroup.less b/pc4backstage/pc4public/odoc/style/publicGroup.less
new file mode 100644
index 0000000..f6ad226
--- /dev/null
+++ b/pc4backstage/pc4public/odoc/style/publicGroup.less
@@ -0,0 +1,11 @@
+.publicGroupDialogForm{
+ .ant-col-12{
+ width: 100%;
+ }
+ .ant-modal-footer{
+ height: 60px;
+ }
+ .ant-table-body{
+ max-height: 380px !important;
+ }
+}
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.editorconfig b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.editorconfig
new file mode 100644
index 0000000..604c94e
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.editorconfig
@@ -0,0 +1,9 @@
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*.{js,css}]
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 2
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.gitignore b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.gitignore
new file mode 100644
index 0000000..7e996ee
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.gitignore
@@ -0,0 +1,30 @@
+*.iml
+*.log
+.idea/
+.ipr
+.iws
+*~
+~*
+*.diff
+*.patch
+*.bak
+.DS_Store
+Thumbs.db
+.project
+.*proj
+.svn/
+*.swp
+*.swo
+*.pyc
+*.pyo
+.build
+node_modules
+.cache
+dist
+assets/**/*.css
+build
+lib
+es
+coverage
+yarn.lock
+package-lock.json
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.travis.yml b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.travis.yml
new file mode 100644
index 0000000..cc34e2a
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/.travis.yml
@@ -0,0 +1,32 @@
+language: node_js
+
+sudo: false
+
+notifications:
+ email:
+ - yiminghe@gmail.com
+
+node_js:
+- 6.0.0
+
+before_install:
+- |
+ if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
+ then
+ echo "Only docs were updated, stopping build process."
+ exit
+ fi
+ npm install npm@3.x -g
+ phantomjs --version
+script:
+- |
+ if [ "$TEST_TYPE" = test ]; then
+ npm test
+ else
+ npm run $TEST_TYPE
+ fi
+env:
+ matrix:
+ - TEST_TYPE=lint
+ - TEST_TYPE=test
+ - TEST_TYPE=coverage
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/HISTORY.md b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/HISTORY.md
new file mode 100644
index 0000000..2d6aa60
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/HISTORY.md
@@ -0,0 +1,92 @@
+# History
+----
+## 7.0.2 / 2018-05-03
+
+- Better aria-* attributes support.
+- Improve Menu performance by avoiding unnecessary updates.
+- Minor key shortcut bug fixes.
+- Support passing props through to MenuItem list item
+
+## 6.0.0 / 2017-10-30
+
+- Replace openSubMenuOnMouseEnter/closeSubMenuOnMouseLeave with triggerSubMenuAction
+- Add subMenuCloseDelay and subMenuOpenDelay
+- Refactor with rc-trigger
+
+## 5.1.0 / 2016-09-12
+
+- Add dom for submenu arrow
+
+## 5.0.0 / 2016-08-19
+
+- remove onOpen/onClose, support onOpenChange(openKeys: string[])
+
+## 4.13.0 / 2016-07-22
+
+- support submenu-selected
+
+## 4.12 / 2016-05-05
+
+- make submenu active only title is hovered when inline
+
+## 4.11.0 / 2016-04-27
+
+- add onMouseEnter/onTitleMouseLeave/onTitleClick/...
+
+## 4.10.0 / 2016-01-20
+
+- use es6 export
+
+## 4.9.0 / 2015-12-25
+- add keyPath to onOpen/onClose argument info
+
+## 4.6.0 / 2015-09-16
+- add keyPath to onClick argument info
+
+## 4.5.0 / 2015-09-14
+- does not hide submenu when click(use onClick to set openKeys to [] if you want)
+
+## 4.4.0 / 2015-08-13
+- add openAnimation/openTransitionName prop
+
+## 4.3.0 / 2015-08-13
+- make selectedKeys openedKeys controllable
+- add closeSubMenuOnMouseLeave/onOpen/onClose props
+
+## 4.1.0 / 2015-08-11
+- remove openOnHover for SubMenu
+- add openSubMenuOnMouseEnter prop for Menu
+
+## 4.0.0 / 2015-08-10
+
+- add props: mode (horizontal, vertical, inline) for Menu
+- add defaultSelectedKeys, make selectedKeys controllable
+- change param of onSelect onDeselect
+
+## 3.5.0 / 2015-08-06
+
+add props: vertical/horizontal for Menu, align for SubMenu
+
+## 3.4.0 / 2015-06-17
+
+`improved` [#9](https://github.com/react-component/menu/issues/9) allow not set key for menuitem
+
+`new` [#10](https://github.com/react-component/menu/issues/10) support MenuItemGroup
+
+## 3.3.0 / 2015-06-08
+
+`new` add Menu.Divider Component
+
+## 3.1.0 / 2015-03-26
+
+`improved` [#5](https://github.com/react-component/menu/issues/5) support selected and disabled for menuitem simultaneously
+
+## 3.0.0 / 2015-03-17
+
+support react 0.13 and es6
+
+## 2.2.0 / 2015-01-29
+
+`new` [#3](https://github.com/react-component/menu/issues/3) support scrollIntoView if menu is scrollable
+
+`new` [#2](https://github.com/react-component/menu/issues/2) support multiple prop and onDeselect callback
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/LICENSE.md b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/LICENSE.md
new file mode 100644
index 0000000..1f5a0d9
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/LICENSE.md
@@ -0,0 +1,9 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-present yiminghe
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/README.md b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/README.md
new file mode 100644
index 0000000..406f798
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/README.md
@@ -0,0 +1,376 @@
+# rc-menu
+---
+
+react menu component. port from https://github.com/kissyteam/menu
+
+
+[![NPM version][npm-image]][npm-url]
+[![build status][travis-image]][travis-url]
+[![Test coverage][coveralls-image]][coveralls-url]
+[![gemnasium deps][gemnasium-image]][gemnasium-url]
+[![node version][node-image]][node-url]
+[![npm download][download-image]][download-url]
+
+[npm-image]: http://img.shields.io/npm/v/rc-menu.svg?style=flat-square
+[npm-url]: http://npmjs.org/package/rc-menu
+[travis-image]: https://img.shields.io/travis/react-component/menu.svg?style=flat-square
+[travis-url]: https://travis-ci.org/react-component/menu
+[coveralls-image]: https://img.shields.io/coveralls/react-component/menu.svg?style=flat-square
+[coveralls-url]: https://coveralls.io/r/react-component/menu?branch=master
+[gemnasium-image]: http://img.shields.io/gemnasium/react-component/menu.svg?style=flat-square
+[gemnasium-url]: https://gemnasium.com/react-component/menu
+[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
+[node-url]: http://nodejs.org/download/
+[download-image]: https://img.shields.io/npm/dm/rc-menu.svg?style=flat-square
+[download-url]: https://npmjs.org/package/rc-menu
+
+
+## Screenshot
+
+
+
+
+## Usage
+
+```jsx
+import Menu, {SubMenu, MenuItem} from 'rc-menu';
+ReactDOM.render(, container);
+```
+
+## install
+
+[](https://npmjs.org/package/rc-menu)
+
+## API
+
+### Menu props
+
+
+
+
+ | name |
+ type |
+ default |
+ description |
+
+
+
+
+ | className |
+ String |
+ |
+ additional css class of root dom node |
+
+
+ | mode |
+ String |
+ vertical |
+ one of ["horizontal","inline","vertical-left","vertical-right"] |
+
+
+ | activeKey |
+ Object |
+ |
+ initial and current active menu item's key. |
+
+
+ | defaultActiveFirst |
+ Boolean |
+ false |
+ whether active first menu item when show if activeKey is not set or invalid |
+
+
+ | multiple |
+ Boolean |
+ false |
+ whether allow multiple select |
+
+
+ | selectable |
+ Boolean |
+ true |
+ allow selecting menu items |
+
+
+ | selectedKeys |
+ String[] |
+ [] |
+ selected keys of items |
+
+
+ | defaultSelectedKeys |
+ String[] |
+ [] |
+ initial selected keys of items |
+
+
+ | openKeys |
+ String[] |
+ [] |
+ open keys of SubMenuItem |
+
+
+ | defaultOpenKeys |
+ String[] |
+ [] |
+ initial open keys of SubMenuItem |
+
+
+ | onSelect |
+ function({key:String, item:ReactComponent, domEvent:Event, selectedKeys:String[]}) |
+ |
+ called when select a menu item |
+
+
+ | onClick |
+ function({key:String, item:ReactComponent, domEvent:Event, keyPath: String[]}) |
+ |
+ called when click a menu item |
+
+
+ | onOpenChange |
+ (openKeys:String[]) => void |
+ |
+ called when open/close sub menu |
+
+
+ | onDeselect |
+ function({key:String, item:ReactComponent, domEvent:Event, selectedKeys:String[]}) |
+ |
+ called when deselect a menu item. only called when allow multiple |
+
+
+ | triggerSubMenuAction |
+ Enum { hover, click } |
+ hover |
+ which action can trigger submenu open/close |
+
+
+ | openAnimation |
+ {enter:function,leave:function}|String |
+ |
+ animate when sub menu open or close. see rc-animate for object type. |
+
+
+ | openTransition |
+ String |
+ |
+ css transitionName when sub menu open or close |
+
+
+ | subMenuOpenDelay |
+ Number |
+ 0 |
+ delay time to show popup sub menu. unit: s |
+
+
+ | subMenuCloseDelay |
+ Number |
+ 0.1 |
+ delay time to hide popup sub menu. unit: s |
+
+
+ | forceSubMenuRender |
+ Boolean |
+ false |
+ whether to render submenu even if it is not visible |
+
+
+ | getPopupContainer |
+ Function(menuDOMNode): HTMLElement |
+ () => document.body |
+ Where to render the DOM node of popup menu when the mode is horizontal or vertical |
+
+
+
+
+### Menu.Item props
+
+
+
+
+ | name |
+ type |
+ default |
+ description |
+
+
+
+
+ | className |
+ String |
+ |
+ additional css class of root dom node |
+
+
+ | disabled |
+ Boolean |
+ false |
+ no effect for click or keydown for this item |
+
+
+ | key |
+ Object |
+ |
+ corresponding to activeKey |
+
+
+ | onMouseEnter |
+ Function({eventKey, domEvent}) |
+ |
+ |
+
+
+ | onMouseLeave |
+ Function({eventKey, domEvent}) |
+ |
+ |
+
+
+
+
+
+### Menu.SubMenu props
+
+
+
+
+ | name |
+ type |
+ default |
+ description |
+
+
+
+
+ | className |
+ String |
+ |
+ additional css class of root dom node |
+
+
+ | title |
+ String/ReactElement |
+ |
+ sub menu's content |
+
+
+ | key |
+ Object |
+ |
+ corresponding to activeKey |
+
+
+ | disabled |
+ Boolean |
+ false |
+ no effect for click or keydown for this item |
+
+
+ | onMouseEnter |
+ Function({eventKey, domEvent}) |
+ |
+ |
+
+
+ | onMouseLeave |
+ Function({eventKey, domEvent}) |
+ |
+ |
+
+
+ | onTitleMouseEnter |
+ Function({eventKey, domEvent}) |
+ |
+ |
+
+
+ | onTitleMouseLeave |
+ Function({eventKey, domEvent}) |
+ |
+ |
+
+
+ | onTitleClick |
+ Function({eventKey, domEvent}) |
+ |
+ |
+
+
+ | popupOffset |
+ Array |
+ |
+ The offset of the popup submenu, in an x, y coordinate array. e.g.: `[0,15]` |
+
+
+
+
+### Menu.Divider props
+
+none
+
+### Menu.ItemGroup props
+
+
+
+
+ | name |
+ type |
+ default |
+ description |
+
+
+
+
+ | title |
+ String|React.Element |
+ |
+ title of item group |
+
+
+ | children |
+ React.Element[] |
+ |
+ MenuItems belonged to this group |
+
+
+
+
+## Development
+
+```
+npm install
+npm start
+```
+
+## Example
+
+http://localhost:8001/examples/index.md
+
+online example: http://react-component.github.io/menu/examples/
+
+
+## Test Case
+
+```
+npm test
+npm run chrome-test
+```
+
+## Coverage
+
+```
+npm run coverage
+```
+
+open coverage/ dir
+
+
+## License
+
+rc-menu is released under the MIT license.
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/assets/index.less b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/assets/index.less
new file mode 100644
index 0000000..1da996c
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/assets/index.less
@@ -0,0 +1,298 @@
+@menuPrefixCls: rc-menu;
+
+@font-face {
+ font-family: 'FontAwesome';
+ src: url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?v=4.2.0');
+ src: url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('https://cdn.bootcss.com/font-awesome/4.2.0/fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+
+.@{menuPrefixCls} {
+ outline: none;
+ margin-bottom: 0;
+ padding-left: 0; // Override default ul/ol
+ list-style: none;
+ border: 1px solid #d9d9d9;
+ box-shadow: 0 0 4px #d9d9d9;
+ border-radius: 3px;
+ color: #666;
+
+ &-hidden {
+ display: none;
+ }
+
+ &-collapse {
+ overflow: hidden;
+ &-active {
+ transition: height .3s ease-out;
+ }
+ }
+
+ &-item-group-list {
+ margin: 0;
+ padding: 0;
+ }
+
+ &-item-group-title {
+ color: #999;
+ line-height: 1.5;
+ padding: 8px 10px;
+ border-bottom: 1px solid #dedede;
+ }
+
+ &-item-active,
+ &-submenu-active > &-submenu-title {
+ background-color: #eaf8fe;
+ }
+
+ &-item-selected {
+ background-color: #eaf8fe;
+ // fix chrome render bug
+ transform: translateZ(0);
+ }
+
+ &-submenu-selected {
+ background-color: #eaf8fe;
+ }
+
+ & > li&-submenu {
+ padding: 0;
+ }
+
+ &-horizontal&-sub,
+ &-vertical&-sub,
+ &-vertical-left&-sub,
+ &-vertical-right&-sub {
+ min-width: 160px;
+ margin-top: 0;
+ }
+
+ &-item, &-submenu-title {
+ margin: 0;
+ position: relative;
+ display: block;
+ padding: 7px 7px 7px 16px;
+ white-space: nowrap;
+
+ // Disabled state sets text to gray and nukes hover/tab effects
+ &.@{menuPrefixCls}-item-disabled, &.@{menuPrefixCls}-submenu-disabled {
+ color: #777 !important;
+ }
+ }
+ & > &-item-divider {
+ height: 1px;
+ margin: 1px 0;
+ overflow: hidden;
+ padding: 0;
+ line-height: 0;
+ background-color: #e5e5e5;
+ }
+
+ &-submenu {
+ &-popup {
+ position: absolute;
+ }
+ > .@{menuPrefixCls} {
+ background-color: #fff;
+ }
+ }
+
+ .@{menuPrefixCls}-submenu-title, .@{menuPrefixCls}-item {
+ .anticon {
+ width: 14px;
+ height: 14px;
+ margin-right: 8px;
+ top: -1px;
+ }
+ }
+
+ &-horizontal {
+ background-color: #F3F5F7;
+ border: none;
+ border-bottom: 1px solid transparent;
+ border-bottom: 1px solid #d9d9d9;
+ box-shadow: none;
+
+ & > .@{menuPrefixCls}-item, & > .@{menuPrefixCls}-submenu > .@{menuPrefixCls}-submenu-title {
+ padding: 15px 20px;
+ }
+
+ & > .@{menuPrefixCls}-submenu, & > .@{menuPrefixCls}-item {
+ float: left;
+ border-bottom: 2px solid transparent;
+
+ &-active {
+ border-bottom: 2px solid #2db7f5;
+ background-color: #F3F5F7;
+ color: #2baee9;
+ }
+ }
+
+ &:after {
+ content: "\20";
+ display: block;
+ height: 0;
+ clear: both;
+ }
+ }
+
+ &-vertical,
+ &-vertical-left,
+ &-vertical-right,
+ &-inline {
+ padding: 12px 0;
+ & > .@{menuPrefixCls}-item, & > .@{menuPrefixCls}-submenu > .@{menuPrefixCls}-submenu-title {
+ padding: 12px 8px 12px 24px;
+ }
+ .@{menuPrefixCls}-submenu-arrow {
+ display: inline-block;
+ font: normal normal normal 14px/1 FontAwesome;
+ font-size: inherit;
+ vertical-align: baseline;
+ text-align: center;
+ text-transform: none;
+ text-rendering: auto;
+ position: absolute;
+ right: 16px;
+ line-height: 1.5em;
+ &:before {
+ content: "\f0da";
+ }
+ }
+ }
+ &-inline {
+ .@{menuPrefixCls}-submenu-arrow {
+ transform: rotate(90deg);
+ transition: transform .3s;
+ }
+ & .@{menuPrefixCls}-submenu-open > .@{menuPrefixCls}-submenu-title {
+ .@{menuPrefixCls}-submenu-arrow {
+ transform: rotate(-90deg);
+ }
+ }
+ }
+
+ &-vertical&-sub,
+ &-vertical-left&-sub,
+ &-vertical-right&-sub {
+ padding: 0;
+ }
+
+ &-sub&-inline {
+ padding: 0;
+ border: none;
+ border-radius: 0;
+ box-shadow: none;
+
+ & > .@{menuPrefixCls}-item, & > .@{menuPrefixCls}-submenu > .@{menuPrefixCls}-submenu-title {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ padding-right: 0;
+ }
+ }
+
+ .effect() {
+ animation-duration: .3s;
+ animation-fill-mode: both;
+ transform-origin: 0 0;
+ }
+
+ &-open {
+
+ &-slide-up-enter, &-slide-up-appear {
+ .effect();
+ opacity: 0;
+ animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
+ animation-play-state: paused;
+ }
+
+ &-slide-up-leave {
+ .effect();
+ opacity: 1;
+ animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
+ animation-play-state: paused;
+ }
+
+ &-slide-up-enter&-slide-up-enter-active, &-slide-up-appear&-slide-up-appear-active {
+ animation-name: rcMenuOpenSlideUpIn;
+ animation-play-state: running;
+ }
+
+ &-slide-up-leave&-slide-up-leave-active {
+ animation-name: rcMenuOpenSlideUpOut;
+ animation-play-state: running;
+ }
+
+ @keyframes rcMenuOpenSlideUpIn {
+ 0% {
+ opacity: 0;
+ transform-origin: 0% 0%;
+ transform: scaleY(0);
+ }
+ 100% {
+ opacity: 1;
+ transform-origin: 0% 0%;
+ transform: scaleY(1);
+ }
+ }
+ @keyframes rcMenuOpenSlideUpOut {
+ 0% {
+ opacity: 1;
+ transform-origin: 0% 0%;
+ transform: scaleY(1);
+ }
+ 100% {
+ opacity: 0;
+ transform-origin: 0% 0%;
+ transform: scaleY(0);
+ }
+ }
+
+ &-zoom-enter, &-zoom-appear {
+ opacity: 0;
+ .effect();
+ animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
+ animation-play-state: paused;
+ }
+
+ &-zoom-leave {
+ .effect();
+ animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
+ animation-play-state: paused;
+ }
+
+ &-zoom-enter&-zoom-enter-active, &-zoom-appear&-zoom-appear-active {
+ animation-name: rcMenuOpenZoomIn;
+ animation-play-state: running;
+ }
+
+ &-zoom-leave&-zoom-leave-active {
+ animation-name: rcMenuOpenZoomOut;
+ animation-play-state: running;
+ }
+
+ @keyframes rcMenuOpenZoomIn {
+ 0% {
+ opacity: 0;
+ transform: scale(0, 0);
+ }
+ 100% {
+ opacity: 1;
+ transform: scale(1, 1);
+ }
+ }
+ @keyframes rcMenuOpenZoomOut {
+ 0% {
+
+ transform: scale(1, 1);
+ }
+ 100% {
+ opacity: 0;
+ transform: scale(0, 0);
+ }
+ }
+ }
+
+}
+
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/antd.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/antd.html
new file mode 100644
index 0000000..b3a4252
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/antd.html
@@ -0,0 +1 @@
+placeholder
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/antd.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/antd.js
new file mode 100644
index 0000000..379c290
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/antd.js
@@ -0,0 +1,136 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { SubMenu, Item as MenuItem, Divider } from 'rc-menu';
+import 'rc-menu/assets/index.less';
+import animate from 'css-animation';
+
+function handleClick(info) {
+ console.log(`clicked ${info.key}`);
+ console.log(info);
+}
+
+const animation = {
+ enter(node, done) {
+ let height;
+ return animate(node, 'rc-menu-collapse', {
+ start() {
+ height = node.offsetHeight;
+ node.style.height = 0;
+ },
+ active() {
+ node.style.height = `${height}px`;
+ },
+ end() {
+ node.style.height = '';
+ done();
+ },
+ });
+ },
+
+ appear() {
+ return this.enter.apply(this, arguments);
+ },
+
+ leave(node, done) {
+ return animate(node, 'rc-menu-collapse', {
+ start() {
+ node.style.height = `${node.offsetHeight}px`;
+ },
+ active() {
+ node.style.height = 0;
+ },
+ end() {
+ node.style.height = '';
+ done();
+ },
+ });
+ },
+};
+
+const reactContainer = document.getElementById('__react-content');
+
+const nestSubMenu = (offset sub menu 2} key="4" popupOffset={[10, 15]}>
+
+
+ sub menu 3}
+ >
+
+
+
+
+
+ sub menu 4} key="4-2-2">
+
+
+
+
+
+
+
+
+);
+
+function onOpenChange(value) {
+ console.log('onOpenChange', value);
+}
+const commonMenu = ();
+
+function render(container) {
+ const horizontalMenu = React.cloneElement(commonMenu, {
+ mode: 'horizontal',
+ // use openTransition for antd
+ openAnimation: 'slide-up',
+ });
+
+ const horizontalMenu2 = React.cloneElement(commonMenu, {
+ mode: 'horizontal',
+ openAnimation: 'slide-up',
+ triggerSubMenuAction: 'click',
+ });
+
+ const verticalMenu = React.cloneElement(commonMenu, {
+ mode: 'vertical',
+ openAnimation: 'zoom',
+ });
+
+ const inlineMenu = React.cloneElement(commonMenu, {
+ mode: 'inline',
+ defaultOpenKeys: ['1'],
+ openAnimation: animation,
+ });
+
+ ReactDOM.render(
+
antd menu
+
+
+
horizontal
+
+
{horizontalMenu}
+
horizontal and click
+
+
{horizontalMenu2}
+
vertical
+
+
{verticalMenu}
+
inline
+
+
{inlineMenu}
+
+
, container);
+}
+
+render(reactContainer);
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/keyPath.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/keyPath.html
new file mode 100644
index 0000000..48cdce8
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/keyPath.html
@@ -0,0 +1 @@
+placeholder
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/keyPath.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/keyPath.js
new file mode 100644
index 0000000..7779e24
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/keyPath.js
@@ -0,0 +1,45 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { SubMenu, Item as MenuItem } from 'rc-menu';
+
+import 'rc-menu/assets/index.less';
+
+class Test extends React.Component {
+ onClick(info) {
+ console.log('click ', info);
+ }
+
+ getMenu() {
+ return (
+
+ );
+ }
+
+ render() {
+ return ();
+ }
+}
+
+
+ReactDOM.render(, document.getElementById('__react-content'));
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/menuItemGroup.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/menuItemGroup.html
new file mode 100644
index 0000000..b3a4252
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/menuItemGroup.html
@@ -0,0 +1 @@
+placeholder
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/menuItemGroup.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/menuItemGroup.js
new file mode 100644
index 0000000..6f95a8f
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/menuItemGroup.js
@@ -0,0 +1,21 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { Item as MenuItem, ItemGroup as MenuItemGroup } from 'rc-menu';
+
+import 'rc-menu/assets/index.less';
+
+ReactDOM.render(
+
menu item group
+
+, document.getElementById('__react-content'));
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/multiple.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/multiple.html
new file mode 100644
index 0000000..b3a4252
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/multiple.html
@@ -0,0 +1 @@
+placeholder
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/multiple.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/multiple.js
new file mode 100644
index 0000000..f113872
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/multiple.js
@@ -0,0 +1,73 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { SubMenu, Item as MenuItem, Divider } from 'rc-menu';
+
+import 'rc-menu/assets/index.less';
+
+function handleSelect(info) {
+ console.log('selected ', info);
+}
+
+function handleDeselect(info) {
+ console.log('deselect ', info);
+}
+
+const titleRight = (sub menu);
+const titleRight1 = (sub menu 1
+);
+const titleRight2 = (sub menu 2
+);
+const titleRight3 = (sub menu 3
+);
+
+function render(container) {
+ function destroy() {
+ ReactDOM.unmountComponentAtNode(container);
+ }
+
+ const leftMenu = (
+
+ );
+ ReactDOM.render(
+
multiple selectable menu
+
+
+
+
+
{leftMenu}
+
, container);
+}
+
+const container = document.getElementById('__react-content');
+
+render(container);
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/openKeys.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/openKeys.html
new file mode 100644
index 0000000..b3a4252
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/openKeys.html
@@ -0,0 +1 @@
+placeholder
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/openKeys.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/openKeys.js
new file mode 100644
index 0000000..6a27f91
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/openKeys.js
@@ -0,0 +1,53 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { SubMenu, Item as MenuItem } from 'rc-menu';
+
+import 'rc-menu/assets/index.less';
+
+class Test extends React.Component {
+ state = {
+ openKeys: [],
+ };
+
+ onClick(info) {
+ console.log('click ', info);
+ }
+
+ onOpenChange = (openKeys) => {
+ console.log('onOpenChange', openKeys);
+ this.setState({
+ openKeys,
+ });
+ }
+
+ getMenu() {
+ return (
+
+ );
+ }
+
+ render() {
+ return ();
+ }
+}
+
+ReactDOM.render(, document.getElementById('__react-content'));
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/scrollable.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/scrollable.html
new file mode 100644
index 0000000..b3a4252
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/scrollable.html
@@ -0,0 +1 @@
+placeholder
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/scrollable.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/scrollable.js
new file mode 100644
index 0000000..5dcffc4
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/scrollable.js
@@ -0,0 +1,22 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { Item as MenuItem } from 'rc-menu';
+
+import 'rc-menu/assets/index.less';
+
+const children = [];
+for (let i = 0; i < 20; i++) {
+ children.push();
+}
+
+const menuStyle = {
+ width: 200,
+ height: 200,
+ overflow: 'auto',
+};
+ReactDOM.render(
+
keyboard scrollable menu
+
+, document.getElementById('__react-content'));
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/selectedKeys.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/selectedKeys.html
new file mode 100644
index 0000000..b3a4252
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/selectedKeys.html
@@ -0,0 +1 @@
+placeholder
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/selectedKeys.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/selectedKeys.js
new file mode 100644
index 0000000..68478b7
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/selectedKeys.js
@@ -0,0 +1,140 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { SubMenu, Item as MenuItem } from 'rc-menu';
+
+import 'rc-menu/assets/index.less';
+
+class Test extends React.Component {
+ state = {
+ destroyed: false,
+ selectedKeys: [],
+ openKeys: [],
+ };
+
+ onSelect = (info) => {
+ console.log('selected ', info);
+ this.setState({
+ selectedKeys: info.selectedKeys,
+ });
+ };
+
+ onDeselect(info) {
+ console.log('deselect ', info);
+ }
+
+ onOpenChange = (openKeys) => {
+ console.log('onOpenChange ', openKeys);
+ this.setState({
+ openKeys,
+ });
+ };
+
+ onCheck = (e) => {
+ const value = e.target.value;
+ if (e.target.checked) {
+ this.setState({
+ selectedKeys: this.state.selectedKeys.concat(value),
+ });
+ } else {
+ const selectedKeys = this.state.selectedKeys.concat();
+ const index = selectedKeys.indexOf(value);
+ if (value !== -1) {
+ selectedKeys.splice(index, 1);
+ }
+ this.setState({
+ selectedKeys,
+ });
+ }
+ };
+
+ onOpenCheck = (e) => {
+ const value = e.target.value;
+ if (e.target.checked) {
+ this.setState({
+ openKeys: this.state.openKeys.concat(value),
+ });
+ } else {
+ const openKeys = this.state.openKeys.concat();
+ const index = openKeys.indexOf(value);
+ if (value !== -1) {
+ openKeys.splice(index, 1);
+ }
+ this.setState({
+ openKeys,
+ });
+ }
+ };
+
+ getMenu() {
+ return (
+
+ );
+ }
+
+ destroy() {
+ this.setState({
+ destroyed: true,
+ });
+ }
+
+ render() {
+ if (this.state.destroyed) {
+ return null;
+ }
+ const allSelectedKeys = ['1-1', '1-2', '2-1', '2-2', '3'];
+ const allOpenKeys = ['1', '2'];
+ const selectedKeys = this.state.selectedKeys;
+ const openKeys = this.state.openKeys;
+
+ return (
+
multiple selectable menu
+
+
+ selectedKeys:
+ {allSelectedKeys.map(k => ())}
+
+
+
+ openKeys:
+ {allOpenKeys.map(k => ())}
+
+
+
{this.getMenu()}
+
);
+ }
+}
+
+ReactDOM.render(, document.getElementById('__react-content'));
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/single.html b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/single.html
new file mode 100644
index 0000000..b3a4252
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/single.html
@@ -0,0 +1 @@
+placeholder
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/single.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/single.js
new file mode 100644
index 0000000..d635b9b
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/examples/single.js
@@ -0,0 +1,72 @@
+/* eslint no-console:0 */
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import Menu, { SubMenu, Item as MenuItem, Divider } from 'rc-menu';
+import 'rc-menu/assets/index.less';
+
+function handleSelect(info) {
+ console.log('selected ', info);
+}
+
+function handleClick(info) {
+ console.log('click ', info);
+}
+
+const titleRight = (sub menu);
+const titleRight1 = (sub menu 1);
+const titleRight2 = (sub menu 2);
+const titleRight3 = (sub menu 3);
+
+function render(container) {
+ function destroy() {
+ ReactDOM.unmountComponentAtNode(container);
+ }
+
+ const leftMenu = (
+
+ );
+ ReactDOM.render(
+
single selectable menu
+
+
+
+
+ archor
+
+
{leftMenu}
+
, container);
+}
+
+const container = document.getElementById('__react-content');
+
+render(container);
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/index.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/index.js
new file mode 100644
index 0000000..fd4d7e5
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/index.js
@@ -0,0 +1 @@
+module.exports = require('./src/');
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/package.json b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/package.json
new file mode 100644
index 0000000..58d55b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/package.json
@@ -0,0 +1,88 @@
+{
+ "name": "rc-menu",
+ "version": "7.0.3",
+ "description": "menu ui component for react",
+ "keywords": [
+ "react",
+ "react-component",
+ "menu",
+ "ui",
+ "react-menu"
+ ],
+ "files": [
+ "es",
+ "lib",
+ "assets/*.css"
+ ],
+ "main": "./lib/index",
+ "module": "./es/index",
+ "homepage": "http://github.com/react-component/menu",
+ "maintainers": [
+ "yiminghe@gmail.com",
+ "hualei5280@gmail.com"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:react-component/menu.git"
+ },
+ "bugs": {
+ "url": "http://github.com/react-component/menu/issues"
+ },
+ "licenses": "MIT",
+ "config": {
+ "port": 8010
+ },
+ "scripts": {
+ "build": "rc-tools run build",
+ "compile": "rc-tools run compile --babel-runtime",
+ "gh-pages": "rc-tools run gh-pages",
+ "start": "rc-tools run server",
+ "start:preact": "DEMO_ENV=preact rmc-tools run server",
+ "pub": "rc-tools run pub --babel-runtime",
+ "lint": "rc-tools run lint",
+ "lint:fix": "rc-tools run lint --fix",
+ "test": "jest",
+ "prepublish": "rc-tools run guard",
+ "coverage": "jest --coverage && cat ./coverage/lcov.info | coveralls"
+ },
+ "jest": {
+ "setupFiles": [
+ "./tests/setup.js"
+ ],
+ "collectCoverageFrom": [
+ "src/**/*"
+ ],
+ "snapshotSerializers": [
+ "enzyme-to-json/serializer"
+ ],
+ "transform": {
+ "\\.jsx?$": "./node_modules/rc-tools/scripts/jestPreprocessor.js"
+ }
+ },
+ "devDependencies": {
+ "coveralls": "^2.11.15",
+ "enzyme": "^3.0.0",
+ "enzyme-adapter-react-16": "^1.0.2",
+ "enzyme-to-json": "^3.0.1",
+ "jest": "^21.0.0",
+ "pre-commit": "1.x",
+ "rc-tools": "7.x",
+ "react": "^16.0.0",
+ "react-dom": "^16.0.0",
+ "react-test-renderer": "^16.0.0",
+ "rmc-tools": "^0.0.2"
+ },
+ "dependencies": {
+ "babel-runtime": "6.x",
+ "classnames": "2.x",
+ "dom-scroll-into-view": "1.x",
+ "mini-store": "^1.1.0",
+ "prop-types": "^15.5.6",
+ "rc-animate": "2.x",
+ "rc-trigger": "^2.3.0",
+ "rc-util": "^4.1.0"
+ },
+ "pre-commit": [
+ "lint"
+ ]
+}
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/DOMWrap.jsx b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/DOMWrap.jsx
new file mode 100644
index 0000000..6027cf4
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/DOMWrap.jsx
@@ -0,0 +1,27 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+
+export default class DOMWrap extends React.Component {
+ static propTypes = {
+ tag: PropTypes.string,
+ hiddenClassName: PropTypes.string,
+ visible: PropTypes.bool,
+ };
+
+ static defaultProps = {
+ tag: 'div',
+ className: '',
+ };
+
+ render() {
+ const props = { ...this.props };
+ if (!props.visible) {
+ props.className += ` ${props.hiddenClassName}`;
+ }
+ const Tag = props.tag;
+ delete props.tag;
+ delete props.hiddenClassName;
+ delete props.visible;
+ return ;
+ }
+}
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/Divider.jsx b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/Divider.jsx
new file mode 100644
index 0000000..2e1f67d
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/Divider.jsx
@@ -0,0 +1,19 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+
+export default class Divider extends React.Component {
+ static propTypes = {
+ className: PropTypes.string,
+ rootPrefixCls: PropTypes.string,
+ };
+
+ static defaultProps = {
+ // To fix keyboard UX.
+ disabled: true,
+ };
+
+ render() {
+ const { className = '', rootPrefixCls } = this.props;
+ return ;
+ }
+}
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/Menu.jsx b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/Menu.jsx
new file mode 100644
index 0000000..56ea9a9
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/Menu.jsx
@@ -0,0 +1,207 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { Provider, create } from 'mini-store';
+import { default as SubPopupMenu, getActiveKey } from './SubPopupMenu';
+import { noop } from './util';
+
+export default class Menu extends React.Component {
+ static propTypes = {
+ defaultSelectedKeys: PropTypes.arrayOf(PropTypes.string),
+ defaultActiveFirst: PropTypes.bool,
+ selectedKeys: PropTypes.arrayOf(PropTypes.string),
+ defaultOpenKeys: PropTypes.arrayOf(PropTypes.string),
+ openKeys: PropTypes.arrayOf(PropTypes.string),
+ mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
+ getPopupContainer: PropTypes.func,
+ onClick: PropTypes.func,
+ onSelect: PropTypes.func,
+ onDeselect: PropTypes.func,
+ onDestroy: PropTypes.func,
+ openTransitionName: PropTypes.string,
+ openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
+ subMenuOpenDelay: PropTypes.number,
+ subMenuCloseDelay: PropTypes.number,
+ forceSubMenuRender: PropTypes.bool,
+ triggerSubMenuAction: PropTypes.string,
+ level: PropTypes.number,
+ selectable: PropTypes.bool,
+ multiple: PropTypes.bool,
+ children: PropTypes.any,
+ className: PropTypes.string,
+ style: PropTypes.object,
+ activeKey: PropTypes.string,
+ prefixCls: PropTypes.string,
+ };
+
+ static defaultProps = {
+ selectable: true,
+ onClick: noop,
+ onSelect: noop,
+ onOpenChange: noop,
+ onDeselect: noop,
+ defaultSelectedKeys: [],
+ defaultOpenKeys: [],
+ subMenuOpenDelay: 0.1,
+ subMenuCloseDelay: 0.1,
+ triggerSubMenuAction: 'hover',
+ prefixCls: 'rc-menu',
+ className: '',
+ mode: 'vertical',
+ style: {},
+ };
+
+ constructor(props) {
+ super(props);
+
+ this.isRootMenu = true;
+
+ let selectedKeys = props.defaultSelectedKeys;
+ let openKeys = props.defaultOpenKeys;
+ if ('selectedKeys' in props) {
+ selectedKeys = props.selectedKeys || [];
+ }
+ if ('openKeys' in props) {
+ openKeys = props.openKeys || [];
+ }
+
+ this.store = create({
+ selectedKeys,
+ openKeys,
+ activeKey: { '0-menu-': getActiveKey(props, props.activeKey) },
+ });
+ }
+
+ componentWillReceiveProps(nextProps) {
+ if ('selectedKeys' in nextProps) {
+ this.store.setState({
+ selectedKeys: nextProps.selectedKeys || [],
+ });
+ }
+ if ('openKeys' in nextProps) {
+ this.store.setState({
+ openKeys: nextProps.openKeys || [],
+ });
+ }
+ }
+
+ onSelect = (selectInfo) => {
+ const props = this.props;
+ if (props.selectable) {
+ // root menu
+ let selectedKeys = this.store.getState().selectedKeys;
+ const selectedKey = selectInfo.key;
+ if (props.multiple) {
+ selectedKeys = selectedKeys.concat([selectedKey]);
+ } else {
+ selectedKeys = [selectedKey];
+ }
+ if (!('selectedKeys' in props)) {
+ this.store.setState({
+ selectedKeys,
+ });
+ }
+ props.onSelect({
+ ...selectInfo,
+ selectedKeys,
+ });
+ }
+ }
+
+ onClick = (e) => {
+ this.store.setState({
+ openKeys: [],
+ });
+ this.props.onClick(e);
+ }
+
+ // onKeyDown needs to be exposed as a instance method
+ // e.g., in rc-select, we need to navigate menu item while
+ // current active item is rc-select input box rather than the menu itself
+ onKeyDown = (e, callback) => {
+ this.innerMenu.getWrappedInstance().onKeyDown(e, callback);
+ }
+
+ onOpenChange = (event) => {
+ const props = this.props;
+ const openKeys = this.store.getState().openKeys.concat();
+ let changed = false;
+ const processSingle = (e) => {
+ let oneChanged = false;
+ if (e.open) {
+ oneChanged = openKeys.indexOf(e.key) === -1;
+ if (oneChanged) {
+ openKeys.push(e.key);
+ }
+ } else {
+ const index = openKeys.indexOf(e.key);
+ oneChanged = index !== -1;
+ if (oneChanged) {
+ openKeys.splice(index, 1);
+ }
+ }
+ changed = changed || oneChanged;
+ };
+ if (Array.isArray(event)) {
+ // batch change call
+ event.forEach(processSingle);
+ } else {
+ processSingle(event);
+ }
+ if (changed) {
+ if (!('openKeys' in this.props)) {
+ this.store.setState({ openKeys });
+ }
+ props.onOpenChange(openKeys);
+ }
+ }
+
+ onDeselect = (selectInfo) => {
+ const props = this.props;
+ if (props.selectable) {
+ const selectedKeys = this.store.getState().selectedKeys.concat();
+ const selectedKey = selectInfo.key;
+ const index = selectedKeys.indexOf(selectedKey);
+ if (index !== -1) {
+ selectedKeys.splice(index, 1);
+ }
+ if (!('selectedKeys' in props)) {
+ this.store.setState({
+ selectedKeys,
+ });
+ }
+ props.onDeselect({
+ ...selectInfo,
+ selectedKeys,
+ });
+ }
+ }
+
+ getOpenTransitionName = () => {
+ const props = this.props;
+ let transitionName = props.openTransitionName;
+ const animationName = props.openAnimation;
+ if (!transitionName && typeof animationName === 'string') {
+ transitionName = `${props.prefixCls}-open-${animationName}`;
+ }
+ return transitionName;
+ }
+
+ render() {
+ let { ...props } = this.props;
+ props.className += ` ${props.prefixCls}-root`;
+ props = {
+ ...props,
+ onClick: this.onClick,
+ onOpenChange: this.onOpenChange,
+ onDeselect: this.onDeselect,
+ onSelect: this.onSelect,
+ openTransitionName: this.getOpenTransitionName(),
+ parentMenu: this,
+ };
+ return (
+
+ this.innerMenu = c}>{this.props.children}
+
+ );
+ }
+}
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/MenuItem.jsx b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/MenuItem.jsx
new file mode 100644
index 0000000..00555ed
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/MenuItem.jsx
@@ -0,0 +1,203 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import PropTypes from 'prop-types';
+import KeyCode from 'rc-util/lib/KeyCode';
+import classNames from 'classnames';
+import scrollIntoView from 'dom-scroll-into-view';
+import { connect } from 'mini-store';
+import { noop, menuAllProps } from './util';
+
+/* eslint react/no-is-mounted:0 */
+
+export class MenuItem extends React.Component {
+ static propTypes = {
+ attribute: PropTypes.object,
+ rootPrefixCls: PropTypes.string,
+ eventKey: PropTypes.string,
+ active: PropTypes.bool,
+ children: PropTypes.any,
+ selectedKeys: PropTypes.array,
+ disabled: PropTypes.bool,
+ title: PropTypes.string,
+ onItemHover: PropTypes.func,
+ onSelect: PropTypes.func,
+ onClick: PropTypes.func,
+ onDeselect: PropTypes.func,
+ parentMenu: PropTypes.object,
+ onDestroy: PropTypes.func,
+ onMouseEnter: PropTypes.func,
+ onMouseLeave: PropTypes.func,
+ multiple: PropTypes.bool,
+ isSelected: PropTypes.bool,
+ manualRef: PropTypes.func,
+ };
+
+ static defaultProps = {
+ onSelect: noop,
+ onMouseEnter: noop,
+ onMouseLeave: noop,
+ manualRef: noop,
+ };
+
+ constructor(props) {
+ super(props);
+ }
+
+ componentDidMount() {
+ // invoke customized ref to expose component to mixin
+ this.callRef();
+ }
+
+ componentDidUpdate() {
+ if (this.props.active) {
+ scrollIntoView(ReactDOM.findDOMNode(this), ReactDOM.findDOMNode(this.props.parentMenu), {
+ onlyScrollIfNeeded: true,
+ });
+ }
+
+ this.callRef();
+ }
+
+ componentWillUnmount() {
+ const props = this.props;
+ if (props.onDestroy) {
+ props.onDestroy(props.eventKey);
+ }
+ }
+
+ onKeyDown = (e) => {
+ const keyCode = e.keyCode;
+ if (keyCode === KeyCode.ENTER) {
+ this.onClick(e);
+ return true;
+ }
+ };
+
+ onMouseLeave = (e) => {
+ const { eventKey, onItemHover, onMouseLeave } = this.props;
+ onItemHover({
+ key: eventKey,
+ hover: false,
+ });
+ onMouseLeave({
+ key: eventKey,
+ domEvent: e,
+ });
+ };
+
+ onMouseEnter = (e) => {
+ const { eventKey, onItemHover, onMouseEnter } = this.props;
+ onItemHover({
+ key: eventKey,
+ hover: true,
+ });
+ onMouseEnter({
+ key: eventKey,
+ domEvent: e,
+ });
+ };
+
+ onClick = (e) => {
+ const { eventKey, multiple, onClick, onSelect, onDeselect, isSelected } = this.props;
+ const info = {
+ key: eventKey,
+ keyPath: [eventKey],
+ item: this,
+ domEvent: e,
+ };
+ onClick(info);
+ if (multiple) {
+ if (isSelected) {
+ onDeselect(info);
+ } else {
+ onSelect(info);
+ }
+ } else if (!isSelected) {
+ onSelect(info);
+ }
+ };
+
+ getPrefixCls() {
+ return `${this.props.rootPrefixCls}-item`;
+ }
+
+ getActiveClassName() {
+ return `${this.getPrefixCls()}-active`;
+ }
+
+ getSelectedClassName() {
+ return `${this.getPrefixCls()}-selected`;
+ }
+
+ getDisabledClassName() {
+ return `${this.getPrefixCls()}-disabled`;
+ }
+
+ callRef() {
+ if (this.props.manualRef) {
+ this.props.manualRef(this);
+ }
+ }
+
+ render() {
+ const props = { ...this.props };
+ const className = classNames(this.getPrefixCls(), props.className, {
+ [this.getActiveClassName()]: !props.disabled && props.active,
+ [this.getSelectedClassName()]: props.isSelected,
+ [this.getDisabledClassName()]: props.disabled,
+ });
+ let attrs = {
+ ...props.attribute,
+ title: props.title,
+ className,
+ // set to menuitem by default
+ role: 'menuitem',
+ 'aria-disabled': props.disabled,
+ };
+
+ if (props.role === 'option') {
+ // overwrite to option
+ attrs = {
+ ...attrs,
+ role: 'option',
+ 'aria-selected': props.isSelected,
+ };
+ } else if (props.role === null) {
+ // sometimes we want to specify role inside element
+ // Link would be a good example
+ delete attrs.role;
+ }
+ // In case that onClick/onMouseLeave/onMouseEnter is passed down from owner
+ const mouseEvent = {
+ onClick: props.disabled ? null : this.onClick,
+ onMouseLeave: props.disabled ? null : this.onMouseLeave,
+ onMouseEnter: props.disabled ? null : this.onMouseEnter,
+ };
+ const style = {
+ ...props.style,
+ };
+ if (props.mode === 'inline') {
+ style.paddingLeft = props.inlineIndent * props.level;
+ }
+ menuAllProps.forEach(key => delete props[key]);
+ return (
+
+ {props.children}
+
+ );
+ }
+}
+
+MenuItem.isMenuItem = true;
+
+const connected = connect(({ activeKey, selectedKeys }, { eventKey, subMenuKey }) => ({
+ active: activeKey[subMenuKey] === eventKey,
+ isSelected: selectedKeys.indexOf(eventKey) !== -1,
+}))(MenuItem);
+
+export default connected;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/MenuItemGroup.jsx b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/MenuItemGroup.jsx
new file mode 100644
index 0000000..6464b51
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/MenuItemGroup.jsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { menuAllProps } from './util';
+
+class MenuItemGroup extends React.Component {
+ static propTypes = {
+ renderMenuItem: PropTypes.func,
+ index: PropTypes.number,
+ className: PropTypes.string,
+ subMenuKey: PropTypes.string,
+ rootPrefixCls: PropTypes.string,
+ };
+
+ static defaultProps = {
+ disabled: true,
+ };
+
+ renderInnerMenuItem = (item) => {
+ const { renderMenuItem, index } = this.props;
+ return renderMenuItem(item, index, this.props.subMenuKey);
+ }
+
+ render() {
+ const { ...props } = this.props;
+ const { className = '', rootPrefixCls } = props;
+ const titleClassName = `${rootPrefixCls}-item-group-title`;
+ const listClassName = `${rootPrefixCls}-item-group-list`;
+ const { title, children } = props;
+ menuAllProps.forEach(key => delete props[key]);
+ return (
+
+
+ {title}
+
+
+ {React.Children.map(children, this.renderInnerMenuItem)}
+
+
+ );
+ }
+}
+
+MenuItemGroup.isMenuItemGroup = true;
+
+export default MenuItemGroup;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/SubMenu.jsx b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/SubMenu.jsx
new file mode 100644
index 0000000..659004a
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/SubMenu.jsx
@@ -0,0 +1,524 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import PropTypes from 'prop-types';
+import Trigger from 'rc-trigger';
+import KeyCode from 'rc-util/lib/KeyCode';
+import classNames from 'classnames';
+import { connect } from 'mini-store';
+import SubPopupMenu from './SubPopupMenu';
+import placements from './placements';
+import Animate from 'rc-animate';
+import {
+ noop,
+ loopMenuItemRecursively,
+ getMenuIdFromSubMenuEventKey,
+ menuAllProps,
+} from './util';
+
+let guid = 0;
+
+const popupPlacementMap = {
+ horizontal: 'bottomLeft',
+ vertical: 'rightTop',
+ 'vertical-left': 'rightTop',
+ 'vertical-right': 'leftTop',
+};
+
+const updateDefaultActiveFirst = (store, eventKey, defaultActiveFirst) => {
+ const menuId = getMenuIdFromSubMenuEventKey(eventKey);
+ const state = store.getState();
+ store.setState({
+ defaultActiveFirst: {
+ ...state.defaultActiveFirst,
+ [menuId]: defaultActiveFirst,
+ },
+ });
+};
+
+export class SubMenu extends React.Component {
+ static propTypes = {
+ parentMenu: PropTypes.object,
+ title: PropTypes.node,
+ children: PropTypes.any,
+ selectedKeys: PropTypes.array,
+ openKeys: PropTypes.array,
+ onClick: PropTypes.func,
+ onOpenChange: PropTypes.func,
+ rootPrefixCls: PropTypes.string,
+ eventKey: PropTypes.string,
+ multiple: PropTypes.bool,
+ active: PropTypes.bool, // TODO: remove
+ onItemHover: PropTypes.func,
+ onSelect: PropTypes.func,
+ triggerSubMenuAction: PropTypes.string,
+ onDeselect: PropTypes.func,
+ onDestroy: PropTypes.func,
+ onMouseEnter: PropTypes.func,
+ onMouseLeave: PropTypes.func,
+ onTitleMouseEnter: PropTypes.func,
+ onTitleMouseLeave: PropTypes.func,
+ onTitleClick: PropTypes.func,
+ popupOffset: PropTypes.array,
+ isOpen: PropTypes.bool,
+ store: PropTypes.object,
+ mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
+ manualRef: PropTypes.func,
+ };
+
+ static defaultProps = {
+ onMouseEnter: noop,
+ onMouseLeave: noop,
+ onTitleMouseEnter: noop,
+ onTitleMouseLeave: noop,
+ onTitleClick: noop,
+ manualRef: noop,
+ mode: 'vertical',
+ title: '',
+ };
+
+ constructor(props) {
+ super(props);
+ const store = props.store;
+ const eventKey = props.eventKey;
+ const defaultActiveFirst = store.getState().defaultActiveFirst;
+
+ this.isRootMenu = false;
+
+ let value = false;
+
+ if (defaultActiveFirst) {
+ value = defaultActiveFirst[eventKey];
+ }
+
+ updateDefaultActiveFirst(store, eventKey, value);
+ }
+
+ componentDidMount() {
+ this.componentDidUpdate();
+ }
+
+ componentDidUpdate() {
+ const { mode, parentMenu, manualRef } = this.props;
+
+ // invoke customized ref to expose component to mixin
+ if (manualRef) {
+ manualRef(this);
+ }
+
+ if (mode !== 'horizontal' || !parentMenu.isRootMenu || !this.props.isOpen) {
+ return;
+ }
+
+ this.minWidthTimeout = setTimeout(() => this.adjustWidth(), 0);
+ }
+
+ componentWillUnmount() {
+ const { onDestroy, eventKey } = this.props;
+ if (onDestroy) {
+ onDestroy(eventKey);
+ }
+
+ /* istanbul ignore if */
+ if (this.minWidthTimeout) {
+ clearTimeout(this.minWidthTimeout);
+ }
+
+ /* istanbul ignore if */
+ if (this.mouseenterTimeout) {
+ clearTimeout(this.mouseenterTimeout);
+ }
+ }
+
+ onDestroy = (key) => {
+ this.props.onDestroy(key);
+ };
+
+ onKeyDown = (e) => {
+ const keyCode = e.keyCode;
+ const menu = this.menuInstance;
+ const {
+ isOpen,
+ store,
+ } = this.props;
+
+ if (keyCode === KeyCode.ENTER) {
+ this.onTitleClick(e);
+ updateDefaultActiveFirst(store, this.props.eventKey, true);
+ return true;
+ }
+
+ if (keyCode === KeyCode.RIGHT) {
+ if (isOpen) {
+ menu.onKeyDown(e);
+ } else {
+ this.triggerOpenChange(true);
+ // need to update current menu's defaultActiveFirst value
+ updateDefaultActiveFirst(store, this.props.eventKey, true);
+ }
+ return true;
+ }
+ if (keyCode === KeyCode.LEFT) {
+ let handled;
+ if (isOpen) {
+ handled = menu.onKeyDown(e);
+ } else {
+ return undefined;
+ }
+ if (!handled) {
+ this.triggerOpenChange(false);
+ handled = true;
+ }
+ return handled;
+ }
+
+ if (isOpen && (keyCode === KeyCode.UP || keyCode === KeyCode.DOWN)) {
+ return menu.onKeyDown(e);
+ }
+ };
+
+ onOpenChange = (e) => {
+ this.props.onOpenChange(e);
+ };
+
+ onPopupVisibleChange = (visible) => {
+ this.triggerOpenChange(visible, visible ? 'mouseenter' : 'mouseleave');
+ };
+
+ onMouseEnter = (e) => {
+ const { eventKey: key, onMouseEnter, store } = this.props;
+ updateDefaultActiveFirst(store, this.props.eventKey, false);
+ onMouseEnter({
+ key,
+ domEvent: e,
+ });
+ };
+
+ onMouseLeave = (e) => {
+ const {
+ parentMenu,
+ eventKey,
+ onMouseLeave,
+ } = this.props;
+ parentMenu.subMenuInstance = this;
+ onMouseLeave({
+ key: eventKey,
+ domEvent: e,
+ });
+ };
+
+ onTitleMouseEnter = (domEvent) => {
+ const { eventKey: key, onItemHover, onTitleMouseEnter } = this.props;
+ onItemHover({
+ key,
+ hover: true,
+ });
+ onTitleMouseEnter({
+ key,
+ domEvent,
+ });
+ };
+
+ onTitleMouseLeave = (e) => {
+ const { parentMenu, eventKey, onItemHover, onTitleMouseLeave } = this.props;
+ parentMenu.subMenuInstance = this;
+ onItemHover({
+ key: eventKey,
+ hover: false,
+ });
+ onTitleMouseLeave({
+ key: eventKey,
+ domEvent: e,
+ });
+ };
+
+ onTitleClick = (e) => {
+ const { props } = this;
+ props.onTitleClick({
+ key: props.eventKey,
+ domEvent: e,
+ });
+ if (props.triggerSubMenuAction === 'hover') {
+ return;
+ }
+ this.triggerOpenChange(!props.isOpen, 'click');
+ updateDefaultActiveFirst(props.store, this.props.eventKey, false);
+ };
+
+ onSubMenuClick = (info) => {
+ this.props.onClick(this.addKeyPath(info));
+ };
+
+ onSelect = (info) => {
+ this.props.onSelect(info);
+ };
+
+ onDeselect = (info) => {
+ this.props.onDeselect(info);
+ };
+
+ getPrefixCls = () => `${this.props.rootPrefixCls}-submenu`;
+
+ getActiveClassName = () => `${this.getPrefixCls()}-active`;
+
+ getDisabledClassName = () => `${this.getPrefixCls()}-disabled`;
+
+ getSelectedClassName = () => `${this.getPrefixCls()}-selected`;
+
+ getOpenClassName = () => `${this.props.rootPrefixCls}-submenu-open`;
+
+ saveMenuInstance = (c) => {
+ // children menu instance
+ this.menuInstance = c;
+ };
+
+ addKeyPath = info => ({
+ ...info,
+ keyPath: (info.keyPath || []).concat(this.props.eventKey),
+ });
+
+ triggerOpenChange = (open, type) => {
+ const key = this.props.eventKey;
+ const openChange = () => {
+ this.onOpenChange({
+ key,
+ item: this,
+ trigger: type,
+ open,
+ });
+ };
+ if (type === 'mouseenter') {
+ // make sure mouseenter happen after other menu item's mouseleave
+ this.mouseenterTimeout = setTimeout(() => {
+ openChange();
+ }, 0);
+ } else {
+ openChange();
+ }
+ }
+
+ isChildrenSelected = () => {
+ const ret = { find: false };
+ loopMenuItemRecursively(this.props.children, this.props.selectedKeys, ret);
+ return ret.find;
+ }
+
+ isOpen = () => this.props.openKeys.indexOf(this.props.eventKey) !== -1
+
+ adjustWidth = () => {
+ /* istanbul ignore if */
+ if (!this.subMenuTitle || !this.menuInstance) {
+ return;
+ }
+ const popupMenu = ReactDOM.findDOMNode(this.menuInstance);
+ if (popupMenu.offsetWidth >= this.subMenuTitle.offsetWidth) {
+ return;
+ }
+
+ /* istanbul ignore next */
+ popupMenu.style.minWidth = `${this.subMenuTitle.offsetWidth}px`;
+ };
+
+ saveSubMenuTitle = (subMenuTitle) => {
+ this.subMenuTitle = subMenuTitle;
+ }
+
+ renderChildren(children) {
+ const props = this.props;
+ const baseProps = {
+ mode: props.mode === 'horizontal' ? 'vertical' : props.mode,
+ visible: this.props.isOpen,
+ level: props.level + 1,
+ inlineIndent: props.inlineIndent,
+ focusable: false,
+ onClick: this.onSubMenuClick,
+ onSelect: this.onSelect,
+ onDeselect: this.onDeselect,
+ onDestroy: this.onDestroy,
+ selectedKeys: props.selectedKeys,
+ eventKey: `${props.eventKey}-menu-`,
+ openKeys: props.openKeys,
+ openTransitionName: props.openTransitionName,
+ openAnimation: props.openAnimation,
+ onOpenChange: this.onOpenChange,
+ subMenuOpenDelay: props.subMenuOpenDelay,
+ parentMenu: this,
+ subMenuCloseDelay: props.subMenuCloseDelay,
+ forceSubMenuRender: props.forceSubMenuRender,
+ triggerSubMenuAction: props.triggerSubMenuAction,
+ defaultActiveFirst: props.store.getState()
+ .defaultActiveFirst[getMenuIdFromSubMenuEventKey(props.eventKey)],
+ multiple: props.multiple,
+ prefixCls: props.rootPrefixCls,
+ id: this._menuId,
+ manualRef: this.saveMenuInstance,
+ };
+
+ const haveRendered = this.haveRendered;
+ this.haveRendered = true;
+
+ this.haveOpened = this.haveOpened || baseProps.visible || baseProps.forceSubMenuRender;
+ // never rendered not planning to, don't render
+ if (!this.haveOpened) {
+ return ;
+ }
+
+ // don't show transition on first rendering (no animation for opened menu)
+ // show appear transition if it's not visible (not sure why)
+ // show appear transition if it's not inline mode
+ const transitionAppear = haveRendered || !baseProps.visible || !baseProps.mode === 'inline';
+
+ baseProps.className = ` ${baseProps.prefixCls}-sub`;
+ const animProps = {};
+
+ if (baseProps.openTransitionName) {
+ animProps.transitionName = baseProps.openTransitionName;
+ } else if (typeof baseProps.openAnimation === 'object') {
+ animProps.animation = { ...baseProps.openAnimation };
+ if (!transitionAppear) {
+ delete animProps.animation.appear;
+ }
+ }
+
+ return (
+
+
+
+ );
+ }
+
+ render() {
+ const props = { ...this.props };
+ const isOpen = props.isOpen;
+ const prefixCls = this.getPrefixCls();
+ const isInlineMode = props.mode === 'inline';
+ const className = classNames(prefixCls, `${prefixCls}-${props.mode}`, {
+ [props.className]: !!props.className,
+ [this.getOpenClassName()]: isOpen,
+ [this.getActiveClassName()]: props.active || (isOpen && !isInlineMode),
+ [this.getDisabledClassName()]: props.disabled,
+ [this.getSelectedClassName()]: this.isChildrenSelected(),
+ });
+
+ if (!this._menuId) {
+ if (props.eventKey) {
+ this._menuId = `${props.eventKey}$Menu`;
+ } else {
+ this._menuId = `$__$${++guid}$Menu`;
+ }
+ }
+
+ let mouseEvents = {};
+ let titleClickEvents = {};
+ let titleMouseEvents = {};
+ if (!props.disabled) {
+ mouseEvents = {
+ onMouseLeave: this.onMouseLeave,
+ onMouseEnter: this.onMouseEnter,
+ };
+
+ // only works in title, not outer li
+ titleClickEvents = {
+ onClick: this.onTitleClick,
+ };
+ titleMouseEvents = {
+ onMouseEnter: this.onTitleMouseEnter,
+ onMouseLeave: this.onTitleMouseLeave,
+ };
+ }
+
+ const style = {};
+ if (isInlineMode) {
+ style.paddingLeft = props.inlineIndent * props.level;
+ }
+
+ let ariaOwns = {};
+ // only set aria-owns when menu is open
+ // otherwise it would be an invalid aria-owns value
+ // since corresponding node cannot be found
+ if (this.props.isOpen) {
+ ariaOwns = {
+ 'aria-owns': this._menuId,
+ };
+ }
+
+ const title = (
+
+ {props.title}
+
+
+ );
+ const children = this.renderChildren(props.children);
+
+ const getPopupContainer = props.parentMenu.isRootMenu ?
+ props.parentMenu.props.getPopupContainer : triggerNode => triggerNode.parentNode;
+ const popupPlacement = popupPlacementMap[props.mode];
+ const popupAlign = props.popupOffset ? { offset: props.popupOffset } : {};
+ const popupClassName = props.mode === 'inline' ? '' : props.popupClassName;
+ const {
+ disabled,
+ triggerSubMenuAction,
+ subMenuOpenDelay,
+ forceSubMenuRender,
+ subMenuCloseDelay,
+ } = props;
+ menuAllProps.forEach(key => delete props[key]);
+ // Set onClick to null, to ignore propagated onClick event
+ delete props.onClick;
+
+ return (
+
+ {isInlineMode && title}
+ {isInlineMode && children}
+ {!isInlineMode && (
+
+ {title}
+
+ )}
+
+ );
+ }
+}
+
+const connected = connect(({ openKeys, activeKey, selectedKeys }, { eventKey, subMenuKey }) => ({
+ isOpen: openKeys.indexOf(eventKey) > -1,
+ active: activeKey[subMenuKey] === eventKey,
+ selectedKeys,
+}))(SubMenu);
+
+connected.isSubMenu = true;
+
+export default connected;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/SubPopupMenu.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/SubPopupMenu.js
new file mode 100644
index 0000000..82c5fba
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/SubPopupMenu.js
@@ -0,0 +1,349 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { connect } from 'mini-store';
+import KeyCode from 'rc-util/lib/KeyCode';
+import createChainedFunction from 'rc-util/lib/createChainedFunction';
+import classNames from 'classnames';
+import { getKeyFromChildrenIndex, loopMenuItem, noop, menuAllProps } from './util';
+import DOMWrap from './DOMWrap';
+
+function allDisabled(arr) {
+ if (!arr.length) {
+ return true;
+ }
+ return arr.every(c => !!c.props.disabled);
+}
+
+function updateActiveKey(store, menuId, activeKey) {
+ const state = store.getState();
+ store.setState({
+ activeKey: {
+ ...state.activeKey,
+ [menuId]: activeKey,
+ },
+ });
+}
+
+export function getActiveKey(props, originalActiveKey) {
+ let activeKey = originalActiveKey;
+ const { children, eventKey } = props;
+ if (activeKey) {
+ let found;
+ loopMenuItem(children, (c, i) => {
+ if (c && !c.props.disabled && activeKey === getKeyFromChildrenIndex(c, eventKey, i)) {
+ found = true;
+ }
+ });
+ if (found) {
+ return activeKey;
+ }
+ }
+ activeKey = null;
+ if (props.defaultActiveFirst) {
+ loopMenuItem(children, (c, i) => {
+ if (!activeKey && c && !c.props.disabled) {
+ activeKey = getKeyFromChildrenIndex(c, eventKey, i);
+ }
+ });
+ return activeKey;
+ }
+ return activeKey;
+}
+
+function saveRef(index, c) {
+ if (c) {
+ this.instanceArray[index] = c;
+ }
+}
+
+export class SubPopupMenu extends React.Component {
+ static propTypes = {
+ onSelect: PropTypes.func,
+ onClick: PropTypes.func,
+ onDeselect: PropTypes.func,
+ onOpenChange: PropTypes.func,
+ onDestroy: PropTypes.func,
+ openTransitionName: PropTypes.string,
+ openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
+ openKeys: PropTypes.arrayOf(PropTypes.string),
+ visible: PropTypes.bool,
+ children: PropTypes.any,
+ parentMenu: PropTypes.object,
+ eventKey: PropTypes.string,
+ store: PropTypes.shape({
+ getState: PropTypes.func,
+ setState: PropTypes.func,
+ }),
+
+ // adding in refactor
+ focusable: PropTypes.bool,
+ multiple: PropTypes.bool,
+ style: PropTypes.object,
+ defaultActiveFirst: PropTypes.bool,
+ activeKey: PropTypes.string,
+ selectedKeys: PropTypes.arrayOf(PropTypes.string),
+ defaultSelectedKeys: PropTypes.arrayOf(PropTypes.string),
+ defaultOpenKeys: PropTypes.arrayOf(PropTypes.string),
+ level: PropTypes.number,
+ mode: PropTypes.oneOf(['horizontal', 'vertical', 'vertical-left', 'vertical-right', 'inline']),
+ triggerSubMenuAction: PropTypes.oneOf(['click', 'hover']),
+ inlineIndent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
+ manualRef: PropTypes.func,
+ };
+
+ static defaultProps = {
+ prefixCls: 'rc-menu',
+ className: '',
+ mode: 'vertical',
+ level: 1,
+ inlineIndent: 24,
+ visible: true,
+ focusable: true,
+ style: {},
+ manualRef: noop,
+ };
+
+ constructor(props) {
+ super(props);
+
+ props.store.setState({
+ activeKey: {
+ ...props.store.getState().activeKey,
+ [props.eventKey]: getActiveKey(props, props.activeKey),
+ },
+ });
+ }
+
+ componentWillMount() {
+ this.instanceArray = [];
+ }
+
+ componentDidMount() {
+ // invoke customized ref to expose component to mixin
+ if (this.props.manualRef) {
+ this.props.manualRef(this);
+ }
+ }
+
+ componentWillReceiveProps(nextProps) {
+ const originalActiveKey = 'activeKey' in nextProps ? nextProps.activeKey :
+ this.getStore().getState().activeKey[this.getEventKey()];
+ const activeKey = getActiveKey(nextProps, originalActiveKey);
+ if (activeKey !== originalActiveKey) {
+ updateActiveKey(this.getStore(), this.getEventKey(), activeKey);
+ }
+ }
+
+ shouldComponentUpdate(nextProps) {
+ return this.props.visible || nextProps.visible;
+ }
+
+ // all keyboard events callbacks run from here at first
+ onKeyDown = (e, callback) => {
+ const keyCode = e.keyCode;
+ let handled;
+ this.getFlatInstanceArray().forEach((obj) => {
+ if (obj && obj.props.active && obj.onKeyDown) {
+ handled = obj.onKeyDown(e);
+ }
+ });
+ if (handled) {
+ return 1;
+ }
+ let activeItem = null;
+ if (keyCode === KeyCode.UP || keyCode === KeyCode.DOWN) {
+ activeItem = this.step(keyCode === KeyCode.UP ? -1 : 1);
+ }
+ if (activeItem) {
+ e.preventDefault();
+ updateActiveKey(this.getStore(), this.getEventKey(), activeItem.props.eventKey);
+
+ if (typeof callback === 'function') {
+ callback(activeItem);
+ }
+
+ return 1;
+ }
+ };
+
+ onItemHover = (e) => {
+ const { key, hover } = e;
+ updateActiveKey(this.getStore(), this.getEventKey(), hover ? key : null);
+ };
+
+ onDeselect = (selectInfo) => {
+ this.props.onDeselect(selectInfo);
+ };
+
+ onSelect = (selectInfo) => {
+ this.props.onSelect(selectInfo);
+ }
+
+ onClick = (e) => {
+ this.props.onClick(e);
+ };
+
+ onOpenChange = (e) => {
+ this.props.onOpenChange(e);
+ };
+
+ onDestroy = (key) => {
+ /* istanbul ignore next */
+ this.props.onDestroy(key);
+ };
+
+ getFlatInstanceArray = () => this.instanceArray;
+
+ getStore = () => this.props.store;
+
+ getEventKey = () =>
+ // when eventKey not available ,it's menu and return menu id '0-menu-'
+ this.props.eventKey || '0-menu-'
+ ;
+
+ getOpenTransitionName = () => this.props.openTransitionName;
+
+ step = (direction) => {
+ let children = this.getFlatInstanceArray();
+ const activeKey = this.getStore().getState().activeKey[this.getEventKey()];
+ const len = children.length;
+ if (!len) {
+ return null;
+ }
+ if (direction < 0) {
+ children = children.concat().reverse();
+ }
+ // find current activeIndex
+ let activeIndex = -1;
+ children.every((c, ci) => {
+ if (c && c.props.eventKey === activeKey) {
+ activeIndex = ci;
+ return false;
+ }
+ return true;
+ });
+ if (
+ !this.props.defaultActiveFirst && activeIndex !== -1
+ &&
+ allDisabled(children.slice(activeIndex, len - 1))
+ ) {
+ return undefined;
+ }
+ const start = (activeIndex + 1) % len;
+ let i = start;
+
+ do {
+ const child = children[i];
+ if (!child || child.props.disabled) {
+ i = (i + 1) % len;
+ } else {
+ return child;
+ }
+ } while (i !== start);
+
+ return null;
+ };
+
+ renderCommonMenuItem = (child, i, extraProps) => {
+ const state = this.getStore().getState();
+ const props = this.props;
+ const key = getKeyFromChildrenIndex(child, props.eventKey, i);
+ const childProps = child.props;
+ const isActive = key === state.activeKey;
+ const newChildProps = {
+ mode: props.mode,
+ level: props.level,
+ inlineIndent: props.inlineIndent,
+ renderMenuItem: this.renderMenuItem,
+ rootPrefixCls: props.prefixCls,
+ index: i,
+ parentMenu: props.parentMenu,
+ // customized ref function, need to be invoked manually in child's componentDidMount
+ manualRef: childProps.disabled ? undefined :
+ createChainedFunction(child.ref, saveRef.bind(this, i)),
+ eventKey: key,
+ active: !childProps.disabled && isActive,
+ multiple: props.multiple,
+ onClick: (e) => {
+ (childProps.onClick || noop)(e);
+ this.onClick(e);
+ },
+ onItemHover: this.onItemHover,
+ openTransitionName: this.getOpenTransitionName(),
+ openAnimation: props.openAnimation,
+ subMenuOpenDelay: props.subMenuOpenDelay,
+ subMenuCloseDelay: props.subMenuCloseDelay,
+ forceSubMenuRender: props.forceSubMenuRender,
+ onOpenChange: this.onOpenChange,
+ onDeselect: this.onDeselect,
+ onSelect: this.onSelect,
+ ...extraProps,
+ };
+ if (props.mode === 'inline') {
+ newChildProps.triggerSubMenuAction = 'click';
+ }
+ return React.cloneElement(child, newChildProps);
+ };
+
+ renderMenuItem = (c, i, subMenuKey) => {
+ /* istanbul ignore if */
+ if (!c) {
+ return null;
+ }
+ const state = this.getStore().getState();
+ const extraProps = {
+ openKeys: state.openKeys,
+ selectedKeys: state.selectedKeys,
+ triggerSubMenuAction: this.props.triggerSubMenuAction,
+ subMenuKey,
+ };
+ return this.renderCommonMenuItem(c, i, extraProps);
+ };
+
+ render() {
+ const { ...props } = this.props;
+ this.instanceArray = [];
+ const className = classNames(
+ props.prefixCls,
+ props.className,
+ `${props.prefixCls}-${props.mode}`,
+ );
+ const domProps = {
+ className,
+ // role could be 'select' and by default set to menu
+ role: props.role || 'menu',
+ };
+ if (props.id) {
+ domProps.id = props.id;
+ }
+ if (props.focusable) {
+ domProps.tabIndex = '0';
+ domProps.onKeyDown = this.onKeyDown;
+ }
+ const { prefixCls, eventKey, visible } = props;
+ menuAllProps.forEach(key => delete props[key]);
+
+ // Otherwise, the propagated click event will trigger another onClick
+ delete props.onClick;
+ return (
+ // ESLint is not smart enough to know that the type of `children` was checked.
+ /* eslint-disable */
+
+ {React.Children.map(
+ props.children,
+ (c, i) => this.renderMenuItem(c, i, eventKey || '0-menu-'),
+ )}
+
+ /* eslint-enable */
+ );
+ }
+}
+
+export default connect()(SubPopupMenu);
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/index.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/index.js
new file mode 100644
index 0000000..c841f04
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/index.js
@@ -0,0 +1,9 @@
+import Menu from './Menu';
+import SubMenu from './SubMenu';
+import MenuItem from './MenuItem';
+import MenuItemGroup from './MenuItemGroup';
+import Divider from './Divider';
+
+export { SubMenu, MenuItem as Item, MenuItem, MenuItemGroup, MenuItemGroup as ItemGroup, Divider };
+
+export default Menu;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/placements.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/placements.js
new file mode 100644
index 0000000..52b5cbc
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/placements.js
@@ -0,0 +1,29 @@
+const autoAdjustOverflow = {
+ adjustX: 1,
+ adjustY: 1,
+};
+
+export const placements = {
+ topLeft: {
+ points: ['bl', 'tl'],
+ overflow: autoAdjustOverflow,
+ offset: [0, -7],
+ },
+ bottomLeft: {
+ points: ['tl', 'bl'],
+ overflow: autoAdjustOverflow,
+ offset: [0, 7],
+ },
+ leftTop: {
+ points: ['tr', 'tl'],
+ overflow: autoAdjustOverflow,
+ offset: [-4, 0],
+ },
+ rightTop: {
+ points: ['tl', 'tr'],
+ overflow: autoAdjustOverflow,
+ offset: [4, 0],
+ },
+};
+
+export default placements;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/util.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/util.js
new file mode 100644
index 0000000..62d71b9
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/src/util.js
@@ -0,0 +1,105 @@
+import React from 'react';
+
+export function noop() {
+}
+
+export function getKeyFromChildrenIndex(child, menuEventKey, index) {
+ const prefix = menuEventKey || '';
+ return child.key || `${prefix}item_${index}`;
+}
+
+export function getMenuIdFromSubMenuEventKey(eventKey) {
+ return `${eventKey}-menu-`;
+}
+
+export function loopMenuItem(children, cb) {
+ let index = -1;
+ React.Children.forEach(children, (c) => {
+ index++;
+ if (c && c.type && c.type.isMenuItemGroup) {
+ React.Children.forEach(c.props.children, (c2) => {
+ index++;
+ cb(c2, index);
+ });
+ } else {
+ cb(c, index);
+ }
+ });
+}
+
+export function loopMenuItemRecursively(children, keys, ret) {
+ /* istanbul ignore if */
+ if (!children || ret.find) {
+ return;
+ }
+ React.Children.forEach(children, (c) => {
+ if (c) {
+ const construct = c.type;
+ if (!construct
+ ||
+ !(construct.isSubMenu || construct.isMenuItem || construct.isMenuItemGroup)
+ ) {
+ return;
+ }
+ if (keys.indexOf(c.key) !== -1) {
+ ret.find = true;
+ } else if (c.props.children) {
+ loopMenuItemRecursively(c.props.children, keys, ret);
+ }
+ }
+ });
+}
+
+export const menuAllProps = [
+ 'defaultSelectedKeys',
+ 'selectedKeys',
+ 'defaultOpenKeys',
+ 'openKeys',
+ 'mode',
+ 'getPopupContainer',
+ 'onSelect',
+ 'onDeselect',
+ 'onDestroy',
+ 'openTransitionName',
+ 'openAnimation',
+ 'subMenuOpenDelay',
+ 'subMenuCloseDelay',
+ 'forceSubMenuRender',
+ 'triggerSubMenuAction',
+ 'level',
+ 'selectable',
+ 'multiple',
+ 'onOpenChange',
+ 'visible',
+ 'focusable',
+ 'defaultActiveFirst',
+ 'prefixCls',
+ 'inlineIndent',
+ 'parentMenu',
+ 'title',
+ 'rootPrefixCls',
+ 'eventKey',
+ 'active',
+ 'onItemHover',
+ 'onTitleMouseEnter',
+ 'onTitleMouseLeave',
+ 'onTitleClick',
+ 'popupOffset',
+ 'isOpen',
+ 'renderMenuItem',
+ 'manualRef',
+ 'subMenuKey',
+ 'disabled',
+ 'index',
+ 'isSelected',
+ 'store',
+ 'activeKey',
+
+ // the following keys found need to be removed from test regression
+ 'attribute',
+ 'value',
+ 'popupClassName',
+ 'inlineCollapsed',
+ 'menu',
+ 'theme',
+];
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/Menu.spec.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/Menu.spec.js
new file mode 100644
index 0000000..bb65e42
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/Menu.spec.js
@@ -0,0 +1,264 @@
+/* eslint-disable no-undef, react/no-multi-comp */
+import React from 'react';
+import { render, mount } from 'enzyme';
+import { renderToJson } from 'enzyme-to-json';
+import KeyCode from 'rc-util/lib/KeyCode';
+import Menu, { MenuItem, MenuItemGroup, SubMenu, Divider } from '../src';
+
+describe('Menu', () => {
+ describe('render', () => {
+ function createMenu(props) {
+ return (
+
+ );
+ }
+
+ ['vertical', 'horizontal', 'inline'].forEach((mode) => {
+ it(`renders ${mode} menu correctly`, () => {
+ const wrapper = render(createMenu({ mode }));
+ expect(renderToJson(wrapper)).toMatchSnapshot();
+ });
+ });
+ });
+
+ describe('render role listbox', () => {
+ function createMenu() {
+ return (
+
+ );
+ }
+
+ it('renders menu correctly', () => {
+ const wrapper = render(createMenu());
+ expect(renderToJson(wrapper)).toMatchSnapshot();
+ });
+ });
+
+ it('set activeKey', () => {
+ const wrapper = mount(
+ ,
+ );
+ expect(wrapper.find('MenuItem').first().props().active).toBe(true);
+ expect(wrapper.find('MenuItem').last().props().active).toBe(false);
+ });
+
+ it('active first item', () => {
+ const wrapper = mount(
+ ,
+ );
+ expect(wrapper.find('MenuItem').first().props().active).toBe(true);
+ });
+
+ it('select multiple items', () => {
+ const wrapper = mount(
+ ,
+ );
+ wrapper.find('MenuItem').first().simulate('click');
+ wrapper.find('MenuItem').last().simulate('click');
+
+ expect(wrapper.find('.rc-menu-item-selected').length).toBe(2);
+ });
+
+ it('can be controlled by selectedKeys', () => {
+ const wrapper = mount(
+ ,
+ );
+ expect(wrapper.find('li').first().props().className).toContain('-selected');
+ wrapper.setProps({ selectedKeys: ['2'] });
+ expect(wrapper.find('li').last().props().className).toContain('-selected');
+ });
+
+ it('select default item', () => {
+ const wrapper = mount(
+ ,
+ );
+ expect(wrapper.find('li').first().props().className).toContain('-selected');
+ });
+
+ it('can be controlled by openKeys', () => {
+ const wrapper = mount(
+ ,
+ );
+ expect(wrapper.find('ul').first().props().className).not.toContain('-hidden');
+ wrapper.setProps({ openKeys: ['g2'] });
+ expect(wrapper.find('ul').last().props().className).not.toContain('-hidden');
+ });
+
+ it('open default submenu', () => {
+ const wrapper = mount(
+ ,
+ );
+ expect(wrapper.find('ul').first().props().className).not.toContain('-hidden');
+ });
+
+ it('fires select event', () => {
+ const handleSelect = jest.fn();
+ const wrapper = mount(
+ ,
+ );
+ wrapper.find('MenuItem').first().simulate('click');
+ expect(handleSelect.mock.calls[0][0].key).toBe('1');
+ });
+
+ it('fires click event', () => {
+ const handleClick = jest.fn();
+ const wrapper = mount(
+ ,
+ );
+ wrapper.find('MenuItem').first().simulate('click');
+ expect(handleClick.mock.calls[0][0].key).toBe('1');
+ });
+
+ it('fires deselect event', () => {
+ const handleDeselect = jest.fn();
+ const wrapper = mount(
+ ,
+ );
+ wrapper.find('MenuItem').first().simulate('click').simulate('click');
+ expect(handleDeselect.mock.calls[0][0].key).toBe('1');
+ });
+
+ it('active by mouse enter', () => {
+ const wrapper = mount(
+ ,
+ );
+ let menuItem = wrapper.find('MenuItem').last();
+ menuItem.simulate('mouseEnter');
+ menuItem = wrapper.find('MenuItem').last();
+ expect(menuItem.props().active).toBe(true);
+ });
+
+ it('active by key down', () => {
+ const wrapper = mount(
+ ,
+ );
+
+ wrapper.simulate('keyDown', { keyCode: KeyCode.DOWN });
+ expect(wrapper.find('MenuItem').at(1).props().active).toBe(true);
+ });
+
+ it('keydown works when children change', () => {
+ class App extends React.Component {
+ state = {
+ items: [1, 2, 3],
+ }
+
+ render() {
+ return (
+
+ );
+ }
+ }
+
+ const wrapper = mount();
+
+ wrapper.setState({ items: [0, 1] });
+
+ wrapper.find('Menu').simulate('keyDown', { keyCode: KeyCode.DOWN });
+ expect(wrapper.find('MenuItem').at(0).props().active).toBe(true);
+
+ wrapper.find('Menu').simulate('keyDown', { keyCode: KeyCode.DOWN });
+ expect(wrapper.find('MenuItem').at(1).props().active).toBe(true);
+ });
+
+ it('active first item when children changes', () => {
+ class App extends React.Component {
+ state = {
+ items: ['foo'],
+ }
+
+ render() {
+ return (
+
+ );
+ }
+ }
+
+ const wrapper = mount();
+
+ wrapper.setState({ items: ['bar', 'foo'] });
+
+ expect(
+ wrapper.find('li').first().hasClass('rc-menu-item-active'),
+ ).toBe(true);
+ });
+});
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/MenuItem.spec.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/MenuItem.spec.js
new file mode 100644
index 0000000..567855e
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/MenuItem.spec.js
@@ -0,0 +1,127 @@
+/* eslint-disable no-undef */
+import React from 'react';
+import { mount, shallow } from 'enzyme';
+import KeyCode from 'rc-util/lib/KeyCode';
+import Menu, { MenuItem, MenuItemGroup, SubMenu } from '../src';
+
+import { MenuItem as NakedMenuItem } from '../src/MenuItem';
+
+describe('MenuItem', () => {
+ describe('disabled', () => {
+ it('can not be active by key down', () => {
+ const wrapper = mount(
+ ,
+ );
+
+ wrapper.simulate('keyDown', { keyCode: KeyCode.DOWN });
+ expect(wrapper.find('MenuItem').at(1).props().active).toBe(false);
+ });
+
+ it('not fires select event when selected', () => {
+ const handleSelect = jest.fn();
+ const wrapper = mount(
+ ,
+ );
+
+ wrapper.find('.xx').simulate('click');
+ expect(handleSelect).not.toBeCalled();
+ });
+ });
+
+ describe('menuItem events', () => {
+ let onMouseEnter;
+ let onMouseLeave;
+ let onItemHover;
+ let wrapper;
+ let instance;
+ const domEvent = { keyCode: 13 };
+ const key = '1';
+
+ beforeEach(() => {
+ onMouseEnter = jest.fn();
+ onMouseLeave = jest.fn();
+ onItemHover = jest.fn();
+
+ wrapper = shallow(
+ 1);
+ instance = wrapper.instance();
+ });
+
+ it('on enter key down should trigger mouse click', () => {
+ instance.onClick = jest.fn();
+ instance.onKeyDown(domEvent);
+
+ expect(instance.onClick).toHaveBeenCalledWith(domEvent);
+ });
+
+ it('on mouse enter should trigger props.onItemHover props.onMouseEnter', () => {
+ instance.onMouseEnter(domEvent);
+
+ expect(onItemHover).toHaveBeenCalledWith({ key, hover: true });
+ expect(onMouseEnter).toHaveBeenCalledWith({ key, domEvent });
+ });
+
+ it('on mouse leave should trigger props.onItemHover props.onMouseLeave', () => {
+ instance.onMouseLeave(domEvent);
+
+ expect(onItemHover).toHaveBeenCalledWith({ key, hover: false });
+ expect(onMouseLeave).toHaveBeenCalledWith({ key, domEvent });
+ });
+ });
+
+ describe('rest props', () => {
+ it('can render all props to sub component', () => {
+ const onClick = jest.fn();
+ const restProps = {
+ onClick,
+ 'data-whatever': 'whatever',
+ title: 'title',
+ className: 'className',
+ style: { fontSize: 20 },
+ };
+ const wrapper = mount(
+ ,
+ );
+ expect(wrapper.render()).toMatchSnapshot();
+ wrapper.find('MenuItem').at(0).simulate('click');
+ expect(onClick).toHaveBeenCalledTimes(1);
+ wrapper.find('MenuItemGroup').at(0).simulate('click');
+ expect(onClick).toHaveBeenCalledTimes(2);
+ });
+ });
+
+ describe('overwrite default role', () => {
+ it('should set empty role', () => {
+ const wrapper = shallow(test);
+
+ expect(wrapper.render()).toMatchSnapshot();
+ });
+
+ it('should set specific role', () => {
+ const wrapper = shallow(test);
+
+ expect(wrapper.render()).toMatchSnapshot();
+ });
+ });
+});
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/SubMenu.spec.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/SubMenu.spec.js
new file mode 100644
index 0000000..0a42472
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/SubMenu.spec.js
@@ -0,0 +1,359 @@
+/* eslint-disable no-undef */
+import React from 'react';
+import PropTypes from 'prop-types';
+import { mount } from 'enzyme';
+import KeyCode from 'rc-util/lib/KeyCode';
+import Menu, { MenuItem, SubMenu } from '../src';
+
+describe('SubMenu', () => {
+ beforeAll(() => {
+ jest.useFakeTimers();
+ });
+
+ afterAll(() => {
+ });
+
+ function createMenu(props) {
+ return (
+
+ );
+ }
+
+ it('don\'t show submenu when disabled', () => {
+ const wrapper = mount(
+ ,
+ );
+ wrapper.find('.rc-menu-submenu-title').first().simulate('mouseEnter');
+ expect(wrapper.instance().store.getState().openKeys).toEqual([]);
+ });
+
+ it('offsets the submenu popover', () => {
+ const wrapper = mount(
+ ,
+ );
+
+ const popupAlign = wrapper.find('Trigger').prop('popupAlign');
+ expect(popupAlign).toEqual({ offset: [0, 15] });
+ });
+
+ describe('openSubMenuOnMouseEnter and closeSubMenuOnMouseLeave are true', () => {
+ it('toggles when mouse enter and leave', () => {
+ const wrapper = mount(createMenu());
+
+ wrapper.find('.rc-menu-submenu-title').first().simulate('mouseEnter');
+ jest.runAllTimers();
+ expect(wrapper.instance().store.getState().openKeys).toEqual(['s1']);
+
+ wrapper.find('.rc-menu-submenu-title').first().simulate('mouseLeave');
+ jest.runAllTimers();
+ expect(wrapper.instance().store.getState().openKeys).toEqual([]);
+ });
+ });
+
+ describe('openSubMenuOnMouseEnter and closeSubMenuOnMouseLeave are false', () => {
+ let wrapper;
+
+ beforeEach(() => {
+ wrapper = mount(createMenu({
+ triggerSubMenuAction: 'click',
+ }));
+ });
+
+ it('toggles when mouse click', () => {
+ wrapper.find('.rc-menu-submenu-title').first().simulate('click');
+ expect(wrapper.instance().store.getState().openKeys).toEqual(['s1']);
+
+ wrapper.find('.rc-menu-submenu-title').first().simulate('click');
+ expect(wrapper.instance().store.getState().openKeys).toEqual([]);
+ });
+ });
+
+ it('fires openChange event', () => {
+ const handleOpenChange = jest.fn();
+ const wrapper = mount(
+ ,
+ );
+
+ wrapper.find('.rc-menu-submenu-title').at(0).simulate('mouseEnter');
+ jest.runAllTimers();
+ expect(handleOpenChange).toBeCalledWith(['item_1']);
+
+ wrapper.update();
+
+ wrapper.find('.rc-menu-submenu-title').at(1).simulate('mouseEnter');
+ jest.runAllTimers();
+ expect(handleOpenChange).toBeCalledWith(['item_1', 'item_1-menu-item_1']);
+ });
+
+ describe('mouse events', () => {
+ it('mouse enter event on a submenu should not activate first item', () => {
+ const wrapper = mount(createMenu({ openKeys: ['s1'] }));
+ const title = wrapper.find('.rc-menu-submenu-title').first();
+ title.simulate('mouseEnter');
+
+ jest.runAllTimers();
+ wrapper.update();
+
+ expect(wrapper.find('.rc-menu-sub').first().is('.rc-menu-hidden')).toBe(false);
+ expect(wrapper.find('MenuItem').first().props().active).toBe(false);
+ });
+
+ it('click to open a submenu should not activate first item', () => {
+ const wrapper = mount(createMenu({ triggerSubMenuAction: 'click' }));
+ const subMenuTitle = wrapper.find('.rc-menu-submenu-title').first();
+ subMenuTitle.simulate('click');
+
+ jest.runAllTimers();
+ wrapper.update();
+
+ expect(wrapper.find('.rc-menu-sub').first().is('.rc-menu-hidden')).toBe(false);
+ expect(wrapper.find('MenuItem').first().props().active).toBe(false);
+ });
+
+ it('mouse enter/mouse leave on a subMenu item should trigger hooks', () => {
+ const onMouseEnter = jest.fn();
+ const onMouseLeave = jest.fn();
+ const wrapper = mount(
+ ,
+ );
+ const subMenu = wrapper.find('.rc-menu-submenu').first();
+
+ subMenu.simulate('mouseEnter');
+ expect(onMouseEnter).toHaveBeenCalledTimes(1);
+
+ subMenu.simulate('mouseLeave');
+ expect(onMouseLeave).toHaveBeenCalledTimes(1);
+ });
+ });
+
+ describe('key press', () => {
+ describe('enter key', () => {
+ it('opens menu and active first item', () => {
+ const wrapper = mount(createMenu());
+ const title = wrapper.find('.rc-menu-submenu-title').first();
+
+ title.simulate('mouseEnter').simulate('keyDown', { keyCode: KeyCode.ENTER });
+
+ jest.runAllTimers();
+ wrapper.update();
+
+ expect(wrapper.find('.rc-menu-sub').first().is('.rc-menu-hidden')).toBe(false);
+ expect(wrapper.find('MenuItem').first().props().active).toBe(true);
+ });
+ });
+
+ describe('left & right key', () => {
+ it('toggles menu', () => {
+ const wrapper = mount(createMenu({ defaultActiveFirst: true }));
+ const title = wrapper.find('.rc-menu-submenu-title').first();
+
+ title.simulate('mouseEnter').simulate('keyDown', { keyCode: KeyCode.LEFT });
+ expect(wrapper.instance().store.getState().openKeys).toEqual([]);
+ title.simulate('keyDown', { keyCode: KeyCode.RIGHT });
+ expect(wrapper.instance().store.getState().openKeys).toEqual(['s1']);
+ expect(wrapper.find('MenuItem').first().props().active).toBe(true);
+ });
+ });
+
+ it('up & down key', () => {
+ const wrapper = mount(createMenu());
+ const titles = wrapper.find('.rc-menu-submenu-title');
+
+ titles.first().simulate('mouseEnter')
+ .simulate('keyDown', { keyCode: KeyCode.LEFT })
+ .simulate('keyDown', { keyCode: KeyCode.DOWN });
+ expect(wrapper.find('.rc-menu-submenu').last().is('.rc-menu-submenu-active')).toBe(true);
+
+ titles.last().simulate('keyDown', { keyCode: KeyCode.UP });
+ expect(wrapper.find('.rc-menu-submenu').first().is('.rc-menu-submenu-active')).toBe(true);
+ });
+
+ it('combined key presses', () => {
+ const wrapper = mount(createMenu());
+ const titles = wrapper.find('.rc-menu-submenu-title');
+ const firstItem = titles.first();
+
+ // testing keydown event after submenu is closed and then opened again
+ firstItem.simulate('mouseEnter')
+ .simulate('keyDown', { keyCode: KeyCode.RIGHT })
+ .simulate('keyDown', { keyCode: KeyCode.LEFT })
+ .simulate('keyDown', { keyCode: KeyCode.RIGHT })
+ .simulate('keyDown', { keyCode: KeyCode.DOWN })
+ .simulate('keyDown', { keyCode: KeyCode.DOWN })
+ .simulate('keyDown', { keyCode: KeyCode.DOWN });
+
+ expect(
+ wrapper
+ .find('[title="submenu1-1"]')
+ .find('.rc-menu-submenu')
+ .first()
+ .is('.rc-menu-submenu-active'),
+ ).toBe(true);
+ });
+ });
+
+ it('fires select event', () => {
+ const handleSelect = jest.fn();
+ const wrapper = mount(createMenu({ onSelect: handleSelect }));
+ wrapper.find('.rc-menu-submenu-title').first().simulate('mouseEnter');
+
+ jest.runAllTimers();
+ wrapper.update();
+
+ wrapper.find('MenuItem').first().simulate('click');
+ expect(handleSelect.mock.calls[0][0].key).toBe('s1-1');
+ });
+
+ it('fires select event', () => {
+ const wrapper = mount(createMenu());
+ wrapper.find('.rc-menu-submenu-title').first().simulate('mouseEnter');
+
+ jest.runAllTimers();
+ wrapper.update();
+
+ wrapper.find('MenuItem').first().simulate('click');
+ expect(wrapper.find('.rc-menu-submenu').first().is('.rc-menu-submenu-selected')).toBe(true);
+ });
+
+ it('fires deselect event for multiple menu', () => {
+ const handleDeselect = jest.fn();
+ const wrapper = mount(createMenu({
+ multiple: true,
+ onDeselect: handleDeselect,
+ }));
+ wrapper.find('.rc-menu-submenu-title').first().simulate('mouseEnter');
+
+ jest.runAllTimers();
+ wrapper.update();
+
+ wrapper.find('MenuItem').first().simulate('click');
+ wrapper.find('MenuItem').first().simulate('click');
+
+ expect(handleDeselect.mock.calls[0][0].key).toBe('s1-1');
+ });
+
+ describe('horizontal menu', () => {
+ it('should automatically adjust width', () => {
+ const props = {
+ mode: 'horizontal',
+ openKeys: ['s1'],
+ };
+
+ const wrapper = mount(
+ ,
+ );
+
+ const subMenuInstance = wrapper.find('SubMenu').first().instance();
+ const adjustWidthSpy = jest.spyOn(subMenuInstance, 'adjustWidth');
+
+ jest.runAllTimers();
+
+ expect(adjustWidthSpy).toHaveBeenCalledTimes(2);
+ });
+ });
+
+ describe('submenu animation', () => {
+ const appear = () => {};
+
+ it('should animate with transition class', () => {
+ const wrapper = mount(createMenu({
+ openTransitionName: 'fade',
+ mode: 'inline',
+ }));
+
+ const title = wrapper.find('.rc-menu-submenu-title').first();
+
+ title.simulate('click');
+ jest.runAllTimers();
+
+ expect(wrapper.find('Animate').prop('transitionName')).toEqual('fade');
+ });
+
+ it('should animate on initially opened menu', () => {
+ const wrapper = mount(createMenu({
+ openAnimation: { appear },
+ mode: 'inline',
+ openKeys: ['s1'],
+ }));
+
+ expect(wrapper.find('Animate').first().prop('animation')).toEqual({ appear });
+ });
+
+ it('should animate with config', () => {
+ const wrapper = mount(createMenu({
+ openAnimation: { appear },
+ mode: 'inline',
+ }));
+
+ const title = wrapper.find('.rc-menu-submenu-title').first();
+
+ title.simulate('click');
+ jest.runAllTimers();
+
+ expect(wrapper.find('Animate').first().prop('animation')).toEqual({ appear });
+ });
+ });
+
+ describe('.componentWillUnmount()', () => {
+ it('should invoke hooks', () => {
+ const onDestroy = jest.fn();
+ const App = props => (
+
+ );
+
+ App.propTypes = {
+ show: PropTypes.bool,
+ };
+
+ const wrapper = mount();
+
+ wrapper.setProps({ show: false });
+
+ expect(onDestroy).toHaveBeenCalledWith('s1');
+ });
+ });
+});
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__mocks__/rc-trigger.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__mocks__/rc-trigger.js
new file mode 100644
index 0000000..3230307
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__mocks__/rc-trigger.js
@@ -0,0 +1,3 @@
+import Trigger from 'rc-trigger/lib/mock';
+
+export default Trigger;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__snapshots__/Menu.spec.js.snap b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__snapshots__/Menu.spec.js.snap
new file mode 100644
index 0000000..1fe60a6
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__snapshots__/Menu.spec.js.snap
@@ -0,0 +1,299 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Menu render renders horizontal menu correctly 1`] = `
+
+`;
+
+exports[`Menu render renders inline menu correctly 1`] = `
+
+`;
+
+exports[`Menu render renders vertical menu correctly 1`] = `
+
+`;
+
+exports[`Menu render role listbox renders menu correctly 1`] = `
+
+`;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__snapshots__/MenuItem.spec.js.snap b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__snapshots__/MenuItem.spec.js.snap
new file mode 100644
index 0000000..86edeeb
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/__snapshots__/MenuItem.spec.js.snap
@@ -0,0 +1,81 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`MenuItem overwrite default role should set empty role 1`] = `
+
+ test
+
+`;
+
+exports[`MenuItem overwrite default role should set specific role 1`] = `
+
+ test
+
+`;
+
+exports[`MenuItem rest props can render all props to sub component 1`] = `
+
+`;
diff --git a/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/setup.js b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/setup.js
new file mode 100644
index 0000000..684b8a6
--- /dev/null
+++ b/pc4backstage/pc4public/portal/_rc/_rc-menu-7.0.3/tests/setup.js
@@ -0,0 +1,8 @@
+global.requestAnimationFrame = global.requestAnimationFrame || function requestAnimationFrame(cb) {
+ return setTimeout(cb, 0);
+};
+
+const Enzyme = require('enzyme');
+const Adapter = require('enzyme-adapter-react-16');
+
+Enzyme.configure({ adapter: new Adapter() });
diff --git a/pc4backstage/pc4public/portal/index.js b/pc4backstage/pc4public/portal/index.js
new file mode 100644
index 0000000..c005efa
--- /dev/null
+++ b/pc4backstage/pc4public/portal/index.js
@@ -0,0 +1,11 @@
+import WeaThemeCenter from './wea-theme-center';
+import WeaThemeLayout from './wea-theme-layout';
+import WeaMaterialLib from './wea-materiallib';
+import WeaPlugin from './wea-plugin';
+import WeaLicense from './wea-license';
+import WeaVersion from './wea-version';
+import WeaSystemSetting from './wea-system-setting';
+import WeaDocument from './wea-document';
+import WeaShowHelp from './wea-show-help';
+
+export { WeaThemeCenter, WeaThemeLayout, WeaMaterialLib, WeaPlugin, WeaLicense, WeaVersion, WeaSystemSetting, WeaDocument, WeaShowHelp };
diff --git a/pc4backstage/pc4public/portal/wea-birthday/index.js b/pc4backstage/pc4public/portal/wea-birthday/index.js
new file mode 100644
index 0000000..0cc8fc4
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-birthday/index.js
@@ -0,0 +1,70 @@
+import React from 'react';
+import { Modal } from 'antd';
+import { WeaTools } from 'ecCom';
+import './style/index';
+
+class WeaBirthday extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ visible: false,
+ birthdayInfo: { bgimg: '', curdate: '', congratulation: '', textcolor: '', usercolor: '', userlist: [] },
+ };
+ }
+
+ componentWillMount() {
+ const date = new Date();
+ const today = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
+ const __date = WeaTools.ls.getStr('birthday-date');
+ if (today != __date) {
+ WeaTools.callApi('/api/portal/plugin/birthdayinfo', 'POST', {}).then((result) => {
+ if (result.userlist && result.userlist.length) {
+ this.setState({
+ visible: true,
+ birthdayInfo: result,
+ });
+
+ WeaTools.ls.set('birthday-date', today);
+ setTimeout(() => this.setState({ visible: false }), 14 * 1000);
+ }
+ });
+ }
+ }
+
+ render() {
+ const { visible, birthdayInfo } = this.state;
+ const { bgimg, curdate, congratulation, textcolor, usercolor, userlist } = birthdayInfo;
+
+ return (
+ this.setState({ visible: false })}
+ onCancel={() => this.setState({ visible: false })}
+ >
+
+
+
+ {
+ userlist.map((item, index) => (
+
+
{item.lastname}
+
{item.detialInfo}
+
+ ))
+ }
+
+
+
+ );
+ }
+}
+
+export default WeaBirthday;
diff --git a/pc4backstage/pc4public/portal/wea-birthday/style/index.css b/pc4backstage/pc4public/portal/wea-birthday/style/index.css
new file mode 100644
index 0000000..b51d93e
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-birthday/style/index.css
@@ -0,0 +1,84 @@
+.birthday-modal {
+ width: 100%;
+ height: 100%;
+}
+
+.birthday-modal .ant-modal {
+ position: relative;
+ top: 50%;
+ margin-top: -238px;
+ padding-bottom: 0;
+}
+
+.birthday-modal .ant-modal-content {
+ border: 0;
+ border-radius: 0;
+}
+
+.birthday-modal .ant-modal-header {
+ padding: 5px 16px;
+ color: #fff;
+ background-color: #4f81bd;
+ border: 0;
+ border-radius: 0;
+}
+
+.birthday-modal .ant-modal-body {
+ padding: 0;
+ border: 0;
+ border-radius: 0;
+}
+
+.birthday-modal .ant-modal-close {
+ top: 10px;
+ right: 10px;
+ color: #fff;
+}
+
+.birthday-content {
+ position: relative;
+ width: 499px;
+ height: 475px;
+ padding: 247px 30px 20px 30px;
+}
+
+.birthday-congratulation {
+ width: 100%;
+ height: auto;
+}
+
+.birthday-congratulation-content {
+ text-align: left;
+}
+
+.birthday-congratulation-date {
+ text-align: right;
+}
+
+.birthday-users {
+ width: 100%;
+ height: 140px;
+ overflow: hidden;
+ vertical-align: middle;
+}
+
+.birthday-user {
+ height: 20px;
+ line-height: 20px;
+}
+
+.birthday-user-lastname {
+ float: left;
+ width: 100px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.birthday-user-detial {
+ float: left;
+ width: 300px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
diff --git a/pc4backstage/pc4public/portal/wea-birthday/style/index.js b/pc4backstage/pc4public/portal/wea-birthday/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-birthday/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-color-input/index.js b/pc4backstage/pc4public/portal/wea-color-input/index.js
new file mode 100644
index 0000000..0f6801f
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-color-input/index.js
@@ -0,0 +1,44 @@
+import React from 'react';
+import { Popover } from 'antd';
+import 'rc-color-picker/assets/index.css';
+import { Panel as ColorPickerPanel } from 'rc-color-picker';
+import { WeaInput } from 'ecCom';
+import './style/index';
+
+class WeaColorInput extends React.Component {
+ constructor(props) {
+ super(props);
+ this.onChange = this.onChange.bind(this);
+ }
+
+ onChange(value) {
+ this.props.onChange(value);
+ }
+
+ render() {
+ const { color = '#000', layout } = this.props;
+
+ return (
+
+
this.onChange(obj.color)}
+ mode="RGB"
+ />
+ }
+ trigger="click"
+ getTooltipContainer={() => layout || document.body}
+ overlayClassName="portal-wea-ci-popover"
+ >
+
+
+
+
+ );
+ }
+}
+
+export default WeaColorInput;
diff --git a/pc4backstage/pc4public/portal/wea-color-input/style/index.css b/pc4backstage/pc4public/portal/wea-color-input/style/index.css
new file mode 100644
index 0000000..38c9924
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-color-input/style/index.css
@@ -0,0 +1,24 @@
+.portal-wea-ci {
+ display: inline-block;
+ position: relative;
+ width: 100px;
+}
+
+.portal-wea-ci-popover .ant-popover-arrow {
+ display: none;
+}
+
+.portal-wea-ci-popover .ant-popover-inner-content {
+ padding: 0;
+}
+
+.portal-wea-ci-btn {
+ position: absolute;
+ z-index: 999;
+ top: 7px;
+ right: 7px;
+ width: 15px;
+ height: 15px;
+ border: 1px solid #eee;
+ cursor: pointer;
+}
diff --git a/pc4backstage/pc4public/portal/wea-color-input/style/index.js b/pc4backstage/pc4public/portal/wea-color-input/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-color-input/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-custom-setting/index.js b/pc4backstage/pc4public/portal/wea-custom-setting/index.js
new file mode 100644
index 0000000..9fcec1e
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-custom-setting/index.js
@@ -0,0 +1,83 @@
+import React from 'react';
+import { inject, observer } from 'mobx-react';
+import { Button, Row, Col, Spin } from 'antd';
+import { WeaTools, WeaLocaleProvider, WeaErrorPage, WeaSearchGroup, WeaFormItem, WeaCheckbox } from 'ecCom';
+const getLabel = WeaLocaleProvider.getLabel;
+import { PortalSetting } from 'weaPortal';
+import PortalMenu from '../wea-portalmenu/';
+
+import './style/';
+
+class SettingButton extends React.Component {
+ render() {
+ return (
+
+
+
+
+
+ );
+ }
+}
+
+class SwitchButton extends React.Component {
+ render() {
+ return (
+
+ this.props.onSetState(value)} />
+
+ );
+ }
+}
+
+@inject('weaportal_customsetting_store')
+@observer
+class WeaCustomSetting extends React.Component {
+ constructor(props) {
+ super(props);
+ this.onPortalSetting = this.onPortalSetting.bind(this);
+ }
+
+ componentWillMount() {
+ const { weaportal_customsetting_store } = this.props;
+ weaportal_customsetting_store.getPortalData();
+ }
+
+ onPortalSetting(params) {
+ this.refs.portalsetting.handleOnSetting({
+ from: 'addElement',
+ viewtype: 'edit',
+ isSetting: true,
+ ...params,
+ });
+ }
+
+ render() {
+ const { weaportal_customsetting_store } = this.props;
+ const { state, onSetState } = weaportal_customsetting_store;
+ const { loading, isRemeberTab, isOpenSortTopByUsage, isSortTopByUsage, quickSearchShowMenu, hplist } = state;
+
+ return (
+
+
+
+
+
+ this.refs.portalmenu.onShow({ type: 'top' })} />
+ this.refs.portalmenu.onShow({ type: 'left' })} />
+ {isOpenSortTopByUsage == '1' ? onSetState({ isSortTopByUsage: value })} /> : ''}
+ onSetState({ quickSearchShowMenu: value })} />
+
+
+ {hplist.map(item => )}
+
+
+ onSetState({ isRemeberTab: value })} />
+
+
+
+ );
+ }
+}
+
+export default WeaCustomSetting;
diff --git a/pc4backstage/pc4public/portal/wea-custom-setting/style/index.css b/pc4backstage/pc4public/portal/wea-custom-setting/style/index.css
new file mode 100644
index 0000000..ff6e560
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-custom-setting/style/index.css
@@ -0,0 +1,10 @@
+.wea-custom-setting-btn {
+ color: #b2b2b2;
+ font-size: 16px;
+}
+.wea-custom-setting-btn i{
+ cursor: pointer;
+}
+.wea-custom-setting-btn i:hover {
+ color: #2db7f5;
+}
diff --git a/pc4backstage/pc4public/portal/wea-custom-setting/style/index.js b/pc4backstage/pc4public/portal/wea-custom-setting/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-custom-setting/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-document/plugin.js b/pc4backstage/pc4public/portal/wea-document/plugin.js
new file mode 100644
index 0000000..43bdc1d
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-document/plugin.js
@@ -0,0 +1,56 @@
+import { WeaTools,WeaLocaleProvider,WeaDialog } from 'ecCom';
+import isEmpty from 'lodash/isEmpty';
+import ReactDOM from 'react-dom';
+import {Button} from 'antd';
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+(function () {
+ WeaTools.callApi('/api/doc/console/multi/openWin/getOpenDocs', 'GET', {}).then(result => {
+ if(result.api_status){
+ const docs = result.docs || [];
+ Array.isArray(docs) && !isEmpty(docs) && docs.forEach(v => {
+ const div = document.createElement('div');
+ document.body.appendChild(div);
+ ReactDOM.render(
+ {
+
+ const _ob = document.getElementsByClassName("docPropDialog_" + v.id);
+
+ if(_ob){
+ try {
+ _ob[0].remove();
+ } catch(Err){
+ try {
+ _ob[0].parentNode.removeNode(true);
+ }catch(e) {
+
+ }
+ }
+ }
+ }}
+ >
+
+
+
+
+
+ , div);
+ })
+ }
+ });
+})();
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/wea-license/LicenseMessage.js b/pc4backstage/pc4public/portal/wea-license/LicenseMessage.js
new file mode 100644
index 0000000..404431a
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-license/LicenseMessage.js
@@ -0,0 +1,93 @@
+import React from 'react';
+import { Icon } from 'antd';
+
+class LicenseMessage extends React.Component {
+ render() {
+ const { message } = this.props;
+
+ if (message == '1') {
+ return (
+
+
+ Success !
+
+ );
+ }
+
+ let msgComp = ;
+ if (message == '0') {
+ msgComp = (
+
+
License信息错误,请检查启动脚本是否包含GBK字符集并重新启动Resin尝试,并且检查License是否正确(E8要求更换公司名称的授权必须清空ecology/license目录再重启Resin提交)!
+
License message error, please check the start script contain 'GBK' and try to restart Resin and check if the License is correct(you must clear ecology/license and restart resin before you upload the difference conpanyname License in E8)!
+
+ );
+ } else if (message == '2') {
+ msgComp = (
+
+
+ 数据库连接或者执行失败,请按下列步骤检查:
+ 1.检查数据库服务器是否正常;
+ 2.检查数据库驱动包是否存在;
+ 3.检查weaver.properies配置信息是否正确;
+ 4.检查ecology日志是否有异常!
+
+
+ Failed to Connect Data Server, please check by step as below:
+ 1.checking the Data Server is OK;
+ 2.checking the SQL driver is exist;
+ 3.checking the message of the file 'weaver.properies' is right;
+ 4.Check ecology log exception!
+
+
+ );
+ } else if (message == '3') {
+ msgComp = (
+
+
License文件上传出错!
+
License file uploading error!
+
+ );
+ } else if (message == '4') {
+ msgComp = (
+
+
License信息错误,License已过期!
+
License message error, license is overdue!
+
+ );
+ } else if (message == '5') {
+ msgComp = (
+
+
License信息错误,已分配用户数大于License申请人数!
+
License message error, the HRMs is larger than the apllied in the license!
+
+ );
+ } else if (message == '6') {
+ msgComp = (
+
+
没有选择正确的License文件或者License文件不存在!
+
Wrong choosing License file or License file is not exist!
+
+ );
+ } else if (message == '7') {
+ msgComp = (
+
+
+ 1.验证码不得为空!
+ 2.系统设置表SystemSet字段filesystem值对应路径(默认为空)不存在或者没有写权限,详细见ecology/log/ecology日志!
+
+
+ 1.Verification code must not be empty!
+ 2.System error, detail to see the ecology log!
+
+
+ );
+ } else {
+ msgComp = {message}
;
+ }
+
+ return {msgComp}
;
+ }
+}
+
+export default LicenseMessage;
diff --git a/pc4backstage/pc4public/portal/wea-license/LicenseSubmit.js b/pc4backstage/pc4public/portal/wea-license/LicenseSubmit.js
new file mode 100644
index 0000000..110c685
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-license/LicenseSubmit.js
@@ -0,0 +1,171 @@
+import React from 'react';
+import { Button, Icon, message } from 'antd';
+import { WeaTools, WeaDialog, WeaFormItem, WeaInput, WeaUpload } from 'ecCom';
+
+import LicenseMessage from './LicenseMessage';
+
+class LicenseSubmit extends React.Component {
+ state = { visible: false, isShowMsg: false, isChangeCode: false };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.getLicenseCode = this.getLicenseCode.bind(this);
+ this.onChange = this.onChange.bind(this);
+ this.onSubmit = this.onSubmit.bind(this);
+ this.onSubmitCode = this.onSubmitCode.bind(this);
+ this.onBack = this.onBack.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ }
+
+ render() {
+ const { code = '', code_old = '', code_new = '', code_rep = '' } = this.state;
+
+ let displayComp = (
+
+
+ this.setState({ code: value })} />
+ this.setState({ isChangeCode: true })}>更改验证码
+
+
+
+
+
+
+
+
+
+ 提示:将公司名称及识别码提交给软件供应商,以获取License。
+
+
+ );
+
+ if (this.state.isShowMsg) {
+ displayComp = ;
+ }
+
+ if (this.state.isChangeCode) {
+ displayComp = (
+
+
+ this.setState({ code_old: value })} />
+
+
+ this.setState({ code_new: value })} />
+
+
+ this.setState({ code_rep: value })} />
+
+
+ );
+ }
+
+ return (
+
+ {displayComp}
+
+ );
+ }
+
+ getButtons() {
+ const { isShowMsg, isChangeCode } = this.state;
+
+ let buttons = [];
+ if (isChangeCode) {
+ buttons.push();
+ buttons.push();
+ } else {
+ if (isShowMsg) {
+ buttons.push();
+ } else {
+ buttons.push();
+ }
+ buttons.push();
+ }
+ return buttons;
+ }
+
+ getLicenseCode() {
+ WeaTools.callApi('/api/system/license/InLicense', 'POST', {}).then((data) => {
+ this.setState({ ...data });
+ });
+ }
+
+ onChange(ids, list, args) {
+ const _message = args[0].message;
+ this.setState({ isShowMsg: true, message: _message });
+ }
+
+ onSubmit() {
+ const { code = '' } = this.state;
+ if (code.trim() != '') {
+ this.refs.WeaUpload.doUpload();
+ } else {
+ message.warning('必要信息不完整!');
+ }
+ }
+
+ onSubmitCode() {
+ const { code_old = '', code_new = '', code_rep = '' } = this.state;
+
+ if (code_old.trim() != '' && code_new.trim() != '' && code_rep.trim() != '') {
+ if (code_new === code_rep) {
+ WeaTools.callApi('/api/system/license/CodeOperation', 'POST', {
+ passwordold: code_old,
+ passwordnew: code_new,
+ }).then((data) => {
+ const _message = data.message;
+ if (_message == '1') {
+ message.error('旧的验证码不正确!');
+ } else {
+ message.success(_message);
+ this.onBack();
+ }
+ });
+ } else {
+ message.warning('两次输入的新验证码不同!');
+ }
+ } else {
+ message.warning('必要信息不完整!');
+ }
+ }
+
+ onBack() {
+ this.setState({ isShowMsg: false, isChangeCode: false, message: '', code: '', code_old: '', code_new: '', code_rep: '' });
+ }
+
+ onCancel() {
+ this.setState({ visible: false, isShowMsg: false, isChangeCode: false, message: '', code: '', code_old: '', code_new: '', code_rep: '' });
+ }
+
+ onShow() {
+ this.setState({ visible: true });
+ this.getLicenseCode();
+ }
+}
+
+export default LicenseSubmit;
diff --git a/pc4backstage/pc4public/portal/wea-license/index.js b/pc4backstage/pc4public/portal/wea-license/index.js
new file mode 100644
index 0000000..0e460ff
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-license/index.js
@@ -0,0 +1,101 @@
+import React from 'react';
+import { Button } from 'antd';
+import { WeaTools, WeaDialog, WeaSearchGroup, WeaFormItem, WeaInput } from 'ecCom';
+
+import './style/';
+import LicenseSubmit from './LicenseSubmit';
+
+class WeaLicense extends React.Component {
+ state = { visible: false, data: {} };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.getLicenseInfo = this.getLicenseInfo.bind(this);
+ this.onSubmit = this.onSubmit.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.onShow = this.onShow.bind(this);
+ }
+
+ render() {
+ const { data } = this.state;
+ const { companyName, licenseCode, hrmNum, scCount, expireDate, concurrentFlag, onlineusercount, licensenum, unusedlice } = data;
+
+ const colProps = {
+ labelCol: { span: 8 },
+ wrapperCol: { span: 16 },
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+
+ getButtons() {
+ const { data } = this.state;
+
+ let buttons = [];
+ if (data.canEdit) {
+ buttons.push();
+ }
+ return buttons;
+ }
+
+ getLicenseInfo() {
+ WeaTools.callApi('/api/system/license/licenseInfo', 'POST', {}).then((data) => {
+ this.setState({ data });
+ });
+ }
+
+ onSubmit() {
+ this.refs.LicenseSubmit.onShow();
+ }
+
+ onCancel() {
+ this.setState({ visible: false });
+ }
+
+ onShow() {
+ this.setState({ visible: true });
+ this.getLicenseInfo();
+ }
+}
+
+export default WeaLicense;
diff --git a/pc4backstage/pc4public/portal/wea-license/style/index.css b/pc4backstage/pc4public/portal/wea-license/style/index.css
new file mode 100644
index 0000000..41d9bb3
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-license/style/index.css
@@ -0,0 +1,27 @@
+.wevicon-wea-license {
+ font-size: 14px;
+}
+
+.wevicon-wea-license:before {
+ content: "\e9b1";
+}
+
+.wea-license-group {
+ padding: 20px 20px;
+}
+
+.wea-license-group .wea-form-item {
+ margin: 15px 0;
+}
+
+.wea-license-tip-msg {
+ width: 380px;
+ height: 30px;
+ line-height: 30px;
+ margin: 40px auto 10px auto;
+ color: #ff9200;
+ text-align: center;
+ border: 1px solid #ffd073;
+ border-radius: 5px;
+ background-color: #fff3dc;
+}
diff --git a/pc4backstage/pc4public/portal/wea-license/style/index.js b/pc4backstage/pc4public/portal/wea-license/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-license/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-materiallib/MaterialLib.js b/pc4backstage/pc4public/portal/wea-materiallib/MaterialLib.js
new file mode 100644
index 0000000..40dae46
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-materiallib/MaterialLib.js
@@ -0,0 +1,51 @@
+import React from 'react';
+import { WeaTools, WeaLeftRightLayout } from 'ecCom';
+
+import './style/';
+import MaterialLibLeft from './MaterialLibLeft';
+import MaterialLibRight from './MaterialLibRight';
+
+class MaterialLib extends React.Component {
+ state = { visible: true, hasRight: false, dir: 'image/' };
+
+ constructor(props) {
+ super(props);
+ this.setVisible = this.setVisible.bind(this);
+ this.setDir = this.setDir.bind(this);
+ }
+
+ componentWillMount() {
+ WeaTools.callApi('/api/portal/materialLib/getRightStatus', 'GET', {}).then((result) => {
+ this.setState({ hasRight: result.right_status == 1 });
+ });
+ }
+
+ render() {
+ const { multiCheck } = this.props;
+ const { visible, hasRight, dir } = this.state;
+
+ return (
+ visible ?
+ }
+ children={}
+ /> : ''
+ );
+ }
+
+ setVisible(visible) {
+ this.setState({ visible });
+ }
+
+ setDir(dir) {
+ this.setState({ dir });
+ }
+
+ getCheckedFiles() {
+ return this.refs.mlr.getCheckedFiles();
+ }
+}
+
+export default MaterialLib;
diff --git a/pc4backstage/pc4public/portal/wea-materiallib/MaterialLibLeft.js b/pc4backstage/pc4public/portal/wea-materiallib/MaterialLibLeft.js
new file mode 100644
index 0000000..8f31e77
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-materiallib/MaterialLibLeft.js
@@ -0,0 +1,80 @@
+import React from 'react';
+import { Button, Icon } from 'antd';
+import { WeaTools, WeaLocaleProvider, WeaNewScroll, WeaTree } from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class MaterialLibLeft extends React.Component {
+ state = { datas: [] };
+
+ constructor(props) {
+ super(props);
+ this.onSelect = this.onSelect.bind(this);
+ this.onLoadData = this.onLoadData.bind(this);
+ this.onAdd = this.onAdd.bind(this);
+ this.onEdit = this.onEdit.bind(this);
+ this.onDelete = this.onDelete.bind(this);
+ }
+
+ componentWillMount() {
+ WeaTools.callApi('/api/portal/materialLib/getDirs', 'GET', {}).then((result) => {
+ this.setState({ datas: result.datas || [] });
+ });
+ }
+
+ render() {
+ const { hasRight } = this.props;
+ const { datas } = this.state;
+
+ return (
+
+
+
+ {getLabel(0, '全部目录')}
+
+
+
+
+
+
+ {
+ hasRight ? (
+
+
+ {getLabel(0, '目录名称只能包含字母和数字')}
+
+ ) : ''
+ }
+
+ );
+ }
+
+ onSelect(dirs) {
+ this.props.setDir(dirs[0]);
+ }
+
+ onLoadData(node) {
+ return WeaTools.callApi('/api/portal/materialLib/getDirs', 'GET', { dir: node.dir });
+ }
+
+ onAdd(value, node) {
+ return WeaTools.callApi('/api/portal/materialLib/addDir', 'POST', { dir: node.dir, dirname: value });
+ }
+
+ onEdit(value, node) {
+ return WeaTools.callApi('/api/portal/materialLib/renameDir', 'POST', { dir: node.dir, dirname: value });
+ }
+
+ onDelete(node) {
+ WeaTools.callApi('/api/portal/materialLib/deleteDir', 'POST', { dir: node.dir });
+ }
+}
+
+export default MaterialLibLeft;
diff --git a/pc4backstage/pc4public/portal/wea-materiallib/MaterialLibRight.js b/pc4backstage/pc4public/portal/wea-materiallib/MaterialLibRight.js
new file mode 100644
index 0000000..0f8e453
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-materiallib/MaterialLibRight.js
@@ -0,0 +1,320 @@
+import React from 'react';
+import { Button, Icon, Modal, message, Checkbox, Pagination } from 'antd';
+import { WeaTools, WeaLocaleProvider, WeaUpload } from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+import * as _ from 'lodash';
+
+class MaterialLibRight extends React.Component {
+ state = { data: [], pageCurrent: 1, pageSize: 10, pageTotal: 0, checkedFiles: [], edit: false, file: {} };
+
+ constructor(props) {
+ super(props);
+ this.getFiles = this.getFiles.bind(this);
+ this.onPageCurrentChange = this.onPageCurrentChange.bind(this);
+ this.onPageSizeChange = this.onPageSizeChange.bind(this);
+ this.onCheck = this.onCheck.bind(this);
+ this.onEdit = this.onEdit.bind(this);
+ this.onChange = this.onChange.bind(this);
+ this.onSave = this.onSave.bind(this);
+ this.onDelete = this.onDelete.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.getCheckedFiles = this.getCheckedFiles.bind(this);
+ }
+
+ componentWillMount() {
+ this.getFiles(this.props.dir);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ if (nextProps.dir != this.props.dir) {
+ this.getFiles(nextProps.dir);
+ }
+ }
+
+ componentDidUpdate() {
+ const input = this.refs.EditInput;
+ input && input.focus();
+ }
+
+ render() {
+ const { hasRight, dir } = this.props;
+ const { data = [], pageCurrent, pageSize, pageTotal, checkedFiles, edit, file } = this.state;
+ const disabled = !(checkedFiles && checkedFiles.length);
+
+ let row = [],
+col = [];
+ for (let i = 0, len = data.length; i < len; i++) {
+ col.push(data[i]);
+ if (i % 5 == 4 || i == len - 1) {
+ row.push(col);
+ col = [];
+ }
+ }
+
+ return (
+
+ {
+ hasRight ? (
+
+
+ this.getFiles(dir)}
+ style={{ display: 'inline-block', paddingTop: 0 }}
+ >
+
+
+
+
+
+ ) : ''
+ }
+
+ {
+ row && row.length ? (
+
+ {
+ row.map((row, index) => (
+
+ {
+ row.map((col) => {
+ const checked = _.findIndex(checkedFiles, item => item.id == col.id) != -1;
+ return (
+ -
+
this.onCheck(col)}>
+
+
+
}`})
+
+ {
+ hasRight ? (
+
+
+ {
+ col.id == file.id ? (
+ edit ? (
+ e.stopPropagation()}
+ onChange={this.onChange}
+ onKeyDown={(e) => {
+ e.stopPropagation();
+ if (e.keyCode == 13) {
+ this.onSave();
+ }
+ }}
+ />
+ ) : `${file.filename_new}.${col.filetype}`
+ ) : `${col.filename}.${col.filetype}`
+ }
+
+ {
+ col.id == file.id && edit ? (
+ {
+ e.stopPropagation();
+ this.onSave();
+ }}
+ >
+
+
+ ) : (
+ {
+ e.stopPropagation();
+ this.onEdit(col);
+ }}
+ >
+
+
+ )
+ }
+ {
+ col.id == file.id && edit ? (
+ {
+ e.stopPropagation();
+ this.onCancel();
+ }}
+ >
+
+
+ ) : (
+ {
+ e.stopPropagation();
+ this.onDelete(col.id);
+ }}
+ >
+
+
+ )
+ }
+
+ ) : (
+
+ {`${col.filename}.${col.filetype}`}
+
+ )
+ }
+
+
+
+ );
+ })
+ }
+
+ ))
+ }
+
+
+
`共 ${total} 条`}
+ pageSizeOptions={['10', '20', '50', '100']}
+ onChange={this.onPageCurrentChange}
+ onShowSizeChange={this.onPageSizeChange}
+ />
+
+
+ ) : (
+
+ {getLabel(0, '暂无数据')}
+
+ )
+ }
+
+
+ );
+ }
+
+ getFiles(dir, pageCurrent, pageSize) {
+ WeaTools.callApi('/api/portal/materialLib/getFiles', 'GET', {
+ dir: dir || this.props.dir,
+ pageCurrent: pageCurrent || this.state.pageCurrent,
+ pageSize: pageSize || this.state.pageSize,
+ }).then((result) => {
+ this.setState({
+ data: result.data,
+ pageTotal: result.count,
+ checkedFiles: [],
+ edit: false,
+ file: {},
+ });
+ });
+ }
+
+ onPageCurrentChange(pageCurrent) {
+ this.setState({ pageCurrent });
+
+ const { dir } = this.props;
+ const { pageSize } = this.state;
+ this.getFiles(dir, pageCurrent, pageSize);
+ }
+
+ onPageSizeChange(current, pageSize) {
+ this.setState({ pageSize });
+
+ const { dir } = this.props;
+ const { pageCurrent } = this.state;
+ this.getFiles(dir, pageCurrent, pageSize);
+ }
+
+ onCheck(file) {
+ const { multiCheck = false } = this.props;
+ let { checkedFiles } = this.state;
+
+ if (_.findIndex(checkedFiles, item => item.id == file.id) != -1) {
+ _.remove(checkedFiles, item => item.id == file.id);
+ } else if (multiCheck) {
+ checkedFiles.push(file);
+ } else {
+ checkedFiles = [file];
+ }
+
+ this.setState({ checkedFiles });
+ }
+
+ onEdit(file = {}) {
+ this.setState({ edit: true, file: { ...file, filename_new: file.filename } });
+ }
+
+ onChange(e) {
+ const { file } = this.state;
+ this.setState({ file: { ...file, filename_new: e.target.value } });
+ }
+
+ onSave() {
+ const { file } = this.state;
+ const { filename_new = '' } = file;
+
+ if (filename_new.trim() == '') {
+ message.warning(getLabel(0, '必要信息不完整!'));
+ } else if (!filename_new.toLowerCase().match(/^[0-9A-Za-z]+$/)) {
+ message.warning(getLabel(0, '文件名称只能包含字母和数字'));
+ } else {
+ this.setState({ edit: false });
+ WeaTools.callApi('/api/portal/materialLib/renameFile', 'POST', {
+ ...file,
+ }).then((result) => {
+ if (result.api_status) {
+ message.success(getLabel(0, '操作成功'));
+ this.getFiles();
+ } else {
+ message.warning(getLabel(0, '操作失败'));
+ }
+ });
+ }
+ }
+
+ onDelete(ids) {
+ const { checkedFiles = [] } = this.state;
+ const chkIds = checkedFiles.map(item => item.id);
+ ids = ids || chkIds.join(',');
+
+ if (ids) {
+ Modal.confirm({
+ title: getLabel(0, '系统提示'),
+ content: getLabel(0, '确定删除吗?'),
+ onOk: () => {
+ WeaTools.callApi('/api/portal/materialLib/deleteFile', 'POST', {
+ ids,
+ }).then((result) => {
+ if (result.api_status) {
+ message.success(getLabel(0, '操作成功'));
+ this.getFiles();
+ } else {
+ message.warning(getLabel(0, '操作失败'));
+ }
+ });
+ },
+ });
+ }
+ }
+
+ onCancel() {
+ this.setState({ edit: false, file: {} });
+ }
+
+ getCheckedFiles() {
+ return this.state.checkedFiles;
+ }
+}
+
+export default MaterialLibRight;
diff --git a/pc4backstage/pc4public/portal/wea-materiallib/index.js b/pc4backstage/pc4public/portal/wea-materiallib/index.js
new file mode 100644
index 0000000..9b77025
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-materiallib/index.js
@@ -0,0 +1,102 @@
+import React from 'react';
+import { Button, Icon, message } from 'antd';
+import { WeaLocaleProvider, WeaDialog, WeaInput, WeaInputSearch } from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+import MaterialLib from './MaterialLib';
+
+class WeaMaterialLib extends React.Component {
+ state = { visible: false, value: this.props.value };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.onOk = this.onOk.bind(this);
+ this.onClear = this.onClear.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.onShow = this.onShow.bind(this);
+ this.onChange = this.onChange.bind(this);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ this.setState({ value: nextProps.value });
+ }
+
+ render() {
+ const { type, value, disabled, multiCheck, getTooltipContainer = () => document.body } = this.props;
+ const { visible } = this.state;
+
+ let displayComp = ;
+ if (type == 'button') {
+ displayComp = {this.props.children}
;
+ } else {
+ displayComp = ;
+ }
+
+ if (disabled) {
+ displayComp = ;
+ }
+
+ return (
+
+ {displayComp}
+
+
+
+
+ );
+ }
+
+ getButtons() {
+ let buttons = [];
+ buttons.push();
+ buttons.push();
+ buttons.push();
+ return buttons;
+ }
+
+ onShow() {
+ this.setState({ visible: true });
+ this.refs.ml && this.refs.ml.setVisible({ visible: true });
+ }
+
+ onOk() {
+ const checkedFiles = this.refs.ml.getCheckedFiles();
+
+ if (checkedFiles && checkedFiles.length) {
+ const filepaths = checkedFiles.map(item => item.filepath);
+ this.onChange(filepaths.join(','));
+ this.refs.ml.setVisible(false);
+ this.setState({ visible: false });
+ } else {
+ message.warning(getLabel(0, '请选择!'));
+ }
+ }
+
+ onClear() {
+ this.refs.ml.setVisible(false);
+ this.setState({ visible: false, value: '' });
+ this.props.onChange('');
+ }
+
+ onCancel() {
+ this.refs.ml.setVisible(false);
+ this.setState({ visible: false });
+ }
+
+ onChange(value) {
+ this.props.onChange(value);
+ }
+}
+
+export default WeaMaterialLib;
diff --git a/pc4backstage/pc4public/portal/wea-materiallib/style/index.css b/pc4backstage/pc4public/portal/wea-materiallib/style/index.css
new file mode 100644
index 0000000..a017a1b
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-materiallib/style/index.css
@@ -0,0 +1,173 @@
+.portal-p4e-mll {
+ position: relative;
+ height: 100%;
+}
+
+.portal-p4e-mll-top {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 40px;
+ line-height: 40px;
+ padding: 0 20px;
+ border-bottom: 1px solid #e2e2e2;
+}
+
+.portal-p4e-mll-middle {
+ position: absolute;
+ bottom: 30px;
+ top: 40px;
+ width: 100%;
+ overflow: auto;
+}
+
+.portal-p4e-mll-bottom {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 30px;
+ line-height: 30px;
+ color: #999;
+ text-align: center;
+}
+
+.portal-p4e-mlr {
+ position: relative;
+ height: 100%;
+}
+
+.portal-p4e-mlr-top {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 40px;
+ line-height: 40px;
+ padding: 0 20px;
+ border-bottom: 1px solid #e2e2e2;
+}
+
+.portal-p4e-mlr-middle {
+ position: absolute;
+ bottom: 0;
+ top: 40px;
+ width: 100%;
+ overflow: auto;
+}
+
+.portal-p4e-mlr-btns {
+ float: right;
+ width: 100px;
+ height: 40px;
+ line-height: 35px;
+}
+
+.portal-p4e-mlr-btn {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ padding: 0;
+ margin-left: 10px;
+ border: none;
+ border-radius: 0 !important;
+ font-weight: 700;
+}
+
+.portal-p4e-mlt-table {
+ width: 100%;
+}
+
+.portal-p4e-mlt-tr {
+ width: 100%;
+ height: 230px;
+ margin: 10px 0;
+}
+
+.portal-p4e-mlt-td {
+ float: left;
+ width: 20%;
+ min-width: 225px;
+ padding: 10px;
+}
+
+.portal-p4e-mlt-item {
+ width: 190px;
+ height: 210px;
+ padding: 10px;
+ margin: 0 auto;
+ border: 1px solid #e2e2e2;
+ border-radius: 2px;
+ cursor: pointer;
+}
+
+.portal-p4e-mlt-item:hover {
+ border: 1px solid #408de2;
+}
+
+.portal-p4e-mlt-chk {
+ height: 20px;
+ line-height: 20px;
+}
+
+.portal-p4e-mlt-preview {
+ display: table-cell;
+ width: 168px;
+ height: 140px;
+ text-align: center;
+ vertical-align: middle;
+ background-color: #f2f2f2;
+}
+
+.portal-p4e-mlt-img {
+ max-width: 168px;
+ max-height: 140px;
+ vertical-align: middle;
+}
+
+.portal-p4e-mlt-title2 {
+ display: inline-block;
+ width: 168px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ text-align: center;
+}
+
+.portal-p4e-mlt-opt {
+ height: 30px;
+ line-height: 30px;
+}
+
+.portal-p4e-mlt-title {
+ float: left;
+ display: inline-block;
+ width: 120px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.portal-p4e-mlt-title input {
+ width: 100%;
+ height: 28px;
+ line-height: 28px;
+ border: 1px solid #d9d9d9;
+ outline: none;
+}
+
+.portal-p4e-mlt-edit {
+ float: left;
+ display: inline-block;
+ width: 14px;
+ margin: 0 10px;
+ font-size: 14px;
+}
+
+.portal-p4e-mlt-delete {
+ float: left;
+ display: inline-block;
+ width: 14px;
+ font-size: 14px;
+}
diff --git a/pc4backstage/pc4public/portal/wea-materiallib/style/index.js b/pc4backstage/pc4public/portal/wea-materiallib/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-materiallib/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-menu/MenuInline.js b/pc4backstage/pc4public/portal/wea-menu/MenuInline.js
new file mode 100644
index 0000000..46a5d6a
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-menu/MenuInline.js
@@ -0,0 +1,228 @@
+import { Menu } from 'antd';
+
+const SubMenu = Menu.SubMenu;
+const ItemMenu = Menu.Item;
+import cloneDeep from 'lodash/cloneDeep';
+
+class WeaMenuInline extends React.Component {
+ constructor(props) {
+ super(props);
+ const openKeys = this.getOpenKeys(props.defaultSelectedKey, props.datas);
+ // console.log("openKeys1:",openKeys);
+ this.state = {
+ mode: props.mode || 'Inline',
+ datas: props.datas || [],
+ inlineWidth: props.inlineWidth || 197,
+ verticalWidth: props.verticalWidth || 61,
+ fontSize: props.fontSize,
+ openKeys: openKeys || [],
+ selectedKey: props.defaultSelectedKey || '', // 包含SubMenu,只做单选
+ defaultSelectedKey: props.defaultSelectedKey || '', // 包含SubMenu,只做单选
+ canClick: true,
+ selectedType: 0,
+ };
+ }
+ componentWillReceiveProps(nextProps) {
+ // console.log('datas:',this.props.datas,nextProps.datas,this.props.datas.toString() !== nextProps.datas.toString());
+ // console.log('defaultSelectedKey',this.props.defaultSelectedKey,nextProps.defaultSelectedKey,this.props.defaultSelectedKey !== nextProps.defaultSelectedKey);
+ // console.log('defaultSelectedKey',this.state.defaultSelectedKey,nextProps.defaultSelectedKey,this.state.defaultSelectedKey !== nextProps.defaultSelectedKey);
+
+ const openKeys = this.getOpenKeys(nextProps.defaultSelectedKey, nextProps.datas);
+ if (
+ JSON.stringify(this.props.datas) !== JSON.stringify(nextProps.datas) ||
+ (this.props.defaultSelectedKey !== nextProps.defaultSelectedKey && this.state.defaultSelectedKey !== nextProps.defaultSelectedKey)
+ ) {
+ // 计算出openKeys
+ let newProps = {
+ datas: nextProps.datas || [],
+ openKeys: openKeys || [],
+ defaultSelectedKey: nextProps.defaultSelectedKey || '',
+ selectedKey: nextProps.defaultSelectedKey || '',
+ };
+ // if(this.props.defaultSelectedKey !== nextProps.defaultSelectedKey&&this.state.defaultSelectedKey !== nextProps.defaultSelectedKey)
+ // newProps.openKeys = this.getOpenKeys(nextProps.defaultSelectedKey,nextProps.datas);
+ this.setState(newProps);
+ }
+ }
+ render() {
+ const { mode, datas, verticalWidth } = this.state;
+ const { openKeys, selectedType } = this.state;
+ let that = this;
+ return (
+
+ );
+ }
+
+ getOpenKeys(key, datas) {
+ const data = this.getDataByKey(key, datas);
+ const treeKey = data.treeKey;
+ let treeKeyArr = treeKey ? treeKey.split('{$}') : [];
+ // console.log("treeKey:",treeKey," treeKeyArr:",treeKeyArr);
+ return treeKeyArr;
+ }
+ onModeChange() {
+ const { mode } = this.state;
+ if (typeof this.props.onModeChange == 'function') {
+ this.props.onModeChange(mode);
+ }
+ }
+ getDataByKey(key, datas) {
+ let that = this;
+ let obj = '';
+ for (let i = 0; i < datas.length && obj == ''; i++) {
+ if (datas[i].id == key) {
+ obj = cloneDeep(datas[i]);
+ }
+ if (obj == '' && datas[i].child && datas[i].child.length > 0) {
+ obj = that.getDataByKey(key, datas[i].child);
+ }
+ }
+ return obj;
+ }
+ changeSelectedKey(key, data, type) {
+ if (window.event && window.event.shiftKey) {
+ window.open(data.fullrouteurl || data.url, '_blank');
+ return;
+ }
+
+ if (data && data.target != 'mainFrame') {
+ window.open(data.fullrouteurl || data.url, data.target);
+ return;
+ }
+ const { canClick } = this.state;
+ const { clickBlock } = this.props;
+ const that = this;
+ // let d = new Date();
+ // console.log(canClick,d.getTime());
+ if (canClick) {
+ this.setState({
+ canClick: false,
+ selectedKey: key,
+ selectedType: type,
+ });
+ if (typeof this.props.onSelect == 'function') {
+ this.props.onSelect(key, data, type);
+ }
+ setTimeout(() => {
+ that.setState({ canClick: true });
+ }, clickBlock || 300);
+ }
+ }
+ changeOpen(openKeys) {
+ this.setState({
+ openKeys,
+ });
+ }
+ renderMenuItem(datas, level) {
+ const selectedClassName = 'wea-menu-selected';
+ let that = this;
+ const { selectedKey, canClick } = this.state;
+ let datasArr = new Array();
+ for (let i = 0; i < datas.length; i++) {
+ const data = datas[i];
+ const isSubMenu = data.child && data.child.length > 0;
+ const isSelected = selectedKey == data.id || `verTop_${selectedKey}` == data.id;
+ if (data.isInlineHide !== 'true') {
+ if (isSubMenu) {
+ datasArr.push(
+ {
+ that.changeSelectedKey(e.key, data, 0);
+ }}
+ title={that.renderTitle(data, level)}
+ >
+ {that.renderMenuItem(data.child, level + 1)}
+ ,
+ );
+ } else {
+ datasArr.push(
+
+ {that.renderTitle(data, level)}
+ ,
+ );
+ }
+ }
+ }
+ return datasArr;
+ }
+ renderTitle(data, level) {
+ const { verticalWidth, fontSize } = this.state;
+ const that = this;
+ const needImg = level == 1;
+ const underLineStyle = data.hasUnderLine == 'true' ? { borderBottom: '1px solid #bbb' } : {};
+ const topLineStyle = data.hasTopLine == 'true' ? { borderTop: '1px solid #bbb' } : {};
+ const borderStyle = Object.assign({ height: 42, position: 'relative' }, underLineStyle, topLineStyle);
+ const iconMarginR = verticalWidth / 2 - 9;
+
+ const img =
+ data.iconType == '2' && data.iconImgSrc ? (
+
+ ) : data.icon ? (
+
+ ) : (
+
+ );
+ const urlIcon = (
+
{
+ that.changeSelectedKey(data.id, data, 1);
+ e.stopPropagation();
+ }}
+ />
+ );
+ return (
+
+ {needImg ? img : ''}
+
+ {data.tagColor ? (
+
+ ) : (
+ ''
+ )}
+
+ {data.name}
+ {data.count != '' && (
+
+ ({data.count})
+
+ )}
+
+
+
+ {data.titleUrlIcon ? urlIcon : ''}
+
+ );
+ }
+}
+
+export default WeaMenuInline;
diff --git a/pc4backstage/pc4public/portal/wea-menu/MenuVertical.js b/pc4backstage/pc4public/portal/wea-menu/MenuVertical.js
new file mode 100644
index 0000000..ffd1778
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-menu/MenuVertical.js
@@ -0,0 +1,176 @@
+import { Menu } from 'antd';
+
+const SubMenu = Menu.SubMenu;
+const ItemMenu = Menu.Item;
+import cloneDeep from 'lodash/cloneDeep';
+
+class WeaMenuVertical extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ mode: props.mode || 'vertical',
+ datas: props.datas || [],
+ inlineWidth: props.inlineWidth || 197,
+ verticalWidth: props.verticalWidth || 61,
+ fontSize: props.fontSize,
+ selectedKey: props.defaultSelectedKey || '', // 包含SubMenu,只做单选
+ defaultSelectedKey: props.defaultSelectedKey || '', // 包含SubMenu,只做单选
+ canClick: true,
+ translatepage: props.translatepage || '',
+ };
+ this.changeheight = this.changeheight.bind(this);
+ }
+ componentWillReceiveProps(nextProps) {
+ // console.log("nextProps:",nextProps);
+ if (
+ JSON.stringify(this.props.datas) !== JSON.stringify(nextProps.datas) ||
+ (this.props.defaultSelectedKey !== nextProps.defaultSelectedKey && this.state.defaultSelectedKey !== nextProps.defaultSelectedKey)
+ ) {
+ let key =
+ nextProps.defaultSelectedKey && nextProps.defaultSelectedKey.indexOf('verTop_') === 0
+ ? nextProps.defaultSelectedKey.substring(7)
+ : nextProps.defaultSelectedKey;
+ this.setState({
+ datas: nextProps.datas || [],
+ defaultSelectedKey: nextProps.defaultSelectedKey || '',
+ selectedKey: key || '',
+ });
+ }
+ }
+ changeheight() {
+ let asdh = $('#menuScrollWrapper').height();
+ $('.wea-menu-vertical .ant-menu-vertical .ant-menu-submenu>.ant-menu-sub').css({ maxHeight: asdh, overflow: 'auto' });
+ }
+ render() {
+ const { mode, datas } = this.state;
+ const { selectedKey } = this.state;
+ let that = this;
+ return (
+
+ );
+ }
+
+ onModeChange() {
+ const { mode } = this.state;
+ if (typeof this.props.onModeChange == 'function') {
+ this.props.onModeChange(mode);
+ }
+ }
+ changeSelectedKey(key, data, type) {
+ if (window.event && window.event.shiftKey) {
+ window.open(data.fullrouteurl || data.url, '_blank');
+ return;
+ }
+
+ if (data && data.target != 'mainFrame') {
+ window.open(data.fullrouteurl || data.url, data.target);
+ return;
+ }
+ const { canClick } = this.state;
+ const { clickBlock } = this.props;
+ const that = this;
+ // let d = new Date();
+ // console.log(canClick,d.getTime());
+ if (canClick) {
+ if (key && key.indexOf('verTop_') === 0) {
+ key = key.substring(7);
+ }
+ this.setState({
+ canClick: false,
+ selectedKey: key,
+ });
+ if (typeof this.props.onSelect == 'function') {
+ this.props.onSelect(key, data, type);
+ }
+ setTimeout(() => {
+ that.setState({ canClick: true });
+ }, clickBlock || 300);
+ }
+ }
+ getDataByKey(key, datas) {
+ let that = this;
+ let obj = '';
+ for (let i = 0; i < datas.length && obj == ''; i++) {
+ if (datas[i].id == key) {
+ obj = cloneDeep(datas[i]);
+ }
+ if (obj == '' && datas[i].child && datas[i].child.length > 0) {
+ obj = that.getDataByKey(key, datas[i].child);
+ }
+ }
+ return obj;
+ }
+ renderMenuItem(datas, level) {
+ const selectedClassName = 'wea-menu-selected';
+ let that = this;
+ const { selectedKey } = this.state;
+ let datasArr = new Array();
+ for (let i = 0; i < datas.length; i++) {
+ const data = datas[i];
+ const isSubMenu = data.child && data.child.length > 0;
+ const isSelected = selectedKey == data.id || `verTop_${selectedKey}` == data.id;
+ if (data.isVerticalHide !== 'true') {
+ if (isSubMenu) {
+ datasArr.push(
+ {
+ that.changeSelectedKey(e.key, data, 0);
+ }}
+ title={that.renderTitle(data, level)}
+ >
+ {that.renderMenuItem(data.child, level + 1)}
+ ,
+ );
+ if (level == 2 && i == 0 && !data.isVerticalHide) {
+ datasArr.push();
+ }
+ } else {
+ datasArr.push(
+
+ {that.renderTitle(data, level)}
+ ,
+ );
+ }
+ }
+ }
+ return datasArr;
+ }
+ renderTitle(data, level) {
+ const { fontSize, translatepage } = this.state;
+ const needImg = level == 1;
+ const img =
+ data.iconType == '2' && data.iconImgSrc ? (
+
+ ) : data.icon ? (
+
+ ) : (
+
+ );
+ if (level > 1) {
+ return (
+
+ {translatepage == '1' ? (data.fname ? data.fname : data.name) : data.name}
+
+ );
+ }
+ return needImg ? img : '';
+ }
+}
+
+export default WeaMenuVertical;
diff --git a/pc4backstage/pc4public/portal/wea-menu/async.js b/pc4backstage/pc4public/portal/wea-menu/async.js
new file mode 100644
index 0000000..de76b97
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-menu/async.js
@@ -0,0 +1,9 @@
+/*
+ * @Last Modified by: Theoton
+ * @Last Modified time: 2018-05-19 13:30:08
+ */
+import { asyncComponent } from 'react-async-component';
+
+export default asyncComponent({
+ resolve: () => System.import('./index'),
+});
diff --git a/pc4backstage/pc4public/portal/wea-menu/index.js b/pc4backstage/pc4public/portal/wea-menu/index.js
new file mode 100644
index 0000000..6e2c209
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-menu/index.js
@@ -0,0 +1,166 @@
+import { Icon } from 'antd';
+import MenuInline from './MenuInline';
+import MenuVertical from './MenuVertical';
+import cloneDeep from 'lodash/cloneDeep';
+import { WeaNewScroll, WeaIntro } from 'ecCom';
+
+const { Step } = WeaIntro;
+
+class WeaMenu extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ mode: props.mode || 'inline',
+ defaultSelectedKey: props.defaultSelectedKey || '',
+ datas: props.datas || [],
+ verticalWidth: props.verticalWidth || 50,
+ inlineWidth: props.inlineWidth || 190,
+ menuHeight: jQuery(document.body).height() - 55 - props.translatepageheight,
+ fontSize: props.fontSize,
+ translatepage: props.translatepage || '',
+ };
+ }
+ resetHeigth() {
+ const { portalThemeStore } = this.props;
+ const { translatepage } = portalThemeStore;
+ let transheight = translatepage == '1' ? 30 : 0;
+ this.setState({ menuHeight: jQuery(document.body).height() - 55 - transheight });
+ }
+ componentDidMount() {
+ jQuery(window).resize(() => {
+ this._reactInternalInstance !== undefined && this.resetHeigth();
+ });
+ }
+ componentWillReceiveProps(nextProps) {
+ if (
+ JSON.stringify(this.props.datas) !== JSON.stringify(nextProps.datas) ||
+ (this.props.defaultSelectedKey !== nextProps.defaultSelectedKey && this.state.defaultSelectedKey !== nextProps.defaultSelectedKey)
+ ) {
+ // 计算出openKeys
+ this.setState({
+ datas: nextProps.datas || [],
+ defaultSelectedKey: nextProps.defaultSelectedKey || '',
+ });
+ }
+
+ if (this.props.mode != nextProps.mode) {
+ this.setState({
+ mode: nextProps.mode,
+ });
+ }
+ }
+ render() {
+ const { mode, datas, verticalWidth, inlineWidth, defaultSelectedKey, menuHeight, fontSize, translatepage } = this.state;
+ const newDatas = this.setTreeKey('', datas);
+ const { addonBefore, addonAfter, addonBeforeHeight, addonAfterHeight, clickBlock, needSwitch } = this.props;
+ let style = { width: mode == 'vertical' ? verticalWidth : inlineWidth };
+ let conHeightNum =
+ (needSwitch ? 40 : 0) +
+ (!!addonBeforeHeight && mode == 'inline' ? addonBeforeHeight : 0) +
+ (!!addonAfterHeight && mode == 'inline' ? addonAfterHeight : 0);
+ return (
+
+
+ {needSwitch ? (
+
+
+
+
+
+ ) : (
+ ''
+ )}
+ {!!addonBefore && mode == 'inline' ? addonBefore : ''}
+
+ {mode === 'inline' ? (
+
+ ) : (
+
+ )}
+
+ {!!addonAfter && mode == 'inline' ? addonAfter : ''}
+
+
+ );
+ }
+ onModeChange(mode) {
+ // console.log("mode:",mode);
+ const { inlineWidth, verticalWidth } = this.state;
+ const newMode = mode == 'inline' ? 'vertical' : 'inline';
+ const newWidth = newMode == 'inline' ? inlineWidth : verticalWidth;
+ this.setState({
+ mode: newMode,
+ });
+ if (typeof this.props.onModeChange == 'function') {
+ this.props.onModeChange(newMode, newWidth);
+ }
+ }
+ onSelect(key, data, type) {
+ // console.log("key:",key," data:",data,"type",type);
+
+ this.setState({
+ defaultSelectedKey: key,
+ });
+ if (typeof this.props.onSelect == 'function') {
+ this.props.onSelect(key, data, type);
+ }
+ }
+ setTreeKey(pKey, datas) {
+ // console.log("datas:",datas);
+ let that = this;
+ let newDatas = new Array();
+ for (let i = 0; i < datas.length; i++) {
+ let data = datas[i];
+ data.treeKey = pKey != '' ? `${pKey}{$}${data.id}` : data.id;
+ if (data.child && data.child.length > 0) {
+ data.child = that.setTreeKey(data.treeKey, data.child);
+ }
+ newDatas.push(data);
+ }
+ return newDatas;
+ }
+ getVerticalDatas(datas) {
+ // console.log("datas:",datas);
+ let newDatas = new Array();
+ for (let i = 0; i < datas.length; i++) {
+ const data = datas[i];
+ let newData = cloneDeep(data);
+ newData.child = [];
+ let newDataNoChild = cloneDeep(newData);
+ newDataNoChild.id = `verTop_${newDataNoChild.id}`;
+ if (data.child) {
+ newData.child = [newDataNoChild].concat(data.child);
+ } else {
+ newData.child = [newDataNoChild];
+ }
+ newDatas.push(newData);
+ // newDataNoChild.child = [cloneDeep(datas[i])];
+ // newDatas.push(newDataNoChild);
+ }
+ // console.log("newDatas:",newDatas);
+ return newDatas;
+ }
+}
+
+export default WeaMenu;
diff --git a/pc4backstage/pc4public/portal/wea-menu/style/index.css b/pc4backstage/pc4public/portal/wea-menu/style/index.css
new file mode 100644
index 0000000..9672f25
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-menu/style/index.css
@@ -0,0 +1,152 @@
+/*菜单背景颜色*/
+
+.wea-menu {
+ height: 100%;
+ color: #727375;
+ background-color: #f1f5f9;
+}
+
+.wea-menu .scroll-wrapper> .scroll-content {
+ overflow-x: hidden !important;
+}
+
+.wea-menu .ant-menu-submenu {
+ position: initial;
+}
+
+.wea-menu-selected {
+ background-color: #30bbff;
+ color: #fff;
+}
+
+.wea-menu-vertical .ant-menu-vertical {
+ border: 0;
+}
+
+.wea-menu-switch {
+ text-align: center;
+ height: 40px;
+ background-color: #e0e5eb;
+ cursor: pointer;
+}
+
+.wea-menu-switch .anticon {
+ line-height: 40px;
+}
+
+.wea-menu-vertical .ant-menu-vertical .ant-menu-submenu>.ant-menu-sub {
+ position: fixed;
+}
+
+.wea-menu-vertical .wea-menu-submenu-title {
+ text-align: center;
+ padding: 0 !important;
+}
+
+.wea-menu-vertical .wea-menu-submenu-title:after {
+ display: none;
+}
+
+.wea-menu-inline .ant-menu-submenu-title,
+.wea-menu-vertical .ant-menu-submenu-title,
+.wea-menu-inline .ant-menu-item,
+.wea-menu-vertical .ant-menu-item {
+ background-color: rgba(0, 0, 0, 0);
+ /*white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;*/
+}
+
+/*字体超出*/
+.wea-menu-inline .ant-menu-submenu-title>div>span.wea-menu-tip-out,
+.wea-menu-inline .ant-menu-item>div>span.wea-menu-tip-out{
+ display: block;
+ max-width: 92%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/*修复大小*/
+
+.wea-menu-vertical .ant-menu-item {
+ margin-left: 0;
+ left: 0;
+}
+
+
+/*选中样式*/
+
+.wea-menu-vertical .wea-menu-selected,
+.wea-menu-inline .wea-menu-selected {
+ background-color: #30bbff;
+ color: #fff;
+}
+
+
+/*小条目hover*/
+.wea-menu-inline .ant-menu-submenu-title:hover,
+.wea-menu-inline .ant-menu-item:hover,
+.wea-menu-vertical .ant-menu-submenu-active,
+.wea-menu-vertical .ant-menu-item-active{
+ background-color: #0077d1;
+ color: #fff;
+}
+
+
+/*纵向根菜单hover*/
+
+.wea-menu-vertical .ant-menu-root>.ant-menu-submenu-active,
+.wea-menu-vertical .ant-menu-root>.ant-menu-item-active {
+ background-color: #e2e5ec;
+}
+
+/*小蓝标*/
+
+.wea-menu-vertical .ant-menu-root>.ant-menu-submenu-active:before,
+.wea-menu-vertical .ant-menu-root>.ant-menu-item-active:before {
+ border: 2px solid #0077d1;
+ display: block;
+ content: "";
+ width: 0;
+ height: 0;
+ border-top: 21px solid #0077d1;
+ border-bottom: 21px solid #0077d1;
+ position: absolute;
+}
+
+
+
+/*纵向菜单一级标题同色*/
+
+.wea-menu-vertical .ant-menu-root>.ant-menu-submenu-vertical>ul>li:first-child {
+ text-indent: -1em;
+}
+
+
+/*hover出菜单样式*/
+
+.wea-menu-vertical .ant-menu-submenu-active>ul {
+ border-radius: 0;
+ box-shadow: 2px 0px 5px -1px #ddd;
+ background-color: #e2e5ec;
+}
+
+
+/*选中的菜单hover保持不变*/
+
+.wea-menu-vertical .wea-menu-selected:hover,
+.wea-menu-vertical .ant-menu-root>.ant-menu-submenu-vertical:hover>ul>li.wea-menu-selected,
+.wea-menu-inline .wea-menu-selected:hover {
+ background-color: #30bbff;
+ color: #fff;
+}
+
+
+/*去掉ant ul菜单右边框*/
+
+.wea-menu .ant-menu-inline,
+.wea-menu .wea-menu-vertical {
+ border: 0
+}
+
diff --git a/pc4backstage/pc4public/portal/wea-menu/style/index.js b/pc4backstage/pc4public/portal/wea-menu/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-menu/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-plugin/index.js b/pc4backstage/pc4public/portal/wea-plugin/index.js
new file mode 100644
index 0000000..2be956c
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-plugin/index.js
@@ -0,0 +1,210 @@
+import React from 'react';
+import { Button, Icon, Checkbox } from 'antd';
+import { WeaTools, WeaDialog, WeaSearchGroup, WeaTable } from 'ecCom';
+
+import './style/';
+
+class WeaPlugin extends React.Component {
+ state = { visible: this.props.visible || false, test: false, data: {}, isCheck: false };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.getPlugins = this.getPlugins.bind(this);
+ this.getPluginStatus = this.getPluginStatus.bind(this);
+ this.onChange = this.onChange.bind(this);
+ this.onTest = this.onTest.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.onShow = this.onShow.bind(this);
+ }
+
+ componentWillMount() {
+ if (this.state.visible) {
+ this.getPlugins();
+ }
+ }
+
+ render() {
+ const { test, data = {}, isCheck = false } = this.state;
+ const { plugins = [], otherPlugins = [] } = data;
+
+ let columns = [
+ { key: 'index', title: '序号', dataIndex: 'index', width: '10%' },
+ { key: 'name', title: '名称', dataIndex: 'name', width: '20%' },
+ { key: 'explain', title: '描述', dataIndex: 'explain', width: '35%' },
+ { key: 'size', title: '大小', dataIndex: 'size', width: '10%' },
+ {
+ key: 'status',
+title: '状态',
+dataIndex: 'status',
+width: '10%',
+ render: (text, record) => this.getPluginStatus(record.progid),
+ },
+ {
+ key: 'download',
+title: '下载并安装',
+dataIndex: 'download',
+width: '15%',
+ render: (text, record) => 下载,
+ },
+ ];
+
+ let displayComp = (
+
+
+
+
+
+
+
+
+ 每次进入系统时检测
+
+
+ 注意:安装完毕请重启计算机!
+
+
+ );
+
+ if (test) {
+ columns = [
+ {
+ key: 'index',
+title: '序号',
+dataIndex: 'index',
+width: '10%',
+ render: (text, record) => parseInt(record.index) - 1,
+ },
+ { key: 'name', title: '名称', dataIndex: 'name', width: '15%' },
+ { key: 'clsid', title: '控件编号', dataIndex: 'clsid', width: '20%' },
+ { key: 'clsname', title: '控件名称', dataIndex: 'clsname', width: '20%' },
+ { key: 'version', title: '版本', dataIndex: 'version', width: '10%' },
+ {
+ key: 'status',
+title: '状态',
+dataIndex: 'status',
+width: '10%',
+ render: (text, record) => this.getPluginStatus(record.progid),
+ },
+ {
+ key: 'download',
+title: '检测',
+dataIndex: 'download',
+width: '15%',
+ render: (text, record) => ,
+ },
+ ];
+
+ displayComp = (
+
+
+
+
+
+
+
1
+
第一步:从 C:\WINDOWS\Downloaded Program Files 删除通过自动提示安装方式注册的控件,对应名称参见clsname列;
+
+
+
2
+
第二步:从“控制面板 -> 删除或添加程序”删除通过下载控件方式安装的控件;
+
+
+
3
+
第三步:删除用手工方式注册的控件:
+
+
1、在命令行执行 regedit.exe;
+
2、在键 HKEY_CLASSES_ROOT\CLSID 下查找对应的 clsid,如Office 控件的注册项为 {'{23739A7E-5741-4D1C-88D5-D50B18F7C347}'};
+
3、如果找到该注册项,表明控件已安装。安装的文件路径见 InprocServer32 项的值,在命令行执行“regsvr32 /u <带路径的文件名称>”即可删除;
+
+
+
+
4
+
第四步:点击 this.setState({ test: false })}>重新下载控件方式安装控件!
+
+
+
+
+ 卸载控件之前需要关闭所有 IE 窗口和使用控件的程序。
+
+
+
+ );
+ }
+
+ return (
+
+ {displayComp}
+
+ );
+ }
+
+ getButtons() {
+ let buttons = [];
+ if (this.state.test) {
+ buttons.push();
+ } else {
+ buttons.push();
+ }
+ return buttons;
+ }
+
+ getPlugins() {
+ WeaTools.callApi('/api/portal/systemInfo/getPlugins', 'GET', {}).then((result) => {
+ const { data } = result;
+ this.setState({ data, isCheck: data.isCheck });
+ });
+ }
+
+ onChange(e) {
+ const checked = e.target.checked;
+ this.setState({ isCheck: checked });
+
+ WeaTools.callApi('/api/portal/systemInfo/setIsCheck', 'POST', { isCheck: checked ? '0' : '1' });
+ }
+
+ getPluginStatus(progid) {
+ let status = false;
+ try {
+ const obj = new ActiveXObject(progid);
+ if (obj) {
+ status = true;
+ }
+ } catch (e) {
+ }
+
+ return status ? : ;
+ }
+
+ onTest(obj) {
+ const dialog = new window.top.Dialog();
+ dialog.currentWindow = window;
+ dialog.Width = 650;
+ dialog.Height = 400;
+ dialog.Title = `控件检测:${obj.name}`;
+ dialog.URL = obj.checkpageurl;
+ dialog.show();
+ }
+
+ onCancel() {
+ this.setState({ visible: false });
+ }
+
+ onShow() {
+ this.setState({ visible: true });
+ this.getPlugins();
+ }
+}
+
+export default WeaPlugin;
diff --git a/pc4backstage/pc4public/portal/wea-plugin/plugin.js b/pc4backstage/pc4public/portal/wea-plugin/plugin.js
new file mode 100644
index 0000000..c7021ec
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-plugin/plugin.js
@@ -0,0 +1,16 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import { WeaTools } from 'ecCom';
+import WeaPlugin from './index.js';
+
+(function () {
+ WeaTools.callApi('/api/portal/systemInfo/getIsCheck', 'GET', {}).then((result) => {
+ const { data } = result;
+ const { isCheck } = data;
+ if (isCheck) {
+ const div = document.createElement('div');
+ document.body.appendChild(div);
+ ReactDOM.render(, div);
+ }
+ });
+}());
diff --git a/pc4backstage/pc4public/portal/wea-plugin/style/index.css b/pc4backstage/pc4public/portal/wea-plugin/style/index.css
new file mode 100644
index 0000000..f8794a9
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-plugin/style/index.css
@@ -0,0 +1,55 @@
+.wevicon-wea-plugin {
+ font-size: 14px;
+}
+
+.wevicon-wea-plugin:before {
+ content: "\e9ab";
+}
+
+.wea-plugin-body {
+ position: relative;
+ width: 100%;
+ height: 480px;
+}
+
+.wea-plugin-body .anticon-search {
+ color: #00a9ff;
+}
+
+.wea-plugin-chk-msg {
+ height: 25px;
+ line-height: 25px;
+ padding-left: 25px;
+}
+
+.wea-plugin-tip-msg {
+ position: absolute;
+ bottom: 20px;
+ left: 50%;
+ width: 220px;
+ height: 30px;
+ line-height: 30px;
+ margin-left: -110px;
+ color: #ff9200;
+ text-align: center;
+ border: 1px solid #ffd073;
+ border-radius: 5px;
+ background-color: #fff3dc;
+}
+
+.wea-plugin-step {
+ line-height: 30px;
+}
+
+.wea-plugin-step-num {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ line-height: 20px;
+ margin-right: 10px;
+ color: #333;
+ text-align: center;
+ border-radius: 10px;
+ background-color: #d8d8d8;
+}
+
diff --git a/pc4backstage/pc4public/portal/wea-plugin/style/index.js b/pc4backstage/pc4public/portal/wea-plugin/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-plugin/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-portalmenu/index.js b/pc4backstage/pc4public/portal/wea-portalmenu/index.js
new file mode 100644
index 0000000..10e3f78
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-portalmenu/index.js
@@ -0,0 +1,71 @@
+import React from 'react';
+import { Button, Icon } from 'antd';
+import { WeaLocaleProvider, WeaDialog, WeaRightMenu, WeaMoreButton, WeaNewScroll } from 'ecCom';
+const getLabel = WeaLocaleProvider.getLabel;
+import PortalMenuTree from '../../../pc4backstage/portal4engine/components/portalmenu/PortalMenuTree';
+
+class PortalMenu extends React.Component {
+ state = { visible: false, type: 'left' };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.getRightMenus = this.getRightMenus.bind(this);
+ this.onShow = this.onShow.bind(this);
+ this.onAdd = this.onAdd.bind(this);
+ this.onSave = this.onSave.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ }
+
+ render() {
+ const { visible, type } = this.state;
+
+ return (
+
+ {visible ? : ''}
+
+ );
+ }
+
+ getButtons() {
+ let buttons = [];
+ buttons.push();
+ buttons.push();
+ buttons.push();
+ return buttons;
+ }
+
+ getRightMenus() {
+ let rightMenus = [];
+ rightMenus.push({ key: '1', icon: , content: getLabel(611, '添加'), onClick: this.onAdd });
+ rightMenus.push({ key: '2', icon: , content: getLabel(30986, '保存'), onClick: this.onSave });
+ return rightMenus;
+ }
+
+ onShow(params) {
+ this.setState({ visible: true, ...params });
+ }
+
+ onAdd() {
+ this.refs.portalmenutree.wrappedInstance.onAdd2SubCompany();
+ }
+
+ onSave() {
+ this.refs.portalmenutree.wrappedInstance.onSave();
+ }
+
+ onCancel() {
+ this.setState({ visible: false });
+ }
+}
+
+export default PortalMenu;
diff --git a/pc4backstage/pc4public/portal/wea-show-help/plugin.js b/pc4backstage/pc4public/portal/wea-show-help/plugin.js
new file mode 100644
index 0000000..2cbe17b
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-show-help/plugin.js
@@ -0,0 +1,11 @@
+import { WeaTools } from 'ecCom';
+import isEmpty from 'lodash/isEmpty';
+
+const { ls } = WeaTools;
+(function () {
+ WeaTools.callApi('/api/systeminfo/othersetting/getHelp', 'GET', {}).then((result) => {
+ ls.set('showHelp', { showHelp: result.helpmenu });
+ ls.set('showCopyAndPaste', { showCopyAndPaste: result.showCopyAndPaste });
+ ls.set('useRightMenu', { useRightMenu: result.useRightMenu });
+ });
+}());
diff --git a/pc4backstage/pc4public/portal/wea-system-setting/index.js b/pc4backstage/pc4public/portal/wea-system-setting/index.js
new file mode 100644
index 0000000..7b6bce7
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-system-setting/index.js
@@ -0,0 +1,184 @@
+import React from 'react';
+import { Button, Icon, Switch, Tooltip, message } from 'antd';
+import { WeaTools, WeaDialog, WeaSearchGroup, WeaFormItem, WeaInput, WeaBrowser } from 'ecCom';
+
+import './style/';
+
+class WeaSystemSetting extends React.Component {
+ state = { visible: false, data: {} };
+
+ fn ; //保存事件
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.getSettingData = this.getSettingData.bind(this);
+ this.setMulitLangPermission = this.setMulitLangPermission.bind(this);
+ this.onChange = this.onChange.bind(this);
+ this.onSave = this.onSave.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.onShow = this.onShow.bind(this);
+ }
+ componentDidMount(){
+ const { fn } = this.props;
+ this.fn = fn;
+ }
+
+ render() {
+ const { data } = this.state;
+ const {
+ canEdit = false, enableMultiLang = false,
+ oaaddress, licenseRemind, remindUserNames, remindDays, picturePath,
+ filesystem, filesystembackup, filesystembackuptime, needzip, isaesencrypt,
+ } = data;
+
+ return (
+
+
+
+ this.onChange({ oaaddress: value })} />
+
+ {
+ canEdit ?
+
+ this.onChange({ licenseRemind: checked ? '1' : '0' })} />
+ : ''
+ }
+ {
+ canEdit && licenseRemind == '1' ?
+
+ this.onChange({ remindUsers: ids, remindUserNames: datas })}
+ />
+ : ''
+ }
+ {
+ canEdit && licenseRemind == '1' ?
+
+ this.onChange({ remindDays: value })} />
+ : ''
+ }
+
+
+
+ this.onChange({ picturePath: value })}
+ />
+
+
+ this.onChange({ filesystem: value })}
+ />
+
+
+
+ this.onChange({ filesystembackup: value })}
+ />
+
+
+ this.onChange({ filesystembackuptime: value })}
+ />
+
+
+ this.onChange({ needzip: checked ? '1' : '0' })} />
+
+
+ this.onChange({ isaesencrypt: checked ? '1' : '0' })} />
+
+
+ {
+ enableMultiLang ?
+
+
+
+ 设置
+
+
+ : ''
+ }
+
+ );
+ }
+
+ getButtons() {
+ const { data } = this.state;
+
+ let buttons = [];
+ if (data.canEdit) {
+ buttons.push();
+ }
+ return buttons;
+ }
+
+ getSettingData() {
+ WeaTools.callApi('/api/portal/systemInfo/getSettingData', 'GET', {}).then((result) => {
+ const { data } = result;
+ this.setState({ data });
+ });
+ }
+
+ setMulitLangPermission() {
+ const dialog = new window.top.Dialog();
+ dialog.currentWindow = window;
+ dialog.Height = 650;
+ dialog.Width = 600;
+ dialog.Title = '多语言授权设置';
+ dialog.URL = '/docs/tabs/DocCommonTab.jsp?_fromURL=80&isdialog=1';
+ dialog.show();
+ }
+
+ onChange(obj) {
+ const { data } = this.state;
+ this.setState({ data: { ...data, ...obj } });
+ }
+
+ onSave() {
+ const { data } = this.state;
+
+ WeaTools.callApi('/api/portal/systemInfo/saveSettingData', 'POST', {
+ ...data,
+ }).then((result) => {
+ typeof (this.fn)==='function'&&this.fn(data.oaaddress);
+ this.onCancel();
+ });
+ }
+
+ onCancel() {
+ this.setState({ visible: false });
+ }
+
+ onShow() {
+ this.setState({ visible: true });
+ this.getSettingData();
+ }
+}
+
+export default WeaSystemSetting;
diff --git a/pc4backstage/pc4public/portal/wea-system-setting/style/index.css b/pc4backstage/pc4public/portal/wea-system-setting/style/index.css
new file mode 100644
index 0000000..c4a925c
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-system-setting/style/index.css
@@ -0,0 +1,7 @@
+.wevicon-wea-system-setting {
+ font-size: 14px;
+}
+
+.wevicon-wea-system-setting:before {
+ content: "\e9ad";
+}
diff --git a/pc4backstage/pc4public/portal/wea-system-setting/style/index.js b/pc4backstage/pc4public/portal/wea-system-setting/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-system-setting/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-theme-center/index.js b/pc4backstage/pc4public/portal/wea-theme-center/index.js
new file mode 100644
index 0000000..0928330
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-theme-center/index.js
@@ -0,0 +1,206 @@
+import React from 'react';
+import { Button, Icon, Tabs, Modal } from 'antd';
+import { WeaTools, WeaLocaleProvider, WeaDialog, WeaNewScroll } from 'ecCom';
+
+const TabPane = Tabs.TabPane;
+const getLabel = WeaLocaleProvider.getLabel;
+const E8_SYS_COLORS = ['#0070c1', '#cc3432', '#5c64c2', '#50833b', '#874d19', '#f46f43', '#22c9b2', '#b24079', '#83686c', '#666f81', '#627f7e'];
+
+import './style/';
+
+class WeaThemeCenter extends React.Component {
+ state = { visible: false, loading: false, tabKey: '', tabKey2: '', themes: [], curTheme: {}, hasRight: false };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.onOk = this.onOk.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.onSetting = this.onSetting.bind(this);
+ this.onThemeChange = this.onThemeChange.bind(this);
+ this.onColorChange = this.onColorChange.bind(this);
+ }
+
+ render() {
+ const { visible, loading, tabKey, tabKey2, themes = [], curTheme = {}, hasRight } = this.state;
+ const { type: type_cur, templateid: templateid_cur, templatetype: templatetype_cur, skin: skin_cur, color: color_cur, layout: layout_cur } = curTheme;
+
+ const themeTabPaneComp = (
+
+ this.setState({ tabKey2: key })}>
+ {
+ themes.map((themeType) => {
+ const { key, name, data = [] } = themeType;
+
+ return (
+
+
+
+ {
+ data.map((theme, index) => {
+ const { type, templateid, templatetype, skin, layout } = theme;
+
+ let previewComp = '';
+ if (key == 'ecology8') {
+ previewComp =
;
+ } else {
+ previewComp =
;
+ }
+
+ let selectedComp = '';
+ if (type == type_cur && ((templateid == templateid_cur && templatetype == templatetype_cur && skin == skin_cur) || (layout == '5' && layout == layout_cur))) {
+ selectedComp =

;
+ }
+
+ return (
+
this.onThemeChange(theme)}>
+ {previewComp}
+
{theme.name}
+ {selectedComp}
+
+ );
+ })
+ }
+
+
+
+ );
+ })
+ }
+
+
+ );
+
+ let tabComp = ;
+ const operationComp = hasRight ? : '';
+ if (templatetype_cur == 'ecology8') {
+ let colorImg = '';
+ let colorSelectedStyle = {};
+ if (color_cur) {
+ const _color = color_cur.replace(/[^0-9]/ig, '');
+ const _index = _color == '' ? 0 : parseInt(_color);
+ colorImg = `/wui/theme/ecology8/page/images/skin/color${_color}_wev8.png`;
+ colorSelectedStyle = { display: 'block', left: 50 * _index + 41, backgroundColor: E8_SYS_COLORS[_index] };
+ }
+
+ const colorTabPaneComp = (
+
+
+
+
+ {
+ E8_SYS_COLORS.map((item, index) => (
+
+ ))
+ }
+
+
+ );
+
+ tabComp = (
+ this.setState({ tabKey: key })} tabBarExtraContent={operationComp}>
+ {themeTabPaneComp}
+ {colorTabPaneComp}
+
+ );
+ } else {
+ tabComp = (
+ this.setState({ tabKey: key })} tabBarExtraContent={operationComp}>
+ {themeTabPaneComp}
+
+ );
+ }
+
+ return (
+
+ {tabComp}
+
+ );
+ }
+
+ onShow() {
+ this.setState({ visible: true, loading: true });
+ WeaTools.callApi('/api/portal/themeCenter/getAllThemes', 'GET', {}).then((result) => {
+ const { data = {} } = result;
+ const { curTheme = {} } = data;
+ const { templatetype, color, layout } = curTheme;
+ this.setState({ loading: false, tabKey: templatetype == 'ecology8' && color ? '2' : '1', tabKey2: layout == '5' ? 'ts' : templatetype, ...data });
+ });
+ }
+
+ getButtons() {
+ let buttons = [];
+ buttons.push();
+ return buttons;
+ }
+
+ onOk() {
+ this.setState({ visible: false });
+ }
+
+ onCancel() {
+ this.setState({ visible: false });
+ }
+
+ onSetting() {
+ window.open('/spa/portal/engine.html#/portalengine/portalmaintenance/mainportal', '_blank');
+ }
+
+ onThemeChange(theme) {
+ const { type, templatetype } = theme;
+
+ if (type == 'preview') {
+ let redirectUrl = theme.url;
+ let width = screen.availWidth - 10;
+ let height = screen.availHeight - 60;
+ let szFeatures = 'top=0,';
+ szFeatures += 'left=0,';
+ szFeatures += `width=${width},`;
+ szFeatures += `height=${height},`;
+ szFeatures += 'directories=no,';
+ szFeatures += 'status=yes,';
+ szFeatures += 'menubar=no,';
+ szFeatures += 'scrollbars=yes,';
+ szFeatures += 'resizable=yes';
+ window.open(redirectUrl, '', szFeatures);
+ } else if (type == 'layout') {
+ this.setState({ loading: true });
+ doThemeAction('onLayoutChange', { type: theme.layout }, () => this.setState({ loading: false }));
+ } else if (templatetype == 'ecology8' || templatetype == 'ecology9') {
+ this.setState({ loading: true });
+ doThemeAction('onThemeChange', theme, () => this.setState({ loading: false, curTheme: theme }));
+ }
+ }
+
+ onColorChange(e) {
+ const $obj = jQuery(e.target);
+ const index = $obj.attr('data-index');
+ jQuery('.wea-theme-center-color-img').css('background', `url(/wui/theme/ecology8/page/images/skin/color${index}_wev8.png)`);
+ jQuery('.wea-theme-center-color-selected').css({ display: 'block', 'background-color': $obj.css('background-color') }).animate({ left: $obj.position().left - 5 });
+
+ this.setState({ loading: true });
+ doThemeAction('onColorChange', { color: `left${index}` }, () => this.setState({ loading: false }));
+ }
+}
+
+export default WeaThemeCenter;
diff --git a/pc4backstage/pc4public/portal/wea-theme-center/style/index.css b/pc4backstage/pc4public/portal/wea-theme-center/style/index.css
new file mode 100644
index 0000000..24aca94
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-theme-center/style/index.css
@@ -0,0 +1,138 @@
+.wea-theme-center .ant-modal-content {
+ border: 1px solid #e2e2e2;
+}
+
+.wea-theme-center .ant-tabs-nav-container {
+ font-size: 12px;
+}
+
+.wea-theme-center .ant-tabs-card .ant-tabs-bar {
+ padding-left: 15px;
+}
+
+.wea-theme-center .ant-tabs-card .ant-tabs-bar .ant-tabs-nav-container {
+ height: 33px;
+}
+
+.wea-theme-center .ant-tabs-card .ant-tabs-bar .ant-tabs-tab {
+ margin-right: 5px;
+ border-radius: 0;
+}
+
+.wea-theme-center .ant-tabs-card .ant-tabs-bar .ant-tabs-tab-inner {
+ transition: none;
+}
+
+.wea-theme-center .wevicon-theme-center {
+ font-size: 14px;
+}
+
+.wea-theme-center .wevicon-theme-center:before {
+ content: "\e903";
+}
+
+.wea-theme-center .wea-theme-center-body {
+ padding: 5px 0;
+}
+
+.wea-theme-center .wea-theme-center-items {
+ padding: 0 41px;
+}
+
+.wea-theme-center .wea-theme-center-item {
+ display: inline-block;
+ position: relative;
+ width: 130px;
+ margin: 5px;
+}
+
+.wea-theme-center .wea-theme-center-preview {
+ position: relative;
+ height: 75px;
+ width: 125px;
+ border: 1px solid #b8dbed;
+ cursor: pointer;
+}
+
+.wea-theme-center .wea-theme-center-preview:hover {
+ box-shadow: 0 0 10px #ccdaf9;
+}
+
+.wea-theme-center .wea-theme-center-preview img {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 118px;
+ height: 68px;
+ margin-top: -34px;
+ margin-left: -59px;
+}
+
+.wea-theme-center .wea-theme-center-title {
+ width: 125px;
+ padding: 5px 0;
+ color: #39c;
+ text-align: center;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.wea-theme-center .wea-theme-center-selected {
+ position: absolute;
+ top: 0;
+ right: 5px;
+ width: 21px;
+ height: 21px;
+}
+
+.wea-theme-center .wea-theme-center-color-preview {
+ width: 90px;
+ height: 90px;
+ margin: 35px auto;
+ border: 2px solid #d6d6d6;
+ border-radius: 50%;
+}
+
+.wea-theme-center .wea-theme-center-color-img {
+ position: relative;
+ top: 13px;
+ left: 12px;
+ width: 57px;
+ height: 57px;
+}
+
+.wea-theme-center .wea-theme-center-colors {
+ position: relative;
+ width: 100%;
+ height: 75px;
+ padding-left: 46px;
+}
+
+.wea-theme-center .wea-theme-center-color {
+ float: left;
+ width: 50px;
+ height: 50px;
+ margin-top: 12px;
+ cursor: pointer;
+}
+
+.wea-theme-center .wea-theme-center-color:nth-child(2) {
+ border-top-left-radius: 5px;
+ border-bottom-left-radius: 5px;
+}
+
+.wea-theme-center .wea-theme-center-color:last-child {
+ border-top-right-radius: 5px;
+ border-bottom-right-radius: 5px;
+}
+
+.wea-theme-center .wea-theme-center-color-selected {
+ display: none;
+ position: absolute;
+ top: 0;
+ width: 60px;
+ height: 75px;
+ background-color: #0070c1;
+ box-shadow: 0 0 5px #ccc;
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/wea-theme-center/style/index.js b/pc4backstage/pc4public/portal/wea-theme-center/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-theme-center/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-theme-layout/index.js b/pc4backstage/pc4public/portal/wea-theme-layout/index.js
new file mode 100644
index 0000000..63f4a13
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-theme-layout/index.js
@@ -0,0 +1,88 @@
+import React from 'react';
+import { Button, Icon } from 'antd';
+import { WeaTools, WeaLocaleProvider, WeaDialog } from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+import './style/';
+
+class WeaThemeLayout extends React.Component {
+ state = { visible: false, loading: false, layouts: [], curLayout: {} };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.onOk = this.onOk.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.onChange = this.onChange.bind(this);
+ }
+
+ render() {
+ const { visible, loading, layouts = [], curLayout = {} } = this.state;
+
+ return (
+
+
+ {
+ layouts.map((layout) => {
+ const { key, type, name } = layout;
+ const isSelected = type == curLayout.type;
+ const selectedClassName = isSelected ? 'wea-theme-layout-selected' : '';
+
+ return (
+
+
this.onChange(layout)}>
+

+
+
{name}
+ {isSelected ?
: ''}
+
+ );
+ })
+ }
+
+
+ );
+ }
+
+ getButtons() {
+ let buttons = [];
+ buttons.push();
+ return buttons;
+ }
+
+ onOk() {
+ this.setState({ visible: false });
+ }
+
+ onCancel() {
+ this.setState({ visible: false });
+ }
+
+ onShow() {
+ this.setState({ visible: true, loading: true });
+ WeaTools.callApi('/api/portal/themeCenter/getAllLayouts', 'GET', {}).then((result) => {
+ const { data = {} } = result;
+ this.setState({ loading: false, ...data });
+ });
+ }
+
+ onChange(layout) {
+ this.setState({ curLayout: layout });
+ doThemeAction('onLayoutChange', layout);
+ }
+}
+
+export default WeaThemeLayout;
diff --git a/pc4backstage/pc4public/portal/wea-theme-layout/style/index.css b/pc4backstage/pc4public/portal/wea-theme-layout/style/index.css
new file mode 100644
index 0000000..4bf380b
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-theme-layout/style/index.css
@@ -0,0 +1,52 @@
+.wea-theme-layout .icon-coms-plate {
+ font-size: 14px;
+}
+
+.wea-theme-layout .wea-theme-layout-body {
+ width: 648px;
+ margin: 122px auto;
+}
+
+.wea-theme-layout .wea-theme-layout-item {
+ position: relative;
+ display: inline-block;
+ margin: 0 31px;
+}
+
+.wea-theme-layout .wea-theme-layout-img {
+ width: 100px;
+ height: 100px;
+ border: 2px solid #d7d8d9;
+ cursor: pointer;
+}
+
+.wea-theme-layout .wea-theme-layout-img img {
+ width: 96px;
+ height: 96px;
+}
+
+.wea-theme-layout .wea-theme-layout-name {
+ width: 100px;
+ height: 55px;
+ line-height: 55px;
+ color: #333;
+ font-size: 14px;
+ text-align: center;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ cursor: pointer;
+}
+
+.wea-theme-layout .wea-theme-layout-img:hover,
+.wea-theme-layout .wea-theme-layout-selected .wea-theme-layout-img {
+ border: 2px solid #2db7f5;
+}
+
+.wea-theme-layout .wea-theme-layout-selected .wea-theme-layout-icon {
+ position: absolute;
+ top: 70px;
+ right: 8px;
+ color: #2db7f5;
+ font-size: 22px;
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/portal/wea-theme-layout/style/index.js b/pc4backstage/pc4public/portal/wea-theme-layout/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-theme-layout/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/portal/wea-version/index.js b/pc4backstage/pc4public/portal/wea-version/index.js
new file mode 100644
index 0000000..b9e05e7
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-version/index.js
@@ -0,0 +1,93 @@
+import React from 'react';
+import { Button } from 'antd';
+import { WeaTools, WeaDialog } from 'ecCom';
+
+import './style/';
+
+class WeaVersion extends React.Component {
+ state = { visible: false, data: {} };
+
+ constructor(props) {
+ super(props);
+ this.getButtons = this.getButtons.bind(this);
+ this.onCancel = this.onCancel.bind(this);
+ this.onShow = this.onShow.bind(this);
+ }
+
+ render() {
+ const { data } = this.state;
+ const { logo, label1, cversion, label2, companyname, label3, website, msg1, msg2, msg3, msg4, label4, copyright } = data;
+
+ return (
+
+
+
+

+
+
+
+ {label1}
+ :
+ {cversion}
+
+
+ {label2}
+ :
+ {companyname}
+
+
+
+
{msg1}
+
{msg2}
+
{msg3}
+
{msg4}
+
+
+ {label4} © {copyright}
+
+
+
+ );
+ }
+
+ getButtons() {
+ let buttons = [];
+ buttons.push();
+ return buttons;
+ }
+
+ getVersion() {
+ WeaTools.callApi('/api/portal/systemInfo/getVersion', 'GET', {}).then((result) => {
+ const { data } = result;
+ this.setState({ data });
+ });
+ }
+
+ onCancel() {
+ this.setState({ visible: false });
+ }
+
+ onShow() {
+ this.setState({ visible: true });
+ this.getVersion();
+ }
+}
+
+export default WeaVersion;
diff --git a/pc4backstage/pc4public/portal/wea-version/style/index.css b/pc4backstage/pc4public/portal/wea-version/style/index.css
new file mode 100644
index 0000000..be7c444
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-version/style/index.css
@@ -0,0 +1,64 @@
+.wevicon-wea-version {
+ font-size: 14px;
+}
+
+.wevicon-wea-version:before {
+ content: "\e9af";
+}
+
+.wea-version-body {
+ position: relative;
+ width: 100%;
+ height: 420px;
+ padding: 20px 40px;
+}
+
+.wea-version-logo {
+ width: 100%;
+ height: 48px;
+ line-height: 48px;
+}
+
+.wea-version-split {
+ margin: 20px 0;
+ border-top: 1px dashed #e2e2e2;
+}
+
+.wea-version-label1,
+.wea-version-label2,
+.wea-version-label3,
+.wea-version-label4 {
+ height: 25px;
+ line-height: 25px;
+}
+
+.wea-version-label1 {
+ color: #4d7ad8;
+}
+
+.wea-version-label2 {
+ color: #333;
+}
+
+.wea-version-label3 {
+ color: #333;
+}
+
+.wea-version-label4 {
+ position: absolute;
+ bottom: 20px;
+ color: #999;
+}
+
+.wea-version-msg {
+ margin-top: 15px;
+ color: #333;
+}
+
+.wea-version-msg > p {
+ line-height: 20px;
+}
+
+.wea-version-warning {
+ margin-top: 15px;
+}
diff --git a/pc4backstage/pc4public/portal/wea-version/style/index.js b/pc4backstage/pc4public/portal/wea-version/style/index.js
new file mode 100644
index 0000000..6a9a4b1
--- /dev/null
+++ b/pc4backstage/pc4public/portal/wea-version/style/index.js
@@ -0,0 +1 @@
+import './index.css';
diff --git a/pc4backstage/pc4public/single.js b/pc4backstage/pc4public/single.js
new file mode 100644
index 0000000..93d3120
--- /dev/null
+++ b/pc4backstage/pc4public/single.js
@@ -0,0 +1,36 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+
+import { Provider } from 'mobx-react';
+import { createHashHistory } from 'history';
+import { Router, Route, useRouterHistory } from 'react-router';
+import { RouterStore, syncHistoryWithStore } from 'mobx-react-router';
+
+import weaCustomSetting from 'weaCustomSetting';
+
+const browserHistory = useRouterHistory(createHashHistory)({
+ queryKey: '_key',
+ basename: '/',
+});
+
+const routing = new RouterStore();
+
+const allStore = {
+ routing,
+ ...weaCustomSetting.store,
+};
+
+const history = syncHistoryWithStore(browserHistory, allStore.routing);
+window.weaHistory = history;
+
+const Root = () => (
+
+
+ props.children}>
+ {weaCustomSetting.Route}
+
+
+
+);
+
+ReactDOM.render(, document.getElementById('container'));
diff --git a/pc4backstage/pc4public/stores/cloudstore/setting.js b/pc4backstage/pc4public/stores/cloudstore/setting.js
new file mode 100644
index 0000000..a93f85c
--- /dev/null
+++ b/pc4backstage/pc4public/stores/cloudstore/setting.js
@@ -0,0 +1,57 @@
+import { observable, action } from 'mobx';
+import { WeaForm } from 'comsMobx';
+import { message, Button } from 'antd';
+import { WeaTools, WeaLocaleProvider } from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+import * as mobx from 'mobx';
+import cloneDeep from 'lodash/cloneDeep';
+
+const toJS = mobx.toJS;
+
+export default class WeaCloudstoreSetting {
+ @observable condition = [];
+ @observable form = new WeaForm();
+
+ @action
+ getButtons() {
+ let btns = [];
+ btns.push();
+ return btns;
+ }
+ @action
+ getRightMenu() {
+ let btns = [];
+ btns.push({
+ icon: ,
+ content: getLabel(30986, '保存'),
+ });
+ return btns;
+ }
+ @action
+ onRightMenuClick(key) {
+ switch (key) {
+ case '0':
+ this.onSaveSetting();
+ break;
+ }
+ }
+ @action
+ getSetting() {
+ WeaTools.callApi('/api/systeminfo/hrmusersetting/getForm', 'GET', {}).then((result) => {
+ this.condition = result.conditions;
+ this.form.initFormFields(result.conditions);
+ });
+ }
+ @action
+ onSaveSetting() {
+ WeaTools.callApi('/api/systeminfo/hrmusersetting/update', 'POST', this.form.getFormParams())
+ .then((result) => {
+ if (result.status == '2') {
+ message.error(getLabel(84544, '保存失败!'));
+ } else {
+ message.success(getLabel(83551, '保存成功!'));
+ }
+ });
+ }
+}
diff --git a/pc4backstage/pc4public/stores/hrm/WeaHrmGroupStore.js b/pc4backstage/pc4public/stores/hrm/WeaHrmGroupStore.js
new file mode 100644
index 0000000..7d64b2f
--- /dev/null
+++ b/pc4backstage/pc4public/stores/hrm/WeaHrmGroupStore.js
@@ -0,0 +1,1129 @@
+import {
+ observable,
+ action,
+} from 'mobx';
+import * as Api from '../../apis/hrmgroup';
+import {
+ WeaForm,
+ WeaTableNew,
+} from 'comsMobx';
+import {
+ message,
+ Modal,
+} from 'antd';
+import * as mobx from 'mobx';
+import {
+ i18n,
+} from '../../hrm/i18n';
+import {
+ WeaLocaleProvider,
+} from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+const toJS = mobx.toJS;
+const {
+ TableStore,
+} = WeaTableNew;
+const confirm = Modal.confirm;
+
+import {
+ WeaLogView,
+} from 'comsMobx';
+
+const {
+ LogStore,
+} = WeaLogView;
+
+import HrmImportCommon from './importCommon.js';
+
+export default class WeaHrmGroupStore {
+ @observable editTabKey = '0';
+ @observable suggestTabKey = '3';
+ @observable condition1 = [];
+ @observable condition2 = [];
+ @observable condition3 = [];
+ @observable condition4 = [];
+ @observable condition5 = [];
+ @observable condition6 = [];
+ @observable condition7 = [];
+ @observable isSuggestDialogShow = false;
+ @observable isPanelOneShow = false;
+ @observable isPanelTwoShow = false;
+ @observable isPanelThreeShow = false;
+ @observable isNewDialogShow = false;
+ @observable isEditDialogShow = false;
+ @observable isMadalShow = false;
+ @observable isImportBaseDialogShow = false;
+ @observable isImportMemberDialogShow = false;
+ @observable isShareDialogShow = false;
+ @observable isImportInfoDialogShow = false;
+ @observable isImportHistoryDialogShow = false;
+ @observable isImportMemInfoDialogShow = false;
+ @observable form1 = new WeaForm();
+ @observable form2 = new WeaForm();
+ @observable form3 = new WeaForm();
+ @observable form4 = new WeaForm();
+ @observable form5 = new WeaForm();
+ @observable form6 = new WeaForm();
+ @observable form7 = new WeaForm();
+ @observable tableStore1 = new TableStore();
+ @observable tableStore2 = new TableStore();
+ @observable tableStore3 = new TableStore();
+ @observable tableStore4 = new TableStore();
+ @observable groupid = '';
+ @observable memberid = '';
+ @observable typeid = '';
+ @observable excelfile = '';
+ @observable list = [];
+ @observable upStatus = '';
+ @observable importStatus = '';
+ @observable currentIndex = '0';
+ @observable logFilePath = '';
+ @observable loading = true;
+ @observable columns = [];
+ @observable dataSource = [];
+ @observable action = {};
+ @observable delFileNum = '';
+ @observable suggestid = '';
+ @observable hasTrumpet = false;
+ @observable hasHint = false;
+ @observable height = 510;
+ @observable orderArr = [];
+ @observable rowIdArr = [];
+ @observable valArr = [];
+ @observable checkBoxVal = 0;
+ @observable hasWeaTop = false;
+ @observable selectvalue = '1';
+ @observable scopeValue = [0, 100];
+ @observable isImportStop = false;
+ @observable hasAuthority = false;
+ @observable date = '';
+ @observable logView = {
+ visible: false,
+ logSmallType: '',
+ targetId: '',
+ logStore: new LogStore(),
+ }
+ @observable showCanceled = false;
+
+ @observable hrmImportCommon = new HrmImportCommon();
+ @observable hasLogRight = false;
+
+ setSourceStore = () => {
+ this.hrmImportCommon.setSourceStore(this);
+ }
+
+ @action
+ toggleLog = (params) => {
+ const {
+ visible,
+ logSmallType,
+ targetId,
+ } = params;
+
+ ['visible', 'logSmallType', 'targetId'].map((v) => {
+ this.logView[v] = eval(v) === undefined ? '' : eval(v);
+ });
+ }
+
+ @action
+ updateFormFields(arg, val) {
+ if (arg == '1') {
+ this.form1.updateFields({
+ name: {
+ value: val,
+ },
+ });
+}
+ if (arg == '2') {
+ this.form2.updateFields({
+ resourcename: {
+ value: val,
+ },
+ });
+}
+ if (arg == '3') {
+ this.form4.updateFields({
+ excelfile: {
+ value: val,
+ },
+ });
+}
+ if (arg == '4') {
+ this.form5.updateFields({
+ excelfile: {
+ value: val,
+ },
+ });
+}
+ if (arg == '5') {
+ this.form7.updateFields({
+ suggesttitle: {
+ value: val,
+ },
+ });
+}
+ if (arg == '6') {
+ this.form6.updateFields({
+ seclevel__seclevelTo: {
+ value: val,
+ },
+ });
+}
+ }
+
+ tabClick(key) {
+ this.editTabKey = key;
+ if (key == '0') {
+ this.getPanelForm('1');
+ }
+ if (key == '1') {
+ this.getPanelForm('2');
+ this.getTableInfo('2');
+ }
+ if (key == '2') {
+ this.getTableInfo('3');
+ }
+ }
+
+ suggestTabClick(key) {
+ this.suggestTabKey = key;
+ this.getTableInfo('7');
+ }
+
+ tabReset() {
+ this.editTabKey = '0';
+ }
+
+ getPanelForm(arg) {
+ let params;
+ if (arg == '1') {
+ params = {
+ cmd: 'base',
+ };
+}
+ if (arg == '2') {
+ params = {
+ cmd: 'member',
+ };
+}
+ if (arg == '3') {
+ params = {
+ cmd: 'suggest',
+ };
+}
+
+ Api.getSearchCondition(params).then((data) => {
+ if (arg == '1') {
+ this.condition1 = data.condition;
+ this.form1.initFormFields(data.condition);
+ this.hasLogRight = data.hasRight;
+ }
+ if (arg == '2') {
+ this.condition2 = data.condition;
+ this.form2.initFormFields(data.condition);
+ }
+ if (arg == '3') {
+ this.condition7 = data.condition;
+ this.form7.initFormFields(data.condition);
+ }
+ });
+ }
+
+ getForm(arg) {
+ let params;
+ if (arg == '1' || arg == '2') {
+ params = {
+ cmd: 'base',
+ };
+ this.condition3 = [];
+ this.form3 = new WeaForm();
+ }
+ if (arg == '2') {
+ params.groupid = this.groupid;
+ }
+ if (arg == '3') {
+ params = {
+ cmd: 'importbase',
+ };
+ this.condition4 = [];
+ this.form4 = new WeaForm();
+ }
+ if (arg == '4') {
+ params = {
+ cmd: 'importmember',
+ };
+ this.condition5 = [];
+ this.form5 = new WeaForm();
+ }
+ if (arg == '5') {
+ params = {
+ cmd: 'share',
+ };
+ this.condition6 = [];
+ this.form6 = new WeaForm();
+ }
+
+
+ Api.getFormCondition(params).then((data) => {
+ if (arg == '1' || arg == '2') {
+ this.condition3 = data.condition;
+ this.form3.initFormFields(data.condition);
+ }
+ if (arg == '1') {
+ this.setNewDialogStatus(true);
+ }
+ if (arg == '2') {
+ // this.editTabKey = '0';
+ this.setNewDialogStatus(false);
+ this.setEditDialogStatus(true);
+ }
+ if (arg == '3') {
+ this.condition4 = data.condition;
+ this.form4.initFormFields([data.condition[0]]);
+ this.setImportBaseDialogStatus(true);
+ }
+ if (arg == '4') {
+ this.condition5 = data.condition;
+ this.form5.initFormFields([data.condition[0]]);
+ this.setImportMemberDialogStatus(true);
+ }
+ if (arg == '5') {
+ data.condition[0].items = this.putElementToLast('rolelevel', data.condition[0].items);
+ this.condition6 = data.condition;
+ this.form6.initFormFields(data.condition);
+ this.setShareDialogStatus(true);
+ }
+ });
+ }
+
+ changeShowAll() {
+ this.showCanceled = !this.showCanceled;
+ this.getTableInfo('1');
+ }
+
+ doCancel(params = {}) {
+ let _this = this;
+ confirm({
+ title: i18n.confirm.defaultTitle(),
+ content: i18n.label.sealConfirm(),
+ okText: i18n.button.ok(),
+ cancelText: i18n.button.cancel(),
+ onOk() {
+ Api.doCancel(params).then((data) => {
+ if (data.status == '1') {
+ _this.getTableInfo('1');
+ // message.success(i18n.message.cancelSuccess());
+ } else {
+ message.warning(data.message);
+ }
+ }, (error) => {
+ message.warning(error.message);
+ });
+ },
+ onCancel() {
+ return false;
+ },
+ });
+ }
+
+ doISCanceled(params = {}) {
+ let _this = this;
+ confirm({
+ title: i18n.confirm.defaultTitle(),
+ content: i18n.label.unsealConfirm(),
+ okText: i18n.button.ok(),
+ cancelText: i18n.button.cancel(),
+ onOk() {
+ Api.doISCanceled(params).then((data) => {
+ if (data.status == '1') {
+ _this.getTableInfo('1');
+ // message.success(i18n.message.doISCancelSuccess());
+ } else {
+ message.warning(data.message);
+ }
+ }, (error) => {
+ message.warning(error.message);
+ });
+ },
+ onCancel() {
+ return false;
+ },
+ });
+ }
+
+ getTableInfo(arg) {
+ let params;
+ if (arg == '1') {
+ this.tableStore1 = new TableStore();
+ params = {
+ cmd: 'base',
+ showCanceled: this.showCanceled ? '1' : '0',
+ ...this.form1.getFormParams(),
+ };
+ }
+ if (arg == '2') {
+ this.tableStore2 = new TableStore();
+ params = {
+ cmd: 'member',
+ groupid: this.groupid,
+ ...this.form2.getFormParams(),
+ };
+ }
+ if (arg == '3') {
+ this.tableStore3 = new TableStore();
+ params = {
+ cmd: 'share',
+ groupid: this.groupid,
+ };
+ }
+ if (arg == '4') {
+ params = {
+ cmd: 'importbaseresult',
+ currentIndex: this.currentIndex,
+ };
+ }
+ if (arg == '5') {
+ params = {
+ cmd: 'importhistory',
+ importtype: 'group',
+ };
+ }
+ if (arg == '6') {
+ params = {
+ cmd: 'importmemberresult',
+ currentIndex: this.currentIndex,
+ };
+ }
+ if (arg == '7') {
+ this.tableStore4 = new TableStore();
+ params = {
+ cmd: 'suggest',
+ status: (parseInt(this.suggestTabKey) - 3).toString(),
+ ...this.form7.getFormParams(),
+ };
+ }
+
+ Api.getSearchResult(params).then((data) => {
+ if (data.status == '-1' && arg !== '5') {
+ if (data.message) message.warning(data.message);
+ this.loading = false;
+ return false;
+ }
+ if (data.status == '-1' && arg == '5') {
+ this.setAuthorityStatus(false);
+ this.loading = false;
+ return false;
+ }
+ this.setAuthorityStatus(true);
+ if (arg == '1') {
+ this.tableStore1.getDatas(data.sessionkey, 1);
+ }
+ if (arg == '2') {
+ this.tableStore2.getDatas(data.sessionkey, 1);
+ }
+ if (arg == '3') {
+ this.tableStore3.getDatas(data.sessionkey, 1);
+ }
+ if (arg == '4' || arg == '6') {
+ let is = data.importStatus;
+ this.importStatus = is;
+ if (is == 'over' && data.logFilePath) {
+ this.logFilePath = data.logFilePath;
+ }
+ if (data.items) {
+ this.dataSource = this.dataSource.concat(data.items);
+ this.currentIndex = this.dataSource.length;
+ }
+ this.columns = data.columns;
+ }
+ if (arg == '5') {
+ data.columns[0].width = '40%';
+ data.columns[1].width = '40%';
+ data.columns[2].width = '20%';
+ if (data.items.length == 0) this.loading = false;
+ this.columns = data.columns;
+ this.dataSource = data.items;
+ this.action = data.action;
+ }
+ if ((arg == '4' || arg == '5' || arg == '6') && data.items && data.items.length > 0) {
+ this.loading = false;
+ }
+ if (arg == '7') {
+ this.tableStore4.getDatas(data.sessionkey, 1);
+ }
+ });
+ }
+
+ save(arg) {
+ let params;
+ if (arg == '1' || arg == '2' || arg == '9') {
+ params = this.form3.getFormParams();
+ // if (!params.name) {
+ // message.warning('必填信息不完整!');
+ // return;
+ // }
+ params = {
+ cmd: 'base',
+ ...params,
+ };
+ }
+ if (arg == '9') {
+ params = {
+ groupid: this.groupid,
+ ...params,
+ };
+ }
+
+ if (arg == '3') {
+ params = {
+ cmd: 'member',
+ groupid: this.groupid,
+ members: this.memberid,
+ };
+ }
+
+ if (arg == '4') {
+ params = this.form6.getFormParams();
+ let sharetype = params.sharetype;
+ let jobtitlelevel = params.jobtitlelevel;
+
+ if ((sharetype == '2' || sharetype == '3' || sharetype == '4' || sharetype == '8' || sharetype == '5') && (!('seclevel' in params) || !('seclevelTo' in params))) {
+ params.seclevel = this.scopeValue[0];
+ params.seclevelTo = this.scopeValue[1];
+ }
+
+ if ((sharetype == '1' && !params.rsid) || (sharetype == '2' && !params.sbid) || (sharetype == '3' && !params.did) || (sharetype == '4' && !params.rid) || (sharetype == '7' && !params.jobtitle) || (sharetype == '7' && jobtitlelevel == '1' && !params.jobtitledepartment) || (sharetype == '7' && jobtitlelevel == '2' && !params.jobtitlesubcompany) || (sharetype == '8' && !params.customid)) {
+ message.warning(i18n.message.requiredIsNotFull());
+ return false;
+ }
+
+ if (!(sharetype == '1' || sharetype == '7') && (params.seclevel === undefined || params.seclevelTo === undefined)) {
+ message.warning(i18n.message.requiredIsNotFull());
+ return false;
+ }
+
+ params = {
+ cmd: 'share',
+ groupid: this.groupid,
+ ...params,
+ alllevel: this.checkBoxVal,
+ rolelevel: (parseInt(this.selectvalue) - 1).toString(),
+ };
+ }
+ if (arg == '5') {
+ params = {
+ cmd: 'importbase',
+ importtype: 'group',
+ creater: '',
+ ...this.form4.getFormParams(),
+ };
+ }
+
+ if (arg == '6') {
+ params = {
+ cmd: 'importmember',
+ groupid: this.groupid,
+ ...this.form5.getFormParams(),
+ };
+ }
+
+ if (arg == '5' || arg == '6') {
+ if (this.importStatus == 'over') this.importStatusReset();
+ if (this.isImportStop) this.importStopReset();
+ setTimeout(() => this.timer(arg), 1000);
+ }
+
+ if (arg == '7') {
+ params = {
+ cmd: 'doAdd',
+ id: this.suggestid,
+ };
+ }
+
+ if (arg == '8') {
+ params = {
+ cmd: 'doChange',
+ id: this.suggestid,
+ };
+ }
+
+ if (arg == '10') {
+ let arr = this.dataFilter(toJS(this.rowIdArr), toJS(this.valArr));
+ for (let i = 0; i < arr.length; i++) {
+ if (parseInt(arr[i]) < 0) {
+ message.warning(i18n.message.canLowerThanZero());
+ return false;
+ }
+ }
+ let result = this.dataFilter(toJS(this.rowIdArr), toJS(this.orderArr));
+ params = {
+ cmd: 'saveDspOrder',
+ dspOrder: result,
+ };
+ }
+
+ if (arg == '1' || arg == '2' || arg == '9') {
+ this.form3.validateForm().then((f) => {
+ if (f.isValid) {
+ Api.saveForm(params).then((data) => {
+ if (data.status == '1') {
+ if (data.message) message.success(data.message);
+ if (data.groupid) {
+ this.groupid = data.groupid;
+ }
+ if (arg == '1' || arg == '2') {
+ this.setNewDialogStatus(false);
+ this.getTableInfo('1');
+ }
+ if (arg == '2') {
+ this.setEditDialogStatus(true);
+ this.getForm('2');
+ }
+ if (arg == '9') {
+ this.setEditDialogStatus(false);
+ this.getTableInfo('1');
+ }
+ } else {
+ if (data.message) message.warning(data.message);
+ return false;
+ }
+ });
+ } else {
+ f.showErrors();
+ this.setDate({
+ date: new Date(),
+ });
+ }
+ });
+ } else {
+ Api.saveForm(params).then((data) => {
+ if (data.status == '1') {
+ if (data.message) message.success(data.message);
+ if (data.groupid) {
+ this.groupid = data.groupid;
+ }
+ if (arg == '3') {
+ this.getTableInfo('1');
+ this.getTableInfo('2');
+ }
+ if (arg == '4') {
+ this.setShareDialogStatus(false);
+ this.getTableInfo('3');
+ this.shareFormReset();
+ }
+
+ if (arg == '7') {
+ this.getTableInfo('7');
+ this.getTableInfo('1');
+ this.getTableInfo('2');
+ }
+ if (arg == '8') {
+ this.getTableInfo('7');
+ }
+ if (arg == '10') {
+ this.setEditDialogStatus(false);
+ this.getTableInfo('1');
+
+ this.tabReset();
+ }
+ } else {
+ if (data.message) message.warning(data.message);
+ return false;
+ }
+ });
+ }
+ }
+
+ setDate = (date) => {
+ this.date = date;
+ }
+
+
+ putElementToLast(domkey, arr) {
+ let index = this.getIndex(domkey, arr);
+ if (index) {
+ let ele = arr.splice(index, 1);
+ arr.push(ele[0]);
+ } else {
+ return false;
+ }
+ return arr;
+ }
+
+ getIndex(domkey, arr) {
+ let index;
+ for (let i = 0; i < arr.length; i++) {
+ if (domkey == arr[i].domkey[0]) {
+ index = i;
+ }
+ }
+
+ return index;
+ }
+
+
+ delete(arg, tag1, tag2) {
+ let params;
+ if (arg == '1') {
+ params = {
+ cmd: 'base',
+ groupid: this.groupid,
+ };
+ }
+ if (arg == '2') {
+ params = {
+ cmd: 'member',
+ groupid: this.groupid,
+ id: this.memberid,
+ };
+ }
+ if (arg == '3') {
+ params = {
+ cmd: 'share',
+ groupid: this.groupid,
+ id: this.typeid,
+ };
+ }
+ if (arg == '4') {
+ params = {
+ cmd: 'importhistory',
+ filename: this.delFileNum,
+ };
+ }
+ if (arg == '5') {
+ params = {
+ cmd: 'doDel',
+ id: this.suggestid,
+ };
+ }
+
+ Api.deleteTableRow(params).then((data) => {
+ if (tag1 == 'batch' && tag2 == 'last') {
+ if (data.status == '1') {
+ data.message && message.success(data.message);
+ this.getTableInfo('1');
+ arg == '2' && this.getTableInfo('2');
+ arg == '3' && this.getTableInfo('3');
+ } else {
+ if (data.message) message.warning(data.message);
+ return false;
+ }
+ }
+ if (tag1 !== 'batch' && data.status == '1') {
+ if (data.message) message.success(data.message);
+ this.getTableInfo('1');
+ if (arg == '2') {
+ this.getTableInfo('2');
+ }
+ if (arg == '3') {
+ this.getTableInfo('3');
+ }
+ if (arg == '4') {
+ this.getTableInfo('5');
+ }
+ if (arg == '5') {
+ this.getTableInfo('7');
+ this.getTableInfo('2');
+ }
+ } else {
+ if (data.message) message.warning(data.message);
+ return false;
+ }
+ });
+ }
+
+ hasSuggestHint() {
+ let params = {
+ cmd: 'isHasSuggest',
+ };
+ Api.getSearchResult(params).then((data) => {
+ if (data.isHas == 1) {
+ this.setTrumpet(true);
+ this.getPanelForm('3');
+ this.getTableInfo('7');
+ } else {
+ this.setTrumpet(false);
+ }
+
+ if (data.isHasNew == 1) {
+ this.setHint(true);
+ } else {
+ this.setHint(false);
+ }
+ });
+ }
+
+ timer(arg) {
+ let t = setInterval(() => {
+ if (this.importStatus == 'over') {
+ clearInterval(t);
+ this.importStatusReset();
+ this.currentIndexReset();
+ if (!this.isImportStop) {
+ message.success(i18n.message.importSuccess());
+ }
+ this.getTableInfo('2');
+ this.getTableInfo('1');
+ return false;
+ }
+ arg == '5' ? this.getTableInfo('4') : this.getTableInfo('6');
+ }, 1000);
+ }
+
+ dataFilter(arr, _arr) {
+ let _arr_ = [];
+ for (let i = 0; i < arr.length; i++) {
+ if (arr.indexOf(arr[i]) == arr.lastIndexOf(arr[i])) {
+ if (_arr_.indexOf(_arr[i]) == -1) {
+ _arr_.push(_arr[i]);
+ }
+ } else {
+ let index = arr.lastIndexOf(arr[i]);
+ if (_arr_.indexOf(_arr[index]) == -1) {
+ _arr_.push(_arr[index]);
+ }
+ }
+ }
+
+ return _arr_;
+ }
+
+ showConfirm(arg, bool) {
+ let _this = this;
+ confirm({
+ title: i18n.confirm.defaultTitle(),
+ content: i18n.confirm.closeDialogIfunfinished(),
+ okText: i18n.button.ok(),
+ cancelText: i18n.button.cancel(),
+ onOk() {
+ if (arg == '1') _this.isImportInfoDialogShow = false;
+ if (arg == '2') _this.isImportMemInfoDialogShow = false;
+ _this.loadingReset();
+ _this.colAndDsReset();
+ _this.logFilePathReset();
+ if (_this.importStatus == 'importing') {
+ _this.importStatus = 'over';
+ _this.setImportStopStatus(true);
+ }
+ },
+ onCancel() {
+ return false;
+ },
+ });
+ }
+
+ getButtons() {
+ return [];
+ }
+
+ getRightMenu() {
+ const dropMenuDatas = [{
+ key: '0',
+ content: i18n.button.import(),
+ icon: ,
+ }, {
+ key: '1',
+ content: i18n.button.create(),
+ icon: ,
+ }, {
+ key: '2',
+ content: i18n.button.multiDelete(),
+ icon: ,
+ }];
+ if (this.hasLogRight) {
+ dropMenuDatas.push({
+ key: '3',
+ content: getLabel('83', '日志'),
+ icon: ,
+ onClick: () => {
+ this.toggleLog({
+ visible: true,
+ logSmallType: '3002',
+ });
+ },
+ });
+ }
+
+ return dropMenuDatas;
+ }
+
+ onRightMenuClick(key) {
+ key == '0' && this.getForm('3');
+ key == '1' && this.getForm('1');
+ key == '2' && this.showConfirm();
+ }
+
+ showConfirm() {
+ let _this = this;
+ confirm({
+ title: i18n.confirm.defaultTitle(),
+ content: i18n.confirm.batchDeleteConfirm(),
+ okText: i18n.button.ok(),
+ cancelText: i18n.button.cancel(),
+ onOk() {
+ _this.ok();
+ },
+ onCancel() {
+ return false;
+ },
+ });
+ }
+
+ ok() {
+ this.tableStore1.selectedRowKeys.map((item) => {
+ this.setGroupId(item);
+ this.delete('1', 'batch', 'last');
+ });
+ }
+
+ setSuggestDialogStatus(bool) {
+ this.isSuggestDialogShow = bool;
+ this.hasSuggestHint();
+ this.form7.reset();
+ this.suggestTabKey = '3';
+ }
+
+ setPanelOneStatus(bool) {
+ this.isPanelOneShow = bool;
+ }
+
+ setPanelTwoStatus(bool) {
+ this.isPanelTwoShow = bool;
+ }
+
+ setPanelThreeStatus(bool) {
+ this.isPanelThreeShow = bool;
+ }
+
+ setNewDialogStatus(bool) {
+ this.isNewDialogShow = bool;
+ }
+
+ setEditDialogStatus(bool) {
+ this.isEditDialogShow = bool;
+ this.form2.reset();
+ }
+
+ setGroupId(groupid) {
+ this.groupid = groupid;
+ }
+
+ setMemberId(memberid) {
+ this.memberid = memberid;
+ }
+
+ setTypeId(typeid) {
+ this.typeid = typeid;
+ }
+
+ setMadalStatus(bool) {
+ this.isMadalShow = bool;
+ }
+
+ setWeaTopStatus(bool) {
+ this.hasWeaTop = bool;
+ }
+
+ setImportBaseDialogStatus(bool) {
+ this.isImportBaseDialogShow = bool;
+ if (!bool) {
+ this.upStatusReset();
+ this.excelfileReset();
+ this.listReset();
+ }
+ }
+
+ setImportMemberDialogStatus(bool) {
+ this.isImportMemberDialogShow = bool;
+ if (!bool) {
+ this.upStatusReset();
+ this.excelfileReset();
+ this.listReset();
+ }
+ }
+
+ setShareDialogStatus(bool) {
+ this.isShareDialogShow = bool;
+ this.shareFormReset();
+ }
+
+ setImportInfoDialogStatus(bool) {
+ if (bool) {
+ this.isImportInfoDialogShow = true;
+ } else if (this.importStatus == 'importing') {
+ this.showConfirm('1', false);
+ } else {
+ this.isImportInfoDialogShow = false;
+ this.importStatus = 'over';
+ this.setImportStopStatus(false);
+ this.loadingReset();
+ this.colAndDsReset();
+ this.logFilePathReset();
+ }
+ }
+
+ setImportHistoryDialogStatus(bool) {
+ this.isImportHistoryDialogShow = bool;
+ if (!bool) {
+ this.loadingReset();
+ this.colAndDsReset();
+ this.actionReset();
+ }
+ }
+
+ setImportMemInfoDialogStatus(bool) {
+ if (bool) {
+ this.isImportMemInfoDialogShow = true;
+ } else if (this.importStatus == 'importing') {
+ this.showConfirm('2', false);
+ } else {
+ this.isImportMemInfoDialogShow = false;
+ this.importStatus = 'over';
+ this.setImportStopStatus(false);
+ this.loadingReset();
+ this.colAndDsReset();
+ this.logFilePathReset();
+ }
+ }
+
+ setImportStopStatus(bool) {
+ this.isImportStop = bool;
+ }
+
+ setExcelfile(excelfile) {
+ this.excelfile = excelfile;
+ }
+
+ setList(list) {
+ this.list = list;
+ }
+
+ setUpStatus(upStatus) {
+ this.upStatus = upStatus;
+ }
+
+ setDelFileNum(delFileNum) {
+ this.delFileNum = delFileNum;
+ }
+
+ setSuggestId(suggestid) {
+ this.suggestid = suggestid;
+ }
+
+ setTrumpet(bool) {
+ this.hasTrumpet = bool;
+ }
+
+ setHint(bool) {
+ this.hasHint = bool;
+ }
+
+ setAuthorityStatus(bool) {
+ this.hasAuthority = bool;
+ }
+
+ setDsporderArr(val, rowData) {
+ if (val < 0) {
+ message.warning(i18n.message.canLowerThanZero());
+ }
+ this.rowIdArr.push(rowData.id);
+ this.orderArr.push(`${rowData.id}-${val}`);
+ this.valArr.push(val);
+ }
+
+ setImportStatus(status) {
+ this.importStatus = status;
+ }
+
+ setCheckBoxVal(val) {
+ this.checkBoxVal = val;
+ }
+
+ setSelectValue(val) {
+ this.selectvalue = val;
+ }
+
+ setScopeValue(scopeValue) {
+ this.scopeValue = scopeValue;
+ this.updateFormFields('6', scopeValue);
+ }
+
+ loadingReset() {
+ this.loading = true;
+ }
+
+ importStatusReset() {
+ this.importStatus = '';
+ }
+
+ colAndDsReset() {
+ this.columns = [];
+ this.dataSource = [];
+ }
+
+ actionReset() {
+ this.action = {};
+ }
+
+ upStatusReset() {
+ this.upStatus = '';
+ }
+
+ logFilePathReset() {
+ this.logFilePath = '';
+ }
+
+ currentIndexReset() {
+ this.currentIndex = '0';
+ }
+
+ excelfileReset() {
+ this.excelfile = '';
+ }
+
+ listReset() {
+ this.list = [];
+ }
+
+ selectValueReset() {
+ this.selectvalue = '1';
+ }
+
+ scopeValueReset() {
+ this.scopeValue = [0, 100];
+ }
+
+ checkBoxValReset() {
+ this.checkBoxVal = 0;
+ }
+
+ shareFormReset() {
+ this.form6.reset();
+ this.form6.updateFields({
+ sharetype: {
+ value: '1',
+ },
+ });
+ this.checkBoxValReset();
+ this.selectValueReset();
+ this.scopeValueReset();
+ }
+
+ importStopReset() {
+ this.isImportStop = false;
+ }
+
+ changeHeight(height) {
+ this.height = height;
+ }
+
+ refreshTable=() => {
+ if (this.isEditDialogShow) {
+ this.getTableInfo('2');
+ } else {
+ this.getTableInfo('1');
+ }
+ }
+}
diff --git a/pc4backstage/pc4public/stores/hrm/importCommon.js b/pc4backstage/pc4public/stores/hrm/importCommon.js
new file mode 100644
index 0000000..0eba51c
--- /dev/null
+++ b/pc4backstage/pc4public/stores/hrm/importCommon.js
@@ -0,0 +1,422 @@
+import * as asyncFetch from '../../apis/importresource';
+import {
+ observable,
+ action,
+ extendObservable,
+} from 'mobx';
+import {
+ WeaForm,
+ WeaTableNew,
+} from 'comsMobx';
+import {
+ WeaLocaleProvider,
+} from 'ecCom';
+import {
+ message,
+} from 'antd';
+
+const getLabel = WeaLocaleProvider.getLabel;
+const {
+ TableStore,
+} = WeaTableNew;
+
+export default class HrmImportCommon {
+ @observable importType = '';
+ @observable importDialog = {
+ visible: false,
+ condition: [],
+ form: new WeaForm(),
+ title: '',
+ loading: true,
+ templetName: '',
+ selectedValue: 'workcode',
+ }
+
+ @observable resultDialog = {
+ title: observable.ref(getLabel(82341, '导入结果')),
+ errorTip: observable.ref(getLabel(384059, '导入文件存在以下错误,请解决后重新上传!')),
+ visible: false,
+ index: 1,
+ datas: [],
+ importStatus: '',
+ pId: '',
+ interval: '',
+ tableStore: new TableStore(),
+ errorInfo: [],
+ succnum: 0,
+ failnum: 0,
+ loading: true,
+ component: '',
+ }
+
+ @observable recordDialog = {
+ title: observable.ref(getLabel(24644, '历史导入记录')),
+ visible: false,
+ tableStore: new TableStore(),
+ }
+
+ @observable logDialog = {
+ title: observable.ref(getLabel(24835, '导入日志')),
+ visible: false,
+ tableStore: new TableStore(),
+ isPanelShow: false,
+ form: new WeaForm(),
+ condition: [],
+ loading: true,
+ }
+
+ @action
+ getImportForm = () => {
+ this.importDialog.loading = true;
+ let params = {
+ importType: this.importType,
+ };
+ asyncFetch.getImportForm(params).then((rs) => {
+ const {
+ status,
+ condition = [],
+ } = rs;
+
+ if (status == '1') {
+ this.importDialog.condition = condition;
+ const copy = [...condition];
+ copy.splice(1);
+ copy[0].items.splice(2);
+ this.importDialog.form.initFormFields(copy);
+ this.importDialog.loading = false;
+ } else {
+ message.error(rs.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ getImportProcessInfo = () => {
+ let params = {
+ importType: this.importType,
+ index: this.resultDialog.index,
+ };
+ asyncFetch.getImportProcessLog(params).then((rs) => {
+ const {
+ datas,
+ index,
+ pId = '',
+ status,
+ } = rs;
+
+ this.resultDialog.loading = false;
+ if (status == '1') {
+ const {
+ importStatus,
+ interval,
+ errorInfo,
+ component,
+ } = this.resultDialog;
+
+ component.scrollToLast();
+
+ if (importStatus == 'over' || importStatus == 'error') {
+ clearInterval(interval);
+ if (!this.hasErrorInfo(errorInfo)) this.getResultInfo();
+
+ // 导入完成后,刷新节假日设置页面的年视图或清单列表
+ this.sourceStore && this.sourceStore.refreshTable();
+ return;
+ }
+
+ if (rs.importStatus == 'over' || rs.importStatus == 'error') {
+ this.resultDialog.loading = true;
+ }
+
+ this.resultDialog.importStatus = rs.importStatus;
+
+ if (pId) this.resultDialog.pId = pId;
+
+ if (this.resultDialog.datas.length == 0) {
+ this.resultDialog.datas = datas;
+ } else {
+ this.resultDialog.datas = [...this.resultDialog.datas, ...datas];
+ }
+
+ this.resultDialog.index = index;
+ }
+ });
+ }
+
+ @action
+ getResultInfo = () => {
+ let params = {
+ pId: this.resultDialog.pId,
+ };
+ this.resultDialog.loading = true;
+ asyncFetch.getImportResult(params).then((rs) => {
+ const {
+ datas,
+ status,
+ } = rs,
+{
+ succnum,
+ failnum,
+ sessionkey = '',
+ } = datas;
+
+ if (status == '1') {
+ this.resultDialog.succnum = succnum;
+ this.resultDialog.failnum = failnum;
+ sessionkey && this.resultDialog.tableStore.getDatas(sessionkey, 1);
+ }
+ this.resultDialog.loading = false;
+ });
+ }
+
+ @action
+ getRecordTable = () => {
+ let params = {
+ importType: this.importType,
+ };
+ asyncFetch.getImportHistory(params).then((rs) => {
+ const {
+ status,
+ sessionkey,
+ } = rs;
+
+ if (status == '1') {
+ this.recordDialog.tableStore.getDatas(sessionkey, 1);
+ } else {
+ message.error(rs.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ getLogTable = () => {
+ let params = {
+ importType: this.importType,
+ ...this.logDialog.form.getFormParams(),
+ };
+ if (this.resultDialog.pId) {
+ params = { ...params,
+ pId: this.resultDialog.pId,
+ };
+ }
+ asyncFetch.getImportLogDetail(params).then((rs) => {
+ const {
+ status,
+ sessionkey,
+ } = rs;
+
+ if (status == '1') {
+ this.logDialog.tableStore.getDatas(sessionkey, 1);
+ } else {
+ message.error(rs.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ submitImportInfo = () => {
+ let params = {
+ importType: this.importType,
+ excelfile: this.importDialog.excelFileId,
+ operateType: 'add',
+ };
+ if (['group', 'groupMember'].includes(this.importType)) {
+ params = {
+ ...params,
+ ...this.importDialog.form.getFormParams(),
+ };
+ }
+ if (this.otherParams) {
+ Object.assign(params, this.otherParams);
+ }
+ this.setResultInfoDialogVisible(true);
+ asyncFetch.saveImport(params).then((rs) => {
+ const {
+ status,
+ errorInfo,
+ } = rs;
+
+ if (status == '1') {
+ if (this.hasErrorInfo(errorInfo)) {
+ this.resultDialog.errorInfo = errorInfo;
+ this.resultDialog.importStatus = 'error';
+ }
+ } else {
+ message.error(rs.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ this.resultDialog.interval = setInterval(() => this.getImportProcessInfo(), 2000);
+ }
+
+ @action
+ getLogSearchPanelCondition = () => {
+ this.logDialog.loading = true;
+ let params = {
+ importType: this.importType,
+ };
+ asyncFetch.getImportLogSearchCondition(params).then((rs) => {
+ const {
+ status,
+ searchCondition,
+ } = rs;
+
+ if (status == '1') {
+ this.logDialog.condition = searchCondition;
+ this.logDialog.form.initFormFields(searchCondition);
+ } else {
+ message.error(rs.message);
+ }
+ this.logDialog.loading = false;
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ setExcelFileNo = (id) => {
+ extendObservable(this.importDialog, {
+ excelFileId: id,
+ });
+ }
+
+ @action
+ submitExcel = () => {
+ if (!this.importDialog.excelFileId) {
+ message.warning(getLabel(385362, '请选择导入模板!'));
+ return;
+ }
+ this.submitImportInfo();
+ }
+
+ @action
+ queryRecord = () => {
+ this.setRecordDialogVisible(true);
+ }
+
+ @action
+ queryLog = () => {
+ this.setLogDialogVisible(true);
+ }
+
+ @action
+ jumpToImportResult = (id) => {
+ this.resultDialog.pId = id;
+ this.resultDialog.importStatus = 'over';
+ this.setResultInfoDialogVisible(true);
+ this.getResultInfo();
+ }
+
+
+ @action
+ setImportDialogVisible = (bool) => {
+ this.importDialog.visible = bool;
+ if (bool) {
+ this.getImportForm();
+ } else {
+ this.importDialogReset();
+ }
+ }
+
+ @action
+ setResultInfoDialogVisible = (bool) => {
+ this.resultDialog.visible = bool;
+ if (!bool) {
+ clearInterval(this.resultDialog.interval);
+ this.resetResultDialogStatus();
+ }
+ }
+
+ @action
+ importDialogReset = () => {
+ this.importDialog.condition = [];
+ this.importDialog.form = new WeaForm();
+ this.importDialog.selectedValue = 'workcode';
+ this.importDialog.excelFileId = '';
+ }
+
+ @action
+ resetResultDialogStatus = () => {
+ this.resultDialog.index = 1;
+ this.resultDialog.datas = [];
+ this.resultDialog.importStatus = '';
+ this.resultDialog.pId = '';
+ this.resultDialog.interval = '';
+ this.resultDialog.errorInfo = '';
+ this.resultDialog.loading = true;
+ }
+
+ @action
+ setRecordDialogVisible = (bool) => {
+ this.recordDialog.visible = bool;
+ bool && this.getRecordTable();
+ }
+
+ @action
+ setLogDialogVisible = (bool) => {
+ this.logDialog.visible = bool;
+ bool && this.getLogTable();
+ if (!bool) {
+ this.logDialog.isPanelShow = false;
+ this.logDialog.form = new WeaForm();
+ this.logDialog.condition = [];
+ }
+ }
+
+ @action
+ setLogPanelStatus = (bool) => {
+ this.logDialog.isPanelShow = bool;
+ bool && this.logDialog.condition.length == 0 && this.getLogSearchPanelCondition();
+ }
+
+ @action
+ searchLogInfo = () => {
+ this.getLogTable();
+ }
+
+ hasErrorInfo = (errorInfo) => {
+ if (errorInfo.length == 0) return false;
+ return true;
+ }
+
+ @action
+ setTempletName = (templetName) => {
+ this.importDialog.templetName = templetName;
+ }
+
+ @action
+ setImportDialogTitle = (title) => {
+ this.importDialog.title = title;
+ }
+
+ @action
+ setImportType = (type) => {
+ this.importType = type;
+ }
+
+ @action
+ setSelectedValue = (value) => {
+ this.importDialog.selectedValue = value;
+ }
+
+ @action
+ setScoll = (component) => {
+ this.resultDialog.component = component;
+ }
+
+ @action
+ setSourceStore = (store) => {
+ this.sourceStore = store;
+ }
+
+ setOtherParams=(params) => {
+ this.otherParams = params;
+ }
+}
diff --git a/pc4backstage/pc4public/stores/hrm/otherSetting.js b/pc4backstage/pc4public/stores/hrm/otherSetting.js
new file mode 100644
index 0000000..fff9cc3
--- /dev/null
+++ b/pc4backstage/pc4public/stores/hrm/otherSetting.js
@@ -0,0 +1,213 @@
+import * as Api from '../../apis/otherSetting';
+import {
+ toJS,
+} from 'mobx';
+import {
+ observable,
+ action,
+ computed,
+} from 'mobx';
+import {
+ WeaForm,
+ WeaTableNew,
+} from 'comsMobx';
+import {
+ Button,
+ message,
+} from 'antd';
+import {
+ i18n,
+} from '../../hrm/i18n';
+
+const {
+ TableStore,
+} = WeaTableNew;
+
+export default class HrmOtherSetting {
+ @observable main = {
+ btnMenu: [],
+ authorized: false,
+ loading: true,
+ }
+ @observable formInfo = {
+ conditions: [],
+ form: new WeaForm(),
+ loading: true,
+ date: '',
+ id: '',
+ }
+
+ @observable hasSynchroRight = false;
+
+ @computed get menu() {
+ let topMenu = this.main.btnMenu.filter(item => item.isTop == '1' || item.isBatch == '1');
+ let rightMenu = this.main.btnMenu.filter(item => !item.isBatch);
+
+ return {
+ topMenu,
+ rightMenu,
+ };
+ }
+
+ @action
+ getAuth = () => {
+ Api.getAuth().then((cb) => {
+ const {
+ status,
+ hasRight,
+ } = cb;
+
+ if (status == '1') {
+ hasRight && this.grantAuth();
+ this.main.loading = false;
+ } else {
+ message.error(cb.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ getButtonsMenu = () => {
+ Api.getButtonsMenu().then((rs) => {
+ const {
+ api_status,
+ btnMenu,
+ } = rs;
+
+ if (api_status) {
+ this.main.btnMenu = btnMenu;
+ } else {
+ message.error(rs.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ getFormInfo = () => {
+ Api.getFormInfo().then((rs) => {
+ const {
+ api_status,
+ conditions,
+ id,
+ hasRight,
+ } = rs;
+
+ if (api_status) {
+ this.formInfo.conditions = conditions;
+ this.formInfo.form.initFormFields(conditions);
+ this.formInfo.id = id;
+ this.formInfo.loading = false;
+
+ this.hasSynchroRight = hasRight;
+ } else {
+ message.error(rs.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ save = () => {
+ const {
+ form,
+ id,
+ } = this.formInfo;
+
+ const params = {
+ id,
+ ...form.getFormParams(),
+ };
+
+ Api.save(params).then((rs) => {
+ const {
+ api_status,
+ sign,
+ } = rs;
+
+ if (params.defaultLinkMode !== undefined) {
+ window.localStorage.setItem('ec_open_rewrite', params.defaultLinkMode);
+ }
+
+ if (params.dragColumns !== undefined) {
+ window.localStorage.setItem('dragColumns_WeaTable', params.dragColumns);
+ }
+
+ if (params.isPageAutoWrap !== undefined) {
+ window.localStorage.setItem('isPageAutoWrap', params.isPageAutoWrap);
+ }
+
+ if (api_status) {
+ sign == '1' ? message.success(rs.message) : message.warning(rs.message);
+ } else {
+ message.error(rs.message);
+ }
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+
+ @action
+ grantAuth = () => {
+ this.main.authorized = true;
+ }
+
+ @action
+ closeAuth = () => {
+ this.main.authorized = false;
+ }
+
+ @action
+ refreshFormInfo = () => {
+ this.formInfo.form = new WeaForm();
+ this.formInfo.conditions = [];
+ this.formInfo.loading = true;
+ }
+
+ @action
+ getButtons = () => {
+ const btns = [()];
+
+ return btns;
+ }
+
+ @action
+ getRightMenu = () => {
+ const menu = [{
+ key: '0',
+ icon: ,
+ content: i18n.button.save(),
+ }];
+
+ return menu;
+ }
+
+ @action
+ onRightMenuClick = (key) => {
+ key == '0' && this.save();
+ }
+
+ synchro = () => {
+ const {
+ form,
+ } = this.formInfo,
+{
+ defaultLinkMode,
+ } = form.getFormParams();
+
+ Api.synchro({
+ defaultLinkMode,
+ }).then((rs) => {
+ const {
+ status,
+ } = rs;
+ status ? message.success('同步成功') : message.warning('同步失败');
+ }).catch((error) => {
+ message.error(error);
+ });
+ }
+}
diff --git a/pc4backstage/pc4public/stores/index.js b/pc4backstage/pc4public/stores/index.js
new file mode 100644
index 0000000..af7e9f9
--- /dev/null
+++ b/pc4backstage/pc4public/stores/index.js
@@ -0,0 +1,32 @@
+// 门户管理
+import WeaPortalCustomSettingStore from './portal/';
+// 人力资源
+import WeaHrmGroupStore from './hrm/WeaHrmGroupStore';
+import HrmOtherSetting from './hrm/otherSetting';
+// import WeaCloudstoreSetting from './cloudstore/setting';
+// 工作流
+import UserDefaultSettingStore from './workflow/userDefaultSettingStore';
+import UserPhraseEditStore from './workflow/userPhraseEditStore';
+import AutographStore from './workflow/autographStore';
+
+import PrivateGroupStore from './odoc/privateGroupStore';
+
+const weahrm_group_store = new WeaHrmGroupStore();
+// const weacloudstore_setting_store = new WeaCloudstoreSetting();
+const hrmOtherSetting = new HrmOtherSetting();
+const weaworkflow_userdefault_store = new UserDefaultSettingStore();
+const weaworkflow_userphrase_store = new UserPhraseEditStore();
+const weaworkflow_autograph_store = new AutographStore();
+
+const odoc_privateGroupStore = new PrivateGroupStore();
+
+export default {
+ ...WeaPortalCustomSettingStore,
+ weahrm_group_store,
+ // weacloudstore_setting_store,
+ hrmOtherSetting,
+ weaworkflow_userdefault_store,
+ weaworkflow_userphrase_store,
+ weaworkflow_autograph_store,
+ odoc_privateGroupStore,
+};
diff --git a/pc4backstage/pc4public/stores/odoc/privateGroupStore.js b/pc4backstage/pc4public/stores/odoc/privateGroupStore.js
new file mode 100644
index 0000000..0dc6d58
--- /dev/null
+++ b/pc4backstage/pc4public/stores/odoc/privateGroupStore.js
@@ -0,0 +1,258 @@
+import { observable, action, toJS } from 'mobx';
+import { WeaTableNew, WeaLogView, WeaForm } from 'comsMobx';
+import { WeaLocaleProvider } from 'ecCom';
+import * as Api from './../../apis/privateGroupSetingApi';
+import { message, Modal, Button } from 'antd';
+
+const { TableStore } = WeaTableNew;
+const { LogStore } = WeaLogView;
+const { getLabel } = WeaLocaleProvider;
+const confirm = Modal.confirm;
+
+class PrivateGroupStore {
+ @observable dialogVisible = false;
+ @observable tableStore = new TableStore();
+ @observable selectedRowKeys = [];
+ @observable logVisible = false;
+ @observable logStore = new LogStore();
+ @observable logType = '';
+ @observable logSmallType = '';
+ @observable isOdocPanelShow = false;
+
+ @observable loading = false;
+
+ @observable isCreat = true;
+ @observable conditions = [];
+ @observable receiveId = '';
+ @observable clickRowKey = '';
+
+
+ /* --编辑弹窗--*/
+ @observable odocForm = new WeaForm();
+ @observable odoConditionForm = new WeaForm();
+ @observable creatDialogVisible = false;
+
+ // 获取列表数据
+ @action.bound getTableData () {
+ const param = {
+ ConditionType: '1',
+ ...this.odoConditionForm.getFormParams(),
+ };
+ this.selectedRowKeys = [];
+ Api.getTableData(param).then((data) => {
+ if (data.sessionkey) {
+ this.tableStore.getDatas(data.sessionkey);
+ }
+ });
+ }
+
+ // 行选中
+ @action.bound rowSelection (selectRow) {
+ this.selectedRowKeys = selectRow;
+ }
+
+ // 弹窗隐藏
+ @action.bound dialogHide () {
+ this.dialogVisible = false;
+ }
+
+ // 弹窗显示
+ @action.bound dialogShow () {
+ this.dialogVisible = true;
+ }
+
+ // 编辑/新建 弹窗隐藏
+ @action.bound creatDialogHide (save='') {
+ this.creatDialogVisible = false;
+ if (save=='save') {
+ this.selectedRowKeys = [];
+ }
+ this.receiveId = '';
+ }
+
+ // 编辑/新建 弹窗显示
+ @action.bound creatDialogShow (isCreat = true) {
+ this.isCreat = isCreat;
+ this.getCommReceiveItems(isCreat);
+ this.creatDialogVisible = true;
+ }
+
+
+ @action
+ updateOdocForm (val) {
+ this.odoConditionForm.updateFields({
+ receiveName: val,
+ });
+ }
+
+ // 获取odocForm表单
+ @action.bound getCommReceiveItems (isCreat) {
+ if (!isCreat) {
+ this.receiveId = this.clickRowKey;
+ }
+ const params = {
+ ConditionType: '1',
+ receiveId: this.receiveId,
+ };
+ Api.getCommReceiveItems(params).then((data) => {
+ if (data.api_status) {
+ this.odocForm = new WeaForm();
+ this.odocForm.setCondition(data.groupsCondition);
+ if (isCreat) {
+ this.odocForm.updateFields({ sorting: { value: '0' } });
+ }
+ }
+ });
+ }
+
+ // 右侧操作菜单
+ @action.bound onOperatesClick (record, index, operate, flag) {
+ this.clickRowKey = record.id;
+ if (flag == '0') {
+ this.creatDialogShow(false);
+ } else if (flag == '2') {
+ this.showConfirm('one');
+ } else if (flag == '3') {
+ this.logShow();
+ }
+ }
+
+ // 校验
+ @action.bound onCheck () {
+ this.odocForm.validateForm().then((data) => {
+ if (data.isValid) {
+ this.saveReceiveGroup();
+ } else {
+ data.showErrors();
+ }
+ });
+ }
+
+ // 编辑 新建保存
+ @action.bound saveReceiveGroup () {
+ this.setLoading(true);
+ const formData = this.odocForm.getFormParams();
+ const id = this.clickRowKey;
+ const param = {
+ ...formData,
+ receiveunitType: '1',
+ id: this.isCreat ? '' : id,
+ };
+ Api.saveReceiveGroup(param).then((data) => {
+ this.setLoading(false);
+ if (data.api_status) {
+ this.getTableData();
+ this.creatDialogHide('save');
+ message.success(getLabel(22619, '保存成功!'));
+ } else {
+ message.error(data.api_errormsg);
+ }
+ });
+ }
+
+ // 获取高级搜索列表
+ @action.bound getPanelForm () {
+ const params = {
+ cmd: 'base',
+ };
+ Api.getSearchCondition(params).then((data) => {
+ this.conditions = data.conditions;
+ if (window.console) console.log(data);
+ this.odoConditionForm.initFormFields(data.conditions);
+ });
+ }
+
+
+ @action.bound setOdocPanelStatus (bool) {
+ this.isOdocPanelShow = bool;
+ }
+
+ @action.bound showConfirm (type = '') {
+ const _this = this;
+ confirm({
+ title: getLabel('384484', '您是否确认要删除这项内容'),
+ onOk () {
+ _this.deletePrivate(type);
+ },
+ });
+ }
+
+
+ // 删除
+ @action.bound deletePrivate (type) {
+ this.setLoading(true);
+ const params = {
+ ids: type == 'one' ? this.clickRowKey : this.selectedRowKeys.join(','),
+ };
+ Api.deleteReceiveGroup(params).then((data) => {
+ this.setLoading(false);
+ if (data.api_status) {
+ message.success(getLabel(20461, '删除成功'));
+ this.getTableData();
+ this.selectedRowKeys = [];
+ this.clickRowKey = '';
+ } else {
+ message.error(data.api_errormsg);
+ }
+ });
+ }
+
+
+ // 获取日志参数
+ @action.bound getPrivateReceiveLogType () {
+ Api.getPrivateReceiveLogType().then((data) => {
+ this.logType = data.logType;
+ this.logSmallType = data.logSmallType;
+ });
+ }
+
+ // 日志显示
+ @action.bound logShow () {
+ this.logVisible = true;
+ }
+
+ // 日志隐藏
+ @action.bound logHide () {
+ this.logVisible = false;
+ // this.selectedRowKeys = [];
+ this.clickRowKey = '';
+ }
+
+ @action.bound setLoading (bool) {
+ this.loading = bool;
+ }
+
+ @action
+ getRightMenu = () => {
+ const disabled = !(toJS(this.selectedRowKeys).length > 0);
+ let btns = [];
+ btns.push({
+ key: '1',
+ icon: ,
+ content: getLabel(365, '新建'),
+ onClick: () => {
+ this.creatDialogShow();
+ },
+ }, {
+ key: '2',
+ disabled: !this.loading && disabled,
+ icon: ,
+ content: getLabel(32136, '批量删除'),
+ onClick: () => {
+ this.showConfirm();
+ },
+ });
+ return btns;
+ }
+ @action
+ getButtons = () => {
+ const disabled = !(toJS(this.selectedRowKeys).length > 0);
+ const btns = [
+ ,
+ ,
+ ];
+
+ return btns;
+ }
+}
+export default PrivateGroupStore;
diff --git a/pc4backstage/pc4public/stores/portal/WeaPortalCustomSettingStore.js b/pc4backstage/pc4public/stores/portal/WeaPortalCustomSettingStore.js
new file mode 100644
index 0000000..47a3ff9
--- /dev/null
+++ b/pc4backstage/pc4public/stores/portal/WeaPortalCustomSettingStore.js
@@ -0,0 +1,89 @@
+import { observable, action } from 'mobx';
+import { message, Modal, Button } from 'antd';
+import { WeaTools, WeaLocaleProvider } from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+import objectAssign from 'object-assign';
+import HrmImportCommon from '../hrm/importCommon.js';
+
+class WeaPortalCustomSettingStore {
+ @observable state = {
+ loading: true,
+ hideLeftMenu: '0',
+ isRemeberTab: '0',
+ isShowLeftMenu: '0',
+ isSortTopByUsage: '0',
+ quickSearchShowMenu: '0',
+ hplist: [],
+ };
+
+ constructor() {
+ this.onSetState = this.onSetState.bind(this);
+ this.getButtons = this.getButtons.bind(this);
+ this.getRightMenu = this.getRightMenu.bind(this);
+ this.onRightMenuClick = this.onRightMenuClick.bind(this);
+ this.getPortalData = this.getPortalData.bind(this);
+ this.onSaveSetting = this.onSaveSetting.bind(this);
+ }
+
+ // 实例化【导入】对应的store
+ @observable hrmImportCommon = new HrmImportCommon();
+
+ // 向【导入】store中注入【人力资源】store
+ setSourceStore = (store) => {
+ this.hrmImportCommon.setSourceStore(store);
+ }
+
+ @action
+ onSetState(state) {
+ this.state = objectAssign({}, this.state, state);
+ }
+
+ @action
+ getButtons() {
+ let btns = [];
+ btns.push();
+ return btns;
+ }
+
+ @action
+ getRightMenu() {
+ let btns = [];
+ btns.push({
+ icon: ,
+ content: getLabel(30986, '保存'),
+ });
+ return btns;
+ }
+
+ @action
+ onRightMenuClick(key) {
+ switch (key) {
+ case '0':
+ this.onSaveSetting();
+ break;
+ }
+ }
+
+ @action
+ getPortalData() {
+ WeaTools.callApi('/api/portal/customSetting/getCustomSettingData', 'GET', {}).then((result) => {
+ const { data } = result;
+ this.state = { ...data, loading: false };
+ });
+ }
+
+ @action
+ onSaveSetting() {
+ let params = { ...this.state };
+ delete params.hplist;
+ WeaTools.callApi('/api/portal/customSetting/saveCustomSettingData', 'POST', params).then((result) => {
+ if (result.api_status) {
+ message.success(getLabel(83551, '保存成功!'));
+ } else {
+ message.error(getLabel(84544, '保存失败!'));
+ }
+ });
+ }
+}
+module.exports = WeaPortalCustomSettingStore;
diff --git a/pc4backstage/pc4public/stores/portal/index.js b/pc4backstage/pc4public/stores/portal/index.js
new file mode 100644
index 0000000..03e3a56
--- /dev/null
+++ b/pc4backstage/pc4public/stores/portal/index.js
@@ -0,0 +1,7 @@
+import WeaPortalCustomSettingStore from './WeaPortalCustomSettingStore';
+import PortalMenuStore from '../../../pc4backstage/portal4engine/stores/portalmenu/PortalMenuStore';
+
+const weaportal_customsetting_store = new WeaPortalCustomSettingStore();
+const portalMenuStore = new PortalMenuStore();
+
+export default { weaportal_customsetting_store, portalMenuStore };
diff --git a/pc4backstage/pc4public/stores/workflow/autographStore.js b/pc4backstage/pc4public/stores/workflow/autographStore.js
new file mode 100644
index 0000000..334d711
--- /dev/null
+++ b/pc4backstage/pc4public/stores/workflow/autographStore.js
@@ -0,0 +1,52 @@
+import * as API from '../../apis/autographApi';
+import { observable, action } from 'mobx';
+
+export default class AutographStore {
+ @observable initInfo = [];
+ @observable isMustInput = '';
+ @observable isAutoResizeSignImage = true;
+ @observable recordId = '0';
+ @observable visible = true;
+
+ @action
+ setMobxState = (params = {}) => {
+ Object.keys(params).forEach((v) => {
+ this[v] = params[v];
+ });
+ }
+ @action
+ getAutographInfo = params => new Promise((resolve) => {
+ API.getAutographInfo(params).then((res) => {
+ this.initInfo = res;
+ resolve(res);
+ });
+ })
+
+ @action
+ saveAutograph = (src) => {
+ const isMustInput = this.isMustInput;
+ if (isMustInput === '1' || (isMustInput === '2' && src === 'reject')) {
+ if (Consult.DocEmpty && Consult.OpinionText == '') {
+ return false;
+ }
+ }
+ // TODO save
+ let record = '';
+ const timestamp = Date.parse(new Date()) / 1000;
+ if (Consult.Modify) {
+ let saveFlag = this.isAutoResizeSignImage ? Consult.SaveAsGifEx(`${timestamp}.gif`, 'All', 'Remote') : Consult.SaveSignature();
+ if (!saveFlag) {
+ return false;
+ }
+ record = Consult.WebGetMsgByName('RECORDID');
+ if (parseInt(record) > 0 && this.isAutoResizeSignImage) {
+ Consult.WebSetMsgByName('TEMPCALL', '1');
+ Consult.WebSetMsgByName('TEMPID', record);
+ saveFlag = Consult.SaveSignature();
+ }
+ } else {
+ return this.recordId;
+ }
+ return record;
+ }
+}
diff --git a/pc4backstage/pc4public/stores/workflow/listStore.js b/pc4backstage/pc4public/stores/workflow/listStore.js
new file mode 100644
index 0000000..29cc835
--- /dev/null
+++ b/pc4backstage/pc4public/stores/workflow/listStore.js
@@ -0,0 +1,80 @@
+import { observable, action } from 'mobx';
+import { WeaForm } from 'comsMobx';
+import { WeaTableNew } from 'comsMobx';
+
+const { TableStore } = WeaTableNew;
+
+/**
+ * @author liuzy 2017-10-18
+ * 流程列表通用store模板,适应于树+列表+高级查询模式,实例:待办/已办/我的请求/查询流程/流程回收站等等
+ */
+export class ListStore {
+ /** 列表store */
+ @observable loading = false;
+ title = '';
+ @observable tableStore = new TableStore();
+
+ /** 高级查询store */
+ @observable form = new WeaForm();
+ @observable showSearchAd = false;
+ condition = [];
+
+ /** 左侧树store */
+ leftTree = [];
+ leftTreeCount = {};
+ leftTreeCountType = [];
+ selectedTreeKey = '';
+
+ /** 顶部Tab组件store */
+ topTab = [];
+ topTabCount = {};
+
+ constructor() {
+ this.setLoading = this.setLoading.bind(this);
+ this.setTitle = this.setTitle.bind(this);
+ this.setShowSearchAd = this.setShowSearchAd.bind(this);
+ this.setFormFields = this.setFormFields.bind(this);
+ this.appendFormFields = this.appendFormFields.bind(this);
+ this.clearFormFields = this.clearFormFields.bind(this);
+ this.setSelectedTreeKey = this.setSelectedTreeKey.bind(this);
+ this.resetForm = this.resetForm.bind(this);
+ this.resetTable = this.resetTable.bind(this);
+ }
+
+ @action
+ setLoading(bool = false) {
+ this.loading = bool;
+ }
+
+ setTitle(title) {
+ this.title = title;
+ }
+
+ setShowSearchAd(bool) {
+ this.showSearchAd = bool;
+ }
+
+ setFormFields(value) {
+ this.form.updateFields(value, true); // true代表完全覆盖方式更新条件值
+ }
+
+ appendFormFields(value) {
+ this.form.updateFields(value, false);
+ }
+
+ clearFormFields() {
+ this.form.resetConditionValue(); // 清除查询条件值
+ }
+
+ setSelectedTreeKey(key) {
+ this.selectedTreeKey = key;
+ }
+
+ resetForm() {
+ this.form = new WeaForm();
+ }
+
+ resetTable() {
+ this.tableStore = new TableStore();
+ }
+}
diff --git a/pc4backstage/pc4public/stores/workflow/userDefaultSettingStore.js b/pc4backstage/pc4public/stores/workflow/userDefaultSettingStore.js
new file mode 100644
index 0000000..345dd8c
--- /dev/null
+++ b/pc4backstage/pc4public/stores/workflow/userDefaultSettingStore.js
@@ -0,0 +1,187 @@
+/**
+ * @author jh
+ */
+
+import { observable, action } from 'mobx';
+import { message, Button, Modal } from 'antd';
+
+import { ListStore } from './listStore';
+import * as API from '../../apis/userDefaultSettingApi';
+
+import { WeaLocaleProvider } from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+export default class UserDefaultSettingStore extends ListStore {
+ @observable showColl = false;
+ @observable selectedRows =[];
+ @observable conditions = [];
+ @observable visiableAdd = false;// 新建短语的弹窗的显隐
+ date = new Date();
+ weaworkflow_userdefault_store = null;
+
+ constructor() {
+ super();
+ this.getConditionInfo = this.getConditionInfo.bind(this);
+ this.onSave = this.onSave.bind(this);
+ this.getRightMenu = this.getRightMenu.bind(this);
+ this.onRightMenuClick = this.onRightMenuClick.bind(this);
+ this.getButtons = this.getButtons.bind(this);
+ this.closeColl = this.closeColl.bind(this);
+ this.updateSelectedRows = this.updateSelectedRows.bind(this);
+ this.onDel = this.onDel.bind(this);
+ this.changeDisplay = this.changeDisplay.bind(this);
+ }
+
+ /**
+ * 控制显隐
+ */
+ @action
+ changeDisplay(para) {
+ API.doChangeStatus(para).then((res) => {
+ const { success = '0', msg = '' } = res;
+ message.success(msg);
+ if (success == 1) {
+ this.getConditionInfo();
+ }
+ });
+ }
+
+ /**
+ * 获取页面Condition
+ * @param para
+ */
+ @action
+ getConditionInfo(para = {}) {
+ API.getConditionInfo(para).then((reVal) => {
+ this.resetTable();
+ this.form.setCondition([reVal.conditions[0]]);
+ this.conditions = reVal.conditions;
+ this.tableStore.getDatas(reVal.tableSession, para.current || 1);
+ this.dataKey = reVal.tableSession;
+ });
+ }
+
+ /**
+ * //设置新建短语弹窗的显隐
+ * @param selectedRow
+ */
+
+ @action
+ setVisiableAdd = (val) => {
+ this.visiableAdd = val;
+ }
+ /**
+ * 更新table选中行
+ * @param selectedRow
+ */
+ @action
+ updateSelectedRows(selectedRow) {
+ this.selectedRows = selectedRow;
+ }
+
+ @action
+ set_weaworkflow_userdefault_store = (val) => {
+ this.weaworkflow_userdefault_store = val;
+ }
+
+ /**
+ * 删除
+ * @param id
+ */
+ onDel(phraseId) {
+ phraseId && this.selectedRows.push(phraseId);
+ const para = {
+ ids: this.selectedRows.join(','),
+ };
+ const thisCxt = this;
+ Modal.confirm({
+ title: getLabel(131329, '信息确认'),
+ content: this.selectedRows.length > 1 ? getLabel(33435, ' 确定要删除选中的记录吗? ') : getLabel(15097, ' 确定要删除吗?'),
+ onOk() {
+ API.deleteData(para).then((reVal) => {
+ message.success(reVal.msg);
+ thisCxt.getConditionInfo();
+ // 清空已选行
+ thisCxt.selectedRows = [];
+ });
+ },
+ onCancel() {},
+ okText: getLabel(33703, '确认'),
+ cancelText: getLabel(31129, '取消'),
+ });
+ }
+
+ /**
+ * 保存显示设置
+ */
+ @action
+ onSave() {
+ const para = this.form.getFormParams();
+ this.form.validateForm().then((f) => {
+ if (f.isValid) {
+ API.doSaveUserDefault(para).then((reVal) => {
+ message.success(reVal.msg);
+ });
+ } else {
+ f.showErrors();
+ this.date = new Date();
+ }
+ });
+ }
+
+ @action
+ getButtons() {
+ let btns = [];
+ btns.push();
+ return btns;
+ }
+
+ // 右键菜单项
+ @action
+ getRightMenu() {
+ return [{
+ key: 'save',
+ icon: ,
+ content: getLabel(30986, '保存'),
+ onClick: () => {
+ this.onSave();
+ },
+ }, {
+ key: 'displayCol',
+ icon: ,
+ content: getLabel(32535, '显示列定制'),
+ onClick: () => {
+ this.tableStore.setColSetVisible(true);
+ this.tableStore.tableColSet(true);
+ },
+ }, {
+ key: 'coll',
+ icon: ,
+ content: getLabel(28111, '收藏'),
+ onClick: (key) => {
+ this.showColl = true;
+ },
+ }];
+ }
+
+ @action
+ onRightMenuClick(key) {
+ switch (key) {
+ case '0':
+ this.onSave();
+ break;
+ case '1':
+ this.tableStore.setColSetVisible(true);
+ this.tableStore.tableColSet(true);
+ break;
+ case '2':
+ this.showColl = true;
+ break;
+ }
+ }
+ @action
+ closeColl() {
+ this.showColl = false;
+ }
+}
diff --git a/pc4backstage/pc4public/stores/workflow/userPhraseEditStore.js b/pc4backstage/pc4public/stores/workflow/userPhraseEditStore.js
new file mode 100644
index 0000000..ec2b8b3
--- /dev/null
+++ b/pc4backstage/pc4public/stores/workflow/userPhraseEditStore.js
@@ -0,0 +1,110 @@
+/**
+ * @author jh
+ */
+
+
+import { observable, action, toJS } from 'mobx';
+import { message, Modal } from 'antd';
+import { WeaLocaleProvider } from 'ecCom';
+
+import { ListStore } from './listStore';
+import * as API from '../../apis/userDefaultSettingApi';
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+export default class UserPhraseEditStore extends ListStore {
+ @observable visiable = false;
+ @observable phraseDescValue ='';
+ @observable saveDisable = false;
+ @observable success = -1; // -1无权限;0异常;1成功
+
+ conditions = [];
+
+ phraseId = '';
+
+ constructor() {
+ super();
+ this.onEdit = this.onEdit.bind(this);
+ this.onCancelEdit = this.onCancelEdit.bind(this);
+ this.richTextOnChange = this.richTextOnChange.bind(this);
+ }
+
+
+ /**
+ * 获取设置信息
+ * @param id
+ */
+ onEdit(id = '', defaultRemark) {
+ const para = {
+ id,
+ };
+ API.doEdit(para).then((reVal) => {
+ super.resetForm();
+ this.form.initFormFields(reVal.conditions);
+ this.conditions = reVal.conditions;
+ this.phraseDescValue = defaultRemark || reVal.phraseDescValue;
+ // this.visiable = true;
+ this.phraseId = id;
+ this.success = reVal.success;
+ });
+ }
+
+ /**
+ * 保存
+ */
+ onSave(callFun) {
+ if (this.realLength(this.phraseDescValue) > 4000) {
+ Modal.warning({ title: getLabel(131329, '信息确认'), okText: getLabel(33703, '确认'), content: getLabel(385840, '文本长度不能超过4000(1个中文字符等于3个长度)') });
+ return;
+ }
+ this.form.validateForm().then((f) => {
+ if (f.isValid) {
+ this.saveDisable = true;
+ const para = {
+ id: this.phraseId,
+ phraseDesc: this.phraseDescValue,
+ };
+ const formPara = { ...this.form.getFormParams(), ...para };
+ API.doSave(formPara).then((reVal) => {
+ message.success(reVal.msg);
+ this.onCancelEdit();
+ this.saveDisable = false;
+ callFun && callFun();
+ });
+ } else {
+ f.showErrors();
+ }
+ });
+ }
+ /**
+ * 关闭编辑弹框
+ */
+ onCancelEdit() {
+ this.visiable = false;
+ }
+
+ /**
+ * 富文本编辑器
+ */
+ richTextOnChange(desc = '') {
+ this.phraseDescValue = desc;
+ }
+
+ realLength(str) {
+ let j = 0;
+ for (let i = 0; i <= str.length - 1; i++) {
+ j += 1;
+ if ((str.charCodeAt(i)) > 127) {
+ j += 2;
+ }
+ }
+ return j;
+ }
+ @action
+ setStates = (states = {}) => {
+ const keys = Object.keys(states);
+ keys.forEach((key) => {
+ this[key] = states[key];
+ });
+ }
+}
diff --git a/pc4backstage/pc4public/workflow/Autograph.js b/pc4backstage/pc4public/workflow/Autograph.js
new file mode 100644
index 0000000..76a3cc8
--- /dev/null
+++ b/pc4backstage/pc4public/workflow/Autograph.js
@@ -0,0 +1,289 @@
+import React from 'react';
+import { inject, observer } from 'mobx-react';
+import { Icon } from 'antd';
+import {
+ WeaTools,
+ WeaLocaleProvider,
+ WeaErrorPage
+} from 'ecCom';
+import './style/autograph.less';
+
+const getLabel = WeaLocaleProvider.getLabel;
+@inject('weaworkflow_autograph_store')
+@observer
+export default class Autograph extends React.Component {
+ static defaultProps = {
+ prefixCls: 'wf-autograph',
+ }
+ constructor(props) {
+ super(props);
+ this.state = {
+ formSignatureWidth: 1034,
+ editType: 0, //EditType:默认签章类型,0:签名 1:文字 默认值:0
+ isIE: true,
+ }
+ }
+
+ componentDidMount() {
+ const { weaworkflow_autograph_store: {
+ getAutographInfo, setMobxState,
+ }, params, isMustInput, recordId } = this.props;
+ const ua = navigator.userAgent.toLowerCase();
+ const isIE = /rv:([\d.]+)\) like gecko/.test(ua);
+ this.setState({ isIE });
+ this.handleResize();
+ setMobxState({ isMustInput, recordId });
+ jQuery(Consult2).parent().append('')
+ isIE && getAutographInfo(params).then(() => {
+ this.initAutograph();
+ });
+ window.addEventListener('resize', this.handleResize);
+ }
+
+ componentWillUnmount() {
+ window.removeEventListener('resize', this.handleResize);
+ }
+
+ handleResize = () => {
+ const { formSignatureWidth } = this.state;
+ const dom = document.getElementById('consultdiv');
+ const width = dom.clientWidth || dom.scrollWidth;
+ if (width !== formSignatureWidth) {
+ this.setState({ formSignatureWidth: width });
+ }
+ }
+
+ initAutograph() {
+ const { formSignatureWidth } = this.state;
+ const {weaworkflow_autograph_store} = this.props;
+ const { initInfo, setMobxState } = weaworkflow_autograph_store;
+ Consult.WebUrl = '/workflow/request/RevisionServer.jsp'; //WebUrl:系统服务器路径,与服务器交互操作,如打开签章信息
+ // Consult.WebUrl = initInfo.WebUrl; //WebUrl:系统服务器路径,与服务器交互操作,如打开签章信息
+ Consult.RecordID = initInfo.RecordID || '-1'; //RecordID:本文档记录编号
+ Consult.FieldName ="Consult"; //FieldName:签章窗体可以根据实际情况再增加,只需要修改控件属性 FieldName 的值就可以
+ Consult.UserName = initInfo.UserName; //UserName:签名用户名称
+ Consult.WebSetMsgByName("USERID", initInfo.UserId); //USERID:签名用户id
+ Consult.Enabled = initInfo.Consult_Enabled; //Enabled:是否允许修改,0:不允许 1:允许 默认值:1
+ Consult.PenColor = initInfo.PenColor; //PenColor:笔的颜色,采用网页色彩值 默认值:#000000
+ Consult.BorderStyle = "0"; //BorderStyle:边框,0:无边框 1:有边框 默认值:1
+ Consult.EditType = initInfo.EditType; //EditType:默认签章类型,0:签名 1:文字 默认值:0
+ Consult.ShowPage = initInfo.ShowPage; //ShowPage:设置默认显示页面,0:电子印章,1:网页签批,2:文字批注 默认值:0
+ Consult.InputText = ""; //InputText:设置署名信息, 为空字符串则默认信息[用户名+时间]内容
+ Consult.PenWidth = initInfo.PenWidth; //PenWidth:笔的宽度,值:1 2 3 4 5 默认值:2
+ Consult.FontSize = initInfo.FontSize; //FontSize:文字大小,默认值:11
+ Consult.ShowMenu = "0";
+ Consult.SignatureType = initInfo.SignatureType; //SignatureType:签章来源类型,0表示从服务器数据库中读取签章,1表示从硬件密钥盘中读取签章,2表示从本地读取签章,并与ImageName(本地签章路径)属性相结合使用 默认值:0}
+ Consult.InputList = initInfo.InputList; //InputList:设置文字批注信息列表
+ Consult.ShowUserListMenu = "true"; //签批用户列表是否显示,"true"为显示
+ Consult.FontName=initInfo.FontName; // 设置字体名称
+ Consult.CASignType = initInfo.CASignType; //默认为不启用数字签名
+ Consult.SetFieldByName("DocEmptyJuggle", initInfo.DocEmptyJuggle);
+ Consult.LoadSignature(); //调用签章数据信息
+ Consult.ImgWidth=formSignatureWidth;
+ Consult.ImgHeight = initInfo.formSignatureHeight;
+ // this.setState({ isAutoResizeSignImage: initInfo.isAutoResizeSignImage });
+ setMobxState({ isAutoResizeSignImage: initInfo.isAutoResizeSignImage });
+ }
+
+ // saveAutograph = (src) => {
+ // const { isMustInput } = this.props;
+ // if (isMustInput === '1' || (isMustInput === '2' && "reject" === src)) {
+ // if(Consult.DocEmpty && Consult.OpinionText == "") {
+ // isDocEmpty = 1;
+ // return false;
+ // }
+ // }
+ // //TODO save
+ // let record = '';
+ // let timestamp = Date.parse(new Date());
+ // timestamp = timestamp / 1000;
+ // if (Consult.Modify) {
+ // let saveFlag = this.state.isAutoResizeSignImage ? Consult.SaveAsGifEx(timestamp+".gif","All","Remote") : Consult.SaveSignature();
+ // if (!saveFlag) {
+ // return false;
+ // }
+ // record = Consult.WebGetMsgByName("RECORDID");
+ // if (parseInt(record) > 0 && isAutoResizeSignImage) {
+ // Consult.WebSetMsgByName("TEMPCALL","1");
+ // Consult.WebSetMsgByName("TEMPID",record);
+ // saveFlag = Consult.SaveSignature();
+ // }
+ // } else {
+ // return this.props.recordId;
+ // }
+ // return record;
+ // }
+
+ getHash = (prefixCls) => prefixCls + Math.random().toString(36).substr(2, 6);
+
+ openSignature = () => this.state.isIE && Consult.OpenSignature();
+
+ changeEditType = () => this.state.isIE && this.setState({ editType: Consult.EditType === 0 ? 1 : 0, }, () => { Consult.EditType = this.state.editType; });
+
+ showSignature = () => this.state.isIE && Consult.ShowSignature();
+
+ clear = () => this.state.isIE && Consult.Clear();
+
+ clearAll = () => this.state.isIE && Consult.ClearAll();
+
+ chgReadSignatureType = () => {
+ if (this.state.isIE) {
+ const res = Consult.SignatureType === 1 ? 0 : 1;
+ if (this.state.isIE) {
+ Consult.SignatureType = res;
+ if (res === 0) alert('签章从数据库中读取');
+ else alert('签章从智能钥匙盘中读取');
+ }
+ }
+ }
+
+ showZoomInHandWrite = () => this.state.isIE && Consult.ShowZoomInHandWrite();
+
+ getToolTabs = () => {
+ const { editType } = this.state;
+ const { prefixCls, weaworkflow_autograph_store: { visible, isMustInput, setMobxState } } = this.props;
+ return visible ? (
+
+ |
+
+ 签字意见
+ { isMustInput && ((必填))}
+ |
+
+
+
+
+
+
+ {getLabel('21431', '打开签章 ')}
+
+ |
+
+
+
+
+
+
+ { editType === 0 ? getLabel('25349', '手写签批 ') : getLabel('21441', '文字签批 ') }
+
+ |
+
+
+
+
+
+
+
+
+
+
+ {getLabel('21432', '签章列表 ')}
+
+ |
+
+
+
+
+
+
+ {getLabel('21433', '取消修改 ')}
+
+ |
+
+
+
+
+
+
+ {getLabel('21434', '清空全部 ')}
+
+ |
+
+
+
+
+
+
+
+
+
+
+ {getLabel('21435', '切换签章来源 ')}
+
+ |
+
+
+
+
+
+
+
+
+
+
+ {getLabel('131881', ' 全屏手写')}
+
+ |
+
+ ): (
+ setMobxState({ visible: true })}>
+ |
+
+ 签字意见
+ {isMustInput && ((必填))}
+ |
+
+ )
+ }
+
+ render() {
+ const { formSignatureWidth, isIE } = this.state;
+ const { weaworkflow_autograph_store, prefixCls, bottomBarConfig } = this.props;
+ const { initInfo: { formSignatureHeight = 200, revisionClassId, revisionClientUrl }, visible } = weaworkflow_autograph_store;
+ return (
+
+
+ {
+ visible ? isIE ? (
+
+ ) : (
+
+
!
+
+
您当前使用的浏览器不支持【表单签章】,
+
如需使用该功能,请使用IE浏览器!
+
+
+ ) : null
+ }
+ {
+ visible && bottomBarConfig && (
+
+ { bottomBarConfig.map(config => (
{config}
)) }
+
+ )
+ }
+
+ );
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/pc4public/workflow/RichTextTitle.js b/pc4backstage/pc4public/workflow/RichTextTitle.js
new file mode 100644
index 0000000..7b5841c
--- /dev/null
+++ b/pc4backstage/pc4public/workflow/RichTextTitle.js
@@ -0,0 +1,32 @@
+import React from 'react';
+
+import {inject,observer} from 'mobx-react';
+
+import {WeaLocaleProvider,WeaHelpfulTip} from 'ecCom';
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+export class RichTextTitle extends React.Component{
+
+ constructor(props){
+ super(props);
+ }
+
+ render(){
+
+ const {isRequired='required'} = this.props;
+
+ return (
+
+
+ {getLabel(18775,'短语描述')}
+
+
+ );
+ }
+
+
+
+}
+
diff --git a/pc4backstage/pc4public/workflow/UserDefaultSetting.js b/pc4backstage/pc4public/workflow/UserDefaultSetting.js
new file mode 100644
index 0000000..ffcbdb4
--- /dev/null
+++ b/pc4backstage/pc4public/workflow/UserDefaultSetting.js
@@ -0,0 +1,271 @@
+import React from 'react';
+import { toJS } from 'mobx';
+import loadjs from 'loadjs';
+import { inject, observer } from 'mobx-react';
+import { message, Row, Col, Button } from 'antd';
+import { WeaSwitch, WeaLogView, WeaTableNew } from 'comsMobx';
+import {
+ WeaTools,
+ WeaCollect,
+ WeaBrowser,
+ WeaFormItem,
+ WeaErrorPage,
+ WeaAlertPage,
+ WeaRightMenu,
+ WeaSearchGroup,
+ WeaLocaleProvider,
+} from 'ecCom';
+const getKey = WeaTools.getKey;
+
+import * as allStore from '../stores/index';
+import { WeaDialog } from '../../pc4backstage/workflow/components/pathSet/nodeSet/signInput/SignSet';
+import TransferComs from '../../pc4backstage/workflow/components/pathSet/nodeSet/signInput/TransferComs';
+// import {UserPhraseEdit} from './UserPhraseEdit';
+
+const getLabel = WeaLocaleProvider.getLabel;
+const WeaTable = WeaTableNew.WeaTable;
+// const _this_ = this;
+@inject('weaworkflow_userdefault_store')
+// @inject('weaworkflow_userphrase_store')
+@observer
+class UserDefaultSetting extends React.Component {
+ constructor(props) {
+ super(props);
+ this.getBtns.bind(this);
+ this.state = {
+ hasLoad: false,
+ store: null,
+ };
+ }
+
+ componentDidMount() {
+ const init = () => {
+ const { weaworkflow_userdefault_store } = this.props;
+ weaworkflow_userdefault_store.getConditionInfo();
+ const { UserPhraseEditStore } = window.weaWorkflowPublic;
+ const weaworkflow_userphrase_store = new UserPhraseEditStore();
+ window.weaworkflow_userphrase_store = weaworkflow_userphrase_store;
+ this.setState({ hasLoad: true, store: weaworkflow_userphrase_store });
+
+ window.wf_userDefaultSetting_this_ = this;
+ };
+ loadjs.isDefined('workflowPublic') ? loadjs.ready('workflowPublic', init) : loadjs([
+ '/spa/workflow/static4public/index.js',
+ '/spa/workflow/static4public/index.css',
+ ], 'workflowPublic', init);
+ }
+
+ varTemp = {
+ btns: [],
+ rowSelectionObj: {onChange: () => {}},
+ formParams: {}
+ }
+ render() {
+ const { hasLoad, store } = this.state;
+ if (hasLoad) {
+ const { weaworkflow_userdefault_store } = this.props;
+ const { form, conditions, showColl, tableStore, setVisiableAdd, visiableAdd, weaworkflow_userphrase_store } = weaworkflow_userdefault_store;
+ const { UserPhraseEdit } = window.weaWorkflowPublic;
+ const formParamsTemp = form.getFormParams();
+ for(var i in formParamsTemp) {
+ this.varTemp.formParams[i] = formParamsTemp[i];
+ }
+ // 基础设置页面信息
+ let conditionGroup = [];
+ this.varTemp.btns = [],
+ this.varTemp.btns = this.getBtns();
+ if(this.rowSelection.onChange) {
+ this.rowSelectionObj.onChange = this.rowSelection().onChange
+ }
+ mobx.toJS(conditions).map((g, index) => {
+ index == 1 &&
+ conditionGroup.push(
+
+ {
+ const { weaworkflow_userdefault_store } = this.props;
+ const { updateSelectedRows } = weaworkflow_userdefault_store;
+ updateSelectedRows(toJS(selectedRowKeys));
+ }
+ }}
+ />
+ ,
+ );
+ });
+ let conditionGroup4DefSet = [];
+ mobx.toJS(conditions).map((g, index) => {
+ index == 0 && g && g.items.map((fields, index) => {
+
+ if(getKey(fields) == 'showSwitchBar') {
+
+ }else if(getKey(fields) == 'isOpenContinnuationProcess') {
+ const switchItem = g.items[index + 1];
+ conditionGroup4DefSet.push({
+ com: (
+
+
+
+ {this.varTemp.formParams.isOpenContinnuationProcess == '1' &&
+
+ }
+ ),
+ colSpan: 1,
+ });
+ } else {
+ conditionGroup4DefSet.push({
+ com: (
+ this.getDialog(v)} />
+ ),
+ colSpan: 1,
+ });
+ }
+ });
+ });
+ const _this = this;
+ return (
+
+
+ {/* {form.render({ center: true, needTigger: true })} */}
+
+ {conditionGroup}
+ {
+ setVisiableAdd(val);
+ }}
+ saveCallBack={() => {
+ weaworkflow_userdefault_store.getConditionInfo();
+ setVisiableAdd(false);
+ }}
+ />
+
+ {/* 收藏 */}
+ { weaworkflow_userdefault_store.closeColl(); }}
+ />
+
+ );
+ }
+ return ........
;
+ }
+
+
+ /**
+ * 获取操作菜单
+ */
+ getBtns() {
+ const { weaworkflow_userdefault_store } = this.props;
+ const { selectedRows, setVisiableAdd } = weaworkflow_userdefault_store;
+ const { store } = this.state;
+ const _this = this;
+ return (
+
+
+
+
+ );
+ }
+
+ rowSelection() {
+ const { weaworkflow_userdefault_store } = this.props;
+ const { updateSelectedRows } = weaworkflow_userdefault_store;
+ return {
+ onChange: (selectedRowKeys) => {
+ updateSelectedRows(toJS(selectedRowKeys));
+ },
+ };
+ }
+}
+
+
+export default WeaTools.tryCatch(React,
+ props => ,
+ { error: '' },
+)(UserDefaultSetting);
+
+
+window.userDefaultUtil = (() => ({
+ onDel: (id) => {
+ allStore.default.weaworkflow_userdefault_store.onDel(id);
+ },
+ onEdit: (id) => {
+ wf_userDefaultSetting_this_.state.store.onEdit(id);
+ wf_userDefaultSetting_this_.props.weaworkflow_userdefault_store.setVisiableAdd(true);
+ },
+ onHide: (id, groupid) => {
+ allStore.default.weaworkflow_userdefault_store.changeDisplay({ id, groupid: groupid.split('+')[0], status: groupid.split('+')[1] });
+ },
+ onDisplay: (id, groupid) => {
+ allStore.default.weaworkflow_userdefault_store.changeDisplay({ id, groupid: groupid.split('+')[0], status: groupid.split('+')[1] });
+ },
+ }))();
diff --git a/pc4backstage/pc4public/workflow/UserPhraseEdit.js b/pc4backstage/pc4public/workflow/UserPhraseEdit.js
new file mode 100644
index 0000000..dffe59e
--- /dev/null
+++ b/pc4backstage/pc4public/workflow/UserPhraseEdit.js
@@ -0,0 +1,298 @@
+/**
+ * @author jh
+ * @desc 编辑字段页面组件
+ *
+ */
+import React from "react";
+import {inject, observer} from 'mobx-react';
+import {toJS} from 'mobx';
+import {WeaSwitch} from 'comsMobx';
+import {Button, Row, Modal} from 'antd';
+import {
+ WeaTools,
+ WeaDialog,
+ WeaCollect,
+ WeaRichText,
+ WeaFormItem,
+ WeaRightMenu,
+ WeaMoreButton,
+ WeaSearchGroup,
+ WeaLocaleProvider,
+ WeaAlertPage,
+} from 'ecCom';
+
+import {RichTextTitle} from "./RichTextTitle";
+
+import isRegExp from 'lodash/isRegExp';
+const getLabel = WeaLocaleProvider.getLabel;
+
+
+@observer
+export class UserPhraseEdit extends React.Component {
+
+ constructor(props) {
+ super(props);
+
+ this.getDialogBtns.bind(this);
+
+ this.state = {
+ isRequired: 'required',
+ showCollect: false,
+ }
+ }
+
+ render() {
+ const {store,visiable,setVisiable} = this.props;
+ const {
+ // visiable,
+ onCancelEdit,
+ form,
+ success,
+ conditions,
+ richTextOnChange,
+ phraseDescValue
+ } = store;
+
+ const formParams = form.getFormParams();
+ const {isRequired, showCollect} = this.state;
+
+ let conditionGroup = [];
+ let extentsConfig = [];
+ this.initExtentsConfig(extentsConfig);
+
+ if(success == -1){
+ conditionGroup.push(
+ }
+ iconSize = {120}
+ paddingTop ={'15%'}
+ >
+
+ 对不起,您暂时没有权限 !
+
+
+ );
+ }else if(success == 0){
+ conditionGroup.push(
+ }
+ iconSize = {120}
+ paddingTop ={'15%'}
+ >
+
+ 发生异常,请刷新重新或联系管理员
+
+
+ )
+ }else{
+ form.isFormInit && conditions && conditions.map((g, index) => {
+
+ index == 0 ? conditionGroup.push(
+
+ {
+ g.items && g.items.map((item) => {
+ if(item.domkey[0] === 'dsporder'){
+ item.regExp = /^(-{0,1}|(-{0,1}[0-9]{1,}[.]?[0-9]*))$/;
+ }
+ return (
+
+
+
+
+
+ )
+ })
+ }
+
+ )
+ :
+ conditionGroup.push(
+ }
+ showGroup={g.defaultshow}
+ >
+
+
+ )
+ });
+ }
+
+ return (
+ {
+ onCancelEdit();
+ setVisiable(false);
+ }}
+ buttons={this.getDialogBtns()}
+ style={{width: 800, height: 600}}
+ draggable={true}
+ >
+
+ {conditionGroup}
+
+ {/*收藏*/}
+ this.setState({showCollect: false})}
+ submitBack={data => console.log('onOk: ', data)}
+ />
+
+ );
+ }
+
+ buttonBtnChange(name = '', ids = '', list = [], type = '',addfileid=''){
+ let returnInfo = [];
+ if(name === 'Upload'){
+ if(type === 'image'){
+ list.map(item => {
+ const imglink = `/weaver/weaver.file.FileDownload?fileid=${item.fileid}`;
+ returnInfo.push(`
`);
+ });
+ this.refs.WeaRichText.insertHTML(returnInfo.join(''));
+ }
+ }
+ return ' ';
+ }
+ /**
+ * 保存
+ */
+ doSave() {
+ const {isRequired} = this.state;
+ if (isRequired == 'required') {
+ Modal.warning({title:getLabel(131329,'信息确认'),okText: getLabel(33703, '确认'), content: getLabel(384146, '必要信息不完整,红色*为必填项')});
+ return;
+ }
+ const {store, saveCallBack} = this.props;
+ const {form} = store;
+ const formParams = form.getFormParams();
+ const {groupid = '', dsporder = 0} =formParams;
+ if(groupid == '1' && dsporder < 0) {
+ Modal.warning({title:getLabel(131329,'信息确认'),okText: getLabel(33703, '确认'), content: getLabel(385772, '显示顺序不能为负数!')});
+ return;
+ }
+
+ store.onSave(saveCallBack);//weaworkflow_userdefault_store.getConditionInfo
+ }
+
+ /**
+ * 富文本编辑器输入onChange事件
+ * @param desc
+ */
+ onChange(desc = '') {
+
+ const {store} = this.props;
+ const {richTextOnChange} = store;
+ richTextOnChange(desc);
+ this.setState({
+ isRequired: desc === '' ? 'required' : ''
+ });
+
+ }
+
+ /**
+ * 富文本编辑器配置参数
+ * @returns {{height: number, toolbar: string, toolbar_Full: *[]}}
+ */
+ getCkConfig() {
+ return {
+ height: 240,
+ removePlugins:'resize',
+ toolbar: [{name: 'document', items: ['Source']},
+ {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike',]},
+ {name: 'styles', items: ['Font', 'FontSize']},
+ {name: 'colors', items: ['TextColor', 'BGColor']},
+ {
+ name: 'paragraph',
+ items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']
+ },
+ {name: 'links', items: ['Link', 'Unlink']},
+ {name: 'tools', items: ['Maximize']},
+ {name: 'insert', items: ['Table', '-', 'Undo', 'Redo']}]
+
+ };
+ }
+
+ getDialogBtns() {
+ const {store} = this.props;
+ return [
+ (
+ ),
+ ()
+ ];
+ }
+
+ initExtentsConfig(extentsConfig) {
+ extentsConfig.push({
+ name: 'Upload',
+ type: 'image',
+ show:
+
+
,
+ uploadUrl: '/api/doc/upload/uploadFile',
+ category: 'all',
+ limitType: 'jpg,gif,png',
+ title: getLabel(20001, '上传图片'),
+ needLoading: false
+ });
+ }
+
+ getMoreBtns() {
+ return [{
+ key: "save",
+ icon: ,
+ content: getLabel(30986, '保存'),
+ onClick: () => {
+ this.doSave();
+ }
+ }, {
+ key: "coll",
+ icon: ,
+ content: getLabel(28111, '收藏'),
+ onClick: () => {
+ this.setState({
+ showCollect: true,
+ });
+ }
+ }
+ ];
+ }
+
+}
+
+
diff --git a/pc4backstage/pc4public/workflow/style/autograph.less b/pc4backstage/pc4public/workflow/style/autograph.less
new file mode 100644
index 0000000..4d5d605
--- /dev/null
+++ b/pc4backstage/pc4public/workflow/style/autograph.less
@@ -0,0 +1,134 @@
+.wf-autograph {
+ width: 100%;
+ position: relative;
+ border: 1px solid #e2e2e2;
+
+ &-noData {
+ background: #f9f9f9;
+ padding: 100px 0;
+ text-align: center;
+ &-icon {
+ display: inline-block;
+ font-size: 20px;
+ color: #ffa114;
+ width: 50px;
+ height: 50px;
+ line-height: 50px;
+ text-align: center;
+ border: 1px solid #ffa114;
+ border-radius: 50%;
+ vertical-align: middle;
+ padding-bottom: 10px;
+ }
+ &-desc {
+ color: #f00;
+ display: inline-block;
+ margin-left: 25px;
+ line-height: 25px;
+ vertical-align: middle;
+ text-align: left;
+ }
+ }
+
+ &-bottomBarConfig {
+ border-top: 1px solid #e2e2e2;
+
+ &-single {
+ display: inline-block;
+ line-height: 40px;
+ height: 40px;
+ padding: 0 10px;
+ vertical-align: middle;
+ }
+ }
+
+ &-consulttab {
+ width: 100%;
+
+ &-formSignatureTd {
+ width: 100%;
+ }
+ }
+
+ &-tooltab {
+ width: inherit;
+ padding: 0;
+ border-bottom: 1px solid #e2e2e2;
+
+ &-tr {
+ background: #f9f9f9;
+ line-height: 40px;
+ height: 40px;
+ vertical-align: middle;
+ }
+
+ &-td {
+ display: inline-block;
+
+ &:hover {
+
+ .wf-autograph-tooltab-label,
+ .wf-autograph-tooltab-img {
+ cursor: pointer;
+ color: #2db7f5;
+
+ .path1,
+ .path2,
+ .path3,
+ .path4,
+ .path5,
+ .path6 {
+ &::before {
+ color: #2db7f5;
+ }
+ }
+ }
+ }
+
+ .wf-autograph-tooltab-label {
+ color: #333;
+ padding-right: 20px;
+ vertical-align: middle;
+ }
+
+ .wf-autograph-tooltab-label-required {
+ color: #ff3f3f;
+ }
+
+ .wf-autograph-tooltab-img {
+ vertical-align: middle;
+ padding-right: 5px;
+ padding-left: 15px;
+ color: #333;
+ font-size: 16px;
+ }
+ }
+
+ &-tdSign {
+ width: 150px;
+
+ &:hover {
+
+ .wf-autograph-tooltab-label,
+ .wf-autograph-tooltab-img {
+ cursor: auto;
+ color: #afafaf;
+ }
+ }
+
+ .icon-coms-Need-feedback {
+ color: #afafaf;
+ vertical-align: middle;
+ }
+
+ .wf-autograph-tooltab-label {
+ color: #afafaf;
+ padding-right: 0;
+ }
+
+ .wf-autograph-tooltab-img {
+ font-size: 14px;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/pc4mobx/amain/index.async.js b/pc4mobx/amain/index.async.js
new file mode 100644
index 0000000..72fa00b
--- /dev/null
+++ b/pc4mobx/amain/index.async.js
@@ -0,0 +1,205 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import {
+ Router,
+ useRouterHistory,
+} from 'react-router';
+import {
+ createHashHistory,
+} from 'History';
+import {
+ Provider,
+} from 'mobx-react';
+import {
+ RouterStore,
+ syncHistoryWithStore,
+} from 'mobx-react-router';
+import {
+ WeaLocaleProvider,
+ WeaTools,
+} from 'ecCom';
+import {
+ Login,
+ Theme,
+ store as portalThemeStore,
+} from 'weaPortalTheme';
+import LibRoute from '../../pc4public/amain/LibRoute';
+import {
+ checkCasIsDeployed,
+} from '../../pc4backstage/integration/apis/CommonService';
+
+const libRouteTool = new LibRoute('main');
+window.libRouteLoaded = libRouteTool.libRouteLoaded;
+
+const browserHistory = useRouterHistory(createHashHistory)({
+ queryKey: '_key',
+ basename: '/',
+});
+
+const routingStore = new RouterStore();
+
+const history = syncHistoryWithStore(browserHistory, routingStore);
+window.weaHistory = history;
+
+const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'theme');
+function getQueryVariable(variable)
+{
+ var query = window.location.search.substring(1);
+ var vars = query.split("&");
+ for (var i=0;i {
+ const path = `${window.location.protocol}//${window.location.host}${window.location.pathname}${window.location.search}#/main`;
+ WeaTools.checkSSO('', false).then(() => {
+ if (!/.*appid=.*&service=.*/.test(window.location.href) && !window.loadCas) {
+ // window.loadCas = true
+
+ checkCasIsDeployed().then((res) => {
+ if (!res.hasSession && res.isDeployed && res.weaver_login_type !== 'OALogin') {
+ if (/\/spa\/portal\/public\/index\.html#\/licensesubmit\?display=page/.test(window.location.href)) {
+ getLocaleLabel(nextState, replace, callback);
+ } else {
+ let service = `${window.location.protocol}//${window.location.host}${window.ecologyContentPath || ''}/wui/cas-entrance.jsp?path=${encodeURIComponent(path)}&ssoType=${res.ssoType}`;
+ if(getQueryVariable("languid")){
+ service = `${window.location.protocol}//${window.location.host}${window.ecologyContentPath || ''}/wui/cas-entrance.jsp?languid=${getQueryVariable("languid")}&path=${encodeURIComponent(path)}&ssoType=${res.ssoType}`;
+ }
+ window.localStorage["casPath"] = service;
+ window.location.href = service;
+ }
+ } else {
+ getLocaleLabel(nextState, replace, callback);
+ }
+ });
+ } else {
+ window.localStorage.removeItem('casPath');
+ getLocaleLabel(nextState, replace, callback);
+ }
+ });
+};
+
+const onEnter = (nextState, replace, callback) => {
+ WeaTools.checkSSO('', false).then(() => {
+ getLocaleLabel(nextState, replace, callback);
+ });
+};
+
+const libs = [
+ // [eventRegister, lib, route]
+ ['f_portal', 'weaPortal', 'portal'], // 门户
+ ['f_workflow', 'weaWorkflow', 'workflow'], // 流程
+ ['f_workplan', 'weaWorkplan', 'wp'], // 日程 (人力、微搜、客户、项目依赖)
+ ['f_smallApp', 'weaSmallApp', ['album', 'sms', 'voting']], // 小模块 (微搜依赖)
+ ['f_esearch', 'weaESearch', 'esearch'], // 微搜
+ ['f_document', 'weaDoc', 'document'], // 文档
+ ['f_hrm', 'weaHrm', 'hrm'], // 人力
+ ['f_blog', 'weaBlog', 'blog'], // 微博
+ ['f_cowork', 'weaCowork', 'cowork'], // 协作
+ ['f_email', 'weaEmail', 'email'], // 邮件
+ ['f_cpt', 'weaCpt', 'cpt'], // 资产
+ ['f_crm', 'weaCrm', 'crm'], // 客户
+ ['f_crmReport', 'weaCrmReport', 'crm'], // 客户报表
+ ['f_cube', 'weaCube', 'cube'], // 建模
+ ['f_demo', 'weaDemo', 'demo'], // demo示例
+ // ['f_develop', 'weaDevelop', 'develop'], // 二次开发 主干不需要
+ ['f_fna', 'weaFna', 'fna'], // 财务
+ ['f_fnaMulit', 'weaFnaMulit', 'fnaMulit'], // 财务 全面预算
+ ['f_inte', 'weaInte', 'inte'], // 集成
+ ['f_meeting', 'weaMeeting', 'meeting'], // 会议
+ ['f_odoc', 'weaOdoc', ['workflow', 'offical']], // 公文
+ ['f_prj', 'weaPrj', 'prj'], // 项目
+ ['f_workrelate', 'weaWorkrelate', 'workrelate'], // 执行力
+ ['f_portrait', 'weaPortrait', 'portrait'], // 组织画像
+ ['f_car', 'weaCar', 'car'], // 车辆前后端
+ // ['f_contract', 'weaContract_zs', 'contract'], // 合同 停止开发
+ ['f_customSetting', 'weaCustomSetting', 'customsetting'], // 个性化设置
+ ['f_govern', 'weaGovern', 'govern'], // 督查督办
+ ['f_info', 'weaInfo', 'info'], // 信息采编
+ ['f_attendance', 'weaHrmAttendance', 'attendance'], // 新考勤模块
+ ['f_tax', 'weaHrmTax', 'tax'], // 新个税
+ ['edc_app', 'weaEdcApp', 'edc'], // 数据中心模块
+ ['edc_app_v2', 'weaEdcAppV2', 'edc_v2'], // 数据中心模块
+ ['f_compared', 'weaCompared', 'compared'], // 对比
+ ['f_organization', 'weaOrganization', 'organization'],
+ ...(window.e9LibsConfigCustomF || []),
+];
+
+
+const stores = {
+ routing: routingStore,
+ ...portalThemeStore,
+};
+
+const routes = {
+ childRoutes: [{
+ path: '/',
+ component: Login,
+ onEnter: checkCasForLogin,
+ },
+ // { path: '/', component: Login},
+ {
+ path: 'main',
+ onEnter,
+ component: Theme,
+ getChildRoutes({
+ location: {
+ pathname,
+ },
+ }, cb) {
+ libs.forEach((lib) => {
+ if (window[lib[1]]) {
+ libRouteTool.getLibRoute(...lib);
+ cb(null, [
+ ...libRouteTool.libRouteLoaded.routes, {
+ path: 'report',
+ childRoutes: libRouteTool.libRouteLoaded.routes,
+ },
+ ]);
+ } else if (lib[0]) {
+ const libPath = lib[2];
+ if (
+ (
+ typeof libPath === 'string' && (
+ pathname.indexOf(`/main/${libPath}`) === 0 ||
+ pathname.indexOf(`/main/report/${libPath}`) === 0
+ )
+ ) ||
+ (
+ Array.isArray(libPath) && (
+ libPath.some(p =>
+ pathname.indexOf(`/main/${p}`) === 0 ||
+ pathname.indexOf(`/main/report/${p}`) === 0,
+ )
+ )
+ )
+ ) {
+ libRouteTool.getLibRouteAsync(...lib).then(() => {
+ cb(null, [
+ ...libRouteTool.libRouteLoaded.routes, {
+ path: 'report',
+ childRoutes: libRouteTool.libRouteLoaded.routes,
+ },
+ ]);
+ });
+ }
+ }
+ });
+ },
+ },
+ ],
+};
+
+class Root extends React.Component {
+ render() {
+ return (
+
+
+
+ );
+ }
+}
+
+ReactDOM.render(, document.getElementById('container'));
diff --git a/pc4mobx/amain/index.js b/pc4mobx/amain/index.js
new file mode 100644
index 0000000..4666aeb
--- /dev/null
+++ b/pc4mobx/amain/index.js
@@ -0,0 +1,125 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+
+import {
+ Router,
+ Route,
+ useRouterHistory
+} from 'react-router';
+import {
+ createHashHistory
+} from 'History';
+import {
+ Provider
+} from 'mobx-react';
+import {
+ RouterStore,
+ syncHistoryWithStore
+} from 'mobx-react-router';
+
+const browserHistory = useRouterHistory(createHashHistory)({
+ queryKey: '_key',
+ basename: '/',
+});
+
+const routingStore = new RouterStore();
+
+const history = syncHistoryWithStore(browserHistory, routingStore);
+window.weaHistory = history;
+
+// 主题
+import {
+ Login,
+ Theme,
+ store as portalThemeStore
+} from 'weaPortalTheme';
+// 主题多语言
+import {
+ WeaLocaleProvider
+} from 'ecCom';
+const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'theme');
+
+const libs = [
+ 'weaPortal', // 门户
+ 'weaAlbum', // 相册
+ 'weaBlog', // 微博
+ 'weaCowork', // 协作
+ 'weaCpt', // 资产
+ 'weaCrm', // 客户
+ 'weaCrmReport', // 客户报表
+ 'weaCube', // 建模
+ 'weaDemo', // demo示例
+ 'weaDevelop', // 二次开发
+ 'weaDoc', // 文档
+ 'weaEmail', // 邮件
+ 'weaESearch', // 微搜
+ 'weaFna', // 财务
+ 'weaFnaSpecial', // 财务
+ 'weaFnaMulit', // 财务 全面预算
+ 'weaHrm', // 人力
+ 'weaInte', // 集成
+ 'weaMeeting', // 会议
+ 'weaOdoc', // 公文
+ 'weaPrj', // 项目
+ 'weaSmallApp', // 小模块
+ 'weaWorkflow', // 流程
+ 'weaWorkplan', // 日程
+ 'weaWorkrelate', // 执行力
+ 'weaPortrait', // 组织画像
+ 'weaCar', //车辆前后端
+ 'weaContract_zs', //合同
+ 'weaCustomSetting', // 个性化设置
+ 'weaHrmAttendance', //新考勤模块
+ 'weaHrmTax', //新个税
+ 'weaHrmScAirportAddressBook', //四川航空通讯录
+ 'weaEdcApp',//数据中心前端
+ 'weaEdcAppV2',
+ 'weaCompared',// '对比'
+ 'weaOrganization', //组织
+];
+
+const getModules = (names = []) => {
+ let store = {};
+ const route = [];
+ names.forEach(name => {
+ const module = window[name];
+ if (module && module.store && module.Route) {
+ store = { ...store,
+ ...module.store
+ };
+ route.push(module.Route);
+ }
+ });
+ return {
+ store,
+ route,
+ };
+};
+
+const stores = {
+ routing: routingStore,
+ ...portalThemeStore,
+ ...getModules(libs).store,
+};
+
+const Report = props => {props.children}
;
+
+class Root extends React.Component {
+ render() {
+ return (
+
+
+
+
+
+ {getModules(libs).route}
+
+ {getModules(libs).route}
+
+
+
+ );
+ }
+}
+
+ReactDOM.render(, document.getElementById('container'));
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/basicImport.js b/pc4mobx/organization/apis/basicImport.js
new file mode 100644
index 0000000..930d757
--- /dev/null
+++ b/pc4mobx/organization/apis/basicImport.js
@@ -0,0 +1,7 @@
+import {
+ WeaTools
+} from 'ecCom'
+
+export const getBasicDataImportHasRight = (params) => {
+ return WeaTools.callApi('/api/hrm/import/resource/getBasicDataImportHasRight', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/columnSetting.js b/pc4mobx/organization/apis/columnSetting.js
new file mode 100644
index 0000000..b2520fe
--- /dev/null
+++ b/pc4mobx/organization/apis/columnSetting.js
@@ -0,0 +1,24 @@
+import { WeaTools } from 'ecCom'
+
+export const getTableEdit = (params) => {
+ return WeaTools.callApi('/api/hrm/carddisplay/getCustomCardTable', 'GET', params);
+}
+export const userDefineCardItemSave = (params) => {
+ return WeaTools.callApi('/api/hrm/carddisplay/saveCustomCard', 'POST', params);
+}
+export const hasRight = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/hasRight', 'GET', params);
+}
+export const getTable = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/getTable', 'GET', params);
+}
+export const cardAccessSave = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/save', 'POST', params);
+}
+export const getCardButtonTable = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/getCardButtonTable', 'GET', params);
+}
+export const saveFieldDefinedInfo = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/saveCardButton', 'POST', params);
+}
+
diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js
index 6fb261f..ccc6838 100644
--- a/pc4mobx/organization/apis/company.js
+++ b/pc4mobx/organization/apis/company.js
@@ -4,7 +4,6 @@ import {
} from 'ecCom'
export const getSearchList = (params) => {
- //return WeaTools.callApi('/api/bs/hrmorganization/comp/listComp', 'POST', params);
return fetch('/api/bs/hrmorganization/comp/listComp', {
method: 'POST',
mode: 'cors',
@@ -42,26 +41,20 @@ export const getAdvanceSearchCondition = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getSearchCondition', 'GET', params);
}
+
export const add = (params) => {
- return fetch('/api/bs/hrmorganization/comp/saveBaseComp', {
- method: 'POST',
- mode: 'cors',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(params)
- })
+ return WeaTools.callApi('/api/bs/hrmorganization/comp/saveBaseComp', 'POST', params);
+}
+
+export const version = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/save', 'POST', params);
+}
+
+export const selectVersions = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/getVersion', 'GET', params);
}
export const editResource = (params) => {
- // return fetch('/api/bs/hrmorganization/comp/updateComp', {
- // method: 'POST',
- // mode: 'cors',
- // headers: {
- // 'Content-Type': 'application/json'
- // },
- // body: JSON.stringify(params)
- // })
return WeaTools.callApi('/api/bs/hrmorganization/comp/updateComp', 'POST', params);
}
@@ -76,11 +69,26 @@ export const updateForbiddenTag = (params) => {
})
}
+export const move = (params) => {
+ return fetch('/api/bs/hrmorganization/comp/moveCompany', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
export const getCompanyForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompSaveForm', 'GET', params);
}
+export const getMoveForm = () => {
+ return WeaTools.callApi('/api/bs/hrmorganization/comp/getMoveForm', 'GET');
+}
+
export const getCompanyExtendForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getCompBaseForm', 'GET', params);
}
@@ -88,4 +96,5 @@ export const getCompanyExtendForm = (params) => {
export const getHasRight = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/comp/getHasRight', 'GET', params);
-}
\ No newline at end of file
+}
+
diff --git a/pc4mobx/organization/apis/datasImport.js b/pc4mobx/organization/apis/datasImport.js
new file mode 100644
index 0000000..438e698
--- /dev/null
+++ b/pc4mobx/organization/apis/datasImport.js
@@ -0,0 +1,21 @@
+import { WeaTools } from 'ecCom'
+
+//作废
+//获取导入表单
+export const getImportForm = (params) => {
+ return WeaTools.callApi(`/api/hrm/import/resource/getImportForm`, 'GET', params);
+}
+//导入文件提交
+export const saveImport = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveImportResource`, 'POST', params);
+}
+
+
+//获取导入结果回调数据
+export const getImportProcessLog = (params) => {
+ return WeaTools.callApi(`/api/hrm/importlog/getImportProcessLog`, 'GET', params);
+}
+//获取导入结果
+export const getImportResult = (params) => {
+ return WeaTools.callApi(`/api/hrm/importlog/getImportResult`, 'GET', params);
+}
diff --git a/pc4mobx/organization/apis/department.js b/pc4mobx/organization/apis/department.js
index 47ddcd6..ca1407c 100644
--- a/pc4mobx/organization/apis/department.js
+++ b/pc4mobx/organization/apis/department.js
@@ -29,16 +29,49 @@ export const getAdvanceSearchCondition = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/dept/getSearchCondition', 'GET', params);
}
-export const getHrmListByJobId = (params) => {
- return WeaTools.callApi('/api/bs/hrmorganization/job/getHrmListByJobId', 'GET', params);
+export const getPostionTable = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/dept/getJobListByPid', 'GET', params);
}
export const getCopyForm = (params) => {
- return WeaTools.callApi('/api/bs/hrmorganization/job/getCopyForm', 'GET', params);
+ return WeaTools.callApi('/api/bs/hrmorganization/dept/getCopyForm', 'GET', params);
+}
+
+export const getMergeForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/dept/getMergeForm', 'GET', params);
+}
+
+export const version = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/save', 'POST', params);
+}
+
+
+export const exportData = (ids) => {
+ fetch('/api/bs/hrmorganization/common/department/export').then(res => res.blob().then(blob => {
+ var filename=`部门档案.xlsx`
+ var a = document.createElement('a');
+ var url = window.URL.createObjectURL(blob);
+ a.href = url;
+ a.download = filename;
+ a.click();
+ window.URL.revokeObjectURL(url);
+ }))
+}
+
+export const selectVersions = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/getVersion', 'GET', params);
+}
+
+export const getTransferForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params);
}
export const add = (params) => {
- return fetch('/api/bs/hrmorganization/dept/saveBaseForm', {
+ return WeaTools.callApi('/api/bs/hrmorganization/dept/saveBaseForm', 'POST', params);
+}
+
+export const copy = (params) => {
+ return fetch('/api/bs/hrmorganization/dept/copyDepartment', {
method: 'POST',
mode: 'cors',
headers: {
@@ -48,8 +81,19 @@ export const add = (params) => {
})
}
-export const copy = (params) => {
- return fetch('/api/bs/hrmorganization/job/copyJobItem', {
+export const merge = (params) => {
+ return fetch('/api/bs/hrmorganization/dept/mergeDepartment', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const transfer = (params) => {
+ return fetch('/api/bs/hrmorganization/dept/moveDepartment', {
method: 'POST',
mode: 'cors',
headers: {
diff --git a/pc4mobx/organization/apis/fieldDefined.js b/pc4mobx/organization/apis/fieldDefined.js
new file mode 100644
index 0000000..122308d
--- /dev/null
+++ b/pc4mobx/organization/apis/fieldDefined.js
@@ -0,0 +1,134 @@
+import {
+ WeaTools
+} from 'ecCom';
+
+/**
+ * 获取tab数据
+ * @param {Object} params [description]
+ * @return {[type]} [description]
+ */
+ export const getHasRight = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getHasRight`, 'GET', params)
+
+export const getTabInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTabInfo`, 'GET', params)
+
+export const getFieldDefinedInfo = (moduleName, params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getFieldDefinedInfo`, 'GET', params)
+
+export const saveFieldDefinedInfo = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveFields`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const removeFieldDefinedInfo = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/del`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const saveGroupInfo = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTitle`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+
+export const saveGroupSettingInfo = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveGroup`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const changeTypeInfo = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/changeTree`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const removeGroupInfo = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/deleteTitle`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+
+export const getTree = (moduleName,params = {}) => WeaTools.callApi(`/api/bs/hrmorganization/fieldDefined/${moduleName}/getTree`, 'GET', params)
+
+export const saveTree = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/saveTree`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const deleteTree = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/deleteTree`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const changeGroup = (moduleName,params) => {
+ return fetch(`/api/bs/hrmorganization/fieldDefined/${moduleName}/changeGroup`, {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const getEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/getEncryptFieldSettingForm`, 'GET', params)
+
+export const saveEncryptFieldSettingForm = (params = {}) => WeaTools.callApi(`/api/encrypt/fieldsetting/saveEncryptFieldSettingForm`, 'POST', params)
+
+//获取字段可查看范围列表
+export const getEncryptFieldScopeList = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/getEncryptFieldScopeList', 'POST', params);
+
+//获取字段可查看范围表单
+export const getEncryptFieldScopeForm = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/getEncryptFieldScopeForm', 'GET', params);
+
+//保存字段可查看范围
+export const saveEncryptFieldScopeSetting = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/saveEncryptFieldScopeSetting', 'POST', params);
+
+//删除字段可查看范围
+export const delEncryptFieldScopeSetting = (params = {}) => WeaTools.callApi('/api/encrypt/fieldsetting/delEncryptFieldScopeSetting', 'POST', params);
+
diff --git a/pc4mobx/organization/apis/hrmInfoExtend.js b/pc4mobx/organization/apis/hrmInfoExtend.js
new file mode 100644
index 0000000..c2dea13
--- /dev/null
+++ b/pc4mobx/organization/apis/hrmInfoExtend.js
@@ -0,0 +1,11 @@
+import {
+ WeaTools
+} from 'ecCom';
+
+export const editResource = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/updateForm', 'POST', params);
+}
+
+export const getResourceExtendForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getTabForm', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/importDialog.js b/pc4mobx/organization/apis/importDialog.js
new file mode 100644
index 0000000..9f5f60c
--- /dev/null
+++ b/pc4mobx/organization/apis/importDialog.js
@@ -0,0 +1,16 @@
+import { WeaTools } from 'ecCom'
+
+//获取导入表单
+export const getImportForm = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getCommonForm`, 'GET', params);
+ }
+
+ //导入文件提交
+export const saveImport = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveCommonImport`, 'POST', params);
+}
+
+ //获取导入结果
+export const getImportResult = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportResult`, 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/importresource.js b/pc4mobx/organization/apis/importresource.js
new file mode 100644
index 0000000..6446a7c
--- /dev/null
+++ b/pc4mobx/organization/apis/importresource.js
@@ -0,0 +1,29 @@
+import { WeaTools } from 'ecCom'
+//获取导入表单
+export const getImportForm = (params) => {
+ return WeaTools.callApi(`/api/hrm/import/resource/getImportForm`, 'GET', params);
+}
+//导入文件提交
+export const saveImport = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveImportResource`, 'POST', params);
+}
+//获取导入结果回调数据
+export const getImportProcessLog = (params) => {
+ return WeaTools.callApi(`/api/hrm/importlog/getImportProcessLog`, 'GET', params);
+}
+//获取导入结果
+export const getImportResult = (params) => {
+ return WeaTools.callApi(`/api/hrm/importlog/getImportResult`, 'GET', params);
+}
+//历史导入信息查询
+export const getImportHistory = (params) => {
+ return WeaTools.callApi(`/api/hrm/importlog/getImportHistory`, 'GET', params);
+}
+//导入日志
+export const getImportLogDetail = (params) => {
+ return WeaTools.callApi(`/api/hrm/importlog/getImportColResultLog`, 'GET', params);
+}
+//导入日志 - 高级搜索
+export const getImportLogSearchCondition = (params) => {
+ return WeaTools.callApi(`/api/hrm/importlog/getHistorySearchCondition`, 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/job.js b/pc4mobx/organization/apis/job.js
index 6f44f6a..0230814 100644
--- a/pc4mobx/organization/apis/job.js
+++ b/pc4mobx/organization/apis/job.js
@@ -37,6 +37,10 @@ export const getCopyForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/job/getCopyForm', 'GET', params);
}
+export const refresh = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/job/refresh', 'GET', params);
+}
+
export const add = (params) => {
return fetch('/api/bs/hrmorganization/job/saveBaseForm', {
method: 'POST',
@@ -78,12 +82,33 @@ export const getJobForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/job/getSaveForm', 'GET', params);
}
+export const getSchemeInfo = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/sequence/getSchemeInfo', 'GET', params);
+}
export const getJobExtendForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/job/getJobBaseForm', 'GET', params);
}
-
export const getHasRight = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/job/getHasRight', 'GET', params);
+}
+
+export const getLevelId = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/grade/getLevelId', 'GET', params);
+}
+
+export const getMergeForm = (params = {}) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/job/getMergeForm', 'GET', params);
+}
+
+export const merge = (params) => {
+ return fetch('/api/bs/hrmorganization/job/mergeJob', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/jobgrade.js b/pc4mobx/organization/apis/jobgrade.js
index 5ef46d5..8109602 100644
--- a/pc4mobx/organization/apis/jobgrade.js
+++ b/pc4mobx/organization/apis/jobgrade.js
@@ -62,6 +62,11 @@ export const getTabInfo = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/grade/getTabInfo', 'GET', params);
}
+
export const getHasRight = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/grade/getHasRight', 'GET', params);
+}
+
+export const getTree = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTreeData', 'GET', params);
}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/joblevel.js b/pc4mobx/organization/apis/joblevel.js
index 0203910..8fb9365 100644
--- a/pc4mobx/organization/apis/joblevel.js
+++ b/pc4mobx/organization/apis/joblevel.js
@@ -65,4 +65,8 @@ export const getTabInfo = (params) => {
export const getHasRight = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/level/getTableBtn', 'GET', params);
+}
+
+export const getTree = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTreeData', 'GET', params);
}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/logview.js b/pc4mobx/organization/apis/logview.js
new file mode 100644
index 0000000..cc12e6c
--- /dev/null
+++ b/pc4mobx/organization/apis/logview.js
@@ -0,0 +1,12 @@
+
+import {
+ WeaTools
+} from 'ecCom'
+
+export const getLogList = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/log/listPage', 'GET', params);
+}
+
+export const getAdvanceSearchCondition = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/log/getSearchCondition', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/managerDetach.js b/pc4mobx/organization/apis/managerDetach.js
new file mode 100644
index 0000000..79b9766
--- /dev/null
+++ b/pc4mobx/organization/apis/managerDetach.js
@@ -0,0 +1,62 @@
+
+import {
+ WeaTools
+} from 'ecCom'
+
+export const getSearchList = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/detach/getTable', 'GET', params);
+}
+
+export const getHasRight = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/detach/getTableBtn', 'GET', params);
+}
+
+export const getAdvanceSearchCondition = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/detach/getSearchCondition', 'GET', params);
+}
+
+export const getForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/detach/getForm', 'GET', params);
+}
+
+export const doDetachSwitch = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/detach/doDetach', 'GET', params);
+}
+
+export const deleteTableData = (params) => {
+ return fetch('/api/bs/hrmorganization/detach/deleteByIds', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+
+export const add = (params) => {
+ return fetch('/api/bs/hrmorganization/detach/save', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const edit = (params) => {
+ return fetch('/api/bs/hrmorganization/detach/update', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+
+
+
diff --git a/pc4mobx/organization/apis/newImport.js b/pc4mobx/organization/apis/newImport.js
new file mode 100644
index 0000000..eac6738
--- /dev/null
+++ b/pc4mobx/organization/apis/newImport.js
@@ -0,0 +1,27 @@
+import { WeaTools } from 'ecCom'
+
+//导入页面权限
+export const getHasRight = () => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getHasRight`, 'GET');
+}
+
+//选择导入字段
+export const getImportFields = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportFields`, 'GET', params);
+}
+
+//导入文件提交
+export const saveImport = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/saveImport`, 'POST', params);
+}
+
+//获取导入表单
+export const getImportForm = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportForm`, 'GET', params);
+}
+
+//获取导入结果
+export const getImportResult = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportResult`, 'GET', params);
+}
+
diff --git a/pc4mobx/organization/apis/numberSet.js b/pc4mobx/organization/apis/numberSet.js
new file mode 100644
index 0000000..b287162
--- /dev/null
+++ b/pc4mobx/organization/apis/numberSet.js
@@ -0,0 +1,115 @@
+/*
+ * Author: 黎永顺
+ * Description:
+ * Date: 2022-06-07 09:52:01
+ * LastEditTime: 2022-06-15 13:06:02
+ */
+import { WeaTools } from "ecCom";
+
+/**
+ * name:获取编号设置
+ * param {*} params serialtype, SUBCOMPANY:分部
+ * return {*}
+ */
+export const getCodeSetting = (params) => {
+ return WeaTools.callApi("/api/hrm/codeSetting/getCodeSetting", "GET", params);
+};
+
+/**
+ * name: 保存编号设置
+ * param {*} params
+ * return {*}
+ */
+export const saveOrUpdateCodeSetting = (params) => {
+ return WeaTools.callApi(
+ "/api/hrm/codeSetting/saveOrUpdateCodeSetting",
+ "POST",
+ params
+ );
+};
+/**
+ * name: 保存起始编号设置
+ * param {*} params
+ * return {*}
+ */
+export const saveStartNum = (params) => {
+ return WeaTools.callApi("/api/hrm/codeSetting/saveStartNum", "POST", params);
+};
+
+/**
+ * name: 起始编号设置
+ * param {*} params
+ * return {*}
+ */
+export const getStartNumForm = (params) => {
+ return WeaTools.callApi(
+ "/api/hrm/codeSetting/getStartNumForm",
+ "GET",
+ params
+ );
+};
+
+/**
+ * name: 高级搜索条件
+ * param {*} params
+ * return {*}
+ */
+ export const getAdvanceSearchCondition = (params) => {
+ return WeaTools.callApi(
+ "/api/hrm/codeSetting/getAdvanceSearchCondition",
+ "GET",
+ params
+ );
+};
+
+/**
+ * name: 预留编号设置列表查询
+ * param {*} params
+ * return {*}
+ */
+export const getSearchReservedCodeList = (params) => {
+ return WeaTools.callApi(
+ "/api/hrm/codeSetting/getSearchReservedCodeList",
+ "POST",
+ params
+ );
+};
+
+/**
+ * name: 保存预留编号设置
+ * param {*} params
+ * return {*}
+ */
+export const saveReservedCode = (params) => {
+ return WeaTools.callApi(
+ "/api/hrm/codeSetting/saveReservedCode",
+ "POST",
+ params
+ );
+};
+
+/**
+ * name: 新增预留编号表单查询
+ * param {*} params
+ * return {*}
+ */
+export const getReservedCodeFrom = (params) => {
+ return WeaTools.callApi(
+ "/api/hrm/codeSetting/getReservedCodeFrom",
+ "GET",
+ params
+ );
+};
+
+/**
+ * name: 删除预留编号
+ * param {*} params
+ * return {*}
+ */
+export const deleteReservedCodeById = (params) => {
+ return WeaTools.callApi(
+ "/api/hrm/codeSetting/deleteReservedCodeById",
+ "POST",
+ params
+ );
+};
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/officeManage.js b/pc4mobx/organization/apis/officeManage.js
index db1be85..1d081fc 100644
--- a/pc4mobx/organization/apis/officeManage.js
+++ b/pc4mobx/organization/apis/officeManage.js
@@ -2,11 +2,11 @@
* Author: 黎永顺
* Description:
* Date: 2022-05-13 16:36:09
- * LastEditTime: 2022-05-16 16:27:08
+ * LastEditTime: 2022-06-22 14:37:27
*/
import { WeaTools } from "ecCom";
-export const getHasRight = (params) => {
+export const getHasRight = params => {
return WeaTools.callApi(
"/api/bs/hrmorganization/postinfo/getHasRight",
"GET",
@@ -14,7 +14,7 @@ export const getHasRight = (params) => {
);
};
-export const getSearchCondition = (params) => {
+export const getSearchCondition = params => {
return WeaTools.callApi(
"/api/bs/hrmorganization/postinfo/getSearchCondition",
"GET",
@@ -22,84 +22,94 @@ export const getSearchCondition = (params) => {
);
};
-export const getPostInfoForm = (params) => {
+export const getPostInfoForm = params => {
return WeaTools.callApi(
"/api/bs/hrmorganization/postinfo/getPostInfoForm",
"GET",
params
);
};
-export const savePostInfo = (params) => {
+export const savePostInfo = params => {
return fetch("/api/bs/hrmorganization/postinfo/savePostInfo", {
method: "POST",
mode: "cors",
headers: {
- "Content-Type": "application/json",
+ "Content-Type": "application/json"
},
- body: JSON.stringify(params),
+ body: JSON.stringify(params)
});
};
-export const updatePostInfo = (params) => {
+export const updatePostInfo = params => {
return fetch("/api/bs/hrmorganization/postinfo/updatePostInfo", {
method: "POST",
mode: "cors",
headers: {
- "Content-Type": "application/json",
+ "Content-Type": "application/json"
},
- body: JSON.stringify(params),
+ body: JSON.stringify(params)
});
};
-export const updateForbiddenTagById = (params) => {
+export const updateForbiddenTagById = params => {
return fetch("/api/bs/hrmorganization/postinfo/updateForbiddenTagById", {
method: "POST",
mode: "cors",
headers: {
- "Content-Type": "application/json",
+ "Content-Type": "application/json"
},
- body: JSON.stringify(params),
+ body: JSON.stringify(params)
});
};
-export const savePost = (params) => {
+export const savePost = params => {
return fetch("/api/bs/hrmorganization/post/savePost", {
method: "POST",
mode: "cors",
headers: {
- "Content-Type": "application/json",
+ "Content-Type": "application/json"
},
- body: JSON.stringify(params),
+ body: JSON.stringify(params)
+ });
+};
+export const updatePost = params => {
+ return fetch("/api/bs/hrmorganization/post/updatePost", {
+ method: "POST",
+ mode: "cors",
+ headers: {
+ "Content-Type": "application/json"
+ },
+ body: JSON.stringify(params)
});
};
-export const deleteByIds = (params) => {
+export const deleteByIds = params => {
return fetch("/api/bs/hrmorganization/post/deleteByIds", {
method: "POST",
mode: "cors",
headers: {
- "Content-Type": "application/json",
+ "Content-Type": "application/json"
},
- body: JSON.stringify(params),
+ body: JSON.stringify(params)
});
};
-export const deletePostinfoByIds = (params) => {
+export const deletePostinfoByIds = params => {
return fetch("/api/bs/hrmorganization/postinfo/deleteByIds", {
method: "POST",
mode: "cors",
headers: {
- "Content-Type": "application/json",
+ "Content-Type": "application/json"
},
- body: JSON.stringify(params),
+ body: JSON.stringify(params)
});
};
-export const getTreeData = (params) => {
+export const getTreeData = params => {
return WeaTools.callApi(
"/api/bs/hrmorganization/post/getTreeData",
"GET",
params
);
};
-export const getPostForm = (params) => {
+export const getPostForm = params => {
return WeaTools.callApi(
"/api/bs/hrmorganization/post/getPostForm",
"GET",
@@ -107,7 +117,7 @@ export const getPostForm = (params) => {
);
};
-export const getPostInfoTable = (params) => {
+export const getPostInfoTable = params => {
return WeaTools.callApi(
"/api/bs/hrmorganization/postinfo/getPostInfoTable",
"GET",
diff --git a/pc4mobx/organization/apis/personnelResume.js b/pc4mobx/organization/apis/personnelResume.js
new file mode 100644
index 0000000..c445ede
--- /dev/null
+++ b/pc4mobx/organization/apis/personnelResume.js
@@ -0,0 +1,29 @@
+
+import {
+ WeaTools
+} from 'ecCom'
+
+export const getHasRight = () => {
+ return WeaTools.callApi('/api/bs/hrmorganization/personnelresume/hasRight', 'GET');
+}
+
+
+export const getPersonnelResume = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/personnelresume/getResumeList', 'GET', params);
+}
+
+export const getAdvanceSearchCondition = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/personnelresume/personnelScreening', 'GET', params);
+}
+
+export const downloadPerResume = (type) => {
+ fetch(`/api/bs/hrmorganization/personnelresume/downloadPerResume?type=${type}`).then(res => res.blob().then(blob => {
+ var filename= type == 0 ? `人员简历合并导出.docx` : `全部简历.zip`
+ var a = document.createElement('a');
+ var url = window.URL.createObjectURL(blob);
+ a.href = url;
+ a.download = filename;
+ a.click();
+ window.URL.revokeObjectURL(url);
+ }))
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/qtxConfig.js b/pc4mobx/organization/apis/qtxConfig.js
new file mode 100644
index 0000000..0424d9c
--- /dev/null
+++ b/pc4mobx/organization/apis/qtxConfig.js
@@ -0,0 +1,9 @@
+import { WeaTools } from 'ecCom';
+
+
+export const getQtxConfigInfo = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/config/selectConfigInfo', 'GET', params);
+}
+export const saveQtxConfigInfo = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/config/saveConfigInfo', 'POST', params);
+ }
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/quickSearch.js b/pc4mobx/organization/apis/quickSearch.js
new file mode 100644
index 0000000..7c5e5fb
--- /dev/null
+++ b/pc4mobx/organization/apis/quickSearch.js
@@ -0,0 +1,16 @@
+import {
+ WeaTools
+} from 'ecCom';
+
+export const saveQuickSearchInfo = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/saveQuickSearchInfo`, 'POST', params);
+}
+
+export const saveQuickSearchDetailInfo = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/saveQuickSearchDetailInfo`, 'POST', params);
+}
+
+export const getQuickSearchInfo = (params) => WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/getQuickSearchInfo`, 'GET', params);
+
+export const getQuickSearchDetailInfo = (params) => WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/getQuickSearchDetailInfo`, 'GET', params);
+
diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js
new file mode 100644
index 0000000..d8a8aeb
--- /dev/null
+++ b/pc4mobx/organization/apis/resource.js
@@ -0,0 +1,122 @@
+
+import {
+ WeaTools
+} from 'ecCom'
+
+export const getSearchList = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/listPage', 'GET', params);
+}
+
+export const getAdvanceSearchCondition = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSearchCondition', 'GET', params);
+}
+
+export const add = (params) => {
+ return fetch('/api/bs/hrmorganization/hrmresource/saveBaseForm', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+
+export const getSchemeForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSaveForm', 'GET', params);
+}
+
+export const getHasRight = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getHasRight', 'GET', params);
+}
+
+export const getQuickSearchCondition = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/quicksearch/getQuickSearchCondition', 'GET', params);
+}
+
+
+export const editResource = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/updateForm', 'POST', params);
+}
+
+export const getResourceExtendForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', params);
+}
+
+export const version = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/save', 'POST', params);
+}
+
+export const exportResource = (ids) => {
+ fetch('/api/bs/hrmorganization/common/resource/export?ids='+ids).then(res => res.blob().then(blob => {
+ var filename=`人员档案.xlsx`
+ var a = document.createElement('a');
+ var url = window.URL.createObjectURL(blob);
+ a.href = url;
+ a.download = filename;
+ a.click();
+ window.URL.revokeObjectURL(url);
+ }))
+}
+
+
+export const saveSearchTemplate = (params) => {
+ return fetch('/api/bs/hrmorganization/hrmresource/saveSearchTemplate', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const saveCustomTemplate = (params) => {
+ return fetch('/api/bs/hrmorganization/hrmresource/saveCustomTemplate', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+
+export const deleteSearchTemplate = (params) => {
+ return fetch('/api/bs/hrmorganization/hrmresource/deleteSearchTemplate', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const getSearchTemplate = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/hrmresource/getSearchTemplate`, 'GET',params);
+}
+
+export const getTemplateSelectKeys = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/hrmresource/getTemplateSelectKeys`, 'GET',params);
+}
+
+export const updateCustomTemplate = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/hrmresource/updateCustomTemplate`, 'POST',params);
+}
+
+export const saveColumnsCustomTemplate = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/hrmresource/saveColumnsCustomTemplate`, 'POST',params);
+}
+
+export const getEditTable = () => {
+ return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getCustomTemplate', 'GET');
+}
+
+export const getCustomTransferData = (id) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/hrmresource/getCustomTransferData?templateId=${id}`, 'GET');
+}
+
+
diff --git a/pc4mobx/organization/apis/resourceBasicInfo.js b/pc4mobx/organization/apis/resourceBasicInfo.js
new file mode 100644
index 0000000..fd06371
--- /dev/null
+++ b/pc4mobx/organization/apis/resourceBasicInfo.js
@@ -0,0 +1,106 @@
+
+import {
+ WeaTools
+} from 'ecCom'
+
+export const getSearchList = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getTable', 'GET', params);
+}
+
+export const deleteTableData = (params) => {
+ return fetch('/api/bs/hrmorganization/resourceBasicInfo/delete', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const recoverData = (params) => {
+ return fetch('/api/bs/hrmorganization/resourceBasicInfo/recover', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const getAdvanceSearchCondition = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getSearchCondition', 'GET', params);
+}
+
+export const addType = (params) => {
+ return fetch('/api/bs/hrmorganization/resourceBasicInfo/saveResourceItemClass', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const editType = (params) => {
+ return fetch('/api/bs/hrmorganization/resourceBasicInfo/updateResourceItemClass', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const deleteType = (params) => {
+ return fetch('/api/bs/hrmorganization/resourceBasicInfo/deleteResourceItemClass', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const getTypeForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getItemClassForm', 'GET', params);
+}
+
+
+export const add = (params) => {
+ return fetch('/api/bs/hrmorganization/resourceBasicInfo/save', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const edit = (params) => {
+ return fetch('/api/bs/hrmorganization/resourceBasicInfo/update', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ })
+}
+
+export const getForm = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getForm', 'GET', params);
+}
+
+export const getHasRight = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getHasRight', 'GET', params);
+}
+
+export const getTree = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/resourceBasicInfo/getTreeData', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/apis/resourceCard.js b/pc4mobx/organization/apis/resourceCard.js
new file mode 100644
index 0000000..d82035c
--- /dev/null
+++ b/pc4mobx/organization/apis/resourceCard.js
@@ -0,0 +1,13 @@
+
+import {
+ WeaTools
+} from 'ecCom'
+
+export const getCardData = (id) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/personnelcard/getPersonnelCard?id=${id}`, 'GET');
+}
+
+
+export const selectVersions = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/getVersion', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/components/Home.js b/pc4mobx/organization/components/Home.js
index 244ed50..669915c 100644
--- a/pc4mobx/organization/components/Home.js
+++ b/pc4mobx/organization/components/Home.js
@@ -12,18 +12,20 @@ const WeaLogViewComp = WeaLogView.Component;
const {
LogStore
} = WeaLogView;
+import LogView from "./log/LogView";
+
+import {LogViewStore} from "../stores/logview"
class Home extends React.Component {
constructor(props) {
super(props);
this.state = {
- key: new Date().getTime(),
+ keys: new Date().getTime(),
visible: false,
- logStore: new LogStore(),
- logType: '4',
- logSmallType: ''
+ logViewStore: new LogViewStore()
+
}
- window.setLogViewProps = this.setLogViewProps;
+ window.setLogViewProp = this.setLogViewProp;
}
componentDidMount(){
@@ -46,13 +48,10 @@ class Home extends React.Component {
});
}
- setLogViewProps = (props) => {
+ setLogViewProp = (props) => {
this.setState({
- key: new Date().getTime(),
- targetId: '',
visible: true,
- logType: '4',
- logStore: new LogStore(),
+ logViewStore: new LogViewStore(),
...props
});
}
@@ -61,15 +60,17 @@ class Home extends React.Component {
visible: false
})
}
+
render() {
//const isSingle = window.location.pathname.indexOf('/spa/hrm/engine') > -1;
return (
-
-
+
+
{this.props.children}
+
)
}
diff --git a/pc4mobx/organization/components/ImportDialog.js b/pc4mobx/organization/components/ImportDialog.js
new file mode 100644
index 0000000..e233189
--- /dev/null
+++ b/pc4mobx/organization/components/ImportDialog.js
@@ -0,0 +1,240 @@
+import {
+ WeaNewScroll,
+ WeaSearchGroup,
+ WeaMoreButton,
+ WeaDialog
+} from 'ecCom'
+import {
+ inject,
+ observer,
+} from 'mobx-react'
+import {
+ Spin,
+ Button,
+ Pagination,
+ Steps,
+ Upload,
+ Icon,
+ Row,
+ Col,
+ Progress
+} from 'antd'
+
+import {
+ WeaSwitch,
+ WeaTableNew
+} from 'comsMobx'
+
+import {
+ i18n
+} from '../public/i18n';
+import { addContentPath } from '../util/index.js'
+
+const Step = Steps.Step;
+const Dragger = Upload.Dragger;
+const WeaTable = WeaTableNew.WeaTable;
+
+
+@inject("importDialog")
+@observer
+export default class ImportDialog extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ width: 800,
+ height: 600,
+ title: '数据导入',
+ }
+ }
+
+ getCircle() {
+ let style = {
+ width: 20,
+ height: 20,
+ backgroundColor: '#D8D8D8',
+ webkitBorderRadius: 10,
+ mozBorderRadius: 10,
+ msBorderRadius: 10,
+ oBorderRadius: 10,
+ borderRadius: 10,
+ //paddingLeft: 6,
+ textAlign: 'center',
+ }
+ return style;
+ }
+
+ getIllustration(val, url, index, link) {
+ let p;
+ if (index == 0) {
+ p = ({i18n.label.downLoadTemplete()}: {i18n.label.importTemplate()}
);
+ } else {
+ p = ();
+ }
+ return p;
+ }
+
+ next() {
+ const { importDialog } = this.props;
+ let { current, steps } = importDialog;
+ current = current + 1;
+ if (current === steps.length) {
+ current = 0;
+ importDialog.init();
+ }
+ importDialog.current = current;
+ current === steps.length - 1 && importDialog.startImport();
+ }
+
+ getForm() {
+ const {
+ importDialog
+ } = this.props;
+ const {
+ condition
+ } = importDialog;
+ let _arr = [];
+
+ condition.map((c, i) => {
+ let arr = [];
+ c.items.map((field, index) => {
+ arr.push({
+ com: (
+
+
+
+
+
+
+ {this.getIllustration(field.value, field.link, index, field)}
+
+
+
+
+ ),
+ colSpan: 1
+ })
+ })
+ _arr.push(
)
+
+ });
+ return _arr;
+ }
+
+ setFileId(fileInfo) {
+ const { importDialog } = this.props;
+ fileInfo.file.response && importDialog.setExcelfile(fileInfo.file.response.data.fileid);
+ importDialog.filelist = fileInfo.fileList;
+ }
+
+ reRenderColumns(c) {
+ c.forEach(item => {
+ if (item.dataIndex == 'operatedetail') {
+ item.render = function (text, record) {
+ return {text}
+ }
+ }
+ });
+ }
+
+ render() {
+ const {
+ importDialog
+ } = this.props, {
+ importVisible,steps,current, pvisable, percent, failnum, succnum, importResultTip, importResultStore, importStatus, loading, date
+ } = importDialog, {
+ width,
+ height,
+ title
+ } = this.state;
+
+ const buttons = [
+ (),
+ ];
+
+
+ const props = {
+ name: 'file',
+ action: '/api/doc/upload/uploadFile',
+ accept: '.xls,.xlsx',
+ multiple:false
+
+ };
+
+ return (
+ importDialog.init()}
+ buttons={buttons}
+ style={{ width: width, height: height }}
+ >
+
+
+ {steps.map((s, i) => )}
+
+
+
+ {
+ current == 0 &&
+ {
+ this.setFileId(fileInfo)
+ }
+ }
+ >
+
+
+
+
+
点击或将文件拖拽到此区域上传
+
支持单个或批量上传,严禁上传公司内部资料及其他违禁文件
+
+
+ {this.getForm()}
+
+ }
+ {
+ current == 1 &&
+ {
+ importStatus == 'over' &&
+
0 ? '#54D3A2' : '#FF0000' }}>
+ 0 ? 'check' : 'cross'} style={{ color: '#fff' }} />
+
{importResultTip}
+
+ }
+ {
+ failnum > 0 &&
+
this.reRenderColumns(c)}
+ />
+ }
+ importDialog.pvisable = false}
+ visible={pvisable}
+ style={{ width: 300, height: 50 }}
+ >
+
+
+
+ }
+
+
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/components/NewAndEditDialog.js b/pc4mobx/organization/components/NewAndEditDialog.js
index 7513c42..51a984e 100644
--- a/pc4mobx/organization/components/NewAndEditDialog.js
+++ b/pc4mobx/organization/components/NewAndEditDialog.js
@@ -4,6 +4,7 @@ import {
WeaNewScroll,
WeaSearchGroup,
WeaMoreButton,
+ WeaPopoverHrm
} from 'ecCom'
import {
@@ -18,14 +19,14 @@ import {
import {
i18n
} from '../public/i18n';
+import AttachToNumberField from './NewNumberField';
+
export default class NewAndEditDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
width: 700,
- enable: props.enable
-
}
}
@@ -46,24 +47,31 @@ export default class NewAndEditDialog extends React.Component {
error={form.getError(field)}
tipPosition="bottom"
wrapperCol={{ span: `${field.fieldcol}` }}>
- {}
+ {}
+ {field.domkey[0] == 'subcompanycode' && field.viewAttr != '1' && }
+ {field.domkey[0] == 'departmentcode' && field.viewAttr != '1' && }
+ {/* {field.domkey[0] == 'job_no' && field.viewAttr != '1' && }
+ {field.domkey[0] == 'work_code' && field.viewAttr != '1' && } */}
)
})
})
- return {arr}
+ return {arr}
}
onChange = data => {
- if(this.state.enable && data.schemeId) {
- const {
- condition,
- form,
- bindChangeEnvent,
- } = this.props;
+ const {
+ bindChangeEnvent,
+ moduleName
+ } = this.props;
+ if (moduleName == 'jobGrade' && data.schemeId) {
bindChangeEnvent(data.schemeId.value);
}
-
-
+ if (moduleName == 'staffScheme' && data.planYear) {
+ bindChangeEnvent(data.planYear.value);
+ }
+ if (moduleName == 'staff' && data.planId) {
+ bindChangeEnvent(data);
+ }
};
onBlur = data => {
@@ -95,6 +103,11 @@ export default class NewAndEditDialog extends React.Component {
>
+ {field.domkey[0] == 'subcompanycode' && field.viewAttr != '1' && }
+ {field.domkey[0] == 'departmentcode' && field.viewAttr != '1' && }
+ {/* {field.domkey[0] == 'job_no' && field.viewAttr != '1' && }
+ {field.domkey[0] == 'work_code' && field.viewAttr != '1' && } */}
+
),
colSpan: 1
@@ -118,17 +131,20 @@ export default class NewAndEditDialog extends React.Component {
isEdit,
height,
conditionLen,
+ saveAndSetting
} = this.props, {
width,
} = this.state;
const buttons = [
(),
+ (saveAndSetting && ),
()
];
return (
onCancel()}
buttons={isEdit ? buttons : buttons.slice(1, 2)}
style={{ width: width, height: height }}
+ initLoadCss
>
{
loading ?
- : 1 ? '' : 'hrm-dialog-form'}>
- {conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()}
-
- }
+ : conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()}
+
+
)
}
-}
\ No newline at end of file
+}
diff --git a/pc4mobx/organization/components/NewNumberField.js b/pc4mobx/organization/components/NewNumberField.js
new file mode 100644
index 0000000..9d6e40c
--- /dev/null
+++ b/pc4mobx/organization/components/NewNumberField.js
@@ -0,0 +1,140 @@
+import React, { PureComponent } from "react";
+import { i18n } from "../public/i18n";
+import { WeaTools } from "ecCom";
+
+/**
+ * 添加多级路径
+ *
+ * @param {*} url
+ */
+export const addContentPath = (url) => {
+ const ecologyContentPath = window.ecologyContentPath || "";
+ if (url && ecologyContentPath) {
+ //避免重复添加ecologyContentPath
+ //避免传入的参数不是链接
+ if (url.startsWith("/") && !url.startsWith(ecologyContentPath)) {
+ url = ecologyContentPath + url;
+ }
+ }
+ return url;
+};
+
+export default class AttachToNumberField extends PureComponent {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ canRe: false,
+ canCheck: false,
+ canNew: false
+ };
+ this.typeMap = {
+ subcompanycode: "SUBCOMPANY",
+ departmentcode: "DEPARTMENT",
+ job_no: "JOBTITLES",
+ // work_code: "USER"
+ };
+
+ }
+
+ componentWillMount() {
+ const { field: { domkey: [targetKey] } } = this.props;
+ this.targetKey = targetKey;
+ this.type = this.typeMap[this.targetKey];
+ }
+
+ componentDidMount() {
+ this.init(this.props.isEdit);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ if (nextProps.form != this.props.form) {
+ this.init(nextProps.isEdit);
+ }
+ }
+
+ init = (isEdit) => {
+ WeaTools.callApi("/api/hrm/codeSetting/getHasSelect", "GET", {}).then(res => {
+ if (res) {
+ //后台设置页面开关关闭,接口不会返回对应的权限,所以这里做下兼容
+ const target = res[this.type] || { hasSelect: false, hasRight: false };
+ const { hasSelect, hasRight } = target;
+ this.setState({
+ canRe: hasSelect && isEdit,
+ canCheck: hasSelect,
+ canNew: hasRight
+ });
+ }
+ });
+ };
+
+ handleClick = (e) => {
+ const urlMap = {
+ select: {
+ title: i18n.label.selectReserveNumber(),
+ url: addContentPath(`/spa/hrm/engine.html#/hrmengine/reservedNumber?type=${this.type}&isSimple=1`)
+ },
+ add: {
+ title: i18n.label.newReserveNumber(),
+ url: addContentPath(`/spa/hrm/engine.html#/hrmengine/newReservedNumberContent?type=${this.type}`)
+ }
+ };
+
+ const { title, url } = urlMap[e.target.id];
+
+ ecCom.WeaTools.createDialog({
+ title,
+ url,
+ moduleName: "hrm",
+ style: { width: 800, height: 600 },
+ callback: this.updateFormField,
+ onCancel: () => { // 关闭通信
+ }
+ }).show();
+ };
+ updateFormField = (value) => {
+ const { form } = this.props;
+ form.updateFields({
+ [this.targetKey]: value
+ });
+ };
+ //重新生成编号
+ reNumber = () => {
+ const { form, useId } = this.props;
+ const fieldMap = {
+ subcompanycode: "subshowid",
+ departmentcode: "showid",
+ jobtitlecode: "jobactivityid",
+ workcode: "useid"
+ },
+ fieldname = fieldMap[this.targetKey];
+
+ WeaTools.callApi("/api/hrm/codeSetting/regenerateCode", "POST", {
+ serialtype: this.type,
+ [`${this.type.toLocaleLowerCase()}id`]: form.getFormParams()[fieldname] || useId
+ }).then(res => {
+ const { api_status, code } = res;
+ if (api_status) {
+ if (code) {
+ this.updateFormField(code);
+ } else {
+ message.error(res.api_errormsg);
+ }
+ }
+ });
+ };
+
+
+ render() {
+ const { canRe, canCheck, canNew } = this.state;
+ return (
+
+ );
+ }
+}
diff --git a/pc4mobx/organization/components/NewWeaTableEditDialog.js b/pc4mobx/organization/components/NewWeaTableEditDialog.js
new file mode 100644
index 0000000..0cbdb50
--- /dev/null
+++ b/pc4mobx/organization/components/NewWeaTableEditDialog.js
@@ -0,0 +1,59 @@
+import {
+ observer
+} from 'mobx-react';
+import {
+ WeaDialog,
+ WeaTableEdit
+} from 'ecCom';
+import {
+ Spin,
+ Button, Modal
+} from 'antd'
+
+import * as mobx from "mobx";
+const toJS = mobx.toJS;
+
+@observer
+export default class NewWeaTableEditDialog extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ onRowSelect = (sRowKeys, rows, dataIndex, selectedDatas) => {
+ const { store } = this.props;
+ if (dataIndex === undefined || selectedDatas === undefined) {
+ return;
+ }
+ store.setEnableRows(selectedDatas.isused);
+ };
+
+ render() {
+ const {
+ store,
+ } = this.props, {
+ temlateManageDialog,
+ relatedData
+ } = store;
+ const { datas, columns, loading,selectedData } = relatedData;
+
+ return (
+
+ store.setTableEditDatas(e)}
+ onRowSelect={(sRowKeys, rows, dataIndex, selectedDatas) => this.onRowSelect(sRowKeys, rows, dataIndex, selectedDatas)}
+ />
+
+ );
+ }
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/components/SearchPanelDialog.js b/pc4mobx/organization/components/SearchPanelDialog.js
new file mode 100644
index 0000000..9d3f9fe
--- /dev/null
+++ b/pc4mobx/organization/components/SearchPanelDialog.js
@@ -0,0 +1,135 @@
+import {
+ WeaDialog,
+ WeaFormItem,
+ WeaNewScroll,
+ WeaSearchGroup,
+ WeaMoreButton,
+ WeaPopoverHrm
+} from 'ecCom'
+
+import {
+ Row,
+ Col,
+ Spin,
+ Button,
+} from 'antd'
+
+import {
+ WeaSwitch
+} from 'comsMobx'
+
+import {
+ i18n
+} from '../public/i18n';
+import AttachToNumberField from './NewNumberField';
+import "../style/common.less";
+
+export default class SearchPanelDialog extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ width: 700,
+ }
+ }
+
+
+ getForm() {
+ const {
+ condition,
+ form,
+ isFormInit,
+ } = this.props;
+
+ let arr = [];
+ isFormInit && condition.map(c => {
+ c.items.map((field, index) => {
+ arr.push(
+
+
+ {}
+
+
+ )
+ })
+ })
+ return {arr}
+ }
+
+ getSearchGroupForm() {
+ const {
+ condition,
+ form,
+ isFormInit,
+ } = this.props;
+
+ let arr = [];
+ isFormInit && condition.map((c, i) => {
+ let _arr = [];
+ c.items.map((field, index) => {
+ _arrarr.push(
+
+
+ {}
+
+
+ )
+ })
+ arr.push()
+ })
+
+ return {arr}
;
+ }
+
+
+
+ render() {
+ const {
+ title,
+ visible,
+ search,
+ onCancel,
+ loading,
+ height,
+ conditionLen,
+ form
+ } = this.props, {
+ width,
+ } = this.state;
+
+ const buttons = [
+ (),
+ (),
+ ()
+ ];
+
+ return (
+ onCancel()}
+ buttons={buttons}
+ style={{ width: width, height: height }}
+ initLoadCss
+ >
+ {
+ loading ?
+
+
+ : conditionLen > 1 ? this.getSearchGroupForm() : this.getForm()}
+
+
+
+ )
+ }
+}
diff --git a/pc4mobx/organization/components/SelectTag.js b/pc4mobx/organization/components/SelectTag.js
new file mode 100644
index 0000000..07c6148
--- /dev/null
+++ b/pc4mobx/organization/components/SelectTag.js
@@ -0,0 +1,24 @@
+
+import "../style/common.less";
+
+export default class SelectTag extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ const {
+ bagColor,
+ text,
+ } = this.props;
+ const bagStyle = {
+ background:bagColor
+ }
+
+ return (
+
+ )
+ }
+}
diff --git a/pc4mobx/organization/components/VersionsSlider.js b/pc4mobx/organization/components/VersionsSlider.js
new file mode 100644
index 0000000..442ddda
--- /dev/null
+++ b/pc4mobx/organization/components/VersionsSlider.js
@@ -0,0 +1,93 @@
+import {
+ WeaFormItem,
+ WeaTab,
+ WeaTableEdit
+} from 'ecCom'
+
+import {
+ Spin,
+ Button,
+ Tooltip,
+ Row, Col, Select
+} from 'antd'
+
+
+import { chunk, isEmpty } from 'lodash';
+import { toJS } from "mobx";
+const Option = Select.Option;
+
+export default class VersionsSlider extends React.Component {
+
+ componentDidMount() {
+
+ }
+
+ isEmptyObject(obj) {
+ for (let key in obj) {
+ return false;
+ }
+ return true;
+ }
+
+
+ render() {
+ const {
+ versionList,
+ handleChange
+ } = this.props;
+
+ const newData = chunk(versionList.datas, 2);
+
+
+ return (
+
+
+
+
+ 操作人: {versionList.operateName}
+
+
+ 操作时间: {versionList.operateTime}
+
+
+ 版本:
+
+
+
+ {newData.map((item, index) => {
+ return (
+
+ {item.map((subItem) => {
+ return (
+
+ {subItem.fieldId}
+ {subItem.fieldValue.length > 10 ?
+ {subItem.fieldValue}
+ : {subItem.fieldValue}}
+
+
+
+ );
+ })}
+
+ );
+ })}
+
+
+ )
+ }
+}
diff --git a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js b/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js
deleted file mode 100644
index 25f9140..0000000
--- a/pc4mobx/organization/components/branchNumSetting/components/numberComposition.js
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Author: 黎永顺
- * Description:
- * Date: 2022-05-17 16:02:56
- * LastEditTime: 2022-05-18 18:03:07
- */
-import React, { Component, Fragment } from "react";
-import { Button, Modal } from "antd";
-import {
- WeaTableEdit,
- WeaDialog,
- WeaMoreButton,
- WeaFormItem,
- WeaSelect,
- WeaInput,
-} from "ecCom";
-import Preview from "./preview";
-import { i18n } from "../../../public/i18n";
-import _ from "lodash";
-import "../index.less";
-
-const dataSource = [
- {
- value: "",
- numFieldName: "字符串",
- numField: "string",
- },
- { value: "3", numFieldName: "流水号位数", numField: "number" },
-];
-
-const options = [
- {
- key: "string",
- showname: "字符串",
- },
- {
- key: "year",
- showname: "当前年份",
- },
- {
- key: "month",
- showname: "当前月份",
- },
- {
- key: "day",
- showname: "当前日期",
- },
-];
-class NumberComposition extends Component {
- constructor() {
- super();
- this.state = {
- visible: false,
- numField: "string",
- numFieldName: "字符串",
- dataSource,
- };
- }
-
- /**
- * name:复选框禁用
- * param undefined
- * return {*}
- */
- getRowSelection = (rowSelection) => {
- const { dataSource } = this.state;
- const hasMonthNum = dataSource.some((item) => item.numField === "month");
- const hasDayNum = dataSource.some((item) => item.numField === "day");
- const sel = { ...rowSelection };
- sel.getCheckboxProps = (record) => {
- return {
- disabled:
- record.numField === "number" ||
- (hasMonthNum && record.numField === "year") ||
- (hasDayNum && record.numField === "month"),
- };
- };
- return sel;
- };
- /**
- * name: 字段保存
- * return {*}
- */
- handleSave = () => {
- const { numField, numFieldName, dataSource } = this.state;
- const objWrite = {
- value: "",
- numFieldName,
- numField,
- };
- const objView = {
- com: {
- value: [{ key: numField, label: "", type: "TEXT" }],
- },
- [numField]: "",
- numFieldName,
- numField,
- };
- if (numField === "year" || numField === "month" || numField === "day") {
- const hasYearOrMonthOrDay = _.some(
- dataSource,
- (it) => it.numField === numField
- );
- const hasYearNum = dataSource.some((item) => item.numField === "year");
- const hasMonthNum = dataSource.some((item) => item.numField === "month");
- if (!hasYearOrMonthOrDay) {
- if (numField === "month" && !hasYearNum) {
- Modal.warning({
- title: "信息确认",
- content: `添加【${numFieldName}】时,请先添加【当前年份】!`,
- onOk() {},
- okText: "确认",
- });
- return;
- }
- if (numField === "day" && (!hasYearNum || !hasMonthNum)) {
- Modal.warning({
- title: "信息确认",
- content: `添加【${numFieldName}】时,请先添加【当前年份】和【当前月份】!`,
- onOk() {},
- okText: "确认",
- });
- return;
- }
- this.setState({
- visible: false,
- numField: "string",
- numFieldName: "字符串",
- dataSource: [...dataSource, objView],
- });
- } else {
- this.showConfirm();
- }
- } else {
- this.setState({
- visible: false,
- numField: "string",
- numFieldName: "字符串",
- dataSource: [...dataSource, objWrite],
- });
- }
- };
- /**
- * name:年月日字段重复提示
- * return {*}
- */
- showConfirm = () => {
- const { numFieldName } = this.state;
- Modal.warning({
- title: "信息确认",
- content: `已经添加过一个${numFieldName},请选择其他编号字段!`,
- footer: [],
- onOk() {},
- okText: "确认",
- });
- };
- /**
- * name: 编号字段删除
- * return {*}
- */
- handleDeleteTable = (keys, datas) => {
- const { dataSource } = this.state;
- const stringRow = _.filter(dataSource, (it) => it.numField === "string");
- const yearRow = _.filter(dataSource, (it) => it.numField === "year");
- const monthRow = _.filter(dataSource, (it) => it.numField === "month");
- const dayRow = _.filter(dataSource, (it) => it.numField === "day");
- const disableRow = _.filter(dataSource, (it) => it.numField === "number");
- const tmpV = [
- ...stringRow,
- ...yearRow,
- ...monthRow,
- ...dayRow,
- ...disableRow,
- ];
- this.setState({
- dataSource: _.filter(tmpV, (it, idx) => !keys.includes(idx)),
- });
- };
-
- handleChangeInput = (value, index) => {
- const { dataSource } = this.state;
- const stringRow = _.filter(dataSource, (it) => it.numField === "string");
- const yearRow = _.filter(dataSource, (it) => it.numField === "year");
- const monthRow = _.filter(dataSource, (it) => it.numField === "month");
- const dayRow = _.filter(dataSource, (it) => it.numField === "day");
- const disableRow = _.filter(dataSource, (it) => it.numField === "number");
- const tmpV = _.map(
- [...stringRow, ...yearRow, ...monthRow, ...dayRow, ...disableRow],
- (it, idx) => ({ ...it, key: idx })
- );
- this.setState({
- dataSource: _.map(tmpV, (it) => {
- if (it.key === index) {
- return {
- ...it,
- value,
- };
- }
- return { ...it };
- }),
- });
- };
-
- render() {
- const { visible, numField, dataSource } = this.state;
- const columns = [
- {
- title: "",
- dataIndex: "numFieldName",
- key: "numFieldName",
- colSpan: 1,
- com: [{ label: "", type: "TEXT" }],
- width: "20%",
- },
- {
- title: "",
- useRecord: true,
- dataIndex: "custom",
- key: "custom",
- com: [
- {
- type: "custom",
- key: "custom",
- render: (text, record, index) => {
- const { numField } = record;
- if (
- numField === "year" ||
- numField === "month" ||
- numField === "day"
- ) {
- return ;
- }
- return (
-
- this.handleChangeInput(value, index, record)
- }
- />
- );
- },
- },
- ],
- // dataIndex: "value",
- // key: "value",
- // com: [{ label: "", type: "INPUT", viewAttr: 2, key: "value" }],
- colSpan: 1,
- width: "70%",
- },
- ];
- const buttons = [
- ,
- ,
- ];
- const stringRow = _.map(
- _.filter(dataSource, (it) => it.numField === "string"),
- (item, index) => {
- return {
- ...item,
- numFieldName: `${item.numFieldName}${index + 1}`,
- };
- }
- );
- const yearRow = _.filter(dataSource, (it) => it.numField === "year");
- const monthRow = _.filter(dataSource, (it) => it.numField === "month");
- const dayRow = _.filter(dataSource, (it) => it.numField === "day");
- const disableRow = _.filter(dataSource, (it) => it.numField === "number");
-
- return (
-
-
- this.setState({
- visible: true,
- })
- }
- onDelete={this.handleDeleteTable}
- />
- {/* 预览 */}
-
- {/* 新增弹框 */}
-
- this.setState({
- visible: false,
- })
- }
- icon="icon-coms-hrm"
- iconBgcolor="#217346"
- title={i18n.label.addNumberField()}
- visible={visible}
- hasScroll
- maxHeight={150}
- buttons={buttons}>
-
-
- {
- this.setState({ numField, numFieldName });
- }}
- />
-
-
-
-
- );
- }
-}
-
-export default NumberComposition;
diff --git a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js b/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js
deleted file mode 100644
index b5cd812..0000000
--- a/pc4mobx/organization/components/branchNumSetting/components/startReservedNumberSet.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Author: 黎永顺
- * Description: 起始编号及预留编号设置
- * Date: 2022-05-17 15:51:41
- * LastEditTime: 2022-05-17 16:01:33
- */
-import React, { Component, Fragment } from "react";
-import { WeaFormItem } from "ecCom";
-
-class StartReservedNumberSet extends Component {
- render() {
- return (
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default StartReservedNumberSet;
diff --git a/pc4mobx/organization/components/branchNumSetting/index.js b/pc4mobx/organization/components/branchNumSetting/index.js
deleted file mode 100644
index 6ab1d7d..0000000
--- a/pc4mobx/organization/components/branchNumSetting/index.js
+++ /dev/null
@@ -1,124 +0,0 @@
-const { inject, observer } = mobxReact;
-const ProductItem = ecodeSDK.imp(ProductItem);
-const ProductDialog = ecodeSDK.imp(ProductDialog);
-const { toJS } = mobx;
-// const { product } = ecodeSDK.imp(productDataSource);
-const { WeaDialog } = ecCom;
-const { createRef } = React;
-
-@inject("projectStore")
-@observer
-class ProductIndex extends React.Component {
- constructor() {
- super();
- this.state = {
- dialogParams: {
- visible: false,
- productId: "",
- },
- dialogWidth: 1200,
- dialogHeight: 100,
- };
- this.productRef = createRef();
- }
- componentDidMount() {
- window.addEventListener("resize", this.resizeWidthHeight);
- this.resizeWidthHeight();
- this.init();
- }
- conponentWillUnmount() {
- window.removeEventListener("resize", this.resizeWidthHeight);
- }
-
- resizeWidthHeight = () => {
- requestAnimationFrame(() => {
- if (!this.productRef.current) {
- return;
- }
- const { offsetWidth, offsetHeight } = this.productRef.current;
- this.setState({
- dialogWidth: offsetWidth - 100,
- // offsetHeight / 2
- dialogHeight: 80,
- });
- });
- };
-
- init = () => {
- const {
- projectStore: { init },
- } = this.props;
- init();
- };
-
- handlePickProduct = async (productId) => {
- const {
- projectStore: { viewProject, init },
- } = this.props;
- const { api_status } = await viewProject(productId);
- if (api_status) init();
- this.setState({
- dialogParams: { ...this.state.dialogParams, visible: true, productId },
- });
- };
-
- render() {
- const { dialogParams, dialogHeight, dialogWidth } = this.state;
- const {
- projectStore: { product },
- } = this.props;
- return (
-
-
- {_.map(toJS(product), (item, index) => {
- const { id, title, subTitle, products } = item;
- return (
-
- {/*
{title}
-
{subTitle}
*/}
-
-
- );
- })}
- {/*
-
- 演示
-
- 脚本
-
- */}
-
- {/* 弹框 */}
- {dialogParams.visible && (
-
{
- this.resizeWidthHeight();
- this.setState({
- dialogParams: {
- ...this.state.dialogParams,
- visible: false,
- productId: "",
- },
- });
- }}
- visible={dialogParams.visible}
- style={{ width: dialogWidth }}>
-
-
- )}
-
- );
- }
-}
-
-ecodeSDK.exp(ProductIndex);
diff --git a/pc4mobx/organization/components/columnSetting/customItem.js b/pc4mobx/organization/components/columnSetting/customItem.js
new file mode 100644
index 0000000..c0f5e0c
--- /dev/null
+++ b/pc4mobx/organization/components/columnSetting/customItem.js
@@ -0,0 +1,48 @@
+import React, { Component } from "react";
+import { WeaTableEdit } from "ecCom";
+import { inject, observer } from "mobx-react";
+import { toJS } from "mobx";
+
+@inject("columnSetting")
+@observer
+class CustomItem extends Component {
+ componentDidMount() {
+ this.init();
+ }
+
+ init = () => {
+ const { columnSetting } = this.props;
+ columnSetting.loadTabThreeRelatedData();
+ };
+
+ onRowSelect = (sRowKeys, rows, dataIndex, selectedDatas) => {
+ const { columnSetting } = this.props;
+ if (dataIndex === undefined || selectedDatas === undefined) {
+ return;
+ }
+ columnSetting.setEnableThreeRows(selectedDatas.status);
+ };
+
+ render() {
+ const { columnSetting } = this.props, { tabThreeRelatedData } = columnSetting;
+ const { datas, columns, selectedData, loading } = tabThreeRelatedData;
+ return (
+
+ columnSetting.setCustomTableEditDatas(e)}
+ onRowSelect={(sRowKeys, rows, dataIndex, selectedDatas) => this.onRowSelect(sRowKeys, rows, dataIndex, selectedDatas)}
+ />
+
+ );
+ }
+}
+
+export default CustomItem;
diff --git a/pc4mobx/organization/components/columnSetting/defineShowItems.js b/pc4mobx/organization/components/columnSetting/defineShowItems.js
new file mode 100644
index 0000000..66838ef
--- /dev/null
+++ b/pc4mobx/organization/components/columnSetting/defineShowItems.js
@@ -0,0 +1,50 @@
+import { inject, observer } from "mobx-react";
+import React, { Component } from "react";
+import { WeaTableEdit } from "ecCom";
+import * as mobx from "mobx";
+
+const toJS = mobx.toJS;
+
+@inject("columnSetting")
+@observer
+export default class DefineShowItems extends Component {
+ constructor(props) {
+ super(props);
+ }
+
+ componentDidMount() {
+ this.init();
+ }
+
+ init = () => {
+ const { columnSetting } = this.props;
+ columnSetting.loadTabTwoRelatedData();
+ };
+
+ onRowSelect = (sRowKeys, rows, dataIndex, selectedDatas) => {
+ const { columnSetting } = this.props;
+ if (dataIndex === undefined || selectedDatas === undefined) {
+ return;
+ }
+ columnSetting.setEnableRows(selectedDatas.isused);
+ };
+
+ render() {
+ const { columnSetting } = this.props, { tabTwoRelatedData } = columnSetting;
+ const { datas, columns, selectedData, loading } = tabTwoRelatedData;
+ return (
+ columnSetting.setTableEditDatas(e)}
+ onRowSelect={(sRowKeys, rows, dataIndex, selectedDatas) => this.onRowSelect(sRowKeys, rows, dataIndex, selectedDatas)}
+ />
+ );
+ }
+}
diff --git a/pc4mobx/organization/components/columnSetting/index.js b/pc4mobx/organization/components/columnSetting/index.js
new file mode 100644
index 0000000..632b8c3
--- /dev/null
+++ b/pc4mobx/organization/components/columnSetting/index.js
@@ -0,0 +1,106 @@
+import React, { Component } from "react";
+import { WeaRightMenu, WeaTab, WeaTop } from "ecCom";
+import { inject, observer } from "mobx-react";
+import { Button } from "antd";
+import PermissionItem from "./permissionItem";
+import DefineShowItems from "./defineShowItems";
+import CustomItem from "./customItem";
+import { i18n } from "../../public/i18n";
+import { renderNoright } from "../../util";
+
+@inject("columnSetting")
+@observer
+class ColumnSetting extends Component {
+ componentDidMount() {
+ this.init();
+ }
+
+ init = () => {
+ const { columnSetting } = this.props;
+ columnSetting.getRight();
+ };
+
+ getTopMenuBtns = () => {
+ return [
+
+ ];
+ };
+ getDropMenuDatas = () => {
+ return [
+ {
+ key: "save",
+ icon: ,
+ content: "保存"
+ }
+ ];
+ };
+ getTabName = () => {
+ return [{
+ key: "0",
+ title: i18n.label.defineShowItems()
+ }, {
+ key: "1",
+ title: i18n.label.columnPermission()
+ }, {
+ key: "2",
+ title: i18n.label.columnCustom()
+ }];
+ };
+ save = () => {
+ const { columnSetting } = this.props;
+ const { selectedKey } = columnSetting;
+ selectedKey === "0" ?
+ columnSetting.userDefineCardItemSave() :
+ selectedKey === "1" ?
+ columnSetting.columnPermissionSave() : columnSetting.customItemSave();
+ };
+
+ render() {
+ const { columnSetting } = this.props;
+ const { selectedKey, authorized } = columnSetting;
+ if (authorized === false) {
+ return renderNoright();
+ }
+ return (
+ authorized &&
+
,
+ content: "保存"
+ }]}
+ onClick={key => (key && this[key]())}
+ >
+
}
+ iconBgcolor="#217346"
+ loading={true}
+ buttons={this.getTopMenuBtns()}
+ showDropIcon={true}
+ dropMenuDatas={this.getDropMenuDatas()}
+ onDropMenuClick={(e) => (e && this[e]())}
+ />
+
columnSetting.setSelectedKey(key)}
+ />
+ {
+ selectedKey === "0" ?
+ :
+ selectedKey === "1" ?
+ :
+
+ }
+
+
+ );
+ }
+}
+
+export default ColumnSetting;
diff --git a/pc4mobx/organization/components/columnSetting/permissionItem.js b/pc4mobx/organization/components/columnSetting/permissionItem.js
new file mode 100644
index 0000000..13207cf
--- /dev/null
+++ b/pc4mobx/organization/components/columnSetting/permissionItem.js
@@ -0,0 +1,89 @@
+import React, { Component } from "react";
+import { WeaTableNew } from "comsMobx";
+import { WeaBrowser, WeaCheckbox } from "ecCom";
+import { inject, observer } from "mobx-react";
+import { toJS } from "mobx";
+
+const WeaTable = WeaTableNew.WeaTable;
+
+@inject("columnSetting")
+@observer
+class PermissionItem extends Component {
+ componentDidMount() {
+ this.init();
+ }
+
+ init = () => {
+ const { columnSetting } = this.props;
+ columnSetting.loadTabOneRelatedData();
+ };
+ changeSaveParams = (record, value, dataIndex) => {
+ const { columnSetting } = this.props;
+ const list = _.isEmpty(columnSetting.columnsPermissionData) ? toJS(columnSetting.tableStore.datas) : columnSetting.columnsPermissionData;
+ const dataSource = _.map([...list], it => {
+ if (record.id === it.id) {
+ return {
+ ...it,
+ [dataIndex]: value
+ };
+ }
+ return { ...it };
+ });
+ columnSetting.setColumnsPermissionData(dataSource);
+ };
+ renderRenderColumns = columns => {
+ columns.forEach((c, index) => {
+ if (c.dataIndex === "status" || c.dataIndex === "all_people" ||
+ c.dataIndex === "superior" || c.dataIndex === "all_superior") {
+ c.render = (text, record) => {
+ return (
+ {
+ this.changeSaveParams(record, value, c.dataIndex);
+ }}
+ />
+ );
+ };
+ } else if (c.dataIndex === "custom") {
+ c.render = (text, record) => {
+ const custom = record[c.dataIndex].split(",");
+ const customspan = record[`${c.dataIndex}span`].split(",");
+ const replaceDatas = _.map(custom, (item, index) => ({ id: custom[index], name: customspan[index] }));
+ return (
+ {
+ this.changeSaveParams(record, value, c.dataIndex);
+ }}
+ />
+ );
+ };
+ }
+ });
+ };
+
+ render() {
+ const { columnSetting } = this.props, { tableStore } = columnSetting;
+ return (
+
+ this.renderRenderColumns(c)}
+ onOperatesClick={(record, index, operate) =>
+ this.onOperatesClick(record, index, operate)}
+ />
+
+ );
+ }
+}
+
+export default PermissionItem;
diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js
index b766975..ab0ccab 100644
--- a/pc4mobx/organization/components/company/CompanyExtend.js
+++ b/pc4mobx/organization/components/company/CompanyExtend.js
@@ -1,22 +1,25 @@
/**
* @Author: 程亮
* @Date: 2022-05-18 14:52:39
- * @LastEditTime: 2022-05-26 17:11:02
- * @Description:
+ * @LastEditTime: 2023-08-04 16:52:47
+ * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
*/
-import { Button, Modal, message, Row, Col, Spin } from 'antd';
-import isEmpty from 'lodash/isEmpty'
+import { Button, Modal, message, Row, Col, Spin, Select,Tooltip } from 'antd';
+import { chunk,isEmpty } from 'lodash';
import cloneDeep from 'lodash/cloneDeep'
import forEach from 'lodash/forEach'
-import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab,WeaTop } from 'ecCom'
+import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop, WeaSlideModal } from 'ecCom'
import { WeaSwitch } from 'comsMobx';
import { inject, observer } from 'mobx-react';
import * as mobx from 'mobx';
import { i18n } from '../../public/i18n';
+import '../../style/common.less';
+import VersionsSlider from '../VersionsSlider';
const toJS = mobx.toJS;
import '../../style/common.less';
+import AttachToNumberField from "../NewNumberField";
@inject('companyExtend')
@@ -25,12 +28,17 @@ import '../../style/common.less';
export default class CompanyExtend extends React.Component {
componentDidMount() {
- this.init();
+ this.handleHashChange();
+ window.addEventListener('hashchange', this.handleHashChange);
}
- init = () => {
- const { companyExtend,company } = this.props;
- //const {id} = company;
- let {hash} = window.location;
+
+ componentWillUnmount() {
+ window.removeEventListener('hashchange', this.handleHashChange);
+ }
+
+ handleHashChange = () => {
+ const { companyExtend, company } = this.props;
+ let { hash } = window.location;
hash = hash.split("?")[0];
let id = hash.match("[^/]+(?=/$|$)")[0];
companyExtend.init();
@@ -40,14 +48,14 @@ export default class CompanyExtend extends React.Component {
getTabChildren = () => {
const { companyExtend } = this.props;
- let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = companyExtend;
+ let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = companyExtend;
let tabChildren = [];
tableInfo = toJS(tableInfo);
tableInfo && tableInfo.map((t, i) => {
if (detailSelectedKey == i) {
tabChildren.push(
companyExtend.setPersonalEditTables(ref)}
+ ref={(ref) => companyExtend.setPersonalEditTables(ref)}
showTitle={isEditor}
// title={'列表信息'}
//addFirstRow={isEditor}
@@ -122,9 +130,11 @@ export default class CompanyExtend extends React.Component {
label={`${field.label}`}
error={form.getError(field)}
tipPosition={tipPosition}
+ className={j === 1 && "minH5"}
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
+ {field.domkey[0] == 'subcompanycode' && isEditor &&}
),
colSpan: 1
});
@@ -176,6 +186,14 @@ export default class CompanyExtend extends React.Component {
this.editCard();
}
}
+ //, {
+ // icon: ,
+ // content: i18n.button.version(),
+ // key: 'view',
+ // onClick: key => {
+ // this.view();
+ // }
+ // }
]
}
}
@@ -189,6 +207,7 @@ export default class CompanyExtend extends React.Component {
const save = ;
const back = ;
const edit = ;
+ const view = ;
const btns = [];
try {
if (isEditor) {
@@ -199,6 +218,7 @@ export default class CompanyExtend extends React.Component {
} else {
if (buttons.hasEdit) {
btns.push(edit);
+ //btns.push(view);
}
}
} catch (e) { }
@@ -216,29 +236,32 @@ export default class CompanyExtend extends React.Component {
}
backCard = () => {
- this.init();
+ this.handleHashChange();
}
+ view = () => {
+ const { companyExtend } = this.props;
+ companyExtend.selectVersions();
+ }
+
+ onClose = () => {
+ const { companyExtend } = this.props;
+ companyExtend.open = false;
+ }
+
+
changeData(key) {
const {
companyExtend
} = this.props;
companyExtend.changeData(key);
-}
+ }
render() {
const { companyExtend } = this.props;
- const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey } = companyExtend;
+ const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey, isEditor, open, versionList } = companyExtend;
- // if(!hasRight && !loading){
- // return (
- //
- // {i18n.message.authFailed()}
- //
- // )
- // }
-
- try {
+ try {
return (
}
+ iconBgcolor='#217346'
buttons={this.getTopButtons()}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
@@ -273,9 +299,21 @@ export default class CompanyExtend extends React.Component {
}
+
+
+
+ companyExtend.changeVersion(val)}/> : 暂无历史版本
}
+ onClose={this.onClose}
+ onAnimationEnd={() => console.log('onAnimationEnd')} />