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
package/src/store/DynamicForm.ts
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { defineStore } from "pinia";
|
|
2
|
-
import { warning } from "@/utils/message";
|
|
3
|
-
import { ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export const useDynamicFormStore = defineStore("dynamicForm", () => {
|
|
6
|
-
const dataForm: any = ref({});
|
|
7
|
-
const selectData: any = ref(null);
|
|
8
|
-
const dataId: any = ref(null);
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
*选中数据
|
|
12
|
-
* @param data
|
|
13
|
-
*/
|
|
14
|
-
const setSelectData = (data: object | Array<object>) => {
|
|
15
|
-
selectData.value = data;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* 赋值
|
|
19
|
-
* @param id 数据Id
|
|
20
|
-
*/
|
|
21
|
-
const setDataId = (id: number | string) => {
|
|
22
|
-
dataId.value = id;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* 存数据
|
|
26
|
-
* @param data
|
|
27
|
-
*/
|
|
28
|
-
const setFormData = (data: object) => {
|
|
29
|
-
dataForm.value = { ...data };
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* 向集合添加数据
|
|
33
|
-
* @param batchName
|
|
34
|
-
* @param data
|
|
35
|
-
*/
|
|
36
|
-
const addBatchData = (batchName: string, data: any) => {
|
|
37
|
-
let batchDatas: Array<any> = dataForm.value[batchName] as Array<any>;
|
|
38
|
-
if (!batchDatas || batchDatas.length == 0) {
|
|
39
|
-
dataForm.value[batchName] = [];
|
|
40
|
-
batchDatas = dataForm.value[batchName];
|
|
41
|
-
}
|
|
42
|
-
batchDatas.push(data);
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* 清除视图
|
|
46
|
-
* @param fieldName
|
|
47
|
-
*/
|
|
48
|
-
const delField = (fieldName: string) => {
|
|
49
|
-
delete dataForm.value[fieldName];
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* 删除集合内指定的所有属性
|
|
53
|
-
* @param batchName 集合名称
|
|
54
|
-
* @param fieldName 属性名称
|
|
55
|
-
* @param rowIndex 要删除属性所在的行 从1开始 -1 表示删除所有的属性
|
|
56
|
-
*/
|
|
57
|
-
const delBatchField = (
|
|
58
|
-
batchName: string,
|
|
59
|
-
fieldName: string,
|
|
60
|
-
rowIndex: number = -1,
|
|
61
|
-
) => {
|
|
62
|
-
const batchDatas = dataForm.value[batchName];
|
|
63
|
-
if (!batchDatas || batchDatas.length == 0) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (batchDatas instanceof Object) {
|
|
67
|
-
delete batchDatas[fieldName];
|
|
68
|
-
} else {
|
|
69
|
-
if (rowIndex > 0) {
|
|
70
|
-
delete batchDatas[rowIndex - 1][fieldName];
|
|
71
|
-
} else {
|
|
72
|
-
batchDatas.forEach((item: any) => {
|
|
73
|
-
delete item[fieldName];
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* 设置指定属性的值
|
|
80
|
-
* @param fieldName
|
|
81
|
-
* @param value
|
|
82
|
-
*/
|
|
83
|
-
const addOrUpdateField = (fieldName: string, value: any) => {
|
|
84
|
-
dataForm.value[fieldName] = value;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* 在集合里新增或者修改属性的值
|
|
88
|
-
* @param batchName 集合名称
|
|
89
|
-
* @param fieldName 属性名称
|
|
90
|
-
* @param value 值
|
|
91
|
-
* @param rowIndex 集合索引 从1开始 -1 表示在所有的数据中新增或者修改指定的值
|
|
92
|
-
*/
|
|
93
|
-
const batchAddOrUpdateField = (
|
|
94
|
-
batchName: string,
|
|
95
|
-
fieldName: string,
|
|
96
|
-
value: any,
|
|
97
|
-
rowIndex: number = -1,
|
|
98
|
-
) => {
|
|
99
|
-
let batchDatas = dataForm.value[batchName];
|
|
100
|
-
if (!batchDatas || batchDatas.length == 0) {
|
|
101
|
-
dataForm.value[batchName] = [];
|
|
102
|
-
batchDatas = dataForm.value[batchName];
|
|
103
|
-
}
|
|
104
|
-
if (batchDatas instanceof Object) {
|
|
105
|
-
batchDatas[fieldName] = value;
|
|
106
|
-
} else {
|
|
107
|
-
if (rowIndex > 0) {
|
|
108
|
-
batchDatas[rowIndex - 1][fieldName] = value;
|
|
109
|
-
} else {
|
|
110
|
-
batchDatas.forEach((item: any) => {
|
|
111
|
-
item[fieldName] = value;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* 重命名属性,
|
|
118
|
-
* @param sourceField 原来的属性名
|
|
119
|
-
* @param distField 新的属性名
|
|
120
|
-
* @param newValue 新的值
|
|
121
|
-
*/
|
|
122
|
-
const renameField = (
|
|
123
|
-
sourceField: string,
|
|
124
|
-
distField: string,
|
|
125
|
-
newValue?: any,
|
|
126
|
-
) => {
|
|
127
|
-
if (Object.keys(dataForm.value).includes(distField)) {
|
|
128
|
-
warning("新的属性名已存在,不能进行修改");
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const bakeValue = dataForm.value[sourceField];
|
|
132
|
-
delete dataForm.value[sourceField];
|
|
133
|
-
dataForm.value[distField] = newValue ? newValue : bakeValue;
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* 重命名集合属性,
|
|
137
|
-
* @param batchName 集合名称
|
|
138
|
-
* @param sourceField 原来的属性名
|
|
139
|
-
* @param distField 新的属性名
|
|
140
|
-
* @param newValue 新的值
|
|
141
|
-
* @param rowIndex 指定重命名集合索引 从1开始 ,-1 表示重命名所有属性
|
|
142
|
-
*/
|
|
143
|
-
const batchRenameField = (
|
|
144
|
-
batchName: string,
|
|
145
|
-
sourceField: string,
|
|
146
|
-
distField: string,
|
|
147
|
-
newValue?: any,
|
|
148
|
-
rowIndex: number = -1,
|
|
149
|
-
) => {
|
|
150
|
-
const batchDatas = dataForm.value[batchName];
|
|
151
|
-
if (!batchDatas || batchDatas.length == 0) {
|
|
152
|
-
batchAddOrUpdateField(batchName, distField, newValue, rowIndex);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
const dataFun = (
|
|
156
|
-
data: any,
|
|
157
|
-
sourceField: string,
|
|
158
|
-
distField: string,
|
|
159
|
-
newValue?: any,
|
|
160
|
-
) => {
|
|
161
|
-
if (Object.keys(data).includes(distField)) {
|
|
162
|
-
warning("新的属性名已存在,不能进行修改");
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
const bakeValue: any = data[sourceField];
|
|
166
|
-
delete dataForm.value[sourceField];
|
|
167
|
-
dataForm.value[distField] = newValue || bakeValue;
|
|
168
|
-
return true;
|
|
169
|
-
};
|
|
170
|
-
if (batchDatas instanceof Object) {
|
|
171
|
-
dataFun(batchDatas, sourceField, distField, newValue);
|
|
172
|
-
} else {
|
|
173
|
-
if (rowIndex > 0) {
|
|
174
|
-
dataFun(batchDatas[rowIndex - 1], sourceField, distField, newValue);
|
|
175
|
-
} else {
|
|
176
|
-
batchDatas.forEach((item: any) => {
|
|
177
|
-
const result = dataFun(item, sourceField, distField, newValue);
|
|
178
|
-
if (!result) {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* 获取指定属性的值
|
|
187
|
-
* @param fieldName 属性名称
|
|
188
|
-
*/
|
|
189
|
-
const getFieldValue = (fieldName: string) => {
|
|
190
|
-
return dataForm.value[fieldName];
|
|
191
|
-
};
|
|
192
|
-
/**
|
|
193
|
-
* 获取集合指定属性的数据
|
|
194
|
-
* @param batchName 集合名称
|
|
195
|
-
* @param fieldName 属性名称
|
|
196
|
-
* @param rowIndex 指定获取集合索引数据 从1开始,-1表示获取所有
|
|
197
|
-
*/
|
|
198
|
-
const getBatchFieldValue = (
|
|
199
|
-
batchName: string,
|
|
200
|
-
fieldName: string,
|
|
201
|
-
rowIndex: number = -1,
|
|
202
|
-
) => {
|
|
203
|
-
const batchDatas = dataForm.value[batchName];
|
|
204
|
-
if (!batchDatas) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
if (batchDatas instanceof Object) {
|
|
208
|
-
return batchDatas[fieldName];
|
|
209
|
-
} else {
|
|
210
|
-
if (rowIndex > 0) {
|
|
211
|
-
return batchDatas[rowIndex - 1][fieldName];
|
|
212
|
-
} else {
|
|
213
|
-
return batchDatas.map((item: any) => item[fieldName]);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* 清除所有Tab
|
|
219
|
-
*/
|
|
220
|
-
const clearAll = () => {
|
|
221
|
-
dataForm.value = {};
|
|
222
|
-
};
|
|
223
|
-
return {
|
|
224
|
-
dataForm,
|
|
225
|
-
selectData,
|
|
226
|
-
dataId,
|
|
227
|
-
setSelectData,
|
|
228
|
-
setDataId,
|
|
229
|
-
setFormData,
|
|
230
|
-
addBatchData,
|
|
231
|
-
delField,
|
|
232
|
-
delBatchField,
|
|
233
|
-
addOrUpdateField,
|
|
234
|
-
batchAddOrUpdateField,
|
|
235
|
-
renameField,
|
|
236
|
-
batchRenameField,
|
|
237
|
-
getFieldValue,
|
|
238
|
-
getBatchFieldValue,
|
|
239
|
-
clearAll,
|
|
240
|
-
};
|
|
241
|
-
});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { defineStore } from "pinia";
|
|
2
|
-
import { Config } from "@/api/settings";
|
|
3
|
-
import { ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export const useGlobalConfigStore = defineStore(
|
|
6
|
-
"globalConfig",
|
|
7
|
-
() => {
|
|
8
|
-
const configFormInfo = ref<any>({});
|
|
9
|
-
/**
|
|
10
|
-
*设置数据
|
|
11
|
-
* @param data
|
|
12
|
-
*/
|
|
13
|
-
const setConfigFormInfo = (data: any) => {
|
|
14
|
-
configFormInfo.value = data;
|
|
15
|
-
localStorage.setItem("starHorseConfigInfo", JSON.stringify(data));
|
|
16
|
-
Config.buttonStyle.value = data.buttonShowType || "dropdown";
|
|
17
|
-
if (data.themeColor) {
|
|
18
|
-
document.documentElement.style.setProperty(
|
|
19
|
-
"--star-horse-style",
|
|
20
|
-
data.themeColor,
|
|
21
|
-
);
|
|
22
|
-
document.documentElement.style.setProperty(
|
|
23
|
-
"--el-color-primary",
|
|
24
|
-
data.themeColor,
|
|
25
|
-
);
|
|
26
|
-
document.documentElement.style.setProperty(
|
|
27
|
-
"--el-select-input-color",
|
|
28
|
-
data.themeColor,
|
|
29
|
-
);
|
|
30
|
-
document.documentElement.style.setProperty(
|
|
31
|
-
"--el-pagination-button-color",
|
|
32
|
-
data.themeColor,
|
|
33
|
-
);
|
|
34
|
-
document.documentElement.style.setProperty(
|
|
35
|
-
"--el-tree-expand-icon-color",
|
|
36
|
-
data.themeColor,
|
|
37
|
-
);
|
|
38
|
-
document.documentElement.style.setProperty(
|
|
39
|
-
"--fc-button-bg-color",
|
|
40
|
-
data.themeColor,
|
|
41
|
-
);
|
|
42
|
-
document.documentElement.style.setProperty(
|
|
43
|
-
"--fc-button-border-color",
|
|
44
|
-
data.themeColor,
|
|
45
|
-
);
|
|
46
|
-
document.documentElement.style.setProperty(
|
|
47
|
-
"--fc-button-active-bg-color",
|
|
48
|
-
data.themeColor,
|
|
49
|
-
);
|
|
50
|
-
document.documentElement.style.setProperty(
|
|
51
|
-
"--fc-button-active-border-color",
|
|
52
|
-
data.themeColor,
|
|
53
|
-
);
|
|
54
|
-
document.documentElement.style.setProperty(
|
|
55
|
-
"--fc-button-hover-bg-color",
|
|
56
|
-
data.themeColor,
|
|
57
|
-
);
|
|
58
|
-
document.documentElement.style.setProperty(
|
|
59
|
-
"--fc-button-hover-border-color",
|
|
60
|
-
data.themeColor,
|
|
61
|
-
);
|
|
62
|
-
// document.documentElement.style.setProperty('--fc-button-text-color', "#000");
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* 清除所有Tab
|
|
67
|
-
*/
|
|
68
|
-
const clearAll = (isDark: string = "N") => {
|
|
69
|
-
configFormInfo.value = {
|
|
70
|
-
tagsView: "Y",
|
|
71
|
-
position: "left",
|
|
72
|
-
menusCfg: "tradition",
|
|
73
|
-
isDark,
|
|
74
|
-
};
|
|
75
|
-
const starHorseConfigInfo = localStorage.getItem("starHorseConfigInfo");
|
|
76
|
-
if (starHorseConfigInfo) {
|
|
77
|
-
setConfigFormInfo(JSON.parse(starHorseConfigInfo));
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
configFormInfo,
|
|
83
|
-
setConfigFormInfo,
|
|
84
|
-
clearAll,
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
persist: false,
|
|
89
|
-
},
|
|
90
|
-
);
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { defineStore } from "pinia";
|
|
2
|
-
import { Ref, ref } from "vue";
|
|
3
|
-
import { PageFieldInfo } from "@/components/types/PageFieldInfo";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 用户自定义方法处理逻辑
|
|
7
|
-
*/
|
|
8
|
-
export const useSelfOperationStore = defineStore("selfOperation", () => {
|
|
9
|
-
const formFieldList = ref<PageFieldInfo>({});
|
|
10
|
-
const fieldItemList = ref<any>({});
|
|
11
|
-
const formData = ref<any>({});
|
|
12
|
-
const formInstance = ref();
|
|
13
|
-
/**
|
|
14
|
-
* 设置表单信息
|
|
15
|
-
* @param fieldList
|
|
16
|
-
*/
|
|
17
|
-
const setFormFields = (fieldList: PageFieldInfo) => {
|
|
18
|
-
formFieldList.value = fieldList;
|
|
19
|
-
};
|
|
20
|
-
const setFormInstance = (formRef: Ref) => {
|
|
21
|
-
formInstance.value = formRef.value;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* 设置实例数据
|
|
25
|
-
* @param data
|
|
26
|
-
*/
|
|
27
|
-
const setFormData = (data: any) => {
|
|
28
|
-
formData.value = data;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* 添加
|
|
32
|
-
* @param formItem
|
|
33
|
-
*/
|
|
34
|
-
const addFormItem = (formItem: any) => {
|
|
35
|
-
if (!formItem || (!formItem.fieldName && !formItem.preps?.name)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
fieldItemList.value[formItem.fieldName || formItem.preps?.name] = formItem;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 批量添加
|
|
43
|
-
* @param formItems
|
|
44
|
-
*/
|
|
45
|
-
const addFormItemList = (formItems: Array<any>) => {
|
|
46
|
-
if (!formItems) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
for (const index in formItems) {
|
|
50
|
-
const formItem = formItems[index];
|
|
51
|
-
fieldItemList.value[formItem.fieldName || formItem.preps?.name] =
|
|
52
|
-
formItem;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* 获取属性配置信息
|
|
57
|
-
* @param fieldName
|
|
58
|
-
*/
|
|
59
|
-
const getFormItem = (fieldName: string) => {
|
|
60
|
-
return fieldItemList.value[fieldName] || {};
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* 一个模块只能操作一个表单
|
|
64
|
-
* 初始化数据
|
|
65
|
-
*/
|
|
66
|
-
const init = (fieldList: PageFieldInfo, data: any, formRef: Ref) => {
|
|
67
|
-
formFieldList.value = fieldList;
|
|
68
|
-
fieldItemList.value = {};
|
|
69
|
-
formData.value = data;
|
|
70
|
-
formInstance.value = formRef;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* 清除掉数据
|
|
74
|
-
*/
|
|
75
|
-
const clearAll = () => {
|
|
76
|
-
formFieldList.value = {};
|
|
77
|
-
fieldItemList.value = {};
|
|
78
|
-
formData.value = {};
|
|
79
|
-
formInstance.value = null;
|
|
80
|
-
};
|
|
81
|
-
return {
|
|
82
|
-
formFieldList,
|
|
83
|
-
fieldItemList,
|
|
84
|
-
formInstance,
|
|
85
|
-
formData,
|
|
86
|
-
setFormInstance,
|
|
87
|
-
setFormFields,
|
|
88
|
-
setFormData,
|
|
89
|
-
addFormItem,
|
|
90
|
-
addFormItemList,
|
|
91
|
-
getFormItem,
|
|
92
|
-
init,
|
|
93
|
-
clearAll,
|
|
94
|
-
};
|
|
95
|
-
});
|
package/src/store/UserInfo.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { defineStore } from "pinia";
|
|
2
|
-
import { MenusInfo } from "@/components/types/MenusInfo";
|
|
3
|
-
import { ref } from "vue";
|
|
4
|
-
|
|
5
|
-
export const useUserInfoStore = defineStore(
|
|
6
|
-
"userInfo",
|
|
7
|
-
() => {
|
|
8
|
-
const userInfo = ref<any>({});
|
|
9
|
-
const pageButtonPermission = ref<any>({});
|
|
10
|
-
const permissionMenus = ref<any>([]);
|
|
11
|
-
const dynamicMenus = ref<any>([]);
|
|
12
|
-
const loginDialogVisible = ref<boolean>(false);
|
|
13
|
-
|
|
14
|
-
const showLoginDialog = () => {
|
|
15
|
-
loginDialogVisible.value = true;
|
|
16
|
-
};
|
|
17
|
-
const closeLoginDialog = () => {
|
|
18
|
-
loginDialogVisible.value = false;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* 用户登录
|
|
22
|
-
* @param data
|
|
23
|
-
*/
|
|
24
|
-
const login = (data: any) => {
|
|
25
|
-
userInfo.value = data;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* 用户登出
|
|
29
|
-
*/
|
|
30
|
-
const logout = () => {
|
|
31
|
-
// this.userInfo = {};
|
|
32
|
-
permissionMenus.value = [];
|
|
33
|
-
dynamicMenus.value = [];
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* 权限菜单
|
|
37
|
-
* @param data
|
|
38
|
-
*/
|
|
39
|
-
const addPermissionMenus = (data: any) => {
|
|
40
|
-
permissionMenus.value = data;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* 添加页面按钮权限
|
|
44
|
-
* @param data
|
|
45
|
-
*/
|
|
46
|
-
const addPageButtonPermission = (data: any) => {
|
|
47
|
-
pageButtonPermission.value = data;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* 记录菜单权限
|
|
51
|
-
* @param menuId
|
|
52
|
-
* @param data
|
|
53
|
-
*/
|
|
54
|
-
const pushPageButtonPermission = (menuId: string, data: any) => {
|
|
55
|
-
pageButtonPermission.value[menuId] = data;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* 添加动态菜单
|
|
59
|
-
* @param data
|
|
60
|
-
*/
|
|
61
|
-
const addDynamicMenus = (data: MenusInfo) => {
|
|
62
|
-
if (!dynamicMenus.value) {
|
|
63
|
-
dynamicMenus.value = [];
|
|
64
|
-
}
|
|
65
|
-
if (data) {
|
|
66
|
-
dynamicMenus.value.push(data);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
return {
|
|
70
|
-
userInfo,
|
|
71
|
-
pageButtonPermission,
|
|
72
|
-
permissionMenus,
|
|
73
|
-
dynamicMenus,
|
|
74
|
-
showLoginDialog,
|
|
75
|
-
loginDialogVisible,
|
|
76
|
-
closeLoginDialog,
|
|
77
|
-
login,
|
|
78
|
-
logout,
|
|
79
|
-
addPermissionMenus,
|
|
80
|
-
addPageButtonPermission,
|
|
81
|
-
pushPageButtonPermission,
|
|
82
|
-
addDynamicMenus,
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
persist: true,
|
|
87
|
-
},
|
|
88
|
-
);
|
package/src/store/index.ts
DELETED
package/src/theme/localStorge.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LangType } from "./theme";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 获取系统语言
|
|
5
|
-
*/
|
|
6
|
-
export function getLang(): LangType {
|
|
7
|
-
return (localStorage.getItem("lang") as LangType) || LangType.ZH_CN;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 设置系统语言
|
|
12
|
-
* @param lang
|
|
13
|
-
*/
|
|
14
|
-
export function setLang(lang: LangType) {
|
|
15
|
-
return localStorage.setItem("lang", lang);
|
|
16
|
-
}
|
package/src/theme/theme.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export enum ThemeType {
|
|
2
|
-
Light = "light",
|
|
3
|
-
Dark = "dark",
|
|
4
|
-
DarkDimmed = "darkDimmed",
|
|
5
|
-
FollowOs = "followOs",
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export enum EditorThemeType {
|
|
9
|
-
DashboardLightTheme = "DashboardLightTheme",
|
|
10
|
-
DashboardBlackTheme = "DashboardBlackTheme",
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export enum PrimaryColorType {
|
|
14
|
-
Polar_Green = "polar-green",
|
|
15
|
-
Golden_Purple = "golden-purple",
|
|
16
|
-
Polar_Blue = "polar-blue",
|
|
17
|
-
Silver = "silver",
|
|
18
|
-
Red = "red",
|
|
19
|
-
Orange = "orange",
|
|
20
|
-
Blue2 = "blue2",
|
|
21
|
-
Gold = "gold",
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export enum LangType {
|
|
25
|
-
EN_US = "en_us",
|
|
26
|
-
ZH_CN = "zh_cn",
|
|
27
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { uuid } from "@/api/system";
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import { useDesignFormStore } from "@/store/DesignForm";
|
|
4
|
-
import piniaInstance from "@/store";
|
|
5
|
-
|
|
6
|
-
const designForm = useDesignFormStore(piniaInstance);
|
|
7
|
-
const formData = computed(() => designForm.formData);
|
|
8
|
-
const numField: Array<string> = [
|
|
9
|
-
"minlength",
|
|
10
|
-
"maxLength",
|
|
11
|
-
"step",
|
|
12
|
-
"rows",
|
|
13
|
-
"height",
|
|
14
|
-
"width",
|
|
15
|
-
"columns",
|
|
16
|
-
"gutter",
|
|
17
|
-
"limit",
|
|
18
|
-
"precision",
|
|
19
|
-
"min",
|
|
20
|
-
"max",
|
|
21
|
-
"highThreshold",
|
|
22
|
-
"lowThreshold",
|
|
23
|
-
"multipleLimit",
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 处理默认值
|
|
28
|
-
* @param type
|
|
29
|
-
*/
|
|
30
|
-
const getDefaultVal = (type: string) => {
|
|
31
|
-
if (type == "number" || type == "slider" || type == "rate") {
|
|
32
|
-
return undefined;
|
|
33
|
-
} else if (type == "checkbox" || type == "transfer") {
|
|
34
|
-
return [];
|
|
35
|
-
} else {
|
|
36
|
-
return "";
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* 复制字段
|
|
42
|
-
* @param data
|
|
43
|
-
* @param type
|
|
44
|
-
*/
|
|
45
|
-
export function fieldCopy(data: any, type: string) {
|
|
46
|
-
const reData = JSON.parse(JSON.stringify(data));
|
|
47
|
-
//如果数据没有索引,则初始化索引
|
|
48
|
-
const ms = designForm.getFieldDataIndex();
|
|
49
|
-
const mvData: any = {};
|
|
50
|
-
mvData["id"] = "Id" + uuid();
|
|
51
|
-
// console.log(reData);
|
|
52
|
-
/**
|
|
53
|
-
* 处理preps
|
|
54
|
-
*/
|
|
55
|
-
const preps = reData.preps;
|
|
56
|
-
mvData["preps"] = {};
|
|
57
|
-
for (const key in preps) {
|
|
58
|
-
const temp = preps[key];
|
|
59
|
-
if (numField.includes(temp.fieldName)) {
|
|
60
|
-
try {
|
|
61
|
-
mvData.preps[temp.fieldName] = parseInt(temp.defaultValues);
|
|
62
|
-
} catch (e) {
|
|
63
|
-
mvData.preps[temp.fieldName] = null;
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
mvData.preps[temp.fieldName] = temp.defaultValues;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
mvData.preps["id"] = mvData["id"];
|
|
70
|
-
mvData.preps["label"] = reData.itemName;
|
|
71
|
-
mvData.preps["itemNameLabel"] = reData.itemName;
|
|
72
|
-
mvData.preps["name"] = reData.itemType + ms;
|
|
73
|
-
formData.value[reData.preps.fieldName] = getDefaultVal(reData.itemType);
|
|
74
|
-
mvData["compType"] = type;
|
|
75
|
-
mvData["itemType"] = reData.itemType;
|
|
76
|
-
if (reData.itemType == "box") {
|
|
77
|
-
mvData.preps["elements"] = [
|
|
78
|
-
{ rowIndex: 1, columns: [{ colIndex: 1, colspan: 24, items: [] }] },
|
|
79
|
-
];
|
|
80
|
-
} else if (reData.itemType == "table") {
|
|
81
|
-
mvData.preps["elements"] = [{ colIndex: 1, columns: 1, items: [] }];
|
|
82
|
-
} else if (reData.itemType == "dytable") {
|
|
83
|
-
mvData.preps["elements"] = [
|
|
84
|
-
{
|
|
85
|
-
colIndex: 1,
|
|
86
|
-
columns: [{ colIndex: 1, colspan: 1, rowspan: 1, items: [] }],
|
|
87
|
-
},
|
|
88
|
-
];
|
|
89
|
-
}
|
|
90
|
-
return mvData;
|
|
91
|
-
}
|