st-comp 0.0.237 → 0.0.238

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 (120) hide show
  1. package/components.d.ts +0 -1
  2. package/es/CustomFunction.cjs +1 -1
  3. package/es/CustomFunction.js +21 -21
  4. package/es/FactorWarning.cjs +1 -1
  5. package/es/FactorWarning.js +25 -25
  6. package/es/Kline.cjs +1 -1
  7. package/es/Kline.js +10 -10
  8. package/es/KlineBasic.cjs +1 -1
  9. package/es/KlineBasic.js +18 -18
  10. package/es/KlineConfig.cjs +1 -1
  11. package/es/KlineConfig.js +15 -15
  12. package/es/KlineNew.cjs +1 -1
  13. package/es/KlineNew.js +9 -9
  14. package/es/KlinePlus.cjs +1 -1
  15. package/es/KlinePlus.js +11 -11
  16. package/es/MonacoEditor.cjs +1 -1
  17. package/es/MonacoEditor.js +3 -31
  18. package/es/Pagination.cjs +1 -1
  19. package/es/Pagination.js +13 -13
  20. package/es/PasswordPrompt.cjs +1 -1
  21. package/es/PasswordPrompt.js +2 -2
  22. package/es/Table.cjs +1 -1
  23. package/es/Table.js +17 -17
  24. package/es/User.cjs +1 -1
  25. package/es/User.js +18 -18
  26. package/es/VarSelectDialog.cjs +3 -3
  27. package/es/VarSelectDialog.js +178 -122
  28. package/es/VarietyAutoComplete.cjs +1 -1
  29. package/es/VarietyAutoComplete.js +7 -7
  30. package/es/VarietySearch.cjs +17 -18
  31. package/es/VarietySearch.js +2592 -2705
  32. package/es/VarietyTextCopy.cjs +1 -1
  33. package/es/VarietyTextCopy.js +9 -9
  34. package/es/VirtualTable.cjs +1 -1
  35. package/es/VirtualTable.js +61 -61
  36. package/es/{_initCloneObject-3823a101.cjs → _initCloneObject-52b6a510.cjs} +1 -1
  37. package/es/{_initCloneObject-c34c65bc.js → _initCloneObject-eaef9418.js} +2 -2
  38. package/es/{config-provider-2182708a.cjs → config-provider-a584d81e.cjs} +1 -1
  39. package/es/{config-provider-06a63185.js → config-provider-b16efd62.js} +3 -3
  40. package/es/{dropdown-89b74bc9.cjs → dropdown-071c5d7e.cjs} +1 -1
  41. package/es/{dropdown-302f71e7.js → dropdown-a59bba73.js} +2 -2
  42. package/es/{el-autocomplete-b9a3054a.cjs → el-autocomplete-a07e9439.cjs} +1 -1
  43. package/es/{el-autocomplete-ed75a659.js → el-autocomplete-ba808eb6.js} +5 -5
  44. package/es/{el-button-d09ff85f.js → el-button-c95adb85.js} +3 -3
  45. package/es/{el-button-68baab7b.cjs → el-button-eec58cff.cjs} +1 -1
  46. package/es/{el-checkbox-64648e02.js → el-checkbox-7421ccd3.js} +3 -3
  47. package/es/{el-checkbox-b982e2ef.cjs → el-checkbox-c25236a6.cjs} +1 -1
  48. package/es/{el-dialog-6a80e3d8.js → el-dialog-41ab8417.js} +4 -4
  49. package/es/{el-dialog-ad7309e9.cjs → el-dialog-ae86edb8.cjs} +1 -1
  50. package/es/{el-form-item-4076e55f.cjs → el-form-item-c3fe189b.cjs} +1 -1
  51. package/es/{el-form-item-4eca95be.js → el-form-item-c53c374d.js} +5 -5
  52. package/es/{el-input-cae60510.js → el-input-2f75c4ba.js} +49 -49
  53. package/es/{el-input-172c49f8.cjs → el-input-7fd293af.cjs} +1 -1
  54. package/es/{el-input-number-c2e71528.cjs → el-input-number-22e21d16.cjs} +1 -1
  55. package/es/{el-input-number-c2499410.js → el-input-number-5193fe6d.js} +4 -4
  56. package/es/{el-loading-05826e64.cjs → el-loading-cfd86c15.cjs} +1 -1
  57. package/es/{el-loading-c738468d.js → el-loading-f6022062.js} +1 -1
  58. package/es/{el-menu-item-7f986598.cjs → el-menu-item-17dc717e.cjs} +1 -1
  59. package/es/{el-menu-item-f904f685.js → el-menu-item-7e881203.js} +4 -4
  60. package/es/{el-message-a86c0efa.cjs → el-message-5e6a6be9.cjs} +1 -1
  61. package/es/{el-message-box-05d8cf39.js → el-message-box-a93d2f6a.js} +9 -9
  62. package/es/{el-message-box-40ff2af5.cjs → el-message-box-c10adb52.cjs} +1 -1
  63. package/es/{el-message-0df23ae7.js → el-message-e544a8f5.js} +5 -5
  64. package/es/{el-overlay-cc9bc792.js → el-overlay-09ad71cd.js} +18 -18
  65. package/es/{el-overlay-d7a6e4a9.cjs → el-overlay-9e34965f.cjs} +1 -1
  66. package/es/{el-popconfirm-737a015b.cjs → el-popconfirm-70a976bf.cjs} +1 -1
  67. package/es/{el-popconfirm-a6f66a0e.js → el-popconfirm-81dcd202.js} +4 -4
  68. package/es/{el-popper-a38874f4.js → el-popper-b4f97157.js} +1 -1
  69. package/es/{el-popper-7ba87e05.cjs → el-popper-b6c99b28.cjs} +1 -1
  70. package/es/{el-segmented-51b1c797.js → el-segmented-b868d074.js} +2 -2
  71. package/es/{el-segmented-3fd66a0e.cjs → el-segmented-f8fce9ac.cjs} +1 -1
  72. package/es/{el-select-1b149fab.js → el-select-95627997.js} +8 -8
  73. package/es/{el-select-12f6deb7.cjs → el-select-d8d91db1.cjs} +1 -1
  74. package/es/{el-table-column-3e30ebae.js → el-table-column-376cd907.js} +9 -9
  75. package/es/{el-table-column-516a0ed9.cjs → el-table-column-c974cb96.cjs} +1 -1
  76. package/es/{el-tag-0a25efdf.js → el-tag-66cab138.js} +2 -2
  77. package/es/{el-tag-789f05d3.cjs → el-tag-a33c4b22.cjs} +1 -1
  78. package/es/{el-text-73d899ff.js → el-text-ac60d0f2.js} +1 -1
  79. package/es/{el-text-1470de46.cjs → el-text-c20a9f48.cjs} +1 -1
  80. package/es/{index-cebc7160.cjs → index-098c2447.cjs} +1 -1
  81. package/es/{index-c04f444f.cjs → index-11547a0c.cjs} +1 -1
  82. package/es/{index-4194c942.js → index-1f7d4f70.js} +1 -1
  83. package/es/{index-8de94a49.cjs → index-298075cf.cjs} +1 -1
  84. package/es/{index-94e43e0d.js → index-57672682.js} +2 -2
  85. package/es/{index-6806997d.js → index-844bdd85.js} +2 -2
  86. package/es/{index-6e967429.js → index-88546436.js} +2 -2
  87. package/es/{index-ee977f79.cjs → index-9b9ef5dd.cjs} +1 -1
  88. package/es/{index-87b4bf61.js → index-a871c3eb.js} +60 -75
  89. package/es/{index-ac98a4d8.js → index-bc8e277e.js} +12573 -12827
  90. package/es/{index-4f48940d.cjs → index-c108567d.cjs} +1 -1
  91. package/es/{index-2375023e.cjs → index-d725fef6.cjs} +137 -138
  92. package/es/{index-54d289d1.js → index-d91dc23f.js} +2 -2
  93. package/es/{index-42e59bf5.js → index-e5566b94.js} +1 -1
  94. package/es/{index-696b6a94.cjs → index-f3562b52.cjs} +1 -1
  95. package/es/{index-269b22da.cjs → index-f967d6c1.cjs} +1 -1
  96. package/es/{python-c67c8901.cjs → python-c27ba105.cjs} +2 -2
  97. package/es/{python-a914569a.js → python-ecde9ff2.js} +11 -39
  98. package/es/style.css +1 -1
  99. package/es/{use-form-common-props-47e50c10.js → use-form-common-props-815d48a6.js} +28 -28
  100. package/es/{use-form-common-props-344056f9.cjs → use-form-common-props-fd9b61a0.cjs} +1 -1
  101. package/es/{use-global-config-cf78ebac.cjs → use-global-config-30d7d8ce.cjs} +1 -1
  102. package/es/{use-global-config-f52caea0.js → use-global-config-b5e9d3d5.js} +4 -4
  103. package/es/{validator-3cad04b2.cjs → validator-1b8a6128.cjs} +1 -1
  104. package/es/{validator-94c04152.js → validator-764a9db0.js} +1 -1
  105. package/es/{zh-cn-aabfaa94.cjs → zh-cn-90317f62.cjs} +1 -1
  106. package/es/{zh-cn-4921961d.js → zh-cn-e963c628.js} +1 -1
  107. package/lib/bundle.js +1 -1
  108. package/lib/bundle.umd.cjs +225 -227
  109. package/lib/{index-c6d17ca2.js → index-f416420b.js} +31754 -32122
  110. package/lib/{python-09a6fcf8.js → python-766b93ca.js} +1 -1
  111. package/lib/style.css +1 -1
  112. package/package.json +1 -2
  113. package/packages/MonacoEditor/index.vue +70 -741
  114. package/packages/VarietySearch/components/AddTag/index.vue +86 -20
  115. package/packages/VarietySearch/components/FactorScreen/index.vue +12 -80
  116. package/packages/VarietySearch/components/FactorScreen/tools.js +0 -41
  117. package/src/main.ts +11 -16
  118. package/src/pages/MonacoEditor/index.vue +0 -1
  119. package/es/VarietySelect-2fd501da.cjs +0 -1
  120. package/es/VarietySelect-5a9dd50b.js +0 -68
