st-comp 0.0.211 → 0.0.213
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/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +143 -138
- package/es/VarietySearch.cjs +5 -5
- package/es/VarietySearch.js +477 -463
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +87 -87
- package/lib/{index-3eaf4b5a.js → index-ead7586a.js} +3271 -3252
- package/lib/{python-a46505d9.js → python-2a542cf4.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineConfig/index.vue +6 -0
- package/packages/VarietySearch/components/CompositeOrder/index.vue +31 -12
package/package.json
CHANGED
|
@@ -63,6 +63,12 @@ onMounted(() => {
|
|
|
63
63
|
getCycleOptions();
|
|
64
64
|
mainIndicatorOptions.value = props.indicatorStore.mainIndicatorList ?? [];
|
|
65
65
|
});
|
|
66
|
+
watch(
|
|
67
|
+
() => props.indicatorStore.mainIndicatorList,
|
|
68
|
+
() => {
|
|
69
|
+
mainIndicatorOptions.value = props.indicatorStore.mainIndicatorList ?? [];
|
|
70
|
+
},
|
|
71
|
+
);
|
|
66
72
|
defineExpose({
|
|
67
73
|
// 打开
|
|
68
74
|
open: async () => {
|
|
@@ -11,7 +11,11 @@ const props = defineProps({
|
|
|
11
11
|
commonOption: { type: Array, default: () => [] }, // 已选常用选项
|
|
12
12
|
});
|
|
13
13
|
const visible = ref(false);
|
|
14
|
-
const compositeOrderForm = ref({
|
|
14
|
+
const compositeOrderForm = ref({
|
|
15
|
+
id: null,
|
|
16
|
+
name: null, // 字段名
|
|
17
|
+
value: "desc", // 排序
|
|
18
|
+
});
|
|
15
19
|
|
|
16
20
|
// 组合排序数据源 [受到: 品种市场, 常用选项影响]
|
|
17
21
|
const compositeOrderOptions = computed(() => {
|
|
@@ -41,7 +45,7 @@ const handleAction = (action, index) => {
|
|
|
41
45
|
switch (action) {
|
|
42
46
|
// 新增
|
|
43
47
|
case "add": {
|
|
44
|
-
compositeOrderForm.value = { name: null, value: "desc" };
|
|
48
|
+
compositeOrderForm.value = { id: null, name: null, value: "desc" };
|
|
45
49
|
visible.value = true;
|
|
46
50
|
break;
|
|
47
51
|
}
|
|
@@ -54,22 +58,37 @@ const handleAction = (action, index) => {
|
|
|
54
58
|
}
|
|
55
59
|
// 窗口确认
|
|
56
60
|
case "submit": {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
data.value.
|
|
61
|
+
const { id, name, value } = compositeOrderForm.value;
|
|
62
|
+
if (!name) return ElMessage.warning("请选择需要排序的条件");
|
|
63
|
+
const { label } = compositeOrderOptions.value.find((item) => item.key === name);
|
|
64
|
+
const tagText = `${label}-${value === "asc" ? "正序↑" : "降序↓"}`;
|
|
65
|
+
|
|
66
|
+
// 新增确认逻辑
|
|
67
|
+
if (id === null) {
|
|
68
|
+
// 判断data中是否已存在同字段条件, 是则替换, 否则push
|
|
69
|
+
const index = data.value.findIndex((item) => item.name === name);
|
|
70
|
+
if (index === -1) {
|
|
71
|
+
data.value.push({ ...compositeOrderForm.value, id: name, tagText });
|
|
72
|
+
} else {
|
|
73
|
+
data.value.splice(index, 1, { ...compositeOrderForm.value, id: name, tagText });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// 编辑确认逻辑
|
|
77
|
+
else if (compositeOrderForm.value.id) {
|
|
78
|
+
// 修改当前位置的内容, 并将其他相同name的删除掉
|
|
79
|
+
const index = data.value.findIndex((item) => item.name === id);
|
|
80
|
+
const index2 = data.value.findIndex((item) => item.name === name);
|
|
81
|
+
data.value[index] = { ...compositeOrderForm.value, id: name, tagText };
|
|
82
|
+
if (index2 !== -1 && index !== index2) data.value.splice(index2, 1);
|
|
66
83
|
}
|
|
84
|
+
|
|
67
85
|
visible.value = false;
|
|
68
86
|
break;
|
|
69
87
|
}
|
|
70
88
|
// 删除
|
|
71
89
|
case "delete": {
|
|
72
90
|
data.value.splice(index, 1);
|
|
91
|
+
visible.value = false;
|
|
73
92
|
break;
|
|
74
93
|
}
|
|
75
94
|
}
|
|
@@ -84,7 +103,7 @@ watch(
|
|
|
84
103
|
return compositeOrderOptions.value.find((item) => item.key === name);
|
|
85
104
|
});
|
|
86
105
|
}
|
|
87
|
-
}
|
|
106
|
+
},
|
|
88
107
|
);
|
|
89
108
|
</script>
|
|
90
109
|
|