star-horse-lowcode 2.7.62 → 2.7.65

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 (221) hide show
  1. package/.env.development +3 -0
  2. package/.env.production +3 -0
  3. package/.eslintrc-auto-import.json +77 -0
  4. package/.gitignore +27 -0
  5. package/.idea/.gitignore +5 -0
  6. package/.idea/MarsCodeWorkspaceAppSettings.xml +6 -0
  7. package/.idea/inspectionProfiles/Project_Default.xml +7 -0
  8. package/.idea/modules.xml +8 -0
  9. package/.idea/testcode.iml +12 -0
  10. package/.idea/vcs.xml +6 -0
  11. package/.idea/watcherTasks.xml +4 -0
  12. package/.idea/workspace.xml +207 -0
  13. package/.npmignore +21 -0
  14. package/.prettierignore +26 -0
  15. package/README.md +2 -0
  16. package/auto-imports.d.ts +137 -0
  17. package/components.d.ts +189 -0
  18. package/dist/assets/index.css +1 -1
  19. package/dist/index.es.js +941 -720
  20. package/dist/types/index.d.ts +8 -8
  21. package/eslint.config.js +37 -0
  22. package/index.html +14 -0
  23. package/package-lock.json +8276 -0
  24. package/package.json +6 -6
  25. package/prettier.config.js +20 -0
  26. package/public/logo.svg +660 -0
  27. package/src/App.vue +11 -0
  28. package/src/api/date_utils.ts +219 -0
  29. package/src/api/finger_utils.ts +71 -0
  30. package/src/api/form_utils.ts +281 -0
  31. package/src/api/jquery.min.js +2 -0
  32. package/src/api/pcas-code.json +1 -0
  33. package/src/api/settings.ts +81 -0
  34. package/src/api/star_horse_apis.ts +196 -0
  35. package/src/api/star_horse_utils.ts +797 -0
  36. package/src/api/system.ts +351 -0
  37. package/src/api/user_func.ts +147 -0
  38. package/src/api/valid_utils.ts +165 -0
  39. package/src/assets/css/index.scss +908 -0
  40. package/src/assets/icons.css +574 -0
  41. package/src/assets/star-horse-icons.woff +0 -0
  42. package/src/components/comp/ShDynamicForm.vue +160 -0
  43. package/src/components/comp/ShForm.vue +30 -0
  44. package/src/components/comp/ShTableListColumn.vue +61 -0
  45. package/src/components/comp/StarHorseDataSelector.vue +139 -0
  46. package/src/components/comp/StarHorseDataView.vue +110 -0
  47. package/src/components/comp/StarHorseDataViewItems.vue +61 -0
  48. package/src/components/comp/StarHorseDataViewTable.vue +102 -0
  49. package/src/components/comp/StarHorseDialog.vue +383 -0
  50. package/src/components/comp/StarHorseDraggable.vue +401 -0
  51. package/src/components/comp/StarHorseForm.vue +458 -0
  52. package/src/components/comp/StarHorseFormItem.vue +82 -0
  53. package/src/components/comp/StarHorseFormList.vue +516 -0
  54. package/src/components/comp/StarHorseFormTable.vue +56 -0
  55. package/src/components/comp/StarHorseIcon.vue +76 -0
  56. package/src/components/comp/StarHorseItem.vue +302 -0
  57. package/src/components/comp/StarHorseJsonEditor.vue +115 -0
  58. package/src/components/comp/StarHorsePopover.vue +66 -0
  59. package/src/components/comp/StarHorseSearchComp.vue +253 -0
  60. package/src/components/comp/StarHorseStaticTable.vue +395 -0
  61. package/src/components/comp/StarHorseTableColumn.vue +249 -0
  62. package/src/components/comp/StarHorseTableComp.vue +1193 -0
  63. package/src/components/comp/StarHorseTableViewColumn.vue +61 -0
  64. package/src/components/comp/StarHorseTree.vue +494 -0
  65. package/src/components/comp/index.ts +22 -0
  66. package/src/components/comp/items/UTableColumn.vue +65 -0
  67. package/src/components/comp/items/boxItem.vue +98 -0
  68. package/src/components/comp/items/callitem.ts +9 -0
  69. package/src/components/comp/items/cardItem.vue +152 -0
  70. package/src/components/comp/items/collapseItem.vue +134 -0
  71. package/src/components/comp/items/dytableItem.vue +135 -0
  72. package/src/components/comp/items/otherItem.vue +65 -0
  73. package/src/components/comp/items/tabItem.vue +155 -0
  74. package/src/components/comp/items/tabPanelItem.vue +110 -0
  75. package/src/components/comp/items/tableColumn.vue +129 -0
  76. package/src/components/comp/items/tableItem.vue +97 -0
  77. package/src/components/comp/items/tablebtn.vue +158 -0
  78. package/src/components/comp/items/viewBoxItem.vue +55 -0
  79. package/src/components/comp/items/viewCardItem.vue +47 -0
  80. package/src/components/comp/items/viewCollapseItem.vue +71 -0
  81. package/src/components/comp/items/viewDytableItem.vue +77 -0
  82. package/src/components/comp/items/viewOtherItem.vue +55 -0
  83. package/src/components/comp/items/viewTabItem.vue +77 -0
  84. package/src/components/comp/items/viewTabPanelItem.vue +54 -0
  85. package/src/components/comp/items/viewTableItem.vue +74 -0
  86. package/src/components/comp/selfcomp.ts +9 -0
  87. package/src/components/comp/utils/DataPicker.vue +302 -0
  88. package/src/components/comp/utils/DataTag.vue +51 -0
  89. package/src/components/cron/Crontab-Day.vue +230 -0
  90. package/src/components/cron/Crontab-Hour.vue +165 -0
  91. package/src/components/cron/Crontab-Min.vue +166 -0
  92. package/src/components/cron/Crontab-Month.vue +166 -0
  93. package/src/components/cron/Crontab-Result.vue +615 -0
  94. package/src/components/cron/Crontab-Second.vue +185 -0
  95. package/src/components/cron/Crontab-Week.vue +208 -0
  96. package/src/components/cron/Crontab-Year.vue +183 -0
  97. package/src/components/cron/Crontab.vue +474 -0
  98. package/src/components/enums/ModuleEnums.ts +10 -0
  99. package/src/components/enums/ServiceEnums.ts +18 -0
  100. package/src/components/formcomp/container/box-container.vue +162 -0
  101. package/src/components/formcomp/container/callitem.ts +9 -0
  102. package/src/components/formcomp/container/card-container.vue +170 -0
  103. package/src/components/formcomp/container/collapse-container.vue +133 -0
  104. package/src/components/formcomp/container/dytable-col.vue +448 -0
  105. package/src/components/formcomp/container/dytable-container.vue +57 -0
  106. package/src/components/formcomp/container/dytableUtils.ts +358 -0
  107. package/src/components/formcomp/container/group-box-container.vue +331 -0
  108. package/src/components/formcomp/container/index.ts +6 -0
  109. package/src/components/formcomp/container/tab-container.vue +153 -0
  110. package/src/components/formcomp/container/table-container.vue +249 -0
  111. package/src/components/formcomp/items/allitem.ts +9 -0
  112. package/src/components/formcomp/items/area-item.vue +116 -0
  113. package/src/components/formcomp/items/audio-item.vue +163 -0
  114. package/src/components/formcomp/items/autocomplete-item.vue +118 -0
  115. package/src/components/formcomp/items/barcode-item.vue +87 -0
  116. package/src/components/formcomp/items/base-json-item.vue +207 -0
  117. package/src/components/formcomp/items/button-item.vue +228 -0
  118. package/src/components/formcomp/items/cascade-item.vue +113 -0
  119. package/src/components/formcomp/items/checkbox-item.vue +97 -0
  120. package/src/components/formcomp/items/color-item.vue +70 -0
  121. package/src/components/formcomp/items/cron-item.vue +115 -0
  122. package/src/components/formcomp/items/datetime-item.vue +99 -0
  123. package/src/components/formcomp/items/depart-item.vue +51 -0
  124. package/src/components/formcomp/items/dialog-input-item.vue +207 -0
  125. package/src/components/formcomp/items/divider-item.vue +66 -0
  126. package/src/components/formcomp/items/html-item.vue +65 -0
  127. package/src/components/formcomp/items/htmleditor-item.vue +104 -0
  128. package/src/components/formcomp/items/icon-item.vue +195 -0
  129. package/src/components/formcomp/items/image-item.vue +247 -0
  130. package/src/components/formcomp/items/index.ts +44 -0
  131. package/src/components/formcomp/items/input-item.vue +150 -0
  132. package/src/components/formcomp/items/json-array-item.vue +67 -0
  133. package/src/components/formcomp/items/json-item.vue +66 -0
  134. package/src/components/formcomp/items/markdown-item.vue +77 -0
  135. package/src/components/formcomp/items/number-item.vue +94 -0
  136. package/src/components/formcomp/items/number-range-item.vue +278 -0
  137. package/src/components/formcomp/items/page-select-item.vue +407 -0
  138. package/src/components/formcomp/items/password-item.vue +71 -0
  139. package/src/components/formcomp/items/qrcode-item.vue +84 -0
  140. package/src/components/formcomp/items/radio-item.vue +112 -0
  141. package/src/components/formcomp/items/rate-item.vue +68 -0
  142. package/src/components/formcomp/items/select-item.vue +133 -0
  143. package/src/components/formcomp/items/signature-item.vue +216 -0
  144. package/src/components/formcomp/items/slider-item.vue +68 -0
  145. package/src/components/formcomp/items/starhorse-form-item.vue +334 -0
  146. package/src/components/formcomp/items/switch-item.vue +77 -0
  147. package/src/components/formcomp/items/tag-item.vue +77 -0
  148. package/src/components/formcomp/items/text-item.vue +75 -0
  149. package/src/components/formcomp/items/textarea-item.vue +85 -0
  150. package/src/components/formcomp/items/time-item.vue +77 -0
  151. package/src/components/formcomp/items/time-picker-item.vue +74 -0
  152. package/src/components/formcomp/items/transfer-item.vue +93 -0
  153. package/src/components/formcomp/items/tselect-item.vue +121 -0
  154. package/src/components/formcomp/items/unknown-item.vue +51 -0
  155. package/src/components/formcomp/items/upload-item.vue +189 -0
  156. package/src/components/formcomp/items/user-item.vue +177 -0
  157. package/src/components/formcomp/items/usercomp-item.vue +85 -0
  158. package/src/components/formcomp/items/view-markdown-item.vue +77 -0
  159. package/src/components/formcomp/utils/EditDataDialog.vue +67 -0
  160. package/src/components/formcomp/utils/FieldList.vue +125 -0
  161. package/src/components/formcomp/utils/ItemRelationEventUtils.ts +284 -0
  162. package/src/components/help.vue +31 -0
  163. package/src/components/menu/MenuItem.vue +95 -0
  164. package/src/components/menu/SubMenu.vue +68 -0
  165. package/src/components/menu/SubSystemMenu.vue +142 -0
  166. package/src/components/register.ts +24 -0
  167. package/src/components/system/ContentMenu.vue +260 -0
  168. package/src/components/system/StarHorseButtonList.vue +344 -0
  169. package/src/components/system/StarHorseMenu.vue +97 -0
  170. package/src/components/system/StarHorseSvg.vue +62 -0
  171. package/src/components/system/SystemComp.ts +9 -0
  172. package/src/components/system/index.ts +4 -0
  173. package/src/components/types/ApiUrls.ts +168 -0
  174. package/src/components/types/BtnAction.ts +51 -0
  175. package/src/components/types/BtnAuth.ts +43 -0
  176. package/src/components/types/CompInfo.ts +81 -0
  177. package/src/components/types/DialogProps.ts +55 -0
  178. package/src/components/types/DyCompField.ts +23 -0
  179. package/src/components/types/DynamicNode.ts +42 -0
  180. package/src/components/types/MenusInfo.ts +45 -0
  181. package/src/components/types/PageFieldInfo.ts +530 -0
  182. package/src/components/types/PageProps.ts +25 -0
  183. package/src/components/types/Params.ts +93 -0
  184. package/src/components/types/RuleType.ts +10 -0
  185. package/src/components/types/SearchProps.ts +42 -0
  186. package/src/components/types/ShortKey.ts +30 -0
  187. package/src/components/types/StarHorseType.ts +18 -0
  188. package/src/components/types/index.ts +15 -0
  189. package/src/config/element.ts +15 -0
  190. package/src/config/styles.ts +4 -0
  191. package/src/index.ts +98 -0
  192. package/src/install.ts +33 -0
  193. package/src/lang/en_US.ts +81 -0
  194. package/src/lang/index.ts +35 -0
  195. package/src/lang/zh_CN.ts +84 -0
  196. package/src/main.ts +57 -0
  197. package/src/plugins/AblesPlugin.ts +618 -0
  198. package/src/plugins/registerCompPlugin.ts +15 -0
  199. package/src/sample/test.vue +9 -0
  200. package/src/store/ButtonPermission.ts +101 -0
  201. package/src/store/ConsumerView.ts +52 -0
  202. package/src/store/ContinusConfig.ts +78 -0
  203. package/src/store/CopyerOperation.ts +74 -0
  204. package/src/store/DesignForm.ts +481 -0
  205. package/src/store/DesignPage.ts +59 -0
  206. package/src/store/DynamicForm.ts +241 -0
  207. package/src/store/GlobalConfig.ts +90 -0
  208. package/src/store/SelfOperation.ts +95 -0
  209. package/src/store/UserInfo.ts +88 -0
  210. package/src/store/index.ts +6 -0
  211. package/src/theme/localStorge.ts +16 -0
  212. package/src/theme/theme.ts +27 -0
  213. package/src/utils/FieldOperationUtils.ts +91 -0
  214. package/src/utils/auth.ts +83 -0
  215. package/src/utils/message.ts +69 -0
  216. package/src/utils/preview.ts +125 -0
  217. package/tsconfig.json +39 -0
  218. package/tsconfig.node.json +10 -0
  219. package/vite-env.d.ts +16 -0
  220. package/vite.config.ts +162 -0
  221. package/yarn.lock +4627 -0
