+ hasRight &&
this.handleMenuClick(key)}
@@ -438,6 +438,6 @@ export default class RankScheme extends React.Component {
onCancel={() => rankScheme.setVisible(false)}
/>
- )
+ )
}
}
\ No newline at end of file
diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js
index e73f6ed..7b49088 100644
--- a/pc4mobx/organization/index.js
+++ b/pc4mobx/organization/index.js
@@ -32,7 +32,8 @@ import ResourceBasicInfo from "./components/resource/ResourceBasicInfo";
import ResourceCard from "./components/resource/ResourceCard";
import ManagerDetach from "./components/detach/ManagerDetach";
import ColumnSetting from "./components/columnSetting";
-import PersonnelResume from "./components/resource/PersonnelResume"
+import PersonnelResume from "./components/resource/PersonnelResume";
+import QuickSearch from "./components/fieldDefinedSet/QuickSearch";
import stores from "./stores";
import "./style/index";
@@ -98,7 +99,7 @@ const Routes = (
-
+
);
diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js
index e0d8271..da356c6 100644
--- a/pc4mobx/organization/stores/index.js
+++ b/pc4mobx/organization/stores/index.js
@@ -26,7 +26,8 @@ import {ImportDialogStore} from "./importDialog";
import {ResourceCardStore} from "./resourceCard";
import {ManagerDetachStore} from "./managerDetach";
import {ColumnSetting} from './columnSetting';
-import {PersonnelResumeStore} from './personnelResume'
+import {PersonnelResumeStore} from './personnelResume';
+import { QuickSearchStore } from "./quickSearch";
module.exports = {
@@ -58,5 +59,6 @@ module.exports = {
resourceCard:new ResourceCardStore(),
managerDetach: new ManagerDetachStore(),
columnSetting: new ColumnSetting(),
- personnelResume:new PersonnelResumeStore()
+ personnelResume:new PersonnelResumeStore(),
+ quickSearch:new QuickSearchStore()
};
diff --git a/pc4mobx/organization/stores/quickSearch.js b/pc4mobx/organization/stores/quickSearch.js
new file mode 100644
index 0000000..8fccec9
--- /dev/null
+++ b/pc4mobx/organization/stores/quickSearch.js
@@ -0,0 +1,175 @@
+import {
+ observable,
+ action
+} from 'mobx';
+import * as mobx from 'mobx';
+import * as API from '../apis/quickSearch';
+import {
+ WeaForm
+} from 'comsMobx';
+import {
+ Modal,
+ message,
+} from 'antd'
+import {
+ i18n
+} from '../public/i18n';
+import { WeaLocaleProvider } from 'ecCom';
+
+const toJS = mobx.toJS;
+const getLabel = WeaLocaleProvider.getLabel;
+
+
+export class QuickSearchStore {
+
+ @observable quickSearchForm = new WeaForm();
+ @observable qcSelectedRowKeys = [];
+ @observable quickSearchData = {
+ datas: [],//表格记录record
+ setting: {},
+ options: [],
+ };
+ @observable quickSearchDetailVisable = false;
+ @observable qcData = { qcType: '', cid: '', fieldid: '' };//快速查询明细type
+ @observable quickSearchDetailData = [];
+ @observable precision = 0;
+
+ /**** ==============quickSearchForm ===============*/
+ @observable quickSearchFields = [
+ {
+ domkey: ['isquicksearch'],
+ conditionType: 'SWITCH',
+ label: getLabel('387493', "快捷搜索条件"),
+ labelcol: 5,
+ fieldcol: 19,
+ viewAttr: 3,
+ }
+ ]
+
+
+ @action("初始化页面") initList = () => {
+ this.quickSearchForm.initFormFields([{ items: this.quickSearchFields.slice() }]);
+ this.getQuickSearchInfo();
+ }
+
+ @action clearQuciSearchData = () => {
+ this.quickSearchData.setting = {};
+ this.quickSearchData.datas = [];
+ this.quickSearchData.options = [];
+ }
+
+ @action("数据获取") getQuickSearchInfo = () => {
+ this.clearQuciSearchData();
+ API.getQuickSearchInfo({ customid: 382 }).then(action(({ status, errorCode, error, setting, datas, options, groupidOptions }) => {
+ if (status == '1') {
+ this.quickSearchData.setting = setting;
+ this.quickSearchData.datas = datas.map(d => {
+ return { ...d, visible: false }
+ });
+ this.quickSearchData.groupidOptions = groupidOptions;
+ this.quickSearchData.options = options;
+ this.quickSearchForm.updateFields({
+ isquicksearch: setting.isquicksearch,
+ });
+ } else {
+ message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ }
+ }));
+ }
+
+
+
+ @action("保存页面") saveQuickSearchInfo = (params) => {
+ // let datas = this.quickSearchData.datas;
+ // datas.map((data, index) => {
+ // data.orderid = index
+ // });
+
+ // let formparm = this.quickSearchForm.getFormParams();
+ // if (!this.checkQuickSearchData()) {
+ // message.error(getLabel('387954', "条件字段不能重复"));
+ // return;
+ // }
+ // let id = this.quickSearchData.setting.id;
+ // if (id == null) {
+ // return;
+ // }
+ // if (params) {
+ // formparm = params;
+ // }
+ // API.saveQuickSearchInfo({
+ // id: id,
+ // customid: this.customid,
+ // data: JSON.stringify(datas), ...formparm
+ // }).then(({ status, errorCode, error, setting, datas, options }: any) => {
+ // if (status == '1') {
+ // message.success(getLabel(83551, '保存成功!'));
+ // this.qcSelectedRowKeys = [];
+ // this.getQuickSearchInfo();
+ // } else {
+ // message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ // }
+ // });
+ // this.quickSearchData.setting.id = null;
+ }
+
+
+
+ @action setQuickSearchData = (datas) => {
+ this.quickSearchData.datas = datas;
+ }
+
+
+ /**============================quickdetail===================== */
+ @action("设置") openQuickSearchDetail = (record) => {
+ this.quickSearchDetailVisable = true;
+ this.qcData.qcType = record.type;
+ this.qcData.cid = record.cid;
+ this.qcData.fieldid = record.fieldid;
+ this.getQuickSearchDetailInfo(record.cid);
+ }
+
+ @action getQuickSearchDetailInfo = (cid) => {
+ API.getQuickSearchDetailInfo({ cid: cid }).then(({ status, errorCode, error, setting, datas, precision }) => {
+ if (status == '1') {
+ this.quickSearchDetailData = datas;
+ this.precision = precision;
+ } else {
+ message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ }
+ });
+ }
+
+
+
+ /**===========================buttons=========================== */
+ rightMenu = [
+ {
+ "isBatch": "0",
+ "isTop": "1",
+ "menuFun": "save",
+ "menuIcon": "icon-coms-Preservation",
+ "menuName": "保存",
+ "type": "BTN_save"
+ },
+ // {
+ // "isBatch": "0",
+ // "isTop": "0",
+ // "menuFun": "log",
+ // "menuIcon": "icon-coms-Print-log",
+ // "menuName": "日志",
+ // "type": "BTN_log"
+ // }
+ ];
+ topMenu = [
+ {
+ "isBatch": "1",
+ "isTop": "1",
+ "menuFun": "save",
+ "menuIcon": "icon-coms-Preservation",
+ "menuName": "保存",
+ "type": "BTN_save"
+ }
+ ]
+
+}
\ No newline at end of file
From 56cb6a800aa0227f8eb479af0e43263a2afc2300 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Wed, 9 Aug 2023 16:37:35 +0800
Subject: [PATCH 04/12] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/organization/apis/quickSearch.js | 4 +-
.../fieldDefinedSet/QuickSearchDetail.js | 261 ++++++++++++++++++
pc4mobx/organization/stores/quickSearch.js | 21 ++
3 files changed, 284 insertions(+), 2 deletions(-)
diff --git a/pc4mobx/organization/apis/quickSearch.js b/pc4mobx/organization/apis/quickSearch.js
index 5f1f10f..1fb0eb1 100644
--- a/pc4mobx/organization/apis/quickSearch.js
+++ b/pc4mobx/organization/apis/quickSearch.js
@@ -13,7 +13,7 @@ export const saveFieldDefinedInfo = (moduleName,params) => {
})
}
-export const getQuickSearchInfo = (params) => WeaTools.callApi(`/api/cube/list/getQuickSearchInfo`, 'GET', params);
+export const getQuickSearchInfo = (params) => WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/getQuickSearchInfo`, 'GET', params);
-export const getQuickSearchDetailInfo = (params) => WeaTools.callApi(`/api/cube/list/getQuickSearchDetailInfo`, 'GET', params);
+export const getQuickSearchDetailInfo = (params) => WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/getQuickSearchDetailInfo`, 'GET', params);
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
index e69de29..b480154 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
@@ -0,0 +1,261 @@
+import React from 'react';
+import { observer } from 'mobx-react';
+import { WeaDialog, WeaNewScroll, WeaLocaleProvider, WeaRightMenu } from 'ecCom';
+import { WeaScope, WeaInput, WeaInputNumber, WeaSearchGroup, WeaTab, WeaError, WeaHelpfulTip } from 'ecCom';
+const getLabel = WeaLocaleProvider.getLabel;
+import { Button, Table, Modal, message } from 'antd';
+import { observable, toJS, } from "mobx";
+import { WeaForm } from 'comsMobx';
+import $ from 'jquery';
+
+@observer
+export default class QuickSearchDetail extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+
+ onSelectChange = (keys, rows) => {
+ let keyarr = [];
+ rows.map(row => {
+ keyarr.push(row.key);
+ });
+ const { quickSearch } = this.props;
+ quickSearch.qcDetailRowKeys = keyarr;
+ }
+
+ save = () => {
+ const { quickSearch } = this.props;
+ quickSearch.saveQuickSearchDetailInfo();
+ }
+
+ closeDialog = () => {
+ const { quickSearch } = this.props;
+ quickSearch.quickSearchDetailVisable = false;
+ }
+
+ getSearchButton = () => {
+ const { quickSearch } = this.props;
+ const buttons = new Array();
+ buttons.push(
);
+ buttons.push(
);
+
+ return buttons;
+ }
+
+ addRow = () => {
+ // const { CubeListStore } = this.props;
+ // let { quickSearchDetailData } = CubeListStore;
+ // let datas = quickSearchDetailData;
+ // let time = new Date().getTime();
+ // let obj = {
+ // key: "new_" + time,
+ // customname: '',
+ // orderid: 0,
+ // minnum: '',
+ // maxnum: '',
+ // type: CubeListStore.qcData.qcType,
+ // fieldid: CubeListStore.qcData.fieldid,
+ // customid: CubeListStore.customid
+ // }
+ // datas = toJS(datas);
+ // datas.push(obj);
+ // CubeListStore.setQuickSearchDetailData(datas);
+ }
+
+ delRow = () => {
+ // const { CubeListStore } = this.props;
+ // let { qcDetailRowKeys } = CubeListStore;
+ // if (qcDetailRowKeys.length <= 0) {
+ // message.error(getLabel(22346, '请选择要删除的信息', 'label'));
+ // return;
+ // }
+ // const that = this;
+ // Modal.confirm({
+ // title: getLabel(83601, '您确认要删除选中的记录吗?'),
+ // onOk() {
+ // let datas = CubeListStore.quickSearchDetailData;
+ // datas = toJS(datas);
+ // datas = that.delFromArray(datas, qcDetailRowKeys);
+ // CubeListStore.qcDetailRowKeys = [];
+ // CubeListStore.setQuickSearchDetailData(datas);
+ // },
+ // onCancel() { },
+ // });
+ }
+
+ render() {
+ const { quickSearch: store } = this.props, {
+ qcDetailRowKeys
+ } = store;
+ const rowSelection = {
+ qcDetailRowKeys,
+ onChange: this.onSelectChange,
+ }
+ const Height = $(".wea-dialog-body")[0] && $(".wea-dialog-body")[0].style.height;
+ const buttons = [
+
,
+
+ ]
+ return (
+
+
+
+
+
+
+
+
+
+ )
+ }
+
+
+}
+
+@observer
+class QuickSearchTableEdit extends React.Component{
+
+ getColumns = () => {
+ let columnArray = [
+ {
+ title: getLabel(195, "名称"), dataIndex: "customname", key: "customname", width: "40%",
+ com: [{ label: '', type: 'INPUT', key: 'customname', viewAttr: 3, otherParams: { isBase64: true, inputType: "multilang" } }]
+ },
+ {
+ title:
+ {getLabel(387588, "内容自定义条件")}
+
+
, dataIndex: "condition", key: "condition", width: "40%",
+ com: [{ label: '', type: 'SCOP', key: 'condition', viewAttr: 3 }]
+ },
+ {
+ title: getLabel(88, "顺序"), dataIndex: "orderid", key: "orderid", width: "20%",
+ com: [{ label: '', type: 'INPUTNUMBER', key: 'orderid', viewAttr: 2, otherParams: { max: 999, step: 1 } }]
+ }
+ ];
+ columnArray = columnArray.map((col) => {
+ let _col = { ...col };
+ _col.render = (text, record, index) => {
+ return this.getColRender(_col, text, record, index);
+ }
+ return _col
+ });
+ return columnArray;
+ }
+
+ getColRender = (_col, text, record, index) => {
+ const { datas } = this.props;
+ const { quickSearch: { quickSearchRefObj } } = this.props.ListProps;
+ const { com, } = _col;
+ let _com = [];
+ com.map((c) => {
+ if (typeof c.props === 'object') {
+ _com.push(
);
+ } else {
+ const { key, viewAttr = 2, type = 'INPUT', width, otherParams = {} } = c;
+ const _type = type.toUpperCase();
+ _com.push(
+
+ {
+ _type === 'INPUT' &&
+ quickSearchRefObj[`error_${key}_${index}`] = ref}
+ >
+ this.onEdit(record, index, key, value)}
+ {...otherParams}
+ />
+
+ }
+ {
+ _type === 'SCOP' &&
+ quickSearchRefObj[`error_${key}_${index}`] = ref}
+ >
+
+ this.onEdit(record, index, key, value)}
+ />
+
+
+ }
+ {
+ _type === 'INPUTNUMBER' &&
+ this.onEdit(record, index, key, value1)}
+ {...otherParams}
+ />
+ }
+
+ )
+ }
+ });
+ return (
+
+ {_com}
+
+ )
+ }
+
+ onEdit = (record, index, key, value) => {
+ const { datas } = this.props;
+ let _datas = [...datas];
+ _datas[index][key] = value;
+ if (key == 'condition') {
+ _datas[index].minnum = value[0] === undefined ? "" : value[0];
+ _datas[index].maxnum = value[1] === undefined ? "" : value[1];
+ }
+ typeof this.props.onChange === 'function' && this.props.onChange(_datas);
+ }
+ render() {
+ const { datas, rowSelection } = this.props;
+ return (
+
+ )
+ }
+}
diff --git a/pc4mobx/organization/stores/quickSearch.js b/pc4mobx/organization/stores/quickSearch.js
index 8fccec9..b8d4725 100644
--- a/pc4mobx/organization/stores/quickSearch.js
+++ b/pc4mobx/organization/stores/quickSearch.js
@@ -33,6 +33,8 @@ export class QuickSearchStore {
@observable qcData = { qcType: '', cid: '', fieldid: '' };//快速查询明细type
@observable quickSearchDetailData = [];
@observable precision = 0;
+ @observable qcDetailRowKeys = [];
+ quickSearchRefObj = {};
/**** ==============quickSearchForm ===============*/
@observable quickSearchFields = [
@@ -139,6 +141,25 @@ export class QuickSearchStore {
}
});
}
+ @action("明细保存") saveQuickSearchDetailInfo = () => {
+ // let datas = this.quickSearchDetailData;
+ // if (!this.checkQuickSearchDetailData()) {
+ // return;
+ // }
+ // API.saveQuickSearchDetailInfo({
+ // cid: this.qcData.cid,
+ // data: JSON.stringify(datas)
+ // }).then(({ status, errorCode, error, setting, datas, options }: any) => {
+ // if (status == '1') {
+ // message.success(getLabel(83551, '保存成功!'));
+ // this.qcDetailRowKeys = [];
+ // this.getQuickSearchDetailInfo(this.qcData.cid);
+ // } else {
+ // message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ // }
+ // });
+ }
+
From 35b783ca722006452a911447eea412a56b9cd18d Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Wed, 9 Aug 2023 17:14:53 +0800
Subject: [PATCH 05/12] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/organization/apis/quickSearch.js | 11 +--
.../components/fieldDefinedSet/QuickSearch.js | 99 +++++++++++--------
.../fieldDefinedSet/QuickSearchDetail.js | 2 +-
pc4mobx/organization/stores/quickSearch.js | 87 +++++++++-------
4 files changed, 108 insertions(+), 91 deletions(-)
diff --git a/pc4mobx/organization/apis/quickSearch.js b/pc4mobx/organization/apis/quickSearch.js
index 1fb0eb1..10a9ae2 100644
--- a/pc4mobx/organization/apis/quickSearch.js
+++ b/pc4mobx/organization/apis/quickSearch.js
@@ -2,15 +2,8 @@ import {
WeaTools
} from 'ecCom';
-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 saveQuickSearchInfo = (params) => {
+ return WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/saveQuickSearchInfo`, 'POST', params);
}
export const getQuickSearchInfo = (params) => WeaTools.callApi(`/api/bs/hrmorganization/quicksearch/getQuickSearchInfo`, 'GET', params);
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js
index c920315..8ce48b3 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js
@@ -130,52 +130,65 @@ export default class QuickSearch extends React.Component {
}
addRow = () => {
- // const { CubeListStore } = this.props;
- // let { quickSearchData } = CubeListStore;
- // let datas = quickSearchData.datas;
- // if(datas.length>=6){
- // message.error(getLabel('387795',"最多只能添加6项"));
- // return;
- // }
- // let time = new Date().getTime();
- // let type = quickSearchData.options.length > 0 ? quickSearchData.options[0].type : '2';
- // let fieldid = quickSearchData.options.length > 0 ? quickSearchData.options[0].key : '';
- // let customname = quickSearchData.options.length > 0 ? quickSearchData.options[0].showname : '';
- // let isdetailtable = quickSearchData.options.length > 0 ? quickSearchData.options[0].isdetailtable : '0';
- // let obj = {
- // key: "new_" + time,
- // fieldid: fieldid,
- // customname: customname,
- // range: type == '1' ? getLabel('387636', "内容自定义") : getLabel('387637', "字段本身值"),
- // condition: type == '1' ? getLabel('68', "设置") : '',
- // orderid: 0,
- // type: type,
- // isdetailtable: isdetailtable
- // }
- // datas = toJS(datas);
- // datas.push(obj);
- // CubeListStore.setQuickSearchData(datas);
+ const { quickSearch } = this.props;
+ let { quickSearchData } = quickSearch;
+ let datas = quickSearchData.datas;
+ if(datas.length>=6){
+ message.error(getLabel('387795',"最多只能添加6项"));
+ return;
+ }
+ let time = new Date().getTime();
+ let type = quickSearchData.options.length > 0 ? quickSearchData.options[0].type : '2';
+ let fieldid = quickSearchData.options.length > 0 ? quickSearchData.options[0].key : '';
+ let customname = quickSearchData.options.length > 0 ? quickSearchData.options[0].showname : '';
+ let isdetailtable = quickSearchData.options.length > 0 ? quickSearchData.options[0].isdetailtable : '0';
+ let obj = {
+ key: "new_" + time,
+ fieldid: fieldid,
+ customname: customname,
+ range: type == '1' ? getLabel('387636', "内容自定义") : getLabel('387637', "字段本身值"),
+ condition: type == '1' ? getLabel('68', "设置") : '',
+ orderid: 0,
+ type: type,
+ isdetailtable: isdetailtable
+ }
+ datas = toJS(datas);
+ datas.push(obj);
+ quickSearch.setQuickSearchData(datas);
}
delRow = () => {
- // const { CubeListStore } = this.props;
- // let { qcSelectedRowKeys } = CubeListStore;
- // if (qcSelectedRowKeys.length <= 0) {
- // message.error(getLabel(22346, '请选择要删除的信息', 'label'));
- // return;
- // }
- // const that = this;
- // Modal.confirm({
- // title: getLabel(83601, '您确认要删除选中的记录吗?'),
- // onOk() {
- // let { datas } = CubeListStore.quickSearchData;
- // datas = toJS(datas);
- // datas = that.delFromArray(datas, qcSelectedRowKeys);
- // CubeListStore.qcSelectedRowKeys = [];
- // CubeListStore.setQuickSearchData(datas);
- // },
- // onCancel() {},
- // });
+ const { quickSearch } = this.props;
+ let { qcSelectedRowKeys } = quickSearch;
+ if (qcSelectedRowKeys.length <= 0) {
+ message.error(getLabel(22346, '请选择要删除的信息', 'label'));
+ return;
+ }
+ const that = this;
+ Modal.confirm({
+ title: getLabel(83601, '您确认要删除选中的记录吗?'),
+ onOk() {
+ let { datas } = quickSearch.quickSearchData;
+ datas = toJS(datas);
+ datas = that.delFromArray(datas, qcSelectedRowKeys);
+ quickSearch.qcSelectedRowKeys = [];
+ quickSearch.setQuickSearchData(datas);
+ },
+ onCancel() {},
+ });
+ }
+
+ delFromArray = (array, selectRowIds) => {
+ for (let i = 0; i < selectRowIds.length; i++) {
+ let key = selectRowIds[i];
+ for (let j = 0; j < array.length; j++) {
+ if (array[j]["key"] == key) {
+ array.splice(j, 1);
+ break;
+ }
+ }
+ }
+ return array;
}
onSelectChange = (keys, rows) => {
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
index b480154..23dc8d1 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
@@ -48,7 +48,7 @@ export default class QuickSearchDetail extends React.Component {
}
addRow = () => {
- // const { CubeListStore } = this.props;
+ // const { quickSearch } = this.props;
// let { quickSearchDetailData } = CubeListStore;
// let datas = quickSearchDetailData;
// let time = new Date().getTime();
diff --git a/pc4mobx/organization/stores/quickSearch.js b/pc4mobx/organization/stores/quickSearch.js
index b8d4725..9e7b12d 100644
--- a/pc4mobx/organization/stores/quickSearch.js
+++ b/pc4mobx/organization/stores/quickSearch.js
@@ -62,65 +62,76 @@ export class QuickSearchStore {
@action("数据获取") getQuickSearchInfo = () => {
this.clearQuciSearchData();
- API.getQuickSearchInfo({ customid: 382 }).then(action(({ status, errorCode, error, setting, datas, options, groupidOptions }) => {
- if (status == '1') {
- this.quickSearchData.setting = setting;
+ API.getQuickSearchInfo({ customid: 382 }).then(action(({ code, data, msg }) => {
+ if (code == 200) {
+ this.quickSearchData.setting = data.setting;
this.quickSearchData.datas = datas.map(d => {
return { ...d, visible: false }
});
- this.quickSearchData.groupidOptions = groupidOptions;
- this.quickSearchData.options = options;
+ this.quickSearchData.groupidOptions = data.groupidOptions;
+ this.quickSearchData.options = data.options;
this.quickSearchForm.updateFields({
- isquicksearch: setting.isquicksearch,
+ isquicksearch: data.setting.isquicksearch,
});
} else {
- message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
}
}));
}
- @action("保存页面") saveQuickSearchInfo = (params) => {
- // let datas = this.quickSearchData.datas;
- // datas.map((data, index) => {
- // data.orderid = index
- // });
+ @action("保存页面") saveQuickSearchInfo = () => {
+ let datas = this.quickSearchData.datas;
+ datas.map((data, index) => {
+ data.orderid = index
+ });
- // let formparm = this.quickSearchForm.getFormParams();
- // if (!this.checkQuickSearchData()) {
- // message.error(getLabel('387954', "条件字段不能重复"));
- // return;
- // }
- // let id = this.quickSearchData.setting.id;
- // if (id == null) {
- // return;
- // }
- // if (params) {
- // formparm = params;
- // }
- // API.saveQuickSearchInfo({
- // id: id,
- // customid: this.customid,
- // data: JSON.stringify(datas), ...formparm
- // }).then(({ status, errorCode, error, setting, datas, options }: any) => {
- // if (status == '1') {
- // message.success(getLabel(83551, '保存成功!'));
- // this.qcSelectedRowKeys = [];
- // this.getQuickSearchInfo();
- // } else {
- // message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
- // }
- // });
- // this.quickSearchData.setting.id = null;
+ let formparm = this.quickSearchForm.getFormParams();
+ if (!this.checkQuickSearchData()) {
+ message.error(getLabel('387954', "条件字段不能重复"));
+ return;
+ }
+ let id = this.quickSearchData.setting.id;
+ if (id == null) {
+ return;
+ }
+ API.saveQuickSearchInfo({
+ id: id,
+ customid: this.customid,
+ data: JSON.stringify(datas), ...formparm
+ }).then(({ status, errorCode, error, setting, datas, options }) => {
+ if (status == '1') {
+ message.success(getLabel(83551, '保存成功!'));
+ this.qcSelectedRowKeys = [];
+ this.getQuickSearchInfo();
+ } else {
+ message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ }
+ });
+ this.quickSearchData.setting.id = null;
}
+ checkQuickSearchData = () => {
+ let map = new Map();
+ let result = true;
+ this.quickSearchData.datas.map(data => {
+ if (map.has(data.fieldid)) {
+ result = false;
+ }
+ map.set(data.fieldid, data.customname);
+ });
+ return result;
+ }
@action setQuickSearchData = (datas) => {
this.quickSearchData.datas = datas;
}
+ @action setQuickSearchData = (datas) => {
+ this.quickSearchData.datas = datas;
+ }
/**============================quickdetail===================== */
@action("设置") openQuickSearchDetail = (record) => {
From 7c6e62c28fdfb4f6cf96180fed87e5ce8499d3b4 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Thu, 10 Aug 2023 09:34:44 +0800
Subject: [PATCH 06/12] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/organization/apis/quickSearch.js | 4 +
.../fieldDefinedSet/QuickSearchDetail.js | 83 +++++++++++--------
pc4mobx/organization/stores/quickSearch.js | 15 ++--
3 files changed, 60 insertions(+), 42 deletions(-)
diff --git a/pc4mobx/organization/apis/quickSearch.js b/pc4mobx/organization/apis/quickSearch.js
index 10a9ae2..7c5e5fb 100644
--- a/pc4mobx/organization/apis/quickSearch.js
+++ b/pc4mobx/organization/apis/quickSearch.js
@@ -6,6 +6,10 @@ 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/components/fieldDefinedSet/QuickSearchDetail.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
index 23dc8d1..94e43ef 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
@@ -48,44 +48,57 @@ export default class QuickSearchDetail extends React.Component {
}
addRow = () => {
- // const { quickSearch } = this.props;
- // let { quickSearchDetailData } = CubeListStore;
- // let datas = quickSearchDetailData;
- // let time = new Date().getTime();
- // let obj = {
- // key: "new_" + time,
- // customname: '',
- // orderid: 0,
- // minnum: '',
- // maxnum: '',
- // type: CubeListStore.qcData.qcType,
- // fieldid: CubeListStore.qcData.fieldid,
- // customid: CubeListStore.customid
- // }
- // datas = toJS(datas);
- // datas.push(obj);
- // CubeListStore.setQuickSearchDetailData(datas);
+ const { quickSearch } = this.props;
+ let { quickSearchDetailData } = quickSearch;
+ let datas = quickSearchDetailData;
+ let time = new Date().getTime();
+ let obj = {
+ key: "new_" + time,
+ customname: '',
+ orderid: 0,
+ minnum: '',
+ maxnum: '',
+ type: quickSearch.qcData.qcType,
+ fieldid: quickSearch.qcData.fieldid,
+ customid: quickSearch.customid
+ }
+ datas = toJS(datas);
+ datas.push(obj);
+ quickSearch.setQuickSearchDetailData(datas);
}
delRow = () => {
- // const { CubeListStore } = this.props;
- // let { qcDetailRowKeys } = CubeListStore;
- // if (qcDetailRowKeys.length <= 0) {
- // message.error(getLabel(22346, '请选择要删除的信息', 'label'));
- // return;
- // }
- // const that = this;
- // Modal.confirm({
- // title: getLabel(83601, '您确认要删除选中的记录吗?'),
- // onOk() {
- // let datas = CubeListStore.quickSearchDetailData;
- // datas = toJS(datas);
- // datas = that.delFromArray(datas, qcDetailRowKeys);
- // CubeListStore.qcDetailRowKeys = [];
- // CubeListStore.setQuickSearchDetailData(datas);
- // },
- // onCancel() { },
- // });
+ const { quickSearch } = this.props;
+ let { qcDetailRowKeys } = quickSearch;
+ if (qcDetailRowKeys.length <= 0) {
+ message.error(getLabel(22346, '请选择要删除的信息', 'label'));
+ return;
+ }
+ const that = this;
+ Modal.confirm({
+ title: getLabel(83601, '您确认要删除选中的记录吗?'),
+ onOk() {
+ let datas = quickSearch.quickSearchDetailData;
+ datas = toJS(datas);
+ datas = that.delFromArray(datas, qcDetailRowKeys);
+ quickSearch.qcDetailRowKeys = [];
+ quickSearch.setQuickSearchDetailData(datas);
+ },
+ onCancel() { },
+ });
+ }
+
+ delFromArray = (array, selectRowIds) => {
+ for (let i = 0; i < selectRowIds.length; i++) {
+ let key = selectRowIds[i];
+ for (let j = 0; j < array.length; j++) {
+ if (array[j]["key"] == key) {
+ array.splice(j, 1);
+ break;
+ }
+ }
+ }
+ return array;
}
render() {
diff --git a/pc4mobx/organization/stores/quickSearch.js b/pc4mobx/organization/stores/quickSearch.js
index 9e7b12d..23979b6 100644
--- a/pc4mobx/organization/stores/quickSearch.js
+++ b/pc4mobx/organization/stores/quickSearch.js
@@ -62,10 +62,10 @@ export class QuickSearchStore {
@action("数据获取") getQuickSearchInfo = () => {
this.clearQuciSearchData();
- API.getQuickSearchInfo({ customid: 382 }).then(action(({ code, data, msg }) => {
+ API.getQuickSearchInfo().then(action(({ code, data, msg }) => {
if (code == 200) {
this.quickSearchData.setting = data.setting;
- this.quickSearchData.datas = datas.map(d => {
+ this.quickSearchData.datas = data.datas.map(d => {
return { ...d, visible: false }
});
this.quickSearchData.groupidOptions = data.groupidOptions;
@@ -98,15 +98,14 @@ export class QuickSearchStore {
}
API.saveQuickSearchInfo({
id: id,
- customid: this.customid,
data: JSON.stringify(datas), ...formparm
- }).then(({ status, errorCode, error, setting, datas, options }) => {
- if (status == '1') {
+ }).then(({ code, data, msg }) => {
+ if (data == 200) {
message.success(getLabel(83551, '保存成功!'));
this.qcSelectedRowKeys = [];
this.getQuickSearchInfo();
} else {
- message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
}
});
this.quickSearchData.setting.id = null;
@@ -171,7 +170,9 @@ export class QuickSearchStore {
// });
}
-
+ @action setQuickSearchDetailData = (datas) => {
+ this.quickSearchDetailData = datas;
+ }
/**===========================buttons=========================== */
From de6a309f42be96982a8b622b1057ddd263194804 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Fri, 11 Aug 2023 09:39:58 +0800
Subject: [PATCH 07/12] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/organization/stores/quickSearch.js | 82 +++++++++++++++-------
1 file changed, 55 insertions(+), 27 deletions(-)
diff --git a/pc4mobx/organization/stores/quickSearch.js b/pc4mobx/organization/stores/quickSearch.js
index 23979b6..08c456a 100644
--- a/pc4mobx/organization/stores/quickSearch.js
+++ b/pc4mobx/organization/stores/quickSearch.js
@@ -18,10 +18,11 @@ import { WeaLocaleProvider } from 'ecCom';
const toJS = mobx.toJS;
const getLabel = WeaLocaleProvider.getLabel;
+const formatMultiLang = WeaLocaleProvider.formatMultiLang;
export class QuickSearchStore {
-
+
@observable quickSearchForm = new WeaForm();
@observable qcSelectedRowKeys = [];
@observable quickSearchData = {
@@ -36,8 +37,8 @@ export class QuickSearchStore {
@observable qcDetailRowKeys = [];
quickSearchRefObj = {};
- /**** ==============quickSearchForm ===============*/
- @observable quickSearchFields = [
+ /**** ==============quickSearchForm ===============*/
+ @observable quickSearchFields = [
{
domkey: ['isquicksearch'],
conditionType: 'SWITCH',
@@ -100,7 +101,7 @@ export class QuickSearchStore {
id: id,
data: JSON.stringify(datas), ...formparm
}).then(({ code, data, msg }) => {
- if (data == 200) {
+ if (code == 200) {
message.success(getLabel(83551, '保存成功!'));
this.qcSelectedRowKeys = [];
this.getQuickSearchInfo();
@@ -128,7 +129,7 @@ export class QuickSearchStore {
this.quickSearchData.datas = datas;
}
- @action setQuickSearchData = (datas) => {
+ @action setQuickSearchData = (datas) => {
this.quickSearchData.datas = datas;
}
@@ -142,38 +143,65 @@ export class QuickSearchStore {
}
@action getQuickSearchDetailInfo = (cid) => {
- API.getQuickSearchDetailInfo({ cid: cid }).then(({ status, errorCode, error, setting, datas, precision }) => {
- if (status == '1') {
- this.quickSearchDetailData = datas;
- this.precision = precision;
+ API.getQuickSearchDetailInfo({ cid: cid }).then(({ code, data, msg }) => {
+ if (code == 200) {
+ this.quickSearchDetailData = data.datas;
+ this.precision = data.precision;
} else {
- message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
+ message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
}
});
}
@action("明细保存") saveQuickSearchDetailInfo = () => {
- // let datas = this.quickSearchDetailData;
- // if (!this.checkQuickSearchDetailData()) {
- // return;
- // }
- // API.saveQuickSearchDetailInfo({
- // cid: this.qcData.cid,
- // data: JSON.stringify(datas)
- // }).then(({ status, errorCode, error, setting, datas, options }: any) => {
- // if (status == '1') {
- // message.success(getLabel(83551, '保存成功!'));
- // this.qcDetailRowKeys = [];
- // this.getQuickSearchDetailInfo(this.qcData.cid);
- // } else {
- // message.error(`[${getLabel(127353, "错误") + errorCode}]:${error}`);
- // }
- // });
+ let datas = this.quickSearchDetailData;
+ if (!this.checkQuickSearchDetailData()) {
+ return;
+ }
+ API.saveQuickSearchDetailInfo({
+ cid: this.qcData.cid,
+ data: JSON.stringify(datas)
+ }).then(({ code, data, msg }) => {
+ if (code == 200) {
+ message.success(getLabel(83551, '保存成功!'));
+ this.qcDetailRowKeys = [];
+ this.getQuickSearchDetailInfo(this.qcData.cid);
+ } else {
+ message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
+ }
+ });
}
@action setQuickSearchDetailData = (datas) => {
this.quickSearchDetailData = datas;
}
+ checkQuickSearchDetailData = () => {
+ let result = true;
+ for (let i = 0; i < this.quickSearchDetailData.length; i++) {
+ let data = this.quickSearchDetailData[i];
+ if (_.trim(formatMultiLang(data.customname)) == '') {
+ this.quickSearchRefObj[`error_customname_${i}`].showError();
+ result = false;
+ break;
+ }
+ let minnum = data.minnum + '';
+ let maxnum = data.maxnum + '';
+ if ((_.trim(formatMultiLang(minnum)) == '' || minnum == undefined) && (_.trim(formatMultiLang(maxnum)) == '' || maxnum == undefined)) {
+ this.quickSearchRefObj[`error_condition_${i}`].showError();
+ result = false;
+ return;
+ }
+ if ((minnum != '' && minnum != undefined)
+ && (maxnum != '' && maxnum != undefined)
+ && (parseFloat(minnum) > parseFloat(maxnum))) {
+ message.error(getLabel('382783', "请填写正确的区间"));
+ result = false;
+ return;
+ }
+ }
+ return result;
+ }
+
/**===========================buttons=========================== */
rightMenu = [
@@ -204,5 +232,5 @@ export class QuickSearchStore {
"type": "BTN_save"
}
]
-
+
}
\ No newline at end of file
From 67947182fd615adb443826b59cce690bbe3fb419 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Fri, 11 Aug 2023 10:15:56 +0800
Subject: [PATCH 08/12] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../organization/components/fieldDefinedSet/QuickSearch.js | 4 ++--
.../components/fieldDefinedSet/QuickSearchDetail.js | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js
index 8ce48b3..3f01cf5 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearch.js
@@ -133,8 +133,8 @@ export default class QuickSearch extends React.Component {
const { quickSearch } = this.props;
let { quickSearchData } = quickSearch;
let datas = quickSearchData.datas;
- if(datas.length>=6){
- message.error(getLabel('387795',"最多只能添加6项"));
+ if(datas.length>=8){
+ message.error(getLabel('387795',"最多只能添加8项"));
return;
}
let time = new Date().getTime();
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
index 94e43ef..e1d7a1f 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
@@ -34,6 +34,11 @@ export default class QuickSearchDetail extends React.Component {
quickSearch.quickSearchDetailVisable = false;
}
+ onChange = (data) => {
+ const { quickSearch } = this.props;
+ quickSearch.setQuickSearchDetailData(data);
+ }
+
getSearchButton = () => {
const { quickSearch } = this.props;
const buttons = new Array();
@@ -258,6 +263,7 @@ class QuickSearchTableEdit extends React.Component{
}
typeof this.props.onChange === 'function' && this.props.onChange(_datas);
}
+
render() {
const { datas, rowSelection } = this.props;
return (
From 1a87a3f1180d8118f8630589df86d0175b0e69c2 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Wed, 16 Aug 2023 13:58:08 +0800
Subject: [PATCH 09/12] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E6=9D=A1=E4=BB=B6?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/organization/apis/resource.js | 5 +
.../components/fieldDefinedSet/FieldDef.js | 6 +-
.../fieldDefinedSet/QuickSearchTableEdit.js | 4 +-
pc4mobx/organization/components/job/Job.js | 2 +-
.../components/resource/resource.js | 7 +-
pc4mobx/organization/index.js | 6 +
pc4mobx/organization/stores/resource.js | 127 +++++++-----------
7 files changed, 67 insertions(+), 90 deletions(-)
diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js
index f4c16ee..d8a8aeb 100644
--- a/pc4mobx/organization/apis/resource.js
+++ b/pc4mobx/organization/apis/resource.js
@@ -31,6 +31,11 @@ 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);
}
diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js
index ffb3bd2..38f3576 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDef.js
@@ -105,9 +105,9 @@ export default class FieldDef extends Component {
}
const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)]
return (
-
{
- this.tabDom = dom
-}}>
+
{
+ this.tabDom = dom
+ }}>
setEditTable(editTable, 'fieldDef')}
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js
index c496438..914d31b 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchTableEdit.js
@@ -46,8 +46,8 @@ export default class QuickSearchTableEdit extends React.Component {
label: '',
type: 'SELECT',
key: 'showmodel',
- viewAttr: 2,
- options: [{ key: '0', showname: getLabel(149, '默认') }, { key: '1', showname: getLabel(19852, '平铺') },]
+ viewAttr: 1,
+ options: [ { key: '0', showname: getLabel(19852, '平铺') },]
}]
}
];
diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js
index e15d141..f6cd5cd 100644
--- a/pc4mobx/organization/components/job/Job.js
+++ b/pc4mobx/organization/components/job/Job.js
@@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-05-26 14:05:59
- * @LastEditTime: 2023-08-02 17:09:24
+ * @LastEditTime: 2023-08-14 11:39:45
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js
*/
diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js
index e73148e..56a3ed3 100644
--- a/pc4mobx/organization/components/resource/resource.js
+++ b/pc4mobx/organization/components/resource/resource.js
@@ -82,6 +82,7 @@ export default class Resource extends React.Component {
resource
} = this.props;
resource.getHasRight();
+ resource.getQuickSearchCondition();
let { hash } = window.location;
hash = hash.split("?")[1].split("&");
if (hash.length >= 2) {
@@ -507,7 +508,7 @@ export default class Resource extends React.Component {
} = this.props;
const {
isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition,
- form, dialogLoading, isEdit, date, hasRight, defaultShowLeft
+ form, dialogLoading, isEdit, date, hasRight, defaultShowLeft,enable
} = store;
if (hasRight === false) {
@@ -542,10 +543,10 @@ export default class Resource extends React.Component {
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
- onSearch={() => store.getTableInfo()}
+ onSearch={() => {store.hideRadioGroup();store.getTableInfo();}}
onSearchChange={val => this.onSearchChange(val)}
/>
-
+ {enable && }
this.reCalculateTableHeight = new Date().getTime(), 500);
}
- rangeConditions = [
- {
- label: '联动类型',
- options: [
- {key:'0',showname:'全部'},
- {key:'1',showname:'今天', selected: true},
- {key:'2',showname:'本周'},
- {key:'3',showname: '时间'},
- {key:'5',showname:'本年'},
- {key:'7',showname:'上个月'},
- {key:'8',showname:'数值区间'},
- {key:'6',showname:'指定日期范围'},
- ],
- domkey: ['dateFrom'],
- selectLinkageDatas: {
- '1': {
- conditionType: 'INPUT',
- domkey: ['INPUT'],
- },
- '3': {
- conditionType: 'DATEPICKER',
- domkey: ['INPUT111111121'],
- viewAttr: 3,
- format: 'YYYY',
- },
- '2': {
- conditionType: 'CHECKBOX',
- domkey: ['CHECKBOX'],
- },
- '8': {
- conditionType: 'SCOPE',
- domkey: ['CHECKBOX1', 'CHECKBOX2'],
- },
- '6': {
- conditionType: 'RANGEPICKER',
- domkey: ['start', 'end'],
- }
- },
- labelcol: 6,
- fieldcol: 18,
- },
- {
- label: '不联动类型',
- options: [
- {key:'0',showname:'全部', selected: true},
- {key:'1',showname:'外勤签到'},
- {key:'2',showname:'考勤签到/签退'},
- ],
- domkey: ['checking'],
- labelcol: 6,
- fieldcol: 18,
- },
- {
- label: '只读类型',
- viewAttr: '1',
- options: [
- {key:'0',showname:'全部'},
- {key:'1',showname:'外勤签到'},
- {key:'2',showname:'考勤签到/签退'},
- ],
- labelcol: 6,
- fieldcol: 18,
- },
- {
- label: '自定义类型',
- com: 自定义组件
,
- labelcol: 6,
- fieldcol: 18,
- }
- ];
+ @observable rangeConditions = [];
+ @observable radioParams = {};
+
@observable refreshRadioGroup = new Date().getTime();
@computed get radioGroupConfig(){
this.refreshRadioGroup;
@@ -167,24 +101,39 @@ export class ResourceStore {
}
@action onRadioGroupChangeHandle = params => {
- console.log(params);
+ this.radioParams = params;
+ this.getTableInfo();
}
@action("列表") getTableInfo() {
- let params;
this.tableStore = new TableStore();
- if (this.isEmptyObject(this.form2.getFormParams())) {
+ let params = {};
+ debugger;
+ if(this.isEmptyObject(this.radioParams)) {
params = {
...this.selectTreeNodeInfo,
- lastName: this.lastName
- };
- } else {
+ isQuickSearch:false
+ }
+ if (this.isEmptyObject(this.form2.getFormParams())) {
+ params = {
+ ...params,
+ lastName: this.lastName,
+ };
+ } else {
+ params = {
+ ...params,
+ ...this.form2.getFormParams()
+ };
+ }
+ }else {
params = {
+ ...this.radioParams,
...this.selectTreeNodeInfo,
- ...this.form2.getFormParams()
- };
+ isQuickSearch:true
+ }
}
+ this.form2.resetForm();
Api.getSearchList(params).then(res => {
if (res.code === 200) {
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
@@ -198,6 +147,7 @@ export class ResourceStore {
@action("nodetree事件") doSearch(params) {
this.selectTreeNodeInfo = params;
+ this.showRadioGroup = true;
this.getTableInfo();
}
@@ -211,7 +161,7 @@ export class ResourceStore {
return response.json()
}).then(data => {
if (data.code === 200) {
- message.success(data.msg);
+ message.success(data.msg,1);
this.getTableInfo();
this.setVisible(false);
} else {
@@ -270,6 +220,18 @@ export class ResourceStore {
})
}
+ @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);
+ })
+ }
@action("顶部按钮") getHasRight() {
Api.getHasRight().then(res => {
@@ -793,8 +755,6 @@ export class ResourceStore {
});
}
-
-
updateFields(val) {
this.form2.updateFields({
lastname: {
@@ -803,6 +763,11 @@ export class ResourceStore {
});
}
+ hideRadioGroup() {
+ this.radioParams = {};
+ this.showRadioGroup = false;
+ }
+
setSearchCondition(condition) {
this.searchCondition = condition;
}
From 26f19c32834aedebfa1fb12b02c4e704537da0dc Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Thu, 17 Aug 2023 10:56:56 +0800
Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/fieldDefinedSet/QuickSearchDetail.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
index e1d7a1f..b98697e 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QuickSearchDetail.js
@@ -165,7 +165,7 @@ class QuickSearchTableEdit extends React.Component{
{getLabel(387588, "内容自定义条件")}
, dataIndex: "condition", key: "condition", width: "40%",
com: [{ label: '', type: 'SCOP', key: 'condition', viewAttr: 3 }]
From a7a0de166e0abc4a9c96c21a035724f036085d9f Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Mon, 21 Aug 2023 18:09:48 +0800
Subject: [PATCH 11/12] =?UTF-8?q?=E4=BC=81=E9=80=9A=E5=AD=A6=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E8=87=AA=E5=AE=9A=E4=B9=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/organization/apis/qtxConfig.js | 6 +
.../components/fieldDefinedSet/QtxConfig.js | 176 ++++++++++++++++++
pc4mobx/organization/index.js | 2 +
pc4mobx/organization/stores/index.js | 4 +-
pc4mobx/organization/stores/qtxConfig.js | 155 +++++++++++++++
pc4mobx/organization/stores/quickSearch.js | 4 -
6 files changed, 342 insertions(+), 5 deletions(-)
create mode 100644 pc4mobx/organization/apis/qtxConfig.js
create mode 100644 pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js
create mode 100644 pc4mobx/organization/stores/qtxConfig.js
diff --git a/pc4mobx/organization/apis/qtxConfig.js b/pc4mobx/organization/apis/qtxConfig.js
new file mode 100644
index 0000000..08e84ad
--- /dev/null
+++ b/pc4mobx/organization/apis/qtxConfig.js
@@ -0,0 +1,6 @@
+import { WeaTools } from 'ecCom';
+
+
+export const getQtxConfigInfo = (params) => {
+ return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/getCardButtonTable', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js b/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js
new file mode 100644
index 0000000..115515c
--- /dev/null
+++ b/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js
@@ -0,0 +1,176 @@
+import React from 'react'
+import * as mobx from 'mobx'
+import {
+ inject,
+ observer
+} from 'mobx-react'
+import {
+ WeaTop, WeaFormItem, WeaTable, WeaRightMenu, WeaHelpfulTip,
+ WeaNewScroll, WeaSearchGroup, WeaLocaleProvider, WeaTab, WeaTableEdit
+} from 'ecCom'
+import {
+ Row, Col, Button, Modal, message, Input, Dropdown, Icon, Menu
+} from 'antd'
+import { WeaSwitch } from 'comsMobx'
+import {
+ i18n
+} from '../../public/i18n';
+const getLabel = WeaLocaleProvider.getLabel;
+
+const toJS = mobx.toJS;
+const confirm = Modal.confirm;
+
+
+
+@inject('qtxConfig')
+@observer
+export default class QtxConfig extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ componentWillMount() {
+ }
+
+ componentDidMount() {
+ const {
+ qtxConfig
+ } = this.props;
+ qtxConfig.initList();
+ }
+
+ componentWillUnmount() {
+ }
+
+
+ componentWillReceiveProps(nextProps) {
+ const {
+ qtxConfig
+ } = this.props;
+
+ if (this.props.location.key !== nextProps.location.key) {
+ qtxConfig.initList();
+ }
+ }
+
+ getDropMenuDatas() {
+ const {
+ qtxConfig
+ } = this.props, {
+ rightMenu
+ } = qtxConfig
+
+ let menus = [];
+ toJS(rightMenu).map((item, index) => {
+ let obj = {
+ key: item.menuFun,
+ icon:
,
+ content: item.menuName,
+ }
+ menus.push(obj);
+ })
+ return menus;
+ }
+
+ getTopMenuBtns() {
+ const {
+ qtxConfig
+ } = this.props, {
+ topMenu
+ } = qtxConfig
+
+ let btns = [];
+ topMenu.map((item, i) => {
+ btns.push(
);
+ });
+ return btns;
+ }
+
+ save = () => {
+ const {
+ qtxConfig
+ } = this.props;
+ //qtxConfig.saveQuickSearchInfo();
+ }
+
+ login = () => {
+ window.open("/api/bs/hrmorganization/config/ssoLogin", "_blank")
+ }
+
+
+
+
+ getFormItems = () => {
+ const { qtxConfig } = this.props;
+ const { configFields, configForm } = qtxConfig;
+ const arr = [];
+ const formParams = configForm.getFormParams();
+ const { isFormInit } = configForm;
+ isFormInit && configFields.map((field, index) => {
+ arr.push(
+
+
+ {}
+ {}
+
+
+ )
+ })
+
+ return
{arr}
+ }
+
+
+
+ render() {
+ const { qtxConfig: store } = this.props;
+ const { editTableData } = store, {
+ datas, columns, selectedData, loading
+ } = editTableData;
+
+ return (
+
+ { this[key] && this[key]() }}
+ >
+ }
+ iconBgcolor='#217346'
+ loading={true}
+ buttons={this.getTopMenuBtns()}
+ showDropIcon={true}
+ dropMenuDatas={this.getDropMenuDatas()}
+ onDropMenuClick={(key) => { this[key] && this[key]() }}
+ >
+
+
+ {this.getFormItems()}
+
+
+ store.setTableEditDatas(e)}
+ />
+
+
+
+
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js
index af92242..444140a 100644
--- a/pc4mobx/organization/index.js
+++ b/pc4mobx/organization/index.js
@@ -34,6 +34,7 @@ import ManagerDetach from "./components/detach/ManagerDetach";
import ColumnSetting from "./components/columnSetting";
import PersonnelResume from "./components/resource/PersonnelResume";
import QuickSearch from "./components/fieldDefinedSet/QuickSearch";
+import QtxConfig from "./components/fieldDefinedSet/QtxConfig";
import stores from "./stores";
import "./style/index";
@@ -106,6 +107,7 @@ const Routes = (
+
);
diff --git a/pc4mobx/organization/stores/index.js b/pc4mobx/organization/stores/index.js
index da356c6..c0f3814 100644
--- a/pc4mobx/organization/stores/index.js
+++ b/pc4mobx/organization/stores/index.js
@@ -28,6 +28,7 @@ import {ManagerDetachStore} from "./managerDetach";
import {ColumnSetting} from './columnSetting';
import {PersonnelResumeStore} from './personnelResume';
import { QuickSearchStore } from "./quickSearch";
+import { QtxConfigStore } from "./qtxConfig";
module.exports = {
@@ -60,5 +61,6 @@ module.exports = {
managerDetach: new ManagerDetachStore(),
columnSetting: new ColumnSetting(),
personnelResume:new PersonnelResumeStore(),
- quickSearch:new QuickSearchStore()
+ quickSearch:new QuickSearchStore(),
+ qtxConfig: new QtxConfigStore()
};
diff --git a/pc4mobx/organization/stores/qtxConfig.js b/pc4mobx/organization/stores/qtxConfig.js
new file mode 100644
index 0000000..b773c9b
--- /dev/null
+++ b/pc4mobx/organization/stores/qtxConfig.js
@@ -0,0 +1,155 @@
+import {
+ observable,
+ action,
+ computed, extendObservable
+} from 'mobx';
+import * as mobx from 'mobx';
+import * as API from '../apis/qtxConfig';
+import {
+ WeaForm
+} from 'comsMobx';
+import {
+ Modal,
+ message,
+} from 'antd'
+import {
+ i18n
+} from '../public/i18n';
+import { WeaLocaleProvider } from 'ecCom';
+
+const toJS = mobx.toJS;
+const getLabel = WeaLocaleProvider.getLabel;
+
+
+export class QtxConfigStore {
+
+ @observable configForm = new WeaForm();
+ @observable editTableData = {
+ datas: [],
+ columns: [],
+ loading: true,
+ selectedData: {}
+ };
+
+ @observable configFields = [
+ {
+ domkey: ['isopenconfig'],
+ conditionType: 'SWITCH',
+ label: getLabel('-1', "是否开启数据库配置"),
+ labelcol: 5,
+ fieldcol: 19,
+ viewAttr: 3,
+ }
+ ]
+
+ @action("初始化页面") initList = () => {
+ this.configForm.initFormFields([{ items: this.configFields.slice() }]);
+ this.getQtxConfigInfo();
+ }
+
+ @action clearConfigData = () => {
+ this.editTableData.datas = [];
+ this.editTableData.columns = [];
+ this.editTableData.loading = true;
+
+ }
+
+ @action("数据获取") getQtxConfigInfo = () => {
+ this.clearConfigData();
+ API.getQtxConfigInfo().then(action(({ code, data, msg }) => {
+ if (code == 200) {
+ const { columns, datas } = data;
+ extendObservable(this.editTableData, {
+ datas: datas,
+ columns: columns,
+ loading: false
+ });
+ // this.configForm.updateFields({
+ // isquicksearch: data.setting.isquicksearch,
+ // });
+ } else {
+ message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
+ }
+ }));
+ }
+
+ setTableEditDatas = (e) => {
+ debugger;
+ if(e.length > 1) {
+ e.pop();
+ message.error("默认只能添加一条配置数据!!!")
+ }
+ extendObservable(this.editTableData, {
+ datas: e
+ });
+ }
+
+ @action("保存页面") saveQtxConfigInfo = () => {
+ // let datas = this.quickSearchData.datas;
+ // datas.map((data, index) => {
+ // data.orderid = index
+ // });
+
+ // let formparm = this.configForm.getFormParams();
+ // if (!this.checkQuickSearchData()) {
+ // message.error(getLabel('387954', "条件字段不能重复"));
+ // return;
+ // }
+ // let id = this.quickSearchData.setting.id;
+ // if (id == null) {
+ // return;
+ // }
+ // API.saveQuickSearchInfo({
+ // id: id,
+ // data: JSON.stringify(datas), ...formparm
+ // }).then(({ code, data, msg }) => {
+ // if (code == 200) {
+ // message.success(getLabel(83551, '保存成功!'));
+ // this.qcSelectedRowKeys = [];
+ // this.getQuickSearchInfo();
+ // } else {
+ // message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
+ // }
+ // });
+ // this.quickSearchData.setting.id = null;
+ }
+
+ /**===========================buttons=========================== */
+ rightMenu = [
+ {
+ "isBatch": "0",
+ "isTop": "1",
+ "menuFun": "save",
+ "menuIcon": "icon-coms-Preservation",
+ "menuName": "保存",
+ "type": "BTN_save"
+ },
+ {
+ "isBatch": "0",
+ "isTop": "0",
+ "menuFun": "login",
+ "menuIcon": "icon-coms-link",
+ "menuName": "单点登录",
+ "type": "BTN_link"
+ }
+ ];
+ topMenu = [
+ {
+ "isBatch": "1",
+ "isTop": "1",
+ "menuFun": "save",
+ "menuIcon": "icon-coms-Preservation",
+ "menuName": "保存",
+ "type": "BTN_save"
+ },
+ {
+ "isBatch": "1",
+ "isTop": "1",
+ "menuFun": "login",
+ "menuIcon": "icon-coms-link",
+ "menuName": "单点登录",
+ "type": "BTN_link"
+ }
+ ]
+
+}
\ No newline at end of file
diff --git a/pc4mobx/organization/stores/quickSearch.js b/pc4mobx/organization/stores/quickSearch.js
index 08c456a..328b76e 100644
--- a/pc4mobx/organization/stores/quickSearch.js
+++ b/pc4mobx/organization/stores/quickSearch.js
@@ -129,10 +129,6 @@ export class QuickSearchStore {
this.quickSearchData.datas = datas;
}
- @action setQuickSearchData = (datas) => {
- this.quickSearchData.datas = datas;
- }
-
/**============================quickdetail===================== */
@action("设置") openQuickSearchDetail = (record) => {
this.quickSearchDetailVisable = true;
From 403d040956f7e59c0fcf924109bc1fd935ea4d07 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Tue, 22 Aug 2023 18:07:47 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E4=BC=81=E9=80=9A=E5=AD=A6=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/organization/apis/qtxConfig.js | 7 +-
.../components/fieldDefinedSet/QtxConfig.js | 4 +-
pc4mobx/organization/stores/qtxConfig.js | 66 ++++++++++---------
3 files changed, 43 insertions(+), 34 deletions(-)
diff --git a/pc4mobx/organization/apis/qtxConfig.js b/pc4mobx/organization/apis/qtxConfig.js
index 08e84ad..0424d9c 100644
--- a/pc4mobx/organization/apis/qtxConfig.js
+++ b/pc4mobx/organization/apis/qtxConfig.js
@@ -2,5 +2,8 @@ import { WeaTools } from 'ecCom';
export const getQtxConfigInfo = (params) => {
- return WeaTools.callApi('/api/bs/hrmorganization/cardAccess/getCardButtonTable', 'GET', params);
-}
\ No newline at end of file
+ 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/components/fieldDefinedSet/QtxConfig.js b/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js
index 115515c..42ffc21 100644
--- a/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js
+++ b/pc4mobx/organization/components/fieldDefinedSet/QtxConfig.js
@@ -90,7 +90,8 @@ export default class QtxConfig extends React.Component {
const {
qtxConfig
} = this.props;
- //qtxConfig.saveQuickSearchInfo();
+ let result = this.tableEdit.refs.edit.doRequiredCheck();
+ result.pass && qtxConfig.saveQtxConfigInfo();
}
login = () => {
@@ -157,6 +158,7 @@ export default class QtxConfig extends React.Component {
{this.tableEdit = el}}
draggable
deleteConfirm
showCopy={false}
diff --git a/pc4mobx/organization/stores/qtxConfig.js b/pc4mobx/organization/stores/qtxConfig.js
index b773c9b..fe0bd2e 100644
--- a/pc4mobx/organization/stores/qtxConfig.js
+++ b/pc4mobx/organization/stores/qtxConfig.js
@@ -64,9 +64,9 @@ export class QtxConfigStore {
columns: columns,
loading: false
});
- // this.configForm.updateFields({
- // isquicksearch: data.setting.isquicksearch,
- // });
+ this.configForm.updateFields({
+ isopenconfig: data.isopenconfig,
+ });
} else {
message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
}
@@ -74,7 +74,6 @@ export class QtxConfigStore {
}
setTableEditDatas = (e) => {
- debugger;
if(e.length > 1) {
e.pop();
message.error("默认只能添加一条配置数据!!!")
@@ -85,35 +84,40 @@ export class QtxConfigStore {
}
@action("保存页面") saveQtxConfigInfo = () => {
- // let datas = this.quickSearchData.datas;
- // datas.map((data, index) => {
- // data.orderid = index
- // });
-
- // let formparm = this.configForm.getFormParams();
- // if (!this.checkQuickSearchData()) {
- // message.error(getLabel('387954', "条件字段不能重复"));
- // return;
- // }
- // let id = this.quickSearchData.setting.id;
- // if (id == null) {
- // return;
- // }
- // API.saveQuickSearchInfo({
- // id: id,
- // data: JSON.stringify(datas), ...formparm
- // }).then(({ code, data, msg }) => {
- // if (code == 200) {
- // message.success(getLabel(83551, '保存成功!'));
- // this.qcSelectedRowKeys = [];
- // this.getQuickSearchInfo();
- // } else {
- // message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
- // }
- // });
- // this.quickSearchData.setting.id = null;
+ if(this.editTableData.datas.length == 0) {
+ return message.error("至少保存一条配置数据!!")
+ }
+ let editTable = JSON.stringify(this.editTableData.datas[0]);
+ API.saveQtxConfigInfo({
+ ...this.configForm.getFormParams(),
+ editTable,
+ }).then(({ code, data, msg }) => {
+ if (code == 200) {
+ message.success(getLabel(83551, '保存成功!'));
+ this.getQtxConfigInfo();
+ } else {
+ message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
+ }
+ });
}
+ arrToJson = (arr) => {
+ 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];
+ }
+ });
+
+ return json;
+ }
+
+
/**===========================buttons=========================== */
rightMenu = [
{