@@ -23,13 +23,12 @@
23
23
  <!-- 添加标签弹窗 -->
24
24
  <el-dialog
25
25
  v-model="visible"
26
- title="Tips"
27
26
  width="1000"
28
27
  >
29
28
  <template #header>
30
29
  <div>
31
30
  添加标签
32
- <el-radio-group v-model="tagType" size="small" style="margin-left: 8px; vertical-align: 5px;" v-if="0">
31
+ <el-radio-group v-model="tagType" size="small" style="margin-left: 8px; vertical-align: 5px;">
33
32
  <el-radio-button label="个人" value="person" />
34
33
  <el-radio-button label="系统" value="system" />
35
34
  </el-radio-group>
@@ -41,8 +40,8 @@
41
40
  <el-checkbox :checked="isCheck(item)" @change="changeCheckBox(item)">
42
41
  <div style="display: flex; width: 280px;">
43
42
  <div style="flex: 1;line-height: 24px;">{{ item.name }}</div>
44
- <el-button size="small" :icon="Edit" v-if="0"></el-button>
45
- <el-button size="small" :icon="Delete" @click="deleteTag(item)"></el-button>
43
+ <el-button size="small" :icon="Edit" @click="editTag(item)" v-if="tagType === 'person'"></el-button>
44
+ <el-button size="small" :icon="Delete" @click="deleteTag(item)" v-if="tagType === 'person'"></el-button>
46
45
  </div>
