This commit is contained in:
parent
c52d10323a
commit
07dec3350f
|
|
@ -38,3 +38,17 @@ export const editResource = (params) => {
|
|||
export const getResourceExtendForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', 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);
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-02 09:20:03
|
||||
* @LastEditTime: 2022-06-22 16:54:39
|
||||
* @LastEditTime: 2022-06-29 17:42:27
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js
|
||||
*/
|
||||
|
|
@ -238,7 +238,7 @@ export default class DepartmentExtendStore extends React.Component {
|
|||
datas={this.getRightMenu()}
|
||||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
loading={true}
|
||||
loading={loading}
|
||||
title={isEditor ? i18n.label.editDept() : i18n.label.departmentInfo()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
|
|
|
|||
|
|
@ -91,17 +91,17 @@ export default class FieldDef extends Component {
|
|||
}
|
||||
}
|
||||
//人员卡片字段定义页面
|
||||
if (moduleName === 'resourcefielddefined') {
|
||||
if ((window.e9_locale.userLanguage == 7)) { //系统语言为中文
|
||||
Object.assign(tableProps.scroll, {
|
||||
x: 1200
|
||||
});
|
||||
} else {
|
||||
Object.assign(tableProps.scroll, {
|
||||
x: isJobTreeNode ? 1400 : 1900
|
||||
});
|
||||
}
|
||||
}
|
||||
// if (moduleName === 'resourcefielddefined') {
|
||||
// if ((window.e9_locale.userLanguage == 7)) { //系统语言为中文
|
||||
// Object.assign(tableProps.scroll, {
|
||||
// x: 1200
|
||||
// });
|
||||
// } else {
|
||||
// Object.assign(tableProps.scroll, {
|
||||
// x: isJobTreeNode ? 1400 : 1900
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)]
|
||||
|
|
|
|||
|
|
@ -269,7 +269,6 @@ export default class DatasImport extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
debugger
|
||||
const {
|
||||
datasImport,
|
||||
mainTitle,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import {
|
|||
WeaRightMenu,
|
||||
WeaLeftRightLayout,
|
||||
WeaOrgTree,
|
||||
WeaDropdown
|
||||
} from 'ecCom'
|
||||
import {
|
||||
Row,
|
||||
|
|
@ -34,14 +35,14 @@ import '../../style/common.less';
|
|||
|
||||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
import { renderNoright } from '../../util';
|
||||
import DatasImport from '../import/datasImport';
|
||||
import DatasImport from '../import/datasImport';
|
||||
|
||||
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
const confirm = Modal.confirm;
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
const { ButtonSelect } = WeaDropdown;
|
||||
|
||||
@inject('resource')
|
||||
@inject('datasImport')
|
||||
|
|
@ -125,6 +126,28 @@ export default class Resource extends React.Component {
|
|||
|
||||
});
|
||||
|
||||
const datas = [
|
||||
{
|
||||
key: "1", show: (<span>全部导出</span>), text: "全部导出", selected: true
|
||||
},
|
||||
|
||||
{
|
||||
key: "2", show: (<span>批量导出</span>), text: "批量导出"
|
||||
}
|
||||
];
|
||||
btns.push(<ButtonSelect
|
||||
datas={datas}
|
||||
btnOnClick={key => {
|
||||
if (key == "1") {
|
||||
resource.export();
|
||||
}
|
||||
if(key == "2") {
|
||||
tableStore.selectedRowKeys.length > 0 ? resource.export() : message.error("请选择需要导出的数据")
|
||||
}
|
||||
}}
|
||||
//menuOnClick={(key, e) => console.log("选择了按钮:", e)}
|
||||
/>)
|
||||
|
||||
return btns;
|
||||
}
|
||||
|
||||
|
|
@ -161,6 +184,7 @@ export default class Resource extends React.Component {
|
|||
datasImport.getImportForm();
|
||||
}
|
||||
|
||||
|
||||
batchDelete() {
|
||||
const {
|
||||
resource
|
||||
|
|
@ -334,7 +358,7 @@ export default class Resource extends React.Component {
|
|||
}
|
||||
|
||||
handleSaveAndSetting() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
getPanelComponents() {
|
||||
|
|
@ -402,8 +426,8 @@ export default class Resource extends React.Component {
|
|||
resource
|
||||
} = this.props;
|
||||
const {
|
||||
isPanelShow, form2, schemeName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||
form, dialogLoading, isEdit, date, hasRight,defaultShowLeft
|
||||
isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition,
|
||||
form, dialogLoading, isEdit, date, hasRight, defaultShowLeft
|
||||
} = resource;
|
||||
|
||||
if (hasRight === false) {
|
||||
|
|
@ -431,7 +455,7 @@ export default class Resource extends React.Component {
|
|||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
searchType={['base', 'advanced']}
|
||||
showSearchAd={isPanelShow}
|
||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? schemeName : form2.getFormParams().schemeName}
|
||||
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? lastName : form2.getFormParams().lastName}
|
||||
setShowSearchAd={bool => resource.setPanelStatus(bool)}
|
||||
hideSearchAd={() => resource.setPanelStatus(false)}
|
||||
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
|
||||
|
|
@ -463,7 +487,7 @@ export default class Resource extends React.Component {
|
|||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => resource.setVisible(false)}
|
||||
saveAndSetting = {() => this.handleSaveAndSetting()}
|
||||
saveAndSetting={() => this.handleSaveAndSetting()}
|
||||
/>
|
||||
<DatasImport ecId={`${this && this.props && this.props.ecId || ''}_DatasImport@q4rrwm`} />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -233,5 +233,8 @@ export class CompanyExtendStore {
|
|||
this.buttons = buttons;
|
||||
}
|
||||
|
||||
setDate(date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ export class DepartmentExtendStore {
|
|||
save = () => {
|
||||
if (this.loading)
|
||||
return;
|
||||
this.loading = true;
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.loading = true;
|
||||
if (this.personalEditTables) {
|
||||
const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas,
|
||||
isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true
|
||||
|
|
@ -231,5 +231,9 @@ export class DepartmentExtendStore {
|
|||
this.buttons = buttons;
|
||||
}
|
||||
|
||||
setDate(date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-09 10:16:00
|
||||
* @LastEditTime: 2022-06-27 15:32:03
|
||||
* @LastEditTime: 2022-06-29 17:23:37
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js
|
||||
*/
|
||||
|
|
@ -300,40 +300,40 @@ export class FieldDefinedStore extends HrmBaseStore {
|
|||
}];
|
||||
|
||||
//人员卡片字段定义-添加【允许个人修改】列
|
||||
if (this.moduleName === 'resourcefielddefined') {
|
||||
if (this.isJobTreeNode) {//【工作信息】列表不添加【允许个人修改】列
|
||||
} else {
|
||||
columns.push({
|
||||
title: getLabel(510359, '允许个人修改'),
|
||||
dataIndex: 'isModify',
|
||||
key: 'isModify',
|
||||
checkType: 'checkbox',
|
||||
colSpan: 1,
|
||||
width: '11%'
|
||||
});
|
||||
}
|
||||
}
|
||||
this.encryptEnable && columns.push({
|
||||
title: getLabel('526997', '加密设置'),
|
||||
dataIndex: 'canEncrypt',
|
||||
key: 'canEncrypt',
|
||||
com: [
|
||||
{
|
||||
type: 'custom',
|
||||
key: 'custom',
|
||||
render: (text, record, index, onEdit) => {
|
||||
const { canEncrypt } = record;
|
||||
if (canEncrypt == '1')
|
||||
return (
|
||||
<a onClick={() => this.onEncryptHandle(record)}>{getLabel('526997', '加密设置')}</a>
|
||||
)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
],
|
||||
colSpan: 1,
|
||||
width: '8%'
|
||||
});
|
||||
// if (this.moduleName === 'resourcefielddefined') {
|
||||
// if (this.isJobTreeNode) {//【工作信息】列表不添加【允许个人修改】列
|
||||
// } else {
|
||||
// columns.push({
|
||||
// title: getLabel(510359, '允许个人修改'),
|
||||
// dataIndex: 'isModify',
|
||||
// key: 'isModify',
|
||||
// checkType: 'checkbox',
|
||||
// colSpan: 1,
|
||||
// width: '11%'
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// this.encryptEnable && columns.push({
|
||||
// title: getLabel('526997', '加密设置'),
|
||||
// dataIndex: 'canEncrypt',
|
||||
// key: 'canEncrypt',
|
||||
// com: [
|
||||
// {
|
||||
// type: 'custom',
|
||||
// key: 'custom',
|
||||
// render: (text, record, index, onEdit) => {
|
||||
// const { canEncrypt } = record;
|
||||
// if (canEncrypt == '1')
|
||||
// return (
|
||||
// <a onClick={() => this.onEncryptHandle(record)}>{getLabel('526997', '加密设置')}</a>
|
||||
// )
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// colSpan: 1,
|
||||
// width: '8%'
|
||||
// });
|
||||
return columns;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ export class JobExtendStore {
|
|||
save = () => {
|
||||
if (this.loading)
|
||||
return;
|
||||
this.loading = true;
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.loading = true;
|
||||
if (this.personalEditTables) {
|
||||
const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas,
|
||||
isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true
|
||||
|
|
@ -80,7 +80,8 @@ export class JobExtendStore {
|
|||
|
||||
editResource = () => {
|
||||
let pDatas = this.form.getFormParams();
|
||||
Api.editResource({ ...{
|
||||
Api.editResource({
|
||||
...{
|
||||
id: this.id
|
||||
},
|
||||
...pDatas,
|
||||
|
|
@ -124,7 +125,7 @@ export class JobExtendStore {
|
|||
let params = {
|
||||
viewAttr: this.isEditor ? 2 : 1,
|
||||
id: this.id,
|
||||
viewCondition:this.selectedKey
|
||||
viewCondition: this.selectedKey
|
||||
}
|
||||
Api.getJobExtendForm(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
|
@ -144,7 +145,7 @@ export class JobExtendStore {
|
|||
message.warning(error.msg);
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -183,7 +184,7 @@ export class JobExtendStore {
|
|||
this.tabKey = key;
|
||||
}
|
||||
|
||||
updateDetailSelectedKey =(key) => {
|
||||
updateDetailSelectedKey = (key) => {
|
||||
this.detailSelectedKey = key;
|
||||
}
|
||||
|
||||
|
|
@ -235,5 +236,9 @@ export class JobExtendStore {
|
|||
this.buttons = buttons;
|
||||
}
|
||||
|
||||
setDate(date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import {
|
|||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
import {getSecondPath} from '../util/index'
|
||||
|
||||
const toJS = mobx.toJS;
|
||||
const {
|
||||
|
|
@ -173,6 +174,13 @@ const {
|
|||
})
|
||||
}
|
||||
|
||||
@action export(){
|
||||
const params = {
|
||||
...this.form.getFormParams()
|
||||
}
|
||||
Api.exportResource(toJS(this.tableStore.selectedRowKeys).toString());
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form2.updateFields({
|
||||
schemeName: {
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ export class ResourceExtendStore {
|
|||
save = () => {
|
||||
if (this.loading)
|
||||
return;
|
||||
this.loading = true;
|
||||
this.form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
this.loading = true;
|
||||
if (this.personalEditTables) {
|
||||
const targetDatas = this.tableInfo[this.detailSelectedKey].tabinfo.datas,
|
||||
isPass = (targetDatas.length > 0) ? this.personalEditTables.refs.edit.doRequiredCheck().pass : true
|
||||
|
|
|
|||
|
|
@ -148,4 +148,27 @@ export const validDBKeys = (value) => {
|
|||
isValid: true,
|
||||
value
|
||||
};
|
||||
}
|
||||
|
||||
//二级路径加前缀
|
||||
export const getSecondPath=(url)=>{
|
||||
const ecologyContentPath = window.ecologyContentPath||"";//二级路径
|
||||
if(ecologyContentPath!="" && url && url!=""){
|
||||
if(url.startsWith("/")){
|
||||
if(!url.startsWith(ecologyContentPath)){
|
||||
url = ecologyContentPath+url;
|
||||
}
|
||||
}else if(url.startsWith("http")){
|
||||
let origin = window.location.origin;
|
||||
if(!origin){
|
||||
origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
|
||||
}
|
||||
if(url.startsWith(origin) && !url.startsWith(origin+ecologyContentPath)){
|
||||
url = url.replace(origin,origin+ecologyContentPath);
|
||||
}
|
||||
}else {
|
||||
url = ecologyContentPath+"/"+url;
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
Loading…
Reference in New Issue