update 添加载砖的逻辑“

This commit is contained in:
lb 2023-03-24 16:29:58 +08:00
vanhempi 13561c2acc
commit 4f6d27692e
5 muutettua tiedostoa jossa 35 lisäystä ja 14 poistoa

Näytä tiedosto

@ -1,13 +1,18 @@
<template>
<el-dialog
class="dialog-car-payload"
title="装载详情"
:visible="dialogVisible"
@close="handleClose"
:destroy-on-close="false"
:close-on-click-modal="configs.clickModalToClose ?? true"
:width="configs.dialogWidth ?? '50%'"
>
<!-- title -->
<div slot="title" class="dialog-title" style="display: flex; align-items: center;">
<span style="font-size: 18px;">装载详情</span>
<el-button v-if="configs.showAdd ?? false" size="small" type="primary" plain style="margin-left: 16px;" @click="$emit('add-record', id)">添加记录</el-button>
</div>
<!-- main content -->
<BaseListTable
v-loading="tableLoading"
@ -52,6 +57,10 @@ export default {
type: Boolean,
default: false,
},
updateKey: {
type: Number,
default: 1
}
// extraParams: {
// type: Object,
// default: () => ({})
@ -71,8 +80,13 @@ export default {
showPaination: false,
};
},
created() {},
mounted() {},
watch: {
updateKey(val, oldVal) {
if (val !== oldVal) {
this.getList()
}
}
},
activated() {
this.refreshLayoutKey = Math.random();
},
@ -190,5 +204,4 @@ export default {
.dialog-car-payload >>> .el-dialog__body {
padding: 5px 20px 20px;
}
</style>

Näytä tiedosto

@ -40,15 +40,17 @@
v-if="!!carPayloadAddConfigs"
:dialog-visible.sync="carPayloadAddVisible"
:configs="carPayloadAddConfigs"
@refreshDataList="getList"
@refreshDataList="updateCarPayloadKey = Math.random()"
/>
<DialogCarPayload
ref="car-payload-dialog"
key="car-payload-dialog"
ref="car-payload-dialog"
key="car-payload-dialog"
v-if="!!carPayloadDialogConfigs"
:dialog-visible.sync="carPayloadDialogVisible"
:configs="carPayloadDialogConfigs"
@refreshDataList="getList"
:update-key="updateCarPayloadKey"
@add-record="openCarPayloadAddDialog($event)"
/>
</div>
</template>
@ -143,6 +145,7 @@ export default {
dataList: [],
tableLoading: false,
refreshLayoutKey: null,
updateCarPayloadKey: 1
};
},
inject: ["urls"],
@ -191,7 +194,7 @@ export default {
this.dataList = res.data.list;
this.totalPage = res.data.total;
} else if (Array.isArray(res.data)) {
this.dataList = res.data
this.dataList = res.data;
this.totalPage = null;
} else {
this.dataList.splice(0);

Näytä tiedosto

@ -23,7 +23,7 @@ export default function () {
subcomponent: TableOperaionComponent,
options: [
{ name: "to-car-payload", label: "装载详情", icon: 'document' },
{ name: "edit-payload", label: "输入载砖详情", icon: 'edit' },
// { name: "edit-payload", label: "输入载砖详情", icon: 'edit' },
],
},
];
@ -206,6 +206,7 @@ export default function () {
};
const carPayloadDialogConfigs = {
showAdd: true, // 是否显示新增 装载详情,默认为 否
dialogWidth: '70%',
carPayloadDialog: true,
clickModalToClose: true,

Näytä tiedosto

@ -40,15 +40,17 @@
v-if="!!carPayloadAddConfigs"
:dialog-visible.sync="carPayloadAddVisible"
:configs="carPayloadAddConfigs"
@refreshDataList="getList"
@refreshDataList="updateCarPayloadKey = Math.random()"
/>
<DialogCarPayload
ref="car-payload-dialog"
key="car-payload-dialog"
ref="car-payload-dialog"
key="car-payload-dialog"
v-if="!!carPayloadDialogConfigs"
:dialog-visible.sync="carPayloadDialogVisible"
:configs="carPayloadDialogConfigs"
@refreshDataList="getList"
:update-key="updateCarPayloadKey"
@add-record="openCarPayloadAddDialog($event)"
/>
</div>
</template>
@ -143,6 +145,7 @@ export default {
dataList: [],
tableLoading: false,
refreshLayoutKey: null,
updateCarPayloadKey: 1
};
},
inject: ["urls"],
@ -191,7 +194,7 @@ export default {
this.dataList = res.data.list;
this.totalPage = res.data.total;
} else if (Array.isArray(res.data)) {
this.dataList = res.data
this.dataList = res.data;
this.totalPage = null;
} else {
this.dataList.splice(0);

Näytä tiedosto

@ -23,7 +23,7 @@ export default function () {
subcomponent: TableOperaionComponent,
options: [
{ name: "to-car-payload", label: "装载详情", icon: 'document' },
{ name: "edit-payload", label: "输入载砖详情", icon: 'edit' },
// { name: "edit-payload", label: "输入载砖详情", icon: 'edit' },
],
},
];
@ -196,6 +196,7 @@ export default function () {
};
const carPayloadDialogConfigs = {
showAdd: true,
dialogWidth: '70%',
carPayloadDialog: true,
clickModalToClose: true,