meixioacomponent 0.3.28 → 0.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/meixioacomponent.common.js +132 -120
- package/lib/meixioacomponent.umd.js +132 -120
- package/lib/meixioacomponent.umd.min.js +8 -8
- package/package.json +1 -1
- package/packages/components/base/baseDialog/index.vue +40 -32
- package/packages/components/proForm/proForm/pro_form_item.vue +110 -106
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
:size="`d`"
|
|
32
32
|
:color="`d`"
|
|
33
33
|
:event="true"
|
|
34
|
+
v-if="hasCloseIcon"
|
|
34
35
|
:name="`meixicomponenticon-close`"
|
|
35
36
|
@iconClick="iconClick"
|
|
36
37
|
></base-icon>
|
|
@@ -39,33 +40,36 @@
|
|
|
39
40
|
<div class="dialog-content-wrap" :style="dialogContentStyle">
|
|
40
41
|
<slot name="dialog-content"></slot>
|
|
41
42
|
</div>
|
|
42
|
-
<slot
|
|
43
|
-
|
|
43
|
+
<slot
|
|
44
|
+
class="dialog-footer-wrap"
|
|
45
|
+
slot="footer"
|
|
46
|
+
name="dialog-footer"
|
|
47
|
+
></slot>
|
|
44
48
|
</el-dialog>
|
|
45
49
|
</div>
|
|
46
50
|
</template>
|
|
47
51
|
|
|
48
52
|
<script>
|
|
49
|
-
import UseDrag from
|
|
53
|
+
import UseDrag from '../../../config/use/useDrag'
|
|
50
54
|
export default {
|
|
51
|
-
name:
|
|
55
|
+
name: 'baseDialog',
|
|
52
56
|
data() {
|
|
53
57
|
return {
|
|
54
58
|
isShow: true,
|
|
55
59
|
useDrag: null,
|
|
56
60
|
centerDialogVisible: false,
|
|
57
|
-
}
|
|
61
|
+
}
|
|
58
62
|
},
|
|
59
63
|
|
|
60
64
|
mounted() {
|
|
61
65
|
this.$nextTick(() => {
|
|
62
66
|
if (this.$props.onDrag) {
|
|
63
|
-
this.$refs.dragIcon.$el.addEventListener(
|
|
67
|
+
this.$refs.dragIcon.$el.addEventListener('mousedown', this.startDrag)
|
|
64
68
|
}
|
|
65
|
-
})
|
|
69
|
+
})
|
|
66
70
|
},
|
|
67
71
|
beforeDestroy() {
|
|
68
|
-
this.$emit(
|
|
72
|
+
this.$emit('destroy')
|
|
69
73
|
},
|
|
70
74
|
props: {
|
|
71
75
|
// 是否开启拖拽
|
|
@@ -76,7 +80,7 @@ export default {
|
|
|
76
80
|
// 标题栏文字
|
|
77
81
|
title: {
|
|
78
82
|
type: String,
|
|
79
|
-
default:
|
|
83
|
+
default: '对话框标题文字',
|
|
80
84
|
},
|
|
81
85
|
// 对话框的宽度
|
|
82
86
|
width: {
|
|
@@ -86,7 +90,7 @@ export default {
|
|
|
86
90
|
top: {
|
|
87
91
|
type: Number,
|
|
88
92
|
default: () => {
|
|
89
|
-
return document.documentElement.clientHeight * 0.15
|
|
93
|
+
return document.documentElement.clientHeight * 0.15
|
|
90
94
|
},
|
|
91
95
|
},
|
|
92
96
|
// 是否开启遮罩层
|
|
@@ -113,68 +117,72 @@ export default {
|
|
|
113
117
|
tpye: String,
|
|
114
118
|
default: `50vh`,
|
|
115
119
|
},
|
|
120
|
+
|
|
121
|
+
hasCloseIcon: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: true,
|
|
124
|
+
},
|
|
116
125
|
},
|
|
117
126
|
|
|
118
127
|
computed: {
|
|
119
128
|
dialogContentStyle() {
|
|
120
129
|
return {
|
|
121
130
|
height: this.$props.contentHeight,
|
|
122
|
-
}
|
|
131
|
+
}
|
|
123
132
|
},
|
|
124
133
|
},
|
|
125
134
|
methods: {
|
|
126
135
|
init() {
|
|
127
|
-
let target = this.$refs.dialog.$el.childNodes[0]
|
|
128
|
-
let left =
|
|
129
|
-
(document.documentElement.clientWidth - target.clientWidth) / 2;
|
|
136
|
+
let target = this.$refs.dialog.$el.childNodes[0]
|
|
137
|
+
let left = (document.documentElement.clientWidth - target.clientWidth) / 2
|
|
130
138
|
target.style.cssText += `top:${parseInt(
|
|
131
|
-
this.$props.top
|
|
132
|
-
)}px;left:${left}px;margin:0px !important
|
|
139
|
+
this.$props.top,
|
|
140
|
+
)}px;left:${left}px;margin:0px !important`
|
|
133
141
|
},
|
|
134
142
|
startDrag(e) {
|
|
135
143
|
if (!this.useDrag) {
|
|
136
|
-
let target = this.$refs.dialog.$el.children[0]
|
|
144
|
+
let target = this.$refs.dialog.$el.children[0]
|
|
137
145
|
this.useDrag = new UseDrag({
|
|
138
146
|
target: target,
|
|
139
147
|
handle: target.childNodes[0],
|
|
140
148
|
onDragEnd: () => {},
|
|
141
|
-
})
|
|
149
|
+
})
|
|
142
150
|
this.$nextTick(() => {
|
|
143
|
-
this.useDrag.startDrag(e)
|
|
144
|
-
})
|
|
151
|
+
this.useDrag.startDrag(e)
|
|
152
|
+
})
|
|
145
153
|
} else {
|
|
146
|
-
this.useDrag.startDrag(e)
|
|
154
|
+
this.useDrag.startDrag(e)
|
|
147
155
|
}
|
|
148
156
|
},
|
|
149
157
|
|
|
150
158
|
showDialog(cb) {
|
|
151
159
|
if (cb) {
|
|
152
|
-
cb(this.startShow)
|
|
160
|
+
cb(this.startShow)
|
|
153
161
|
} else {
|
|
154
|
-
this.startShow()
|
|
162
|
+
this.startShow()
|
|
155
163
|
}
|
|
156
164
|
},
|
|
157
165
|
startShow() {
|
|
158
|
-
this.centerDialogVisible = true
|
|
166
|
+
this.centerDialogVisible = true
|
|
159
167
|
this.$nextTick(() => {
|
|
160
|
-
this.init()
|
|
161
|
-
})
|
|
168
|
+
this.init()
|
|
169
|
+
})
|
|
162
170
|
},
|
|
163
171
|
closeDialog() {
|
|
164
172
|
if (this.$props.isDestroy) {
|
|
165
|
-
this.isShow = false
|
|
173
|
+
this.isShow = false
|
|
166
174
|
this.$nextTick(() => {
|
|
167
|
-
this.$destroy()
|
|
168
|
-
})
|
|
175
|
+
this.$destroy()
|
|
176
|
+
})
|
|
169
177
|
} else {
|
|
170
|
-
this.centerDialogVisible = false
|
|
178
|
+
this.centerDialogVisible = false
|
|
171
179
|
}
|
|
172
180
|
},
|
|
173
181
|
iconClick() {
|
|
174
|
-
this.closeDialog()
|
|
182
|
+
this.closeDialog()
|
|
175
183
|
},
|
|
176
184
|
},
|
|
177
|
-
}
|
|
185
|
+
}
|
|
178
186
|
</script>
|
|
179
187
|
|
|
180
188
|
<style lang="less" scoped>
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
:key="index"
|
|
30
30
|
:label="item.value"
|
|
31
31
|
v-for="(item, index) in config.list"
|
|
32
|
-
>{{ item.label }}</el-radio-button
|
|
33
32
|
>
|
|
33
|
+
{{ item.label }}
|
|
34
|
+
</el-radio-button>
|
|
34
35
|
</el-radio-group>
|
|
35
36
|
|
|
36
37
|
<!-- checkbox多选框 -->
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
:min="checkMin"
|
|
39
40
|
:max="checkMax"
|
|
40
41
|
v-model="module"
|
|
41
|
-
style="width: 100
|
|
42
|
+
style="width: 100%;"
|
|
42
43
|
v-else-if="config.type == 'checkbox'"
|
|
43
44
|
>
|
|
44
45
|
<el-checkbox
|
|
@@ -46,8 +47,9 @@
|
|
|
46
47
|
:key="index"
|
|
47
48
|
:label="item"
|
|
48
49
|
disabled
|
|
49
|
-
>{{ item }}</el-checkbox
|
|
50
50
|
>
|
|
51
|
+
{{ item }}
|
|
52
|
+
</el-checkbox>
|
|
51
53
|
</el-checkbox-group>
|
|
52
54
|
<!-- textarea -->
|
|
53
55
|
<el-input
|
|
@@ -57,8 +59,7 @@
|
|
|
57
59
|
type="textarea"
|
|
58
60
|
v-model="module"
|
|
59
61
|
v-if="config.type == 'textarea'"
|
|
60
|
-
>
|
|
61
|
-
</el-input>
|
|
62
|
+
></el-input>
|
|
62
63
|
|
|
63
64
|
<base-icon
|
|
64
65
|
:size="`s`"
|
|
@@ -78,9 +79,8 @@
|
|
|
78
79
|
v-model="module"
|
|
79
80
|
:disabled="isDisabled"
|
|
80
81
|
v-if="config.type == 'input'"
|
|
81
|
-
style="width: 100%; height: 100
|
|
82
|
-
>
|
|
83
|
-
</el-input>
|
|
82
|
+
style="width: 100%; height: 100%;"
|
|
83
|
+
></el-input>
|
|
84
84
|
<!-- 数字类型无小数 -->
|
|
85
85
|
<el-input-number
|
|
86
86
|
ref="target"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
v-model.number="module"
|
|
90
90
|
:disabled="isDisabled"
|
|
91
91
|
v-else-if="config.type == 'number'"
|
|
92
|
-
style="width: 100%; height: 100
|
|
92
|
+
style="width: 100%; height: 100%;"
|
|
93
93
|
></el-input-number>
|
|
94
94
|
<!--数字类型两位小数 -->
|
|
95
95
|
<el-input-number
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
:controls="false"
|
|
100
100
|
v-model.number="module"
|
|
101
101
|
:disabled="isDisabled"
|
|
102
|
-
style="width: 100%; height: 100
|
|
102
|
+
style="width: 100%; height: 100%;"
|
|
103
103
|
v-else-if="config.type == 'number2'"
|
|
104
104
|
></el-input-number>
|
|
105
105
|
<!-- select选择器 -->
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
:loading="selectLoading"
|
|
114
114
|
:disabled="isDisabled"
|
|
115
115
|
@visible-change="visibleChange"
|
|
116
|
-
style="width: 100%; height: 100
|
|
116
|
+
style="width: 100%; height: 100%;"
|
|
117
117
|
v-else-if="config.type == 'select' && selectStore"
|
|
118
118
|
:multipleLimit="config.multipleLimit"
|
|
119
119
|
>
|
|
@@ -122,8 +122,7 @@
|
|
|
122
122
|
:key="item.value"
|
|
123
123
|
:label="item[`${selectConfig.label}`]"
|
|
124
124
|
:value="item[`${selectConfig.value}`]"
|
|
125
|
-
>
|
|
126
|
-
</el-option>
|
|
125
|
+
></el-option>
|
|
127
126
|
</el-select>
|
|
128
127
|
<!-- 时间选择器 -->
|
|
129
128
|
<el-date-picker
|
|
@@ -136,11 +135,10 @@
|
|
|
136
135
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
137
136
|
:disabled="isDisabled"
|
|
138
137
|
:prefix-icon="`el-icon-time`"
|
|
139
|
-
style="width: 100%; height: 100
|
|
138
|
+
style="width: 100%; height: 100%;"
|
|
140
139
|
v-else-if="config.type == 'time'"
|
|
141
140
|
:picker-options="config.pickerOptions"
|
|
142
|
-
>
|
|
143
|
-
</el-date-picker>
|
|
141
|
+
></el-date-picker>
|
|
144
142
|
<!-- 单选框 -->
|
|
145
143
|
<el-radio-group
|
|
146
144
|
v-model="module"
|
|
@@ -153,8 +151,9 @@
|
|
|
153
151
|
:label="item.value"
|
|
154
152
|
:disabled="isDisabled"
|
|
155
153
|
v-for="(item, index) in config.list"
|
|
156
|
-
>{{ item.label }}</el-radio-button
|
|
157
154
|
>
|
|
155
|
+
{{ item.label }}
|
|
156
|
+
</el-radio-button>
|
|
158
157
|
</el-radio-group>
|
|
159
158
|
<!-- 选择器 -->
|
|
160
159
|
<el-checkbox-group
|
|
@@ -162,7 +161,7 @@
|
|
|
162
161
|
:min="checkMin"
|
|
163
162
|
:max="checkMax"
|
|
164
163
|
v-model="module"
|
|
165
|
-
style="width: 100
|
|
164
|
+
style="width: 100%;"
|
|
166
165
|
:disabled="isDisabled"
|
|
167
166
|
v-else-if="config.type == 'checkbox'"
|
|
168
167
|
>
|
|
@@ -171,8 +170,9 @@
|
|
|
171
170
|
:label="item"
|
|
172
171
|
:disabled="isDisabled"
|
|
173
172
|
v-for="(item, index) in config.list"
|
|
174
|
-
>{{ item }}</el-checkbox
|
|
175
173
|
>
|
|
174
|
+
{{ item }}
|
|
175
|
+
</el-checkbox>
|
|
176
176
|
</el-checkbox-group>
|
|
177
177
|
<!-- 文本输入框 -->
|
|
178
178
|
<el-input
|
|
@@ -183,8 +183,7 @@
|
|
|
183
183
|
v-model="module"
|
|
184
184
|
:disabled="isDisabled"
|
|
185
185
|
v-if="config.type == 'textarea'"
|
|
186
|
-
>
|
|
187
|
-
</el-input>
|
|
186
|
+
></el-input>
|
|
188
187
|
<!-- 插槽 -->
|
|
189
188
|
<slot name="template" v-else-if="config.type == 'template'"></slot>
|
|
190
189
|
</div>
|
|
@@ -211,27 +210,27 @@
|
|
|
211
210
|
</template>
|
|
212
211
|
|
|
213
212
|
<script>
|
|
214
|
-
import { FilterTime } from
|
|
213
|
+
import { FilterTime } from '../../../utils/utils'
|
|
215
214
|
//
|
|
216
|
-
import componentConfig from
|
|
215
|
+
import componentConfig from '../../../config/componentConfig'
|
|
217
216
|
export default {
|
|
218
217
|
data() {
|
|
219
218
|
return {
|
|
220
219
|
isEdit: false,
|
|
221
220
|
oldValue: null,
|
|
222
|
-
}
|
|
221
|
+
}
|
|
223
222
|
},
|
|
224
223
|
created() {
|
|
225
|
-
this.init()
|
|
224
|
+
this.init()
|
|
226
225
|
},
|
|
227
226
|
mounted() {
|
|
228
227
|
this.$nextTick(() => {
|
|
229
|
-
const { labelWidth } = this.$props
|
|
230
|
-
this.$refs.formItemRef.parentNode.style.cssText += `;width:calc(100% - ${labelWidth}) !important
|
|
228
|
+
const { labelWidth } = this.$props
|
|
229
|
+
this.$refs.formItemRef.parentNode.style.cssText += `;width:calc(100% - ${labelWidth}) !important`
|
|
231
230
|
if (this.$props.disableWatcher) {
|
|
232
|
-
this.triggerDisable(this.$props.value)
|
|
231
|
+
this.triggerDisable(this.$props.value)
|
|
233
232
|
}
|
|
234
|
-
})
|
|
233
|
+
})
|
|
235
234
|
},
|
|
236
235
|
props: {
|
|
237
236
|
disabled: {
|
|
@@ -252,7 +251,7 @@ export default {
|
|
|
252
251
|
|
|
253
252
|
size: {
|
|
254
253
|
type: String,
|
|
255
|
-
default:
|
|
254
|
+
default: 'small',
|
|
256
255
|
},
|
|
257
256
|
|
|
258
257
|
labelWidth: {},
|
|
@@ -260,72 +259,72 @@ export default {
|
|
|
260
259
|
|
|
261
260
|
computed: {
|
|
262
261
|
isDisabled() {
|
|
263
|
-
const { config, disabled } = this.$props
|
|
264
|
-
return config.disabled || disabled
|
|
262
|
+
const { config, disabled } = this.$props
|
|
263
|
+
return config.disabled || disabled
|
|
265
264
|
},
|
|
266
265
|
multiple() {
|
|
267
|
-
return this.$props.config.multipleLimit ? true : false
|
|
266
|
+
return this.$props.config.multipleLimit ? true : false
|
|
268
267
|
},
|
|
269
268
|
selectLoading() {
|
|
270
|
-
return this.selectStore?.getLoading()
|
|
269
|
+
return this.selectStore?.getLoading()
|
|
271
270
|
},
|
|
272
271
|
selectStore() {
|
|
273
|
-
return componentConfig.selectStore.getStore(this.$props.config.useStore)
|
|
272
|
+
return componentConfig.selectStore.getStore(this.$props.config.useStore)
|
|
274
273
|
},
|
|
275
274
|
|
|
276
275
|
selectData() {
|
|
277
|
-
return this.selectStore.getData()
|
|
276
|
+
return this.selectStore.getData()
|
|
278
277
|
},
|
|
279
278
|
|
|
280
279
|
selectConfig() {
|
|
281
|
-
return this.selectStore.getConfig()
|
|
280
|
+
return this.selectStore.getConfig()
|
|
282
281
|
},
|
|
283
282
|
|
|
284
283
|
spContentType() {
|
|
285
|
-
let configType = this.$props.config.type
|
|
284
|
+
let configType = this.$props.config.type
|
|
286
285
|
if (
|
|
287
|
-
configType ==
|
|
288
|
-
configType ==
|
|
289
|
-
configType ==
|
|
290
|
-
configType ==
|
|
286
|
+
configType == 'radio' ||
|
|
287
|
+
configType == 'label' ||
|
|
288
|
+
configType == 'checkbox' ||
|
|
289
|
+
configType == 'textarea'
|
|
291
290
|
) {
|
|
292
|
-
return true
|
|
291
|
+
return true
|
|
293
292
|
}
|
|
294
|
-
return false
|
|
293
|
+
return false
|
|
295
294
|
},
|
|
296
295
|
contentValue() {
|
|
297
|
-
let type = this.$props.config.type
|
|
296
|
+
let type = this.$props.config.type
|
|
298
297
|
switch (type) {
|
|
299
|
-
case
|
|
300
|
-
case
|
|
301
|
-
return this.module
|
|
298
|
+
case 'input':
|
|
299
|
+
case 'textarea':
|
|
300
|
+
return this.module
|
|
302
301
|
|
|
303
|
-
case
|
|
304
|
-
let list = this.selectData
|
|
302
|
+
case 'select':
|
|
303
|
+
let list = this.selectData
|
|
305
304
|
if (list.length > 0) {
|
|
306
305
|
if (!this.multiple) {
|
|
307
306
|
if (this.module) {
|
|
308
307
|
let index = list.findIndex((item) => {
|
|
309
|
-
return item.value == this.module
|
|
310
|
-
})
|
|
311
|
-
return list[index].label
|
|
308
|
+
return item.value == this.module
|
|
309
|
+
})
|
|
310
|
+
return list[index].label
|
|
312
311
|
} else {
|
|
313
|
-
return
|
|
312
|
+
return '暂无数据'
|
|
314
313
|
}
|
|
315
314
|
} else {
|
|
316
|
-
let text =
|
|
315
|
+
let text = ''
|
|
317
316
|
this.module.forEach((item) => {
|
|
318
317
|
let index = list.findIndex((citem) => {
|
|
319
|
-
return citem.value == item
|
|
320
|
-
})
|
|
318
|
+
return citem.value == item
|
|
319
|
+
})
|
|
321
320
|
|
|
322
|
-
text += text ? ` / ${list[index].label}` : list[index].label
|
|
323
|
-
})
|
|
324
|
-
return text
|
|
321
|
+
text += text ? ` / ${list[index].label}` : list[index].label
|
|
322
|
+
})
|
|
323
|
+
return text
|
|
325
324
|
}
|
|
326
325
|
} else {
|
|
327
|
-
this.loadSelectData()
|
|
328
|
-
return this.$props.config.value
|
|
326
|
+
this.loadSelectData()
|
|
327
|
+
return this.$props.config.value
|
|
329
328
|
}
|
|
330
329
|
|
|
331
330
|
// case "time":
|
|
@@ -338,37 +337,37 @@ export default {
|
|
|
338
337
|
// }
|
|
339
338
|
|
|
340
339
|
default:
|
|
341
|
-
return this.module
|
|
340
|
+
return this.module
|
|
342
341
|
}
|
|
343
342
|
},
|
|
344
343
|
type() {
|
|
345
|
-
return this.$props.config.type
|
|
344
|
+
return this.$props.config.type
|
|
346
345
|
},
|
|
347
346
|
|
|
348
347
|
checkMax() {
|
|
349
|
-
let max = this.$props.config.max
|
|
350
|
-
return max ? max : this.$props.config.list.length
|
|
348
|
+
let max = this.$props.config.max
|
|
349
|
+
return max ? max : this.$props.config.list.length
|
|
351
350
|
},
|
|
352
351
|
|
|
353
352
|
checkMin() {
|
|
354
|
-
let min = this.$props.config.min
|
|
355
|
-
return min < 0 || min == undefined || min == null ? 0 : min
|
|
353
|
+
let min = this.$props.config.min
|
|
354
|
+
return min < 0 || min == undefined || min == null ? 0 : min
|
|
356
355
|
},
|
|
357
356
|
module: {
|
|
358
357
|
get() {
|
|
359
|
-
let type = this.$props.config.type
|
|
360
|
-
if (type ==
|
|
358
|
+
let type = this.$props.config.type
|
|
359
|
+
if (type == 'select') {
|
|
361
360
|
if (this.selectData.length <= 0) {
|
|
362
|
-
this.loadSelectData()
|
|
361
|
+
this.loadSelectData()
|
|
363
362
|
}
|
|
364
363
|
}
|
|
365
364
|
|
|
366
|
-
return this.$props.value
|
|
365
|
+
return this.$props.value
|
|
367
366
|
},
|
|
368
367
|
set(val) {
|
|
369
|
-
this.$emit(
|
|
368
|
+
this.$emit('input', val)
|
|
370
369
|
if (this.$props.disableWatcher) {
|
|
371
|
-
this.triggerDisable(val)
|
|
370
|
+
this.triggerDisable(val)
|
|
372
371
|
}
|
|
373
372
|
},
|
|
374
373
|
},
|
|
@@ -376,74 +375,79 @@ export default {
|
|
|
376
375
|
methods: {
|
|
377
376
|
init() {
|
|
378
377
|
if (this.$props.form) {
|
|
379
|
-
this.isEdit = true
|
|
378
|
+
this.isEdit = true
|
|
380
379
|
}
|
|
381
380
|
},
|
|
382
381
|
handleContent() {
|
|
383
382
|
if (this.$props.config.click) {
|
|
384
|
-
this.$props.config.click(this.$props.config)
|
|
383
|
+
this.$props.config.click(this.$props.config)
|
|
385
384
|
}
|
|
386
385
|
},
|
|
387
386
|
handleClick(type) {
|
|
388
387
|
switch (type) {
|
|
389
|
-
case
|
|
390
|
-
this.isEdit = !this.isEdit
|
|
388
|
+
case 'edit':
|
|
389
|
+
this.isEdit = !this.isEdit
|
|
391
390
|
this.$nextTick(() => {
|
|
392
|
-
this.targetFocus()
|
|
393
|
-
})
|
|
391
|
+
this.targetFocus()
|
|
392
|
+
})
|
|
394
393
|
if (this.isEdit) {
|
|
395
|
-
this.oldValue = this.value
|
|
394
|
+
this.oldValue = this.value
|
|
396
395
|
} else {
|
|
397
|
-
this.module = this.oldValue
|
|
398
|
-
this.oldValue = null
|
|
396
|
+
this.module = this.oldValue
|
|
397
|
+
this.oldValue = null
|
|
399
398
|
}
|
|
400
|
-
break
|
|
401
|
-
case
|
|
402
|
-
this.handleContent()
|
|
403
|
-
break
|
|
404
|
-
case
|
|
405
|
-
this.$emit(
|
|
399
|
+
break
|
|
400
|
+
case 'content':
|
|
401
|
+
this.handleContent()
|
|
402
|
+
break
|
|
403
|
+
case 'confirm':
|
|
404
|
+
this.$emit('formItemConfirm', {
|
|
406
405
|
this: this,
|
|
407
406
|
config: this.$props.config,
|
|
408
|
-
})
|
|
409
|
-
break
|
|
407
|
+
})
|
|
408
|
+
break
|
|
410
409
|
default:
|
|
411
|
-
break
|
|
410
|
+
break
|
|
412
411
|
}
|
|
413
412
|
},
|
|
414
413
|
targetFocus() {
|
|
415
|
-
let ref = this.$refs.target
|
|
416
|
-
console.log(ref)
|
|
414
|
+
let ref = this.$refs.target
|
|
415
|
+
console.log(ref)
|
|
417
416
|
if (ref) {
|
|
418
|
-
ref.focus()
|
|
417
|
+
ref.focus()
|
|
419
418
|
}
|
|
420
419
|
},
|
|
421
420
|
handleConfirm() {
|
|
422
|
-
this.isEdit = false
|
|
421
|
+
this.isEdit = false
|
|
423
422
|
},
|
|
424
423
|
loadSelectData() {
|
|
425
|
-
this.selectStore.loadData()
|
|
424
|
+
this.selectStore.loadData()
|
|
426
425
|
},
|
|
427
426
|
visibleChange(visible) {
|
|
428
|
-
if (!visible) return
|
|
429
|
-
if (this.selectData.length > 0) return
|
|
430
|
-
this.loadSelectData()
|
|
427
|
+
if (!visible) return
|
|
428
|
+
if (this.selectData.length > 0) return
|
|
429
|
+
this.loadSelectData()
|
|
431
430
|
},
|
|
432
431
|
triggerDisable(val) {
|
|
433
|
-
let effects = this.$props.disableWatcher.effects
|
|
432
|
+
let effects = this.$props.disableWatcher.effects
|
|
434
433
|
effects.forEach((item) => {
|
|
435
434
|
let obj = {
|
|
436
435
|
key: item.key,
|
|
437
436
|
type: item.type,
|
|
438
437
|
result: item.fn(val),
|
|
439
|
-
}
|
|
438
|
+
}
|
|
440
439
|
|
|
441
|
-
console.log(val)
|
|
442
|
-
this.$emit(
|
|
443
|
-
})
|
|
440
|
+
console.log(val)
|
|
441
|
+
this.$emit('disableWatcherResult', obj)
|
|
442
|
+
})
|
|
444
443
|
},
|
|
445
444
|
},
|
|
446
|
-
|
|
445
|
+
watch: {
|
|
446
|
+
form(newVal, oldVal) {
|
|
447
|
+
this.init();
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
}
|
|
447
451
|
</script>
|
|
448
452
|
|
|
449
453
|
<style lang="less" scoped>
|