st-comp 0.0.243 → 0.0.245
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/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +27 -27
- package/es/VarietySearch.cjs +20 -20
- package/es/VarietySearch.js +2882 -2880
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +4 -4
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +153 -153
- package/lib/{index-f513d22c.js → index-ab2ee69a.js} +16318 -16316
- package/lib/{python-8c7ede72.js → python-ca75e11c.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +4 -3
- package/packages/VarietySearch/components/CompositeOrder/index.vue +2 -0
- package/packages/VarietySearch/components/FactorScreen/index.vue +6 -1
- package/packages/VarietySearch/config.js +4 -5
- package/packages/VarietySearch/index.vue +7 -10
- package/src/pages/VarietySearch/index.vue +7 -2
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, inject, onMounted
|
|
2
|
+
import { ref, inject, onMounted } from "vue";
|
|
3
3
|
import { Edit, DocumentCopy, Delete } from "@element-plus/icons-vue";
|
|
4
4
|
import ManageDialog from "./components/ManageDialog.vue";
|
|
5
5
|
|
|
6
6
|
const { request } = inject("stConfig"); // 组件库全局配置
|
|
7
7
|
const ManageDialogRef = ref(null);
|
|
8
8
|
|
|
9
|
-
const emit = defineEmits(["insert"]);
|
|
9
|
+
const emit = defineEmits(["insert", "actionState"]);
|
|
10
10
|
const props = defineProps({
|
|
11
11
|
size: { type: String, default: "small" },
|
|
12
12
|
selectWidth: { type: String, default: "200px" },
|
|
@@ -44,11 +44,12 @@ const handleInsert = () => {
|
|
|
44
44
|
emit("insert", funcName, funcExpression);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
// 窗口: 函数管理(复制, 编辑, 删除)
|
|
47
|
+
// 窗口: 函数管理(打开, 复制, 编辑, 删除)
|
|
48
48
|
const handleCustomFuncManage = async (action, item) => {
|
|
49
49
|
switch (action) {
|
|
50
50
|
case "open": {
|
|
51
51
|
ManageDialogRef.value.open();
|
|
52
|
+
emit("actionState", "因子筛选", "函数管理");
|
|
52
53
|
break;
|
|
53
54
|
}
|
|
54
55
|
case "copy": {
|
|
@@ -5,6 +5,7 @@ import { ref, watch, computed, inject } from "vue";
|
|
|
5
5
|
const clearRow = inject("clearRow");
|
|
6
6
|
|
|
7
7
|
const data = defineModel("data", { default: [] });
|
|
8
|
+
const emit = defineEmits(["actionState"]);
|
|
8
9
|
const props = defineProps({
|
|
9
10
|
config: { type: Object, default: () => {} },
|
|
10
11
|
varietyMarket: { type: null || Number, default: () => null }, // 已选品种市场
|
|
@@ -58,6 +59,7 @@ const handleAction = (action, index) => {
|
|
|
58
59
|
}
|
|
59
60
|
// 窗口确认
|
|
60
61
|
case "submit": {
|
|
62
|
+
emit("actionState", "组合排序");
|
|
61
63
|
const { id, name, value } = compositeOrderForm.value;
|
|
62
64
|
if (!name) return ElMessage.warning("请选择需要排序的条件");
|
|
63
65
|
const { label } = compositeOrderOptions.value.find((item) => item.key === name);
|
|
@@ -8,6 +8,7 @@ import MonacoEditor from "../../../MonacoEditor/index.vue";
|
|
|
8
8
|
|
|
9
9
|
const { request } = inject("stConfig"); // 组件库全局配置
|
|
10
10
|
|
|
11
|
+
const emit = defineEmits(["actionState"]);
|
|
11
12
|
const props = defineProps({
|
|
12
13
|
config: {
|
|
13
14
|
type: Object,
|
|
@@ -322,8 +323,10 @@ const handleScriptCopy = async () => {
|
|
|
322
323
|
ElMessage.success("脚本内容已经成功复制到粘贴板");
|
|
323
324
|
} finally {
|
|
324
325
|
scriptCopyLoading.value = false;
|
|
326
|
+
emit("actionState", "因子筛选", "复制");
|
|
325
327
|
}
|
|
326
328
|
};
|
|
329
|
+
|
|
327
330
|
// 测试: 复制
|
|
328
331
|
const handleTestCodeCopy = () => {
|
|
329
332
|
let txa = document.createElement("textarea");
|
|
@@ -372,6 +375,7 @@ const handleScriptTest = async (action) => {
|
|
|
372
375
|
}
|
|
373
376
|
} finally {
|
|
374
377
|
scriptTestLoading.value = false;
|
|
378
|
+
emit("actionState", "因子筛选", "测试");
|
|
375
379
|
}
|
|
376
380
|
break;
|
|
377
381
|
}
|
|
@@ -386,6 +390,7 @@ const handleScriptTest = async (action) => {
|
|
|
386
390
|
};
|
|
387
391
|
// 测试: AI分析
|
|
388
392
|
const handleTestAi = () => {
|
|
393
|
+
emit("actionState", "因子筛选", "AI分析");
|
|
389
394
|
const appId = "87be17ecc84d4d2ea3108d7155bec2ac";
|
|
390
395
|
const apiKey = "sk-d995eb26a4334bdeb2ccb4cbfaf51de8";
|
|
391
396
|
scriptAILoading.value = true;
|
|
@@ -396,7 +401,6 @@ const handleTestAi = () => {
|
|
|
396
401
|
return;
|
|
397
402
|
}
|
|
398
403
|
scriptTestResult.ai = scriptTestResult.ai + res;
|
|
399
|
-
console.log(scriptTestResult.ai);
|
|
400
404
|
});
|
|
401
405
|
};
|
|
402
406
|
|
|
@@ -568,6 +572,7 @@ watch(
|
|
|
568
572
|
v-show="factorType === '脚本'"
|
|
569
573
|
size="small"
|
|
570
574
|
@insert="handleInsertCustomFunction"
|
|
575
|
+
@actionState="(...args) => emit('actionState', ...args)"
|
|
571
576
|
/>
|
|
572
577
|
<el-button
|
|
573
578
|
type="primary"
|
|
@@ -47,12 +47,11 @@ const config = {
|
|
|
47
47
|
// { label: "深港通", value: 8192, varietyMarketIds: "5" },
|
|
48
48
|
],
|
|
49
49
|
},
|
|
50
|
-
// 自定标签 [选项:
|
|
50
|
+
// 自定标签 [选项: 组件内部请求]
|
|
51
51
|
customTag: {
|
|
52
52
|
show: true,
|
|
53
|
-
options: [],
|
|
54
53
|
},
|
|
55
|
-
// 价差转换 [选项:
|
|
54
|
+
// 价差转换 [选项: 组件默认]
|
|
56
55
|
jcTranslate: {
|
|
57
56
|
show: true,
|
|
58
57
|
jcOptions: [
|
|
@@ -77,7 +76,7 @@ const config = {
|
|
|
77
76
|
factorOptions: [], // 因子下拉框数据源
|
|
78
77
|
factorDescriptions: [], // 因子使用说明数据源
|
|
79
78
|
},
|
|
80
|
-
// 常用指标 [选项:
|
|
79
|
+
// 常用指标 [选项: 组件默认]
|
|
81
80
|
commonIndicator: {
|
|
82
81
|
show: true,
|
|
83
82
|
options: [
|
|
@@ -618,7 +617,7 @@ const config = {
|
|
|
618
617
|
|
|
619
618
|
export default {
|
|
620
619
|
...config,
|
|
621
|
-
// 组合排序 [选项:
|
|
620
|
+
// 组合排序 [选项: 组件默认] 本质就是给常用指标排序用的, 用的就是常用指标的数据源
|
|
622
621
|
compositeOrder: {
|
|
623
622
|
show: true,
|
|
624
623
|
options: config.commonIndicator.options,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup name="VarietySearch">
|
|
2
|
-
import { watch, computed, provide
|
|
2
|
+
import { watch, computed, provide } from "vue";
|
|
3
3
|
import defaultConfig from "./config.js";
|
|
4
4
|
import FactorScreen from "./components/FactorScreen/index.vue";
|
|
5
5
|
import CommonIndicator from "./components/CommonIndicator/index.vue";
|
|
6
6
|
import CompositeOrder from "./components/CompositeOrder/index.vue";
|
|
7
7
|
import AddTag from "./components/AddTag/index.vue";
|
|
8
8
|
|
|
9
|
+
const emit = defineEmits(["actionState"]);
|
|
9
10
|
const props = defineProps({ config: { type: Object, default: {} } });
|
|
10
11
|
const searchData = defineModel("searchData");
|
|
11
12
|
searchData.value = Object.assign(searchData.value, {
|
|
@@ -83,10 +84,6 @@ const marketIdsOptionDict = computed(() => {
|
|
|
83
84
|
return config.value.marketIds.options;
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
|
-
// 选项数据源: 自定标签
|
|
87
|
-
const customTagDict = computed(() => {
|
|
88
|
-
return config.value.customTag.options;
|
|
89
|
-
});
|
|
90
87
|
// 选项数据源: 价差转换
|
|
91
88
|
const jcOptions = computed(() => {
|
|
92
89
|
return config.value.jcTranslate.jcOptions;
|
|
@@ -148,7 +145,7 @@ watch(
|
|
|
148
145
|
return newValue.find(({ value }) => value === id);
|
|
149
146
|
});
|
|
150
147
|
}
|
|
151
|
-
}
|
|
148
|
+
},
|
|
152
149
|
);
|
|
153
150
|
// 监视: 上市市场数据源
|
|
154
151
|
watch(
|
|
@@ -160,7 +157,7 @@ watch(
|
|
|
160
157
|
return newValue.find(({ value }) => value === id);
|
|
161
158
|
});
|
|
162
159
|
}
|
|
163
|
-
}
|
|
160
|
+
},
|
|
164
161
|
);
|
|
165
162
|
|
|
166
163
|
provide("clearRow", clearRow);
|
|
@@ -555,9 +552,7 @@ defineExpose({
|
|
|
555
552
|
<span>自定标签: </span>
|
|
556
553
|
<span @click="clearRow('customTag')">不限</span>
|
|
557
554
|
</div>
|
|
558
|
-
<AddTag
|
|
559
|
-
v-model:data="searchData.customTag"
|
|
560
|
-
/>
|
|
555
|
+
<AddTag v-model:data="searchData.customTag" />
|
|
561
556
|
</div>
|
|
562
557
|
</template>
|
|
563
558
|
<!-- 价差转换 -->
|
|
@@ -603,6 +598,7 @@ defineExpose({
|
|
|
603
598
|
<FactorScreen
|
|
604
599
|
v-model:data="searchData.factorScreen"
|
|
605
600
|
:config="config.factorScreen"
|
|
601
|
+
@actionState="(...args) => emit('actionState', ...args)"
|
|
606
602
|
/>
|
|
607
603
|
</div>
|
|
608
604
|
</template>
|
|
@@ -619,6 +615,7 @@ defineExpose({
|
|
|
619
615
|
:varietyMarket="searchData.varietyMarket"
|
|
620
616
|
:commonOption="searchData.commonOption"
|
|
621
617
|
:config="config.compositeOrder"
|
|
618
|
+
@actionState="(...args) => emit('actionState', ...args)"
|
|
622
619
|
/>
|
|
623
620
|
</div>
|
|
624
621
|
</template>
|
|
@@ -48,7 +48,7 @@ const getTableData = async () => {
|
|
|
48
48
|
* @description: 根据用户最后一次操作交互的时机, 决定排序使用哪个维度
|
|
49
49
|
* 常规排序字段: orderByInfo
|
|
50
50
|
* 表头的orderByInfo和预警组的orderByInfo为顺序互斥, 谁最后操作就用谁
|
|
51
|
-
*
|
|
51
|
+
*
|
|
52
52
|
* 组合排序字段: compositeOrder
|
|
53
53
|
* 表头的orderByInfo与compositeOrder为顺序互斥, 谁最后操作就用谁
|
|
54
54
|
* 预警组的orderByInfo与compositeOrder为强制互斥, compositeOrder有值就一定优先使用compositeOrder
|
|
@@ -105,6 +105,10 @@ const sortChange = ({ column, prop, order }) => {
|
|
|
105
105
|
getTableData();
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
const actionState = (...args) => {
|
|
109
|
+
console.log(...args);
|
|
110
|
+
};
|
|
111
|
+
|
|
108
112
|
onMounted(async () => {
|
|
109
113
|
const dicAlar = await getAlarDict();
|
|
110
114
|
const dicCycle = await getAlarFreq();
|
|
@@ -181,7 +185,7 @@ watch(
|
|
|
181
185
|
},
|
|
182
186
|
{
|
|
183
187
|
deep: true,
|
|
184
|
-
}
|
|
188
|
+
},
|
|
185
189
|
);
|
|
186
190
|
</script>
|
|
187
191
|
|
|
@@ -191,6 +195,7 @@ watch(
|
|
|
191
195
|
ref="varietySearchRef"
|
|
192
196
|
v-model:searchData="varietySearchData"
|
|
193
197
|
:config="varietySearchConfig"
|
|
198
|
+
@actionState="actionState"
|
|
194
199
|
/>
|
|
195
200
|
<div>品种池组件接口参数: {{ apiParams }}</div>
|
|
196
201
|
<el-button
|