star-horse-lowcode 2.7.65 → 2.7.67
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.
- package/README.md +3 -0
- package/dist/assets/index.css +1 -1
- package/dist/index.es.js +597 -188
- package/dist/types/index.d.ts +30 -0
- package/package.json +3 -3
- package/.env.development +0 -3
- package/.env.production +0 -3
- package/.eslintrc-auto-import.json +0 -77
- package/.gitignore +0 -27
- package/.idea/.gitignore +0 -5
- package/.idea/MarsCodeWorkspaceAppSettings.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/testcode.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.idea/watcherTasks.xml +0 -4
- package/.idea/workspace.xml +0 -207
- package/.npmignore +0 -21
- package/.prettierignore +0 -26
- package/auto-imports.d.ts +0 -137
- package/components.d.ts +0 -189
- package/eslint.config.js +0 -37
- package/index.html +0 -14
- package/package-lock.json +0 -8276
- package/prettier.config.js +0 -20
- package/public/logo.svg +0 -660
- package/src/App.vue +0 -11
- package/src/api/date_utils.ts +0 -219
- package/src/api/finger_utils.ts +0 -71
- package/src/api/form_utils.ts +0 -281
- package/src/api/jquery.min.js +0 -2
- package/src/api/pcas-code.json +0 -1
- package/src/api/settings.ts +0 -81
- package/src/api/star_horse_apis.ts +0 -196
- package/src/api/star_horse_utils.ts +0 -797
- package/src/api/system.ts +0 -351
- package/src/api/user_func.ts +0 -147
- package/src/api/valid_utils.ts +0 -165
- package/src/assets/css/index.scss +0 -908
- package/src/assets/icons.css +0 -574
- package/src/assets/star-horse-icons.woff +0 -0
- package/src/components/comp/ShDynamicForm.vue +0 -160
- package/src/components/comp/ShForm.vue +0 -30
- package/src/components/comp/ShTableListColumn.vue +0 -61
- package/src/components/comp/StarHorseDataSelector.vue +0 -139
- package/src/components/comp/StarHorseDataView.vue +0 -110
- package/src/components/comp/StarHorseDataViewItems.vue +0 -61
- package/src/components/comp/StarHorseDataViewTable.vue +0 -102
- package/src/components/comp/StarHorseDialog.vue +0 -383
- package/src/components/comp/StarHorseDraggable.vue +0 -401
- package/src/components/comp/StarHorseForm.vue +0 -458
- package/src/components/comp/StarHorseFormItem.vue +0 -82
- package/src/components/comp/StarHorseFormList.vue +0 -516
- package/src/components/comp/StarHorseFormTable.vue +0 -56
- package/src/components/comp/StarHorseIcon.vue +0 -76
- package/src/components/comp/StarHorseItem.vue +0 -302
- package/src/components/comp/StarHorseJsonEditor.vue +0 -115
- package/src/components/comp/StarHorsePopover.vue +0 -66
- package/src/components/comp/StarHorseSearchComp.vue +0 -253
- package/src/components/comp/StarHorseStaticTable.vue +0 -395
- package/src/components/comp/StarHorseTableColumn.vue +0 -249
- package/src/components/comp/StarHorseTableComp.vue +0 -1193
- package/src/components/comp/StarHorseTableViewColumn.vue +0 -61
- package/src/components/comp/StarHorseTree.vue +0 -494
- package/src/components/comp/index.ts +0 -22
- package/src/components/comp/items/UTableColumn.vue +0 -65
- package/src/components/comp/items/boxItem.vue +0 -98
- package/src/components/comp/items/callitem.ts +0 -9
- package/src/components/comp/items/cardItem.vue +0 -152
- package/src/components/comp/items/collapseItem.vue +0 -134
- package/src/components/comp/items/dytableItem.vue +0 -135
- package/src/components/comp/items/otherItem.vue +0 -65
- package/src/components/comp/items/tabItem.vue +0 -155
- package/src/components/comp/items/tabPanelItem.vue +0 -110
- package/src/components/comp/items/tableColumn.vue +0 -129
- package/src/components/comp/items/tableItem.vue +0 -97
- package/src/components/comp/items/tablebtn.vue +0 -158
- package/src/components/comp/items/viewBoxItem.vue +0 -55
- package/src/components/comp/items/viewCardItem.vue +0 -47
- package/src/components/comp/items/viewCollapseItem.vue +0 -71
- package/src/components/comp/items/viewDytableItem.vue +0 -77
- package/src/components/comp/items/viewOtherItem.vue +0 -55
- package/src/components/comp/items/viewTabItem.vue +0 -77
- package/src/components/comp/items/viewTabPanelItem.vue +0 -54
- package/src/components/comp/items/viewTableItem.vue +0 -74
- package/src/components/comp/selfcomp.ts +0 -9
- package/src/components/comp/utils/DataPicker.vue +0 -302
- package/src/components/comp/utils/DataTag.vue +0 -51
- package/src/components/cron/Crontab-Day.vue +0 -230
- package/src/components/cron/Crontab-Hour.vue +0 -165
- package/src/components/cron/Crontab-Min.vue +0 -166
- package/src/components/cron/Crontab-Month.vue +0 -166
- package/src/components/cron/Crontab-Result.vue +0 -615
- package/src/components/cron/Crontab-Second.vue +0 -185
- package/src/components/cron/Crontab-Week.vue +0 -208
- package/src/components/cron/Crontab-Year.vue +0 -183
- package/src/components/cron/Crontab.vue +0 -474
- package/src/components/enums/ModuleEnums.ts +0 -10
- package/src/components/enums/ServiceEnums.ts +0 -18
- package/src/components/formcomp/container/box-container.vue +0 -162
- package/src/components/formcomp/container/callitem.ts +0 -9
- package/src/components/formcomp/container/card-container.vue +0 -170
- package/src/components/formcomp/container/collapse-container.vue +0 -133
- package/src/components/formcomp/container/dytable-col.vue +0 -448
- package/src/components/formcomp/container/dytable-container.vue +0 -57
- package/src/components/formcomp/container/dytableUtils.ts +0 -358
- package/src/components/formcomp/container/group-box-container.vue +0 -331
- package/src/components/formcomp/container/index.ts +0 -6
- package/src/components/formcomp/container/tab-container.vue +0 -153
- package/src/components/formcomp/container/table-container.vue +0 -249
- package/src/components/formcomp/items/allitem.ts +0 -9
- package/src/components/formcomp/items/area-item.vue +0 -116
- package/src/components/formcomp/items/audio-item.vue +0 -163
- package/src/components/formcomp/items/autocomplete-item.vue +0 -118
- package/src/components/formcomp/items/barcode-item.vue +0 -87
- package/src/components/formcomp/items/base-json-item.vue +0 -207
- package/src/components/formcomp/items/button-item.vue +0 -228
- package/src/components/formcomp/items/cascade-item.vue +0 -113
- package/src/components/formcomp/items/checkbox-item.vue +0 -97
- package/src/components/formcomp/items/color-item.vue +0 -70
- package/src/components/formcomp/items/cron-item.vue +0 -115
- package/src/components/formcomp/items/datetime-item.vue +0 -99
- package/src/components/formcomp/items/depart-item.vue +0 -51
- package/src/components/formcomp/items/dialog-input-item.vue +0 -207
- package/src/components/formcomp/items/divider-item.vue +0 -66
- package/src/components/formcomp/items/html-item.vue +0 -65
- package/src/components/formcomp/items/htmleditor-item.vue +0 -104
- package/src/components/formcomp/items/icon-item.vue +0 -195
- package/src/components/formcomp/items/image-item.vue +0 -247
- package/src/components/formcomp/items/index.ts +0 -44
- package/src/components/formcomp/items/input-item.vue +0 -150
- package/src/components/formcomp/items/json-array-item.vue +0 -67
- package/src/components/formcomp/items/json-item.vue +0 -66
- package/src/components/formcomp/items/markdown-item.vue +0 -77
- package/src/components/formcomp/items/number-item.vue +0 -94
- package/src/components/formcomp/items/number-range-item.vue +0 -278
- package/src/components/formcomp/items/page-select-item.vue +0 -407
- package/src/components/formcomp/items/password-item.vue +0 -71
- package/src/components/formcomp/items/qrcode-item.vue +0 -84
- package/src/components/formcomp/items/radio-item.vue +0 -112
- package/src/components/formcomp/items/rate-item.vue +0 -68
- package/src/components/formcomp/items/select-item.vue +0 -133
- package/src/components/formcomp/items/signature-item.vue +0 -216
- package/src/components/formcomp/items/slider-item.vue +0 -68
- package/src/components/formcomp/items/starhorse-form-item.vue +0 -334
- package/src/components/formcomp/items/switch-item.vue +0 -77
- package/src/components/formcomp/items/tag-item.vue +0 -77
- package/src/components/formcomp/items/text-item.vue +0 -75
- package/src/components/formcomp/items/textarea-item.vue +0 -85
- package/src/components/formcomp/items/time-item.vue +0 -77
- package/src/components/formcomp/items/time-picker-item.vue +0 -74
- package/src/components/formcomp/items/transfer-item.vue +0 -93
- package/src/components/formcomp/items/tselect-item.vue +0 -121
- package/src/components/formcomp/items/unknown-item.vue +0 -51
- package/src/components/formcomp/items/upload-item.vue +0 -189
- package/src/components/formcomp/items/user-item.vue +0 -177
- package/src/components/formcomp/items/usercomp-item.vue +0 -85
- package/src/components/formcomp/items/view-markdown-item.vue +0 -77
- package/src/components/formcomp/utils/EditDataDialog.vue +0 -67
- package/src/components/formcomp/utils/FieldList.vue +0 -125
- package/src/components/formcomp/utils/ItemRelationEventUtils.ts +0 -284
- package/src/components/help.vue +0 -31
- package/src/components/menu/MenuItem.vue +0 -95
- package/src/components/menu/SubMenu.vue +0 -68
- package/src/components/menu/SubSystemMenu.vue +0 -142
- package/src/components/register.ts +0 -24
- package/src/components/system/ContentMenu.vue +0 -260
- package/src/components/system/StarHorseButtonList.vue +0 -344
- package/src/components/system/StarHorseMenu.vue +0 -97
- package/src/components/system/StarHorseSvg.vue +0 -62
- package/src/components/system/SystemComp.ts +0 -9
- package/src/components/system/index.ts +0 -4
- package/src/components/types/ApiUrls.ts +0 -168
- package/src/components/types/BtnAction.ts +0 -51
- package/src/components/types/BtnAuth.ts +0 -43
- package/src/components/types/CompInfo.ts +0 -81
- package/src/components/types/DialogProps.ts +0 -55
- package/src/components/types/DyCompField.ts +0 -23
- package/src/components/types/DynamicNode.ts +0 -42
- package/src/components/types/MenusInfo.ts +0 -45
- package/src/components/types/PageFieldInfo.ts +0 -530
- package/src/components/types/PageProps.ts +0 -25
- package/src/components/types/Params.ts +0 -93
- package/src/components/types/RuleType.ts +0 -10
- package/src/components/types/SearchProps.ts +0 -42
- package/src/components/types/ShortKey.ts +0 -30
- package/src/components/types/StarHorseType.ts +0 -18
- package/src/components/types/index.ts +0 -15
- package/src/config/element.ts +0 -15
- package/src/config/styles.ts +0 -4
- package/src/index.ts +0 -98
- package/src/install.ts +0 -33
- package/src/lang/en_US.ts +0 -81
- package/src/lang/index.ts +0 -35
- package/src/lang/zh_CN.ts +0 -84
- package/src/main.ts +0 -57
- package/src/plugins/AblesPlugin.ts +0 -618
- package/src/plugins/registerCompPlugin.ts +0 -15
- package/src/sample/test.vue +0 -9
- package/src/store/ButtonPermission.ts +0 -101
- package/src/store/ConsumerView.ts +0 -52
- package/src/store/ContinusConfig.ts +0 -78
- package/src/store/CopyerOperation.ts +0 -74
- package/src/store/DesignForm.ts +0 -481
- package/src/store/DesignPage.ts +0 -59
- package/src/store/DynamicForm.ts +0 -241
- package/src/store/GlobalConfig.ts +0 -90
- package/src/store/SelfOperation.ts +0 -95
- package/src/store/UserInfo.ts +0 -88
- package/src/store/index.ts +0 -6
- package/src/theme/localStorge.ts +0 -16
- package/src/theme/theme.ts +0 -27
- package/src/utils/FieldOperationUtils.ts +0 -91
- package/src/utils/auth.ts +0 -83
- package/src/utils/message.ts +0 -69
- package/src/utils/preview.ts +0 -125
- package/tsconfig.json +0 -39
- package/tsconfig.node.json +0 -10
- package/vite-env.d.ts +0 -16
- package/vite.config.ts +0 -162
- package/yarn.lock +0 -4627
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import { error } from "@/utils/message";
|
|
2
|
-
import { userFunction } from "@/api/user_func";
|
|
3
|
-
import { compDynamicData } from "@/api/star_horse_utils";
|
|
4
|
-
import piniaInstance from "@/store";
|
|
5
|
-
import { useSelfOperationStore } from "@/store/SelfOperation";
|
|
6
|
-
import { useDesignFormStore } from "@/store/DesignForm";
|
|
7
|
-
import { computed, isRef, unref, watch } from "vue";
|
|
8
|
-
|
|
9
|
-
const designForm = useDesignFormStore(piniaInstance);
|
|
10
|
-
const userOperation = useSelfOperationStore(piniaInstance);
|
|
11
|
-
|
|
12
|
-
const isDesign = computed(() => designForm.isEdit);
|
|
13
|
-
/**
|
|
14
|
-
* Change 事件
|
|
15
|
-
* @param context
|
|
16
|
-
* @param formData
|
|
17
|
-
*/
|
|
18
|
-
const change = (context: any, formData: any) => {
|
|
19
|
-
const field = context.field as any;
|
|
20
|
-
const relation = field.preps?.dataRelation;
|
|
21
|
-
operationRelation(relation, "change", formData, field.fieldName);
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Input 事件
|
|
25
|
-
* @param context
|
|
26
|
-
* @param formData
|
|
27
|
-
*/
|
|
28
|
-
const input = (context: any, formData: any) => {
|
|
29
|
-
const field = context.field as any;
|
|
30
|
-
const relation = field.preps?.dataRelation;
|
|
31
|
-
operationRelation(relation, "input", formData, field.fieldName);
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Focus 事件
|
|
35
|
-
* @param context
|
|
36
|
-
* @param formData
|
|
37
|
-
*/
|
|
38
|
-
const focus = (context: any, formData: any) => {
|
|
39
|
-
const field = context.field as any;
|
|
40
|
-
const relation = field.preps?.dataRelation;
|
|
41
|
-
operationRelation(relation, "focus", formData, field.fieldName);
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Blur 事件
|
|
45
|
-
* @param context
|
|
46
|
-
* @param formData
|
|
47
|
-
*/
|
|
48
|
-
const blur = (context: any, formData: any) => {
|
|
49
|
-
const field = context.field as any;
|
|
50
|
-
const relation = field.preps?.dataRelation;
|
|
51
|
-
operationRelation(relation, "blur", formData, field.fieldName);
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Enter 事件
|
|
55
|
-
* @param context
|
|
56
|
-
* @param formData
|
|
57
|
-
*/
|
|
58
|
-
const mouseEnter = (context: any, formData: any) => {
|
|
59
|
-
const field = context.field as any;
|
|
60
|
-
const relation = field.preps?.dataRelation;
|
|
61
|
-
operationRelation(relation, "enter", formData, field.fieldName);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 操作关联关系
|
|
66
|
-
* @param relation
|
|
67
|
-
* @param actionName
|
|
68
|
-
* @param formData
|
|
69
|
-
* @param currentName
|
|
70
|
-
*/
|
|
71
|
-
const operationRelation = async (
|
|
72
|
-
relation: any,
|
|
73
|
-
actionName: string,
|
|
74
|
-
formData: any,
|
|
75
|
-
currentName: string,
|
|
76
|
-
) => {
|
|
77
|
-
if (!relation || actionName != relation.actionName) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const relations: Array<any> = relation?.relationDetails;
|
|
81
|
-
const currentVal = formData[currentName];
|
|
82
|
-
if (!relations || relations.length == 0) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
for (const index in relations) {
|
|
86
|
-
const temp = relations[index];
|
|
87
|
-
const conditon: string = temp.controlCondition;
|
|
88
|
-
const fieldName: string = temp.relationFields;
|
|
89
|
-
if (!conditon || !fieldName) {
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
const field = userOperation.getFormItem(fieldName);
|
|
93
|
-
const params: any = temp.params;
|
|
94
|
-
//数据联动
|
|
95
|
-
if (conditon == "dataLinkage") {
|
|
96
|
-
formData[fieldName + "OptionList"] = await compDynamicData({
|
|
97
|
-
preps: temp,
|
|
98
|
-
});
|
|
99
|
-
} else if (conditon == "eqDisable" || conditon == "eqDisableOrEditable") {
|
|
100
|
-
//输入的值等于指定值隐藏否则显示
|
|
101
|
-
formData["_" + fieldName + "Editable"] = !(currentVal == params);
|
|
102
|
-
} else if (conditon == "eqEditable" || conditon == "eqEditableOrDisable") {
|
|
103
|
-
//输入的值等于指定值显示否则隐藏
|
|
104
|
-
formData["_" + fieldName + "Editable"] = currentVal == params;
|
|
105
|
-
} else if (conditon == "assignValue") {
|
|
106
|
-
//输入的值等于指定值时赋予新值
|
|
107
|
-
if (
|
|
108
|
-
field.itemType == "select" ||
|
|
109
|
-
field.itemType == "tselect" ||
|
|
110
|
-
field.itemType == "autocomplete" ||
|
|
111
|
-
field.itemType == "cascade"
|
|
112
|
-
) {
|
|
113
|
-
field.preps.values = JSON.parse(params);
|
|
114
|
-
} else {
|
|
115
|
-
formData[field.fieldName] = params;
|
|
116
|
-
}
|
|
117
|
-
} else if (conditon == "changeType") {
|
|
118
|
-
//输入的值等于指定值时改变字段类型
|
|
119
|
-
field.itemType = params;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* 所有触发的事件
|
|
125
|
-
* @param context
|
|
126
|
-
* @param emits
|
|
127
|
-
* @param formData
|
|
128
|
-
* @param actionName
|
|
129
|
-
* @param isInit
|
|
130
|
-
*/
|
|
131
|
-
const allAction = (
|
|
132
|
-
context: any,
|
|
133
|
-
emits: any,
|
|
134
|
-
formData: any,
|
|
135
|
-
actionName: string,
|
|
136
|
-
isInit: boolean = false,
|
|
137
|
-
) => {
|
|
138
|
-
const currentData = unref(formData);
|
|
139
|
-
//设计时的初始化不作处理
|
|
140
|
-
// const field = context.field as any;
|
|
141
|
-
try {
|
|
142
|
-
emits("selfFunc", actionName, currentData);
|
|
143
|
-
} catch (e) {
|
|
144
|
-
error("事件触发异常:" + e);
|
|
145
|
-
}
|
|
146
|
-
if (isDesign.value && isInit) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
//处理连动
|
|
151
|
-
switch (actionName) {
|
|
152
|
-
case "change":
|
|
153
|
-
change(context, currentData);
|
|
154
|
-
break;
|
|
155
|
-
case "input":
|
|
156
|
-
input(context, currentData);
|
|
157
|
-
break;
|
|
158
|
-
case "focus":
|
|
159
|
-
focus(context, currentData);
|
|
160
|
-
break;
|
|
161
|
-
case "blur":
|
|
162
|
-
blur(context, currentData);
|
|
163
|
-
break;
|
|
164
|
-
case "enter":
|
|
165
|
-
case "keydown.enter":
|
|
166
|
-
mouseEnter(context, currentData);
|
|
167
|
-
break;
|
|
168
|
-
default:
|
|
169
|
-
console.log("不支持的事件:" + actionName);
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
/**
|
|
174
|
-
* Button 组件的点击事件
|
|
175
|
-
* @param context
|
|
176
|
-
* @param emits
|
|
177
|
-
* @param formData
|
|
178
|
-
* @param code
|
|
179
|
-
* @param evtName 时间名称
|
|
180
|
-
*/
|
|
181
|
-
const buttonAction = (
|
|
182
|
-
context: any,
|
|
183
|
-
emits: any,
|
|
184
|
-
formData: any,
|
|
185
|
-
code: string,
|
|
186
|
-
evtName: string = "click",
|
|
187
|
-
) => {
|
|
188
|
-
const currentData = isRef(formData) ? formData.value : formData;
|
|
189
|
-
if (code) {
|
|
190
|
-
userFunction(code, context, currentData);
|
|
191
|
-
} else {
|
|
192
|
-
const field = context.field as any;
|
|
193
|
-
currentData["starHorseBtnName"] = field.fieldName;
|
|
194
|
-
const actions = field.actions;
|
|
195
|
-
if (actions) {
|
|
196
|
-
if (typeof actions === "function") {
|
|
197
|
-
actions(formData);
|
|
198
|
-
} else {
|
|
199
|
-
actions[evtName]?.(formData);
|
|
200
|
-
}
|
|
201
|
-
} else {
|
|
202
|
-
emits("selfFunc", currentData);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* 检查是否禁用
|
|
208
|
-
* @param attrs
|
|
209
|
-
*/
|
|
210
|
-
const checkIsDisabled = (attrs: any) => {
|
|
211
|
-
// const {attrs} = context;
|
|
212
|
-
const { field } = attrs;
|
|
213
|
-
const fieldName = field.fieldName;
|
|
214
|
-
const isExplicitlyDisabled =
|
|
215
|
-
attrs?.disabled || field.disabled || field.preps?.disabled;
|
|
216
|
-
const eidtDidsabled =
|
|
217
|
-
(attrs.editDisabled || field.editDisabled || field.preps?.editDisabled) &&
|
|
218
|
-
field.preps?.starHorseFieldSource != 1;
|
|
219
|
-
const isImplicitlyDisabled =
|
|
220
|
-
!attrs?.formData?.[`_${fieldName}Editable`] && field?.preps?.disabled;
|
|
221
|
-
return (
|
|
222
|
-
eidtDidsabled === true ||
|
|
223
|
-
isExplicitlyDisabled === true ||
|
|
224
|
-
isImplicitlyDisabled === true
|
|
225
|
-
);
|
|
226
|
-
};
|
|
227
|
-
const useFormField = (context: any, field: any) => {
|
|
228
|
-
const fieldName = computed(() => field.fieldName);
|
|
229
|
-
const updateFormData = (value: any) => {
|
|
230
|
-
const newData = context.attrs.formData;
|
|
231
|
-
newData[fieldName.value] = value;
|
|
232
|
-
// context.emit('form-data-update', newData);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
return {
|
|
236
|
-
fieldValue: computed({
|
|
237
|
-
get: () => context.attrs.formData[fieldName.value],
|
|
238
|
-
set: updateFormData,
|
|
239
|
-
}),
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
const initCompCallEvent = (props: any, emits: any, formData: any) => {
|
|
243
|
-
const events: string[] = Object.keys(props.field.actions || {});
|
|
244
|
-
// 新增数据检查
|
|
245
|
-
if (
|
|
246
|
-
!props.isSearch &&
|
|
247
|
-
!props.field.preps?.["stopInitCallAction"] &&
|
|
248
|
-
events?.length > 0
|
|
249
|
-
) {
|
|
250
|
-
if (
|
|
251
|
-
Object.keys(formData.value || {}).length == 0 ||
|
|
252
|
-
!formData.value[props.field.fieldName]
|
|
253
|
-
) {
|
|
254
|
-
const stop = watch(
|
|
255
|
-
() => formData.value[props.field.fieldName],
|
|
256
|
-
(val) => {
|
|
257
|
-
if (val) {
|
|
258
|
-
doInitCallEvent(props, emits, formData);
|
|
259
|
-
stop();
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
{ immediate: true },
|
|
263
|
-
);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
doInitCallEvent(props, emits, formData);
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
const doInitCallEvent = (props: any, emits: any, formData: any) => {
|
|
270
|
-
const events: string[] = Object.keys(props.field.actions || {});
|
|
271
|
-
if (props.field.preps?.["starHorseFieldSource"] == 5) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
events?.forEach((event) => {
|
|
275
|
-
allAction(props, emits, formData, event, true);
|
|
276
|
-
});
|
|
277
|
-
};
|
|
278
|
-
export {
|
|
279
|
-
allAction,
|
|
280
|
-
buttonAction,
|
|
281
|
-
checkIsDisabled,
|
|
282
|
-
useFormField,
|
|
283
|
-
initCompCallEvent,
|
|
284
|
-
};
|
package/src/components/help.vue
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="help">
|
|
2
|
-
import StarHorseIcon from "@/components/comp/StarHorseIcon.vue";
|
|
3
|
-
|
|
4
|
-
defineProps({
|
|
5
|
-
width: { type: Number, default: 340 },
|
|
6
|
-
message: { type: String, required: true, default: "帮助" },
|
|
7
|
-
});
|
|
8
|
-
</script>
|
|
9
|
-
<template>
|
|
10
|
-
<el-popover
|
|
11
|
-
trigger="hover"
|
|
12
|
-
:popper-style="{ width: 'unset !important' }"
|
|
13
|
-
placement="bottom-start"
|
|
14
|
-
>
|
|
15
|
-
<template #reference>
|
|
16
|
-
<star-horse-icon
|
|
17
|
-
icon-class="help"
|
|
18
|
-
color="var(--star-horse-style)"
|
|
19
|
-
size="12px"
|
|
20
|
-
style="cursor: pointer"
|
|
21
|
-
/>
|
|
22
|
-
</template>
|
|
23
|
-
<div style="font-size: 12px">
|
|
24
|
-
<pre
|
|
25
|
-
>{{ message }}
|
|
26
|
-
</pre
|
|
27
|
-
>
|
|
28
|
-
</div>
|
|
29
|
-
</el-popover>
|
|
30
|
-
</template>
|
|
31
|
-
<style scoped lang="scss"></style>
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, PropType } from "vue";
|
|
3
|
-
import { compKey } from "@/api/system";
|
|
4
|
-
defineOptions({
|
|
5
|
-
name: "MenuItem",
|
|
6
|
-
});
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
item: { type: Object as PropType<any>, required: true },
|
|
9
|
-
preps: {
|
|
10
|
-
type: Object as PropType<any>,
|
|
11
|
-
default: () => {
|
|
12
|
-
return {
|
|
13
|
-
id: "id",
|
|
14
|
-
icon: "icon",
|
|
15
|
-
value: "value",
|
|
16
|
-
label: "name",
|
|
17
|
-
children: "children",
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
level: { type: Number, default: 1 },
|
|
22
|
-
});
|
|
23
|
-
const emits = defineEmits(["selectItem"]);
|
|
24
|
-
const selectItem = (item: any) => {
|
|
25
|
-
emits("selectItem", item);
|
|
26
|
-
};
|
|
27
|
-
let menuColor = computed(() =>
|
|
28
|
-
props.level > 1 ? "var(--star-horse-shadow)" : "var(--star-horse-background)",
|
|
29
|
-
);
|
|
30
|
-
</script>
|
|
31
|
-
<template>
|
|
32
|
-
<el-sub-menu
|
|
33
|
-
popper-class="popper-class"
|
|
34
|
-
v-if="item[preps.children ?? 'children']?.length > 0"
|
|
35
|
-
:index="item[preps.id]"
|
|
36
|
-
@click="selectItem(item)"
|
|
37
|
-
>
|
|
38
|
-
<template #title>
|
|
39
|
-
<el-icon class="star-icon">
|
|
40
|
-
<component :is="item[preps.icon] || 'document'" />
|
|
41
|
-
</el-icon>
|
|
42
|
-
<span>{{ item[preps.label] }} </span>
|
|
43
|
-
</template>
|
|
44
|
-
<MenuItem
|
|
45
|
-
:item="sitem"
|
|
46
|
-
:level="level + 1"
|
|
47
|
-
:preps="preps"
|
|
48
|
-
@selectItem="selectItem"
|
|
49
|
-
v-for="(sitem, key) in item[preps.children ?? 'children']"
|
|
50
|
-
:key="compKey(sitem, key)"
|
|
51
|
-
/>
|
|
52
|
-
</el-sub-menu>
|
|
53
|
-
<el-menu-item
|
|
54
|
-
popper-class="popper-class"
|
|
55
|
-
v-else
|
|
56
|
-
:index="item[preps.id]"
|
|
57
|
-
@click="selectItem(item)"
|
|
58
|
-
>
|
|
59
|
-
<el-icon class="star-icon">
|
|
60
|
-
<component :is="item[preps.icon] || 'document'" />
|
|
61
|
-
</el-icon>
|
|
62
|
-
<template #title>
|
|
63
|
-
<span>{{ item[preps.label] }} </span>
|
|
64
|
-
</template>
|
|
65
|
-
</el-menu-item>
|
|
66
|
-
</template>
|
|
67
|
-
<style lang="scss" scoped>
|
|
68
|
-
.star-icon {
|
|
69
|
-
font-size: 22px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.popper-class {
|
|
73
|
-
background: var(--star-horse-white) !important;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.el-sub-menu {
|
|
77
|
-
background: v-bind(menuColor);
|
|
78
|
-
margin-top: 1px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
:deep(.el-sub-menu__title) {
|
|
82
|
-
height: 40px;
|
|
83
|
-
line-height: 40px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
:deep(.el-scrollbar__view) {
|
|
87
|
-
height: 100%;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.popers {
|
|
91
|
-
overflow: auto;
|
|
92
|
-
height: 100% !important;
|
|
93
|
-
z-index: 999999;
|
|
94
|
-
}
|
|
95
|
-
</style>
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ModelRef } from "vue";
|
|
3
|
-
import { compKey } from "@/api/system";
|
|
4
|
-
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
level: { type: Number, default: 1 },
|
|
7
|
-
});
|
|
8
|
-
const dataList: ModelRef<any> = defineModel("dataList");
|
|
9
|
-
let menuColor = computed(() =>
|
|
10
|
-
props.level > 1 ? "var(--star-horse-shadow)" : "var(--star-horse-background)",
|
|
11
|
-
);
|
|
12
|
-
</script>
|
|
13
|
-
<template>
|
|
14
|
-
<div
|
|
15
|
-
v-if="level > 1"
|
|
16
|
-
style="height: 2px; background: var(--star-horse-white)"
|
|
17
|
-
></div>
|
|
18
|
-
<template v-for="(item, key) in dataList" :key="compKey(item, key)">
|
|
19
|
-
<el-sub-menu v-if="item.children?.length > 0" :index="item.meta.menuId">
|
|
20
|
-
<template #title>
|
|
21
|
-
<el-icon class="star-icon">
|
|
22
|
-
<component :is="item.meta.menuIcon || 'document'" />
|
|
23
|
-
</el-icon>
|
|
24
|
-
<span>{{ item.meta.title }} </span>
|
|
25
|
-
</template>
|
|
26
|
-
<SubMenu v-model:dataList="item.children" :level="level + 1"></SubMenu>
|
|
27
|
-
</el-sub-menu>
|
|
28
|
-
<el-menu-item popper-class="popper-class" v-else :index="item.meta.menuId">
|
|
29
|
-
<el-icon class="star-icon">
|
|
30
|
-
<component :is="item.meta.menuIcon || 'document'" />
|
|
31
|
-
</el-icon>
|
|
32
|
-
<template #title>
|
|
33
|
-
<router-link :to="{ path: item.path }">{{
|
|
34
|
-
item.meta.title
|
|
35
|
-
}}</router-link>
|
|
36
|
-
</template>
|
|
37
|
-
</el-menu-item>
|
|
38
|
-
</template>
|
|
39
|
-
</template>
|
|
40
|
-
<style lang="scss" scoped>
|
|
41
|
-
.star-icon {
|
|
42
|
-
font-size: 22px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.popper-class {
|
|
46
|
-
background: var(--star-horse-style);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.el-sub-menu {
|
|
50
|
-
background: v-bind(menuColor);
|
|
51
|
-
margin-top: 1px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:deep(.el-sub-menu__title) {
|
|
55
|
-
height: 40px;
|
|
56
|
-
line-height: 40px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
:deep(.el-scrollbar__view) {
|
|
60
|
-
height: 100%;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.popers {
|
|
64
|
-
overflow: auto;
|
|
65
|
-
height: 100% !important;
|
|
66
|
-
z-index: 999999;
|
|
67
|
-
}
|
|
68
|
-
</style>
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { PropType, ref } from "vue";
|
|
3
|
-
import StarHorseIcon from "@/components/comp/StarHorseIcon.vue";
|
|
4
|
-
import { compKey } from "@/api/system";
|
|
5
|
-
|
|
6
|
-
defineProps({
|
|
7
|
-
dataList: { type: Array<any>, required: true },
|
|
8
|
-
preps: {
|
|
9
|
-
type: Object as PropType<any>,
|
|
10
|
-
default: () => {
|
|
11
|
-
return {
|
|
12
|
-
value: "value",
|
|
13
|
-
label: "name",
|
|
14
|
-
children: "children",
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
btnTitle: { type: String, default: "添加数据" },
|
|
19
|
-
rmvTitle: { type: String, default: "删除数据" },
|
|
20
|
-
btnVisible: { type: Boolean, default: false },
|
|
21
|
-
rmvVisible: { type: Boolean, default: false },
|
|
22
|
-
});
|
|
23
|
-
const emits = defineEmits(["selectData", "addData", "removeData"]);
|
|
24
|
-
let currentItem = ref<any>({});
|
|
25
|
-
const selectData = (item: any, event: MouseEvent) => {
|
|
26
|
-
currentItem.value = item;
|
|
27
|
-
if (event) {
|
|
28
|
-
event.stopPropagation();
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
}
|
|
31
|
-
emits("selectData", item);
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* 添加数据
|
|
35
|
-
* @param item
|
|
36
|
-
*/
|
|
37
|
-
const addData = (item: any) => {
|
|
38
|
-
emits("addData", item);
|
|
39
|
-
};
|
|
40
|
-
const removeData = (item: any) => {
|
|
41
|
-
emits("removeData", item);
|
|
42
|
-
};
|
|
43
|
-
</script>
|
|
44
|
-
<template>
|
|
45
|
-
<template v-for="(item, key) in dataList" :key="compKey(item, key)">
|
|
46
|
-
<el-sub-menu
|
|
47
|
-
v-if="item?.children?.length > 0"
|
|
48
|
-
:class="{ 'is-active': item[preps.value] == currentItem[preps.value] }"
|
|
49
|
-
:index="item[preps.value]"
|
|
50
|
-
>
|
|
51
|
-
<template #title>
|
|
52
|
-
<el-icon class="star-icon">
|
|
53
|
-
<component is="folder" />
|
|
54
|
-
</el-icon>
|
|
55
|
-
<div class="menu-title" @click="selectData(item, $event)">
|
|
56
|
-
<div class="name">{{ item[preps.label] }}</div>
|
|
57
|
-
<div v-if="btnVisible || rmvVisible" class="btn">
|
|
58
|
-
<el-tooltip :content="btnTitle">
|
|
59
|
-
<star-horse-icon
|
|
60
|
-
cursor="pointer"
|
|
61
|
-
v-if="btnVisible"
|
|
62
|
-
@click.stop="addData(item)"
|
|
63
|
-
icon-class="plus"
|
|
64
|
-
/>
|
|
65
|
-
</el-tooltip>
|
|
66
|
-
<el-tooltip :content="rmvTitle">
|
|
67
|
-
<star-horse-icon
|
|
68
|
-
cursor="pointer"
|
|
69
|
-
v-if="rmvVisible"
|
|
70
|
-
@click.stop="removeData(item)"
|
|
71
|
-
color="var(--el-color-danger)"
|
|
72
|
-
icon-class="minus"
|
|
73
|
-
/>
|
|
74
|
-
</el-tooltip>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</template>
|
|
78
|
-
<SubSystemMenu
|
|
79
|
-
:dataList="item.children"
|
|
80
|
-
:preps="preps"
|
|
81
|
-
@selectData="selectData"
|
|
82
|
-
@removeData="removeData"
|
|
83
|
-
:btnVisible="btnVisible"
|
|
84
|
-
:btnTitle="btnTitle"
|
|
85
|
-
:rmvVisible="rmvVisible"
|
|
86
|
-
:rmvTitle="rmvTitle"
|
|
87
|
-
/>
|
|
88
|
-
</el-sub-menu>
|
|
89
|
-
<el-menu-item
|
|
90
|
-
v-else
|
|
91
|
-
:index="item[preps.value]"
|
|
92
|
-
:class="{ 'is-active': item[preps.value] == currentItem[preps.value] }"
|
|
93
|
-
>
|
|
94
|
-
<el-icon class="star-icon">
|
|
95
|
-
<component is="document" />
|
|
96
|
-
</el-icon>
|
|
97
|
-
<template #title>
|
|
98
|
-
<div class="menu-title" @click="selectData(item, $event)">
|
|
99
|
-
<div class="name">{{ item[preps.label] }}</div>
|
|
100
|
-
<div v-if="btnVisible || rmvVisible" class="btn">
|
|
101
|
-
<el-tooltip :content="btnTitle">
|
|
102
|
-
<star-horse-icon
|
|
103
|
-
cursor="pointer"
|
|
104
|
-
v-if="btnVisible"
|
|
105
|
-
@click.stop="addData(item)"
|
|
106
|
-
icon-class="plus"
|
|
107
|
-
/>
|
|
108
|
-
</el-tooltip>
|
|
109
|
-
<el-tooltip :content="rmvTitle">
|
|
110
|
-
<star-horse-icon
|
|
111
|
-
cursor="pointer"
|
|
112
|
-
v-if="rmvVisible"
|
|
113
|
-
@click.stop="removeData(item)"
|
|
114
|
-
color="var(--el-color-danger)"
|
|
115
|
-
icon-class="minus"
|
|
116
|
-
/>
|
|
117
|
-
</el-tooltip>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</template>
|
|
121
|
-
</el-menu-item>
|
|
122
|
-
</template>
|
|
123
|
-
</template>
|
|
124
|
-
<style scoped lang="scss">
|
|
125
|
-
.star-icon {
|
|
126
|
-
font-size: 22px;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.el-sub-menu {
|
|
130
|
-
justify-content: space-between;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
:deep(.el-sub-menu__title) {
|
|
134
|
-
height: 35px !important;
|
|
135
|
-
line-height: 35px !important;
|
|
136
|
-
width: 100%;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
:deep(.el-scrollbar__view) {
|
|
140
|
-
height: 100%;
|
|
141
|
-
}
|
|
142
|
-
</style>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { App, defineAsyncComponent } from "vue";
|
|
2
|
-
|
|
3
|
-
// 动态导入组件路径(保持原有逻辑)
|
|
4
|
-
const items = import.meta.glob([
|
|
5
|
-
"@/components/comp/*.vue",
|
|
6
|
-
"@/components/comp/items/*.vue",
|
|
7
|
-
"@/components/system/*.vue",
|
|
8
|
-
"@/components/formcomp/items/*.vue",
|
|
9
|
-
"@/components/formcomp/container/*.vue",
|
|
10
|
-
]);
|
|
11
|
-
|
|
12
|
-
// 全局组件注册函数
|
|
13
|
-
export const registerGlobalComponents = (app: App<Element>) => {
|
|
14
|
-
Object.entries(items).forEach(([path, component]) => {
|
|
15
|
-
const name = path
|
|
16
|
-
.split("/")
|
|
17
|
-
.pop() // 获取文件名
|
|
18
|
-
?.replace(/\.vue$/, ""); // 移除扩展名
|
|
19
|
-
|
|
20
|
-
if (name) {
|
|
21
|
-
app.component(name, defineAsyncComponent(component as any));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
};
|