st-comp 0.0.115 → 0.0.116

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 (98) hide show
  1. package/auto-imports.d.ts +1 -0
  2. package/components.d.ts +1 -0
  3. package/es/ChartLayout.cjs +1 -1
  4. package/es/ChartLayout.js +2 -2
  5. package/es/Dialog.cjs +1 -1
  6. package/es/Dialog.js +11 -11
  7. package/es/FactorWarning.cjs +1 -1
  8. package/es/FactorWarning.js +1070 -272
  9. package/es/Kline.cjs +1 -1
  10. package/es/Kline.js +13 -13
  11. package/es/KlineNew.cjs +1 -1
  12. package/es/KlineNew.js +12 -12
  13. package/es/Pagination.cjs +1 -1
  14. package/es/Pagination.js +30 -30
  15. package/es/Pie.cjs +1 -1
  16. package/es/Pie.js +1 -1
  17. package/es/Table.cjs +1 -1
  18. package/es/Table.js +31 -31
  19. package/es/User.cjs +1 -1
  20. package/es/User.js +84 -84
  21. package/es/VarietySearch.cjs +1 -1
  22. package/es/VarietySearch.js +1116 -936
  23. package/es/VirtualTable.cjs +1 -1
  24. package/es/VirtualTable.js +56 -56
  25. package/es/base-ec05f348.cjs +9 -0
  26. package/es/{base-a3fcf99a.js → base-f7877059.js} +345 -328
  27. package/es/{castArray-0e8e51f9.js → castArray-18f43497.js} +1 -1
  28. package/es/{castArray-e6cd255c.cjs → castArray-a45823fe.cjs} +1 -1
  29. package/es/{config-provider-e4ebacca.js → config-provider-6479d795.js} +6 -6
  30. package/es/{config-provider-957c280a.cjs → config-provider-7cdfca4d.cjs} +1 -1
  31. package/es/{debounce-7f3a3471.js → debounce-2336e546.js} +14 -14
  32. package/es/{debounce-3ad03224.cjs → debounce-b2ff12bd.cjs} +1 -1
  33. package/es/{dropdown-c505d260.js → dropdown-46daf582.js} +4 -4
  34. package/es/{dropdown-e73864c0.cjs → dropdown-9a974876.cjs} +1 -1
  35. package/es/{el-button-e389429d.cjs → el-button-196807af.cjs} +1 -1
  36. package/es/{el-button-fe99fee6.js → el-button-802f579a.js} +6 -6
  37. package/es/{el-empty-848e4e08.cjs → el-empty-19ea04f4.cjs} +1 -1
  38. package/es/{el-empty-a338aa98.js → el-empty-3c5ec277.js} +5 -5
  39. package/es/el-form-item-84099d46.js +1599 -0
  40. package/es/el-form-item-c39f717e.cjs +12 -0
  41. package/es/{el-input-65ed0dba.cjs → el-input-6c6f5bda.cjs} +1 -1
  42. package/es/{el-input-35c8ebc3.js → el-input-fac5b401.js} +39 -39
  43. package/es/{el-overlay-851ea246.js → el-overlay-69e9ae49.js} +105 -101
  44. package/es/el-overlay-891dcc40.cjs +1 -0
  45. package/es/{el-popover-246eb710.js → el-popover-694ded47.js} +22 -22
  46. package/es/{el-popover-b0deb095.cjs → el-popover-8735b1fa.cjs} +1 -1
  47. package/es/{el-popper-e052fb84.js → el-popper-6126b1f6.js} +91 -91
  48. package/es/{el-popper-4da22fdc.cjs → el-popper-f62316cd.cjs} +1 -1
  49. package/es/el-scrollbar-d1c3e7f7.cjs +1 -0
  50. package/es/el-scrollbar-e0493906.js +201 -0
  51. package/es/el-select-513126a5.js +1128 -0
  52. package/es/el-select-928f8c19.cjs +1 -0
  53. package/es/{el-table-column-661deade.js → el-table-column-3c920bdd.js} +69 -69
  54. package/es/{el-table-column-d636a7d6.cjs → el-table-column-dd8b62aa.cjs} +1 -1
  55. package/es/{el-tag-a45bdd1e.cjs → el-tag-3b03d13e.cjs} +1 -1
  56. package/es/{el-tag-7601f7e6.js → el-tag-5becabc9.js} +74 -74
  57. package/es/index-048dca7e.js +303 -0
  58. package/es/{index-28cd5fde.js → index-35117549.js} +25 -25
  59. package/es/{index-fc652f21.js → index-57f8f7b9.js} +15 -1
  60. package/es/index-7e40be25.js +167 -0
  61. package/es/index-80a2b137.cjs +1 -0
  62. package/es/{index-35665af5.cjs → index-8a0b1c53.cjs} +1 -1
  63. package/es/{index-25aca205.cjs → index-dc273ea2.cjs} +1 -1
  64. package/es/index-e1e83173.cjs +1 -0
  65. package/es/{raf-a97e05a3.js → raf-07da7cdf.js} +1 -1
  66. package/es/{raf-da075499.cjs → raf-8fc301fd.cjs} +1 -1
  67. package/es/{refs-f0ee592c.js → refs-1b1fe6ca.js} +1 -1
  68. package/es/{refs-34a69f8c.cjs → refs-d00b710b.cjs} +1 -1
  69. package/es/{scroll-1e0c8fab.js → scroll-3b521d81.js} +1 -1
  70. package/es/{scroll-c7ef9180.cjs → scroll-41224831.cjs} +1 -1
  71. package/es/style.css +1 -1
  72. package/es/{use-form-common-props-96d2ea48.cjs → use-form-common-props-1b84d8f4.cjs} +1 -1
  73. package/es/{use-form-common-props-d0739feb.js → use-form-common-props-f3a520d0.js} +53 -53
  74. package/es/{vnode-8f40662d.js → vnode-25d7c2f5.js} +1 -1
  75. package/es/{vnode-562e063c.cjs → vnode-7fbc61e1.cjs} +1 -1
  76. package/es/{zh-cn-0ab4aa73.js → zh-cn-74781bbd.js} +2 -2
  77. package/es/{zh-cn-bf58db71.cjs → zh-cn-ab9a583d.cjs} +1 -1
  78. package/lib/bundle.js +1 -1
  79. package/lib/bundle.umd.cjs +192 -192
  80. package/lib/{index-a981dd97.js → index-c6ba3bcd.js} +30058 -29227
  81. package/lib/{python-72fd599d.js → python-49e22e65.js} +1 -1
  82. package/lib/style.css +1 -1
  83. package/package.json +1 -1
  84. package/packages/FactorWarning/index.vue +296 -97
  85. package/packages/FactorWarning/tools.js +10 -0
  86. package/src/pages/FactorWarning/index.vue +69 -25
  87. package/es/base-adc4e34e.cjs +0 -9
  88. package/es/el-overlay-84e3cb6c.cjs +0 -1
  89. package/es/el-radio-button-12b07ac2.js +0 -1782
  90. package/es/el-radio-button-5259a46b.cjs +0 -12
  91. package/es/el-scrollbar-8cb3663b.cjs +0 -1
  92. package/es/el-scrollbar-c23060d5.js +0 -193
  93. package/es/el-select-4987a187.cjs +0 -1
  94. package/es/el-select-d1a33fbe.js +0 -1233
  95. package/es/index-4090cb2c.cjs +0 -1
  96. package/es/index-af687c16.js +0 -302
  97. package/es/index-b4bbc58d.js +0 -59
  98. package/es/index-f14354e6.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.115",
