Merge pull request 'feature/cl' (#42) from feature/cl into dev

Reviewed-on: http://221.226.25.34:3000/liang.cheng/trunk/pulls/42
This commit is contained in:
liang.cheng 2023-08-23 11:01:45 +08:00
commit ff482709cd
21 changed files with 1806 additions and 272 deletions

View File

@ -0,0 +1,9 @@
import { WeaTools } from 'ecCom';
export const getQtxConfigInfo = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/config/selectConfigInfo', 'GET', params);
}
export const saveQtxConfigInfo = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/config/saveConfigInfo', 'POST', params);
}

View File

@ -0,0 +1,16 @@
import {
WeaTools
} from 'ecCom';
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);

View File

@ -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);
}

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-05-18 14:52:39
* @LastEditTime: 2023-07-26 18:59:02
* @LastEditTime: 2023-08-04 16:52:47
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
*/
@ -28,11 +28,16 @@ import AttachToNumberField from "../NewNumberField";
export default class CompanyExtend extends React.Component {
componentDidMount() {
this.init();
this.handleHashChange();
window.addEventListener('hashchange', this.handleHashChange);
}
init = () => {
componentWillUnmount() {
window.removeEventListener('hashchange', this.handleHashChange);
}
handleHashChange = () => {
const { companyExtend, company } = this.props;
//const {id} = company;
let { hash } = window.location;
hash = hash.split("?")[0];
let id = hash.match("[^/]+(?=/$|$)")[0];
@ -129,7 +134,7 @@ export default class CompanyExtend extends React.Component {
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
{field.domkey[0] == 'subcompanycode' && <AttachToNumberField field={field} form={form} isEdit={true} />}
{field.domkey[0] == 'subcompanycode' && isEditor &&<AttachToNumberField field={field} form={form} isEdit={true} />}
</WeaFormItem>),
colSpan: 1
});
@ -231,7 +236,7 @@ export default class CompanyExtend extends React.Component {
}
backCard = () => {
this.init();
this.handleHashChange();
}
view = () => {

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-05-18 16:23:32
* @LastEditTime: 2023-07-26 18:41:11
* @LastEditTime: 2023-08-08 11:23:40
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
*/

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-06-02 09:20:03
* @LastEditTime: 2023-07-26 18:59:14
* @LastEditTime: 2023-08-04 16:51:56
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js
*/
@ -29,9 +29,15 @@ import '../../style/common.less';
export default class DepartmentExtendStore extends React.Component {
componentDidMount() {
this.init();
this.handleHashChange();
window.addEventListener('hashchange', this.handleHashChange);
}
init = () => {
componentWillUnmount() {
window.removeEventListener('hashchange', this.handleHashChange);
}
handleHashChange = () => {
const { departmentExtend, department } = this.props;
let { hash } = window.location;
hash = hash.split("?")[0];
@ -242,7 +248,7 @@ export default class DepartmentExtendStore extends React.Component {
}
backCard = () => {
this.init();
this.handleHashChange();
}
changeData(key) {

View File

@ -105,7 +105,7 @@ export default class FieldDef extends Component {
}
const rMenu = [...rightMenu, ...store.getBasicMenus(this.props.logSmallType, this.props.targetId)]
return (
<div className={classes} ref={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}>

View File

@ -0,0 +1,178 @@
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: <i className={`${item.menuIcon}`} />,
content: item.menuName,
}
menus.push(obj);
})
return menus;
}
getTopMenuBtns() {
const {
qtxConfig
} = this.props, {
topMenu
} = qtxConfig
let btns = [];
topMenu.map((item, i) => {
btns.push(<Button type='primary' onClick={() => { this[item.menuFun] && this[item.menuFun](); }}>{item.menuName}</Button>);
});
return btns;
}
save = () => {
const {
qtxConfig
} = this.props;
let result = this.tableEdit.refs.edit.doRequiredCheck();
result.pass && qtxConfig.saveQtxConfigInfo();
}
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(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} offset={1}>
<div style={{ marginTop: 20 }}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
label={`${field.label}`}
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={configForm} formParams={formParams} />}
{<WeaHelpfulTip
style={{"marginLeft":"20px"}}
ecId={`${this && this.props && this.props.ecId || ""}_WeaHelpfulTip@4vdvfp@${index}`}
title="未启用的情况下,企通学配置信息将从qtx_sso_login.properties配置文件中读取" />}
</WeaFormItem>
</div>
</Col>)
})
return <Row>{arr}</Row>
}
render() {
const { qtxConfig: store } = this.props;
const { editTableData } = store, {
datas, columns, selectedData, loading
} = editTableData;
return (
<div ref='page' style={{ height: '100%' }}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
datas={this.getDropMenuDatas()}
onClick={key => { this[key] && this[key]() }}
>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
title={"企通学配置自定义"}
icon={<i className='icon-coms-hrm' />}
iconBgcolor='#217346'
loading={true}
buttons={this.getTopMenuBtns()}
showDropIcon={true}
dropMenuDatas={this.getDropMenuDatas()}
onDropMenuClick={(key) => { this[key] && this[key]() }}
>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@ddy3vv`} needTigger={false} showGroup={true} title={getLabel(82751, "基础设置")}>
{this.getFormItems()}
</WeaSearchGroup>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@s8pupj`} needTigger={false} showGroup={true} title={getLabel(-1, "数据库设置")}>
<WeaTableEdit
ecId={`${this && this.props && this.props.ecId || ""}_WeaTableEdit@7rorir`}
ref={el => {this.tableEdit = el}}
draggable
deleteConfirm
showCopy={false}
title=""
columns={toJS(columns)}
datas={toJS(datas)}
selectedData={!loading && toJS(selectedData)}
onChange={e => store.setTableEditDatas(e)}
/>
</WeaSearchGroup>
</WeaTop>
</WeaRightMenu>
</div>
)
}
}

