kz-ui-base 1.0.76 → 1.0.78
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/api/lims/utils/constant.js +4 -2
- package/api/qms/commonQms.js +4 -4
- package/common/src/api/common/common.js +4 -4
- package/common/src/components/base/dialog/editDialog.vue +383 -383
- package/common/src/plugins/index.js +3 -6
- package/common/src/utils/cache/bdCacheOld.js +211 -0
- package/common/src/utils/cache/eamCache.js +4 -6
- package/common/src/utils/cache/fdCacheOld.js +464 -0
- package/common/src/utils/cache/smCacheOld.js +35 -0
- package/common/src/utils/cache/tmCacheOld.js +44 -0
- package/kztool/css/0.1e7abc31.css +1 -0
- package/kztool/kztool.common.0.js +23035 -4174
- package/kztool/kztool.common.1.js +1 -1
- package/kztool/kztool.common.10.js +8 -8
- package/kztool/kztool.common.11.js +9 -1
- package/kztool/kztool.common.12.js +1 -1
- package/kztool/kztool.common.13.js +2 -2
- package/kztool/kztool.common.14.js +1 -1
- package/kztool/kztool.common.15.js +1 -1
- package/kztool/kztool.common.16.js +1 -1
- package/kztool/kztool.common.17.js +1 -1
- package/kztool/kztool.common.18.js +21 -1
- package/kztool/kztool.common.19.js +15 -3
- package/kztool/kztool.common.20.js +1 -1
- package/kztool/kztool.common.21.js +1 -1
- package/kztool/kztool.common.22.js +1 -1
- package/kztool/kztool.common.24.js +1 -1
- package/kztool/kztool.common.25.js +1 -1
- package/kztool/kztool.common.3.js +56 -5
- package/kztool/kztool.common.4.js +9 -1
- package/kztool/kztool.common.6.js +315 -78
- package/kztool/kztool.common.8.js +330 -85
- package/kztool/kztool.common.9.js +35 -27
- package/kztool/kztool.common.js +30802 -8788
- package/kztool/kztool.umd.0.js +23035 -4174
- package/kztool/kztool.umd.1.js +1 -1
- package/kztool/kztool.umd.10.js +8 -8
- package/kztool/kztool.umd.11.js +9 -1
- package/kztool/kztool.umd.12.js +1 -1
- package/kztool/kztool.umd.13.js +2 -2
- package/kztool/kztool.umd.14.js +1 -1
- package/kztool/kztool.umd.15.js +1 -1
- package/kztool/kztool.umd.16.js +1 -1
- package/kztool/kztool.umd.17.js +1 -1
- package/kztool/kztool.umd.18.js +21 -1
- package/kztool/kztool.umd.19.js +15 -3
- package/kztool/kztool.umd.20.js +1 -1
- package/kztool/kztool.umd.21.js +1 -1
- package/kztool/kztool.umd.22.js +1 -1
- package/kztool/kztool.umd.24.js +1 -1
- package/kztool/kztool.umd.25.js +1 -1
- package/kztool/kztool.umd.3.js +56 -5
- package/kztool/kztool.umd.4.js +9 -1
- package/kztool/kztool.umd.6.js +315 -78
- package/kztool/kztool.umd.8.js +330 -85
- package/kztool/kztool.umd.9.js +35 -27
- package/kztool/kztool.umd.js +30802 -8788
- package/kztool/kztool.umd.min.0.js +122 -110
- package/kztool/kztool.umd.min.11.js +1 -1
- package/kztool/kztool.umd.min.18.js +1 -1
- package/kztool/kztool.umd.min.19.js +1 -1
- package/kztool/kztool.umd.min.3.js +2 -2
- package/kztool/kztool.umd.min.4.js +1 -1
- package/kztool/kztool.umd.min.6.js +1 -1
- package/kztool/kztool.umd.min.8.js +1 -1
- package/kztool/kztool.umd.min.9.js +1 -1
- package/kztool/kztool.umd.min.js +434 -138
- package/package.json +1 -1
- package/kztool/css/0.c354e903.css +0 -1
|
@@ -1,383 +1,383 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 添加或修改参数配置对话框 -->
|
|
3
|
-
<el-dialog
|
|
4
|
-
:title="setting.title"
|
|
5
|
-
:visible.sync="setting.isShow"
|
|
6
|
-
:width="width"
|
|
7
|
-
:close-on-click-modal="false"
|
|
8
|
-
append-to-body
|
|
9
|
-
v-dialogDrag
|
|
10
|
-
v-dialogDragHeight
|
|
11
|
-
:before-close="cancel"
|
|
12
|
-
v-if="dialogShow"
|
|
13
|
-
>
|
|
14
|
-
<!-- custom-class="customDialog" -->
|
|
15
|
-
<slot name="entityForm">
|
|
16
|
-
<el-form
|
|
17
|
-
ref="entity"
|
|
18
|
-
:model="entity"
|
|
19
|
-
:rules="rules"
|
|
20
|
-
:label-width="labelWidth"
|
|
21
|
-
>
|
|
22
|
-
<el-row type="flex" style="flex-wrap: wrap">
|
|
23
|
-
<FormColumns
|
|
24
|
-
ref="FormColumns"
|
|
25
|
-
:areaSetting="areaSetting"
|
|
26
|
-
:columns.sync="oldeditColumns?oldeditColumns:columns"
|
|
27
|
-
:entity.sync="entity"
|
|
28
|
-
@change="onChangeEvent"
|
|
29
|
-
@onSearch="onSearch"
|
|
30
|
-
></FormColumns>
|
|
31
|
-
</el-row>
|
|
32
|
-
</el-form>
|
|
33
|
-
<TableForm
|
|
34
|
-
ref="TableForm"
|
|
35
|
-
v-if="setting.isShowItems && listDataShow"
|
|
36
|
-
:listColumns="setting.listSetting.listColumns"
|
|
37
|
-
:listData="listData"
|
|
38
|
-
:listSetting="setting.listSetting"
|
|
39
|
-
@change="onChangeEvent"
|
|
40
|
-
@update="updateMethod"
|
|
41
|
-
></TableForm>
|
|
42
|
-
</slot>
|
|
43
|
-
<div slot="footer">
|
|
44
|
-
<div class="dialog-footer" v-if="setting.bottomShow">
|
|
45
|
-
<el-button
|
|
46
|
-
v-if="!oldeditColumns"
|
|
47
|
-
type="primary"
|
|
48
|
-
:loading="setting.submitLoading"
|
|
49
|
-
@click="submitForm"
|
|
50
|
-
>确 定</el-button
|
|
51
|
-
>
|
|
52
|
-
<el-button @click="cancel">取 消</el-button>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="dialog-footer" v-if="customOpMenus&&customOpMenus.length">
|
|
55
|
-
<el-button
|
|
56
|
-
v-for="opMenu in customOpMenus"
|
|
57
|
-
:key="opMenu.name"
|
|
58
|
-
:icon="opMenu.icon"
|
|
59
|
-
:type="opMenu.cssType"
|
|
60
|
-
:plain="opMenu.plain"
|
|
61
|
-
:loading="setting.submitLoading"
|
|
62
|
-
@click="handleCustomOpMenuClick(opMenu)"
|
|
63
|
-
>{{ opMenu.text }}</el-button
|
|
64
|
-
>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</el-dialog>
|
|
68
|
-
<div v-else>
|
|
69
|
-
<slot name="entityForm">
|
|
70
|
-
<el-form
|
|
71
|
-
ref="entity"
|
|
72
|
-
:model="entity"
|
|
73
|
-
:rules="rules"
|
|
74
|
-
:label-width="labelWidth"
|
|
75
|
-
>
|
|
76
|
-
<el-row type="flex" style="flex-wrap: wrap">
|
|
77
|
-
<FormColumns
|
|
78
|
-
ref="FormColumns"
|
|
79
|
-
:areaSetting="areaSetting"
|
|
80
|
-
:columns.sync="oldeditColumns?oldeditColumns:columns"
|
|
81
|
-
:entity.sync="entity"
|
|
82
|
-
@change="onChangeEvent"
|
|
83
|
-
@onSearch="onSearch"
|
|
84
|
-
></FormColumns>
|
|
85
|
-
</el-row>
|
|
86
|
-
</el-form>
|
|
87
|
-
<TableForm
|
|
88
|
-
ref="TableForm"
|
|
89
|
-
v-if="setting.isShowItems && listDataShow"
|
|
90
|
-
:listColumns="setting.listSetting.listColumns"
|
|
91
|
-
:listData="listData"
|
|
92
|
-
:listSetting="setting.listSetting"
|
|
93
|
-
@change="onChangeEvent"
|
|
94
|
-
@update="updateMethod"
|
|
95
|
-
></TableForm>
|
|
96
|
-
</slot>
|
|
97
|
-
</div>
|
|
98
|
-
</template>
|
|
99
|
-
|
|
100
|
-
<script>
|
|
101
|
-
import { addEntity, updateEntity, listEntity } from "@api/common/common";
|
|
102
|
-
import FormColumns from "@srcComponents/customForm/formColumns.vue";
|
|
103
|
-
import TableForm from "./tableForm.vue";
|
|
104
|
-
|
|
105
|
-
export default {
|
|
106
|
-
name: "EditDialog",
|
|
107
|
-
components: {
|
|
108
|
-
FormColumns,
|
|
109
|
-
TableForm,
|
|
110
|
-
},
|
|
111
|
-
props: {
|
|
112
|
-
//微服务模块名称
|
|
113
|
-
moduleName: {
|
|
114
|
-
type: String,
|
|
115
|
-
default: function () {
|
|
116
|
-
return undefined;
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
//实体名称-服务名称
|
|
120
|
-
serviceName: {
|
|
121
|
-
type: String,
|
|
122
|
-
default: function () {
|
|
123
|
-
return undefined;
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
setting: {
|
|
127
|
-
type: Object,
|
|
128
|
-
default: function () {
|
|
129
|
-
return {
|
|
130
|
-
pkField: "id",
|
|
131
|
-
// 提交状态
|
|
132
|
-
submitLoading: false,
|
|
133
|
-
// 弹出层标题
|
|
134
|
-
title: "",
|
|
135
|
-
// 是否显示弹出层
|
|
136
|
-
isShow: false,
|
|
137
|
-
// 保存时是否自动关闭
|
|
138
|
-
isCloseOnSave: true,
|
|
139
|
-
};
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
// 列信息
|
|
143
|
-
columns: {
|
|
144
|
-
type: Array,
|
|
145
|
-
default: function () {
|
|
146
|
-
return [
|
|
147
|
-
//{ key: 0, text: `用户编码`, property: "userNo", visible: true },
|
|
148
|
-
//{ key: 1, text: `用户账号`, property: "userAccount", visible: true },
|
|
149
|
-
];
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
// 表单参数
|
|
153
|
-
entity: {
|
|
154
|
-
type: Object,
|
|
155
|
-
default: function () {
|
|
156
|
-
return {};
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
// 表单校验
|
|
160
|
-
rules: {
|
|
161
|
-
type: Object,
|
|
162
|
-
default: function () {
|
|
163
|
-
return {};
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
//编辑界面自定义按钮菜单 - 若无自定义按钮,不需要重写
|
|
167
|
-
customOpMenus: {
|
|
168
|
-
type: Array,
|
|
169
|
-
default: function () {
|
|
170
|
-
return [
|
|
171
|
-
//{ name: "custom1", visable: true, icon: "ion-plus-round", text: "自定义1" }
|
|
172
|
-
];
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
//
|
|
176
|
-
areaSetting: {
|
|
177
|
-
type: Object,
|
|
178
|
-
default: function () {
|
|
179
|
-
return {}
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
dialogShow: {
|
|
183
|
-
type: Object,
|
|
184
|
-
default: function () {
|
|
185
|
-
return true
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
data() {
|
|
190
|
-
return {
|
|
191
|
-
//表格宽度
|
|
192
|
-
width: this.setting.width || "60%",
|
|
193
|
-
//input框宽度
|
|
194
|
-
labelWidth: this.setting.labelWidth || "100px",
|
|
195
|
-
items:[],
|
|
196
|
-
listData:[],
|
|
197
|
-
listDataShow:false,
|
|
198
|
-
};
|
|
199
|
-
},
|
|
200
|
-
watch: {},
|
|
201
|
-
created() {
|
|
202
|
-
if (this.setting && this.setting.bottomShow == undefined) {
|
|
203
|
-
this.setting.bottomShow = true;
|
|
204
|
-
}
|
|
205
|
-
if (this.setting && this.setting.width) {
|
|
206
|
-
this.width = this.setting.width;
|
|
207
|
-
} else {
|
|
208
|
-
this.width = "60%";
|
|
209
|
-
}
|
|
210
|
-
if (this.setting && this.setting.labelWidth) {
|
|
211
|
-
this.labelWidth = this.setting.labelWidth;
|
|
212
|
-
} else {
|
|
213
|
-
this.labelWidth = "100px";
|
|
214
|
-
}
|
|
215
|
-
if (
|
|
216
|
-
this.setting.isShowItems &&
|
|
217
|
-
(this.setting.listSetting.addQueryOpen || this.setting.type != "add")
|
|
218
|
-
) {
|
|
219
|
-
if (this.entity.children) {
|
|
220
|
-
this.$set(this, "listData", this.entity.children);
|
|
221
|
-
} else {
|
|
222
|
-
listEntity(
|
|
223
|
-
this.setting.itemModuleName,
|
|
224
|
-
this.setting.itemServiceName,
|
|
225
|
-
{
|
|
226
|
-
[this.setting.itemFkField]:
|
|
227
|
-
this.entity[this.setting.listSetting.pkField],
|
|
228
|
-
|
|
229
|
-
...this.setting.listSetting.parameter,
|
|
230
|
-
},
|
|
231
|
-
this.setting.listSetting.getListAction
|
|
232
|
-
).then((response) => {
|
|
233
|
-
this.$set(this, "listData", response.rows);
|
|
234
|
-
this.listDataShow = true;
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
mounted() {},
|
|
240
|
-
activated() {
|
|
241
|
-
console.log("editDialog");
|
|
242
|
-
},
|
|
243
|
-
methods: {
|
|
244
|
-
//当前绑定实体字段值变更事件
|
|
245
|
-
onChangeEvent(args) {
|
|
246
|
-
this.$emit("change", args);
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
show() {
|
|
250
|
-
this.setting.isShow = true;
|
|
251
|
-
},
|
|
252
|
-
updateMethod(value) {
|
|
253
|
-
this.items = value;
|
|
254
|
-
},
|
|
255
|
-
// 取消按钮
|
|
256
|
-
cancel() {
|
|
257
|
-
this.setting.isShow = false;
|
|
258
|
-
this.$emit("onCancelClick", { data: this.entity, setting: this.setting });
|
|
259
|
-
|
|
260
|
-
},
|
|
261
|
-
// 表单重置
|
|
262
|
-
reset() {
|
|
263
|
-
for (var column of this.columns) {
|
|
264
|
-
this.entity[column.property] = column.default;
|
|
265
|
-
}
|
|
266
|
-
(this).resetForm("entity");
|
|
267
|
-
},
|
|
268
|
-
/** 提交按钮 */
|
|
269
|
-
submitForm: function () {
|
|
270
|
-
var self = this;
|
|
271
|
-
this.setting.submitLoading = true;
|
|
272
|
-
|
|
273
|
-
// (this.$refs["TableForm"]).$refs['entity']
|
|
274
|
-
// .validate((valid) => {
|
|
275
|
-
|
|
276
|
-
// });
|
|
277
|
-
(this.$refs["entity"]).validate((valid) => {
|
|
278
|
-
if (valid) {
|
|
279
|
-
if (this.setting.isShowItems) {
|
|
280
|
-
(this.$refs["TableForm"]).$refs["entity"].validate((valid) => {
|
|
281
|
-
if (valid) {
|
|
282
|
-
if (this.setting.type && this.setting.type == "add") {
|
|
283
|
-
this.$emit("onAddSaveClick", {
|
|
284
|
-
data: this.entity,
|
|
285
|
-
setting: this.setting,
|
|
286
|
-
});
|
|
287
|
-
self.setting.submitLoading = false;
|
|
288
|
-
} else {
|
|
289
|
-
// if (this.setting.isShowItems) {
|
|
290
|
-
// this.$emit("onSaveClick", {
|
|
291
|
-
// data: { data: this.entity, items: this.items },
|
|
292
|
-
// setting: this.setting,
|
|
293
|
-
// });
|
|
294
|
-
// } else {
|
|
295
|
-
// }
|
|
296
|
-
this.$emit("onSaveClick", {
|
|
297
|
-
data: this.entity,
|
|
298
|
-
setting: this.setting,
|
|
299
|
-
});
|
|
300
|
-
self.setting.submitLoading = false;
|
|
301
|
-
}
|
|
302
|
-
} else {
|
|
303
|
-
this.setting.submitLoading = false;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
} else {
|
|
307
|
-
if (this.setting.type && this.setting.type == "add") {
|
|
308
|
-
this.$emit("onAddSaveClick", {
|
|
309
|
-
data: this.entity,
|
|
310
|
-
setting: this.setting,
|
|
311
|
-
});
|
|
312
|
-
self.setting.submitLoading = false;
|
|
313
|
-
} else {
|
|
314
|
-
// if (this.setting.isShowItems) {
|
|
315
|
-
// this.$emit("onSaveClick", {
|
|
316
|
-
// data: { data: this.entity, items: this.items },
|
|
317
|
-
// setting: this.setting,
|
|
318
|
-
// });
|
|
319
|
-
// } else {
|
|
320
|
-
// }
|
|
321
|
-
this.$emit("onSaveClick", {
|
|
322
|
-
data: this.entity,
|
|
323
|
-
setting: this.setting,
|
|
324
|
-
});
|
|
325
|
-
self.setting.submitLoading = false;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
} else {
|
|
329
|
-
this.setting.submitLoading = false;
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
},
|
|
333
|
-
/** 自定义操作菜单按钮点击处理 */
|
|
334
|
-
handleCustomOpMenuClick(opMenu) {
|
|
335
|
-
this.$emit("onCustomOpMenuClick", {
|
|
336
|
-
opMenu: opMenu,
|
|
337
|
-
data: this.entity,
|
|
338
|
-
setting: this.setting,
|
|
339
|
-
});
|
|
340
|
-
},
|
|
341
|
-
onSearch(value) {
|
|
342
|
-
this.$emit("onSearch", value);
|
|
343
|
-
},
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
</script>
|
|
347
|
-
|
|
348
|
-
<style scoped>
|
|
349
|
-
.wrapper-container-supplement {
|
|
350
|
-
min-height: 415px;
|
|
351
|
-
}
|
|
352
|
-
::v-deep label {
|
|
353
|
-
font-weight: 500;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
::v-deep .el-input.is-disabled .el-input__inner {
|
|
357
|
-
color: #606266;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
::v-deep .el-form-item {
|
|
361
|
-
margin-bottom: 16px;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
::v-deep .el-form-item--small.el-form-item {
|
|
365
|
-
margin-bottom: 8px;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
::v-deep .el-dialog__body {
|
|
369
|
-
padding: 24px 24px 0 24px;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
::v-deep .el-dialog__footer {
|
|
373
|
-
text-align: center;
|
|
374
|
-
border-top: 1px solid #e7e8ed;
|
|
375
|
-
padding: 12px 0 12px 0;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
::v-deep .el-dialog__header {
|
|
379
|
-
padding: 16px 16px 10px;
|
|
380
|
-
border-bottom: 1px solid #dcdfe6;
|
|
381
|
-
}
|
|
382
|
-
</style>
|
|
383
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 添加或修改参数配置对话框 -->
|
|
3
|
+
<el-dialog
|
|
4
|
+
:title="setting.title"
|
|
5
|
+
:visible.sync="setting.isShow"
|
|
6
|
+
:width="width"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
append-to-body
|
|
9
|
+
v-dialogDrag
|
|
10
|
+
v-dialogDragHeight
|
|
11
|
+
:before-close="cancel"
|
|
12
|
+
v-if="dialogShow"
|
|
13
|
+
>
|
|
14
|
+
<!-- custom-class="customDialog" -->
|
|
15
|
+
<slot name="entityForm">
|
|
16
|
+
<el-form
|
|
17
|
+
ref="entity"
|
|
18
|
+
:model="entity"
|
|
19
|
+
:rules="rules"
|
|
20
|
+
:label-width="labelWidth"
|
|
21
|
+
>
|
|
22
|
+
<el-row type="flex" style="flex-wrap: wrap">
|
|
23
|
+
<FormColumns
|
|
24
|
+
ref="FormColumns"
|
|
25
|
+
:areaSetting="areaSetting"
|
|
26
|
+
:columns.sync="oldeditColumns?oldeditColumns:columns"
|
|
27
|
+
:entity.sync="entity"
|
|
28
|
+
@change="onChangeEvent"
|
|
29
|
+
@onSearch="onSearch"
|
|
30
|
+
></FormColumns>
|
|
31
|
+
</el-row>
|
|
32
|
+
</el-form>
|
|
33
|
+
<TableForm
|
|
34
|
+
ref="TableForm"
|
|
35
|
+
v-if="setting.isShowItems && listDataShow"
|
|
36
|
+
:listColumns="setting.listSetting.listColumns"
|
|
37
|
+
:listData="listData"
|
|
38
|
+
:listSetting="setting.listSetting"
|
|
39
|
+
@change="onChangeEvent"
|
|
40
|
+
@update="updateMethod"
|
|
41
|
+
></TableForm>
|
|
42
|
+
</slot>
|
|
43
|
+
<div slot="footer">
|
|
44
|
+
<div class="dialog-footer" v-if="setting.bottomShow">
|
|
45
|
+
<el-button
|
|
46
|
+
v-if="!oldeditColumns"
|
|
47
|
+
type="primary"
|
|
48
|
+
:loading="setting.submitLoading"
|
|
49
|
+
@click="submitForm"
|
|
50
|
+
>确 定</el-button
|
|
51
|
+
>
|
|
52
|
+
<el-button @click="cancel">取 消</el-button>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="dialog-footer" v-if="customOpMenus&&customOpMenus.length">
|
|
55
|
+
<el-button
|
|
56
|
+
v-for="opMenu in customOpMenus"
|
|
57
|
+
:key="opMenu.name"
|
|
58
|
+
:icon="opMenu.icon"
|
|
59
|
+
:type="opMenu.cssType"
|
|
60
|
+
:plain="opMenu.plain"
|
|
61
|
+
:loading="setting.submitLoading"
|
|
62
|
+
@click="handleCustomOpMenuClick(opMenu)"
|
|
63
|
+
>{{ opMenu.text }}</el-button
|
|
64
|
+
>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</el-dialog>
|
|
68
|
+
<div v-else>
|
|
69
|
+
<slot name="entityForm">
|
|
70
|
+
<el-form
|
|
71
|
+
ref="entity"
|
|
72
|
+
:model="entity"
|
|
73
|
+
:rules="rules"
|
|
74
|
+
:label-width="labelWidth"
|
|
75
|
+
>
|
|
76
|
+
<el-row type="flex" style="flex-wrap: wrap">
|
|
77
|
+
<FormColumns
|
|
78
|
+
ref="FormColumns"
|
|
79
|
+
:areaSetting="areaSetting"
|
|
80
|
+
:columns.sync="oldeditColumns?oldeditColumns:columns"
|
|
81
|
+
:entity.sync="entity"
|
|
82
|
+
@change="onChangeEvent"
|
|
83
|
+
@onSearch="onSearch"
|
|
84
|
+
></FormColumns>
|
|
85
|
+
</el-row>
|
|
86
|
+
</el-form>
|
|
87
|
+
<TableForm
|
|
88
|
+
ref="TableForm"
|
|
89
|
+
v-if="setting.isShowItems && listDataShow"
|
|
90
|
+
:listColumns="setting.listSetting.listColumns"
|
|
91
|
+
:listData="listData"
|
|
92
|
+
:listSetting="setting.listSetting"
|
|
93
|
+
@change="onChangeEvent"
|
|
94
|
+
@update="updateMethod"
|
|
95
|
+
></TableForm>
|
|
96
|
+
</slot>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<script>
|
|
101
|
+
import { addEntity, updateEntity, listEntity } from "@api/common/common";
|
|
102
|
+
import FormColumns from "@srcComponents/customForm/formColumns.vue";
|
|
103
|
+
import TableForm from "./tableForm.vue";
|
|
104
|
+
|
|
105
|
+
export default {
|
|
106
|
+
name: "EditDialog",
|
|
107
|
+
components: {
|
|
108
|
+
FormColumns,
|
|
109
|
+
TableForm,
|
|
110
|
+
},
|
|
111
|
+
props: {
|
|
112
|
+
//微服务模块名称
|
|
113
|
+
moduleName: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: function () {
|
|
116
|
+
return undefined;
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
//实体名称-服务名称
|
|
120
|
+
serviceName: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: function () {
|
|
123
|
+
return undefined;
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
setting: {
|
|
127
|
+
type: Object,
|
|
128
|
+
default: function () {
|
|
129
|
+
return {
|
|
130
|
+
pkField: "id",
|
|
131
|
+
// 提交状态
|
|
132
|
+
submitLoading: false,
|
|
133
|
+
// 弹出层标题
|
|
134
|
+
title: "",
|
|
135
|
+
// 是否显示弹出层
|
|
136
|
+
isShow: false,
|
|
137
|
+
// 保存时是否自动关闭
|
|
138
|
+
isCloseOnSave: true,
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
// 列信息
|
|
143
|
+
columns: {
|
|
144
|
+
type: Array,
|
|
145
|
+
default: function () {
|
|
146
|
+
return [
|
|
147
|
+
//{ key: 0, text: `用户编码`, property: "userNo", visible: true },
|
|
148
|
+
//{ key: 1, text: `用户账号`, property: "userAccount", visible: true },
|
|
149
|
+
];
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
// 表单参数
|
|
153
|
+
entity: {
|
|
154
|
+
type: Object,
|
|
155
|
+
default: function () {
|
|
156
|
+
return {};
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
// 表单校验
|
|
160
|
+
rules: {
|
|
161
|
+
type: Object,
|
|
162
|
+
default: function () {
|
|
163
|
+
return {};
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
//编辑界面自定义按钮菜单 - 若无自定义按钮,不需要重写
|
|
167
|
+
customOpMenus: {
|
|
168
|
+
type: Array,
|
|
169
|
+
default: function () {
|
|
170
|
+
return [
|
|
171
|
+
//{ name: "custom1", visable: true, icon: "ion-plus-round", text: "自定义1" }
|
|
172
|
+
];
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
//
|
|
176
|
+
areaSetting: {
|
|
177
|
+
type: Object,
|
|
178
|
+
default: function () {
|
|
179
|
+
return {}
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
dialogShow: {
|
|
183
|
+
type: Object,
|
|
184
|
+
default: function () {
|
|
185
|
+
return true
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
data() {
|
|
190
|
+
return {
|
|
191
|
+
//表格宽度
|
|
192
|
+
width: this.setting.width || "60%",
|
|
193
|
+
//input框宽度
|
|
194
|
+
labelWidth: this.setting.labelWidth || "100px",
|
|
195
|
+
items:[],
|
|
196
|
+
listData:[],
|
|
197
|
+
listDataShow:false,
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
watch: {},
|
|
201
|
+
created() {
|
|
202
|
+
if (this.setting && this.setting.bottomShow == undefined) {
|
|
203
|
+
this.setting.bottomShow = true;
|
|
204
|
+
}
|
|
205
|
+
if (this.setting && this.setting.width) {
|
|
206
|
+
this.width = this.setting.width;
|
|
207
|
+
} else {
|
|
208
|
+
this.width = "60%";
|
|
209
|
+
}
|
|
210
|
+
if (this.setting && this.setting.labelWidth) {
|
|
211
|
+
this.labelWidth = this.setting.labelWidth;
|
|
212
|
+
} else {
|
|
213
|
+
this.labelWidth = "100px";
|
|
214
|
+
}
|
|
215
|
+
if (
|
|
216
|
+
this.setting.isShowItems &&
|
|
217
|
+
(this.setting.listSetting.addQueryOpen || this.setting.type != "add")
|
|
218
|
+
) {
|
|
219
|
+
if (this.entity.children) {
|
|
220
|
+
this.$set(this, "listData", this.entity.children);
|
|
221
|
+
} else {
|
|
222
|
+
listEntity(
|
|
223
|
+
this.setting.itemModuleName,
|
|
224
|
+
this.setting.itemServiceName,
|
|
225
|
+
{
|
|
226
|
+
[this.setting.itemFkField]:
|
|
227
|
+
this.entity[this.setting.listSetting.pkField],
|
|
228
|
+
|
|
229
|
+
...this.setting.listSetting.parameter,
|
|
230
|
+
},
|
|
231
|
+
this.setting.listSetting.getListAction
|
|
232
|
+
).then((response) => {
|
|
233
|
+
this.$set(this, "listData", response.rows);
|
|
234
|
+
this.listDataShow = true;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
mounted() {},
|
|
240
|
+
activated() {
|
|
241
|
+
console.log("editDialog");
|
|
242
|
+
},
|
|
243
|
+
methods: {
|
|
244
|
+
//当前绑定实体字段值变更事件
|
|
245
|
+
onChangeEvent(args) {
|
|
246
|
+
this.$emit("change", args);
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
show() {
|
|
250
|
+
this.setting.isShow = true;
|
|
251
|
+
},
|
|
252
|
+
updateMethod(value) {
|
|
253
|
+
this.items = value;
|
|
254
|
+
},
|
|
255
|
+
// 取消按钮
|
|
256
|
+
cancel() {
|
|
257
|
+
this.setting.isShow = false;
|
|
258
|
+
this.$emit("onCancelClick", { data: this.entity, setting: this.setting });
|
|
259
|
+
|
|
260
|
+
},
|
|
261
|
+
// 表单重置
|
|
262
|
+
reset() {
|
|
263
|
+
for (var column of this.columns) {
|
|
264
|
+
this.entity[column.property] = column.default;
|
|
265
|
+
}
|
|
266
|
+
(this).resetForm("entity");
|
|
267
|
+
},
|
|
268
|
+
/** 提交按钮 */
|
|
269
|
+
submitForm: function () {
|
|
270
|
+
var self = this;
|
|
271
|
+
this.setting.submitLoading = true;
|
|
272
|
+
|
|
273
|
+
// (this.$refs["TableForm"]).$refs['entity']
|
|
274
|
+
// .validate((valid) => {
|
|
275
|
+
|
|
276
|
+
// });
|
|
277
|
+
(this.$refs["entity"]).validate((valid) => {
|
|
278
|
+
if (valid) {
|
|
279
|
+
if (this.setting.isShowItems) {
|
|
280
|
+
(this.$refs["TableForm"]).$refs["entity"].validate((valid) => {
|
|
281
|
+
if (valid) {
|
|
282
|
+
if (this.setting.type && this.setting.type == "add") {
|
|
283
|
+
this.$emit("onAddSaveClick", {
|
|
284
|
+
data: this.entity,
|
|
285
|
+
setting: this.setting,
|
|
286
|
+
});
|
|
287
|
+
self.setting.submitLoading = false;
|
|
288
|
+
} else {
|
|
289
|
+
// if (this.setting.isShowItems) {
|
|
290
|
+
// this.$emit("onSaveClick", {
|
|
291
|
+
// data: { data: this.entity, items: this.items },
|
|
292
|
+
// setting: this.setting,
|
|
293
|
+
// });
|
|
294
|
+
// } else {
|
|
295
|
+
// }
|
|
296
|
+
this.$emit("onSaveClick", {
|
|
297
|
+
data: this.entity,
|
|
298
|
+
setting: this.setting,
|
|
299
|
+
});
|
|
300
|
+
self.setting.submitLoading = false;
|
|
301
|
+
}
|
|
302
|
+
} else {
|
|
303
|
+
this.setting.submitLoading = false;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
} else {
|
|
307
|
+
if (this.setting.type && this.setting.type == "add") {
|
|
308
|
+
this.$emit("onAddSaveClick", {
|
|
309
|
+
data: this.entity,
|
|
310
|
+
setting: this.setting,
|
|
311
|
+
});
|
|
312
|
+
self.setting.submitLoading = false;
|
|
313
|
+
} else {
|
|
314
|
+
// if (this.setting.isShowItems) {
|
|
315
|
+
// this.$emit("onSaveClick", {
|
|
316
|
+
// data: { data: this.entity, items: this.items },
|
|
317
|
+
// setting: this.setting,
|
|
318
|
+
// });
|
|
319
|
+
// } else {
|
|
320
|
+
// }
|
|
321
|
+
this.$emit("onSaveClick", {
|
|
322
|
+
data: this.entity,
|
|
323
|
+
setting: this.setting,
|
|
324
|
+
});
|
|
325
|
+
self.setting.submitLoading = false;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
this.setting.submitLoading = false;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
/** 自定义操作菜单按钮点击处理 */
|
|
334
|
+
handleCustomOpMenuClick(opMenu) {
|
|
335
|
+
this.$emit("onCustomOpMenuClick", {
|
|
336
|
+
opMenu: opMenu,
|
|
337
|
+
data: this.entity,
|
|
338
|
+
setting: this.setting,
|
|
339
|
+
});
|
|
340
|
+
},
|
|
341
|
+
onSearch(value) {
|
|
342
|
+
this.$emit("onSearch", value);
|
|
343
|
+
},
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
</script>
|
|
347
|
+
|
|
348
|
+
<style scoped>
|
|
349
|
+
.wrapper-container-supplement {
|
|
350
|
+
min-height: 415px;
|
|
351
|
+
}
|
|
352
|
+
::v-deep label {
|
|
353
|
+
font-weight: 500;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
::v-deep .el-input.is-disabled .el-input__inner {
|
|
357
|
+
color: #606266;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
::v-deep .el-form-item {
|
|
361
|
+
margin-bottom: 16px;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
::v-deep .el-form-item--small.el-form-item {
|
|
365
|
+
margin-bottom: 8px;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
::v-deep .el-dialog__body {
|
|
369
|
+
padding: 24px 24px 0 24px;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
::v-deep .el-dialog__footer {
|
|
373
|
+
text-align: center;
|
|
374
|
+
border-top: 1px solid #e7e8ed;
|
|
375
|
+
padding: 12px 0 12px 0;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
::v-deep .el-dialog__header {
|
|
379
|
+
padding: 16px 16px 10px;
|
|
380
|
+
border-bottom: 1px solid #dcdfe6;
|
|
381
|
+
}
|
|
382
|
+
</style>
|
|
383
|
+
<style></style>
|