lw-cdp-ui 1.3.2 → 1.3.3-ui

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.
@@ -384,35 +384,6 @@ export default {
384
384
 
385
385
 
386
386
  <style lang="scss" scoped>
387
- :deep(.el-col) {
388
- &:first-child {
389
- .title-name {
390
- border: 0;
391
- padding-top: 25px;
392
- margin-top: 0;
393
- }
394
- }
395
- }
396
-
397
- .title-name {
398
- font-size: 18px;
399
- font-weight: bold;
400
- margin-bottom: 10px;
401
- margin-top: 25px;
402
- border-top: 10px solid #f5f7fa;
403
- padding-top: 20px;
404
- }
405
-
406
- .form-mini {
407
- display: flex;
408
- width: 100%;
409
- box-sizing: border-box;
410
- }
411
- .form-affix {
412
- min-width: 130px;
413
- padding-left: 20px;
414
- }
415
-
416
387
  .w-20 {
417
388
  width: 100px;
418
389
  }
@@ -422,48 +393,7 @@ export default {
422
393
  display: none !important;
423
394
  }
424
395
  }
425
- .affix-body {
426
- background-color: var(--el-fill-color-light);
427
- border: 1px solid var(--el-border-color-light);
428
- margin: 0;
429
- position: relative;
430
- &::after {
431
- content: "";
432
- position: absolute;
433
- left: -2px;
434
- right: 0;
435
- height: 16px;
436
- background-color: #ffffff;
437
- top: -17px;
438
- }
439
- .anchor-link {
440
- padding: 0 20px;
441
- height: var(--el-tabs-header-height);
442
- box-sizing: border-box;
443
- list-style: none;
444
- font-size: var(--el-font-size-base);
445
- font-weight: bold;
446
- color: var(--el-text-color-secondary);
447
- position: relative;
448
- height: 40px;
449
- display: inline-block;
450
- line-height: 40px;
451
- cursor: pointer;
452
- border-left: 1px solid transparent;
453
- border-right: 1px solid transparent;
454
- }
455
- .active {
456
- color: var(--el-color-primary);
457
- background-color: var(--el-bg-color-overlay);
458
- border-bottom: 1px solid var(--el-bg-color-overlay);
459
- border-right-color: var(--el-border-color);
460
- border-left: 1px solid var(--el-border-color-light);
461
- border-right: 1px solid var(--el-border-color-light);
462
- &:first-child {
463
- border-left: 1px solid var(--el-fill-color-light);
464
- }
465
- }
466
- }
396
+
467
397
 
