SelectDialog.vue
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
<GLDialog class="select-dialog" :title="dialogConfig.title" mode="small" :visible.sync="visible" :show-close="true" :before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" :okText="dialogConfig.okText" :cancelText="dialogConfig.cancelText">
<div class="dialog-wrap" v-loading="loading">
<glsxCombiForm ref="editFormRef" :labelWidth="labelWidth" labelPaddingRight="0" :formObj="batchForm" :formData="editFormData" :formRules="editRules" formRef="editChildRef"></glsxCombiForm>
</div>
</GLDialog>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'SelectDialog',
props: {
dialogConfig: {
type: Object,
default: () => {
return {
title: '提示',
okText: '确定',
cancelText: '取消'
}
}
},
visible: {
type: Boolean,
default: false
},
batchForm: {
type: Object,
default: () => { }
},
editFormData: {
type: Array,
default: () => []
},
editRules: {
type: Object,
default: () => { }
},
loading: {
type: Boolean,
default: false
},
labelWidth: {
type: String,
default: '154px'
}
},
components: {
glsxCombiForm
},
data() {
return {}
},
methods: {
confirmPriceChange() {
this.$refs.editFormRef.$refs.editChildRef.validate(valid => {
if (valid) {
this.$emit('confirm', this.batchForm)
}
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss">
.select-dialog {
.dialog-wrap {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
span {
white-space: nowrap;
}
/deep/ .el-input {
&,
.el-input__inner {
width: 100px;
}
}
}
}
</style>