st-comp 0.0.49 → 0.0.51

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,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.49",
4
+ "version": "0.0.51",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -127,7 +127,7 @@
127
127
  </template>
128
128
 
129
129
  <script setup>
130
- import { ref, computed } from 'vue'
130
+ import { ref, computed, watch } from 'vue'
131
131
  import { CircleCloseFilled } from "@element-plus/icons-vue";
132
132
  import { ElMessage } from 'element-plus';
133
133
 
@@ -161,11 +161,18 @@ const tagList = computed(() => {
161
161
  return {
162
162
  ...item,
163
163
  freqName: props.config.freqList.find(i => i.value === item.freqId)?.label,
164
- factorName: props.config.factorList.find(i => i.id === item.factorId)?.factorName,
164
+ factorName: props.config.factorList.find(i => i.value === item.factorId)?.label,
165
165
  }
166
166
  })
167
167
  })
168
168
 
169
+ watch(
170
+ () => props.formData[props.config.key],
171
+ () => {
172
+ factorList.value = [...props.formData[props.config.key]]
173
+ }, { deep: true }
174
+ )
175
+
169
176
  // 打开弹窗
170
177
  const open = () => {
171
178
  if (factorList.value.length === 0) {
@@ -6,6 +6,7 @@
6
6
  text
7
7
  size="small"
8
8
  type="primary"
9
+ @click="clear"
9
10
  >
10
11
  不限
11
12
  </el-button>
@@ -100,6 +101,11 @@ const deleteList = (data) => {
100
101
  emit('change', props.config.key, list.value.filter((item) => item.key !== data.key))
101
102
  }
102
103
 
104
+ // 不限
105
+ const clear = () => {
106
+ emit('change', props.config.key, [])
107
+ }
108
+
103
109
  const onSubmit = (data) => {
104
110
  if (list.value.find((item) => item.key === data.key)) {
105
111
  // 已经存在当前指标