View File

@ -0,0 +1,262 @@
import React from 'react'
import * as mobx from 'mobx'
import {
inject,
observer
} from 'mobx-react'
import {
WeaTop, WeaFormItem, WeaTable, WeaRightMenu,
WeaNewScroll, WeaSearchGroup, WeaLocaleProvider, WeaTab
} from 'ecCom'
import {
Row, Col, Button, Modal, message, Input, Dropdown, Icon, Menu
} from 'antd'
import { WeaSwitch } from 'comsMobx'
import {
i18n
} from '../../public/i18n';
import QuickSearchTableEdit from './QuickSearchTableEdit';
import QuickSearchDetail from './QuickSearchDetail';
const getLabel = WeaLocaleProvider.getLabel;
const toJS = mobx.toJS;
const confirm = Modal.confirm;
@inject('quickSearch')
@observer
export default class QuickSearch extends React.Component {
constructor(props) {
super(props);
}
componentWillMount() {
}
componentDidMount() {
const {
quickSearch
} = this.props;
quickSearch.initList();
}
componentWillUnmount() {
}
componentWillReceiveProps(nextProps) {
const {
quickSearch
} = this.props;
if (this.props.location.key !== nextProps.location.key) {
quickSearch.initList();
}
}
getDropMenuDatas() {
const {
quickSearch
} = this.props,{
rightMenu
} = quickSearch
let menus = [];
toJS(rightMenu).map((item, index) => {
let obj = {
key: item.menuFun,
icon: <i className={`${item.menuIcon}`} />,
content: item.menuName,
}
menus.push(obj);
})
return menus;
}
getTopMenuBtns() {
const {
quickSearch
} = this.props,{
topMenu
} = quickSearch
let btns = [];
topMenu.map((item, i) => {
btns.push(<Button type='primary' onClick={() => {this[item.menuFun] && this[item.menuFun]();}}>{item.menuName}</Button>);
});
return btns;
}
save = () => {
const {
quickSearch
} = this.props;
quickSearch.saveQuickSearchInfo();
}
getFormItems = () => {
const { quickSearch } = this.props;
const { quickSearchFields, quickSearchForm } = quickSearch;
const arr = [];
const formParams = quickSearchForm.getFormParams();
const { isFormInit } = quickSearchForm;
isFormInit && quickSearchFields.map((field, index) => {
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} offset={1}>
<div style={{ marginTop: 20 }}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
label={`${field.label}`}
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={quickSearchForm} formParams={formParams} />}
</WeaFormItem>
</div>
</Col>)
})
return <Row>{arr}</Row>
}
getSearchButton = () => {
return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@7xw5i9@addRow`} type="primary" shape="circle" title={getLabel(611, '添加')} size="small" disabled={0} onClick={() => {
this.addRow();
}}><i className="anticon anticon-plus"></i></Button>),
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@lzrtmm@delRow`} shape="circle" title={getLabel(126371, '删除')} size="small" onClick={() => {
this.delRow();
}} ><i className="anticon anticon-minus"></i></Button>
]
}
addRow = () => {
const { quickSearch } = this.props;
let { quickSearchData } = quickSearch;
let datas = quickSearchData.datas;
if(datas.length>=8){
message.error(getLabel('387795',"最多只能添加8项"));
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 { 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) => {
let keyarr = [];
rows.map(row => {
keyarr.push(row.key);
});
const { quickSearch } = this.props;
quickSearch.qcSelectedRowKeys = keyarr;
}
onChange = (data) => {
const { quickSearch } = this.props;
quickSearch.setQuickSearchData(data);
}
render() {
const { quickSearch: store } = this.props;
const { qcSelectedRowKeys } = store;
const rowSelection = {
selectedRowKeys: qcSelectedRowKeys,
onChange: this.onSelectChange,
}
return (
<div ref='page' style={{ height: '100%' }}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
datas={this.getDropMenuDatas()}
onClick={key => {this[key] && this[key]()}}
>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
title={"快捷搜索自定义"}
icon={<i className='icon-coms-hrm' />}
iconBgcolor='#217346'
loading={true}
buttons={this.getTopMenuBtns()}
showDropIcon={true}
dropMenuDatas={this.getDropMenuDatas()}
onDropMenuClick={(key) => {this[key] && this[key]()}}
>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@weabdm`}>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@ddy3vv`} needTigger={false} showGroup={true} title={getLabel(82751, "基础设置")}>
{this.getFormItems()}
</WeaSearchGroup>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@s8pupj`} needTigger={false} showGroup={true} title={getLabel(384165, "条件字段")}>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@sxnhjh`}
keyParam="key" //主键
buttons={this.getSearchButton()}
/>
<QuickSearchTableEdit ecId={`${this && this.props && this.props.ecId || ''}_QuickSearchTableEdit@1xviqu`}
datas={toJS(store.quickSearchData.datas)}
options={toJS(store.quickSearchData.options)}
onChange={this.onChange}
rowSelection={rowSelection}
ListProps={this.props}
/>
</WeaSearchGroup>
</WeaNewScroll>
<QuickSearchDetail ecId={`${this && this.props && this.props.ecId || ''}_QuickSearchDetail@plu05u`} {...this.props}/>
</WeaTop>
</WeaRightMenu>
</div>
)
}
}

