st-comp 0.0.87 → 0.0.88

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.
Files changed (71) hide show
  1. package/es/ChartLayout.cjs +1 -1
  2. package/es/ChartLayout.js +2 -2
  3. package/es/Dialog.cjs +1 -1
  4. package/es/Dialog.js +10 -10
  5. package/es/Kline.cjs +1 -1
  6. package/es/Kline.js +89 -89
  7. package/es/KlineNew.cjs +1 -1
  8. package/es/KlineNew.js +7 -7
  9. package/es/Pagination.cjs +1 -1
  10. package/es/Pagination.js +138 -138
  11. package/es/Table.cjs +1 -1
  12. package/es/Table.js +27 -27
  13. package/es/TreeMap.cjs +1 -2
  14. package/es/TreeMap.js +1 -163
  15. package/es/VarietySearch.cjs +2 -2
  16. package/es/VarietySearch.js +1286 -1191
  17. package/es/VirtualTable.cjs +3 -3
  18. package/es/VirtualTable.js +119 -119
  19. package/es/{base-315cbfab.cjs → base-2b869b95.cjs} +1 -1
  20. package/es/{base-e85dae08.js → base-5e2578a9.js} +66 -66
  21. package/es/{castArray-b93d1330.js → castArray-9b96e1ad.js} +1 -1
  22. package/es/castArray-adec592d.cjs +1 -0
  23. package/es/{config-provider-17c85684.cjs → config-provider-25d2db4b.cjs} +1 -1
  24. package/es/{config-provider-cb918d0f.js → config-provider-ddbd0b1c.js} +8 -8
  25. package/es/{el-button-ec16f484.cjs → el-button-8fca9a5d.cjs} +1 -1
  26. package/es/{el-button-aab1dbd4.js → el-button-daeb181f.js} +60 -60
  27. package/es/{el-empty-ab3ce002.js → el-empty-b1d5d1e4.js} +11 -11
  28. package/es/{el-empty-16ceef82.cjs → el-empty-d83469ab.cjs} +1 -1
  29. package/es/{el-icon-2d22f211.js → el-icon-0bfbe0c8.js} +673 -673
  30. package/es/el-icon-19bc1691.cjs +20 -0
  31. package/es/el-overlay-88994e77.cjs +5 -0
  32. package/es/{el-overlay-98d7f866.js → el-overlay-fcd84f34.js} +66 -66
  33. package/es/{el-scrollbar-7b9d83d5.js → el-scrollbar-0f49204a.js} +44 -44
  34. package/es/{el-scrollbar-9473fd47.cjs → el-scrollbar-43353984.cjs} +1 -1
  35. package/es/{el-select-fd76b16b.js → el-select-1a2f2c95.js} +239 -239
  36. package/es/el-select-c3d21536.cjs +9 -0
  37. package/es/{el-tag-87576c55.js → el-tag-1e32cb79.js} +144 -144
  38. package/es/el-tag-7737bede.cjs +1 -0
  39. package/es/{focus-trap-ea177336.cjs → focus-trap-19c04a47.cjs} +1 -1
  40. package/es/{focus-trap-067be6d2.js → focus-trap-82e6ab3c.js} +12 -12
  41. package/es/raf-7414f3eb.js +6 -0
  42. package/es/{raf-c437ab23.cjs → raf-a8539dc6.cjs} +1 -1
  43. package/es/{scroll-a80e1458.cjs → scroll-5ec08336.cjs} +1 -1
  44. package/es/{scroll-510cef88.js → scroll-8d15ce5a.js} +1 -1
  45. package/es/style.css +1 -1
  46. package/es/{use-form-item-7924b6c1.cjs → use-form-item-3d2a7ac7.cjs} +1 -1
  47. package/es/{use-form-item-439ac27c.js → use-form-item-ea29755c.js} +135 -135
  48. package/es/use-global-config-3496cd4f.cjs +1 -0
  49. package/es/use-global-config-9eba4e5e.js +110 -0
  50. package/es/{vnode-8c7963dc.js → vnode-2ad5aae4.js} +1 -1
  51. package/es/{vnode-85a610a2.cjs → vnode-b447c505.cjs} +1 -1
  52. package/es/{zh-cn-0024c96d.cjs → zh-cn-35bd18a8.cjs} +1 -1
  53. package/es/{zh-cn-c2b42b5f.js → zh-cn-6a7c1846.js} +2 -2
  54. package/lib/bundle.js +1 -1
  55. package/lib/bundle.umd.cjs +119 -119
  56. package/lib/{index-b5647f94.js → index-cf938a55.js} +11428 -11333
  57. package/lib/{python-e2bb6788.js → python-40015c17.js} +1 -1
  58. package/lib/style.css +1 -1
  59. package/package.json +1 -1
  60. package/packages/VarietySearch/components/CommonIndicator/index.vue +190 -59
  61. package/packages/VarietySearch/config.js +32 -7
  62. package/packages/VarietySearch/index.vue +67 -12
  63. package/src/pages/VarietySearch/index.vue +31 -7
  64. package/es/castArray-f54f6f75.cjs +0 -1
  65. package/es/el-icon-773986c7.cjs +0 -20
  66. package/es/el-overlay-6d0c5cc3.cjs +0 -5
  67. package/es/el-select-d3f15536.cjs +0 -9
  68. package/es/el-tag-a6a4d4ef.cjs +0 -1
  69. package/es/raf-b091dc88.js +0 -6
  70. package/es/use-global-config-857b51f5.js +0 -110
  71. package/es/use-global-config-d02be80b.cjs +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.87",
