star-horse-lowcode 2.7.65 → 2.7.66

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 (220) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/index.css +1 -1
  3. package/dist/index.es.js +491 -253
  4. package/package.json +1 -1
  5. package/.env.development +0 -3
  6. package/.env.production +0 -3
  7. package/.eslintrc-auto-import.json +0 -77
  8. package/.gitignore +0 -27
  9. package/.idea/.gitignore +0 -5
  10. package/.idea/MarsCodeWorkspaceAppSettings.xml +0 -6
  11. package/.idea/inspectionProfiles/Project_Default.xml +0 -7
  12. package/.idea/modules.xml +0 -8
  13. package/.idea/testcode.iml +0 -12
  14. package/.idea/vcs.xml +0 -6
  15. package/.idea/watcherTasks.xml +0 -4
  16. package/.idea/workspace.xml +0 -207
  17. package/.npmignore +0 -21
  18. package/.prettierignore +0 -26
  19. package/auto-imports.d.ts +0 -137
  20. package/components.d.ts +0 -189
  21. package/eslint.config.js +0 -37
  22. package/index.html +0 -14
  23. package/package-lock.json +0 -8276
  24. package/prettier.config.js +0 -20
  25. package/public/logo.svg +0 -660
  26. package/src/App.vue +0 -11
  27. package/src/api/date_utils.ts +0 -219
  28. package/src/api/finger_utils.ts +0 -71
  29. package/src/api/form_utils.ts +0 -281
  30. package/src/api/jquery.min.js +0 -2
  31. package/src/api/pcas-code.json +0 -1
  32. package/src/api/settings.ts +0 -81
  33. package/src/api/star_horse_apis.ts +0 -196
  34. package/src/api/star_horse_utils.ts +0 -797
  35. package/src/api/system.ts +0 -351
  36. package/src/api/user_func.ts +0 -147
  37. package/src/api/valid_utils.ts +0 -165
  38. package/src/assets/css/index.scss +0 -908
  39. package/src/assets/icons.css +0 -574
  40. package/src/assets/star-horse-icons.woff +0 -0
  41. package/src/components/comp/ShDynamicForm.vue +0 -160
  42. package/src/components/comp/ShForm.vue +0 -30
  43. package/src/components/comp/ShTableListColumn.vue +0 -61
  44. package/src/components/comp/StarHorseDataSelector.vue +0 -139
  45. package/src/components/comp/StarHorseDataView.vue +0 -110
  46. package/src/components/comp/StarHorseDataViewItems.vue +0 -61
  47. package/src/components/comp/StarHorseDataViewTable.vue +0 -102
  48. package/src/components/comp/StarHorseDialog.vue +0 -383
  49. package/src/components/comp/StarHorseDraggable.vue +0 -401
  50. package/src/components/comp/StarHorseForm.vue +0 -458
  51. package/src/components/comp/StarHorseFormItem.vue +0 -82
  52. package/src/components/comp/StarHorseFormList.vue +0 -516
  53. package/src/components/comp/StarHorseFormTable.vue +0 -56
  54. package/src/components/comp/StarHorseIcon.vue +0 -76
  55. package/src/components/comp/StarHorseItem.vue +0 -302
  56. package/src/components/comp/StarHorseJsonEditor.vue +0 -115
  57. package/src/components/comp/StarHorsePopover.vue +0 -66
  58. package/src/components/comp/StarHorseSearchComp.vue +0 -253
  59. package/src/components/comp/StarHorseStaticTable.vue +0 -395
  60. package/src/components/comp/StarHorseTableColumn.vue +0 -249
  61. package/src/components/comp/StarHorseTableComp.vue +0 -1193
  62. package/src/components/comp/StarHorseTableViewColumn.vue +0 -61
  63. package/src/components/comp/StarHorseTree.vue +0 -494
  64. package/src/components/comp/index.ts +0 -22
  65. package/src/components/comp/items/UTableColumn.vue +0 -65
  66. package/src/components/comp/items/boxItem.vue +0 -98
  67. package/src/components/comp/items/callitem.ts +0 -9
  68. package/src/components/comp/items/cardItem.vue +0 -152
  69. package/src/components/comp/items/collapseItem.vue +0 -134
  70. package/src/components/comp/items/dytableItem.vue +0 -135
  71. package/src/components/comp/items/otherItem.vue +0 -65
  72. package/src/components/comp/items/tabItem.vue +0 -155
  73. package/src/components/comp/items/tabPanelItem.vue +0 -110
  74. package/src/components/comp/items/tableColumn.vue +0 -129
  75. package/src/components/comp/items/tableItem.vue +0 -97
  76. package/src/components/comp/items/tablebtn.vue +0 -158
  77. package/src/components/comp/items/viewBoxItem.vue +0 -55
  78. package/src/components/comp/items/viewCardItem.vue +0 -47
  79. package/src/components/comp/items/viewCollapseItem.vue +0 -71
  80. package/src/components/comp/items/viewDytableItem.vue +0 -77
  81. package/src/components/comp/items/viewOtherItem.vue +0 -55
  82. package/src/components/comp/items/viewTabItem.vue +0 -77
  83. package/src/components/comp/items/viewTabPanelItem.vue +0 -54
  84. package/src/components/comp/items/viewTableItem.vue +0 -74
  85. package/src/components/comp/selfcomp.ts +0 -9
  86. package/src/components/comp/utils/DataPicker.vue +0 -302
  87. package/src/components/comp/utils/DataTag.vue +0 -51
  88. package/src/components/cron/Crontab-Day.vue +0 -230
  89. package/src/components/cron/Crontab-Hour.vue +0 -165
  90. package/src/components/cron/Crontab-Min.vue +0 -166
  91. package/src/components/cron/Crontab-Month.vue +0 -166
  92. package/src/components/cron/Crontab-Result.vue +0 -615
  93. package/src/components/cron/Crontab-Second.vue +0 -185
  94. package/src/components/cron/Crontab-Week.vue +0 -208
  95. package/src/components/cron/Crontab-Year.vue +0 -183
  96. package/src/components/cron/Crontab.vue +0 -474
  97. package/src/components/enums/ModuleEnums.ts +0 -10
  98. package/src/components/enums/ServiceEnums.ts +0 -18
  99. package/src/components/formcomp/container/box-container.vue +0 -162
  100. package/src/components/formcomp/container/callitem.ts +0 -9
  101. package/src/components/formcomp/container/card-container.vue +0 -170
  102. package/src/components/formcomp/container/collapse-container.vue +0 -133
  103. package/src/components/formcomp/container/dytable-col.vue +0 -448
  104. package/src/components/formcomp/container/dytable-container.vue +0 -57
  105. package/src/components/formcomp/container/dytableUtils.ts +0 -358
  106. package/src/components/formcomp/container/group-box-container.vue +0 -331
  107. package/src/components/formcomp/container/index.ts +0 -6
  108. package/src/components/formcomp/container/tab-container.vue +0 -153
  109. package/src/components/formcomp/container/table-container.vue +0 -249
  110. package/src/components/formcomp/items/allitem.ts +0 -9
  111. package/src/components/formcomp/items/area-item.vue +0 -116
  112. package/src/components/formcomp/items/audio-item.vue +0 -163
  113. package/src/components/formcomp/items/autocomplete-item.vue +0 -118
  114. package/src/components/formcomp/items/barcode-item.vue +0 -87
  115. package/src/components/formcomp/items/base-json-item.vue +0 -207
  116. package/src/components/formcomp/items/button-item.vue +0 -228
  117. package/src/components/formcomp/items/cascade-item.vue +0 -113
  118. package/src/components/formcomp/items/checkbox-item.vue +0 -97
  119. package/src/components/formcomp/items/color-item.vue +0 -70
  120. package/src/components/formcomp/items/cron-item.vue +0 -115
  121. package/src/components/formcomp/items/datetime-item.vue +0 -99
  122. package/src/components/formcomp/items/depart-item.vue +0 -51
  123. package/src/components/formcomp/items/dialog-input-item.vue +0 -207
  124. package/src/components/formcomp/items/divider-item.vue +0 -66
  125. package/src/components/formcomp/items/html-item.vue +0 -65
  126. package/src/components/formcomp/items/htmleditor-item.vue +0 -104
  127. package/src/components/formcomp/items/icon-item.vue +0 -195
  128. package/src/components/formcomp/items/image-item.vue +0 -247
  129. package/src/components/formcomp/items/index.ts +0 -44
  130. package/src/components/formcomp/items/input-item.vue +0 -150
  131. package/src/components/formcomp/items/json-array-item.vue +0 -67
  132. package/src/components/formcomp/items/json-item.vue +0 -66
  133. package/src/components/formcomp/items/markdown-item.vue +0 -77
  134. package/src/components/formcomp/items/number-item.vue +0 -94
  135. package/src/components/formcomp/items/number-range-item.vue +0 -278
  136. package/src/components/formcomp/items/page-select-item.vue +0 -407
  137. package/src/components/formcomp/items/password-item.vue +0 -71
  138. package/src/components/formcomp/items/qrcode-item.vue +0 -84
  139. package/src/components/formcomp/items/radio-item.vue +0 -112
  140. package/src/components/formcomp/items/rate-item.vue +0 -68
  141. package/src/components/formcomp/items/select-item.vue +0 -133
  142. package/src/components/formcomp/items/signature-item.vue +0 -216
  143. package/src/components/formcomp/items/slider-item.vue +0 -68
  144. package/src/components/formcomp/items/starhorse-form-item.vue +0 -334
  145. package/src/components/formcomp/items/switch-item.vue +0 -77
  146. package/src/components/formcomp/items/tag-item.vue +0 -77
  147. package/src/components/formcomp/items/text-item.vue +0 -75
  148. package/src/components/formcomp/items/textarea-item.vue +0 -85
  149. package/src/components/formcomp/items/time-item.vue +0 -77
  150. package/src/components/formcomp/items/time-picker-item.vue +0 -74
  151. package/src/components/formcomp/items/transfer-item.vue +0 -93
  152. package/src/components/formcomp/items/tselect-item.vue +0 -121
  153. package/src/components/formcomp/items/unknown-item.vue +0 -51
  154. package/src/components/formcomp/items/upload-item.vue +0 -189
  155. package/src/components/formcomp/items/user-item.vue +0 -177
  156. package/src/components/formcomp/items/usercomp-item.vue +0 -85
  157. package/src/components/formcomp/items/view-markdown-item.vue +0 -77
  158. package/src/components/formcomp/utils/EditDataDialog.vue +0 -67
  159. package/src/components/formcomp/utils/FieldList.vue +0 -125
  160. package/src/components/formcomp/utils/ItemRelationEventUtils.ts +0 -284
  161. package/src/components/help.vue +0 -31
  162. package/src/components/menu/MenuItem.vue +0 -95
  163. package/src/components/menu/SubMenu.vue +0 -68
  164. package/src/components/menu/SubSystemMenu.vue +0 -142
  165. package/src/components/register.ts +0 -24
  166. package/src/components/system/ContentMenu.vue +0 -260
  167. package/src/components/system/StarHorseButtonList.vue +0 -344
  168. package/src/components/system/StarHorseMenu.vue +0 -97
  169. package/src/components/system/StarHorseSvg.vue +0 -62
  170. package/src/components/system/SystemComp.ts +0 -9
  171. package/src/components/system/index.ts +0 -4
  172. package/src/components/types/ApiUrls.ts +0 -168
  173. package/src/components/types/BtnAction.ts +0 -51
  174. package/src/components/types/BtnAuth.ts +0 -43
  175. package/src/components/types/CompInfo.ts +0 -81
  176. package/src/components/types/DialogProps.ts +0 -55
  177. package/src/components/types/DyCompField.ts +0 -23
  178. package/src/components/types/DynamicNode.ts +0 -42
  179. package/src/components/types/MenusInfo.ts +0 -45
  180. package/src/components/types/PageFieldInfo.ts +0 -530
  181. package/src/components/types/PageProps.ts +0 -25
  182. package/src/components/types/Params.ts +0 -93
  183. package/src/components/types/RuleType.ts +0 -10
  184. package/src/components/types/SearchProps.ts +0 -42
  185. package/src/components/types/ShortKey.ts +0 -30
  186. package/src/components/types/StarHorseType.ts +0 -18
  187. package/src/components/types/index.ts +0 -15
  188. package/src/config/element.ts +0 -15
  189. package/src/config/styles.ts +0 -4
  190. package/src/index.ts +0 -98
  191. package/src/install.ts +0 -33
  192. package/src/lang/en_US.ts +0 -81
  193. package/src/lang/index.ts +0 -35
  194. package/src/lang/zh_CN.ts +0 -84
  195. package/src/main.ts +0 -57
  196. package/src/plugins/AblesPlugin.ts +0 -618
  197. package/src/plugins/registerCompPlugin.ts +0 -15
  198. package/src/sample/test.vue +0 -9
  199. package/src/store/ButtonPermission.ts +0 -101
  200. package/src/store/ConsumerView.ts +0 -52
  201. package/src/store/ContinusConfig.ts +0 -78
  202. package/src/store/CopyerOperation.ts +0 -74
  203. package/src/store/DesignForm.ts +0 -481
  204. package/src/store/DesignPage.ts +0 -59
  205. package/src/store/DynamicForm.ts +0 -241
  206. package/src/store/GlobalConfig.ts +0 -90
  207. package/src/store/SelfOperation.ts +0 -95
  208. package/src/store/UserInfo.ts +0 -88
  209. package/src/store/index.ts +0 -6
  210. package/src/theme/localStorge.ts +0 -16
  211. package/src/theme/theme.ts +0 -27
  212. package/src/utils/FieldOperationUtils.ts +0 -91
  213. package/src/utils/auth.ts +0 -83
  214. package/src/utils/message.ts +0 -69
  215. package/src/utils/preview.ts +0 -125
  216. package/tsconfig.json +0 -39
  217. package/tsconfig.node.json +0 -10
  218. package/vite-env.d.ts +0 -16
  219. package/vite.config.ts +0 -162
  220. package/yarn.lock +0 -4627