View File

@ -0,0 +1,280 @@
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;
}
onChange = (data) => {
const { quickSearch } = this.props;
quickSearch.setQuickSearchDetailData(data);
}
getSearchButton = () => {
const { quickSearch } = this.props;
const buttons = new Array();
buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@spalvu@addRow`} type="primary" shape="circle" title={getLabel(611, '添加')} size="small" disabled={0} onClick={() => {
this.addRow();
}}><i className="anticon anticon-plus"></i></Button>);
buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@zz4kgt@delRow`} title={getLabel(126371, '删除')} shape="circle" size="small" onClick={() => {
this.delRow();
}} ><i className="anticon anticon-minus"></i></Button>);
return buttons;
}
addRow = () => {
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 { 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() {
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 = [
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@va8uvk@save`} onClick={() => this.save()} type="primary">{getLabel(86, "保存")}</Button>,
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@edy7ux@closeDialog`} onClick={() => { this.closeDialog() }}>{getLabel(309, "关闭")}</Button>
]
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@d0kgwh`} style={{ width: 800, height: 550 }}
visible={store.quickSearchDetailVisable}
title={getLabel('387685', "自定义条件设置")}
iconBgcolor="#217346"
icon='icon-coms-hrm'
onCancel={this.closeDialog}
buttons={buttons}
>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@x6apdm`} ref="sc" height={Height?Height:530}>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@d5750t`} needTigger={false} showGroup={true} >
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@85m7gk`}
keyParam="key" //主键
buttons={this.getSearchButton()}
/>
<QuickSearchTableEdit ecId={`${this && this.props && this.props.ecId || ''}_QuickSearchTableEdit@immgug`}
datas={toJS(store.quickSearchDetailData)}
precision={store.precision}
onChange={this.onChange}
rowSelection={rowSelection}
ListProps={this.props}
/>
</WeaSearchGroup>
</WeaNewScroll>
</WeaDialog>
)
}
}
@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: <div>
{getLabel(387588, "内容自定义条件")}&nbsp;
<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@6znscx@condition`}
width = {196} //如果要自定义宽度,在这里设置
title={getLabel('526162','数值关系: 下限值 <= 数值 < 上限值') }
/>
</div>, 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(<span></span>);
} else {
const { key, viewAttr = 2, type = 'INPUT', width, otherParams = {} } = c;
const _type = type.toUpperCase();
_com.push(
<span>
{
_type === 'INPUT' &&
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@z6mgxq@${index}`}
tipPosition={(index == 0 || index+1==datas.length) ? 'top':'bottom'}
error={getLabel('385869', "此项必填")}
style={{ width: "98%" }}
ref={ref => quickSearchRefObj[`error_${key}_${index}`] = ref}
>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@mz6i71@${index}`}
value={record[key]}
viewAttr={viewAttr}
onChange={(value) => this.onEdit(record, index, key, value)}
{...otherParams}
/>
</WeaError>
}
{
_type === 'SCOP' &&
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@bvnfbi@${index}`}
tipPosition={(index == 0 || index+1==datas.length) ? 'top':'bottom'}
error={getLabel('385869', "此项必填")}
ref={ref => quickSearchRefObj[`error_${key}_${index}`] = ref}
>
<div className={(record['minnum'] === '' || record['minnum'] == undefined) && (record['maxnum'] === '' || record['maxnum'] == undefined) ? "required" : ""}>
<WeaScope ecId={`${this && this.props && this.props.ecId || ''}_WeaScope@zu7wra@${index}`}
isMobx
hideOps={true}
precision={this.props.precision}
value={[record['minnum'], record['maxnum']]}
onChange={(value) => this.onEdit(record, index, key, value)}
/>
</div>
</WeaError>
}
{
_type === 'INPUTNUMBER' &&
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@chty4d@${index}`}
value={record[key]}
style={{ width, display: 'inline-block' }}
viewAttr={viewAttr}
onChange={(value1) => this.onEdit(record, index, key, value1)}
{...otherParams}
/>
}
</span>
)
}
});
return (
<div>
{_com}
</div>
)
}
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 (
<div className="wev-cube-table-inner-warp">
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@nytlcm`}
rowSelection={rowSelection}
columns={this.getColumns()}
dataSource={datas}
pagination={false}
/>
</div>
)
}
}

