快捷条件设置
This commit is contained in:
parent
67947182fd
commit
1a87a3f118
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ export default class FieldDef extends Component {
|
|||
}
|
||||
const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)]
|
||||
return (
|
||||
<div className={classes} ref={dom => {
|
||||
this.tabDom = dom
|
||||
}}>
|
||||
<div className={classes} style={{"height":"calc(100% - 47px)"}} ref={dom => {
|
||||
this.tabDom = dom
|
||||
}}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@43qdk8`} datas={rMenu}>
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@5fu5eh`} tableProps={tableProps} viewAttr={3} rowKey={'fieldidrowKey'}
|
||||
ref={(editTable) => setEditTable(editTable, 'fieldDef')}
|
||||
|
|
|
|||
|
|
@ -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, '平铺') },]
|
||||
}]
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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)}
|
||||
/>
|
||||
<GroupList ecId={`${this && this.props && this.props.ecId || ''}_GroupList@2le78y`} store={store} />
|
||||
{enable && <GroupList ecId={`${this && this.props && this.props.ecId || ''}_GroupList@2le78y`} store={store} />}
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ import QuickSearch from "./components/fieldDefinedSet/QuickSearch";
|
|||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
|
||||
// 全局配置
|
||||
message.config({
|
||||
duration: 0.8, // 默认持续时间为 3 秒
|
||||
maxCount: 1, // 全局最大显示数量为 3
|
||||
});
|
||||
|
||||
// 读取系统多语言配置
|
||||
let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(
|
||||
this,
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ export class ResourceStore {
|
|||
|
||||
@observable selectTreeNodeInfo;
|
||||
|
||||
@observable enable = false;
|
||||
@observable _showRadioGroup = true;
|
||||
@computed get showRadioGroup() { return this._showRadioGroup }
|
||||
set showRadioGroup(v) {
|
||||
|
|
@ -84,76 +85,9 @@ export class ResourceStore {
|
|||
dom && Object.assign(this.domRef, { [type]: dom }) && setTimeout(() => 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: <div>自定义组件<Button>自定义</Button></div>,
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue