st-comp 0.0.204 → 0.0.205

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 (74) hide show
  1. package/es/ChartLayout.js +4 -4
  2. package/es/CustomFunction.cjs +1 -1
  3. package/es/CustomFunction.js +29 -29
  4. package/es/FactorWarning.cjs +1 -1
  5. package/es/FactorWarning.js +210 -201
  6. package/es/Kline.js +17 -17
  7. package/es/KlineBasic.js +26 -26
  8. package/es/KlineConfig.js +61 -61
  9. package/es/KlineNew.js +16 -16
  10. package/es/KlinePlus.js +19 -19
  11. package/es/Map.cjs +1 -1
  12. package/es/Map.js +102944 -1
  13. package/es/Pagination.js +73 -73
  14. package/es/PasswordPrompt.js +3 -3
  15. package/es/Table.js +38 -38
  16. package/es/User.js +44 -44
  17. package/es/VarSelectDialog.js +24 -24
  18. package/es/VarietyAutoComplete.js +10 -10
  19. package/es/VarietySearch.js +34 -34
  20. package/es/VarietyTextCopy.js +12 -12
  21. package/es/VirtualTable.js +70 -70
  22. package/es/{_initCloneObject-4ff4ab39.js → _initCloneObject-eaef9418.js} +7 -7
  23. package/es/{base-ff0e366f.js → base-a5af3db3.js} +40 -40
  24. package/es/{castArray-15070be9.js → castArray-7741a212.js} +1 -1
  25. package/es/{config-provider-1a9362d1.js → config-provider-b16efd62.js} +6 -6
  26. package/es/{debounce-e9e47f9a.js → debounce-8d53f4dd.js} +1 -1
  27. package/es/{dropdown-b3b26078.js → dropdown-a59bba73.js} +13 -13
  28. package/es/{el-autocomplete-a52b6885.js → el-autocomplete-ba808eb6.js} +16 -16
  29. package/es/{el-button-65aa0485.js → el-button-c95adb85.js} +39 -39
  30. package/es/{el-checkbox-feb78213.js → el-checkbox-7421ccd3.js} +31 -31
  31. package/es/{el-dialog-234e3137.js → el-dialog-41ab8417.js} +15 -15
  32. package/es/{el-divider-4fe55ebe.js → el-divider-4e059794.js} +1 -1
  33. package/es/{el-empty-ceecb81c.js → el-empty-33cb66f1.js} +5 -5
  34. package/es/{el-form-item-a68893fa.js → el-form-item-c53c374d.js} +34 -34
  35. package/es/{el-input-77c46a8a.js → el-input-2f75c4ba.js} +55 -55
  36. package/es/{el-input-number-23da18a4.js → el-input-number-5193fe6d.js} +31 -31
  37. package/es/{el-loading-025e8c34.js → el-loading-f6022062.js} +5 -5
  38. package/es/{el-menu-item-b1e678ba.js → el-menu-item-7e881203.js} +22 -22
  39. package/es/{el-message-box-db6c3469.js → el-message-box-a93d2f6a.js} +11 -11
  40. package/es/{el-message-8d817082.js → el-message-e544a8f5.js} +23 -23
  41. package/es/{el-overlay-3ebd4a6a.js → el-overlay-09ad71cd.js} +56 -56
  42. package/es/{el-popconfirm-5d93ad96.js → el-popconfirm-81dcd202.js} +20 -20
  43. package/es/{el-popper-ba55a170.js → el-popper-b4f97157.js} +109 -109
  44. package/es/{el-segmented-2813a6dc.js → el-segmented-b868d074.js} +8 -8
  45. package/es/{el-select-71af6fab.js → el-select-95627997.js} +64 -64
  46. package/es/{el-table-column-5d64176c.js → el-table-column-376cd907.js} +15 -15
  47. package/es/{el-tag-ca50befb.js → el-tag-66cab138.js} +15 -15
  48. package/es/{el-text-697ca5b5.js → el-text-ac60d0f2.js} +2 -2
  49. package/es/{index-923df02f.js → index-1f7d4f70.js} +2 -2
  50. package/es/{index-fca9441b.js → index-57672682.js} +3 -3
  51. package/es/{index-730c5d79.js → index-844bdd85.js} +34 -34
  52. package/es/{index-c30bd093.js → index-88546436.js} +17 -17
  53. package/es/{index-269b8a8c.js → index-960806da.js} +36 -36
  54. package/es/{index-8525fbd3.js → index-a871c3eb.js} +27 -27
  55. package/es/{index-93a8960e.js → index-d77a7336.js} +1 -1
  56. package/es/{index-56abb80d.js → index-d91dc23f.js} +12 -12
  57. package/es/{index-7b6ba27d.js → index-e5566b94.js} +43 -43
  58. package/es/raf-80ef0c0a.js +6 -0
  59. package/es/{scroll-41b4f625.js → scroll-679bd6bf.js} +5 -5
  60. package/es/style.css +1 -1
  61. package/es/{use-form-common-props-b342410c.js → use-form-common-props-815d48a6.js} +67 -67
  62. package/es/{use-global-config-409a5a22.js → use-global-config-b5e9d3d5.js} +14 -14
  63. package/es/{validator-46456823.js → validator-764a9db0.js} +1 -1
  64. package/es/{vnode-06571d5b.js → vnode-5ddb7ed1.js} +1 -1
  65. package/es/{zh-cn-87c8697d.js → zh-cn-e963c628.js} +2 -2
  66. package/lib/bundle.js +1 -1
  67. package/lib/bundle.umd.cjs +1 -1
  68. package/lib/{index-41eb55d2.js → index-ca5075d2.js} +16 -7
  69. package/lib/{python-89c64241.js → python-d88672d8.js} +1 -1
  70. package/lib/style.css +1 -1
  71. package/package.json +1 -1
  72. package/packages/FactorWarning/index.vue +14 -3
  73. package/src/pages/FactorWarning/index.vue +73 -84
  74. package/es/raf-8e05a7f4.js +0 -6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.204",