View File

@ -0,0 +1,233 @@
import React from 'react'
import * as mobx from 'mobx'
import {
inject,
observer
} from 'mobx-react'
import {
WeaTable, WeaLocaleProvider, WeaSelect, WeaInput, WeaInputNumber
} from 'ecCom'
import {
Row, Col, Button, Modal, message, Input, Dropdown, Icon, Menu
} from 'antd'
import {
i18n
} from '../../public/i18n';
const getLabel = WeaLocaleProvider.getLabel;
import jQuery from "jquery";
const toJS = mobx.toJS;
export default class QuickSearchTableEdit extends React.Component {
/**========================table字段类型=====================*/
getColumns = () => {
let columnArray = [
{
title: getLabel(261, "字段"), dataIndex: "fieldid", key: "fieldid", width: "18%",
com: [{ label: '', type: 'SELECT', isLink: true, key: 'fieldid', options: [] }]
},
{
title: getLabel(195, "名称"), dataIndex: "customname", key: "customname", width: "18%",
com: [{
label: '', type: 'INPUT', key: 'customname', viewAttr: 2, otherParams: { isBase64: true, inputType: "multilang" }
}]
},
{
title: getLabel(389518, "查询范围"), dataIndex: "range", key: "range", width: "8%",
com: [{ label: '', type: 'INPUT', key: 'range', viewAttr: 1 }]
},
{
title: getLabel(387588, "内容自定义条件"), dataIndex: "condition", key: "condition", width: "15%",
com: [{ label: '', type: 'BUTTON', key: 'condition', viewAttr: 1 }]
}, {
title: getLabel(21657, "显示模式"), dataIndex: "showmodel", key: "showmodel", width: "15%",
com: [{
label: '',
type: 'SELECT',
key: 'showmodel',
viewAttr: 1,
options: [ { key: '0', showname: getLabel(19852, '平铺') },]
}]
}
];
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 {
quickSearch: store
} = this.props;
const { com } = _col;
let _com = [];
com.map((c, idn) => {
if (typeof c.props === 'object') {
_com.push(<span></span>);
} else {
const { key, isLink = false, viewAttr = 2, type = 'INPUT', width, otherParams = {}, detailtype = 1, options = [] } = c;
const _type = type.toUpperCase();
record.range = record.type == '1' ? getLabel('387636', "内容自定义") : getLabel('387637', "字段本身值");
record.condition = record.type == '1' ? getLabel('68', "设置") : '';
if (_type === 'INPUT') {
_com.push(<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@gedh14@${idn}`}
style={{ minWidth: 60 }}
value={record[key]}
viewAttr={viewAttr}
onChange={(value) => this.onEdit(record, index, key, value)}
{...otherParams}
length={100}
/>)
} else if (_type === 'BUTTON') {
_com.push(<a onClick={() => this.onClick(record)}
style={{ width, display: 'inline-block' }}>{record[key]}</a>);
} else if (_type === 'INPUTNUMBER') {
_com.push(<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@9qqytl@${idn}`}
value={record[key]}
style={{ width, display: 'inline-block' }}
viewAttr={viewAttr}
onChange={(value) => this.onEdit(record, index, key, value)}
{...otherParams}
/>)
} else if (_type === 'SELECT') {
if (isLink) {
_com.push(<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@h3f5u2@${idn}`}
style={{ width, display: 'inline-block', minWidth: 173 }}
options={toJS(this.props.options)}
viewAttr={viewAttr}
value={record[key]}
detailtype={detailtype}
onChange={(value) => {
this.onEdit(record, index, key, value)
}}
showSearch
filterOption={(inputValue, option) => this.selectFilterOption(inputValue, option)}
/>);
}else if (key === 'showmodel') {//可以设置平铺的类型
const opt = this.props.options.filter(item => item.fieldid === record.fieldid);
const isShowModel = opt[0] ? opt[0].isShowModel : false;
if (isShowModel) {
if (!record[key]) {
record[key] = '0'
}
_com.push(<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@ffcq2z@${idn}`}
style={{ width, display: 'inline-block' }}
options={options}
viewAttr={viewAttr}
value={record[key]}
detailtype={detailtype}
onChange={(value) => {
this.onEdit(record, index, key, value)
}}
filterOption={(inputValue, option) => selectFilterOption(inputValue, option)}
/>);
}
}
}
}
});
return (
<div className="cube-quicksearch-list-form">{_com}</div>
)
};
onDropChange = (data) => {
typeof this.props.onChange === 'function' && this.props.onChange(data);
}
onClick = (record) => {
const { ListProps } = this.props;
const { quickSearch } = ListProps;
let key = record.key;
if (key.indexOf("new") >= 0 || record.fieldid != record.orifieldid) {
message.error(getLabel(82228, "请先保存再设置条件"));
return;
}
quickSearch.openQuickSearchDetail(record);
};
onEdit = (record, index, key, value, name, data) => {
const { datas } = this.props;
let _datas = [...datas];
_datas[index][key] = value;
if (key == 'fieldid') {
let opt = this.getType(value);
if (opt != null) {
_datas[index].type = opt['type'];
_datas[index].customname = opt['showname'];
_datas[index].range = _datas[index].type == '1' ? getLabel('387636', "内容自定义") : getLabel('387637', "字段本身值");
_datas[index].condition = _datas[index].type == '1' ? getLabel('68', "设置") : '';
_datas[index].isdetailtable = opt['isdetailtable'];
}
}
typeof this.props.onChange === 'function' && this.props.onChange(_datas);
}
getType = (key) => {
let option = null;
this.props.options.map(f => {
if (f.key == key) {
option = f;
}
});
return option;
}
/**
* 根据选择框的名称搜索过滤选项
* @param inputValue
* @param option
*/
selectFilterOption = (inputValue, option) => {
if (inputValue != "") {
const { children } = option["props"];
if (children) {
if ((typeof children) == "string") {
return children.toLowerCase().indexOf(inputValue.toLowerCase()) != -1;
} else if ((typeof children) == "object" && children.length > 0) {
const childrenNew = children[0]["props"]["children"];
if (childrenNew) {
return childrenNew.toLowerCase().indexOf(inputValue.toLowerCase()) != -1;
} else {
return false;
}
} else {
const childrenNew = children["props"]["children"];
if (childrenNew) {
return childrenNew.toLowerCase().indexOf(inputValue.toLowerCase()) != -1;
} else {
return false;
}
}
} else {
return false;
}
}
return true;
}
render() {
const { datas, rowSelection } = this.props;
return (
<div className="wev-cube-table-inner-warp">
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@ofga8g`}
rowSelection={rowSelection}
columns={this.getColumns()}
dataSource={datas}
pagination={false}
draggable={true}
onDrop={this.onDropChange}
/>
</div>
)
}
}

View File

@ -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
*/

View File

@ -0,0 +1,39 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaRadioGroup, WeaLocaleProvider} from 'ecCom';
import classnames from 'classnames';
@observer
export default class GroupList extends Component{
render(){
const {store} = this.props;
const {setDomRef,radioGroupConfig, showRadioGroup} = store;
const displayClassName = classnames({
radioGroupShow: true,
radioGroupHide: !showRadioGroup
})
const iconClassName = classnames({
'icon-coms-down-001': !showRadioGroup,
'icon-coms-up-001': showRadioGroup
})
const label = showRadioGroup ? '隐藏条件' : '显示条件';
return (
<div ref={dom => setDomRef(dom, 'tab')}>
<div className='searchGroup'>
<div className={displayClassName} onClick={() => store.showRadioGroup = !showRadioGroup}>
<span>{label}</span>
<span>
<i className={iconClassName} />
</span>
</div>
<div style={{display: showRadioGroup ? 'block' : 'none'}}>
<WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@6w8eqc`} {...radioGroupConfig} />
</div>
</div>
</div>
)
}
}

