花名册列定制修复

This commit is contained in:
Chengliang 2024-07-15 16:59:03 +08:00
parent 841021361e
commit 6034b5d16f
2 changed files with 29 additions and 27 deletions

View File

@ -441,23 +441,8 @@ export default class Resource extends React.Component {
isFormInit
} = form2;
arr.push(<Row style={{ marginTop: 20 }}>
<Col offset={1} span={2}><span style={{ "lineHeight": "30px", "color": "red" }}>{getLabel(547655,'模板选择')}</span></Col>
<Col span={6} offset={1}>
<WeaSelect
style={{ width: "100%" }}
options={templates}
value={searchTemplateId}
onChange={v => {
resource.changeSearchTemplate(v)
}}
/>
</Col>
<Col offset={1} span={2}><Button onClick={() => resource.deleteSearchTemplate()}>{getLabel(547656,'删除模板 ')}</Button></Col>
</Row>)
isFormInit && defaultCondition.map((c, i) => {
isFormInit && templates.length > 0 && defaultCondition.map((c, i) => {
let _arr = [];
c.items.map((field, index) => {
_arr.push({
@ -471,6 +456,21 @@ export default class Resource extends React.Component {
),
})
})
arr.push(<Row style={{ marginTop: 20 }}>
<Col offset={1} span={2}><span style={{ "lineHeight": "30px", "color": "red" }}>{getLabel(547655,'模板选择')}</span></Col>
<Col span={6} offset={1}>
<WeaSelect
style={{ width: "100%" }}
options={templates}
value={searchTemplateId}
onChange={v => {
resource.changeSearchTemplate(v)
}}
/>
</Col>
<Col offset={1} span={2}><Button onClick={() => resource.deleteSearchTemplate()}>{getLabel(547656,'删除模板 ')}</Button></Col>
</Row>)
arr.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@qaih5l@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={_arr} col={2} />)
})

View File

@ -290,7 +290,7 @@ export class ResourceStore {
@observable templates = [];
@observable customTemplates = [];
@observable searchTemplateName = '';
@observable searchTemplateId = '-1';
@observable searchTemplateId = "-1";
@observable customTemplateName = '';
@observable customTemplateId = '-1';
@ -436,6 +436,7 @@ export class ResourceStore {
}).then(data => {
if (data.code === 200) {
this.searchTemplateId = data.data;
this.templates = [];
this.setPanelStatus(true);
} else {
message.warning(data.msg);
@ -460,7 +461,7 @@ export class ResourceStore {
}).then(data => {
if (data.code === 200) {
this.customTemplateId = data.data;
this.getSearchTemplate(false);
// this.getSearchTemplate(false);
this.customization();
message.success(data.msg);
} else {
@ -484,6 +485,7 @@ export class ResourceStore {
if (data.code === 200) {
message.success(data.msg);
this.searchTemplateId = '-1';
this.templates = [];
this.setPanelStatus(true);
} else {
message.warning(data.msg);
@ -594,13 +596,11 @@ export class ResourceStore {
}
@action("模板") getSearchTemplate = (bool) => {
Api.getSearchTemplate({ type: bool ? 'search' : 'custom' }).then(res => {
Api.getSearchTemplate({ type: bool ? 'search' : 'custom',id: bool ? this.searchTemplateId : this.customTemplateId}).then(res => {
if (res.code === 200) {
if (res.data.templateId) {
this.customTemplateId = res.data.templateId;
}
bool ? this.setTemplates(res.data.templates) : this.setCustomTemplates(res.data.templates);
this.getCustomTransferData();
} else {
message.warning(res.msg);
}
@ -669,6 +669,8 @@ export class ResourceStore {
let { code, msg } = res;
if (code === 200) {
message.success(msg || getLabel(30700,'操作成功'));
//返回默认模板
this.customTemplateId = '-1';
this.getEditTable();
this.customization();
} else {
@ -728,7 +730,7 @@ export class ResourceStore {
this.search = bool;
this.searchDialog.loading = true;
this.getSearchTemplate(bool);
this.getCustomTransferData();
}
@action closeSearchDialog = () => {
@ -784,11 +786,11 @@ export class ResourceStore {
this.defaultCondition = defaultcondition;
}
setTemplates(datas) {
@action setTemplates(datas) {
this.templates = datas;
}
setCustomTemplates(datas) {
@action setCustomTemplates(datas) {
this.customTemplates = datas;
}