@@ -1,207 +0,0 @@
1
- <script setup lang="ts">
2
- import { nextTick, onMounted, PropType, ref, shallowRef } from "vue";
3
- import { warning } from "@/utils/message";
4
- import { FieldInfo, FieldMapping } from "@/components/types/PageFieldInfo";
5
- import { isJson } from "@/api/star_horse_utils";
6
- import {
7
- allAction,
8
- checkIsDisabled,
9
- initCompCallEvent,
10
- } from "@/components/formcomp/utils/ItemRelationEventUtils";
11
- import { SearchFields } from "@/components/types";
12
- import { getDynamicEvents } from "@/api/system";
13
-
14
- const props = defineProps({
15
- isDesign: {
16
- type: Boolean,
17
- default: false,
18
- },
19
- disabled: {
20
- type: Boolean,
21
- default: false,
22
- },
23
- showFormItem: {
24
- type: Boolean,
25
- default: false,
26
- },
27
- bareFlag: {
28
- type: Boolean,
29
- default: false,
30
- },
31
- isSearch: {
32
- type: Boolean,
33
- default: false,
34
- },
35
- field: {
36
- type: Object as PropType<any>,
37
- required: true,
38
- },
39
- parentField: {
40
- type: Object as PropType<any>,
41
- },
42
- formInfo: {
43
- type: Object as PropType<any>,
44
- },
45
- });
46
- const emits = defineEmits(["selfFunc", "selectItem"]);
47
- const formData = defineModel("formData");
48
- const dialogInputTableRef = ref();
49
- let dialogInputVisible = shallowRef(false);
50
- const itemAction = (prep: any) => {
51
- allAction(props, emits, formData, prep);
52
- };
53
- const selectItem = (row: any) => {
54
- let data = "";
55
- let needField = props.field.preps?.needField;
56
- if (!row || !isJson(row)) {
57
- let selectDatas = dialogInputTableRef.value.multipleSelection;
58
- if (!selectDatas) {
59
- warning("请选择数据");
60
- return;
61
- }
62
- data = selectDatas[0];
63
- } else {
64
- data = row;
65
- }
66
- //如果没有指定属性,则默认取相同的属性
67
- let name = props.field.fieldName;
68
- if (!needField) {
69
- formData.value[name] = data[name];
70
- } else {
71
- needField.forEach((item: FieldMapping) => {
72
- if (needField.length == 1) {
73
- formData.value[name] = data[item.sourceField];
74
- } else {
75
- formData.value[item.distField] = data[item.sourceField];
76
- }
77
- });
78
- }
79
- if (props.field.preps?.recall) {
80
- props.field.preps?.["recall"](row);
81
- }
82
- closeAction();
83
- };
84
- const closeAction = () => {
85
- dialogInputVisible.value = false;
86
- };
87
- const showVisible = () => {
88
- dialogInputVisible.value = true;
89
- nextTick(() => {
90
- let fields = props.field.preps?.needField;
91
- let name = props.field.fieldName;
92
- let realName = name;
93
- if (props.field.aliasName) {
94
- realName = props.field?.aliasName;
95
- }
96
- if (fields) {
97
- name = fields.map((item: FieldMapping) => item.sourceField)[0];
98
- }
99
- dialogInputTableRef.value?.setDataInfo(name, formData.value[realName]);
100
- });
101
- };
102
-
103
- onMounted(async () => {
104
- await nextTick();
105
- let inputPreps = props.field?.preps;
106
- if (!inputPreps) {
107
- warning("属性" + props.field?.label + "需要配置params 信息");
108
- return;
109
- }
110
- if (inputPreps.searchFieldList?.length === 0) {
111
- let searchFieldList: Array<SearchFields> = [];
112
- inputPreps.fieldList?.forEach((item: FieldInfo) => {
113
- if (item.searchVisible) {
114
- let temp: any = {
115
- ...item,
116
- };
117
- if (item.prefix) {
118
- temp["fieldName"] = item.prefix + "." + temp["fieldName"];
119
- }
120
- temp["defaultVisible"] = true;
121
- if (item?.type == "input" && !item["matchType"]) {
122
- temp["matchType"] = "lk";
123
- }
124
- searchFieldList.push(temp);
125
- }
126
- });
127
- inputPreps.searchFieldList = { fieldList: searchFieldList };
128
- }
129
- initCompCallEvent(props, emits, formData);
130
- });
131
- </script>
132
- <template>
133
- <star-horse-dialog
134
- :title="field.label + '数据选择'"
135
- :self-func="true"
136
- :dialog-visible="dialogInputVisible"
137
- @merge="selectItem"
138
- @closeAction="closeAction"
139
- >
140
- <el-card class="inner_content">
141
- <div class="search-content">
142
- <div class="search_btn">
143
- <star-horse-search-comp
144
- @searchData="
145
- (data: any) => dialogInputTableRef.createSearchParams(data)
146
- "
147
- :formData="field.preps?.['searchFieldList']"
148
- :compUrl="field.preps?.['dataUrl']"
149
- />
150
- </div>
151
- </div>
152
- <star-horse-table-comp
153
- :fieldList="{
154
- cellEditable: false,
155
- fieldList: field.preps?.['fieldList'],
156
- }"
157
-
158
- :primaryKey="field.preps?.['primaryKey']"
159
- :compUrl="field.preps?.['dataUrl']"
160
- ref="dialogInputTableRef"
161
- :dialogInput="true"
162
- height="400px"
163
- :filterCondition="field.preps?.['filterCondition']"
164
- :orderBy="field.preps?.['orderBy']"
165
- @selectItem="selectItem"
166
- :dataFormat="field.preps?.['dataFormat']"
167
- :disableAction="true"
168
- />
169
- </el-card>
170
- </star-horse-dialog>
171
- <starhorse-form-item
172
- :showFormItem="showFormItem"
173
- :isDesign="isDesign"
174
- :disabled="disabled"
175
- :bareFlag="bareFlag"
176
- :formItem="field"
177
- :parentField="parentField"
178
- >
179
- <el-input
180
- :disabled="checkIsDisabled(props)"
181
- type="text"
182
- v-bind="field.preps"
183
- :fid="field.fieldName"
184
- v-on="getDynamicEvents(props, itemAction)"
185
- v-model="formData[field.fieldName]"
186
- >
187
- <template #append>
188
- <el-button
189
- icon="Search"
190
- @click="showVisible"
191
- :disabled="checkIsDisabled(props)"
192
- />
193
- </template>
194
- </el-input>
195
- </starhorse-form-item>
196
- </template>
197
- <style lang="scss" scoped>
198
- :deep(.el-input-group__append) {
199
- padding: 0 20px !important;
200
- }
201
-
202
- .cell.el-tooltip {
203
- display: flex;
204
- align-items: center;
205
- justify-content: center;
206
- }
207
- </style>
@@ -1,66 +0,0 @@
1
- <template>
2
- <starhorse-form-item
3
- :showFormItem="showFormItem"
4
- :isDesign="isDesign"
5
- :disabled="disabled"
6
- :bareFlag="bareFlag"
7
- :formItem="field"
8
- :parentField="parentField"
9
- >
10
- <el-divider
11
- :direction="field.preps?.direction || 'horizontal'"
12
- v-on="getDynamicEvents(props, itemAction)"
13
- :content-position="field.preps?.contentPosition || 'center'"
14
- >
15
- {{ field.preps?.content }}
16
- </el-divider>
17
- </starhorse-form-item>
18
- </template>
19
- <script setup lang="ts">
20
- import { onMounted, PropType } from "vue";
21
- import { allAction } from "@/components/formcomp/utils/ItemRelationEventUtils";
22
- import { getDynamicEvents } from "@/api/system";
23
-
24
- const props = defineProps({
25
- isDesign: {
26
- type: Boolean,
27
- default: false,
28
- },
29
- disabled: {
30
- type: Boolean,
31
- default: false,
32
- },
33
- showFormItem: {
34
- type: Boolean,
35
- default: false,
36
- },
37
- bareFlag: {
38
- type: Boolean,
39
- default: false,
40
- },
41
- isSearch: {
42
- type: Boolean,
43
- default: false,
44
- },
45
- field: {
46
- type: Object as PropType<any>,
47
- required: true,
48
- },
49
- parentField: {
50
- type: Object as PropType<any>,
51
- },
52
- formInfo: {
53
- type: Object as PropType<any>,
54
- },
55
- });
56
- const emits = defineEmits(["selfFunc", "selectItem"]);
57
- const formData = defineModel("formData");
58
-
59
- const itemAction = (prep: any) => {
60
- allAction(props, emits, formData, prep);
61
- };
62
- onMounted(() => {
63
- formData.value[props.field.fieldName] = props.field.preps?.content;
64
- });
65
- </script>
66
- <style scoped></style>
@@ -1,65 +0,0 @@
1
- <template>
2
- <starhorse-form-item
3
- :showFormItem="showFormItem"
4
- :isDesign="isDesign"
5
- :disabled="disabled"
6
- :bareFlag="bareFlag"
7
- :formItem="field"
8
- :parentField="parentField"
9
- >
10
- <div
11
- class="user_html"
12
- v-html="formData[field.fieldName] || field.preps?.content"
13
- />
14
- </starhorse-form-item>
15
- </template>
16
- <script setup lang="ts">
17
- import { onMounted, PropType } from "vue";
18
-
19
- const props = defineProps({
20
- isDesign: {
21
- type: Boolean,
22
- default: false,
23
- },
24
- disabled: {
25
- type: Boolean,
26
- default: false,
27
- },
28
- showFormItem: {
29
- type: Boolean,
30
- default: false,
31
- },
32
- bareFlag: {
33
- type: Boolean,
34
- default: false,
35
- },
36
- isSearch: {
37
- type: Boolean,
38
- default: false,
39
- },
40
- field: {
41
- type: Object as PropType<any>,
42
- required: true,
43
- },
44
- parentField: {
45
- type: Object as PropType<any>,
46
- },
47
- formInfo: {
48
- type: Object as PropType<any>,
49
- },
50
- });
51
- const emits = defineEmits(["selfFunc", "selectItem"]);
52
- const formData = defineModel("formData");
53
-
54
- onMounted(() => {
55
- formData.value[props.field.fieldName] =
56
- formData.value[props.field.fieldName] || props.field.preps?.content;
57
- });
58
- </script>
59
- <style lang="scss" scoped>
60
- .user_html {
61
- width: 100%;
62
- min-height: 30px;
63
- height: auto;
64
- }
65
- </style>
@@ -1,104 +0,0 @@
1
- <template>
2
- <starhorse-form-item
3
- :showFormItem="showFormItem"
4
- :isDesign="isDesign"
5
- :disabled="disabled"
6
- :bareFlag="bareFlag"
7
- :formItem="field"
8
- :parentField="parentField"
9
- >
10
- <div style="border: 1px solid #ccc">
11
- <QuillEditor
12
- :style="{
13
- height: field.preps?.height || '300px',
14
- 'overflow-y': 'hidden',
15
- }"
16
- :modules="modules"
17
- v-on="getDynamicEvents(props, itemAction)"
18
- v-model="formData[field.fieldName]"
19
- theme="snow"
20
- toolbar="full"
21
- :fid="field.fieldName"
22
- @onCreated="handleCreated"
23
- />
24
- </div>
25
- </starhorse-form-item>
26
- </template>
27
- <script setup lang="ts">
28
- import { onMounted, PropType, shallowRef } from "vue";
29
- import { QuillEditor } from "@vueup/vue-quill";
30
- import "@vueup/vue-quill/dist/vue-quill.snow.css";
31
- import { allAction } from "@/components/formcomp/utils/ItemRelationEventUtils";
32
- import { postRequest } from "@/api/star_horse_apis";
33
- import ImageUploader from "quill-image-uploader";
34
- import { getDynamicEvents } from "@/api/system";
35
-
36
- const props = defineProps({
37
- isDesign: {
38
- type: Boolean,
39
- default: false,
40
- },
41
- disabled: {
42
- type: Boolean,
43
- default: false,
44
- },
45
- showFormItem: {
46
- type: Boolean,
47
- default: false,
48
- },
49
- bareFlag: {
50
- type: Boolean,
51
- default: false,
52
- },
53
- isSearch: {
54
- type: Boolean,
55
- default: false,
56
- },
57
- field: {
58
- type: Object as PropType<any>,
59
- required: true,
60
- },
61
- parentField: {
62
- type: Object as PropType<any>,
63
- },
64
- formInfo: {
65
- type: Object as PropType<any>,
66
- },
67
- });
68
- const emits = defineEmits(["selfFunc", "selectItem"]);
69
- const formData = defineModel("formData");
70
-
71
- const editorRef = shallowRef(); // 编辑器实例,必须用 shallowRef
72
-
73
- const itemAction = (prep: any) => {
74
- allAction(props, emits, formData, prep);
75
- };
76
-
77
- const handleCreated = (editor: any) => {
78
- editorRef.value = editor; // 记录 editor 实例,重要!
79
- };
80
- const modules: any = {
81
- name: "imageUploader",
82
- module: ImageUploader,
83
- options: {
84
- upload: (file) => {
85
- return new Promise((resolve, reject) => {
86
- const formData = new FormData();
87
- formData.append("image", file);
88
-
89
- postRequest("/upload-image", formData)
90
- .then((res) => {
91
- console.log(res);
92
- resolve(res.data.url);
93
- })
94
- .catch((err) => {
95
- reject("Upload failed");
96
- console.error("Error:", err);
97
- });
98
- });
99
- },
100
- },
101
- };
102
- onMounted(() => {});
103
- </script>
104
- <style scoped></style>
@@ -1,195 +0,0 @@
1
- <template>
2
- <starhorse-form-item
3
- :showFormItem="showFormItem"
4
- :isDesign="isDesign"
5
- :disabled="disabled"
6
- :bareFlag="bareFlag"
7
- :formItem="field"
8
- :parentField="parentField"
9
- >
10
- <el-popover
11
- :popper-style="{ width: 'inherit !important' }"
12
- ref="popoverRef"
13
- :placement="field.preps?.placement ?? 'bottom-start'"
14
- :disabled="checkIsDisabled(props) || field.preps?.listView"
15
- trigger="click"
16
- >
17
- <template #reference>
18
- <el-avatar
19
- v-if="iconType == 'system'"
20
- fit="fill"
21
- shape="square"
22
- :style="{
23
- 'font-size': field.preps?.listView ? '22px' : '24px',
24
- background: field.preps?.listView
25
- ? 'unset'
26
- : 'var(--el-avatar-bg-color)',
27
- }"
28
- :icon="formData[field.fieldName]"
29
- />
30
- <star-horse-icon
31
- :icon-class="formData[field.fieldName]"
32
- v-else
33
- size="30px"
34
- style="
35
- color: var(--star-horse-style);
36
- border-radius: 3px;
37
- border: 1px solid var(--star-horse-light-gray);
38
- "
39
- cursor="pointer"
40
- />
41
- </template>
42
- <div class="icon-items">
43
- <div class="search-box">
44
- <el-input
45
- v-model="searchName"
46
- @keydown.enter="dataSearch"
47
- clearable
48
- placeholder="请输入要搜索的图标"
49
- >
50
- <template #prefix>
51
- <star-horse-icon icon-class="search" @click="dataSearch" />
52
- </template>
53
- </el-input>
54
- </div>
55
- <ul class="system-icon">
56
- <li
57
- v-for="sdata in iconList"
58
- @click="assignIcon(sdata.value)"
59
- :title="sdata.name"
60
- :key="sdata.value"
61
- :class="{ 'icon-active': sdata.value == formData[field.fieldName] }"
62
- >
63
- <el-icon
64
- class="star-icon"
65
- style="font-size: 35px; color: var(--star-horse-style)"
66
- v-if="iconType == 'system'"
67
- >
68
- <component :is="sdata.value" :key="sdata.value + '_comp'" />
69
- </el-icon>
70
- <star-horse-icon
71
- :icon-class="sdata.value"
72
- v-else
73
- size="30px"
74
- width="30px"
75
- height="30px"
76
- style="color: var(--star-horse-style)"
77
- cursor="pointer"
78
- />
79
- </li>
80
- </ul>
81
- </div>
82
- </el-popover>
83
- </starhorse-form-item>
84
- </template>
85
- <script setup lang="ts">
86
- import { onMounted, PropType, ref, shallowRef, unref, watch } from "vue";
87
- import {
88
- checkIsDisabled,
89
- initCompCallEvent,
90
- } from "@/components/formcomp/utils/ItemRelationEventUtils";
91
- import StarHorseIcon from "@/components/comp/StarHorseIcon.vue";
92
- import StarhorseFormItem from "@/components/formcomp/items/starhorse-form-item.vue";
93
- import { compDynamicData } from "@/api/star_horse_utils";
94
-
95
- const props = defineProps({
96
- isDesign: {
97
- type: Boolean,
98
- default: false,
99
- },
100
- disabled: {
101
- type: Boolean,
102
- default: false,
103
- },
104
- showFormItem: {
105
- type: Boolean,
106
- default: false,
107
- },
108
- bareFlag: {
109
- type: Boolean,
110
- default: false,
111
- },
112
- isSearch: {
113
- type: Boolean,
114
- default: false,
115
- },
116
- field: {
117
- type: Object as PropType<any>,
118
- required: true,
119
- },
120
- parentField: {
121
- type: Object as PropType<any>,
122
- },
123
- formInfo: {
124
- type: Object as PropType<any>,
125
- },
126
- });
127
- const emits = defineEmits(["selfFunc", "selectItem"]);
128
- const formData = defineModel("formData");
129
-
130
- let searchName = ref<string>("");
131
- let iconList = ref<any>([]);
132
- let allIconList = ref<any>([]);
133
- let iconType = ref<string>("system");
134
- const popoverRef = shallowRef();
135
- const assignIcon = (iconName: string) => {
136
- formData.value[props.field.fieldName] = iconName;
137
- unref(popoverRef).popperRef?.delayHide?.();
138
- itemAction("blur");
139
- };
140
- const dataSearch = () => {
141
- if (!searchName.value) {
142
- iconList.value = allIconList.value;
143
- } else {
144
- iconList.value = allIconList.value.filter((item: any) => {
145
- return (
146
- item.name.toLowerCase().indexOf(searchName.value.toLowerCase()) > -1
147
- );
148
- });
149
- }
150
- };
151
- const itemAction = (prep: any) => {
152
- if (Object.keys(props.field.actions ?? {}).includes("change")) {
153
- emits("selfFunc", prep, formData.value);
154
- }
155
- };
156
- const init = async () => {
157
- const dataa = await compDynamicData(props.field);
158
- if (dataa?.length) {
159
- allIconList.value = dataa;
160
- }
161
- iconType.value = props.field.preps?.iconType ?? "system";
162
- iconList.value = allIconList.value;
163
- };
164
- onMounted(() => {
165
- init();
166
- initCompCallEvent(props, emits, formData);
167
- });
168
- watch(
169
- () => formData.value[props.field.fieldName],
170
- (newVal, oldVal) => {
171
- itemAction("change");
172
- },
173
- );
174
- </script>
175
- <style scoped>
176
- .icon-items {
177
- width: 100%;
178
- display: flex;
179
- flex-direction: column;
180
-
181
- .system-icon {
182
- margin-top: 5px;
183
- justify-content: center;
184
-
185
- li {
186
- margin: 1px;
187
- }
188
- }
189
- }
190
-
191
- .search-box {
192
- width: 90%;
193
- margin: 0 auto;
194
- }
195
- </style>