花名册模板管理

This commit is contained in:
Chengliang 2023-01-16 09:50:36 +08:00
parent 5baac661e2
commit fc1184c64d
3 changed files with 22 additions and 21 deletions

View File

@ -45,7 +45,8 @@ export default class NewWeaTableEditDialog extends React.Component {
ecId={`${this && this.props && this.props.ecId || ""}_WeaTableEdit@7rorir`} ecId={`${this && this.props && this.props.ecId || ""}_WeaTableEdit@7rorir`}
draggable draggable
deleteConfirm deleteConfirm
title="" title="模板"
showCopy={false}
columns={toJS(columns)} columns={toJS(columns)}
datas={toJS(datas)} datas={toJS(datas)}
copyFilterProps={["id"]} copyFilterProps={["id"]}

View File

@ -364,6 +364,7 @@ export default class Resource extends React.Component {
reRenderColumns(columns) { reRenderColumns(columns) {
let _this = this; let _this = this;
columns.forEach((c, index) => { columns.forEach((c, index) => {
c.className = "wea-table-indent"
if (c.dataIndex == 'lastname') { if (c.dataIndex == 'lastname') {
c.render = function (text, record) { c.render = function (text, record) {
return <a href='javascript:void(0);' onClick={() => { return <a href='javascript:void(0);' onClick={() => {
@ -509,8 +510,7 @@ export default class Resource extends React.Component {
if (hasRight === false) { if (hasRight === false) {
return renderNoright(); return renderNoright();
} }
const width = tableStore.columns.filter(c => c.display === "true").length * 50;
return ( return (
hasRight && <div ref='page' style={{ height: '100%' }}> hasRight && <div ref='page' style={{ height: '100%' }}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`} <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
@ -548,6 +548,7 @@ export default class Resource extends React.Component {
needScroll={true} needScroll={true}
getColumns={c => this.reRenderColumns(c)} getColumns={c => this.reRenderColumns(c)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
tableWidth={width}
/> />
</WeaLeftRightLayout> </WeaLeftRightLayout>
</WeaTop> </WeaTop>

View File

@ -251,24 +251,22 @@ export class ResourceStore {
@action("列定制保存") saveCustomDefine = () => { @action("列定制保存") saveCustomDefine = () => {
if(this.customTemplateId == '-1') { if(this.customTemplateId == '-1') {
message.error("默认模板不能修改"); message.error("默认模板不能修改,将返回默认模板列");
}else { }
const params = { const params = {
columns:this.transfer.transferKeys, columns:this.transfer.transferKeys,
templateId:this.customTemplateId templateId:this.customTemplateId
} }
Api.getTemplateSelectKeys(params).then(res => { Api.saveColumnsCustomTemplate(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.transfer.transferKeys = res.data.split(",");
} else {
this.searchDialog.visible = false; this.searchDialog.visible = false;
this.getTableInfo(); this.getTableInfo();
} }
}, error => { }, error => {
message.warning(error.msg); message.warning(error.msg);
}) })
}
} }
@ -381,7 +379,8 @@ export class ResourceStore {
}).then(data => { }).then(data => {
if (data.code === 200) { if (data.code === 200) {
this.customTemplateId = data.data; this.customTemplateId = data.data;
this.getSearchTemplate();
message.success(data.msg);
} else { } else {
message.warning(data.msg); message.warning(data.msg);
} }