4
+ "version": "0.0.88",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -26,15 +26,14 @@ const commonIndicatorOptions = computed(() => {
26
26
  result = result.filter(({ parent }) => {
27
27
  const { commonOptionIds } = parent;
28
28
  // 只要选择了的常用选项里面, 有commonOptionIds中的值, 那么就展示, 即判断两个数组是否有重复元素
29
- return (
30
- [...new Set([...commonOptionIds, ...props.commonOption])].length !==
31
- [...commonOptionIds, ...props.commonOption].length
32
- );
29
+ return [...new Set([...commonOptionIds, ...props.commonOption])].length !== [...commonOptionIds, ...props.commonOption].length;
33
30
  });
34
31
  }
35
32
  }
36
33
  return result;
37
34
  });
35
+
36
+ // 监视: 常用指标数据源
38
37
  watch(
39
38
  () => commonIndicatorOptions.value,
40
39
  () => {
@@ -84,6 +83,10 @@ const clickIndicator = (item) => {
84
83
  netProfit: null,
85
84
  };
86
85
  }
86
+ // 股价分位
87
+ else if (item.key === "priceLevels") {
88
+ indicatorValue.value = { ...baseParams, priceLevels: null };
89
+ }
87
90
  // 认沽认购
88
91
  else if (item.key === "optionsCpType") {
89
92
  indicatorValue.value = {
@@ -95,7 +98,6 @@ const clickIndicator = (item) => {
95
98
  // 打开弹窗
96
99
  visible.value = true;
97
100
  };
98
-
99
101
  // 函数: 点击快捷选项[type-undefined 通用性]
100
102
  const clickConvenientOption = (item) => {
101
103
  indicatorValue.value.range = [...item.range];
@@ -150,43 +152,98 @@ const clicktFeaturelncomesOption = (value) => {
150
152
  // 函数: 确定 (新增custom配置项时, 需要改动)
151
153
  const submitDialog = () => {
152
154
  // 校验 + 格式化文案
153
- if (indicatorValue.value.type === undefined) {
154
- const { label, range, unit } = indicatorValue.value;
155
- // 校验
156
- if (["", null].includes(range[0]) && ["", null].includes(range[1])) {
157
- return ElMessage.warning("格式错误: 请至少填写一个值");
155
+ switch (indicatorValue.value.key) {
156
+ // 是否ST
157
+ case "st": {
158
+ const { label, st } = indicatorValue.value;
159
+ // 校验
160
+ if (st === null) return ElMessage.warning("格式错误: 请至少选择一个值");
161
+ // 格式化文案
162
+ indicatorValue.value.tagText = `${label}: ${st ? "是" : "否"}`;
163
+ break;
158
164
  }
159
- // 格式化文案
160
- if (!["", null].includes(range[0]) && !["", null].includes(range[1])) {
161
- indicatorValue.value.tagText = `${label}: ${range[0]}${unit[0] ?? ""} ~ ${range[1]}${unit[1] ?? ""}`;
162
- } else if (!["", null].includes(range[0])) {
163
- indicatorValue.value.tagText = `${label}: ≥${range[0]}${unit[0] ?? ""}`;
164
- } else {
165
- indicatorValue.value.tagText = `${label}: ≤${range[1]}${unit[1] ?? ""}`;
165
+ // 净利润
166
+ case "tFeaturelncomes": {
167
+ const { label, rule, withFewYears, yearsCount, netProfit } = indicatorValue.value;
168
+ // 校验
169
+ if (["", null].includes(withFewYears) || ["", null].includes(yearsCount) || ["", null].includes(netProfit)) {
170
+ return ElMessage.warning("格式错误: 请填写完整");
171
+ }
172
+ // 格式化文案
173
+ indicatorValue.value.tagText = `${label}: ${withFewYears}年内${yearsCount}年以上盈利${rule === 1 ? "超" : "跌"}过${netProfit}亿`;
174
+ break;
166
175
  }
167
- } else if (indicatorValue.value.key === "st") {
168
- const { label, st } = indicatorValue.value;
169
- // 校验
170
- if (st === null) return ElMessage.warning("格式错误: 请至少选择一个值");
171
- // 格式化文案
172
- indicatorValue.value.tagText = `${label}: ${st ? "是" : "否"}`;
173
- } else if (indicatorValue.value.key === "tFeaturelncomes") {
174
- const { label, rule, withFewYears, yearsCount, netProfit } = indicatorValue.value;
175
- // 校验
176
- if (["", null].includes(withFewYears) || ["", null].includes(yearsCount) || ["", null].includes(netProfit)) {
177
- return ElMessage.warning("格式错误: 请填写完整");
176
+ // 股价分位
177
+ case "priceLevels": {
178
+ const { label, priceLevels } = indicatorValue.value;
179
+ // 校验
180
+ if (!priceLevels || priceLevels.length === 0) return ElMessage.warning("格式错误: 请至少选择一个值");
181
+ // 格式化文案
182
+ indicatorValue.value.tagText = `${label}: 已选${priceLevels}分位`;
183
+ break;
184
+ }
185
+ // 认沽认购
186
+ case "optionsCpType": {
187
+ const { label, optionsCpType } = indicatorValue.value;
188
+ // 校验
189
+ if (optionsCpType === null) return ElMessage.warning("格式错误: 请至少选择一个值");
190
+ // 格式化文案
191
+ indicatorValue.value.tagText = `${label}: ${optionsCpType === 1 ? "看涨" : "看跌"}`;
192
+ break;
193
+ }
194
+ // 其它的通用处理
195
+ default: {
196
+ const { label, range, unit } = indicatorValue.value;
197
+ // 校验
198
+ if (["", null].includes(range[0]) && ["", null].includes(range[1])) {
199
+ return ElMessage.warning("格式错误: 请至少填写一个值");
200
+ }
201
+ // 格式化文案
202
+ if (!["", null].includes(range[0]) && !["", null].includes(range[1])) {
203
+ indicatorValue.value.tagText = `${label}: ${range[0]}${unit[0] ?? ""} ~ ${range[1]}${unit[1] ?? ""}`;
204
+ } else if (!["", null].includes(range[0])) {
205
+ indicatorValue.value.tagText = `${label}: ≥${range[0]}${unit[0] ?? ""}`;
206
+ } else {
207
+ indicatorValue.value.tagText = `${label}: ≤${range[1]}${unit[1] ?? ""}`;
208
+ }
178
209
  }
179
- // 格式化文案
180
- indicatorValue.value.tagText = `${label}: ${withFewYears}年内${yearsCount}年以上盈利${
181
- rule === 1 ? "超" : "跌"
182
- }过${netProfit}亿`;
183
- } else if (indicatorValue.value.key === "optionsCpType") {
184
- const { label, optionsCpType } = indicatorValue.value;
185
- // 校验
186
- if (optionsCpType === null) return ElMessage.warning("格式错误: 请至少选择一个值");
187
- // 格式化文案
188
- indicatorValue.value.tagText = `${label}: ${optionsCpType === 1 ? "看涨" : "看跌"}`;
189
210
  }
211
+ // 校验 + 格式化文案 废弃于: 2024-12-04 0.0.88版本
212
+ // if (indicatorValue.value.type === undefined) {
213
+ // const { label, range, unit } = indicatorValue.value;
214
+ // // 校验
215
+ // if (["", null].includes(range[0]) && ["", null].includes(range[1])) {
216
+ // return ElMessage.warning("格式错误: 请至少填写一个值");
217
+ // }
218
+ // // 格式化文案
219
+ // if (!["", null].includes(range[0]) && !["", null].includes(range[1])) {
220
+ // indicatorValue.value.tagText = `${label}: ${range[0]}${unit[0] ?? ""} ~ ${range[1]}${unit[1] ?? ""}`;
221
+ // } else if (!["", null].includes(range[0])) {
222
+ // indicatorValue.value.tagText = `${label}: ≥${range[0]}${unit[0] ?? ""}`;
223
+ // } else {
224
+ // indicatorValue.value.tagText = `${label}: ≤${range[1]}${unit[1] ?? ""}`;
225
+ // }
226
+ // } else if (indicatorValue.value.key === "st") {
227
+ // const { label, st } = indicatorValue.value;
228
+ // // 校验
229
+ // if (st === null) return ElMessage.warning("格式错误: 请至少选择一个值");
230
+ // // 格式化文案
231
+ // indicatorValue.value.tagText = `${label}: ${st ? "是" : "否"}`;
232
+ // } else if (indicatorValue.value.key === "tFeaturelncomes") {
233
+ // const { label, rule, withFewYears, yearsCount, netProfit } = indicatorValue.value;
234
+ // // 校验
235
+ // if (["", null].includes(withFewYears) || ["", null].includes(yearsCount) || ["", null].includes(netProfit)) {
236
+ // return ElMessage.warning("格式错误: 请填写完整");
237
+ // }
238
+ // // 格式化文案
239
+ // indicatorValue.value.tagText = `${label}: ${withFewYears}年内${yearsCount}年以上盈利${rule === 1 ? "超" : "跌"}过${netProfit}亿`;
240
+ // } else if (indicatorValue.value.key === "optionsCpType") {
241
+ // const { label, optionsCpType } = indicatorValue.value;
242
+ // // 校验
243
+ // if (optionsCpType === null) return ElMessage.warning("格式错误: 请至少选择一个值");
244
+ // // 格式化文案
245
+ // indicatorValue.value.tagText = `${label}: ${optionsCpType === 1 ? "看涨" : "看跌"}`;
246
+ // }
190
247
  // 判断data中是否已存在同样key的数据, 如果存在则替换, 如果不存在就push
191
248
  const keyIndex = data.value.findIndex(({ key }) => key === indicatorValue.value.key);
192
249
  if (keyIndex === -1) {
@@ -210,7 +267,10 @@ const editTag = (item) => {
210
267
  </script>
211
268
 
212
269
  <template>
213
- <div class="common-indicator" v-if="config.show && commonIndicatorOptions.length">
270
+ <div
271
+ class="common-indicator"
272
+ v-if="config.show && commonIndicatorOptions.length"
273
+ >
214
274
  <!-- 指标项展示区域 -->
215
275
  <div class="indicator">
216
276
  <div class="title">
@@ -218,21 +278,45 @@ const editTag = (item) => {
218
278
  <span>不限</span>
219
279
  </div>
220
280
  <div class="options">
221
- <span v-for="item in commonIndicatorOptions" :key="item.key" @click="clickIndicator(item)"> {{ item.label }} </span>
281
+ <span
282
+ v-for="item in commonIndicatorOptions"
283
+ :key="item.key"
284
+ @click="clickIndicator(item)"
285
+ >
286
+ {{ item.label }}
287
+ </span>
222
288
  </div>
223
289
  </div>
224
290
  <div class="tags">
225
- <el-tag v-for="(item, index) in data" closable type="info" @close="deleteTag(index)">
291
+ <el-tag
292
+ v-for="(item, index) in data"
293
+ closable
294
+ type="info"
295
+ @close="deleteTag(index)"
296
+ >
226
297
  <span>{{ item.tagText }}</span>
227
- <span class="edit" @click="editTag(item)">编辑</span>
298
+ <span
299
+ class="edit"
300
+ @click="editTag(item)"
301
+ >编辑</span
302
+ >
228
303
  </el-tag>
229
304
  </div>
230
305
  <!-- 指标具体弹窗 -->
231
- <el-dialog v-model="visible" :title="nowIndicator.label" width="600" align-center destroy-on-close>
306
+ <el-dialog
307
+ v-model="visible"
308
+ :title="nowIndicator.label"
309
+ width="600"
310
+ align-center
311
+ destroy-on-close
312
+ >
232
313
  <!-- type: undefined 为默认便捷配置项 + 输入框形式 -->
233
314
  <template v-if="nowIndicator.type === undefined">
234
315
  <!-- 便捷配置项区域 -->
235
- <div class="convenient-option-box" v-if="nowIndicator.convenientOptions.length">
316
+ <div
317
+ class="convenient-option-box"
318
+ v-if="nowIndicator.convenientOptions.length"
319
+ >
236
320
  <el-button
237
321
  v-for="item in nowIndicator.convenientOptions"
238
322
  :key="item.text"
@@ -243,30 +327,50 @@ const editTag = (item) => {
243
327
  <!-- 输入框区域 -->
244
328
  <div class="out-box">
245
329
  <span>自定义: </span>
246
- <el-input v-model="indicatorValue.range[0]" style="flex: 1">
330
+ <el-input
331
+ v-model="indicatorValue.range[0]"
332
+ style="flex: 1"
333
+ >
247
334
  <!-- 单位 -->
248
- <template #append v-if="nowIndicator.unitOptions.length">
335
+ <template
336
+ #append
337
+ v-if="nowIndicator.unitOptions.length"
338
+ >
249
339
  <span v-if="nowIndicator.unitOptions.length === 1">{{ indicatorValue.unit[0] }}</span>
250
340
  <el-select
251
341
  v-else
252
342
  v-model="indicatorValue.unit[0]"
253
343
  style="width: 72px"
254
344
  >
255
- <el-option v-for="unit in nowIndicator.unitOptions" :label="unit" :value="unit" />
345
+ <el-option
346
+ v-for="unit in nowIndicator.unitOptions"
347
+ :label="unit"
348
+ :value="unit"
349
+ />
256
350
  </el-select>
257
351
  </template>
258
352
  </el-input>
259
353
  ~
260
- <el-input v-model="indicatorValue.range[1]" style="flex: 1">
354
+ <el-input
355
+ v-model="indicatorValue.range[1]"
356
+ style="flex: 1"
357
+ >
261
358
  <!-- 单位 -->
262
- <template #append v-if="nowIndicator.unitOptions.length">
359
+ <template
360
+ #append
361
+ v-if="nowIndicator.unitOptions.length"
362
+ >
263
363
  <span v-if="nowIndicator.unitOptions.length === 1">{{ indicatorValue.unit[1] }}</span>
264
364
  <el-select
265
365
  v-else
266
366
  v-model="indicatorValue.unit[1]"
267
367
  style="width: 72px"
268
368
  >
269
- <el-option v-for="unit in nowIndicator.unitOptions" :label="unit" :value="unit" />
369
+ <el-option
370
+ v-for="unit in nowIndicator.unitOptions"
371
+ :label="unit"
372
+ :value="unit"
373
+ />
270
374
  </el-select>
271
375
  </template>
272
376
  </el-input>
@@ -287,9 +391,7 @@ const editTag = (item) => {
287
391
  <div class="tFeaturelncomes-option-box">
288
392
  <el-button @click="clicktFeaturelncomesOption('≤0')">≤0</el-button>
289
393
  <el-button @click="clicktFeaturelncomesOption('≥0')">≥0</el-button>
290
- <el-button @click="clicktFeaturelncomesOption('五年内有四年以上盈利超过5千万')"
291
- >五年内有四年以上盈利超过5千万</el-button
292
- >
394
+ <el-button @click="clicktFeaturelncomesOption('五年内有四年以上盈利超过5千万')">五年内有四年以上盈利超过5千万</el-button>
293
395
  <el-button @click="clicktFeaturelncomesOption('≥10亿')">≥10亿</el-button>
294
396
  <el-button @click="clicktFeaturelncomesOption('≥20亿')">≥20亿</el-button>
295
397
  </div>
@@ -297,15 +399,40 @@ const editTag = (item) => {
297
399
  <div class="tFeaturelncomes-out-box">
298
400
  <span>自定义: </span>
299
401
  <div>
300
- <el-input-number v-model="indicatorValue.withFewYears" controls-position="right" />
402
+ <el-input-number
403
+ v-model="indicatorValue.withFewYears"
404
+ controls-position="right"
405
+ />
301
406
  年内
302
- <el-input-number v-model="indicatorValue.yearsCount" controls-position="right" />
407
+ <el-input-number
408
+ v-model="indicatorValue.yearsCount"
409
+ controls-position="right"
410
+ />
303
411
  年以上盈利{{ indicatorValue.rule === 1 ? "超" : "跌" }}过
304
- <el-input-number v-model="indicatorValue.netProfit" controls-position="right" />
412
+ <el-input-number
413
+ v-model="indicatorValue.netProfit"
414
+ controls-position="right"
415
+ />
305
416
  亿
306
417
  </div>
307
418
  </div>
308
419
  </div>
420
+ <!-- 股价分位 -->
421
+ <div v-if="nowIndicator.key === 'priceLevels'">
422
+ <el-select
423
+ v-model="indicatorValue.priceLevels"
424
+ multiple
425
+ placeholder="请选择"
426
+ style="width: 100%"
427
+ >
428
+ <el-option
429
+ v-for="item in [1, 2, 3, 4, 5]"
430
+ :key="item"
431
+ :label="`${item}分位`"
432
+ :value="item"
433
+ />
434
+ </el-select>
435
+ </div>
309
436
  <!-- 认沽认购 -->
310
437
  <div v-if="nowIndicator.key === 'optionsCpType'">
311
438
  <el-radio-group v-model="indicatorValue.optionsCpType">
@@ -316,7 +443,11 @@ const editTag = (item) => {
316
443
  </template>
317
444
  <template #footer>
318
445
  <div class="dialog-footer">
319
- <el-button type="primary" @click="submitDialog">确定</el-button>
446
+ <el-button
447
+ type="primary"
448
+ @click="submitDialog"
449
+ >确定</el-button
450
+ >
320
451
  </div>
321
452
  </template>
322
453
  </el-dialog>
@@ -351,8 +482,8 @@ const editTag = (item) => {
351
482
  padding: 4px 0;
352
483
  margin-right: 20px;
353
484
  cursor: pointer;
354
- &:hover{
355
- color: var(--el-color-primary)
485
+ &:hover {
486
+ color: var(--el-color-primary);
356
487
  }
357
488
  }
358
489
  }
@@ -1,6 +1,7 @@
1
- // 默认配置项
1
+ // 品种池搜索组件的默认配置项
2
+
2
3
  export default {
3
- // 品种市场
4
+ // 品种市场 [选项: 前端默认]
4
5
  varietyMarket: {
5
6
  show: true,
6
7
  options: [
@@ -13,7 +14,7 @@ export default {
13
14
  { label: "期权", value: 8, memo: [11] },
14
15
  ],
15
16
  },
16
- // 常用选项
17
+ // 常用选项 [选项: 前端默认]
17
18
  commonOption: {
18
19
  show: true,
19
20
  options: [
@@ -33,12 +34,26 @@ export default {
33
34
  { label: "概念板块指数", value: 15 },
34
35
  ],
35
36
  },
36
- // 自定义标签
37
+ // 上市板块 [选项: 接口获取**!]
38
+ marketIds: {
39
+ show: true,
40
+ options: [
41
+ // { label: "沪深主板", value: 1, varietyMarketIds: [3] },
42
+ // { label: "创业板", value: 2, varietyMarketIds: [3] },
43
+ // { label: "科创板", value: 4, varietyMarketIds: [3] },
44
+ // { label: "新三板", value: 8, varietyMarketIds: [3] },
45
+ // { label: "沪股通", value: 1024, varietyMarketIds: [3] },
46
+ // { label: "深股通", value: 2048, varietyMarketIds: [3] },
47
+ // { label: "沪港通", value: 4096, varietyMarketIds: [5] },
48
+ // { label: "深港通", value: 8192, varietyMarketIds: [5] },
49
+ ],
50
+ },
51
+ // 自定标签 [选项: 接口获取**!]
37
52
  customTag: {
38
53
  show: true,
39
54
  options: [],
40
55
  },
41
- // 因子筛选
56
+ // 因子筛选 [选项: 接口获取**!]
42
57
  factorScreen: {
43
58
  show: true,
44
59
  // SQL功能是否展示
@@ -51,7 +66,7 @@ export default {
51
66
  factorOptions: [], // 因子下拉框数据源
52
67
  factorDescriptions: [], // 因子使用说明数据源
53
68
  },
54
- // 常用指标
69
+ // 常用指标 [选项: 前端默认]
55
70
  commonIndicator: {
56
71
  show: true,
57
72
  options: [
@@ -315,6 +330,16 @@ export default {
315
330
  // 单位下拉框选项
316
331
  unitOptions: ["%"],
317
332
  },
333
+ // 股价分位
334
+ {
335
+ key: "priceLevels",
336
+ label: "股价分位",
337
+ parent: {
338
+ varietyMarketIds: [3, 5, 7],
339
+ commonOptionIds: [4, 6, 12, 14, 15],
340
+ },
341
+ type: "custom",
342
+ },
318
343
  // ----------期权-----------
319
344
  // 过期天数
320
345
  {
@@ -446,7 +471,7 @@ export default {
446
471
  },
447
472
  type: "custom",
448
473
  },
449
- // 持仓量
474
+ // 期权档位
450
475
  {
451
476
  key: "optionGear",
452
477
  label: "期权档位",
@@ -4,16 +4,15 @@ 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
 
7
- const props = defineProps({
8
- // 配置项
9
- config: { type: Object, default: {} },
10
- });
7
+ const props = defineProps({ config: { type: Object, default: {} } });
11
8
  const searchData = defineModel("searchData", {
12
9
  default: {
13
10
  // 品种市场
14
11
  varietyMarket: null,
15
12
  // 常用选项
16
13
  commonOption: [],
14
+ // 上市板块
15
+ marketIds: [],
17
16
  // 自定标签
18
17
  customTag: [],
19
18
  // 因子筛选
@@ -45,16 +44,30 @@ const varietyMarketDict = computed(() => {
45
44
  // 选项数据源: 常用选项
46
45
  const commonOptionDict = computed(() => {
47
46
  const { varietyMarket } = searchData.value;
48
- // 如果已选品种市场,仅展示对应子级下的
47
+ // 已选品种市场,仅展示匹配的
49
48
  if (varietyMarket) {
50
49
  const memo = varietyMarketDict.value.find(({ value }) => value === varietyMarket).memo;
51
50
  return config.value.commonOption.options.filter(({ value }) => memo.includes(value));
52
51
  }
53
- // 如果未选品种市场,则展示全部
52
+ // 未选品种市场,展示全部
54
53
  else {
55
54
  return config.value.commonOption.options;
56
55
  }
57
56
  });
57
+ // 选项数据源: 上市市场
58
+ const marketIdsOptionDict = computed(() => {
59
+ const { varietyMarket } = searchData.value;
60
+ // 已选品种市场, 仅展示匹配的
61
+ if (varietyMarket) {
62
+ return config.value.marketIds.options.filter((item) => {
63
+ return item.varietyMarketIds.includes(varietyMarket);
64
+ });
65
+ }
66
+ // 未选品种市场,展示全部
67
+ else {
68
+ return config.value.marketIds.options;
69
+ }
70
+ });
58
71
  // 选项数据源: 自定标签
59
72
  const customTagDict = computed(() => {
60
73
  return config.value.customTag.options;
@@ -62,7 +75,7 @@ const customTagDict = computed(() => {
62
75
 
63
76
  // 不限
64
77
  const clearRow = (key) => {
65
- if (["commonOption", "customTag", "factorScreen", "commonIndicator"].includes(key)) searchData.value[key] = [];
78
+ if (["commonOption", "marketIds", "customTag", "factorScreen", "commonIndicator"].includes(key)) searchData.value[key] = [];
66
79
  else searchData.value[key] = null;
67
80
  };
68
81
 
@@ -78,6 +91,18 @@ watch(
78
91
  }
79
92
  }
80
93
  );
94
+ // 监视: 上市市场数据源
95
+ watch(
96
+ () => marketIdsOptionDict.value,
97
+ (newValue) => {
98
+ // 如果常用选项已经进行了勾选, 则只保留常用选项中存在的值
99
+ if (searchData.value.marketIds.length) {
100
+ searchData.value.marketIds = searchData.value.marketIds.filter((id) => {
101
+ return newValue.find(({ value }) => value === id);
102
+ });
103
+ }
104
+ }
105
+ );
81
106
 
82
107
  defineExpose({
83
108
  // 生成接口传参结构的数据
@@ -92,11 +117,15 @@ defineExpose({
92
117
  if (data.commonOption?.length) {
93
118
  params.optionId = data.commonOption.join(",");
94
119
  }
95
- // 3.自定标签
120
+ // 3.上市板块
121
+ if (data.marketIds?.length) {
122
+ params.marketIds = data.marketIds;
123
+ }
124
+ // 4.自定标签
96
125
  if (data.customTag?.length) {
97
126
  params.tagIds = data.customTag;
98
127
  }
99
- // 4.因子筛选
128
+ // 5.因子筛选
100
129
  if (config.value.factorScreen?.show) {
101
130
  const { factorScreen } = data;
102
131
  if (factorScreen?.list?.length) {
@@ -114,10 +143,10 @@ defineExpose({
114
143
  params.sql = factorScreen.sqlValue;
115
144
  }
116
145
  }
117
- // 5.常用指标
146
+ // 6.常用指标
118
147
  {
119
148
  const QIQUANKYES = ["expireDays", "virtualRealDegree", "yearProfitRate", "impliedVolatility", "levelMultiplier", "turnover", "volume", "openInterest", "optionsCpType", "optionGear"];
120
- // 1.常用指标-基本面( 表中 type: undefined 的指标, [期权]的常用指标不计入基本面)
149
+ // 1.常用指标-基本面(type:undefined的指标, [期权]的常用指标不计入基本面)
121
150
  const query = data.commonIndicator.reduce((result, item) => {
122
151
  const { key, type, range, unit } = item;
123
152
  // 股息率
@@ -181,7 +210,12 @@ defineExpose({
181
210
  if (netProfitQueryDto) {
182
211
  params.netProfitQueryDto = { ...netProfitQueryDto, netProfit: netProfitQueryDto.netProfit * 100000000.0 };
183
212
  }
184
- // 4.常用指标-期权相关参数
213
+ // 4.常用指标-股价分位
214
+ const priceLevelIndicator = data.commonIndicator.find(({ key }) => key === "priceLevels");
215
+ if (priceLevelIndicator) {
216
+ params.priceLevels = priceLevelIndicator.priceLevels;
217
+ }
218
+ // 5.常用指标-期权相关参数
185
219
  const searchOptionDto = {};
186
220
  data.commonIndicator.forEach((item) => {
187
221
  const { key } = item;
@@ -291,6 +325,27 @@ defineExpose({
291
325
  >
292
326
  </el-checkbox-group>
293
327
  </div>
328
+ <!-- 上市板块 -->
329
+ <div
330
+ v-if="config.marketIds?.show && marketIdsOptionDict.length"
331
+ class="variety-search-row"
332
+ >
333
+ <div class="title">
334
+ <span>上市板块: </span>
335
+ <span @click="clearRow('marketIds')">不限</span>
336
+ </div>
337
+ <el-checkbox-group
338
+ v-model="searchData.marketIds"
339
+ size="small"
340
+ >
341
+ <el-checkbox
342
+ v-for="{ label, value } in marketIdsOptionDict"
343
+ :label="value"
344
+ :key="value"
345
+ >{{ label }}</el-checkbox
346
+ >
347
+ </el-checkbox-group>
348
+ </div>
294
349
  <!-- 自定标签 -->
295
350
  <div
296
351
  v-if="config.customTag?.show && customTagDict.length"