From 72263eb5f74d5cfee2d2ffe466ceca7d11d1d066 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 16 Dec 2022 16:06:51 +0800 Subject: [PATCH] resolve --- pc4mobx/organization/apis/resource.js | 4 --- pc4mobx/organization/apis/resourceCard.js | 5 ++++ .../components/company/company.js | 4 +-- .../components/department/department.js | 4 +-- .../components/department/departmentExtend.js | 7 ++++- .../components/resource/FormItem.js | 2 +- .../components/resource/ResourceCard.js | 30 +++++++++++++++++-- .../organization/stores/departmentextend.js | 3 +- pc4mobx/organization/stores/resourceCard.js | 30 +++++++++++++++++++ 9 files changed, 76 insertions(+), 13 deletions(-) diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index ae91703..d7d1e33 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -43,10 +43,6 @@ export const version = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/save', 'POST', params); } -export const selectVersions = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/getVersion', 'GET', params); -} - export const exportResource = (ids) => { fetch('/api/bs/hrmorganization/common/resource/export?ids='+ids).then(res => res.blob().then(blob => { var filename=`人员档案.xlsx` diff --git a/pc4mobx/organization/apis/resourceCard.js b/pc4mobx/organization/apis/resourceCard.js index 6f49c60..d82035c 100644 --- a/pc4mobx/organization/apis/resourceCard.js +++ b/pc4mobx/organization/apis/resourceCard.js @@ -6,3 +6,8 @@ import { 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/company/company.js b/pc4mobx/organization/components/company/company.js index 5206db1..e34e2c7 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-12-14 13:54:24 + * @LastEditTime: 2022-12-16 15:45:59 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -615,7 +615,7 @@ export default class Company extends React.Component { isFormInit={form1.isFormInit} loading={dialogLoading} isEdit={isEdit} - height={380} + height={350} conditionLen={1} save={() => this.handleSave()} onCancel={() => company.setNewVisible(false)} diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index a40e10e..b54d10a 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-12-14 14:03:50 + * @LastEditTime: 2022-12-16 15:45:48 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -724,7 +724,7 @@ export default class Department extends React.Component { isFormInit={form1.isFormInit} loading={confirmLoading} height={100} - width={400} + width={350} isMerge={isMerge} defaultValue={"0"} save={() => this.PopconfirmSave()} diff --git a/pc4mobx/organization/components/department/departmentExtend.js b/pc4mobx/organization/components/department/departmentExtend.js index cbba14c..49ada80 100644 --- a/pc4mobx/organization/components/department/departmentExtend.js +++ b/pc4mobx/organization/components/department/departmentExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:20:03 - * @LastEditTime: 2022-12-15 19:28:54 + * @LastEditTime: 2022-12-16 11:18:42 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js */ @@ -46,6 +46,11 @@ export default class DepartmentExtendStore extends React.Component { departmentExtend.selectVersions(); } + onClose = () => { + const { departmentExtend } = this.props; + departmentExtend.open = false; + } + getTabChildren = () => { const { departmentExtend } = this.props; let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = departmentExtend; diff --git a/pc4mobx/organization/components/resource/FormItem.js b/pc4mobx/organization/components/resource/FormItem.js index 3cd945c..e52ca52 100644 --- a/pc4mobx/organization/components/resource/FormItem.js +++ b/pc4mobx/organization/components/resource/FormItem.js @@ -124,7 +124,7 @@ export default class FormItem extends React.Component { {subItem.fieldId} {subItem.fieldValue.length > 10 ? {subItem.fieldValue} - : } + : {subItem.fieldValue}} diff --git a/pc4mobx/organization/components/resource/ResourceCard.js b/pc4mobx/organization/components/resource/ResourceCard.js index 0464c11..c734c5d 100644 --- a/pc4mobx/organization/components/resource/ResourceCard.js +++ b/pc4mobx/organization/components/resource/ResourceCard.js @@ -10,7 +10,8 @@ import { WeaFormItem, WeaRightMenu, WeaAlertPage, - WeaNewScrollPagination + WeaNewScrollPagination, + WeaSlideModal } from 'ecCom' import { Row, @@ -36,6 +37,9 @@ import FormItem from './FormItem'; import IframeItem from './IframeItem'; import AnchorDetect from './AnchorDetect'; import { renderNoright } from '../../util'; // 从util文件引入公共的方法 +import VersionsSlider from '../VersionsSlider'; +import isEmpty from 'lodash/isEmpty' + const toJS = mobx.toJS; const confirm = Modal.confirm; @@ -133,6 +137,16 @@ export default class ResourceCard extends React.Component { window.open(e.item.props.url,"_blank") } + view = () => { + const { resourceCard } = this.props; + resourceCard.selectVersions(); + } + + onClose = () => { + const { resourceCard } = this.props; + resourceCard.open = false; + } + onScroll = (event) => { const { resourceCard @@ -188,7 +202,9 @@ export default class ResourceCard extends React.Component { offset, overtime, intervalTime, - data + data, + versionList, + open } = resourceCard; const menu = ( @@ -238,6 +254,7 @@ export default class ResourceCard extends React.Component {
+ { data.buttons.slice(0,3).map((item,index) => { return ( @@ -319,6 +336,15 @@ export default class ResourceCard extends React.Component {
+ departmentExtend.changeVersion(val)}/> :
暂无历史版本
} + onClose={this.onClose} + onAnimationEnd={() => console.log('onAnimationEnd')} /> ) } diff --git a/pc4mobx/organization/stores/departmentextend.js b/pc4mobx/organization/stores/departmentextend.js index 2ca96e0..ffacc2e 100644 --- a/pc4mobx/organization/stores/departmentextend.js +++ b/pc4mobx/organization/stores/departmentextend.js @@ -189,7 +189,8 @@ export class DepartmentExtendStore { } changeVersion = data => { - debugger + this.version = data; + this.selectVersions(); } diff --git a/pc4mobx/organization/stores/resourceCard.js b/pc4mobx/organization/stores/resourceCard.js index af71ec6..a1d8b14 100644 --- a/pc4mobx/organization/stores/resourceCard.js +++ b/pc4mobx/organization/stores/resourceCard.js @@ -17,6 +17,10 @@ export class ResourceCardStore { @observable detectElements = [] // 受监控元素,可能存在空项 @observable flag = true; // 点击Anchor菜单项,不执行监听滚动事件 + @observable open = false; + @observable version = '1.0'; + @observable versionList = {}; + @action("初始化") init = () => { //const { userid } = JSON.parse(localStorage.getItem("theme-account")); this.getCardData(); @@ -36,6 +40,23 @@ export class ResourceCardStore { }) } + @action("历史版本") selectVersions = () => { + let params = { + id:this.userid, + version:this.version + } + Api.selectVersions(params).then((res) => { + this.open = true; + if (res.code === 200) { + this.setVersionList(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + buildDetectElements = (data) => { !this.isEmptyObject(data) && data.anchorList.map((item, index) => { item.activity = index; @@ -51,6 +72,11 @@ export class ResourceCardStore { return true; } + changeVersion = data => { + this.version = data; + this.selectVersions(); + } + setData(value){ this.data = value; @@ -60,6 +86,10 @@ export class ResourceCardStore { setDetectElements(value) { this.detectElements = value; } + + setVersionList(obj) { + this.versionList = obj; + } /************** json数据*****************/ // @observable data = { // buttons:[