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,155 @@
1
+ <script setup lang="ts">
2
+ import { ModelRef, onMounted, PropType } from "vue";
3
+ import { ApiUrls } from "@/components/types/ApiUrls";
4
+ import { FieldInfo } from "@/components/types/PageFieldInfo";
5
+ import StarHorseFormTable from "@/components/comp/StarHorseFormTable.vue";
6
+ import { Config } from "@/api/settings";
7
+ import { compKey } from "@/api/system";
8
+
9
+ const props = defineProps({
10
+ compUrl: { type: Object as PropType<ApiUrls> },
11
+ item: { type: Array as PropType<any>, required: true },
12
+ objectName: { type: String },
13
+ // 数据索引
14
+ dataIndex: { type: Number, default: -1 },
15
+ // 父节点名称
16
+ propPrefix: { type: String, default: "" },
17
+ parentPreps: { type: Object, default: {} },
18
+ subFormFlag: { type: String, default: "N" },
19
+ batchName: { type: String, default: "batchDataList" },
20
+ batchFieldName: { type: String, default: "batchFieldList" },
21
+ primaryKey: { type: [String, Object] as PropType<string | any> },
22
+ rules: { type: Object },
23
+ compSize: { type: String, default: Config.compSize },
24
+ source: { type: Number, default: 1 },
25
+ });
26
+ const emits = defineEmits(["addRow", "removeRow"]);
27
+ const dataForm: ModelRef<any> = defineModel("dataForm");
28
+
29
+ /**
30
+ * 列表添加行数据
31
+ * @param row
32
+ */
33
+ const addRow = (row: any) => {
34
+ emits("addRow", row);
35
+ };
36
+ const closeOperation = (tabName: any) => {
37
+ props.item.tabList?.forEach((item: any, index: number) => {
38
+ if (item.tabName == tabName) {
39
+ props.item.tabList.splice(index, 1);
40
+ props.item.fieldName = props.item.tabList[0]?.tabName;
41
+ let closeAction = props.item.closeAction;
42
+ closeAction && closeAction(item);
43
+ return false;
44
+ }
45
+ });
46
+ };
47
+ /**
48
+ * 列表删除行数据
49
+ * @param row
50
+ */
51
+ const removeRow = (row: any) => {
52
+ emits("removeRow", row);
53
+ };
54
+ const init = () => {};
55
+ onMounted(() => {
56
+ init();
57
+ });
58
+ </script>
59
+
60
+ <template>
61
+ <template v-if="item.tabList?.length > 0">
62
+ <el-tabs
63
+ v-model="item.fieldName"
64
+ :type="item.type || ''"
65
+ @tabRemove="closeOperation"
66
+ :closable="item.closable"
67
+ :addable="item.addable"
68
+ @tabChange="item.actions"
69
+ @tabAdd="item.addActions"
70
+ >
71
+ <template
72
+ v-for="(tabItem, key) in item.tabList"
73
+ :key="compKey(tabItem, key)"
74
+ >
75
+ <tabPanelItem
76
+ :item="tabItem"
77
+ :dataIndex="dataIndex"
78
+ :itemKey="key"
79
+ :source="source"
80
+ parentType="tab"
81
+ :compUrl="compUrl"
82
+ :compSize="compSize"
83
+ :propPrefix="propPrefix"
84
+ @addRow="addRow"
85
+ v-model:dataForm="dataForm"
86
+ @removeRow="removeRow"
87
+ :rules="rules"
88
+ />
89
+ </template>
90
+ </el-tabs>
91
+ </template>
92
+ <template v-else-if="item.batchFieldList?.length > 0">
93
+ <template
94
+ v-if="
95
+ item.batchFieldList.length > 1 &&
96
+ (!item.displayStyle || item.displayStyle == 'tab')
97
+ "
98
+ >
99
+ <el-tabs v-model="item.fieldName" :type="item.type || ''">
100
+ <template
101
+ v-for="(sitem, key) in item.batchFieldList"
102
+ :key="compKey(sitem, key)"
103
+ >
104
+ <tabPanelItem
105
+ :item="sitem"
106
+ :dataIndex="dataIndex"
107
+ :itemKey="key"
108
+ :source="source"
109
+ :compUrl="compUrl"
110
+ :compSize="compSize"
111
+ parentType="batch"
112
+ :propPrefix="propPrefix"
113
+ @addRow="addRow"
114
+ v-model:dataForm="dataForm"
115
+ @removeRow="removeRow"
116
+ :rules="rules"
117
+ />
118
+ </template>
119
+ </el-tabs>
120
+ </template>
121
+ <template
122
+ v-else
123
+ v-for="(temp, key) in item.batchFieldList"
124
+ :key="compKey(temp, key)"
125
+ >
126
+ <star-horse-form-table
127
+ :rules="rules"
128
+ :size="compSize"
129
+ :item="temp"
130
+ @addRow="addRow"
131
+ @removeRow="removeRow"
132
+ v-if="Object.keys(temp).length > 0"
133
+ v-model:dataForm="dataForm"
134
+ />
135
+ </template>
136
+ </template>
137
+ </template>
138
+
139
+ <style scoped lang="scss">
140
+ :deep(.el-tabs__content) {
141
+ height: 100% !important;
142
+ flex: 1;
143
+ overflow: auto;
144
+ }
145
+
146
+ :deep(.el-scrollbar__view) {
147
+ display: flex;
148
+ flex-direction: column;
149
+ height: 100%;
150
+ }
151
+
152
+ :deep(.el-tabs) {
153
+ overflow: auto !important;
154
+ }
155
+ </style>
@@ -0,0 +1,110 @@
1
+ <script setup lang="ts">
2
+ import { ModelRef, onMounted, PropType } from "vue";
3
+ import { ApiUrls } from "@/components/types/ApiUrls";
4
+ import { FieldInfo } from "@/components/types/PageFieldInfo";
5
+ import { Config } from "@/api/settings";
6
+ import { getDataIndex, getFormData, getPrefix } from "@/api/form_utils";
7
+ defineProps({
8
+ compUrl: { type: Object as PropType<ApiUrls> },
9
+ item: { type: Array as PropType<Array<FieldInfo> | any>, required: true },
10
+ // 数据索引
11
+ dataIndex: { type: Number, default: -1 },
12
+ itemKey: { type: [Number, String], default: 0 },
13
+ // 父节点名称
14
+ propPrefix: { type: String, default: "" },
15
+ rules: { type: Object },
16
+ compSize: { type: String, default: Config.compSize },
17
+ source: { type: Number, default: 1 },
18
+ parentType: { type: String, default: "" },
19
+ });
20
+ const emits = defineEmits(["addRow", "removeRow"]);
21
+ const dataForm: ModelRef<any> = defineModel("dataForm");
22
+
23
+ /**
24
+ * 列表添加行数据
25
+ * @param row
26
+ */
27
+ const addRow = (row: any) => {
28
+ emits("addRow", row);
29
+ };
30
+ /**
31
+ * 列表删除行数据
32
+ * @param row
33
+ */
34
+ const removeRow = (row: any) => {
35
+ emits("removeRow", row);
36
+ };
37
+ const init = () => {};
38
+ onMounted(() => {
39
+ init();
40
+ });
41
+ </script>
42
+
43
+ <template>
44
+ <el-tab-pane
45
+ v-if="item['disVisible'] ?? Object.keys(item).length > 0"
46
+ :label="item['title']"
47
+ :name="item.tabName || 'tab' + itemKey"
48
+ :disabled="item.disabled"
49
+ class="h-full flex flex-col"
50
+ >
51
+ <template #label>
52
+ <div class="custom-tabs-label">
53
+ <star-horse-icon :icon-class="item.icon" v-if="item.icon" />
54
+ <span>{{ item.title }}</span>
55
+ </div>
56
+ </template>
57
+ <template
58
+ v-if="
59
+ (parentType == 'tab' && item.tableFlag != 'Y') || item.formFlag == 'Y'
60
+ "
61
+ >
62
+ <el-scrollbar height="100%">
63
+ <star-horse-form-item
64
+ :source="source"
65
+ :compUrl="compUrl"
66
+ :compSize="compSize"
67
+ @addRow="addRow"
68
+ @removeRow="removeRow"
69
+ :objectName="item.objectName"
70
+ :dataForm="
71
+ getFormData(item, dataForm, propPrefix, dataIndex, itemKey)
72
+ "
73
+ :dataIndex="getDataIndex(item, propPrefix, dataIndex, itemKey)"
74
+ :propPrefix="getPrefix(item, propPrefix, dataIndex, itemKey)"
75
+ :fieldList="{ ...item }"
76
+ :rules="rules"
77
+ :subFormFlag="item.subFormFlag"
78
+ :primaryKey="item.primaryKey"
79
+ />
80
+ </el-scrollbar>
81
+ </template>
82
+ <star-horse-form-table
83
+ v-else-if="parentType == 'batch' || item.tableFlag == 'Y'"
84
+ :size="compSize"
85
+ @addRow="addRow"
86
+ @removeRow="removeRow"
87
+ :rules="rules"
88
+ :item="item"
89
+ v-model:dataForm="dataForm"
90
+ />
91
+ </el-tab-pane>
92
+ </template>
93
+
94
+ <style scoped lang="scss">
95
+ :deep(.el-tabs__content) {
96
+ height: 100% !important;
97
+ flex: 1;
98
+ overflow: auto;
99
+ }
100
+
101
+ :deep(.el-scrollbar__view) {
102
+ display: flex;
103
+ flex-direction: column;
104
+ height: 100%;
105
+ }
106
+
107
+ :deep(.el-tabs) {
108
+ overflow: auto !important;
109
+ }
110
+ </style>
@@ -0,0 +1,129 @@
1
+ <script setup lang="ts">
2
+ import { PropType } from "vue";
3
+ import { ApiUrls } from "@/components/types/ApiUrls";
4
+ import { Config } from "@/api/settings";
5
+ import { compKey } from "@/api/system";
6
+
7
+ defineProps({
8
+ //url地址
9
+ compUrl: { type: Object as PropType<ApiUrls>, required: true },
10
+ //列名
11
+ fieldList: { type: Object, required: true },
12
+ //格式化方法
13
+ dataFormat: { type: Function, default: null },
14
+ //是否显示排序
15
+ sortable: { type: Boolean, default: true },
16
+ //是否显示批量属性
17
+ showBatchField: { type: Boolean, default: false },
18
+ compSize: { type: String, default: Config.compSize },
19
+ //全局配置,动态页面使用
20
+ globalConfig: { type: Object as PropType<any>, required: false },
21
+ //是否动态页面
22
+ isDynamic: { type: Boolean, default: false },
23
+ });
24
+ </script>
25
+ <template>
26
+ <template
27
+ v-for="(item, index) in fieldList?.fieldList"
28
+ :key="compKey(item, index)"
29
+ >
30
+ <template v-if="Array.isArray(item)">
31
+ <star-horse-table-column
32
+ :data-format="dataFormat"
33
+ :cellEditable="fieldList['cellEditable']"
34
+ :item="sitem"
35
+ :globalConfig="globalConfig"
36
+ :isDynamic="isDynamic"
37
+ :sortable="sortable"
38
+ :compSize="compSize"
39
+ :compUrl="compUrl"
40
+ :key="compKey(sitem, key)"
41
+ v-for="(sitem, key) in item"
42
+ />
43
+ </template>
44
+ <template v-else-if="item.tabList?.length > 0">
45
+ <template
46
+ v-for="(tabItems, key) in item.tabList"
47
+ :key="compKey(tabItems, key)"
48
+ >
49
+ <star-horse-table-column
50
+ :data-format="dataFormat"
51
+ :cellEditable="fieldList['cellEditable']"
52
+ :item="sitem"
53
+ :globalConfig="globalConfig"
54
+ :isDynamic="isDynamic"
55
+ :sortable="sortable"
56
+ :compSize="compSize"
57
+ :compUrl="compUrl"
58
+ :key="compKey(sitem, skey)"
59
+ v-for="(sitem, skey) in tabItems.fieldList"
60
+ />
61
+ </template>
62
+ </template>
63
+ <template v-else-if="item.dytableList?.length > 0">
64
+ <template
65
+ v-for="(tabItems, key) in item.dytableList"
66
+ :key="compKey(tabItems, key)"
67
+ >
68
+ <star-horse-table-column
69
+ :data-format="dataFormat"
70
+ :cellEditable="fieldList['cellEditable']"
71
+ :item="sitem"
72
+ :globalConfig="globalConfig"
73
+ :isDynamic="isDynamic"
74
+ :sortable="sortable"
75
+ :compSize="compSize"
76
+ :compUrl="compUrl"
77
+ :key="compKey(sitem, skey)"
78
+ v-for="(sitem, skey) in tabItems"
79
+ />
80
+ </template>
81
+ </template>
82
+ <template v-else-if="item.batchFieldList?.length > 0">
83
+ <template
84
+ v-for="(batchItems, key) in item.batchFieldList"
85
+ :key="compKey(batchItems, key)"
86
+ >
87
+ <star-horse-table-column
88
+ :data-format="dataFormat"
89
+ :cellEditable="fieldList['cellEditable']"
90
+ :item="sitem"
91
+ :globalConfig="globalConfig"
92
+ :isDynamic="isDynamic"
93
+ :sortable="sortable"
94
+ :compSize="compSize"
95
+ :compUrl="compUrl"
96
+ :key="compKey(sitem, skey)"
97
+ v-for="(sitem, skey) in batchItems.fieldList"
98
+ />
99
+ </template>
100
+ </template>
101
+ <star-horse-table-column
102
+ v-else
103
+ :compUrl="compUrl"
104
+ :cellEditable="fieldList['cellEditable']"
105
+ :globalConfig="globalConfig"
106
+ :isDynamic="isDynamic"
107
+ :data-format="dataFormat"
108
+ :sortable="sortable"
109
+ :compSize="compSize"
110
+ :item="item"
111
+ />
112
+ </template>
113
+ <template
114
+ v-if="showBatchField"
115
+ v-for="item in fieldList['batchFieldList']"
116
+ :key="compKey(item, item.batchName)"
117
+ >
118
+ <star-horse-table-column
119
+ :data-format="dataFormat"
120
+ :compSize="compSize"
121
+ :globalConfig="globalConfig"
122
+ :isDynamic="isDynamic"
123
+ :sortable="sortable"
124
+ :item="item"
125
+ />
126
+ </template>
127
+ </template>
128
+
129
+ <style scoped lang="scss"></style>
@@ -0,0 +1,97 @@
1
+ <script setup lang="ts">
2
+ import { ModelRef, onMounted, PropType } from "vue";
3
+ import { ApiUrls } from "@/components/types/ApiUrls";
4
+ import { PageFieldInfo } from "@/components/types/PageFieldInfo";
5
+ import StarHorseFormTable from "@/components/comp/StarHorseFormTable.vue";
6
+ import { Config } from "@/api/settings";
7
+ import { compKey } from "@/api/system";
8
+
9
+ const props = defineProps({
10
+ compUrl: { type: Object as PropType<ApiUrls> },
11
+ item: { type: Object as PropType<PageFieldInfo | any>, required: true },
12
+ objectName: { type: String },
13
+ // 数据索引
14
+ dataIndex: { type: Number, default: -1 },
15
+ subFormFlag: { type: String, default: "N" },
16
+ batchName: { type: String, default: "batchDataList" },
17
+ batchFieldName: { type: String, default: "batchFieldList" },
18
+ primaryKey: {
19
+ type: [String, Object] as PropType<string | any>,
20
+ required: true,
21
+ },
22
+ rules: { type: Object },
23
+ compSize: { type: String, default: Config.compSize },
24
+ source: { type: Number, default: 1 },
25
+ });
26
+ const emits = defineEmits(["addRow", "removeRow"]);
27
+ const dataForm: ModelRef<any> = defineModel("dataForm");
28
+ const init = () => {};
29
+ /**
30
+ * 列表添加行数据
31
+ * @param row
32
+ */
33
+ const addRow = (row: any) => {
34
+ emits("addRow", row);
35
+ };
36
+ /**
37
+ * 列表删除行数据
38
+ * @param row
39
+ */
40
+ const removeRow = (row: any) => {
41
+ emits("removeRow", row);
42
+ };
43
+ onMounted(() => {
44
+ init();
45
+ });
46
+ </script>
47
+
48
+ <template>
49
+ <template
50
+ v-if="
51
+ item[batchFieldName]?.length > 1 &&
52
+ (!item.displayStyle || item.displayStyle == 'tab')
53
+ "
54
+ >
55
+ <el-tabs v-model="item.fieldName">
56
+ <template
57
+ v-for="(temp, key) in item[batchFieldName]"
58
+ :key="compKey(temp, key)"
59
+ >
60
+ <el-tab-pane
61
+ :label="temp['title']"
62
+ v-if="
63
+ Object.keys(temp).includes('disVisible') ? temp['disVisible'] : true
64
+ "
65
+ :name="temp.tabName || 'sub_tab' + key"
66
+ :disabled="temp.disabled"
67
+ class="h-full flex flex-col"
68
+ >
69
+ <star-horse-form-table
70
+ :size="compSize"
71
+ @addRow="addRow"
72
+ @removeRow="removeRow"
73
+ :rules="rules"
74
+ :item="temp"
75
+ v-model:dataForm="dataForm"
76
+ />
77
+ </el-tab-pane>
78
+ </template>
79
+ </el-tabs>
80
+ </template>
81
+ <template
82
+ v-else
83
+ v-for="(temp, key) in item[batchFieldName]"
84
+ :key="compKey(temp, key)"
85
+ >
86
+ <star-horse-form-table
87
+ :size="compSize"
88
+ :rules="rules"
89
+ @addRow="addRow"
90
+ @removeRow="removeRow"
91
+ :item="temp"
92
+ v-model:dataForm="dataForm"
93
+ />
94
+ </template>
95
+ </template>
96
+
97
+ <style scoped lang="scss"></style>
@@ -0,0 +1,158 @@
1
+ <script setup lang="ts">
2
+ import { nextTick, onMounted, PropType, ref } from "vue";
3
+ import { UserFuncInfo } from "@/components/types/PageFieldInfo";
4
+ import { BtnHideCondition } from "@/components/types/Params";
5
+ import { Config } from "@/api/settings";
6
+ import { compKey } from "@/api/system";
7
+
8
+ const props = defineProps({
9
+ //按钮列表
10
+ buttonList: { type: Array as PropType<UserFuncInfo[]>, required: true },
11
+ //权限
12
+ permissions: { type: Object as PropType<Permissions>, required: true },
13
+ //数据
14
+ row: { type: Object, required: true },
15
+ //按钮隐藏条件
16
+ hideBtnCondition: {
17
+ type: Array as PropType<BtnHideCondition[]>,
18
+ default: [],
19
+ },
20
+ //按钮大小
21
+ compSize: { type: String, default: Config.compSize },
22
+ //按钮默认显示限制,超出按钮个数则折叠显示
23
+ showLimit: { type: Number, default: 3 },
24
+ });
25
+ let validButtonList = ref<UserFuncInfo[] | any>([]);
26
+ /**
27
+ * 过滤掉需要隐藏的按钮
28
+ */
29
+ const init = () => {
30
+ let btnList: UserFuncInfo[] = props.buttonList;
31
+ validButtonList.value = [];
32
+ for (let i in btnList) {
33
+ let temp: UserFuncInfo = btnList[i];
34
+ if (
35
+ btnHideCheck(temp.authority, props.row) &&
36
+ Object.keys(props.permissions).includes(temp.authority!)
37
+ ) {
38
+ validButtonList.value.push(temp);
39
+ }
40
+ }
41
+ };
42
+
43
+ /**
44
+ * 判断按钮是否需要隐藏
45
+ * @param btn
46
+ * @param row
47
+ */
48
+ const btnHideCheck = (btn: string, row: any) => {
49
+ let cond = props.hideBtnCondition;
50
+ if (!cond || cond.length == 0) {
51
+ return true;
52
+ }
53
+ let flag = false,
54
+ hasBtn = false;
55
+ for (let i in cond) {
56
+ let temp = cond[i];
57
+ if (temp.btnName.includes(btn)) {
58
+ hasBtn = true;
59
+ if (Array.isArray(temp.value)) {
60
+ if (!temp.value.includes(row[temp.fieldName])) {
61
+ flag = true;
62
+ break;
63
+ }
64
+ } else if (row[temp.fieldName] != temp.value) {
65
+ flag = true;
66
+ break;
67
+ }
68
+ }
69
+ }
70
+ return hasBtn ? flag : true;
71
+ };
72
+ onMounted(() => {
73
+ nextTick(() => {
74
+ init();
75
+ });
76
+ });
77
+ </script>
78
+
79
+ <template>
80
+ <template v-if="validButtonList.length > 3">
81
+ <el-tooltip
82
+ :content="item.btnName"
83
+ v-for="(item, key) in validButtonList.slice(0, 3)"
84
+ :key="compKey(item, key)"
85
+ >
86
+ <star-horse-icon
87
+ v-if="permissions[item.authority!]"
88
+ @click="item.funcName!(row)"
89
+ :icon-class="item.icon || 'edit'"
90
+ style="cursor: pointer"
91
+ :color="
92
+ item.authority == 'delete'
93
+ ? 'var(--el-color-danger)'
94
+ : 'var(--star-horse-style)'
95
+ "
96
+ />
97
+ </el-tooltip>
98
+ <el-dropdown>
99
+ <span class="el-dropdown-link">
100
+ <star-horse-icon
101
+ icon-class="ellipsis"
102
+ style="color: var(--star-horse-style)"
103
+ />
104
+ </span>
105
+ <template #dropdown>
106
+ <el-dropdown-menu>
107
+ <el-dropdown-item
108
+ v-for="(auth, key) in validButtonList.slice(
109
+ 3,
110
+ validButtonList.length,
111
+ )"
112
+ :key="compKey(auth, key)"
113
+ :v-if="permissions[auth.authority!]"
114
+ >
115
+ <el-button
116
+ @click="auth.funcName(row)"
117
+ link
118
+ title=""
119
+ style="cursor: pointer; color: var(--star-horse-style)"
120
+ :size="compSize"
121
+ >
122
+ <star-horse-icon
123
+ :icon-class="auth.icon || 'edit'"
124
+ :color="
125
+ auth.authority == 'delete'
126
+ ? 'var(--el-color-danger)'
127
+ : 'var(--star-horse-style)'
128
+ "
129
+ />
130
+ {{ auth["btnName"] }}
131
+ </el-button>
132
+ </el-dropdown-item>
133
+ </el-dropdown-menu>
134
+ </template>
135
+ </el-dropdown>
136
+ </template>
137
+ <template v-else>
138
+ <el-tooltip
139
+ :content="item.btnName"
140
+ v-for="(item, key) in validButtonList"
141
+ :key="compKey(item, key)"
142
+ >
143
+ <star-horse-icon
144
+ v-if="permissions[item.authority]"
145
+ @click="item.funcName(row)"
146
+ :icon-class="item.icon || 'edit'"
147
+ style="cursor: pointer"
148
+ :color="
149
+ item.authority == 'delete'
150
+ ? 'var(--el-color-danger)'
151
+ : 'var(--star-horse-style)'
152
+ "
153
+ />
154
+ </el-tooltip>
155
+ </template>
156
+ </template>
157
+
158
+ <style scoped lang="scss"></style>
@@ -0,0 +1,55 @@
1
+ <script setup lang="ts">
2
+ import { ModelRef, onMounted, PropType, unref } from "vue";
3
+ import { FieldInfo } from "@/components/types/PageFieldInfo";
4
+ import { compKey } from "@/api/system";
5
+
6
+ const props = defineProps({
7
+ item: { type: Array as PropType<Array<FieldInfo> | any>, required: true },
8
+ commonFormat: { type: Function, required: true },
9
+ });
10
+ const dataForm: ModelRef<any> = defineModel("dataForm");
11
+ const dataFormat = (item: any) => {
12
+ let name = item["hideName"] || item["fieldName"];
13
+ let tempForm = unref(dataForm);
14
+ if (!tempForm) {
15
+ return "--";
16
+ }
17
+ let val = tempForm[name];
18
+ try {
19
+ return props.commonFormat(name, val, tempForm);
20
+ } catch (e) {
21
+ return val || "--";
22
+ }
23
+ };
24
+ const init = () => {};
25
+ onMounted(() => {
26
+ init();
27
+ });
28
+ </script>
29
+
30
+ <template>
31
+ <el-row v-if="Array.isArray(item)" :gutter="0">
32
+ <el-col
33
+ :span="sitem.colspan || sitem.preps?.colspan || 24 / item.length"
34
+ v-for="(sitem, ind) in item"
35
+ :key="compKey(sitem, ind)"
36
+ >
37
+ <div
38
+ class="item"
39
+ v-if="sitem.formVisible || sitem.listVisible || sitem.viewVisible"
40
+ >
41
+ <label>{{ sitem.label }} :</label>
42
+ <div class="content">
43
+ <pre v-if="sitem.type == 'textarea' || sitem.type == 'markdown'">{{
44
+ dataFormat(sitem)
45
+ }}</pre>
46
+ <el-tooltip :content="dataFormat(sitem)" v-else>
47
+ {{ dataFormat(sitem) }}
48
+ </el-tooltip>
49
+ </div>
50
+ </div>
51
+ </el-col>
52
+ </el-row>
53
+ </template>
54
+
55
+ <style scoped lang="scss"></style>