View File

@ -36,12 +36,14 @@ import {
} from '../../public/i18n';
//import '../../style/common.less';
import '../../style/resource.less';
import NewAndEditDialog from '../NewAndEditDialog';
import { renderNoright } from '../../util';
import DatasImport from '../import/datasImport';
import SearchCustomDialog from './SearchCustomDialog';
import NewWeaTableEditDialog from '../NewWeaTableEditDialog';
import GroupList from './GroupList';
@ -80,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) {
@ -501,13 +504,12 @@ export default class Resource extends React.Component {
render() {
const {
resource,
resource: store
} = this.props;
const {
isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition,
form, dialogLoading, isEdit, date, hasRight, defaultShowLeft
} = resource;
form, dialogLoading, isEdit, date, hasRight, defaultShowLeft,enable
} = store;
if (hasRight === false) {
return renderNoright();
@ -535,15 +537,16 @@ export default class Resource extends React.Component {
showSearchAd={isPanelShow}
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? lastName : form2.getFormParams().lastName}
searchsBasePlaceHolder='请输入姓名'
setShowSearchAd={bool => resource.setPanelStatus(bool)}
hideSearchAd={() => resource.setPanelStatus(false)}
setShowSearchAd={bool => store.setPanelStatus(bool)}
hideSearchAd={() => store.setPanelStatus(false)}
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
onSearch={() => resource.getTableInfo()}
onSearch={() => {store.hideRadioGroup();store.getTableInfo();}}
onSearchChange={val => this.onSearchChange(val)}
/>
{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}

View File

@ -32,11 +32,19 @@ 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 QtxConfig from "./components/fieldDefinedSet/QtxConfig";
import stores from "./stores";
import "./style/index";
// 全局配置
message.config({
duration: 0.8, // 默认持续时间为 3 秒
maxCount: 1, // 全局最大显示数量为 3
});
// 读取系统多语言配置
let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(
this,
@ -98,7 +106,8 @@ const Routes = (
<Route key="managerDetach" path="managerDetach" component={ManagerDetach} />
<Route key="columnSetting" path="columnSetting" component={ColumnSetting} />
<Route key="personnelResume" path="personnelResume/:id" component={PersonnelResume} />
<Route key="quickSearch" path="quickSearch" component={QuickSearch} />
<Route key="qtxConfig" path="qtxConfig" component={QtxConfig} />
</Route>
);

View File

@ -26,7 +26,9 @@ 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";
import { QtxConfigStore } from "./qtxConfig";
module.exports = {
@ -58,5 +60,7 @@ module.exports = {
resourceCard:new ResourceCardStore(),
managerDetach: new ManagerDetachStore(),
columnSetting: new ColumnSetting(),
personnelResume:new PersonnelResumeStore()
personnelResume:new PersonnelResumeStore(),
quickSearch:new QuickSearchStore(),
qtxConfig: new QtxConfigStore()
};

View File

@ -0,0 +1,159 @@
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({
isopenconfig: data.isopenconfig,
});
} else {
message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
}
}));
}
setTableEditDatas = (e) => {
if(e.length > 1) {
e.pop();
message.error("默认只能添加一条配置数据!!!")
}
extendObservable(this.editTableData, {
datas: e
});
}
@action("保存页面") saveQtxConfigInfo = () => {
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 = [
{
"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"
}
]
}

