2022-06-20 17:08:10 +08:00
|
|
|
import {
|
|
|
|
|
observable,
|
2023-01-06 18:01:46 +08:00
|
|
|
action,
|
2023-01-11 18:22:30 +08:00
|
|
|
computed,
|
|
|
|
|
extendObservable
|
2022-06-20 17:08:10 +08:00
|
|
|
} from 'mobx';
|
|
|
|
|
import * as mobx from 'mobx';
|
|
|
|
|
import * as Api from '../apis/resource'; // 引入API接口文件
|
|
|
|
|
import {
|
2023-01-10 18:23:25 +08:00
|
|
|
WeaForm, WeaTableNew
|
2022-06-20 17:08:10 +08:00
|
|
|
} from 'comsMobx';
|
|
|
|
|
import {
|
|
|
|
|
Modal,
|
|
|
|
|
message,
|
2023-01-05 18:02:33 +08:00
|
|
|
Button
|
2022-06-20 17:08:10 +08:00
|
|
|
} from 'antd'
|
2023-01-06 18:01:46 +08:00
|
|
|
import {
|
2023-01-10 18:23:25 +08:00
|
|
|
WeaSelect,
|
|
|
|
|
WeaInputSearch,
|
|
|
|
|
WeaLocaleProvider,
|
2023-01-06 18:01:46 +08:00
|
|
|
} from 'ecCom';
|
2022-06-20 17:08:10 +08:00
|
|
|
import {
|
|
|
|
|
i18n
|
|
|
|
|
} from '../public/i18n';
|
2023-01-10 18:23:25 +08:00
|
|
|
import { getSecondPath } from '../util/index'
|
2023-08-08 14:28:49 +08:00
|
|
|
import { cloneDeep, isEmpty, trim } from 'lodash';
|
2024-07-25 18:50:53 +08:00
|
|
|
import HrmBaseStore from './baseStore';
|
|
|
|
|
|
2023-01-06 18:01:46 +08:00
|
|
|
|
2024-06-14 16:25:07 +08:00
|
|
|
const getLabel = WeaLocaleProvider.getLabel;
|
2022-06-20 17:08:10 +08:00
|
|
|
const toJS = mobx.toJS;
|
|
|
|
|
const {
|
|
|
|
|
TableStore
|
|
|
|
|
} = WeaTableNew;
|
2023-01-10 18:23:25 +08:00
|
|
|
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
export class ResourceStore extends HrmBaseStore{
|
2022-06-20 17:08:10 +08:00
|
|
|
@observable tableStore = new TableStore();
|
|
|
|
|
@observable topMenu = []
|
|
|
|
|
@observable rightMenu = [];
|
|
|
|
|
@observable condition = [];
|
|
|
|
|
@observable searchCondition = [];
|
2023-01-06 18:01:46 +08:00
|
|
|
@observable defaultCondition = [];
|
2022-06-20 17:08:10 +08:00
|
|
|
@observable isEdit = true;
|
|
|
|
|
@observable isNew = true;
|
|
|
|
|
@observable isPanelShow = false; //高级搜索面板
|
|
|
|
|
@observable form2 = new WeaForm();
|
|
|
|
|
@observable form = new WeaForm();
|
2022-10-21 17:51:28 +08:00
|
|
|
@observable lastName = '';
|
2024-07-30 16:22:54 +08:00
|
|
|
@observable isBaseValue = true;
|
|
|
|
|
|
2022-06-22 10:28:25 +08:00
|
|
|
@observable conditionNum = 8;
|
2022-06-20 17:08:10 +08:00
|
|
|
@observable ids = ''; //选择行id
|
2023-01-10 18:23:25 +08:00
|
|
|
@observable searchConditionLoading = false;
|
2022-06-20 17:08:10 +08:00
|
|
|
@observable nEdialogTitle = '';
|
|
|
|
|
@observable visible = false;
|
|
|
|
|
@observable dialogLoading = true;
|
2022-10-25 17:50:10 +08:00
|
|
|
@observable userId = '';
|
2022-06-20 17:08:10 +08:00
|
|
|
@observable date = '';
|
2024-05-08 16:35:18 +08:00
|
|
|
@observable exSpinning = false;
|
2022-06-20 17:08:10 +08:00
|
|
|
|
|
|
|
|
@observable defaultShowLeft = true;
|
|
|
|
|
@observable companysId = 1
|
2022-10-21 17:51:28 +08:00
|
|
|
@observable hasRight = '';
|
2024-07-25 18:50:53 +08:00
|
|
|
@observable loginId = '';
|
2022-10-21 17:51:28 +08:00
|
|
|
|
|
|
|
|
@observable selectTreeNodeInfo;
|
2024-12-10 17:05:42 +08:00
|
|
|
@observable url = '';
|
2023-01-10 18:23:25 +08:00
|
|
|
|
2023-08-16 13:58:08 +08:00
|
|
|
@observable enable = false;
|
2024-05-08 16:35:18 +08:00
|
|
|
@observable _showRadioGroup = false;
|
2024-06-11 18:55:29 +08:00
|
|
|
@computed get showRadioGroup() {
|
|
|
|
|
return this._showRadioGroup
|
|
|
|
|
}
|
2023-08-08 14:28:49 +08:00
|
|
|
set showRadioGroup(v) {
|
|
|
|
|
this._showRadioGroup = v;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.reCalculateTableHeight = new Date().getTime();
|
|
|
|
|
}, 0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
domRef = {};
|
|
|
|
|
@observable _reCalculateTableHeight = new Date().getTime();
|
2024-06-11 18:55:29 +08:00
|
|
|
@computed get reCalculateTableHeight() {
|
|
|
|
|
return this._reCalculateTableHeight
|
|
|
|
|
}
|
|
|
|
|
set reCalculateTableHeight(v) {
|
|
|
|
|
this._reCalculateTableHeight = v
|
|
|
|
|
}
|
2023-08-08 14:28:49 +08:00
|
|
|
@computed get tableHeihgt() {
|
|
|
|
|
this.reCalculateTableHeight;
|
|
|
|
|
const topHeight = this.domRef.top && this.domRef.top.refs.content ? this.domRef.top.refs.content.clientHeight : 0;
|
|
|
|
|
const tabHeight = this.domRef.tab ? $(this.domRef.tab)[0].clientHeight : 0;
|
|
|
|
|
const h = topHeight - tabHeight;
|
|
|
|
|
return h <= 0 ? 0 : h;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@action setDomRef = (dom, type) => {
|
|
|
|
|
dom && Object.assign(this.domRef, { [type]: dom }) && setTimeout(() => this.reCalculateTableHeight = new Date().getTime(), 500);
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-16 13:58:08 +08:00
|
|
|
@observable rangeConditions = [];
|
|
|
|
|
@observable radioParams = {};
|
|
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
@observable refreshRadioGroup = new Date().getTime();
|
|
|
|
|
@computed get radioGroupConfig(){
|
|
|
|
|
this.refreshRadioGroup;
|
|
|
|
|
return {
|
|
|
|
|
config: [
|
|
|
|
|
...this.rangeConditions
|
|
|
|
|
],
|
|
|
|
|
key: new Date().getTime(),
|
|
|
|
|
onChange: this.onRadioGroupChangeHandle
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@action onRadioGroupChangeHandle = params => {
|
2023-08-16 13:58:08 +08:00
|
|
|
this.radioParams = params;
|
2024-07-25 18:50:53 +08:00
|
|
|
this.form2.reset();
|
2023-08-16 13:58:08 +08:00
|
|
|
this.getTableInfo();
|
2023-08-08 14:28:49 +08:00
|
|
|
}
|
|
|
|
|
|
2023-01-10 18:23:25 +08:00
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
@action("列表") getTableInfo() {
|
2022-06-20 17:08:10 +08:00
|
|
|
this.tableStore = new TableStore();
|
2023-08-16 13:58:08 +08:00
|
|
|
let params = {};
|
|
|
|
|
if(this.isEmptyObject(this.radioParams)) {
|
2022-06-20 17:08:10 +08:00
|
|
|
params = {
|
2024-07-25 18:50:53 +08:00
|
|
|
isQuickSearch:false,
|
2022-10-21 17:51:28 +08:00
|
|
|
...this.selectTreeNodeInfo,
|
2024-07-30 16:22:54 +08:00
|
|
|
|
2023-08-16 13:58:08 +08:00
|
|
|
}
|
2024-07-30 16:22:54 +08:00
|
|
|
//外部INPUT搜索
|
|
|
|
|
if (this.isBaseValue) {
|
2023-08-16 13:58:08 +08:00
|
|
|
params = {
|
|
|
|
|
...params,
|
2024-07-30 16:22:54 +08:00
|
|
|
lastName: this.lastName
|
2023-08-16 13:58:08 +08:00
|
|
|
};
|
2024-07-30 16:22:54 +08:00
|
|
|
}else {
|
2023-08-16 13:58:08 +08:00
|
|
|
params = {
|
|
|
|
|
...params,
|
2024-07-30 16:22:54 +08:00
|
|
|
...this.form2.getFormParams(),
|
2023-08-16 13:58:08 +08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}else {
|
2022-06-20 17:08:10 +08:00
|
|
|
params = {
|
2023-08-16 13:58:08 +08:00
|
|
|
...this.radioParams,
|
2022-10-21 17:51:28 +08:00
|
|
|
...this.selectTreeNodeInfo,
|
2023-08-16 13:58:08 +08:00
|
|
|
isQuickSearch:true
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
}
|
2024-07-25 18:50:53 +08:00
|
|
|
//this.form2.resetForm();
|
2022-06-20 17:08:10 +08:00
|
|
|
Api.getSearchList(params).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
2022-10-21 17:51:28 +08:00
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2022-10-21 17:51:28 +08:00
|
|
|
@action("nodetree事件") doSearch(params) {
|
2023-01-10 18:23:25 +08:00
|
|
|
this.selectTreeNodeInfo = params;
|
2023-08-16 13:58:08 +08:00
|
|
|
this.showRadioGroup = true;
|
2023-01-10 18:23:25 +08:00
|
|
|
this.getTableInfo();
|
2022-06-20 17:08:10 +08:00
|
|
|
}
|
|
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
@action("保存") save() {
|
2022-06-20 17:08:10 +08:00
|
|
|
let params = {
|
|
|
|
|
...this.form.getFormParams()
|
|
|
|
|
};
|
|
|
|
|
this.form.validateForm().then(f => {
|
|
|
|
|
if (f.isValid) {
|
|
|
|
|
Api.add(params).then(response => {
|
|
|
|
|
return response.json()
|
|
|
|
|
}).then(data => {
|
|
|
|
|
if (data.code === 200) {
|
2023-08-16 13:58:08 +08:00
|
|
|
message.success(data.msg,1);
|
2022-06-20 17:08:10 +08:00
|
|
|
this.getTableInfo();
|
|
|
|
|
this.setVisible(false);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(data.msg);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
f.showErrors();
|
|
|
|
|
this.setDate(new Date());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
@action("新增表单") getForm() {
|
2022-06-20 17:08:10 +08:00
|
|
|
let params = this.isNew ? {} : {
|
2022-10-25 17:50:10 +08:00
|
|
|
id: this.userId
|
2022-06-20 17:08:10 +08:00
|
|
|
}
|
|
|
|
|
this.setDialogLoadingStatus(true);
|
|
|
|
|
|
|
|
|
|
Api.getSchemeForm(params).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.setDialogLoadingStatus(false);
|
|
|
|
|
res.data.condition && this.setCondition(res.data.condition);
|
|
|
|
|
res.data.condition && this.form.initFormFields(res.data.condition);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-16 13:58:08 +08:00
|
|
|
@action("快捷搜索") getQuickSearchCondition() {
|
|
|
|
|
Api.getQuickSearchCondition().then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.rangeConditions = res.data.rangeConditions;
|
|
|
|
|
this.enable = res.data.enable;
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
@action("顶部按钮") getHasRight() {
|
2022-06-20 17:08:10 +08:00
|
|
|
Api.getHasRight().then(res => {
|
|
|
|
|
if (res.code === 200) {
|
2022-10-21 17:51:28 +08:00
|
|
|
this.setHasRight(res.data.hasRight);
|
2024-07-25 18:50:53 +08:00
|
|
|
this.loginId = res.data.loginId;
|
|
|
|
|
this.customTemplateId = res.data.customTemplateId;
|
|
|
|
|
this.searchTemplateId = res.data.searchTemplateId;
|
2022-06-20 17:08:10 +08:00
|
|
|
res.data.rightMenu && this.setRightMenu(res.data.rightMenu);
|
|
|
|
|
res.data.topMenu && this.setTopMenu(res.data.topMenu);
|
2024-07-25 18:50:53 +08:00
|
|
|
//1.获取高级搜索内容
|
|
|
|
|
this.getHSearchTemplate(res.data.searchTemplateId);
|
|
|
|
|
//2.获取列定制内容
|
|
|
|
|
this.getSearchTemplate(res.data.customTemplateId);
|
2024-12-10 17:05:42 +08:00
|
|
|
let url = '/spa/organization/static/index.html#/main/organization/resourceCard/';
|
|
|
|
|
if(res.data.cardType == "2") {
|
|
|
|
|
url = '/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/';
|
|
|
|
|
}
|
|
|
|
|
this.url = url;
|
2022-06-20 17:08:10 +08:00
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-08 16:35:18 +08:00
|
|
|
@action("导出") async export() {
|
2022-06-29 18:37:25 +08:00
|
|
|
const params = {
|
|
|
|
|
...this.form.getFormParams()
|
|
|
|
|
}
|
2024-05-08 16:35:18 +08:00
|
|
|
this.exSpinning = true;
|
2024-05-17 16:04:15 +08:00
|
|
|
await Api.exportResource(toJS(this.tableStore.selectedRowKeysAllPages).toString());
|
2024-05-08 16:35:18 +08:00
|
|
|
this.exSpinning = false;
|
2022-06-30 17:14:04 +08:00
|
|
|
this.tableStore.selectedRowKeys = [];
|
2024-05-08 16:35:18 +08:00
|
|
|
|
2022-06-29 18:37:25 +08:00
|
|
|
}
|
|
|
|
|
|
2022-12-14 16:17:15 +08:00
|
|
|
@action("另存为版本") version(id) {
|
2023-01-10 18:23:25 +08:00
|
|
|
Api.version({ id: id }).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
message.success(res.msg);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
2022-12-09 14:47:19 +08:00
|
|
|
}, error => {
|
2023-01-10 18:23:25 +08:00
|
|
|
message.warning(error.msg);
|
2022-12-09 14:47:19 +08:00
|
|
|
})
|
2023-01-05 18:02:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-01-10 18:23:25 +08:00
|
|
|
/** ============================================================================================= */
|
2023-01-13 14:37:03 +08:00
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
@observable searchDialog = {
|
2023-01-10 18:23:25 +08:00
|
|
|
visible: false,
|
2024-07-25 18:50:53 +08:00
|
|
|
loading: false
|
2023-01-10 18:23:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@observable templates = [];
|
2023-01-13 14:37:03 +08:00
|
|
|
@observable customTemplates = [];
|
2023-01-10 18:23:25 +08:00
|
|
|
@observable searchTemplateName = '';
|
2024-07-15 16:59:03 +08:00
|
|
|
@observable searchTemplateId = "-1";
|
2023-01-11 18:22:30 +08:00
|
|
|
@observable customTemplateName = '';
|
|
|
|
|
@observable customTemplateId = '-1';
|
2023-01-05 18:02:33 +08:00
|
|
|
|
2023-01-10 18:23:25 +08:00
|
|
|
@observable search = false;
|
2023-01-05 18:02:33 +08:00
|
|
|
SEARCHDIALOG = {
|
2023-01-10 18:23:25 +08:00
|
|
|
hasScroll: false,
|
|
|
|
|
icon: 'icon-coms-hrm',
|
|
|
|
|
iconBgcolor: '#217346',
|
|
|
|
|
onCancel: () => this.closeSearchDialog(),
|
|
|
|
|
style: {
|
|
|
|
|
width: 700,
|
|
|
|
|
height: 450
|
|
|
|
|
},
|
|
|
|
|
moreBtn: {
|
|
|
|
|
datas: []
|
|
|
|
|
},
|
|
|
|
|
}
|
2023-01-05 18:02:33 +08:00
|
|
|
|
2023-01-06 18:01:46 +08:00
|
|
|
|
|
|
|
|
TRANSFER = {
|
2023-01-10 18:23:25 +08:00
|
|
|
height: 350,
|
|
|
|
|
renderItem: (items) => this.renderItem(items),
|
|
|
|
|
filterLeft: (items) => this.filterLeft(items),
|
|
|
|
|
filterRight: (items) => this.filterRight(items),
|
|
|
|
|
onChange: (v) => this.updateTransferKeys(v)
|
|
|
|
|
}
|
2023-01-06 18:01:46 +08:00
|
|
|
|
|
|
|
|
@observable transfer = {
|
2023-01-10 18:23:25 +08:00
|
|
|
transferDatas: [],
|
|
|
|
|
transferKeys: [],
|
|
|
|
|
transferOptions: [],
|
|
|
|
|
transferSelectedKey: '0',
|
|
|
|
|
transferleftIptVal: '',
|
|
|
|
|
transferRightIptVal: ''
|
|
|
|
|
}
|
2023-01-06 18:01:46 +08:00
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
@action("常用条件定制保存") saveHrmSearchUserDefine = () => {
|
2023-01-06 18:01:46 +08:00
|
|
|
this.closeSearchDialog();
|
2023-01-11 18:22:30 +08:00
|
|
|
this.getSearchCondition(false);
|
2023-01-06 18:01:46 +08:00
|
|
|
}
|
|
|
|
|
|
2023-01-13 14:37:03 +08:00
|
|
|
@action("列定制保存") saveCustomDefine = () => {
|
2023-08-08 14:28:49 +08:00
|
|
|
if (this.customTemplateId == '-1') {
|
2024-06-14 16:25:07 +08:00
|
|
|
message.error(getLabel(547650,'默认模板不能修改,将返回默认模板列'));
|
|
|
|
|
|
|
|
|
|
}
|
2023-01-16 09:50:36 +08:00
|
|
|
const params = {
|
2023-08-08 14:28:49 +08:00
|
|
|
columns: this.transfer.transferKeys,
|
|
|
|
|
templateId: this.customTemplateId
|
2023-01-13 14:37:03 +08:00
|
|
|
}
|
2023-01-16 09:50:36 +08:00
|
|
|
Api.saveColumnsCustomTemplate(params).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.searchDialog.visible = false;
|
|
|
|
|
this.getTableInfo();
|
2024-07-25 18:50:53 +08:00
|
|
|
}else{
|
|
|
|
|
message.error(getLabel(547857,'该模板字段内容仅管理员可操作,即将返回默认设置值'));
|
|
|
|
|
this.searchDialog.visible = false;
|
|
|
|
|
this.getTableInfo();
|
2023-08-08 14:28:49 +08:00
|
|
|
}
|
2023-01-16 09:50:36 +08:00
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
2023-01-13 14:37:03 +08:00
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action("将当前模板应用到所有人") setOverAll = () => {
|
|
|
|
|
if (this.customTemplateId == '-1') {
|
|
|
|
|
return message.error(getLabel(547854,'默认模板不可应用,请选择其它模板'));
|
|
|
|
|
}
|
2023-01-13 14:37:03 +08:00
|
|
|
const params = {
|
2024-07-25 18:50:53 +08:00
|
|
|
templateId: this.customTemplateId
|
2023-01-13 14:37:03 +08:00
|
|
|
}
|
2024-07-25 18:50:53 +08:00
|
|
|
Api.setOverAll(params).then(res => {
|
2023-01-10 18:23:25 +08:00
|
|
|
if (res.code === 200) {
|
2024-07-25 18:50:53 +08:00
|
|
|
message.success(res.msg);
|
2023-01-10 18:23:25 +08:00
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
2023-01-11 18:22:30 +08:00
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
|
2023-01-11 18:22:30 +08:00
|
|
|
|
|
|
|
|
|
2023-01-06 18:01:46 +08:00
|
|
|
inputSearchStyle = {
|
2023-01-10 18:23:25 +08:00
|
|
|
width: "105px",
|
|
|
|
|
float: "right",
|
|
|
|
|
marginTop: "5px",
|
|
|
|
|
marginLeft: "10px"
|
|
|
|
|
}
|
|
|
|
|
selectStyle = {
|
|
|
|
|
marginTop: "-1px",
|
|
|
|
|
width: "85px",
|
|
|
|
|
float: "right"
|
|
|
|
|
}
|
|
|
|
|
@computed get leftHeader() {
|
|
|
|
|
const {
|
|
|
|
|
transferleftIptVal,
|
|
|
|
|
transferOptions,
|
|
|
|
|
transferSelectedKey
|
|
|
|
|
} = this.transfer;
|
|
|
|
|
return (
|
|
|
|
|
<div className="trasfer-header">
|
2024-06-14 16:25:07 +08:00
|
|
|
<span>{getLabel(547648,'待选')}</span>
|
2023-01-10 18:23:25 +08:00
|
|
|
<WeaInputSearch
|
|
|
|
|
style={this.inputSearchStyle}
|
|
|
|
|
value={transferleftIptVal}
|
|
|
|
|
onSearchChange={this.updateTransferleftIptVal}
|
|
|
|
|
/>
|
|
|
|
|
<WeaSelect
|
|
|
|
|
style={this.selectStyle}
|
|
|
|
|
options={transferOptions}
|
|
|
|
|
value={transferSelectedKey}
|
|
|
|
|
onChange={this.updateTransferSelectedKey}
|
|
|
|
|
/>
|
2023-01-06 18:01:46 +08:00
|
|
|
</div>
|
2023-01-10 18:23:25 +08:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@computed get rightHeader() {
|
|
|
|
|
const {
|
|
|
|
|
transferRightIptVal,
|
|
|
|
|
} = this.transfer;
|
|
|
|
|
return (
|
|
|
|
|
<div className="trasfer-header">
|
2024-06-14 16:25:07 +08:00
|
|
|
<span>{getLabel(547649,'已选')}</span>
|
2023-01-10 18:23:25 +08:00
|
|
|
<WeaInputSearch
|
|
|
|
|
style={this.inputSearchStyle}
|
|
|
|
|
value={transferRightIptVal}
|
|
|
|
|
onSearchChange={this.updateTransferRightptVal}
|
|
|
|
|
/>
|
|
|
|
|
<WeaSelect
|
|
|
|
|
style={this.selectStyle}
|
2023-01-13 14:37:03 +08:00
|
|
|
options={this.search ? this.templates : this.customTemplates}
|
|
|
|
|
value={this.search ? this.searchTemplateId : this.customTemplateId}
|
2023-01-10 18:23:25 +08:00
|
|
|
onChange={v => this.getTemplateSelectKeys(v)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
2023-01-13 14:37:03 +08:00
|
|
|
|
2023-01-06 18:01:46 +08:00
|
|
|
renderItem = (item) => {
|
2023-01-10 18:23:25 +08:00
|
|
|
const {
|
|
|
|
|
label,
|
|
|
|
|
title
|
|
|
|
|
} = item;
|
|
|
|
|
return (<div className="trasfer-list-item" style={{ "padding": "10px 20px", "borderBottom": "1px solid #ddd" }}>
|
|
|
|
|
<div className="top text-overflow" style={{ "marginBottom": "4px" }} title={label}>{label}</div>
|
|
|
|
|
<div className="bottom text-overflow" style={{ "color": "#999" }} title={title}>{title}</div>
|
|
|
|
|
</div>)
|
|
|
|
|
};
|
2023-01-06 18:01:46 +08:00
|
|
|
|
|
|
|
|
filterLeft = (items) => {
|
2023-01-10 18:23:25 +08:00
|
|
|
let leftItems = cloneDeep(items);
|
|
|
|
|
const {
|
|
|
|
|
transferleftIptVal,
|
|
|
|
|
transferSelectedKey
|
|
|
|
|
} = this.transfer;
|
|
|
|
|
if (transferSelectedKey) {
|
|
|
|
|
leftItems = leftItems.filter((item) => item.idx == transferSelectedKey)
|
|
|
|
|
}
|
|
|
|
|
if (trim(transferleftIptVal)) {
|
|
|
|
|
leftItems = leftItems.filter((item) => item.label.indexOf(trim(transferleftIptVal)) > -1)
|
|
|
|
|
}
|
|
|
|
|
return leftItems
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filterRight = (items) => {
|
|
|
|
|
let rightItems = cloneDeep(items);
|
|
|
|
|
const {
|
|
|
|
|
transferRightIptVal
|
|
|
|
|
} = this.transfer;
|
|
|
|
|
if (trim(transferRightIptVal)) {
|
|
|
|
|
rightItems = rightItems.filter((item) => item.label.indexOf(trim(transferRightIptVal)) > -1)
|
|
|
|
|
}
|
|
|
|
|
return rightItems
|
|
|
|
|
}
|
2023-01-06 18:01:46 +08:00
|
|
|
|
|
|
|
|
@action("穿梭框变化回调") updateTransferKeys = (v) => {
|
2023-01-10 18:23:25 +08:00
|
|
|
this.transfer.transferKeys = v;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
/******显示列定制功能 *************/
|
|
|
|
|
@action("tab显示列定制点击") openCustomDialog = () => {
|
|
|
|
|
this.search = false;
|
|
|
|
|
this.searchDialog.visible = true;
|
|
|
|
|
}
|
2024-07-15 16:59:03 +08:00
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action("列定制模板") getSearchTemplate = (customTemplateId) => {
|
|
|
|
|
Api.getSearchTemplate({ type: 'custom',id:customTemplateId}).then(res => {
|
2023-01-10 18:23:25 +08:00
|
|
|
if (res.code === 200) {
|
2024-07-25 18:50:53 +08:00
|
|
|
this.setCustomTemplates(res.data.templates);
|
|
|
|
|
this.getCustomTransferData();
|
2023-01-10 18:23:25 +08:00
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action("列定制穿梭框内容") getCustomTransferData() {
|
|
|
|
|
Api.getCustomTransferData(this.customTemplateId).then(result => {
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
const { transferDatas, transferKeys, transferOptions } = result.data;
|
|
|
|
|
this.transfer.transferDatas = transferDatas;
|
|
|
|
|
this.transfer.transferKeys = transferKeys;
|
|
|
|
|
this.transfer.transferOptions = transferOptions;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(result.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
2023-01-13 14:37:03 +08:00
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action("列定制存为模板保存") saveCustomTemplate = () => {
|
|
|
|
|
if (this.customTemplateName == '') {
|
|
|
|
|
message.error(getLabel(547652,'列定制模板的名称不能为空'));
|
|
|
|
|
} else {
|
|
|
|
|
const params = {
|
|
|
|
|
showname: this.customTemplateName,
|
|
|
|
|
fields: this.transfer.transferKeys.toString()
|
|
|
|
|
};
|
|
|
|
|
Api.saveCustomTemplate(params).then(response => {
|
|
|
|
|
return response.json()
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
debugger
|
|
|
|
|
this.setCustomTemplates(res.data.result.templates);
|
|
|
|
|
this.setCustomTemplateId(res.data.result.id);
|
|
|
|
|
message.success(res.msg);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
2023-01-11 18:22:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@action("列定制模板管理") getEditTable() {
|
2024-07-25 18:50:53 +08:00
|
|
|
this.searchDialog.visible = false;
|
2023-01-11 18:22:30 +08:00
|
|
|
this.temlateManageDialog.visible = true;
|
|
|
|
|
this.relatedData.loading = true;
|
2024-07-25 18:50:53 +08:00
|
|
|
this.relatedData.datas = [];
|
2023-01-11 18:22:30 +08:00
|
|
|
Api.getEditTable().then(result => {
|
|
|
|
|
if (result.code === 200) {
|
|
|
|
|
const { columns, datas, selectedData } = result.data;
|
|
|
|
|
extendObservable(this.relatedData, {
|
|
|
|
|
datas: datas,
|
|
|
|
|
columns: columns
|
|
|
|
|
});
|
|
|
|
|
selectedData && extendObservable(this.relatedData, {
|
|
|
|
|
selectedData: selectedData
|
|
|
|
|
});
|
|
|
|
|
extendObservable(this.relatedData, {
|
|
|
|
|
loading: false
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(result.msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action("列定制模板管理保存") updateCustomTemplate() {
|
2023-01-13 14:37:03 +08:00
|
|
|
let params = this.editTableParams;
|
|
|
|
|
Api.updateCustomTemplate(params).then(res => {
|
|
|
|
|
let { code, msg } = res;
|
|
|
|
|
if (code === 200) {
|
2024-06-14 16:25:07 +08:00
|
|
|
message.success(msg || getLabel(30700,'操作成功'));
|
2024-07-25 18:50:53 +08:00
|
|
|
this.getSearchTemplate(this.customTemplateId);
|
|
|
|
|
|
2023-01-13 14:37:03 +08:00
|
|
|
} else {
|
|
|
|
|
message.error(msg);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
message.error(error);
|
|
|
|
|
});
|
2023-08-08 14:28:49 +08:00
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
|
|
|
|
|
/******************************************* 高级搜索内容******************************************/
|
|
|
|
|
@action("高级搜索模板内容") getHSearchTemplate = (searchTemplateId) => {
|
|
|
|
|
Api.getSearchTemplate({ type: 'search',id: searchTemplateId }).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.setTemplates(res.data.templates);
|
|
|
|
|
this.getSearchCondition();
|
2023-08-08 14:28:49 +08:00
|
|
|
} else {
|
2024-07-25 18:50:53 +08:00
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//key为true时根据模板id查找模板内容
|
|
|
|
|
@action("高级搜索表单") getSearchCondition(key = true) {
|
|
|
|
|
this.setScLoadingStatus(true);
|
|
|
|
|
this.form2 = new WeaForm();
|
|
|
|
|
let params = {};
|
|
|
|
|
key ? params = {
|
|
|
|
|
templateId: this.searchTemplateId
|
|
|
|
|
} : params = {
|
|
|
|
|
selectKeys: this.transfer.transferKeys,
|
|
|
|
|
}
|
|
|
|
|
Api.getAdvanceSearchCondition(params).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.setScLoadingStatus(false);
|
|
|
|
|
res.data.conditions && this.setSearchCondition(res.data.conditions);
|
|
|
|
|
res.data.defaultcondition && this.setDefaultCondition(res.data.defaultcondition);
|
|
|
|
|
res.data.defaultcondition && this.form2.initFormFields(res.data.defaultcondition);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@action("高级搜索模板切换") changeSearchTemplate(v) {
|
|
|
|
|
this.searchTemplateId = v;
|
|
|
|
|
this.getSearchCondition();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@action("常用条件定制") formatTransfer = () => {
|
|
|
|
|
const transferDatas = []
|
|
|
|
|
const transferKeys = []
|
|
|
|
|
const transferOptions = [{
|
|
|
|
|
key: "",
|
|
|
|
|
showname: ""
|
|
|
|
|
}]
|
|
|
|
|
this.transfer.transferSelectedKey = '0';
|
|
|
|
|
this.transfer.transferleftIptVal = '';
|
|
|
|
|
this.transfer.transferRightIptVal = '';
|
|
|
|
|
this.searchCondition.forEach((c, idx) => {
|
|
|
|
|
transferOptions.push({
|
|
|
|
|
key: `${idx}`,
|
|
|
|
|
showname: c.title,
|
|
|
|
|
})
|
|
|
|
|
c.items.forEach((i) => {
|
|
|
|
|
transferDatas.push({
|
|
|
|
|
id: i.domkey[0],
|
|
|
|
|
label: i.label,
|
|
|
|
|
title: c.title,
|
|
|
|
|
idx: `${idx}`
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.defaultCondition.forEach((c, idx) => {
|
|
|
|
|
c.items.forEach((i) => {
|
|
|
|
|
transferKeys.push(i.domkey[0]);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.transfer.transferDatas = transferDatas;
|
|
|
|
|
this.transfer.transferKeys = transferKeys;
|
|
|
|
|
this.transfer.transferOptions = transferOptions;
|
|
|
|
|
this.searchDialog.visible = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@action("高级搜索常用条件定制模板切换") getTemplateSelectKeys = v => {
|
|
|
|
|
if (!this.search) {
|
|
|
|
|
this.customTemplateId = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const params = {
|
|
|
|
|
templateId: v,
|
|
|
|
|
type: this.search ? 'search' : 'custom'
|
|
|
|
|
}
|
|
|
|
|
Api.getTemplateSelectKeys(params).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.transfer.transferKeys = res.data.split(",");
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(res.msg);
|
2023-08-08 14:28:49 +08:00
|
|
|
}
|
|
|
|
|
}, error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
2023-01-11 18:22:30 +08:00
|
|
|
|
2023-01-10 18:23:25 +08:00
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action("高级搜索模板保存") saveTemplate = () => {
|
|
|
|
|
if (this.searchTemplateName == '') {
|
|
|
|
|
message.error(getLabel(547651,'搜索模板的名称不能为空'));
|
|
|
|
|
} else {
|
|
|
|
|
const fields = [];
|
|
|
|
|
this.defaultCondition.forEach((c, idx) => {
|
|
|
|
|
c.items.forEach((i) => {
|
|
|
|
|
fields.push(i.domkey[0]);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
const params = {
|
|
|
|
|
showname: this.searchTemplateName,
|
|
|
|
|
fields: fields.toString()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Api.saveSearchTemplate(params).then(response => {
|
|
|
|
|
return response.json()
|
|
|
|
|
}).then(data => {
|
|
|
|
|
if (data.code === 200) {
|
|
|
|
|
this.setSearchTemplateId(data.data);
|
|
|
|
|
this.getHSearchTemplate(data.data);
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(data.msg);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@action("高级搜索模板删除") deleteSearchTemplate = () => {
|
|
|
|
|
|
|
|
|
|
if (this.searchTemplateId == -1) {
|
|
|
|
|
return message.error(getLabel(547653,'默认模板不可删除'));
|
|
|
|
|
}
|
|
|
|
|
Api.deleteSearchTemplate({ id: this.searchTemplateId }).then(response => {
|
|
|
|
|
return response.json()
|
|
|
|
|
}).then(data => {
|
|
|
|
|
if (data.code === 200) {
|
|
|
|
|
message.success(data.msg);
|
|
|
|
|
this.setSearchTemplateId('-1');
|
|
|
|
|
this.getHSearchTemplate('-1');
|
|
|
|
|
} else {
|
|
|
|
|
message.warning(data.msg);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
message.warning(error.msg);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@observable relatedData = {
|
|
|
|
|
datas: [],
|
|
|
|
|
columns: [],
|
|
|
|
|
loading: true,
|
|
|
|
|
selectedData: {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@observable temlateManageDialog = {
|
|
|
|
|
title: getLabel(547582,'模板管理'),
|
|
|
|
|
visible: false,
|
|
|
|
|
hasScroll: true,
|
|
|
|
|
icon: 'icon-coms-hrm',
|
|
|
|
|
iconBgcolor: '#217346',
|
|
|
|
|
onCancel: () => this.closeTemlateManageDialog(),
|
|
|
|
|
style: {
|
|
|
|
|
width: 600,
|
|
|
|
|
height: 450
|
|
|
|
|
},
|
|
|
|
|
buttons: [<Button type='primary' onClick={() => this.updateCustomTemplate()}>{getLabel(547360,'保存')}</Button>]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@computed get editTableParams() {
|
|
|
|
|
let datas = this.relatedData.datas;
|
|
|
|
|
let selectedData = this.relatedData.selectedData.status;
|
|
|
|
|
let params = this.arrToJson(toJS(datas), toJS(selectedData), 'status');
|
|
|
|
|
params.rownum = datas.length;
|
|
|
|
|
return params;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-01-06 18:01:46 +08:00
|
|
|
|
|
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
@action updateTransferleftIptVal = (v) => {
|
|
|
|
|
this.transfer.transferleftIptVal = v;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@action updateTransferSelectedKey = (v) => {
|
|
|
|
|
this.transfer.transferSelectedKey = v;
|
|
|
|
|
}
|
2023-01-06 18:01:46 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
@action updateTransferKeys = (v) => {
|
|
|
|
|
this.transfer.transferKeys = v;
|
|
|
|
|
}
|
2023-01-05 18:02:33 +08:00
|
|
|
|
|
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
@action updateTransferRightptVal = (v) => {
|
|
|
|
|
this.transfer.transferRightIptVal = v;
|
|
|
|
|
}
|
2023-01-10 18:23:25 +08:00
|
|
|
|
2023-01-05 18:02:33 +08:00
|
|
|
|
2023-01-10 18:23:25 +08:00
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action("高级搜索显示列定制") openSearchDialog = () => {
|
2023-08-08 14:28:49 +08:00
|
|
|
this.formatTransfer();
|
|
|
|
|
}
|
2023-01-06 18:01:46 +08:00
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
|
2023-01-11 18:22:30 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
@action closeSearchDialog = () => {
|
|
|
|
|
this.searchDialog.visible = false;
|
|
|
|
|
}
|
2023-01-05 18:02:33 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
@action closeTemlateManageDialog = () => {
|
|
|
|
|
this.temlateManageDialog.visible = false;
|
|
|
|
|
}
|
2023-01-05 18:02:33 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setTableEditDatas(e) {
|
|
|
|
|
e.map(item => {
|
|
|
|
|
for (let key in item) {
|
|
|
|
|
if (key == "undefined") {
|
|
|
|
|
delete item[key];
|
|
|
|
|
}
|
|
|
|
|
if (!item["isused"]) {
|
|
|
|
|
item["isused"] = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
extendObservable(this.relatedData, {
|
|
|
|
|
datas: e
|
|
|
|
|
});
|
|
|
|
|
}
|
2022-12-09 14:47:19 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setEnableRows(e) {
|
|
|
|
|
extendObservable(this.relatedData, {
|
|
|
|
|
selectedData: {
|
|
|
|
|
isused: e
|
2022-06-20 17:08:10 +08:00
|
|
|
}
|
2023-08-08 14:28:49 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateFields(val) {
|
|
|
|
|
this.form2.updateFields({
|
2024-07-30 16:22:54 +08:00
|
|
|
"-1_hrm_lastname": {
|
2023-08-08 14:28:49 +08:00
|
|
|
value: val
|
2023-01-13 14:37:03 +08:00
|
|
|
}
|
2023-08-08 14:28:49 +08:00
|
|
|
});
|
|
|
|
|
}
|
2023-01-06 18:01:46 +08:00
|
|
|
|
2023-08-16 13:58:08 +08:00
|
|
|
hideRadioGroup() {
|
|
|
|
|
this.radioParams = {};
|
|
|
|
|
this.showRadioGroup = false;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setSearchCondition(condition) {
|
|
|
|
|
this.searchCondition = condition;
|
|
|
|
|
}
|
2023-01-06 18:01:46 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setDefaultCondition(defaultcondition) {
|
|
|
|
|
this.defaultCondition = defaultcondition;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2024-07-15 16:59:03 +08:00
|
|
|
@action setTemplates(datas) {
|
2023-08-08 14:28:49 +08:00
|
|
|
this.templates = datas;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action setSearchTemplateId(id) {
|
|
|
|
|
this.searchTemplateId = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-07-15 16:59:03 +08:00
|
|
|
@action setCustomTemplates(datas) {
|
2023-08-08 14:28:49 +08:00
|
|
|
this.customTemplates = datas;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-25 18:50:53 +08:00
|
|
|
@action setCustomTemplateId(id) {
|
|
|
|
|
this.customTemplateId = id;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setScLoadingStatus(bool) {
|
|
|
|
|
this.searchConditionLoading = bool;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setPanelStatus(bool) {
|
|
|
|
|
this.search = true;
|
2024-07-25 18:50:53 +08:00
|
|
|
this.isPanelShow = bool;
|
2023-08-08 14:28:49 +08:00
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
arrToJson(arr, rows, rowKey = "isused") {
|
|
|
|
|
let json = {};
|
|
|
|
|
const _rows = isEmpty(arr) ? [] : rows;
|
|
|
|
|
_rows && _rows.map(index => {
|
|
|
|
|
arr[index][rowKey] = "1";
|
|
|
|
|
});
|
|
|
|
|
arr.map((item, index) => {
|
|
|
|
|
if (!item[rowKey]) item[rowKey] = "0";
|
|
|
|
|
for (let key in item) {
|
|
|
|
|
json[key + "_" + index] = item[key];
|
|
|
|
|
}
|
|
|
|
|
});
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
return json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setLastName(val) {
|
|
|
|
|
this.lastName = val;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
isEmptyObject(obj) {
|
|
|
|
|
for (let key in obj) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2022-06-20 17:08:10 +08:00
|
|
|
}
|
|
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setIds(ids) {
|
|
|
|
|
this.ids = ids;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
scLoadingReset() {
|
|
|
|
|
this.searchConditionLoading = true;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
|
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
formReset() {
|
|
|
|
|
this.form = new WeaForm();
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
dialogLoadingReset() {
|
|
|
|
|
this.dialogLoading = true;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setVisible(bool) {
|
|
|
|
|
this.visible = bool;
|
|
|
|
|
this.formReset();
|
|
|
|
|
!bool && this.dialogLoadingReset();
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setDialogLoadingStatus(bool) {
|
|
|
|
|
this.dialogLoading = bool;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setNeDialogTitle(title) {
|
|
|
|
|
this.nEdialogTitle = title;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setIsNew(bool) {
|
|
|
|
|
this.isNew = bool;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setCondition(condition) {
|
|
|
|
|
this.condition = condition;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setUserId(userId) {
|
|
|
|
|
this.userId = userId;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setDate(date) {
|
|
|
|
|
this.date = date;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setTopMenu(topMenu) {
|
|
|
|
|
this.topMenu = topMenu;
|
|
|
|
|
}
|
2022-06-20 17:08:10 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setRightMenu(rightMenu) {
|
|
|
|
|
this.rightMenu = rightMenu;
|
|
|
|
|
}
|
2023-01-13 14:37:03 +08:00
|
|
|
|
2023-08-08 14:28:49 +08:00
|
|
|
setHasRight(bool) {
|
|
|
|
|
this.hasRight = bool;
|
|
|
|
|
}
|
2023-01-10 18:23:25 +08:00
|
|
|
|
|
|
|
|
}
|