468
398
  :deep(.el-tag) {
469
399
  & + .button-new-tag {
@@ -299,38 +299,6 @@ export default {
299
299
 
300
300
 
301
301
  <style lang="scss" scoped>
302
- :deep(.el-col) {
303
- &:first-child {
304
- .title-name {
305
- border: 0;
306
- padding-top: 25px;
307
- margin-top: 0;
308
- }
309
- }
310
- }
311
-
312
- .title-name {
313
- font-size: 18px;
314
- font-weight: bold;
315
- margin-bottom: 10px;
316
- margin-top: 25px;
317
- border-top: 10px solid #f5f7fa;
318
- padding-top: 20px;
319
- display: flex;
320
- align-items: center;
321
- justify-content: space-between;
322
- }
323
-
324
- .form-mini {
325
- display: flex;
326
- width: 100%;
327
- box-sizing: border-box;
328
- }
329
- .form-affix {
330
- min-width: 130px;
331
- padding-left: 20px;
332
- }
333
-
334
302
  .w-20 {
335
303
  width: 100px;
336
304
  }
@@ -340,48 +308,6 @@ export default {
340
308
  display: none !important;
341
309
  }
342
310
  }
343
- .affix-body {
344
- background-color: var(--el-fill-color-light);
345
- border: 1px solid var(--el-border-color-light);
346
- margin: 0;
347
- position: relative;
348
- &::after {
349
- content: "";
350
- position: absolute;
351
- left: -2px;
352
- right: 0;
353
- height: 16px;
354
- background-color: #ffffff;
355
- top: -17px;
356
- }
357
- .anchor-link {
358
- padding: 0 20px;
359
- height: var(--el-tabs-header-height);
360
- box-sizing: border-box;
361
- list-style: none;
362
- font-size: var(--el-font-size-base);
363
- font-weight: bold;
364
- color: var(--el-text-color-secondary);
365
- position: relative;
366
- height: 40px;
367
- display: inline-block;
368
- line-height: 40px;
369
- cursor: pointer;
370
- border-left: 1px solid transparent;
371
- border-right: 1px solid transparent;
372
- }
373
- .active {
374
- color: var(--el-color-primary);
375
- background-color: var(--el-bg-color-overlay);
376
- border-bottom: 1px solid var(--el-bg-color-overlay);
377
- border-right-color: var(--el-border-color);
378
- border-left: 1px solid var(--el-border-color-light);
379
- border-right: 1px solid var(--el-border-color-light);
380
- &:first-child {
381
- border-left: 1px solid var(--el-fill-color-light);
382
- }
383
- }
384
- }
385
311
 
386
312
  :deep(.el-tag) {
387
313
  & + .button-new-tag {
@@ -20,68 +20,68 @@
20
20
 
21
21
  <el-form v-else
22
22
  ref="form"
23
+ class="lw-form-mini"
23
24
  :model="form"
24
25
  :label-width="config.labelWidth"
25
26
  :label-position="$i18n.locale == 'en-us' ? 'top' : config.labelPosition"
26
27
  v-loading="loading"
27
28
  :size="config?.size || 'default'"
28
29
  element-loading-text="Loading...">
29
- <el-row :gutter="15">
30
+ <div class="lw-form-mini-card"
31
+ v-for="card in formItems">
32
+ <el-row :gutter="15">
33
+ <template v-for="(item, index) in card">
34
+ <el-col :span="item.span || 24"
35
+ v-if="!hideHandle(item)">
36
+ <ViewItem v-if="isView && !item?.options?.isInput"
37
+ :item="item"
38
+ :form="form"
39
+ :index="index">
40
+ <!-- 没有组件是component值 就是插槽名称 -->
41
+ <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
42
+ v-slot:[item.component]>
43
+ <slot :name="item.component"
44
+ :itemCur="item"
45
+ :formCur="form">
46
+ <el-tag type="danger">[{{ item.component }}]
47
+ 没有这个默认组件也未自定义插槽内容</el-tag>
48
+ </slot>
49
+ </template>
50
+ <template v-if="item?.options?.component"
51
+ v-slot:[item?.options?.component]>
52
+ <slot :name="item?.options?.component"></slot>
53
+ </template>
30
54
 
31
- <template v-for="(item, index) in config.formItems">
32
- <el-col :span="item.span || 24"
33
- v-if="!hideHandle(item)">
34
- <ViewItem v-if="isView && !item?.options?.isInput"
35
- :item="item"
36
- :form="form"
37
- :index="index">
38
- <!-- 没有组件是component值 就是插槽名称 -->
39
- <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
40
- v-slot:[item.component]>
41
- <slot :name="item.component"
42
- :itemCur="item"
43
- :formCur="form">
44
- <el-tag type="danger">[{{ item.component }}]
45
- 没有这个默认组件也未自定义插槽内容</el-tag>
46
- </slot>
47
- </template>
48
- <template v-if="item?.options?.component"
49
- v-slot:[item?.options?.component]>
50
- <slot :name="item?.options?.component"></slot>
51
- </template>
52
-
53
- </ViewItem>
54
- <FormItem v-else
55
- :item="item"
56
- :form="form"
57
- :index="index">
58
- <!-- 没有组件是component值 就是插槽名称 -->
59
- <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
60
- v-slot:[item.component]>
61
- <slot :name="item.component"
62
- :itemCur="item"
63
- :formCur="form">
64
- <el-tag type="danger">[{{ item.component }}]
65
- 没有这个默认组件也未自定义插槽内容</el-tag>
66
- </slot>
67
- </template>
68
- <template v-if="item?.options?.component"
69
- v-slot:[item?.options?.component]>
70
- <slot :name="item?.options?.component"></slot>
71
- </template>
72
- </FormItem>
73
- </el-col>
74
- </template>
75
- <el-col v-if="!isView"
76
- :span="24">
77
- <el-form-item>
78
- <slot>
79
- <el-button type="primary"
80
- @click="submit">提交</el-button>
81
- </slot>
82
- </el-form-item>
83
- </el-col>
84
- </el-row>
55
+ </ViewItem>
56
+ <FormItem v-else
57
+ :item="item"
58
+ :form="form"
59
+ :index="index">
60
+ <!-- 没有组件是component值 就是插槽名称 -->
61
+ <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
62
+ v-slot:[item.component]>
63
+ <slot :name="item.component"
64
+ :itemCur="item"
65
+ :formCur="form">
66
+ <el-tag type="danger">[{{ item.component }}]
67
+ 没有这个默认组件也未自定义插槽内容</el-tag>
68
+ </slot>
69
+ </template>
70
+ <template v-if="item?.options?.component"
71
+ v-slot:[item?.options?.component]>
72
+ <slot :name="item?.options?.component"></slot>
73
+ </template>
74
+ </FormItem>
75
+ </el-col>
76
+ </template>
77
+ </el-row>
78
+ </div>
79
+ <el-form-item v-if="!isView">
80
+ <slot>
81
+ <el-button type="primary"
82
+ @click="submit">提交</el-button>
83
+ </slot>
84
+ </el-form-item>
85
85
  </el-form>
86
86
  </template>
87
87
 
@@ -174,15 +174,34 @@ export default {
174
174
  hasValue() {
175
175
  return Object.keys(this.modelValue).length > 0
176
176
  },
177
+ formItems() {
178
+ const result = [];
179
+ let currentGroup = [];
180
+
181
+ this.config.formItems.forEach(item => {
182
+ if (item.component === "divider") {
183
+ if (currentGroup.length) {
184
+ result.push(currentGroup);
185
+ currentGroup = [];
186
+ }
187
+ currentGroup.push(item);
188
+ } else {
189
+ currentGroup.push(item);
190
+ }
191
+ });
177
192
 
193
+ if (currentGroup.length) {
194
+ result.push(currentGroup);
195
+ }
196
+
197
+ return result;
198
+ }
178
199
  },
179
200
  mounted() {
180
201
  if (this.hasConfig) {
181
202
  this.render()
182
203
  }
183
204
  },
184
- beforeDestroy() {
185
- },
186
205
  methods: {
187
206
  /**
188
207
  * 渲染表单数据。
@@ -333,16 +352,6 @@ export default {
333
352
  }
334
353
  </script>
335
354
  <style lang="scss" scoped>
336
- :deep(.el-col) {
337
- &:first-child {
338
- .title-name {
339
- border: 0;
340
- padding-top: 25px;
341
- margin-top: 0;
342
- }
343
- }
344
- }
345
-
346
355
  .form-mini {
347
356
  display: flex;
348
357
  width: 100%;
@@ -361,60 +370,9 @@ export default {
361
370
  margin-left: 10px;
362
371
  }
363
372
 
364
- .title-name {
365
- font-size: 18px;
366
- font-weight: bold;
367
- margin-bottom: 10px;
368
- margin-top: 25px;
369
- border-top: 10px solid #f5f7fa;
370
- padding-top: 20px;
371
- }
372
-
373
373
  :deep(.form-item-name-null) {
374
374
  > .el-form-item__label {
375
375
  display: none !important;
376
376
  }
377
377
  }
378
- .affix-body {
379
- background-color: var(--el-fill-color-light);
380
- border: 1px solid var(--el-border-color-light);
381
- margin: 0;
382
- position: relative;
383
- &::after {
384
- content: "";
385
- position: absolute;
386
- left: -2px;
387
- right: 0;
388
- height: 16px;
389
- background-color: #ffffff;
390
- top: -17px;
391
- }
392
- .anchor-link {
393
- padding: 0 20px;
394
- height: var(--el-tabs-header-height);
395
- box-sizing: border-box;
396
- list-style: none;
397
- font-size: var(--el-font-size-base);
398
- font-weight: bold;
399
- color: var(--el-text-color-secondary);
400
- position: relative;
401
- height: 40px;
402
- display: inline-block;
403
- line-height: 40px;
404
- cursor: pointer;
405
- border-left: 1px solid transparent;
406
- border-right: 1px solid transparent;
407
- }
408
- .active {
409
- color: var(--el-color-primary);
410
- background-color: var(--el-bg-color-overlay);
411
- border-bottom: 1px solid var(--el-bg-color-overlay);
412
- border-right-color: var(--el-border-color);
413
- border-left: 1px solid var(--el-border-color-light);
414
- border-right: 1px solid var(--el-border-color-light);
415
- &:first-child {
416
- border-left: 1px solid var(--el-fill-color-light);
417
- }
418
- }
419
- }
420
378
  </style>
@@ -179,14 +179,11 @@ export default {
179
179
  closeSelectedTag(tag, autoPushLatestView = true) {
180
180
  let item = this.menu[0]
181
181
  if (item.children) {
182
- item = item.children[0]
182
+ item = item.children[0]
183
183
  }
184
-
185
- // 兼容合并菜单
186
- if (item.meta?.code) {
187
- item.path = `/i/${item.name}`
184
+ if (this.tagList.length == 1 && item.path == this.$route.fullPath) {
185
+ return false
188
186
  }
189
-
190
187
  this.$store.commit("removeViewTags", tag)
191
188
  this.$store.commit("removeIframeList", tag)
192
189
  this.$store.commit("removeKeepLive", tag.name)
@@ -196,7 +193,7 @@ export default {
196
193
  if (latestView) {
197
194
  this.$router.push(latestView)
198
195
  } else {
199
- this.$router.push({ path: item.path })
196
+ this.$router.push('/')
200
197
  }
201
198
  }
202
199
  },