style:删除冗余变量

wuyanfu
吴延福 2023-07-03 13:15:23 +08:00
parent 0bb62a94fd
commit b82206e6fd
2 changed files with 3 additions and 7 deletions

View File

@ -44,7 +44,7 @@
</div> </div>
</div> </div>
<el-dialog :close-on-click-modal="false" :title="currentId===-1?'新增':isReadonly?'详情':'编辑'" <el-dialog :close-on-click-modal="false" :title="!updateParams.id'新增':isReadonly?'详情':'编辑'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose"> :visible.sync="showUpdate" width="952px" :before-close="handleClose">
<FormComponent :options="updateOptions" :isReadonly="isReadonly" @change="changes" labelWidth="110px" <FormComponent :options="updateOptions" :isReadonly="isReadonly" @change="changes" labelWidth="110px"
labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions" labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions"

View File

@ -43,8 +43,6 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
public stepUpdateParams = {} as any; public stepUpdateParams = {} as any;
public currentId = -1;
public treeData = [] as any; public treeData = [] as any;
public formActions = [{ public formActions = [{
@ -475,8 +473,8 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
this.updateParams.safetyFactor = this.updateParams.safetyFactor.join(","); this.updateParams.safetyFactor = this.updateParams.safetyFactor.join(",");
this.updateParams.stepNum = this.updateParams.steps.length; this.updateParams.stepNum = this.updateParams.steps.length;
this.updateParams.postCode = this.updateParams.postCode.join(";") this.updateParams.postCode = this.updateParams.postCode.join(";")
this.tableService.addOrUpdate(this.updateParams, this.currentId === -1).then((res) => { this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then((res) => {
this.$message.success(this.currentId === -1 ? "新增成功!" : "编辑成功!"); this.$message.success(!this.updateParams.id? "新增成功!" : "编辑成功!");
this.updateParams = { this.updateParams = {
postCode: [], postCode: [],
safetyFactor: [] safetyFactor: []
@ -501,13 +499,11 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
public showUpdateModel(row?, isRead?) { public showUpdateModel(row?, isRead?) {
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
if (!row) { if (!row) {
this.currentId = -1;
this.updateParams = { this.updateParams = {
steps: [], identifyTime: moment().format('YYYY-MM-DD'), steps: [], identifyTime: moment().format('YYYY-MM-DD'),
identifyUserId: this.account.userId, identifyUserId: this.account.userId,
} as any; } as any;
} else { } else {
this.currentId = row.id;
this.updateParams = JSON.parse(JSON.stringify(row)); this.updateParams = JSON.parse(JSON.stringify(row));
if (!this.updateParams.steps) { if (!this.updateParams.steps) {