From bf30163bb5e4e290a36ee14760f25669504d8215 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Sun, 29 Jan 2023 16:41:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84=E5=BF=AB?= =?UTF-8?q?=E7=85=A70?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/snapshot.js | 7 + .../components/snapshot/Snapshot.js | 225 ++++++++++++++++++ pc4mobx/organization/index.js | 5 +- pc4mobx/organization/stores/index.js | 7 +- pc4mobx/organization/stores/snapshot.js | 84 +++++++ 5 files changed, 324 insertions(+), 4 deletions(-) create mode 100644 pc4mobx/organization/apis/snapshot.js create mode 100644 pc4mobx/organization/components/snapshot/Snapshot.js create mode 100644 pc4mobx/organization/stores/snapshot.js diff --git a/pc4mobx/organization/apis/snapshot.js b/pc4mobx/organization/apis/snapshot.js new file mode 100644 index 0000000..6ce2aba --- /dev/null +++ b/pc4mobx/organization/apis/snapshot.js @@ -0,0 +1,7 @@ +import { + WeaTools +} from 'ecCom' + +export const getSearchList = (date) => { + return WeaTools.callApi(`/api/bs/hrmorganization/danikorresource/listPage?syncDate=${date}`, 'GET'); +} \ No newline at end of file diff --git a/pc4mobx/organization/components/snapshot/Snapshot.js b/pc4mobx/organization/components/snapshot/Snapshot.js new file mode 100644 index 0000000..fc1e383 --- /dev/null +++ b/pc4mobx/organization/components/snapshot/Snapshot.js @@ -0,0 +1,225 @@ +import React from 'react' +import * as mobx from 'mobx' +import { + inject, + observer +} from 'mobx-react' +import { + WeaTop, + WeaTab, + WeaFormItem, + WeaRightMenu, + WeaAlertPage, + WeaDatePicker +} from 'ecCom' +import { + Row, + Col, + Spin, + Modal, + Button, + message, + Switch +} from 'antd' +import { + WeaSwitch, + WeaTableNew +} from 'comsMobx' +import { + i18n +} from '../../public/i18n'; +import { renderNoright } from '../../util'; + +const toJS = mobx.toJS; +const confirm = Modal.confirm; +const WeaTable = WeaTableNew.WeaTable; + + +@inject('snapshot') +@observer +export default class Snapshot extends React.Component { + constructor(props) { + super(props); + } + + componentWillMount() { + } + + componentDidMount() { + this.init(); + } + + componentWillUnmount() { + } + + + componentWillReceiveProps(nextProps) { + const { + snapshot + } = this.props; + + if (this.props.location.key !== nextProps.location.key) { + this.init(); + } + } + + init() { + const { + snapshot + } = this.props; + snapshot.getDatas(); + snapshot.getTableInfo(); + } + + getTopMenuBtns() { + const { + snapshot + } = this.props; + const { + topMenu, + } = snapshot; + + let btns = []; + topMenu.map((item, i) => { + btns.push(); + }); + + return btns; + } + + handleClick(item) { + this[item.menuFun] && this[item.menuFun](); + } + + + + getDropMenuDatas() { + const { + snapshot + } = this.props; + const { + rightMenu + } = snapshot; + + let menus = []; + toJS(rightMenu).map((item, index) => { + let obj = { + key: item.menuFun, + icon: , + content: item.menuName, + } + if (item.menuFun == 'collection' || item.menuFun == 'help' || item.menuFun == 'pageAddress') { + obj.disabled = true; + } + menus.push(obj); + }) + return menus; + } + + handleMenuClick(key) { + this[key] && this[key](); + } + + custom = () => { + const { + snapshot + } = this.props, { + tableStore, + } = snapshot; + + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + } + + + reRenderColumns(columns) { + columns.forEach((c, index) => { + + }) + } + + + //非空判断 + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + + + + render() { + + const { + snapshot + } = this.props; + const { + tableStore, date, hasRight,datas + } = snapshot; + + if (hasRight === false) { + return renderNoright(); + } + + const tabStyle = { + height: "40px", + textAlign: "center", + lineHeight: "40px", + color: "#4472c4", + fontWeight: 900, + fontSize: "16px" + } + const width = tableStore.columns.filter(c => c.display === "true").length * 50; + + return ( + hasRight &&