4
+ "version": "0.0.205",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import { nextTick, ref, watch } from "vue";
3
2
  import zhCn from "element-plus/es/locale/lang/zh-cn";
4
3
  import { InfoFilled } from "@element-plus/icons-vue";
4
+ import { ref, watch } from "vue";
5
5
  import { defaultShowConfig } from "./tools";
6
6
  import { debounce } from "st-func";
7
7
 
@@ -82,9 +82,20 @@ const handleThreeAdd = async (factorName) => {
82
82
  });
83
83
  const fsParams = {
84
84
  factorSelectedList: ruleForm.value.factorSelectedList.map((factorName) => {
85
+ let totalCount = 3;
86
+ // 判断表格里面有没有同因子的数据, 如果有的话需要确保增加以后的有效次数 <= 12
87
+ const repeatData = props.tableData.find(({ factorExtendName }) => factorExtendName === factorName);
88
+ if (repeatData) {
89
+ const diff = repeatData.totalCount - repeatData.currentCount;
90
+ // 如果: 已触发次数 === 触发次数上限, 直接全额添加, 此时后端会另起一行数据的
91
+ if (diff === 0) totalCount = 3;
92
+ // 如果: 已触发次数 !== 触发次数上限 确保添加后的diff要小于等于12, 出于兼容老数据1/20类似的情况考虑, 加个容错
93
+ else totalCount = Math.min(3, 12 - diff >= 0 ? 12 - diff : 0);
94
+ }
85
95
  return {
86
96
  factorName,
87
97
  ...ruleForm.value,
98
+ totalCount,
88
99
  };
89
100
  }),
90
101
  };
