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.
- package/.env.development +3 -0
- package/.env.production +3 -0
- package/.eslintrc-auto-import.json +77 -0
- package/.gitignore +27 -0
- package/.idea/.gitignore +5 -0
- package/.idea/MarsCodeWorkspaceAppSettings.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/modules.xml +8 -0
- package/.idea/testcode.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.idea/workspace.xml +207 -0
- package/.npmignore +21 -0
- package/.prettierignore +26 -0
- package/README.md +2 -0
- package/auto-imports.d.ts +137 -0
- package/components.d.ts +189 -0
- package/dist/assets/index.css +1 -1
- package/dist/index.es.js +941 -720
- package/dist/types/index.d.ts +8 -8
- package/eslint.config.js +37 -0
- package/index.html +14 -0
- package/package-lock.json +8276 -0
- package/package.json +6 -6
- package/prettier.config.js +20 -0
- package/public/logo.svg +660 -0
- package/src/App.vue +11 -0
- package/src/api/date_utils.ts +219 -0
- package/src/api/finger_utils.ts +71 -0
- package/src/api/form_utils.ts +281 -0
- package/src/api/jquery.min.js +2 -0
- package/src/api/pcas-code.json +1 -0
- package/src/api/settings.ts +81 -0
- package/src/api/star_horse_apis.ts +196 -0
- package/src/api/star_horse_utils.ts +797 -0
- package/src/api/system.ts +351 -0
- package/src/api/user_func.ts +147 -0
- package/src/api/valid_utils.ts +165 -0
- package/src/assets/css/index.scss +908 -0
- package/src/assets/icons.css +574 -0
- package/src/assets/star-horse-icons.woff +0 -0
- package/src/components/comp/ShDynamicForm.vue +160 -0
- package/src/components/comp/ShForm.vue +30 -0
- package/src/components/comp/ShTableListColumn.vue +61 -0
- package/src/components/comp/StarHorseDataSelector.vue +139 -0
- package/src/components/comp/StarHorseDataView.vue +110 -0
- package/src/components/comp/StarHorseDataViewItems.vue +61 -0
- package/src/components/comp/StarHorseDataViewTable.vue +102 -0
- package/src/components/comp/StarHorseDialog.vue +383 -0
- package/src/components/comp/StarHorseDraggable.vue +401 -0
- package/src/components/comp/StarHorseForm.vue +458 -0
- package/src/components/comp/StarHorseFormItem.vue +82 -0
- package/src/components/comp/StarHorseFormList.vue +516 -0
- package/src/components/comp/StarHorseFormTable.vue +56 -0
- package/src/components/comp/StarHorseIcon.vue +76 -0
- package/src/components/comp/StarHorseItem.vue +302 -0
- package/src/components/comp/StarHorseJsonEditor.vue +115 -0
- package/src/components/comp/StarHorsePopover.vue +66 -0
- package/src/components/comp/StarHorseSearchComp.vue +253 -0
- package/src/components/comp/StarHorseStaticTable.vue +395 -0
- package/src/components/comp/StarHorseTableColumn.vue +249 -0
- package/src/components/comp/StarHorseTableComp.vue +1193 -0
- package/src/components/comp/StarHorseTableViewColumn.vue +61 -0
- package/src/components/comp/StarHorseTree.vue +494 -0
- package/src/components/comp/index.ts +22 -0
- package/src/components/comp/items/UTableColumn.vue +65 -0
- package/src/components/comp/items/boxItem.vue +98 -0
- package/src/components/comp/items/callitem.ts +9 -0
- package/src/components/comp/items/cardItem.vue +152 -0
- package/src/components/comp/items/collapseItem.vue +134 -0
- package/src/components/comp/items/dytableItem.vue +135 -0
- package/src/components/comp/items/otherItem.vue +65 -0
- package/src/components/comp/items/tabItem.vue +155 -0
- package/src/components/comp/items/tabPanelItem.vue +110 -0
- package/src/components/comp/items/tableColumn.vue +129 -0
- package/src/components/comp/items/tableItem.vue +97 -0
- package/src/components/comp/items/tablebtn.vue +158 -0
- package/src/components/comp/items/viewBoxItem.vue +55 -0
- package/src/components/comp/items/viewCardItem.vue +47 -0
- package/src/components/comp/items/viewCollapseItem.vue +71 -0
- package/src/components/comp/items/viewDytableItem.vue +77 -0
- package/src/components/comp/items/viewOtherItem.vue +55 -0
- package/src/components/comp/items/viewTabItem.vue +77 -0
- package/src/components/comp/items/viewTabPanelItem.vue +54 -0
- package/src/components/comp/items/viewTableItem.vue +74 -0
- package/src/components/comp/selfcomp.ts +9 -0
- package/src/components/comp/utils/DataPicker.vue +302 -0
- package/src/components/comp/utils/DataTag.vue +51 -0
- package/src/components/cron/Crontab-Day.vue +230 -0
- package/src/components/cron/Crontab-Hour.vue +165 -0
- package/src/components/cron/Crontab-Min.vue +166 -0
- package/src/components/cron/Crontab-Month.vue +166 -0
- package/src/components/cron/Crontab-Result.vue +615 -0
- package/src/components/cron/Crontab-Second.vue +185 -0
- package/src/components/cron/Crontab-Week.vue +208 -0
- package/src/components/cron/Crontab-Year.vue +183 -0
- package/src/components/cron/Crontab.vue +474 -0
- package/src/components/enums/ModuleEnums.ts +10 -0
- package/src/components/enums/ServiceEnums.ts +18 -0
- package/src/components/formcomp/container/box-container.vue +162 -0
- package/src/components/formcomp/container/callitem.ts +9 -0
- package/src/components/formcomp/container/card-container.vue +170 -0
- package/src/components/formcomp/container/collapse-container.vue +133 -0
- package/src/components/formcomp/container/dytable-col.vue +448 -0
- package/src/components/formcomp/container/dytable-container.vue +57 -0
- package/src/components/formcomp/container/dytableUtils.ts +358 -0
- package/src/components/formcomp/container/group-box-container.vue +331 -0
- package/src/components/formcomp/container/index.ts +6 -0
- package/src/components/formcomp/container/tab-container.vue +153 -0
- package/src/components/formcomp/container/table-container.vue +249 -0
- package/src/components/formcomp/items/allitem.ts +9 -0
- package/src/components/formcomp/items/area-item.vue +116 -0
- package/src/components/formcomp/items/audio-item.vue +163 -0
- package/src/components/formcomp/items/autocomplete-item.vue +118 -0
- package/src/components/formcomp/items/barcode-item.vue +87 -0
- package/src/components/formcomp/items/base-json-item.vue +207 -0
- package/src/components/formcomp/items/button-item.vue +228 -0
- package/src/components/formcomp/items/cascade-item.vue +113 -0
- package/src/components/formcomp/items/checkbox-item.vue +97 -0
- package/src/components/formcomp/items/color-item.vue +70 -0
- package/src/components/formcomp/items/cron-item.vue +115 -0
- package/src/components/formcomp/items/datetime-item.vue +99 -0
- package/src/components/formcomp/items/depart-item.vue +51 -0
- package/src/components/formcomp/items/dialog-input-item.vue +207 -0
- package/src/components/formcomp/items/divider-item.vue +66 -0
- package/src/components/formcomp/items/html-item.vue +65 -0
- package/src/components/formcomp/items/htmleditor-item.vue +104 -0
- package/src/components/formcomp/items/icon-item.vue +195 -0
- package/src/components/formcomp/items/image-item.vue +247 -0
- package/src/components/formcomp/items/index.ts +44 -0
- package/src/components/formcomp/items/input-item.vue +150 -0
- package/src/components/formcomp/items/json-array-item.vue +67 -0
- package/src/components/formcomp/items/json-item.vue +66 -0
- package/src/components/formcomp/items/markdown-item.vue +77 -0
- package/src/components/formcomp/items/number-item.vue +94 -0
- package/src/components/formcomp/items/number-range-item.vue +278 -0
- package/src/components/formcomp/items/page-select-item.vue +407 -0
- package/src/components/formcomp/items/password-item.vue +71 -0
- package/src/components/formcomp/items/qrcode-item.vue +84 -0
- package/src/components/formcomp/items/radio-item.vue +112 -0
- package/src/components/formcomp/items/rate-item.vue +68 -0
- package/src/components/formcomp/items/select-item.vue +133 -0
- package/src/components/formcomp/items/signature-item.vue +216 -0
- package/src/components/formcomp/items/slider-item.vue +68 -0
- package/src/components/formcomp/items/starhorse-form-item.vue +334 -0
- package/src/components/formcomp/items/switch-item.vue +77 -0
- package/src/components/formcomp/items/tag-item.vue +77 -0
- package/src/components/formcomp/items/text-item.vue +75 -0
- package/src/components/formcomp/items/textarea-item.vue +85 -0
- package/src/components/formcomp/items/time-item.vue +77 -0
- package/src/components/formcomp/items/time-picker-item.vue +74 -0
- package/src/components/formcomp/items/transfer-item.vue +93 -0
- package/src/components/formcomp/items/tselect-item.vue +121 -0
- package/src/components/formcomp/items/unknown-item.vue +51 -0
- package/src/components/formcomp/items/upload-item.vue +189 -0
- package/src/components/formcomp/items/user-item.vue +177 -0
- package/src/components/formcomp/items/usercomp-item.vue +85 -0
- package/src/components/formcomp/items/view-markdown-item.vue +77 -0
- package/src/components/formcomp/utils/EditDataDialog.vue +67 -0
- package/src/components/formcomp/utils/FieldList.vue +125 -0
- package/src/components/formcomp/utils/ItemRelationEventUtils.ts +284 -0
- package/src/components/help.vue +31 -0
- package/src/components/menu/MenuItem.vue +95 -0
- package/src/components/menu/SubMenu.vue +68 -0
- package/src/components/menu/SubSystemMenu.vue +142 -0
- package/src/components/register.ts +24 -0
- package/src/components/system/ContentMenu.vue +260 -0
- package/src/components/system/StarHorseButtonList.vue +344 -0
- package/src/components/system/StarHorseMenu.vue +97 -0
- package/src/components/system/StarHorseSvg.vue +62 -0
- package/src/components/system/SystemComp.ts +9 -0
- package/src/components/system/index.ts +4 -0
- package/src/components/types/ApiUrls.ts +168 -0
- package/src/components/types/BtnAction.ts +51 -0
- package/src/components/types/BtnAuth.ts +43 -0
- package/src/components/types/CompInfo.ts +81 -0
- package/src/components/types/DialogProps.ts +55 -0
- package/src/components/types/DyCompField.ts +23 -0
- package/src/components/types/DynamicNode.ts +42 -0
- package/src/components/types/MenusInfo.ts +45 -0
- package/src/components/types/PageFieldInfo.ts +530 -0
- package/src/components/types/PageProps.ts +25 -0
- package/src/components/types/Params.ts +93 -0
- package/src/components/types/RuleType.ts +10 -0
- package/src/components/types/SearchProps.ts +42 -0
- package/src/components/types/ShortKey.ts +30 -0
- package/src/components/types/StarHorseType.ts +18 -0
- package/src/components/types/index.ts +15 -0
- package/src/config/element.ts +15 -0
- package/src/config/styles.ts +4 -0
- package/src/index.ts +98 -0
- package/src/install.ts +33 -0
- package/src/lang/en_US.ts +81 -0
- package/src/lang/index.ts +35 -0
- package/src/lang/zh_CN.ts +84 -0
- package/src/main.ts +57 -0
- package/src/plugins/AblesPlugin.ts +618 -0
- package/src/plugins/registerCompPlugin.ts +15 -0
- package/src/sample/test.vue +9 -0
- package/src/store/ButtonPermission.ts +101 -0
- package/src/store/ConsumerView.ts +52 -0
- package/src/store/ContinusConfig.ts +78 -0
- package/src/store/CopyerOperation.ts +74 -0
- package/src/store/DesignForm.ts +481 -0
- package/src/store/DesignPage.ts +59 -0
- package/src/store/DynamicForm.ts +241 -0
- package/src/store/GlobalConfig.ts +90 -0
- package/src/store/SelfOperation.ts +95 -0
- package/src/store/UserInfo.ts +88 -0
- package/src/store/index.ts +6 -0
- package/src/theme/localStorge.ts +16 -0
- package/src/theme/theme.ts +27 -0
- package/src/utils/FieldOperationUtils.ts +91 -0
- package/src/utils/auth.ts +83 -0
- package/src/utils/message.ts +69 -0
- package/src/utils/preview.ts +125 -0
- package/tsconfig.json +39 -0
- package/tsconfig.node.json +10 -0
- package/vite-env.d.ts +16 -0
- package/vite.config.ts +162 -0
- package/yarn.lock +4627 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Config } from "@/api/settings";
|
|
2
|
+
import { SearchParams } from "@/components/types/Params";
|
|
3
|
+
|
|
4
|
+
export function getToken() {
|
|
5
|
+
return sessionStorage.getItem(Config.TokenKey);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function setUserInfo(userInfo: any) {
|
|
9
|
+
const s = JSON.stringify(userInfo);
|
|
10
|
+
sessionStorage.setItem(Config.loginInfo, s);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function setPublicKey(publicKey: string) {
|
|
14
|
+
sessionStorage.setItem(Config.publicKey, publicKey);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getPublicKey() {
|
|
18
|
+
return sessionStorage.getItem(Config.publicKey);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 设置客户信息
|
|
23
|
+
* @param customerInfo
|
|
24
|
+
*/
|
|
25
|
+
export function setCustomerInfo(customerInfo: any) {
|
|
26
|
+
const s = JSON.stringify(customerInfo);
|
|
27
|
+
sessionStorage.setItem(Config.customerInfo, s);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 获取客户信息
|
|
32
|
+
*/
|
|
33
|
+
export function getCustomerInfo() {
|
|
34
|
+
const str = sessionStorage.getItem(Config.customerInfo);
|
|
35
|
+
//未找到客户编码
|
|
36
|
+
if (!str || str == "undefined") {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return JSON.parse(str);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 获取查询对象
|
|
44
|
+
*/
|
|
45
|
+
export function getCustomerParam(
|
|
46
|
+
propertyName: string = "",
|
|
47
|
+
): SearchParams | null {
|
|
48
|
+
const customerInfo = getCustomerInfo();
|
|
49
|
+
if (!customerInfo || !propertyName) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return { propertyName: propertyName, value: customerInfo.dataNo };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function getUserInfo() {
|
|
56
|
+
const userInfo = sessionStorage.getItem(Config.loginInfo);
|
|
57
|
+
//未找到用户信息
|
|
58
|
+
if (!userInfo) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return JSON.parse(userInfo);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 检测是否系统管理员
|
|
66
|
+
*/
|
|
67
|
+
export function isSystemManage(): boolean {
|
|
68
|
+
const roleList = getUserInfo()?.rolesList?.filter(
|
|
69
|
+
(item: any) => item.roleType == 3,
|
|
70
|
+
);
|
|
71
|
+
return roleList && roleList.length > 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function setToken(token: string, rememberMe: any) {
|
|
75
|
+
if (rememberMe) {
|
|
76
|
+
} else {
|
|
77
|
+
sessionStorage.setItem(Config.TokenKey, token);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function removeToken() {
|
|
82
|
+
sessionStorage.removeItem(Config.TokenKey);
|
|
83
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ElMessageBox } from "element-plus";
|
|
2
|
+
import Message from "vue-m-message";
|
|
3
|
+
import "vue-m-message/dist/style.css";
|
|
4
|
+
|
|
5
|
+
export const operationConfirm = (msg: string): Promise<boolean> => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
ElMessageBox.confirm(msg, "警告", {
|
|
8
|
+
confirmButtonText: "确认",
|
|
9
|
+
cancelButtonText: "取消",
|
|
10
|
+
type: "warning",
|
|
11
|
+
})
|
|
12
|
+
.then(() => {
|
|
13
|
+
resolve(true);
|
|
14
|
+
})
|
|
15
|
+
.catch(() => {
|
|
16
|
+
reject(false);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 消息提
|
|
22
|
+
* @param msg 消息内容
|
|
23
|
+
* @param type 类型
|
|
24
|
+
* @param duration 持续时间
|
|
25
|
+
* @param title 标题
|
|
26
|
+
* @param position 位置
|
|
27
|
+
*/
|
|
28
|
+
export const message = (
|
|
29
|
+
msg: string,
|
|
30
|
+
type: any = "info",
|
|
31
|
+
duration: number = 2000,
|
|
32
|
+
title: string = "提示",
|
|
33
|
+
position: any = "top-right",
|
|
34
|
+
) => {
|
|
35
|
+
Message({
|
|
36
|
+
message: msg,
|
|
37
|
+
type: type ?? "info",
|
|
38
|
+
duration: duration,
|
|
39
|
+
title: title,
|
|
40
|
+
position: position,
|
|
41
|
+
closable: true,
|
|
42
|
+
collapsable: true,
|
|
43
|
+
isCollapsed: false,
|
|
44
|
+
supportHTML: true,
|
|
45
|
+
width: "350px",
|
|
46
|
+
stopTimerOnHover: true,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* 成功提示
|
|
51
|
+
* @param msg 消息内容
|
|
52
|
+
*/
|
|
53
|
+
export const success = (msg: string) => {
|
|
54
|
+
message(msg, "success", 3000, "成功", "bottom-right");
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* 警告提示
|
|
58
|
+
* @param msg 消息内容
|
|
59
|
+
*/
|
|
60
|
+
export const warning = (msg: string) => {
|
|
61
|
+
message(msg, "warning", 3000, "警告", "bottom-right");
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* 错误提示
|
|
65
|
+
* @param msg 消息内容
|
|
66
|
+
*/
|
|
67
|
+
export const error = (msg: string) => {
|
|
68
|
+
message(msg, "error", 3000, "错误", "bottom-right");
|
|
69
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { SearchParams } from "@/components/types/Params";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 解析查询字段类型
|
|
5
|
+
* @param searchForm
|
|
6
|
+
* @param searchFormData
|
|
7
|
+
*/
|
|
8
|
+
export function analysisSearchData(searchForm: any, searchFormData: any) {
|
|
9
|
+
const searchFields = [];
|
|
10
|
+
for (const key in searchForm) {
|
|
11
|
+
let val = searchForm[key];
|
|
12
|
+
const temp = searchFormData.find((item: any) => item.fieldName == key);
|
|
13
|
+
if (val) {
|
|
14
|
+
if (temp?.type == "datarange") {
|
|
15
|
+
val = [val[0] + " 00:00:00", val[1] + " 23:59:59"];
|
|
16
|
+
} else if (temp?.type == "date") {
|
|
17
|
+
val = [val + " 00:00:00", val + " 23:59:59"];
|
|
18
|
+
}
|
|
19
|
+
const param: SearchParams = {
|
|
20
|
+
propertyName: key,
|
|
21
|
+
operation: temp?.matchType || "eq",
|
|
22
|
+
value: val,
|
|
23
|
+
};
|
|
24
|
+
//处理is查询
|
|
25
|
+
if (temp?.matchType == "is") {
|
|
26
|
+
if (val == "null") {
|
|
27
|
+
param.orOperList = [
|
|
28
|
+
{
|
|
29
|
+
propertyName: key,
|
|
30
|
+
operation: "eq",
|
|
31
|
+
value: "",
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
} else if (val == "not null") {
|
|
35
|
+
searchFields.push({
|
|
36
|
+
propertyName: key,
|
|
37
|
+
operation: "neq",
|
|
38
|
+
value: "",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
searchFields.push(param);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return searchFields;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 解析组件
|
|
50
|
+
* @param compList
|
|
51
|
+
*/
|
|
52
|
+
export function analysisFields(compList: Array<any>) {
|
|
53
|
+
const fieldList: Array<any> = [];
|
|
54
|
+
const tabNames: Array<string> = [];
|
|
55
|
+
const objectNames: Array<string> = [];
|
|
56
|
+
const batchNames: Array<string> = [];
|
|
57
|
+
let priority = 1;
|
|
58
|
+
const loopAnalysis = (boxList: Array<any>) => {
|
|
59
|
+
for (const index in boxList) {
|
|
60
|
+
const columns = boxList[index].columns;
|
|
61
|
+
for (const sindex in columns) {
|
|
62
|
+
const items = columns[sindex].items;
|
|
63
|
+
normalAnalysis(items);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const tabListAnalysis = (tabList: Array<any>) => {
|
|
68
|
+
for (const index in tabList) {
|
|
69
|
+
const temp = tabList[index];
|
|
70
|
+
tabNames.push(temp.tabName);
|
|
71
|
+
objectNames.push(temp.objectName);
|
|
72
|
+
normalAnalysis(temp.items);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const tableListAnalysis = (tableObject?: any) => {
|
|
76
|
+
if (tableObject && Object.keys(tableObject).length > 0) {
|
|
77
|
+
batchNames.push(tableObject.batchFieldName);
|
|
78
|
+
const tableList = tableObject.elements;
|
|
79
|
+
for (const index in tableList) {
|
|
80
|
+
const temp = tableList[index];
|
|
81
|
+
normalAnalysis(temp.items);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const normalAnalysis = (dataList: any) => {
|
|
86
|
+
if (dataList?.length > 0) {
|
|
87
|
+
for (const index in dataList) {
|
|
88
|
+
const temp = dataList[index];
|
|
89
|
+
const itempType = temp.itemType;
|
|
90
|
+
if (itempType == "box" || itempType == "dytable") {
|
|
91
|
+
loopAnalysis(temp.preps.elements);
|
|
92
|
+
} else if (
|
|
93
|
+
itempType == "tab" ||
|
|
94
|
+
itempType == "card" ||
|
|
95
|
+
itempType == "collapse"
|
|
96
|
+
) {
|
|
97
|
+
tabListAnalysis(temp.preps.elements);
|
|
98
|
+
} else if (itempType == "table") {
|
|
99
|
+
tableListAnalysis(temp.preps);
|
|
100
|
+
} else {
|
|
101
|
+
if (Object.keys(temp).length > 0) {
|
|
102
|
+
if (Array.isArray(temp)) {
|
|
103
|
+
temp.forEach((item) => {
|
|
104
|
+
item.priority = priority++;
|
|
105
|
+
fieldList.push(item);
|
|
106
|
+
});
|
|
107
|
+
} else if (temp.batchFieldList) {
|
|
108
|
+
temp.batchFieldList.forEach((item: any) => {
|
|
109
|
+
item.fieldList.forEach((sitem: any) => {
|
|
110
|
+
sitem.priority = priority++;
|
|
111
|
+
fieldList.push(sitem);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
temp.priority = priority++;
|
|
116
|
+
fieldList.push(temp);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
normalAnalysis(compList);
|
|
124
|
+
return { fieldList, tabNames, objectNames, batchNames };
|
|
125
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"baseUrl": "./",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@/*": ["./src/*"]
|
|
11
|
+
},
|
|
12
|
+
"types": ["node", "vite/client"],
|
|
13
|
+
/* Bundler mode */
|
|
14
|
+
"moduleResolution": "node",
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"isolatedModules": true,
|
|
17
|
+
"noEmit": false, // 必须改为 false 才能生成声明文件
|
|
18
|
+
"jsx": "preserve",
|
|
19
|
+
// 关闭严格模式
|
|
20
|
+
"strict": false,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": false,
|
|
23
|
+
"noImplicitAny": false,
|
|
24
|
+
"noEmitOnError": false,
|
|
25
|
+
"noFallthroughCasesInSwitch": true,
|
|
26
|
+
"allowSyntheticDefaultImports": true,
|
|
27
|
+
"declaration": true,
|
|
28
|
+
"declarationDir": "dist/types",
|
|
29
|
+
"emitDeclarationOnly": true,
|
|
30
|
+
},
|
|
31
|
+
"outDir": "dist", // 明确指定输出目录
|
|
32
|
+
"include": ["src/**/*", "types/**/*.ts", "node_modules/unplugin-auto-import/auto-imports.d.ts"],
|
|
33
|
+
"exclude": ["dist", "node_modules"],
|
|
34
|
+
"references": [
|
|
35
|
+
{
|
|
36
|
+
"path": "./tsconfig.node.json"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
package/vite-env.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
declare module '*.mjs'
|
|
3
|
+
declare module '*.d.ts'
|
|
4
|
+
declare module 'element-plus/dist/locale/zh-cn' {
|
|
5
|
+
const content: any;
|
|
6
|
+
export default content;
|
|
7
|
+
}
|
|
8
|
+
declare module '*.vue' {
|
|
9
|
+
import type {DefineComponent, ComponentOptions} from 'vue';
|
|
10
|
+
import Vue from 'vue';
|
|
11
|
+
const component: DefineComponent<{}, {}, any> | ComponentOptions | Vue;
|
|
12
|
+
export default component;
|
|
13
|
+
}
|
|
14
|
+
interface ImportMeta {
|
|
15
|
+
readonly glob: (pattern: string) => Record<string, () => Promise<any>>;
|
|
16
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import vue from "@vitejs/plugin-vue";
|
|
3
|
+
import inject from "@rollup/plugin-inject";
|
|
4
|
+
import { resolve } from "path";
|
|
5
|
+
import Components from "unplugin-vue-components/vite";
|
|
6
|
+
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
|
7
|
+
import AutoImport from "unplugin-auto-import/vite";
|
|
8
|
+
import ElementPlus from "unplugin-element-plus/vite";
|
|
9
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
10
|
+
// import {visualizer} from 'rollup-plugin-visualizer';
|
|
11
|
+
//生产types文件插件
|
|
12
|
+
import dts from "vite-plugin-dts";
|
|
13
|
+
// https://vitejs.dev/config/
|
|
14
|
+
/**
|
|
15
|
+
* 此配置文件,非必需不要随便做修改,特别是打包相关的参数
|
|
16
|
+
*/
|
|
17
|
+
export default defineConfig((mode) => {
|
|
18
|
+
let optimizeDepsList: string[] = ["vue", "vue-router", "pinia", "axios"];
|
|
19
|
+
return {
|
|
20
|
+
base: "/",
|
|
21
|
+
optimizeDeps: {
|
|
22
|
+
// force: true,
|
|
23
|
+
include: optimizeDepsList,
|
|
24
|
+
exclude: [],
|
|
25
|
+
},
|
|
26
|
+
plugins: [
|
|
27
|
+
tailwindcss(),
|
|
28
|
+
vue({
|
|
29
|
+
script: {
|
|
30
|
+
// 开启 defineModel
|
|
31
|
+
defineModel: true,
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
ElementPlus({
|
|
35
|
+
// 自动导入样式(无需手动 import 全量 CSS)
|
|
36
|
+
useSource: true,
|
|
37
|
+
}),
|
|
38
|
+
dts({
|
|
39
|
+
entryRoot: "./src",
|
|
40
|
+
outDir: "dist/types",
|
|
41
|
+
insertTypesEntry: true,
|
|
42
|
+
rollupTypes: true,
|
|
43
|
+
tsconfigPath: "./tsconfig.json",
|
|
44
|
+
exclude: ["**/*.svg", "./src/sample/test.vue"],
|
|
45
|
+
}),
|
|
46
|
+
AutoImport({
|
|
47
|
+
imports: [
|
|
48
|
+
"vue",
|
|
49
|
+
{
|
|
50
|
+
"element-plus/es/locale/lang/zh-cn": [
|
|
51
|
+
["default", "zhCn"], // 别名导入中文包
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
vueTemplate: true,
|
|
56
|
+
dts: "./auto-imports.d.ts",
|
|
57
|
+
eslintrc: {
|
|
58
|
+
enabled: true,
|
|
59
|
+
},
|
|
60
|
+
resolvers: [
|
|
61
|
+
ElementPlusResolver({
|
|
62
|
+
importStyle: "sass",
|
|
63
|
+
}),
|
|
64
|
+
],
|
|
65
|
+
}),
|
|
66
|
+
Components({
|
|
67
|
+
dirs: ["src/components", "src/views"],
|
|
68
|
+
// 这里就是相关ui库的解析工具, 里面的选项有是否使用自动导入样式 如果需要通过 var 变量改变主题 需要注意一下
|
|
69
|
+
resolvers: [ElementPlusResolver({ importStyle: "sass" })],
|
|
70
|
+
}),
|
|
71
|
+
// viteCommonjs(),
|
|
72
|
+
inject({
|
|
73
|
+
$: "jquery", // 这里会自动载入 node_modules 中的 jquery
|
|
74
|
+
jQuery: "jquery",
|
|
75
|
+
"windows.jQuery": "jquery",
|
|
76
|
+
"windows.$": "jquery",
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
css: {
|
|
80
|
+
//解决 Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
|
|
81
|
+
preprocessorOptions: {
|
|
82
|
+
scss: {
|
|
83
|
+
api: "modern-compiler", // or 'modern'
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
resolve: {
|
|
88
|
+
alias: {
|
|
89
|
+
"@": resolve(__dirname, "./src"),
|
|
90
|
+
},
|
|
91
|
+
extensions: [".js", ".vue", ".json", ".ts", ".jsx"],
|
|
92
|
+
},
|
|
93
|
+
cacheDir: "node_modules/.vite",
|
|
94
|
+
build: {
|
|
95
|
+
// 告诉打包工具 "vue-demi" 也是外部依赖项
|
|
96
|
+
rollupOptions: {
|
|
97
|
+
external: ["vue", "pinia", "core-js", "elementPlus", "sample/**/*"],
|
|
98
|
+
output: {
|
|
99
|
+
exports: "named",
|
|
100
|
+
assetFileNames: "assets/[name][extname]", // 修正资源输出路径
|
|
101
|
+
// 禁用代码分割
|
|
102
|
+
inlineDynamicImports: true,
|
|
103
|
+
// 合并所有chunk到单个文件
|
|
104
|
+
manualChunks: undefined,
|
|
105
|
+
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
106
|
+
globals: {
|
|
107
|
+
vue: "Vue",
|
|
108
|
+
pinia: "Pinia",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
terserOptions: {
|
|
113
|
+
compress: {
|
|
114
|
+
keep_infinity: true,
|
|
115
|
+
drop_console: true,
|
|
116
|
+
drop_debugger: true,
|
|
117
|
+
},
|
|
118
|
+
format: {
|
|
119
|
+
comments: false,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
lib: {
|
|
123
|
+
entry: "src/index.ts", //指定组件编译入口文件
|
|
124
|
+
name: "star-horse-lowcode",
|
|
125
|
+
fileName: (format) => `index.${format}.js`,
|
|
126
|
+
//'cjs', 'umd'
|
|
127
|
+
formats: ["es"],
|
|
128
|
+
}, //库编译模式配置
|
|
129
|
+
// 开启并行压缩
|
|
130
|
+
parallel: true,
|
|
131
|
+
//chunk 大小警告的限制(以 kbs 为单位)
|
|
132
|
+
chunkSizeWarningLimit: 2000,
|
|
133
|
+
//浏览器兼容性 "esnext"|"modules",升级后用modules 报错
|
|
134
|
+
target: "esnext",
|
|
135
|
+
//指定输出路径
|
|
136
|
+
outDir: "dist",
|
|
137
|
+
//生成静态资源的存放路径
|
|
138
|
+
assetsDir: "assets",
|
|
139
|
+
//小于此阈值的导入或引用资源将内联为 base64 编码,以避免额外的 http 请求。设置为 0 可以完全禁用此项
|
|
140
|
+
assetsInlineLimit: 4096,
|
|
141
|
+
//启用/禁用 CSS 代码拆分
|
|
142
|
+
cssCodeSplit: true,
|
|
143
|
+
//构建后是否生成 source map 文件
|
|
144
|
+
sourcemap: mode.mode === "development",
|
|
145
|
+
//自定义底层的 Rollup 打包配置
|
|
146
|
+
//@rollup/plugin-commonjs 插件的选项
|
|
147
|
+
commonjsOptions: {},
|
|
148
|
+
//构建的库
|
|
149
|
+
//当设置为 true,构建后将会生成 manifest.json 文件
|
|
150
|
+
manifest: false,
|
|
151
|
+
// 设置为 false 可以禁用最小化混淆,
|
|
152
|
+
// 或是用来指定使用哪种混淆器
|
|
153
|
+
// boolean | 'terser' | 'esbuild'
|
|
154
|
+
minify: "terser", //terser 构建后文件体积更小
|
|
155
|
+
//传递给 Terser 的更多 minify 选项。
|
|
156
|
+
//设置为 false 来禁用将构建后的文件写入磁盘
|
|
157
|
+
write: true,
|
|
158
|
+
//默认情况下,若 outDir 在 root 目录下,则 Vite 会在构建时清空该目录。
|
|
159
|
+
emptyOutDir: true,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
});
|