add EquipmentDrawer
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<!-- 对话框(添加) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@@ -38,6 +38,16 @@
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
<EquipmentDrawer
|
||||
v-if="editVisible"
|
||||
:mode="editMode"
|
||||
@confirm="submitForm"
|
||||
@cancel="editVisible = false"
|
||||
@destroy="editVisible = false">
|
||||
<h1>Ceshi ceshi ceshi</h1>
|
||||
</EquipmentDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -47,6 +57,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import EquipmentPics from './components/EquipmentPics';
|
||||
import EquipmentAssets from './components/EquipmentAssets';
|
||||
import EquipmentDrawer from './components/EquipmentDrawer';
|
||||
|
||||
import {
|
||||
createEquipment,
|
||||
@@ -62,6 +73,7 @@ export default {
|
||||
name: 'Equipment',
|
||||
components: {
|
||||
Editor,
|
||||
EquipmentDrawer,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
@@ -214,19 +226,19 @@ export default {
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
datetime: true,
|
||||
label: '生产日期',
|
||||
prop: 'productionTime',
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
datetime: true,
|
||||
label: '进厂日期',
|
||||
prop: 'enterTime',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
input: true,
|
||||
prop: 'tvalue',
|
||||
label: '设备TT值',
|
||||
rules: [
|
||||
@@ -240,7 +252,7 @@ export default {
|
||||
],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
input: true,
|
||||
label: '产品加工时间',
|
||||
prop: 'processingTime',
|
||||
rules: [
|
||||
@@ -255,13 +267,13 @@ export default {
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
input: true,
|
||||
label: '制造商',
|
||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
prop: 'manufacturer',
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
input: true,
|
||||
label: '设备规格',
|
||||
prop: 'spec',
|
||||
},
|
||||
@@ -303,15 +315,17 @@ export default {
|
||||
prop: 'fileUrls',
|
||||
subcomponent: EquipmentPics,
|
||||
pictures: async () => {
|
||||
// some async request
|
||||
return []
|
||||
// some async request
|
||||
return [];
|
||||
},
|
||||
style: 'overflow-x: auto;'
|
||||
style: 'overflow-x: auto;',
|
||||
},
|
||||
],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
editVisible: false,
|
||||
editMode: 'edit', // 'edit', 'detail'
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
@@ -444,6 +458,23 @@ export default {
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 重写 basicPageMixin 里的 处理表格按钮 方法
|
||||
handleTableBtnClick({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.editMode = 'edit';
|
||||
this.reset();
|
||||
const id = data.id;
|
||||
getEquipment(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.editVisible = true;
|
||||
});
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user