4
+ "version": "0.0.116",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -1,41 +1,32 @@
1
1
  <script setup>
2
2
  import { ref, watch } from "vue";
3
3
  import zhCn from "element-plus/es/locale/lang/zh-cn";
4
+ import { InfoFilled } from "@element-plus/icons-vue";
5
+ import { defaultShowConfig } from "./tools";
6
+ import { debounce } from "st-func";
4
7
 
5
- const emit = defineEmits(["add", "delete", "enabled", "closed"]);
8
+ const segmentedValue = ref(null);
9
+ const visible = defineModel("visible", { default: false });
10
+ const emit = defineEmits(["add", "delete", "enabled", "closed", "shortcutAdd", "shortcutDelete"]);
6
11
  const props = defineProps({
7
- // 弹窗标题
12
+ // 弹窗名称
8
13
  title: { type: [String, null], default: null },
9
- // 表单因子
14
+ // 因子数据
10
15
  moreFactorOptions: { type: Array, default: () => [] },
11
16
  emptyFactorOptions: { type: Array, default: () => [] },
12
- // 表单点击确认提交后是否关闭弹窗
13
- closeAfterSubmit: { type: Boolean, default: true },
14
- // 表格数据
17
+ // 管理数据
15
18
  tableData: { type: Array, default: () => [] },
16
- // 是否可操作
17
- allowOperation: { type: Boolean, default: true },
18
- // 功能点展示配置
19
+ // 快捷配置数据
20
+ shortcutData: { type: Array, default: () => [] },
21
+
22
+ // 字段展示配置
19
23
  showConfig: { type: Object, default: () => ({}) },
24
+ // 是否支持操作
25
+ allowOperation: { type: Boolean, default: true },
20
26
  });