47
46
  </el-checkbox>
48
47
  </div>
@@ -55,6 +54,21 @@
55
54
  </template>
56
55
  </el-dialog>
57
56
  <!-- 编辑标签弹窗 -->
57
+ <el-dialog
58
+ v-model="editVisible"
59
+ title="编辑标签"
60
+ top="20vh"
61
+ width="600"
62
+ >
63
+ <div style="margin-bottom: 12px;">原名称:{{ editItem?.name }}</div>
64
+ <el-input v-model="editValue" />
65
+ <template #footer>
66
+ <div class="dialog-footer">
67
+ <el-button @click="editVisible = false">取消</el-button>
68
+ <el-button type="primary" @click="changeTag()">确定</el-button>
69
+ </div>
70
+ </template>
71
+ </el-dialog>
58
72
  </template>
59
73
 
60
74
  <script setup>
@@ -69,14 +83,17 @@ const data = defineModel("data", { default: [] });
69
83
  const visible = ref(false);
70
84
  const tagType = ref('person'); // 标签类型
71
85
  const searchValue = ref(''); // 搜索值
72
- const totalTagList = ref([]); // 全部标签列表
86
+ const tagMap = ref({}); // 全部标签映射
73
87
  const tagList = ref([]); // 标签列表
74
88
  const checkList = ref([]); // 勾选列表