@@ -0,0 +1,302 @@
1
+ <script setup lang="ts" name="StarHorseItem">
2
+ import { computed, inject, ModelRef, onMounted, PropType, ref } from "vue";
3
+ import { useSelfOperationStore } from "@/store/SelfOperation";
4
+ import piniaInstance from "@/store";
5
+ import {
6
+ compKey,
7
+ dateCompList,
8
+ fieldPlaceholder,
9
+ inputCompList,
10
+ selectCompList,
11
+ uuid,
12
+ } from "@/api/system";
13
+ import { Config } from "@/api/settings";
14
+ import { checkVisible, filterProperties } from "@/api/form_utils";
15
+ import Help from "@/components/help.vue";
16
+
17
+ const props = defineProps({
18
+ item: { type: Object as PropType<any>, required: true },
19
+ column: { type: Object as PropType<any> },
20
+ primaryKey: { type: Object as PropType<any> },
21
+ // 数据索引
22
+ dataIndex: { type: Number, default: -1 },
23
+ bareFlag: { type: Boolean, default: false },
24
+ batchName: { type: String, default: "" },
25
+ compSize: { type: String, default: Config.compSize },
26
+ showLabel: { type: Boolean, default: true }, //是否显示标签
27
+ source: { type: Number, default: 1 },
28
+ });
29
+ let userOperation = useSelfOperationStore(piniaInstance);
30
+ const dataForm: ModelRef<any> = defineModel("dataForm");
31
+ const itemType = ref<string>("input");
32
+ const emit = defineEmits(["dataSearch", "focus", "blur"]);
33
+ const formFields: any = inject("formFields", {});
34
+ // const actionName = ref();
35
+ const componentRef = ref();
36
+ const isDragging = ref(false);
37
+ const startX = ref(0);
38
+ const startWidth = ref(0);
39
+ const dragWidth = ref<string | null>(null);
40
+ const bareStyle = computed(() => ({
41
+ height: itemType.value != "button" ? "100%" : "inherit",
42
+ minWidth: props.source == 4 ? "200px" : "unset",
43
+ maxHeight: props.source == 4 ? "500px" : "unset",
44
+ width:
45
+ props.source == 4
46
+ ? dragWidth.value || props.item.minWidth || "inherit"
47
+ : "100%",
48
+ position: "relative" as const,
49
+ }));
50
+ /**
51
+ * 组件派发事件
52
+ * @param act
53
+ * @param params
54
+ */
55
+ const actionDispatcher = (act: string, ...params: any[]) => {
56
+ if (props.source == 4) {
57
+ if (!act) {
58
+ return;
59
+ }
60
+ emit("dataSearch", params);
61
+ } else {
62
+ let actions: Record<string, Function> = props.item.actions;
63
+ const eventNames: Array<string> = Object.keys(actions || {});
64
+ if (
65
+ eventNames?.length > 0 &&
66
+ eventNames.includes(act) &&
67
+ typeof actions[act] == "function"
68
+ ) {
69
+ actions[act](dataForm.value, params);
70
+ }
71
+ if (act == "focus") {
72
+ emit("focus", props.column, params);
73
+ } else if (act == "blur" || (act == "change" && props.source == 5)) {
74
+ emit("blur", props.column, params);
75
+ }
76
+ }
77
+ };
78
+
79
+ const fieldType = () => {
80
+ const inputList = inputCompList();
81
+ const dateNameList = dateCompList();
82
+ const selectNameList = selectCompList();
83
+ itemType.value = props.item?.type || props.item?.fieldType || "input";
84
+ if (dateNameList.includes(itemType.value)) {
85
+ itemType.value = "datetime";
86
+ //日期默认以时间戳赋值
87
+ }
88
+ if (!props.item.actions) {
89
+ props.item["actions"] = {};
90
+ }
91
+ const keys = Object.keys(props.item.actions);
92
+ if (props.source == 4) {
93
+ const actionKey = inputList.includes(itemType.value)
94
+ ? "keyup.enter"
95
+ : "change";
96
+ if (!keys.includes(actionKey)) {
97
+ props.item.actions[actionKey] = actionKey;
98
+ }
99
+ } else if (props.source == 5) {
100
+ //列表组件动态增加blur 和change 事件
101
+ const actionKey = inputList.includes(itemType.value)
102
+ ? "blur"
103
+ : selectNameList.includes(itemType.value)
104
+ ? "change"
105
+ : null;
106
+ if (actionKey && !keys.includes(actionKey)) {
107
+ props.item.actions[actionKey] = actionKey;
108
+ }
109
+ }
110
+ };
111
+ const exclusions = [
112
+ "name",
113
+ "id",
114
+ "label",
115
+ "itemNameLabel",
116
+ "autocomplete",
117
+ "maxLength",
118
+ ];
119
+ const init = () => {
120
+ fieldType();
121
+ if (!props.item["id"]) {
122
+ props.item["id"] = props.item.preps?.id ?? uuid();
123
+ }
124
+ if (!props.item.fieldName) {
125
+ props.item["fieldName"] = props.item.preps?.name ?? props.item.id;
126
+ }
127
+ fieldPlaceholder(props.item, itemType.value);
128
+ if (props.item.preps) {
129
+ //防止name 与Vue重名,导致渲染异常
130
+ filterProperties(props.item.preps, exclusions);
131
+ props.item.preps["readonly"] = props.item?.readonly || props.source == 3;
132
+ props.item.preps["starHorseFieldSource"] = props.source;
133
+ let keys = Object.keys(props.item.preps);
134
+ for (let key in keys) {
135
+ let val = props.item.preps[key];
136
+ if (val == "Y" || val == "N") {
137
+ props.item.preps[key] = val == "Y";
138
+ } else if (val == "true" || val == "false") {
139
+ props.item.preps[key] = val == "true";
140
+ }
141
+ }
142
+ }
143
+ compPreps();
144
+ };
145
+ const compPreps = () => {
146
+ fieldType();
147
+ //过滤掉查询表单的信息
148
+ if (props.source != 4 && formFields) {
149
+ let fieldName = props.item.fieldName;
150
+ //如果数据来源于列表
151
+ if (props.batchName) {
152
+ let batchFields = formFields[props.batchName];
153
+ if (!batchFields) {
154
+ formFields[props.batchName] = [];
155
+ }
156
+ let row = formFields[props.batchName][dataForm.value["xh"] - 1];
157
+ if (!row) {
158
+ formFields[props.batchName].push([]);
159
+ } else {
160
+ row.push(props.item);
161
+ }
162
+ } else {
163
+ formFields[fieldName] = props.item;
164
+ }
165
+ }
166
+ //将表单属性存储起来
167
+ if (props.source != 4) {
168
+ userOperation.addFormItem(props.item);
169
+ }
170
+ /**
171
+ * 组件初始化时赋值默认值,
172
+ * 在表单操作过程中,不再进行默认值的处理
173
+ */
174
+ if (!dataForm.value[props.item?.fieldName] && props.item?.defaultValue) {
175
+ dataForm.value[props.item?.fieldName] = props.item?.defaultValue;
176
+ }
177
+ };
178
+
179
+ const startDrag = (e: MouseEvent) => {
180
+ isDragging.value = true;
181
+ startX.value = e.clientX;
182
+ const compInfo = (e.target as HTMLElement).parentElement;
183
+ if (compInfo) {
184
+ startWidth.value = compInfo.offsetWidth;
185
+ }
186
+ document.body.style.userSelect = "none";
187
+ };
188
+
189
+ const onDrag = (e: MouseEvent) => {
190
+ if (!isDragging.value) return;
191
+ const delta = e.clientX - startX.value;
192
+ const newWidth = startWidth.value + delta;
193
+ if (newWidth > 100) {
194
+ // 最小宽度限制
195
+ dragWidth.value = `${newWidth}px`;
196
+ }
197
+ };
198
+
199
+ const stopDrag = () => {
200
+ if (isDragging.value) {
201
+ isDragging.value = false;
202
+ document.body.style.userSelect = "";
203
+ }
204
+ };
205
+ const checkClassName = () => {
206
+ if (props.bareFlag || props.item.preps?.headerFlag) {
207
+ return "bare-comp";
208
+ } else {
209
+ return "comp-info";
210
+ }
211
+ };
212
+ onMounted(() => {
213
+ init();
214
+ });
215
+ </script>
216
+ <template>
217
+ <div
218
+ :class="checkClassName()"
219
+ :style="bareStyle"
220
+ @mousemove="onDrag"
221
+ @mouseup="stopDrag"
222
+ @mouseleave="stopDrag"
223
+ >
224
+ <div
225
+ class="drag-handle"
226
+ @mousedown.prevent="startDrag"
227
+ v-if="itemType != 'button' && source == 4"
228
+ ></div>
229
+ <help :message="item.helpMsg" v-if="item.helpMsg" />
230
+ <component
231
+ :key="item.id"
232
+ :is="
233
+ ((dataForm && dataForm['_' + item.fieldName + 'Type']) || itemType) +
234
+ '-item'
235
+ "
236
+ @selfFunc="actionDispatcher"
237
+ ref="componentRef"
238
+ :isSearch="source == 4"
239
+ :bareFlag="bareFlag"
240
+ :field="item"
241
+ v-model:formData="dataForm"
242
+ />
243
+ <div v-if="item.brotherNodes" style="width: 15px" />
244
+ <template
245
+ v-for="(temp, key) in item.brotherNodes"
246
+ :key="compKey(temp, key)"
247
+ >
248
+ <star-horse-item
249
+ v-if="checkVisible(temp, dataForm)"
250
+ :primaryKey="primaryKey"
251
+ :compSize="compSize"
252
+ v-model:dataForm="dataForm"
253
+ :item="temp"
254
+ :dataIndex="dataIndex"
255
+ :bareFlag="true"
256
+ :source="source"
257
+ />
258
+ </template>
259
+ </div>
260
+ </template>
261
+ <style lang="scss" scoped>
262
+ :deep(.el-cascader) {
263
+ width: 100%;
264
+ }
265
+
266
+ .drag-handle {
267
+ position: absolute;
268
+ right: -4px;
269
+ top: 0;
270
+ bottom: 0;
271
+ width: 8px;
272
+ cursor: col-resize;
273
+ z-index: 100;
274
+
275
+ &:hover {
276
+ background: rgba(64, 158, 255, 0.2);
277
+ }
278
+ }
279
+
280
+ .comp-info {
281
+ display: flex;
282
+ justify-content: left;
283
+ flex: 1;
284
+ align-items: center;
285
+ margin: 0 auto;
286
+ }
287
+
288
+ .bare-comp {
289
+ flex: 1;
290
+ display: flex;
291
+ align-items: center;
292
+ width: 100%;
293
+ margin: 5px;
294
+ }
295
+
296
+ .brother-node {
297
+ margin-left: 5px;
298
+ display: flex;
299
+ align-items: center;
300
+ flex: 1;
301
+ }
302
+ </style>
@@ -0,0 +1,115 @@
1
+ <script setup lang="ts">
2
+ import { ModelRef, onBeforeUnmount, onMounted, PropType, ref } from "vue";
3
+ import JsonEditor from "vue3-ts-jsoneditor";
4
+
5
+ defineProps({
6
+ options: { type: Object as PropType<any> },
7
+ currentMode: {
8
+ type: String,
9
+ default: "code",
10
+ },
11
+ modeList: {
12
+ type: Array,
13
+ default: () => ["tree", "code", "form", "text", "view"],
14
+ },
15
+ // en, es zh-CN, pt-BR, tr, ja, fr-FR, de, ru, ko
16
+ language: {
17
+ type: String,
18
+ default: "zh-CN",
19
+ },
20
+ });
21
+
22
+ const json: ModelRef<any> = defineModel("modelValue", {
23
+ default: {},
24
+ });
25
+ // const jsonEditorRef = ref();
26
+ // 'javascript' | 'lodash' | 'jmespath' | 'jsonquery' | 'jsonpath'
27
+ const queryLanguages: Array<any> = [
28
+ "javascript",
29
+ "lodash",
30
+ "jmespath",
31
+ "jsonquery",
32
+ "jsonpath",
33
+ ];
34
+
35
+ // 全屏处理
36
+ let editor = ref(null);
37
+
38
+ const setEditorContent = (value) => {};
39
+ const init = () => {};
40
+ onMounted(() => {
41
+ init();
42
+ setEditorContent(json.value);
43
+ });
44
+ onBeforeUnmount(() => {
45
+ editor.value = null;
46
+ });
47
+ defineExpose({
48
+ editor,
49
+ setEditorContent,
50
+ });
51
+ </script>
52
+ <template>
53
+ <json-editor
54
+ ref="editor"
55
+ mode="text"
56
+ v-model:json="json"
57
+ :queryLanguagesIds="queryLanguages"
58
+ class="json-editor"
59
+ />
60
+ </template>
61
+
62
+ <style scoped lang="scss">
63
+ .container {
64
+ position: relative;
65
+ }
66
+
67
+ .full-screen-container {
68
+ position: fixed;
69
+ top: 0;
70
+ left: 0;
71
+ right: 0;
72
+ bottom: 0;
73
+ z-index: 999999999999;
74
+ width: auto !important;
75
+ height: auto !important;
76
+ }
77
+
78
+ .json-editor {
79
+ width: 100%;
80
+ height: 100%;
81
+ }
82
+
83
+ code {
84
+ background-color: #f5f5f5;
85
+ }
86
+
87
+ .full-screen {
88
+ position: absolute;
89
+ display: none;
90
+ top: 8px;
91
+ right: 110px;
92
+ width: 22px;
93
+ height: 22px;
94
+ border-radius: 2px;
95
+ cursor: pointer;
96
+ background-size: cover;
97
+ background-image: url("data:image/svg+xml,%3Csvg t='1635416254060' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='42247' width='128' height='128'%3E%3Cpath d='M240.8 196l178.4 178.4-45.6 45.6-177.6-179.2-68 68V128h180.8l-68 68z m133.6 408.8L196 783.2 128 715.2V896h180.8l-68-68 178.4-178.4-44.8-44.8zM715.2 128l68 68-178.4 178.4 45.6 45.6 178.4-178.4 68 68V128H715.2z m-65.6 476.8l-45.6 45.6 178.4 178.4-68 68H896V715.2l-68 68-178.4-178.4z' p-id='42248' fill='%23ffffff'%3E%3C/path%3E%3C/svg%3E");
98
+ }
99
+
100
+ .full-screen-container .full-screen {
101
+ background-image: url("data:image/svg+xml,%3Csvg t='1635416420969' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='42490' width='128' height='128'%3E%3Cpath d='M142.4 96.8l-44.8 44.8 173.6 174.4-68 68H384V203.2l-67.2 67.2zM752.8 316l173.6-174.4-44.8-44.8-174.4 173.6-67.2-67.2V384h180.8zM270.4 707.2l-169.6 170.4 44.8 49.6 170.4-174.4 68 68V640H203.2zM820.8 640H640v180.8l68-68 170.4 174.4 44.8-49.6-169.6-170.4z' p-id='42491' fill='%23ffffff'%3E%3C/path%3E%3C/svg%3E");
102
+ }
103
+
104
+ .show {
105
+ display: block;
106
+ }
107
+
108
+ .right {
109
+ right: 15px;
110
+ }
111
+
112
+ .full-screen:hover {
113
+ border: 1px solid #d7e6fe;
114
+ }
115
+ </style>
@@ -0,0 +1,66 @@
1
+ <script lang="ts" setup name="StarHorsePopover">
2
+ import { onMounted, ref } from "vue";
3
+ import { postRequest } from "@/api/star_horse_apis";
4
+ import { warning } from "@/utils/message";
5
+ import { compKey } from "@/api/system";
6
+
7
+ const props = defineProps({
8
+ menuIcon: { type: String },
9
+ iconUrl: { type: String },
10
+ iconSize: { type: Number, default: 48 },
11
+ icons: { type: Array, default: () => [] },
12
+ });
13
+ const emits = defineEmits(["selectIcon"]);
14
+ let iconList = ref<Array<any>>([]);
15
+ const menuIconSelect = (corn: any) => {
16
+ emits("selectIcon", corn);
17
+ };
18
+ const init = () => {
19
+ if (props.iconUrl) {
20
+ postRequest(props.iconUrl, {}).then((res) => {
21
+ const resData = res.data;
22
+ if (resData.code) {
23
+ warning(resData.cnMessage);
24
+ return;
25
+ }
26
+ iconList.value = resData.data;
27
+ });
28
+ } else {
29
+ iconList.value = props.icons;
30
+ }
31
+ };
32
+ onMounted(() => {
33
+ init();
34
+ });
35
+ </script>
36
+ <template>
37
+ <el-popover
38
+ placement="bottom"
39
+ :popper-style="{ width: 'unset !important' }"
40
+ trigger="click"
41
+ >
42
+ <template #reference>
43
+ <slot></slot>
44
+ </template>
45
+ <ul class="system-icon">
46
+ <li
47
+ v-for="(sdata, key) in iconList"
48
+ :key="compKey(sdata, key)"
49
+ @click="menuIconSelect(sdata.menuIcon)"
50
+ :class="menuIcon == sdata.menuIcon ? 'icon-active' : ''"
51
+ >
52
+ <el-tooltip :content="sdata.label">
53
+ <star-horse-icon
54
+ :icon-class="sdata.menuIcon"
55
+ style="
56
+ color: var(--star-horse-style);
57
+ vertical-align: middle;
58
+ font-size: 48px;
59
+ "
60
+ />
61
+ </el-tooltip>
62
+ </li>
63
+ </ul>
64
+ </el-popover>
65
+ </template>
66
+ <style scoped></style>