@@ -111,9 +122,9 @@ const handleFastControls = async (item) => {
111
122
  const repeatData = props.tableData.find(({ factorExtendName }) => factorExtendName === factorName);
112
123
  if (repeatData) {
113
124
  const diff = repeatData.totalCount - repeatData.currentCount;
114
- // 如果: 已触发次数 === 触发次数上限, 直接+3, 此时后端会另起一行数据的
125
+ // 如果: 已触发次数 === 触发次数上限, 直接全额添加, 此时后端会另起一行数据的
115
126
  if (diff === 0) totalCount = data.totalCount;
116
- // 确保添加后的diff要小于等于10, 出于兼容老数据1/20类似的情况考虑, 加个容错
127
+ // 如果: 已触发次数 !== 触发次数上限 确保添加后的diff要小于等于10, 出于兼容老数据1/20类似的情况考虑, 加个容错
117
128
  else totalCount = Math.min(data.totalCount, 10 - diff >= 0 ? 10 - diff : 0);
118
129
  }
119
130
  return {
@@ -1,27 +1,8 @@
1
- <template>
2
- <div style="width: 100%; height: 100%">
3
- <el-button @click="openDialog">因子预警</el-button>
4
- <st-factorWarning
5
- v-model:visible="visible"
6
- :title="title"
7
- :moreFactorOptions="moreFactorOptions"
8
- :emptyFactorOptions="emptyFactorOptions"
9
- :tableData="tableData"
10
- :shortcutData="shortcutData"
11
- :showConfig="showConfig"
12
- @add="handleAddFactor"
13
- @delete="handleDeleteFactor"
14
- @enabled="handleEnabledFactor"
15
- @closed="handleClosed"
16
- @shortcutAdd="handleShortcutAdd"
17
- @shortcutDelete="handleShortcutDelete"
18
- />
19
- </div>
20
- </template>
21
-
22
1
  <script setup>
23
- import axios from "axios";
24
- import { ref, onMounted } from "vue";
2
+ import { getUserData } from "st-func";
3
+ import { ref, onMounted, inject } from "vue";
4
+
5
+ const { request } = inject("stConfig"); // 组件库全局配置
25
6
 
26
7
  const visible = ref(false);
27
8
  const title = ref("品种-code(周期)");
@@ -41,77 +22,64 @@ const showConfig = {
41
22
  // 打开弹窗
42
23
  const openDialog = async () => {
43
24
  // 获取预警因子[多, 空]选项
44
- {
45
- const { data } = await axios({
46
- method: "post",
47
- headers: {
48
- token: "a4c883f7f2efb1fe42505961ce97b954",
49
- },
50
- url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/getFactorConfigByPage",
51
- data: {
52
- pageNum: 1,
53
- pageSize: 9999,
54
- factorType: 2,
55
- },
25
+ const params = {
26
+ pageNum: 1,
27
+ pageSize: 9999,
28
+ factorType: 2,
29
+ };
30
+ const { body } = await request.post("/middleLayer/post/alarm/deliversign/getFactorConfigByPage", params);
31
+ moreFactorOptions.value = body.list.reduce((result, item) => {
32
+ result.push({
33
+ alarmFactor: item.id,
34
+ ...item.tbFactorConfigExtendList.find((citem) => citem.factorType === 1),
35
+ });
36
+ return result;
37
+ }, []);
38
+ emptyFactorOptions.value = body.list.reduce((result, item) => {
39
+ result.push({
40
+ alarmFactor: item.id,
41
+ ...item.tbFactorConfigExtendList.find((citem) => citem.factorType === -1),
56
42
  });
57
- const { body } = data;
58
- moreFactorOptions.value = body.list.reduce((result, item) => {
59
- result.push({
60
- alarmFactor: item.id,
61
- ...item.tbFactorConfigExtendList.find((citem) => citem.factorType === 1),
62
- });
63
- return result;
64
- }, []);
65
- emptyFactorOptions.value = body.list.reduce((result, item) => {
66
- result.push({
67
- alarmFactor: item.id,
68
- ...item.tbFactorConfigExtendList.find((citem) => citem.factorType === -1),
69
- });
70
- return result;
71
- }, []);
72
- }
73
- // 获取自定义快捷配置数据
43
+ return result;
44
+ }, []);
45
+ // 获取快捷配置
74
46
  queryShortcutData();
75
47
  visible.value = true;
76
48
  };
77
- const handleAddFactor = (ruleForm) => console.log(ruleForm);
78
- const handleDeleteFactor = (row) => console.log("删除", row);
79
- const handleEnabledFactor = (row) => console.log("启用", row);
80
- const handleClosed = () => console.log("弹窗关闭");
49
+ // 关闭弹窗
50
+ const handleClosed = () => {
51
+ console.log("弹窗关闭");
52
+ };
53
+
54
+ // 添加因子预警
55
+ const handleAddFactor = (ruleForm) => {
56
+ console.log(ruleForm);
57
+ };
58
+ // 删除因子预警
59
+ const handleDeleteFactor = (row) => {
60
+ console.log("删除", row);
61
+ };
62
+ // 启用因子预警
63
+ const handleEnabledFactor = (row) => {
64
+ console.log("启用", row);
65
+ };
81
66
 
67
+ // 查询快捷配置
82
68
  const queryShortcutData = async () => {
83
- const { data } = await axios({
84
- method: "post",
85
- headers: {
86
- token: "a4c883f7f2efb1fe42505961ce97b954",
87
- },
88
- url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/queryFactorAlarmConfig",
89
- data: {
90
- userId: 103,
91
- },
92
- });
93
- shortcutData.value = data.body;
69
+ const params = {
70
+ userId: getUserData("id"),
71
+ };
72
+ const { body } = await request.post("/middleLayer/post/alarm/deliversign/queryFactorAlarmConfig", params);
73
+ shortcutData.value = body;
94
74
  };
75
+ // 更新快捷配置
95
76
  const handleShortcutAdd = async (params) => {
96
- const { data } = await axios({
97
- method: "post",
98
- headers: {
99
- token: "a4c883f7f2efb1fe42505961ce97b954",
100
- },
101
- url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/addOrUpdateFactorAlarmConfig",
102
- data: params,
103
- });
77
+ await request.post("/middleLayer/post/alarm/deliversign/addOrUpdateFactorAlarmConfig", params);
104
78
  queryShortcutData();
105
79
  };
80
+ // 删除快捷配置
106
81
  const handleShortcutDelete = async (params) => {
107
- const { data } = await axios({
108
- method: "post",
109
- headers: {
110
- token: "a4c883f7f2efb1fe42505961ce97b954",
111
- },
112
- url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/delFactorAlarmConfig",
113
- data: { id: params.id },
114
- });
82
+ await request.post("/middleLayer/post/alarm/deliversign/delFactorAlarmConfig", { id: params.id });
115
83
  queryShortcutData();
116
84
  };
117
85
 
@@ -129,7 +97,7 @@ onMounted(() => {
129
97
  factorExtendValue: "1",
130
98
  factorExtendName: "30均线上+向上+单箱",
131
99
  userId: 103,
132
- totalCount: 10,
100
+ totalCount: 12,
133
101
  currentCount: 1,
134
102
  enable: 1,
135
103
  mark: null,
@@ -212,3 +180,24 @@ onMounted(() => {
212
180
  ];
213
181
  });
214
182
  </script>
183
+
184
+ <template>
185
+ <div style="width: 100%; height: 100%">
186
+ <el-button @click="openDialog">因子预警</el-button>
187
+ <st-factorWarning
188
+ v-model:visible="visible"
189
+ :title="title"
190
+ :moreFactorOptions="moreFactorOptions"
191
+ :emptyFactorOptions="emptyFactorOptions"
192
+ :tableData="tableData"
193
+ :shortcutData="shortcutData"
194
+ :showConfig="showConfig"
195
+ @add="handleAddFactor"
196
+ @delete="handleDeleteFactor"
197
+ @enabled="handleEnabledFactor"
198
+ @closed="handleClosed"
199
+ @shortcutAdd="handleShortcutAdd"
200
+ @shortcutDelete="handleShortcutDelete"
201
+ />
202
+ </div>
203
+ </template>
@@ -1,6 +0,0 @@
1
- import { a as o } from "./base-ff0e366f.js";
2
- const e = (i) => o ? window.requestAnimationFrame(i) : setTimeout(i, 16), a = (i) => o ? window.cancelAnimationFrame(i) : clearTimeout(i);
3
- export {
4
- a as c,
5
- e as r
6
- };