21
- const showConfig = Object.assign(
22
- {
23
- ruleFormPrice: true, // 表单-价格范围
24
- ruleFormMark: true, // 表单-备注
25
- tableStatus: true, // 表格-状态
26
- tableCreateTime: true, // 表格-设置时间
27
- tableMark: true, // 表格-备注
28
- tableEnable: true, // 表格-操作-启用
29
- },
30
- props.showConfig
31
- );
27
+ const showConfig = Object.assign(defaultShowConfig, props.showConfig);
32
28
 
33
- const visible = defineModel("visible", { default: false });
34
-
35
- // 内容类型: [添加-ruleForm, 管理-table]
36
- const contentType = ref(props.allowOperation ? "ruleForm" : "table");
37
-
38
- // 表单相关参数
29
+ // 添加因子相关参数
39
30
  const ruleFormRef = ref(null);
40
31
  const ruleForm = ref({
41
32
  factorType: 1,
@@ -50,46 +41,41 @@ const rules = ref({
50
41
  factorSelectedList: [{ required: true, message: "请选择预警因子", trigger: "blur" }],
51
42
  totalCount: [{ required: true, message: "请填写预警次数", trigger: "blur" }],
52
43
  });
44
+ // 快捷配置相关参数
45
+ const shortcut_ruleFormRef = ref(null);
46
+ const shortcut_ruleForm = ref({
47
+ shortcutName: null,
48
+ factorType: 1,
49
+ factorSelectedList: [],
50
+ totalCount: 1,
51
+ });
52
+ const shortcut_rules = ref({
53
+ factorType: [{ required: true, message: "请选择交易类型", trigger: "blur" }],
54
+ factorSelectedList: [{ required: true, message: "请选择预警因子", trigger: "blur" }],
55
+ totalCount: [{ required: true, message: "请填写预警次数", trigger: "blur" }],
56
+ shortcutName: [{ required: true, message: "请填写配置名称", trigger: "blur" }],
57
+ });
53
58
 
54
- // 表单: 重置
55
- const handleResetForm = () => {
56
- ruleForm.value = {
57
- factorType: 1,
58
- factorSelectedList: [],
59
- totalCount: 1,
60
- minPrice: null,
61
- maxPrice: null,
62
- mark: null,
63
- };
64
- };
65
- // 表单: 三次多/三次空
66
- const handleFastControls = async (type) => {
67
- switch (type) {
68
- case "threeMore":
69
- Object.assign(ruleForm.value, {
70
- factorType: 1,
71
- factorSelectedList: ["dkx金叉", "dkx黄白线上+双箱单次", "dkx金叉后+单箱突破", "30均线上+向上+单箱"],
72
- });
73
- break;
74
- case "threeEmpty":
75
- Object.assign(ruleForm.value, {
76
- factorType: -1,
77
- factorSelectedList: ["dkx死叉", "dkx黄白线下+双箱单次", "dkx死叉后+单箱突破", "30均线下+向下+单箱"],
78
- });
79
- break;
80
- }
81
- // 特殊需求 [2025-03-10]: 葛总要求通过3次多3次空添加的, 具备上限10的校验
82
- const tsParams = {
59
+ // [添加因子] 快捷提交
60
+ const handleFastControls = async (item) => {
61
+ const data = JSON.parse(item.data);
62
+ Object.assign(ruleForm.value, {
63
+ factorType: data.factorType,
64
+ factorSelectedList: data.factorSelectedList,
65
+ totalCount: data.totalCount,
66
+ });
67
+ // 通过快捷进行添加的因子, 具备有效次数上限10的校验
68
+ const fsParams = {
83
69
  factorSelectedList: ruleForm.value.factorSelectedList.map((factorName) => {
84
- let totalCount = 3;
70
+ let totalCount = data.totalCount;
85
71
  // 判断表格里面有没有同因子的数据, 如果有的话需要确保增加以后的有效次数 <= 10
86
72
  const repeatData = props.tableData.find(({ factorExtendName }) => factorExtendName === factorName);
87
73
  if (repeatData) {
88
74
  const diff = repeatData.totalCount - repeatData.currentCount;
89
75
  // 如果: 已触发次数 === 触发次数上限, 直接+3, 此时后端会另起一行数据的
90
- if (diff === 0) totalCount = 3;
76
+ if (diff === 0) totalCount = data.totalCount;
91
77
  // 确保添加后的diff要小于等于10, 出于兼容老数据1/20类似的情况考虑, 加个容错
92
- else totalCount = Math.min(3, 10 - diff >= 0 ? 10 - diff : 0);
78
+ else totalCount = Math.min(data.totalCount, 10 - diff >= 0 ? 10 - diff : 0);
93
79
  }
94
80
  return {
95
81
  factorName,
@@ -98,15 +84,15 @@ const handleFastControls = async (type) => {
98
84
  };
99
85
  }),
100
86
  };
101
- handleSubmit(ruleFormRef.value, false, tsParams);
87
+ handleSubmit(ruleFormRef.value, fsParams);
102
88
  };
103
- // 表单: 提交
104
- const handleSubmit = async (formEl, close = props.closeAfterSubmit, tsParams) => {
89
+ // [添加因子] 普通提交
90
+ const handleSubmit = debounce(async (formEl, fsParams) => {
105
91
  if (!formEl) return;
106
92
  await formEl.validate((valid) => {
107
93
  if (!valid) return false;
108
94
  // 将表单值抛出
109
- const params = tsParams ?? {
95
+ const params = fsParams ?? {
110
96
  factorSelectedList: ruleForm.value.factorSelectedList.map((factorName) => {
111
97
  return {
112
98
  factorName,
@@ -115,33 +101,64 @@ const handleSubmit = async (formEl, close = props.closeAfterSubmit, tsParams) =>
115
101
  }),
116
102
  };
117
103
  emit("add", params);
118
- // 根据是否关闭弹窗, 进行对应的逻辑处理
119
- switch (close) {
120
- // 关闭弹窗
121
- case true: {
122
- visible.value = false;
123
- break;
124
- }
125
- // 重置表单值
126
- case false: {
127
- handleResetForm();
128
- break;
129
- }
130
- }
104
+ // 关闭弹窗
105
+ visible.value = false;
131
106
  });
107
+ }, 200);
108
+
109
+ // [快捷配置] 保存配置
110
+ const handleSaveShortcut = async (formEl) => {
111
+ if (!formEl) return;
112
+ await formEl.validate((valid) => {
113
+ if (!valid) return false;
114
+ // 将表单值抛出
115
+ const params = {
116
+ shortcutName: shortcut_ruleForm.value.shortcutName,
117
+ data: JSON.stringify(shortcut_ruleForm.value),
118
+ };
119
+ emit("shortcutAdd", params);
120
+ handleResetForm();
121
+ });
122
+ };
123
+ // [快捷配置] 回显配置
124
+ const handleClickShortcut = (item) => {
125
+ shortcut_ruleForm.value = JSON.parse(item.data);
126
+ };
127
+ // [快捷配置] 删除配置
128
+ const handleDeleteShortcut = (item) => {
129
+ ElMessageBox.confirm(`是否确认删除配置: ${item.shortcutName} ?`, "删除提示", {
130
+ confirmButtonText: "确认",
131
+ cancelButtonText: "取消",
132
+ type: "warning",
133
+ }).then(() => emit("shortcutDelete", item));
132
134
  };
133
135
 
134
- // 监视组件开关
136
+ // [添加因子, 快捷配置] 重置
137
+ const handleResetForm = () => {
138
+ ruleForm.value = {
139
+ factorType: 1,
140
+ factorSelectedList: [],
141
+ totalCount: 1,
142
+ minPrice: null,
143
+ maxPrice: null,
144
+ mark: null,
145
+ };
146
+ shortcut_ruleForm.value = {
147
+ shortcutName: null,
148
+ factorType: 1,
149
+ factorSelectedList: [],
150
+ totalCount: 1,
151
+ };
152
+ };
135
153
  watch(
136
154
  () => visible.value,
137
155
  (newValue) => {
138
156
  if (newValue) {
139
- contentType.value = props.allowOperation ? "ruleForm" : "table";
157
+ segmentedValue.value = props.allowOperation ? "ruleForm" : "table";
140
158
  handleResetForm();
141
159
  }
142
160
  }
143
161
  );
144
- defineExpose({ handleResetForm });
145
162
  </script>
146
163
 
147
164
  <template>
@@ -161,21 +178,18 @@ defineExpose({ handleResetForm });
161
178
  <span style="margin-right: 4px">因子预警</span>
162
179
  <span>{{ title }}</span>
163
180
  </div>
164
- <el-radio-group v-model="contentType">
165
- <el-radio-button
166
- label="添加"
167
- value="ruleForm"
168
- :disabled="!allowOperation"
169
- />
170
- <el-radio-button
171
- label="管理"
172
- value="table"
173
- />
174
- </el-radio-group>
181
+ <el-segmented
182
+ v-model="segmentedValue"
183
+ :options="[
184
+ { label: '添加', value: 'ruleForm', disabled: !allowOperation },
185
+ { label: '管理', value: 'table', disabled: false },
186
+ { label: '快捷配置', value: 'shortcut', disabled: !allowOperation },
187
+ ]"
188
+ />
175
189
  </div>
176
190
  </template>
177
191
  <!-- 内容: 添加 -->
178
- <template v-if="contentType === 'ruleForm'">
192
+ <template v-if="segmentedValue === 'ruleForm'">
179
193
  <el-form
180
194
  ref="ruleFormRef"
181
195
  :model="ruleForm"
@@ -239,8 +253,30 @@ defineExpose({ handleResetForm });
239
253
  controls-position="right"
240
254
  style="margin-right: 20px"
241
255
  />
242
- <el-button @click="handleFastControls('threeMore')">3次多</el-button>
243
- <el-button @click="handleFastControls('threeEmpty')">3次空</el-button>
256
+ <template v-if="shortcutData.length">
257
+ <el-button
258
+ v-for="item in shortcutData"
259
+ :key="item.id"
260
+ @click="handleFastControls(item)"
261
+ >
262
+ {{ item.shortcutName }}
263
+ </el-button>
264
+ <el-tooltip
265
+ effect="dark"
266
+ content="通过快捷配置添加的因子有效预警次数上限为10"
267
+ placement="right-start"
268
+ >
269
+ <el-icon style="margin-left: 10px"><InfoFilled /></el-icon>
270
+ </el-tooltip>
271
+ </template>
272
+ <el-text
273
+ v-else
274
+ type="primary"
275
+ style="cursor: pointer"
276
+ @click="() => (segmentedValue = 'shortcut')"
277
+ >
278
+ 暂无快捷配置, 是否点击前往自定义配置?
279
+ </el-text>
244
280
  </el-form-item>
245
281
  <!-- 价格范围 -->
246
282
  <el-form-item
@@ -279,7 +315,7 @@ defineExpose({ handleResetForm });
279
315
  </el-form>
280
316
  </template>
281
317
  <!-- 内容: 表格 -->
282
- <template v-if="contentType === 'table'">
318
+ <template v-if="segmentedValue === 'table'">
283
319
  <el-table
284
320
  :data="tableData"
285
321
  size="small"
@@ -379,17 +415,144 @@ defineExpose({ handleResetForm });
379
415
  </el-table-column>
380
416
  </el-table>
381
417
  </template>
418
+ <!-- 内容: 快捷配置 -->
419
+ <template v-if="segmentedValue === 'shortcut'">
420
+ <div class="shortcut-title">
421
+ <span>我的配置</span>
422
+ <el-tooltip
423
+ effect="dark"
424
+ content="如有配置数据, 可点击查看该配置的具体信息"
425
+ placement="right-start"
426
+ >
427
+ <el-icon><InfoFilled /></el-icon>
428
+ </el-tooltip>
429
+ </div>
430
+ <div class="shortcut-config">
431
+ <template v-if="shortcutData.length">
432
+ <el-tag
433
+ v-for="item in shortcutData"
434
+ :key="item.id"
435
+ type="primary"
436
+ closable
437
+ @click="handleClickShortcut(item)"
438
+ @close="handleDeleteShortcut(item)"
439
+ >
440
+ {{ item.shortcutName }}
441
+ </el-tag>
442
+ </template>
443
+ <span
444
+ class="empty"
445
+ v-else
446
+ >暂无数据</span
447
+ >
448
+ </div>
449
+ <div class="shortcut-title">
450
+ <span>新增配置</span>
451
+ <el-tooltip
452
+ effect="dark"
453
+ content="同名配置将会进行覆盖"
454
+ placement="right-start"
455
+ >
456
+ <el-icon><InfoFilled /></el-icon>
457
+ </el-tooltip>
458
+ </div>
459
+ <el-form
460
+ ref="shortcut_ruleFormRef"
461
+ :model="shortcut_ruleForm"
462
+ :rules="shortcut_rules"
463
+ label-width="90px"
464
+ >
465
+ <!-- 配置名称 -->
466
+ <el-form-item
467
+ label="配置名称:"
468
+ prop="shortcutName"
469
+ >
470
+ <el-input
471
+ v-model="shortcut_ruleForm.shortcutName"
472
+ maxlength="6"
473
+ show-word-limit
474
+ style="width: 160px"
475
+ />
476
+ </el-form-item>
477
+ <!-- 交易类型 -->
478
+ <el-form-item
479
+ label="交易类型:"
480
+ prop="factorType"
481
+ >
482
+ <el-button
483
+ type="danger"
484
+ :plain="shortcut_ruleForm.factorType !== 1"
485
+ @click="shortcut_ruleForm.factorType = 1"
486
+ >
487
+
488
+ </el-button>
489
+ <el-button
490
+ type="success"
491
+ :plain="shortcut_ruleForm.factorType !== -1"
492
+ @click="shortcut_ruleForm.factorType = -1"
493
+ >
494
+
495
+ </el-button>
496
+ </el-form-item>
497
+ <!-- 预警因子 -->
498
+ <el-form-item
499
+ label="预警因子:"
500
+ prop="factorSelectedList"
501
+ >
502
+ <el-checkbox-group v-model="shortcut_ruleForm.factorSelectedList">
503
+ <template v-if="shortcut_ruleForm.factorType === 1">
504
+ <el-checkbox
505
+ v-for="(item, index) in moreFactorOptions"
506
+ :key="index"
507
+ :label="item.factorTypeName"
508
+ :value="item.factorTypeName"
509
+ style="width: 200px"
510
+ />
511
+ </template>
512
+ <template v-if="shortcut_ruleForm.factorType === -1">
513
+ <el-checkbox
514
+ v-for="(item, index) in emptyFactorOptions"
515
+ :key="index"
516
+ :label="item.factorTypeName"
517
+ :value="item.factorTypeName"
518
+ style="width: 200px"
519
+ />
520
+ </template>
521
+ </el-checkbox-group>
522
+ </el-form-item>
523
+ <!-- 预警次数 -->
524
+ <el-form-item
525
+ label="预警次数:"
526
+ prop="totalCount"
527
+ >
528
+ <el-input-number
529
+ v-model="shortcut_ruleForm.totalCount"
530
+ :min="1"
531
+ :max="10"
532
+ controls-position="right"
533
+ style="margin-right: 20px"
534
+ />
535
+ </el-form-item>
536
+ </el-form>
537
+ </template>
382
538
  <!-- 底部 -->
383
539
  <template #footer>
384
540
  <div class="custom-footer">
385
541
  <el-button @click="visible = false">关闭</el-button>
386
542
  <el-button
387
- v-if="contentType === 'ruleForm'"
543
+ v-if="segmentedValue === 'ruleForm'"
388
544
  type="primary"
389
545
  @click="handleSubmit(ruleFormRef)"
390
546
  >
391
547
  确认
392
548
  </el-button>
549
+ <el-button
550
+ v-if="segmentedValue === 'shortcut'"
551
+ type="primary"
552
+ @click="handleSaveShortcut(shortcut_ruleFormRef)"
553
+ >
554
+ 保存配置
555
+ </el-button>
393
556
  </div>
394
557
  </template>
395
558
  </el-dialog>
@@ -406,7 +569,6 @@ defineExpose({ handleResetForm });
406
569
  :deep(.el-dialog__headerbtn) {
407
570
  top: 9px;
408
571
  }
409
-
410
572
  :deep(.el-dialog__body) {
411
573
  padding-top: 0;
412
574
  padding-bottom: 0;
@@ -418,7 +580,6 @@ defineExpose({ handleResetForm });
418
580
  height: 590px;
419
581
  }
420
582
  }
421
-
422
583
  .custom-header {
423
584
  width: 100%;
424
585
  display: flex;
@@ -427,9 +588,47 @@ defineExpose({ handleResetForm });
427
588
  padding: 10px;
428
589
  margin-top: -15px;
429
590
  }
430
-
431
591
  .el-radio {
432
592
  margin-right: 20px;
433
593
  }
594
+ .shortcut-title {
595
+ display: inline-block;
596
+ color: var(--el-text-color-regular);
597
+ width: 100%;
598
+ padding: 2px;
599
+ padding-left: 6px;
600
+ font-size: 14px;
601
+ background: linear-gradient(90deg, rgba(178, 161, 248, 0.15), rgba(123, 104, 238, 0));
602
+ position: relative;
603
+ margin-bottom: 10px;
604
+ display: flex;
605
+ align-items: center;
606
+ &::before {
607
+ content: "";
608
+ left: 0;
609
+ top: 0;
610
+ width: 3px;
611
+ height: 100%;
612
+ background-color: #7b68ee;
613
+ position: absolute;
614
+ }
615
+ .el-icon {
616
+ margin-top: 1px;
617
+ margin-left: 4px;
618
+ }
619
+ }
620
+ .shortcut-config {
621
+ margin-bottom: 10px;
622
+ .el-tag {
623
+ cursor: pointer;
624
+ margin-right: 4px;
625
+ }
626
+ .empty {
627
+ display: inline-block;
628
+ width: 100%;
629
+ color: var(--el-color-info);
630
+ text-align: center;
631
+ }
632
+ }
434
633
  }
435
634
  </style>
@@ -0,0 +1,10 @@
1
+ export const defaultShowConfig = {
2
+ // 表单字段
3
+ ruleFormPrice: true, // 价格范围
4
+ ruleFormMark: true, // 备注
5
+ // 表格字段
6
+ tableStatus: true, // 状态
7
+ tableCreateTime: true, // 设置时间
8
+ tableMark: true, // 备注
9
+ tableEnable: true, // 启用按钮
10
+ };
@@ -7,11 +7,14 @@
7
7
  :moreFactorOptions="moreFactorOptions"
8
8
  :emptyFactorOptions="emptyFactorOptions"
9
9
  :tableData="tableData"
10
+ :shortcutData="shortcutData"
10
11
  :showConfig="showConfig"
11
12
  @add="handleAddFactor"
12
13
  @delete="handleDeleteFactor"
13
14
  @enabled="handleEnabledFactor"
14
15
  @closed="handleClosed"
16
+ @shortcutAdd="handleShortcutAdd"
17
+ @shortcutDelete="handleShortcutDelete"
15
18
  />
16
19
  </div>
17
20
  </template>
@@ -25,6 +28,7 @@ const title = ref("品种-code(周期)");
25
28
  const moreFactorOptions = ref([]);
26
29
  const emptyFactorOptions = ref([]);
27
30
  const tableData = ref([]);
31
+ const shortcutData = ref([]);
28
32
  const showConfig = {
29
33
  ruleFormPrice: true, // 表单-价格范围
30
34
  ruleFormMark: true, // 表单-备注
@@ -37,39 +41,79 @@ const showConfig = {
37
41
  // 打开弹窗
38
42
  const openDialog = async () => {
39
43
  // 获取预警因子[多, 空]选项
44
+ {
45
+ const { data } = await axios({
46
+ method: "post",
47
+ headers: {
48
+ token: "8bc3369819162ef472cd7f2db2990438",
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
+ },
56
+ });
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
+ // 获取自定义快捷配置数据
74
+ queryShortcutData();
75
+ visible.value = true;
76
+ };
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("弹窗关闭");
81
+
82
+ const queryShortcutData = async () => {
40
83
  const { data } = await axios({
41
84
  method: "post",
42
85
  headers: {
43
- token: "dbe114939fc69924d6a94ff69074e72c",
86
+ token: "8bc3369819162ef472cd7f2db2990438",
44
87
  },
45
- url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/getFactorConfigByPage",
88
+ url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/queryFactorAlarmConfig",
46
89
  data: {
47
- pageNum: 1,
48
- pageSize: 9999,
49
- factorType: 2,
90
+ userId: 103,
50
91
  },
51
92
  });
52
- const { body } = data;
53
- moreFactorOptions.value = body.list.reduce((result, item) => {
54
- result.push({
55
- alarmFactor: item.id,
56
- ...item.tbFactorConfigExtendList.find((citem) => citem.factorType === 1),
57
- });
58
- return result;
59
- }, []);
60
- emptyFactorOptions.value = body.list.reduce((result, item) => {
61
- result.push({
62
- alarmFactor: item.id,
63
- ...item.tbFactorConfigExtendList.find((citem) => citem.factorType === -1),
64
- });
65
- return result;
66
- }, []);
67
- visible.value = true;
93
+ shortcutData.value = data.body;
94
+ };
95
+ const handleShortcutAdd = async (params) => {
96
+ const { data } = await axios({
97
+ method: "post",
98
+ headers: {
99
+ token: "8bc3369819162ef472cd7f2db2990438",
100
+ },
101
+ url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/addOrUpdateFactorAlarmConfig",
102
+ data: params,
103
+ });
104
+ queryShortcutData();
105
+ };
106
+ const handleShortcutDelete = async (params) => {
107
+ const { data } = await axios({
108
+ method: "post",
109
+ headers: {
110
+ token: "8bc3369819162ef472cd7f2db2990438",
111
+ },
112
+ url: "http://192.168.12.38:5173/middleLayer/post/alarm/deliversign/delFactorAlarmConfig",
113
+ data: { id: params.id },
114
+ });
115
+ queryShortcutData();
68
116
  };
69
- const handleAddFactor = (ruleForm) => console.log(ruleForm);
70
- const handleDeleteFactor = (row) => console.log("删除", row);
71
- const handleEnabledFactor = (row) => console.log("启用", row);
72
- const handleClosed = () => console.log("弹窗关闭");
73
117
 
74
118
  onMounted(() => {
75
119
  tableData.value = [