View File

@ -0,0 +1,232 @@
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;
const formatMultiLang = WeaLocaleProvider.formatMultiLang;
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;
@observable qcDetailRowKeys = [];
quickSearchRefObj = {};
/**** ==============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().then(action(({ code, data, msg }) => {
if (code == 200) {
this.quickSearchData.setting = data.setting;
this.quickSearchData.datas = data.datas.map(d => {
return { ...d, visible: false }
});
this.quickSearchData.groupidOptions = data.groupidOptions;
this.quickSearchData.options = data.options;
this.quickSearchForm.updateFields({
isquicksearch: data.setting.isquicksearch,
});
} else {
message.error(`[${getLabel(127353, "错误") + code}]:${msg}`);
}
}));
}
@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;
}
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;
}
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;
}
/**============================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(({ code, data, msg }) => {
if (code == 200) {
this.quickSearchDetailData = data.datas;
this.precision = data.precision;
} else {
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(({ 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 = [
{
"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"
}
]
}

View File

@ -59,21 +59,81 @@ export class ResourceStore {
@observable selectTreeNodeInfo;
@observable enable = false;
@observable _showRadioGroup = true;
@computed get showRadioGroup() { return this._showRadioGroup }
set showRadioGroup(v) {
this._showRadioGroup = v;
setTimeout(() => {
this.reCalculateTableHeight = new Date().getTime();
}, 0)
}
domRef = {};
@observable _reCalculateTableHeight = new Date().getTime();
@computed get reCalculateTableHeight() { return this._reCalculateTableHeight }
set reCalculateTableHeight(v) { this._reCalculateTableHeight = v }
@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);
}
@observable rangeConditions = [];
@observable radioParams = {};
@observable refreshRadioGroup = new Date().getTime();
@computed get radioGroupConfig(){
this.refreshRadioGroup;
return {
config: [
...this.rangeConditions
],
key: new Date().getTime(),
onChange: this.onRadioGroupChangeHandle
}
}
@action onRadioGroupChangeHandle = 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
isQuickSearch:false
}
if (this.isEmptyObject(this.form2.getFormParams())) {
params = {
...params,
lastName: this.lastName,
};
} else {
params = {
...this.selectTreeNodeInfo,
...params,
...this.form2.getFormParams()
};
}
}else {
params = {
...this.radioParams,
...this.selectTreeNodeInfo,
isQuickSearch:true
}
}
this.form2.resetForm();
Api.getSearchList(params).then(res => {
if (res.code === 200) {
res.data.datas && this.tableStore.getDatas(res.data.datas, 1);
@ -87,6 +147,7 @@ export class ResourceStore {
@action("nodetree事件") doSearch(params) {
this.selectTreeNodeInfo = params;
this.showRadioGroup = true;
this.getTableInfo();
}
@ -100,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 {
@ -159,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 => {
@ -682,8 +755,6 @@ setEnableRows(e) {
});
}
updateFields(val) {
this.form2.updateFields({
lastname: {
@ -692,6 +763,11 @@ updateFields(val) {
});
}
hideRadioGroup() {
this.radioParams = {};
this.showRadioGroup = false;
}
setSearchCondition(condition) {
this.searchCondition = condition;
}

View File

@ -0,0 +1,18 @@
.searchGroup {
width: 100%;
padding: 8px 20px;
.radioGroupShow{
text-align: center;
line-height: 30px;
margin-bottom: 8px;
background-color: #f4f4f4;
color: #333;
span{
padding: 3px;
cursor: pointer;
}
}
}