t20-common-lib 0.15.31 → 0.15.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "t20-common-lib",
3
- "version": "0.15.31",
3
+ "version": "0.15.33",
4
4
  "description": "T20",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -40,10 +40,6 @@ export default {
40
40
  type: [Boolean, Array, Number],
41
41
  defalut: false,
42
42
  },
43
- multiple:{
44
- type:Boolean,
45
- default:false
46
- },
47
43
  items: {
48
44
  type: Object,
49
45
  defalut: () => {
@@ -63,22 +59,15 @@ export default {
63
59
  handler(value,oldV){
64
60
  if(JSON.stringify(value)!==JSON.stringify(oldV)){
65
61
  if(!value) return this.upDateValue=[];
66
- if(!this.multiple){
67
- this.upDateValue=[{
62
+ this.upDateValue=[
63
+ {
68
64
  unitNo:this.value,
69
65
  unitName:this.label
70
- }];
71
- }else{
72
- this.upDateValue=value.map((item,index)=>{
73
- return {
74
- unitNo:item,
75
- unitName:this.label?.split(',')?.[index]
76
- }
77
- })
78
- }
66
+ }
67
+ ];
79
68
  this.$nextTick(()=>{
80
- this.$refs?.unitRef?.upDateShowValue()
81
- })
69
+ this.$refs?.unitRef?.upDateShowValue()
70
+ })
82
71
  }
83
72
  },
84
73
  immediate:true
@@ -90,7 +79,7 @@ export default {
90
79
  return this.value;
91
80
  },
92
81
  set(value) {
93
- if(Array.isArray(value) && !this.multiple){
82
+ if(Array.isArray(value)){
94
83
  this.$emit("input", value[0]);
95
84
  }else{
96
85
  this.$emit("input", value)
@@ -99,24 +88,16 @@ export default {
99
88
  },
100
89
  },
101
90
  methods: {
102
- dataChange(item) {
91
+ dataChange(item, type) {
103
92
  //item一直是数组
104
93
  if (Array.isArray(item) && item.length) {
105
- if (this.multiple) {
106
- this.$emit(`update:label`, item.map((list)=>list.unitName).join(','));
107
- this.$emit("change", item);
108
- } else {
109
- this.$emit(`update:label`, item[0].unitName);
110
- this.$emit("change", item);
111
- }
94
+ this.$emit(`update:label`, item[0].unitName);
95
+ this.$emit("change", item[0].unitNo, item, type);
112
96
  } else {
113
97
  this.$emit(`update:label`, "");
114
- this.$emit("change", []);
98
+ this.$emit("change", null, [], type);
115
99
  }
116
100
  },
117
101
  },
118
102
  };
119
- </script>
120
-
121
- <style>
122
- </style>
103
+ </script>
@@ -36,13 +36,14 @@
36
36
  :label.sync="formData[group.prop][item.nameProp]"
37
37
  v-bind="item.props"
38
38
  @change="
39
- (val, option) =>
39
+ (val, option, ...args) =>
40
40
  $emit('change', {
41
41
  val,
42
42
  option,
43
43
  groupProp: group.prop,
44
44
  item,
45
45
  group,
46
+ args
46
47
  })
47
48
  "
48
49
  @dialogChange="
@@ -8,24 +8,25 @@
8
8
  >
9
9
  <template v-if="group.unitType === 'FORM' || group.unitType === 'UNIT_FORM'">
10
10
  <N20-descriptions>
11
- <el-descriptions-item
12
- v-for="item in group.elements"
13
- :key="`${group.prop}.${item.prop}.${item.elementType}`"
14
- :label="item.label"
15
- v-show="item.isShow !== 0"
16
- >
17
- <template v-if="item.elementType === 'SLOT_ELEMENT'">
18
- <slot
19
- :name="item.prop"
20
- :form-data="formData"
21
- :group-prop="group.prop"
22
- :prop="item.prop"
23
- :element-item="item"
24
- :value="rowValue(group.prop, item.prop)"
25
- />
26
- </template>
27
- <span v-else class="dynamic-form-detail__text">{{ displayText(group.prop, item) }}</span>
28
- </el-descriptions-item>
11
+ <template v-for="item in group.elements">
12
+ <el-descriptions-item
13
+ v-if="item.isShow !== 0"
14
+ :key="`${group.prop}.${item.prop}.${item.elementType}`"
15
+ :label="item.label"
16
+ >
17
+ <template v-if="item.elementType === 'SLOT_ELEMENT'">
18
+ <slot
19
+ :name="item.prop"
20
+ :form-data="formData"
21
+ :group-prop="group.prop"
22
+ :prop="item.prop"
23
+ :element-item="item"
24
+ :value="rowValue(group.prop, item.prop)"
25
+ />
26
+ </template>
27
+ <span v-else class="dynamic-form-detail__text">{{ displayText(group.prop, item) }}</span>
28
+ </el-descriptions-item>
29
+ </template>
29
30
  </N20-descriptions>
30
31
  </template>
31
32
  </N20-expandable-pane>