89
+ const editVisible = ref(false); // 编辑标签弹窗
90
+ const editItem = ref(null); // 编辑标签对象
91
+ const editValue = ref(''); // 编辑标签值
75
92
 
76
93
  const showCheckTagList = computed(() => {
77
94
  return data.value.map(id => {
78
95
  return {
79
- name: totalTagList.value?.find(i => i.id === id)?.tagName,
96
+ name: tagMap.value[id],
80
97
  id,
81
98
  }
82
99
  })
@@ -84,6 +101,7 @@ const showCheckTagList = computed(() => {
84
101
 
85
102
  watch(() => tagType.value, () => {
86
103
  searchValue.value = ''
104
+ getTagList()
87
105
  })
88
106
 
89
107
  watch(() => searchValue.value, () => {
@@ -106,6 +124,7 @@ const changeCheckBox = (item) => {
106
124
  }
107
125
  }
108
126
 
127
+ // 标签相关操作
109
128
  const handleAction = (action, index) => {
110
129
  switch (action) {
111
130
  // 新增
@@ -117,13 +136,6 @@ const handleAction = (action, index) => {
117
136
  getTagList()
118
137
  break;
119
138
  }
120
- // 编辑
121
- case "edit": {
122
- const item = data.value[index];
123
- compositeOrderForm.value = { ...item };
124
- visible.value = true;
125
- break;
126
- }
127
139
  // 窗口确认
128
140
  case "submit": {
129
141
  visible.value = false;
@@ -138,6 +150,7 @@ const handleAction = (action, index) => {
138
150
  }
139
151
  };
140
152
 
153
+ // 删除个人标签
141
154
  const deleteTag = (item) => {
142
155
  ElMessageBox.alert(`确认删除标签“${item.name}”吗?`, '删除标签', {
143
156
  confirmButtonText: 'OK',
@@ -145,13 +158,41 @@ const deleteTag = (item) => {
145
158
  if (action === 'confirm') {
146
159
  await request.post('/alarm/deliversign/deleteTag', { tagId: item.id })
147
160
  getTagList()
148
- Elmessage.success('删除成功!')
161
+ ElMessage.success('删除成功!')
149
162
  }
150
163
  },
151
164
  })
152
165
  }
153
166
 
154
- const getTagList = async (isTotal = false) => {
167
+ // 打开编辑标签弹窗
168
+ const editTag = (item) => {
169
+ editItem.value = item
170
+ editValue.value = item.name
171
+ editVisible.value = true
172
+ }
173
+
174
+ // 修改标签
175
+ const changeTag = async () => {
176
+ await request.post('/alarm/deliversign/addOrUpdateFeatureTag', { tagName: editValue.value, tagId: editItem.value.id })
177
+ tagMap.value = {
178
+ ...tagMap.value,
179
+ [editItem.value.id]: editValue.value
180
+ }
181
+ tagList.value = tagList.value.map(item => {
182
+ if (item.id === editItem.value.id) {
183
+ return {
184
+ ...item,
185
+ name: editValue.value
186
+ }
187
+ }
188
+ return item
189
+ })
190
+ editVisible.value = false
191
+ ElMessage.success('修改成功!')
192
+ }
193
+
194
+ // 获取标签列表
195
+ const getTagList = async () => {
155
196
  if (tagType.value === 'person') {
156
197
  // 个人标签
157
198
  const res = await request.post('/alarm/deliversign/findTagsByUserId', { tagName: searchValue.value })
@@ -162,19 +203,44 @@ const getTagList = async (isTotal = false) => {
162
203
  id: item.id
163
204
  }))
164
205
  })
165
- if (isTotal) {
166
- totalTagList.value = res.body
167
- }
168
206
  } else {
169
207
  // 系统标签
208
+ const res = await request.post('/alarm/deliversign/findSystemTagsByTagName', { tagName: searchValue.value })
209
+ tagList.value = []
210
+ nextTick(() => {
211
+ tagList.value = res.body?.map(item => ({
212
+ name: item.tagName,
213
+ id: item.id
214
+ }))
215
+ })
170
216
  }
171
217
  }
172
218
 
173
- getTagList(true)
219
+ // 获取全部标签
220
+ const getTotalTagMap = async () => {
221
+ const res = await Promise.all([
222
+ request.post('/alarm/deliversign/findTagsByUserId'),
223
+ request.post('/alarm/deliversign/findSystemTagsByTagName')
224
+ ])
225
+ tagMap.value = res.reduce((r, i) => {
226
+ return {
227
+ ...r,
228
+ ...i.body?.reduce((bodyR, bodyI) => {
229
+ return {
230
+ ...bodyR,
231
+ [bodyI.id]: bodyI.tagName
232
+ }
233
+ }, {})
234
+ }
235
+ }, {})
236
+ ElMessage.success('删除成功!')
237
+ }
238
+
239
+ getTotalTagMap()
174
240
 
175
241
  defineExpose({
176
242
  updateTag: () => {
177
- getTagList(true)
243
+ getTotalTagMap()
178
244
  }
179
245
  })
180
246
  </script>
@@ -2,7 +2,7 @@
2
2
  <script setup name="FactorScreen">
3
3
  import { nextTick, ref, watch, inject, reactive } from "vue";
4
4
  import { Close, Plus, CircleCloseFilled, InfoFilled, Document } from "@element-plus/icons-vue";
5
- import { handleVerifyScore, extractConditionDetails, extractVariables, sendToAi } from "./tools.js";
5
+ import { handleVerifyScore, extractConditionDetails, extractVariables } from "./tools.js";
6
6
  import FactorDescription from "./FactorDescription.vue";
7
7
  import MonacoEditor from "../../../MonacoEditor/index.vue";
8
8
 
@@ -38,7 +38,6 @@ const visibleDescriptions = ref(false);
38
38
  const factorType = ref("脚本");
39
39
  const scriptTestLoading = ref(false);
40
40
  const scriptCopyLoading = ref(false);
41
- const scriptAILoading = ref(false);
42
41
  const testVariety = ref("");
43
42
  const testVarietyVisible = ref(false);
44
43
  const scriptTestLogVisible = ref(false);
@@ -46,7 +45,6 @@ const scriptTestResult = reactive({
46
45
  result: null,
47
46
  detail: "",
48
47
  code: "",
49
- ai: "",
50
48
  });
51
49
 
52
50
  // 弹窗表单
@@ -324,16 +322,6 @@ const handleScriptCopy = async () => {
324
322
  scriptCopyLoading.value = false;
325
323
  }
326
324
  };
327
- // 测试: 复制
328
- const handleTestCodeCopy = () => {
329
- let txa = document.createElement("textarea");
330
- txa.value = scriptTestResult.code;
331
- document.body.appendChild(txa);
332
- txa.select();
333
- document.execCommand("copy");
334
- document.body.removeChild(txa);
335
- ElMessage.success("测试代码已经成功复制到粘贴板");
336
- };
337
325
  // 测试: 打开/确认/日志
338
326
  const extractCodesFromString = (str) => {
339
327
  if (!str) return [];
@@ -363,7 +351,7 @@ const handleScriptTest = async (action) => {
363
351
  };
364
352
  const testRes = await request.post("/common/qt/testFactorSelect", params);
365
353
  const { result, detail } = testRes.body;
366
- Object.assign(scriptTestResult, { result, detail, code: body, ai: "" });
354
+ Object.assign(scriptTestResult, { result, detail, code: body });
367
355
  if (result === 1) {
368
356
  ElMessage.success("测试通过");
369
357
  } else {
@@ -384,21 +372,6 @@ const handleScriptTest = async (action) => {
384
372
  }
385
373
  }
386
374
  };
387
- // 测试: AI分析
388
- const handleTestAi = () => {
389
- const appId = "87be17ecc84d4d2ea3108d7155bec2ac";
390
- const apiKey = "sk-d995eb26a4334bdeb2ccb4cbfaf51de8";
391
- scriptAILoading.value = true;
392
- scriptTestResult.ai = "";
393
- sendToAi(appId, apiKey, scriptTestResult.code, (type, res) => {
394
- if (type === "finish") {
395
- scriptAILoading.value = false;
396
- return;
397
- }
398
- scriptTestResult.ai = scriptTestResult.ai + res;
399
- console.log(scriptTestResult.ai);
400
- });
401
- };
402
375
 
403
376
  // 监控: 窗口开关
404
377
  watch(
@@ -423,8 +396,6 @@ watch(
423
396
  Object.assign(scriptTestResult, {
424
397
  result: null,
425
398
  detail: "",
426
- code: "",
427
- ai: "",
428
399
  });
429
400
  break;
430
401
  }
@@ -847,7 +818,6 @@ watch(
847
818
  ref="monacoEditorRef"
848
819
  :language="'lua'"
849
820
  :suggestionEnable="true"
850
- :variableEnable="true"
851
821
  />
852
822
  </div>
853
823
  <template #footer>
@@ -920,7 +890,7 @@ watch(
920
890
  <el-dialog
921
891
  modal-class="log-dialog"
922
892
  v-model="scriptTestLogVisible"
923
- width="80vw"
893
+ width="830"
924
894
  align-center
925
895
  append-to-body
926
896
  draggable
@@ -953,53 +923,17 @@ watch(
953
923
  >
954
924
  <pre>{{ scriptTestResult.code }}</pre>
955
925
  </el-scrollbar>
926
+ <!-- 分割线 -->
927
+ <el-divider direction="vertical" />
956
928
  <!-- 日志 -->
957
- <el-scrollbar
958
- class="log"
959
- height="600px"
960
- >
929
+ <el-scrollbar height="600px">
961
930
  <pre :class="scriptTestResult.result === 1 ? 'success-log' : 'error-log'">{{ scriptTestResult.result === 1 ? `✅️ 测试通过\n${scriptTestResult.detail}` : scriptTestResult.detail }}</pre>
962
931
  </el-scrollbar>
963
- <!-- AI分析结果 -->
964
- <el-scrollbar
965
- class="ai"
966
- height="600px"
967
- >
968
- <v-md-editor
969
- v-if="scriptTestResult.ai"
970
- mode="preview"
971
- :model-value="scriptTestResult.ai"
972
- />
973
- <!-- 正在进行AI分析, 并且没有返回结果时, 展示骨架屏 -->
974
- <el-skeleton
975
- v-else-if="scriptAILoading"
976
- :rows="5"
977
- animated
978
- />
979
- <!-- 未进行AI分析, 并且没有返回结果时, 展示文案 -->
980
- <el-empty
981
- v-else-if="!scriptAILoading"
982
- description="点击下方按钮: AI分析, 分析结果将会展示在此处"
983
- />
984
- </el-scrollbar>
985
932
  </div>
986
933
  <!-- 底部 -->
987
934
  <template #footer>
988
935
  <div class="dialog-footer">
989
- <el-button
990
- type="primary"
991
- :loading="scriptAILoading"
992
- @click="handleTestAi"
993
- >
994
- AI分析
995
- </el-button>
996
- <el-button
997
- type="primary"
998
- @click="handleTestCodeCopy"
999
- >
1000
- 复制
1001
- </el-button>
1002
- <el-button @click="scriptTestLogVisible = false">关闭</el-button>
936
+ <el-button @click="scriptTestLogVisible = false"> 关闭 </el-button>
1003
937
  </div>
1004
938
  </template>
1005
939
  </el-dialog>
@@ -1094,13 +1028,15 @@ watch(
1094
1028
  }
1095
1029
  .content {
1096
1030
  display: flex;
1097
- gap: 1px;
1031
+ background-color: var(--el-color-black);
1098
1032
  .el-scrollbar {
1099
- background-color: var(--el-color-black);
1100
1033
  flex: 1;
1101
1034
  box-sizing: border-box;
1102
1035
  padding: 8px;
1103
- border: var(--el-border);
1036
+ }
1037
+ .el-divider {
1038
+ margin: 0;
1039
+ height: 616px;
1104
1040
  }
1105
1041
  .code {
1106
1042
  color: var(--el-color-info);
@@ -1118,10 +1054,6 @@ watch(
1118
1054
  word-break: break-all;
1119
1055
  word-wrap: break-word;
1120
1056
  }
1121
- .ai {
1122
- flex: 2;
1123
- background-color: white;
1124
- }
1125
1057
  }
1126
1058
  }
1127
1059
  </style>
@@ -32,44 +32,3 @@ export const extractVariables = (content) => {
32
32
 
33
33
  return [...new Set(variables)]; // 去重
34
34
  };
35
-
36
- // 发送AI
37
- export const sendToAi = async (appId, apiKey, value, callback) => {
38
- try {
39
- const res = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${appId}/completion`, {
40
- method: "POST",
41
- body: JSON.stringify({
42
- input: { prompt: value },
43
- parameters: {
44
- incremental_output: "true", // 流式返回
45
- },
46
- debug: {},
47
- }),
48
- headers: {
49
- Authorization: `Bearer ${apiKey}`,
50
- "Content-Type": "application/json",
51
- "X-DashScope-SSE": "enable", // 流式输出
52
- },
53
- });
54
- if (!res.ok || !res.body) throw new Error("请求失败");
55
-
56
- const reader = res.body.getReader();
57
- const decoder = new TextDecoder();
58
-
59
- while (true) {
60
- const { done, value } = await reader.read();
61
- if (done && callback) {
62
- callback("finish", "");
63
- break;
64
- }
65
- try {
66
- const data = decoder.decode(value, { stream: true });
67
- const resData = JSON.parse(data.split("\n")[3].substr(5));
68
- const resText = resData?.output?.text;
69
- if (resText && callback) callback("message", resText);
70
- } catch (error) {}
71
- }
72
- } catch (error) {
73
- console.error(error);
74
- }
75
- };
package/src/main.ts CHANGED
@@ -1,17 +1,12 @@
1
- import { createApp } from "vue";
2
- import "./style.css";
3
- import App from "./App.vue";
4
- import router from "./router";
5
- import stComp from "../packages/index.ts";
6
- import { createPinia } from "pinia";
1
+ import { createApp } from 'vue'
2
+ import './style.css'
3
+ import App from './App.vue'
4
+ import router from './router'
5
+ import stComp from '../packages/index.ts'
6
+ import { createPinia } from 'pinia'
7
7
 
8
- // markdown编辑预览组件
9
- import "@kangc/v-md-editor/lib/style/base-editor.css";
10
- import "@kangc/v-md-editor/lib/theme/style/vuepress.css";
11
- import Prism from "prismjs";
12
- import vuepressTheme from "@kangc/v-md-editor/lib/theme/vuepress.js";
13
- import VueMarkdownEditor from "@kangc/v-md-editor";
14
-
15
- VueMarkdownEditor.use(vuepressTheme, { Prism });
16
-
17
- createApp(App).use(router).use(stComp).use(createPinia()).use(VueMarkdownEditor).mount("#app");
8
+ createApp(App)
9
+ .use(router)
10
+ .use(stComp)
11
+ .use(createPinia())
12
+ .mount('#app')
@@ -8,7 +8,6 @@
8
8
  ref="monacoEditorRef"
9
9
  :defaultValue="value"
10
10
  :suggestionEnable="true"
11
- :variableEnable="true"
12
11
  @change="changeCode"
13
12
  />
14
13
  </div>
@@ -1 +0,0 @@
1
- "use strict";require("./base-ef747d02.cjs");const y=require("./el-autocomplete-b9a3054a.cjs");require("./el-input-172c49f8.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-7ba87e05.cjs");const e=require("vue"),f=require("./index-8901a38c.cjs"),S=require("./_plugin-vue_export-helper-f246444f.cjs");const V={class:"variety-auto-complete"},b={key:0},q={class:"label"},x={__name:"VarietySelect",props:{size:{type:String,default:"default"},placeholder:{type:String,default:"请输入品种名称或代码"},labelShowEnable:{type:Boolean,default:!0},selectClearEnable:{type:Boolean,default:!0}},emits:["select","change"],setup(s,{emit:u}){const d=e.inject("stConfig"),r=u,n=s,c=e.ref(""),p=async(t,l)=>{if(t===""||t==="null")l([]);else{const a={keyWord:t,pageNum:1,pageSize:999,userId:f.V("id"),hotSearchFlag:1},{body:o}=await d.request.post("/common/qt/getFeatureInfosByPage",a),g=o.list.map(({code:i,featureName:h})=>({label:`${i}   ${h}`,value:i}));l(g)}},_=({label:t,value:l})=>{const a=t.split(" ").at(-1);r("select",{name:a,code:l}),n.selectClearEnable&&(c.value="")},m=t=>{r("change",t)};return(t,l)=>{const a=y.ElAutocomplete;return e.openBlock(),e.createElementBlock("div",V,[s.labelShowEnable?(e.openBlock(),e.createElementBlock("span",b,"品种搜索:")):e.createCommentVNode("",!0),e.createVNode(a,{modelValue:c.value,"onUpdate:modelValue":l[0]||(l[0]=o=>c.value=o),clearable:"",size:n.size,placeholder:n.placeholder,"fetch-suggestions":p,onSelect:_,onChange:m},{default:e.withCtx(({item:o})=>[e.createElementVNode("div",q,e.toDisplayString(o.label),1)]),_:1},8,["modelValue","size","placeholder"])])}}},v=S._export_sfc(x,[["__scopeId","data-v-d433c4b8"]]);exports.VarietySelect=v;
@@ -1,68 +0,0 @@
1
- import "./base-a5af3db3.js";
2
- import { E as y } from "./el-autocomplete-ed75a659.js";
3
- import "./el-input-cae60510.js";
4
- import "./el-scrollbar-323542e7.js";
5
- import "./el-popper-a38874f4.js";
6
- import { inject as S, ref as b, openBlock as i, createElementBlock as p, createCommentVNode as V, createVNode as x, withCtx as v, createElementVNode as C, toDisplayString as E } from "vue";
7
- import { V as z } from "./index-7ed0999e.js";
8
- import { _ as B } from "./_plugin-vue_export-helper-dad06003.js";
9
- const w = { class: "variety-auto-complete" }, N = { key: 0 }, k = { class: "label" }, I = {
10
- __name: "VarietySelect",
11
- props: {
12
- size: { type: String, default: "default" },
13
- placeholder: { type: String, default: "请输入品种名称或代码" },
14
- labelShowEnable: { type: Boolean, default: !0 },
15
- // 是否开启展示label
16
- selectClearEnable: { type: Boolean, default: !0 }
17
- // 是否开启选择回调后清除输入框值
18
- },
19
- emits: ["select", "change"],
20
- setup(n, { emit: d }) {
21
- const m = S("stConfig"), c = d, l = n, s = b(""), u = async (e, t) => {
22
- if (e === "" || e === "null")
23
- t([]);
24
- else {
25
- const a = {
26
- keyWord: e,
27
- pageNum: 1,
28
- pageSize: 999,
29
- userId: z("id"),
30
- hotSearchFlag: 1
31
- }, { body: o } = await m.request.post("/common/qt/getFeatureInfosByPage", a), g = o.list.map(({ code: r, featureName: h }) => ({
32
- label: `${r}   ${h}`,
33
- value: r
34
- }));
35
- t(g);
36
- }
37
- }, _ = ({ label: e, value: t }) => {
38
- const a = e.split(" ").at(-1);
39
- c("select", { name: a, code: t }), l.selectClearEnable && (s.value = "");
40
- }, f = (e) => {
41
- c("change", e);
42
- };
43
- return (e, t) => {
44
- const a = y;
45
- return i(), p("div", w, [
46
- n.labelShowEnable ? (i(), p("span", N, "品种搜索:")) : V("", !0),
47
- x(a, {
48
- modelValue: s.value,
49
- "onUpdate:modelValue": t[0] || (t[0] = (o) => s.value = o),
50
- clearable: "",
51
- size: l.size,
52
- placeholder: l.placeholder,
53
- "fetch-suggestions": u,
54
- onSelect: _,
55
- onChange: f
56
- }, {
57
- default: v(({ item: o }) => [
58
- C("div", k, E(o.label), 1)
59
- ]),
60
- _: 1
61
- }, 8, ["modelValue", "size", "placeholder"])
62
- ]);
63
- };
64
- }
65
- }, W = /* @__PURE__ */ B(I, [["__scopeId", "data-v-d433c4b8"]]);
66
- export {
67
- W as V
68
- };