st-comp 0.0.205 → 0.0.207

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.205",
4
+ "version": "0.0.207",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -28,10 +28,10 @@ const mainTips = computed(() => {
28
28
  if (data.data && data.data[activeIndex]) {
29
29
  const itemData = data.data[activeIndex];
30
30
  const result = [
31
- { label: "开", value: round(itemData[0]) },
32
- { label: "高", value: round(itemData[3]) },
33
- { label: "低", value: round(itemData[2]) },
34
- { label: "收", value: round(itemData[1]) },
31
+ { label: "开", value: itemData[0] },
32
+ { label: "高", value: itemData[3] },
33
+ { label: "低", value: itemData[2] },
34
+ { label: "收", value: itemData[1] },
35
35
  ];
36
36
  // 特殊: 交易总额
37
37
  itemData[4] !== null && result.push({ label: "额", value: formatValue(itemData[4]) });
@@ -42,7 +42,7 @@ const mainTips = computed(() => {
42
42
  } else if (itemData[6] < 0) {
43
43
  diffColor = "green";
44
44
  }
45
- result.push({ label: "涨跌", value: `${round(itemData[6])}%`, color: diffColor });
45
+ result.push({ label: "涨跌", value: `${itemData[6]}%`, color: diffColor });
46
46
  return result;
47
47
  }
48
48
  return [];
@@ -91,6 +91,11 @@ const clickIndicator = (item) => {
91
91
  indicatorValue.value = { ...baseParams, peTtmLevels: null };
92
92
  break;
93
93
  }
94
+ // 市盈率估值走势分位
95
+ case "peTrendTtmLevels": {
96
+ indicatorValue.value = { ...baseParams, peTrendTtmLevels: null };
97
+ break;
98
+ }
94
99
  // 认沽认购
95
100
  case "optionsCpType": {
96
101
  indicatorValue.value = {
@@ -177,6 +182,15 @@ const submitDialog = () => {
177
182
  indicatorValue.value.tagText = `${label}: 已选${peTtmLevels}分位`;
178
183
  break;
179
184
  }
185
+ // 市盈率估值走势分位
186
+ case "peTrendTtmLevels": {
187
+ const { label, peTrendTtmLevels } = indicatorValue.value;
188
+ // 校验
189
+ if (!peTrendTtmLevels || peTrendTtmLevels.length === 0) return ElMessage.warning("格式错误: 请至少选择一个值");
190
+ // 格式化文案
191
+ indicatorValue.value.tagText = `${label}: 已选${peTrendTtmLevels}分位`;
192
+ break;
193
+ }
180
194
  // 认沽认购
181
195
  case "optionsCpType": {
182
196
  const { label, optionsCpType } = indicatorValue.value;
@@ -596,6 +610,23 @@ const changeMainFlowRadioType = () => {
596
610
  />
597
611
  </el-select>
598
612
  </div>
613
+ <!-- 市盈率估值走势分位 -->
614
+ <div v-if="nowIndicator.key === 'peTrendTtmLevels'">
615
+ <el-select
616
+ v-model="indicatorValue.peTrendTtmLevels"
617
+ multiple
618
+ clearable
619
+ placeholder="请选择"
620
+ style="width: 420px"
621
+ >
622
+ <el-option
623
+ v-for="item in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
624
+ :key="item"
625
+ :label="`${item}分位`"
626
+ :value="item"
627
+ />
628
+ </el-select>
629
+ </div>
599
630
  <!-- 认沽认购 -->
600
631
  <div v-if="nowIndicator.key === 'optionsCpType'">
601
632
  <el-radio-group v-model="indicatorValue.optionsCpType">
@@ -377,6 +377,16 @@ export default {
377
377
  },
378
378
  type: "custom",
379
379
  },
380
+ // 市盈率估值走势分位
381
+ {
382
+ key: "peTrendTtmLevels",
383
+ label: "市盈率估值走势分位",
384
+ parent: {
385
+ varietyMarketIds: [3, 5, 7],
386
+ commonOptionIds: [4, 6, 12, 14, 15, 16],
387
+ },
388
+ type: "custom",
389
+ },
380
390
  // 主力净流入资金
381
391
  {
382
392
  key: "mainFlow",
@@ -270,7 +270,7 @@ defineExpose({
270
270
  // 7.常用指标
271
271
  {
272
272
  const QIQUANKYES = ["expireDays", "virtualRealDegree", "yearProfitRate", "impliedVolatility", "levelMultiplier", "turnover", "volume", "openInterest", "optionsCpType", "optionGear"];
273
- // 1.基本面(type: undefined的指标, 且[期权]的常用指标不计入基本面)
273
+ // 基本面(type: undefined的指标, 且[期权]的常用指标不计入基本面)
274
274
  const query = data.commonIndicator.reduce((result, item) => {
275
275
  const { key, type, range, unit, radioType, radio, rankRange } = item;
276
276
  // 主力净流入资金
@@ -342,27 +342,32 @@ defineExpose({
342
342
  if (query.length) {
343
343
  params.query = query;
344
344
  }
345
- // 2.是否ST
345
+ // 是否ST
346
346
  const stIndicator = data.commonIndicator.find(({ key }) => key === "st");
347
347
  if (stIndicator) {
348
348
  params.st = stIndicator.st;
349
349
  }
350
- // 3.净利润
350
+ // 净利润
351
351
  const netProfitQueryDto = data.commonIndicator.find(({ key }) => key === "tFeaturelncomes");
352
352
  if (netProfitQueryDto) {
353
353
  params.netProfitQueryDto = { ...netProfitQueryDto, netProfit: netProfitQueryDto.netProfit * 100000000.0 };
354
354
  }
355
- // 4.股价分位
355
+ // 股价分位
356
356
  const priceLevelIndicator = data.commonIndicator.find(({ key }) => key === "priceLevels");
357
357
  if (priceLevelIndicator) {
358
358
  params.priceLevels = priceLevelIndicator.priceLevels;
359
359
  }
360
- // 5.市盈率分位
360
+ // 市盈率分位
361
361
  const peTtmLevelIndicator = data.commonIndicator.find(({ key }) => key === "peTtmLevels");
362
362
  if (peTtmLevelIndicator) {
363
363
  params.peTtmLevels = peTtmLevelIndicator.peTtmLevels;
364
364
  }
365
- // 6.期权相关参数
365
+ // 市盈率估值走势分位
366
+ const peTrendTtmLevelIndicator = data.commonIndicator.find(({ key }) => key === "peTrendTtmLevels");
367
+ if (peTrendTtmLevelIndicator) {
368
+ params.peTrendTtmLevels = peTrendTtmLevelIndicator.peTrendTtmLevels;
369
+ }
370
+ // 期权相关参数
366
371
  const searchOptionDto = {};
367
372
  data.commonIndicator.forEach((item) => {
368
373
  const { key } = item;
@@ -418,7 +423,7 @@ defineExpose({
418
423
  break;
419
424
  }
420
425
  });
421
- // 7.成交量
426
+ // 成交量
422
427
  const perVolumnIndicator = data.commonIndicator.find(({ key }) => key === "perVolumn");
423
428
  if (perVolumnIndicator) {
424
429
  params.perVolumn = {