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,61 @@
|
|
|
1
|
+
<script setup lang="ts" name="StarHorseTableColumn">
|
|
2
|
+
import { createDatetime } from "@/api/date_utils";
|
|
3
|
+
import { parseListData } from "@/api/form_utils";
|
|
4
|
+
import { Config } from "@/api/settings";
|
|
5
|
+
import { PropType } from "vue";
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
batchName: { type: String, default: "" },
|
|
9
|
+
item: { type: Object as PropType<any>, required: true },
|
|
10
|
+
commonFormat: { type: Function, required: true },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const dataFormat = (scope: any) => {
|
|
14
|
+
let item = props.item;
|
|
15
|
+
let val: string = scope.row[item.hideName || item.fieldName];
|
|
16
|
+
if (
|
|
17
|
+
item.type == "select" ||
|
|
18
|
+
item.type == "checkbox" ||
|
|
19
|
+
item.type == "radio"
|
|
20
|
+
) {
|
|
21
|
+
return parseListData(item, val);
|
|
22
|
+
}
|
|
23
|
+
if (item.type == "date" || item.type == "datetime") {
|
|
24
|
+
return createDatetime(val);
|
|
25
|
+
}
|
|
26
|
+
if (props.commonFormat && scope.column.property) {
|
|
27
|
+
return props.commonFormat(scope.column.property, val, scope.row);
|
|
28
|
+
}
|
|
29
|
+
return val;
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
<template>
|
|
33
|
+
<el-table-column
|
|
34
|
+
:prop="item.hideName || item.fieldName"
|
|
35
|
+
:label="item.label"
|
|
36
|
+
sortable
|
|
37
|
+
:show-overflow-tooltip="true"
|
|
38
|
+
v-if="item.formVisible || item.listVisible || item.viewVisible"
|
|
39
|
+
:min-width="(item.minWidth || Config.defaultColumnWidth) + 'px'"
|
|
40
|
+
>
|
|
41
|
+
<template #default="scope">
|
|
42
|
+
{{ dataFormat(scope) }}
|
|
43
|
+
</template>
|
|
44
|
+
</el-table-column>
|
|
45
|
+
</template>
|
|
46
|
+
<style lang="scss">
|
|
47
|
+
tbody {
|
|
48
|
+
.cell {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: row;
|
|
51
|
+
|
|
52
|
+
.el-table__expand-icon {
|
|
53
|
+
margin-top: 5px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
p {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {computed, ModelRef, nextTick, onMounted, PropType, reactive, ref, unref,} from "vue";
|
|
3
|
+
import SubSystemMenu from "@/components/menu/SubSystemMenu.vue";
|
|
4
|
+
import {useGlobalConfigStore} from "@/store/GlobalConfig";
|
|
5
|
+
import piniaInstance from "@/store";
|
|
6
|
+
import {PageProps} from "@/components/types/PageProps";
|
|
7
|
+
import {ApiUrls} from "@/components/types/ApiUrls";
|
|
8
|
+
import {warning} from "@/utils/message";
|
|
9
|
+
import {SearchParams} from "@/components/types/Params";
|
|
10
|
+
import {OrderByInfo} from "@/components/types/PageFieldInfo";
|
|
11
|
+
import {postRequest} from "@/api/star_horse_apis";
|
|
12
|
+
import {closeLoad, createCondition} from "@/api/star_horse_utils";
|
|
13
|
+
import {isSystemManage} from "@/utils/auth";
|
|
14
|
+
import {Config} from "@/api/settings";
|
|
15
|
+
import Help from "@/components/help.vue";
|
|
16
|
+
import {compKey} from "@/api/system";
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
preps: {
|
|
20
|
+
type: Object as PropType<any>,
|
|
21
|
+
default: () => {
|
|
22
|
+
return {
|
|
23
|
+
value: "value",
|
|
24
|
+
label: "name",
|
|
25
|
+
children: "children",
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
helpMsg: {type: String},
|
|
30
|
+
showCollapse: {type: Boolean, default: false},
|
|
31
|
+
treeTitle: {type: String, default: "树形菜单"},
|
|
32
|
+
expand: {type: Boolean, default: false},
|
|
33
|
+
height: {type: Number, default: 600},
|
|
34
|
+
//是否显示复选框
|
|
35
|
+
showCheckBox: {type: Boolean, default: false},
|
|
36
|
+
//是否显示已选中的数据
|
|
37
|
+
showSelectData: {type: Boolean, default: false},
|
|
38
|
+
checkStrictly: {type: Boolean, default: true},
|
|
39
|
+
//是否显示搜索框
|
|
40
|
+
showSearch: {type: Boolean, default: true},
|
|
41
|
+
checkOnClickNode: {type: Boolean, default: true},
|
|
42
|
+
treeType: {type: String, default: "tree"},
|
|
43
|
+
//在标签上显示值
|
|
44
|
+
showCode: {type: Boolean, default: false},
|
|
45
|
+
//是否显示分页
|
|
46
|
+
showPageBar: {type: Boolean, default: false},
|
|
47
|
+
//是否动态数据
|
|
48
|
+
isDynamicData: {type: Boolean, default: false},
|
|
49
|
+
//是否自动加载数据
|
|
50
|
+
autoLoad: {type: Boolean, default: true},
|
|
51
|
+
//接口地址
|
|
52
|
+
compUrl: {type: Object as PropType<ApiUrls>},
|
|
53
|
+
//按钮名称
|
|
54
|
+
btnTitle: {type: String, default: "添加数据"},
|
|
55
|
+
//按钮是否可见
|
|
56
|
+
btnVisible: {type: Boolean, default: false},
|
|
57
|
+
rmvTitle: {type: String, default: "删除数据"},
|
|
58
|
+
rmvVisible: {type: Boolean, default: false},
|
|
59
|
+
//是否显示下拉按钮
|
|
60
|
+
showDropdown: {type: Boolean, default: true},
|
|
61
|
+
/**
|
|
62
|
+
* 数据共享人
|
|
63
|
+
* 拿到别人共享的信息
|
|
64
|
+
* let resultData = await loadData('/system-config/system/dataPermission/currentMenuPermissionPerson', {});
|
|
65
|
+
* 上面接口主要返回共享人的账号
|
|
66
|
+
* commonPersons.value = resultData?.data;
|
|
67
|
+
*/
|
|
68
|
+
commonPersons: {type: Array as PropType<any>, default: []},
|
|
69
|
+
});
|
|
70
|
+
const emits = defineEmits([
|
|
71
|
+
"selectData",
|
|
72
|
+
"changeCollapse",
|
|
73
|
+
"addData",
|
|
74
|
+
"removeData",
|
|
75
|
+
]);
|
|
76
|
+
let configStore = useGlobalConfigStore(piniaInstance);
|
|
77
|
+
let compSize = computed(
|
|
78
|
+
() => configStore.configFormInfo?.inputSize || Config.compSize,
|
|
79
|
+
);
|
|
80
|
+
const treeRef = ref<any>();
|
|
81
|
+
const menuTreeRef = ref<any>();
|
|
82
|
+
const searchData = ref("");
|
|
83
|
+
const treeDatas: ModelRef<any> = defineModel("treeDatas");
|
|
84
|
+
let menuIcon = ref<string>("expand");
|
|
85
|
+
let collapse = ref<boolean>(false);
|
|
86
|
+
const _compKey = compKey;
|
|
87
|
+
let pageInfo = reactive<PageProps>({
|
|
88
|
+
pageSize: 20,
|
|
89
|
+
currentPage: 1,
|
|
90
|
+
totalData: 0,
|
|
91
|
+
totalPage: 0,
|
|
92
|
+
dataList: [],
|
|
93
|
+
});
|
|
94
|
+
const onQueryChanged = (query: string) => {
|
|
95
|
+
treeRef.value!.filter(query);
|
|
96
|
+
};
|
|
97
|
+
const filterMethod = (query: string, node: any) => {
|
|
98
|
+
return node[props.preps?.label]!.toLowerCase().includes(query?.toLowerCase());
|
|
99
|
+
};
|
|
100
|
+
const changeArrow = (evt: MouseEvent) => {
|
|
101
|
+
if (evt) {
|
|
102
|
+
evt.preventDefault();
|
|
103
|
+
evt.stopPropagation();
|
|
104
|
+
}
|
|
105
|
+
collapse.value = !collapse.value;
|
|
106
|
+
menuIcon.value = unref(menuIcon) == "expand" ? "collapse" : "expand";
|
|
107
|
+
emits("changeCollapse", collapse.value);
|
|
108
|
+
};
|
|
109
|
+
const treeOperation = (cmd: string) => {
|
|
110
|
+
if (props.treeType == "tree") {
|
|
111
|
+
if (cmd == "add") {
|
|
112
|
+
emits("addData", {});
|
|
113
|
+
} else if (cmd == "collapse") {
|
|
114
|
+
Object.values(treeRef.value!.store.nodesMap).forEach((v: any) =>
|
|
115
|
+
v.collapse(),
|
|
116
|
+
);
|
|
117
|
+
} else {
|
|
118
|
+
Object.values(treeRef.value!.store.nodesMap).forEach((v: any) =>
|
|
119
|
+
v.expand(),
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
const getAllSubNodeIndex = (datas: any) => {
|
|
124
|
+
datas.forEach((item: any) => {
|
|
125
|
+
if (item.children && item.children.length > 0) {
|
|
126
|
+
if (cmd == "add") {
|
|
127
|
+
emits("addData", {});
|
|
128
|
+
} else if (cmd == "collapse") {
|
|
129
|
+
menuTreeRef.value.close(item[props.preps.value]);
|
|
130
|
+
} else {
|
|
131
|
+
menuTreeRef.value!.open(item[props.preps.value]);
|
|
132
|
+
}
|
|
133
|
+
getAllSubNodeIndex(item.children);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
getAllSubNodeIndex(treeDatas.value);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
let selectedDataList = ref<Array<any>>([]);
|
|
141
|
+
const operSelectData = (data: any, checked: boolean) => {
|
|
142
|
+
if (checked) {
|
|
143
|
+
let hasData = selectedDataList.value.find(
|
|
144
|
+
(item) => item[props.preps.value] == data[props.preps.value],
|
|
145
|
+
);
|
|
146
|
+
if (!hasData) {
|
|
147
|
+
selectedDataList.value.push(data);
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
for (let index in selectedDataList.value) {
|
|
151
|
+
let temp = selectedDataList.value[index];
|
|
152
|
+
if (temp[props.preps?.value] == data[props.preps?.value]) {
|
|
153
|
+
selectedDataList.value.splice(Number(index), 1);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
treeRef.value!.setChecked(data, checked);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const setSelectData = (datas: Array<any>) => {
|
|
161
|
+
//设置数据选中自动会再次赋值
|
|
162
|
+
selectedDataList.value = datas;
|
|
163
|
+
datas.forEach((item) => {
|
|
164
|
+
treeRef.value!.setChecked(item, true);
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
const getSelectData = () => {
|
|
168
|
+
return selectedDataList.value;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 点击事件
|
|
173
|
+
* @param data
|
|
174
|
+
* @param checked
|
|
175
|
+
*/
|
|
176
|
+
const treeChange = (data: any, checked: boolean) => {
|
|
177
|
+
operSelectData(data, checked);
|
|
178
|
+
emits("selectData", data, checked);
|
|
179
|
+
};
|
|
180
|
+
const menuChange = (data: any) => {
|
|
181
|
+
emits("selectData", data);
|
|
182
|
+
};
|
|
183
|
+
const addData = (item: any) => {
|
|
184
|
+
emits("addData", item);
|
|
185
|
+
};
|
|
186
|
+
const removeData = (item: any) => {
|
|
187
|
+
emits("removeData", item);
|
|
188
|
+
};
|
|
189
|
+
const pageSizeClick = (pageSize: number) => {
|
|
190
|
+
pageInfo.pageSize = pageSize;
|
|
191
|
+
loadByPage();
|
|
192
|
+
};
|
|
193
|
+
const pageChangeClick = (currentPage: number) => {
|
|
194
|
+
pageInfo.currentPage = currentPage;
|
|
195
|
+
loadByPage();
|
|
196
|
+
};
|
|
197
|
+
let searchParams: SearchParams[] = [];
|
|
198
|
+
let orderBys: OrderByInfo[] = [];
|
|
199
|
+
const createSearchParams = (
|
|
200
|
+
params: SearchParams[] = [],
|
|
201
|
+
orderBy: OrderByInfo[] = [],
|
|
202
|
+
) => {
|
|
203
|
+
searchParams = params;
|
|
204
|
+
orderBys = orderBy;
|
|
205
|
+
loadByPage();
|
|
206
|
+
};
|
|
207
|
+
const expandData = () => {
|
|
208
|
+
if (props.expand) {
|
|
209
|
+
setTimeout(() => {
|
|
210
|
+
treeOperation("expand");
|
|
211
|
+
}, 800);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const loadByPage = async () => {
|
|
215
|
+
//加入共享人的信息
|
|
216
|
+
if (props.commonPersons?.length && !isSystemManage()) {
|
|
217
|
+
searchParams.push(
|
|
218
|
+
createCondition("a.createdBy", props.commonPersons, "in"),
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
let params: any = {
|
|
222
|
+
currentPage: pageInfo.currentPage,
|
|
223
|
+
pageSize: pageInfo.pageSize,
|
|
224
|
+
fieldList: searchParams,
|
|
225
|
+
orderBy: orderBys,
|
|
226
|
+
};
|
|
227
|
+
postRequest(props.compUrl?.pageListUrl!, params)
|
|
228
|
+
.then((res: any) => {
|
|
229
|
+
if (!res || res.data.code != 0) {
|
|
230
|
+
console.error(res?.data?.cnMessage || "接口异常");
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
let redata = res.data.data;
|
|
234
|
+
//如果不是分页之间显示返回的所有数据
|
|
235
|
+
treeDatas.value = redata?.dataList || redata;
|
|
236
|
+
pageInfo.totalPage = redata.totalPages;
|
|
237
|
+
pageInfo.totalData = redata.totalDatas;
|
|
238
|
+
})
|
|
239
|
+
.catch((err: any) => {
|
|
240
|
+
console.log(err);
|
|
241
|
+
})
|
|
242
|
+
.finally(() => {
|
|
243
|
+
closeLoad();
|
|
244
|
+
});
|
|
245
|
+
await nextTick();
|
|
246
|
+
expandData();
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const init = async () => {
|
|
250
|
+
if (props.isDynamicData) {
|
|
251
|
+
if (!props.compUrl) {
|
|
252
|
+
warning("动态数据须配置数据获取接口");
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (props.autoLoad) {
|
|
256
|
+
loadByPage();
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
await nextTick();
|
|
260
|
+
expandData();
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
onMounted(() => {
|
|
265
|
+
init();
|
|
266
|
+
});
|
|
267
|
+
defineExpose({
|
|
268
|
+
getSelectData,
|
|
269
|
+
setSelectData,
|
|
270
|
+
createSearchParams,
|
|
271
|
+
});
|
|
272
|
+
</script>
|
|
273
|
+
|
|
274
|
+
<template>
|
|
275
|
+
<el-card
|
|
276
|
+
class="inner_content h-full"
|
|
277
|
+
:style="{
|
|
278
|
+
width: collapse ? '60px' : 'unset',
|
|
279
|
+
padding: 'unset',
|
|
280
|
+
}"
|
|
281
|
+
>
|
|
282
|
+
<div
|
|
283
|
+
class="selected-data gap-2"
|
|
284
|
+
v-if="showSelectData && selectedDataList?.length > 0"
|
|
285
|
+
>
|
|
286
|
+
<el-tag
|
|
287
|
+
closable
|
|
288
|
+
@close="operSelectData(item, false)"
|
|
289
|
+
v-for="item in selectedDataList"
|
|
290
|
+
:key="_compKey(item, item[preps.value])"
|
|
291
|
+
>{{ item[preps.label] }}
|
|
292
|
+
</el-tag
|
|
293
|
+
>
|
|
294
|
+
</div>
|
|
295
|
+
<div class="tree-title">
|
|
296
|
+
<div class="title flex items-center">
|
|
297
|
+
{{ treeTitle }}
|
|
298
|
+
<help v-if="helpMsg" :message="helpMsg"/>
|
|
299
|
+
</div>
|
|
300
|
+
<div class="btn" v-if="showCollapse">
|
|
301
|
+
<star-horse-icon :icon-class="menuIcon" @click="changeArrow"/>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
<div class="search-input" v-if="showSearch">
|
|
305
|
+
<el-input
|
|
306
|
+
v-model="searchData"
|
|
307
|
+
:size="compSize"
|
|
308
|
+
clearable
|
|
309
|
+
:style="{ 'margin-right': showDropdown ? 'unset' : '10px' }"
|
|
310
|
+
placeholder="请输入关键字"
|
|
311
|
+
@input="onQueryChanged"
|
|
312
|
+
>
|
|
313
|
+
<template #append>
|
|
314
|
+
<star-horse-icon
|
|
315
|
+
@click="onQueryChanged"
|
|
316
|
+
icon-class="search"
|
|
317
|
+
color="var(--star-horse-style)"
|
|
318
|
+
size="18px"
|
|
319
|
+
/>
|
|
320
|
+
</template>
|
|
321
|
+
</el-input>
|
|
322
|
+
<el-dropdown
|
|
323
|
+
placement="bottom"
|
|
324
|
+
@command="treeOperation"
|
|
325
|
+
v-if="showDropdown"
|
|
326
|
+
>
|
|
327
|
+
<star-horse-icon
|
|
328
|
+
icon-class="v-dot"
|
|
329
|
+
color="var(--star-horse-style)"
|
|
330
|
+
size="20px"
|
|
331
|
+
/>
|
|
332
|
+
<template #dropdown>
|
|
333
|
+
<el-dropdown-menu>
|
|
334
|
+
<el-dropdown-item v-if="btnVisible" command="add"
|
|
335
|
+
>添加数据
|
|
336
|
+
</el-dropdown-item
|
|
337
|
+
>
|
|
338
|
+
<el-dropdown-item command="expand">展开全部</el-dropdown-item>
|
|
339
|
+
<el-dropdown-item command="collapse">折叠全部</el-dropdown-item>
|
|
340
|
+
</el-dropdown-menu>
|
|
341
|
+
</template>
|
|
342
|
+
</el-dropdown>
|
|
343
|
+
</div>
|
|
344
|
+
<el-divider v-if="showSearch"/>
|
|
345
|
+
<div class="tree-content">
|
|
346
|
+
<el-scrollbar height="100%">
|
|
347
|
+
<el-tree
|
|
348
|
+
ref="treeRef"
|
|
349
|
+
:data="treeDatas"
|
|
350
|
+
:props="preps"
|
|
351
|
+
:node-key="preps.value"
|
|
352
|
+
v-if="treeType == 'tree'"
|
|
353
|
+
:filter-node-method="filterMethod"
|
|
354
|
+
:check-strictly="checkStrictly"
|
|
355
|
+
:show-checkbox="showCheckBox"
|
|
356
|
+
highlight-current
|
|
357
|
+
@nodeClick="treeChange"
|
|
358
|
+
@checkChange="treeChange"
|
|
359
|
+
>
|
|
360
|
+
<template #default="{ node, data }">
|
|
361
|
+
<div class="menu-title">
|
|
362
|
+
<div class="name flex items-center">
|
|
363
|
+
<star-horse-icon
|
|
364
|
+
:icon-class="
|
|
365
|
+
data.children?.length > 0 ? 'folder' : 'document'
|
|
366
|
+
"
|
|
367
|
+
/>
|
|
368
|
+
{{ node.label }}
|
|
369
|
+
<template v-if="showCode">
|
|
370
|
+
({{
|
|
371
|
+
data["code"] ||
|
|
372
|
+
data[preps.code || preps.value || "value"] ||
|
|
373
|
+
""
|
|
374
|
+
}})
|
|
375
|
+
</template>
|
|
376
|
+
</div>
|
|
377
|
+
<div v-if="btnVisible || rmvVisible" class="btn">
|
|
378
|
+
<el-tooltip :content="btnTitle">
|
|
379
|
+
<star-horse-icon
|
|
380
|
+
cursor="pointer"
|
|
381
|
+
v-if="btnVisible"
|
|
382
|
+
@click.stop="addData(data)"
|
|
383
|
+
icon-class="plus"
|
|
384
|
+
/>
|
|
385
|
+
</el-tooltip>
|
|
386
|
+
<el-tooltip :content="rmvTitle">
|
|
387
|
+
<star-horse-icon
|
|
388
|
+
cursor="pointer"
|
|
389
|
+
v-if="rmvVisible"
|
|
390
|
+
@click.stop="removeData(data)"
|
|
391
|
+
color="var(--el-color-danger)"
|
|
392
|
+
icon-class="minus"
|
|
393
|
+
/>
|
|
394
|
+
</el-tooltip>
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
</template>
|
|
398
|
+
</el-tree>
|
|
399
|
+
<el-menu
|
|
400
|
+
v-if="treeType == 'menu'"
|
|
401
|
+
ref="menuTreeRef"
|
|
402
|
+
:unique-opened="false"
|
|
403
|
+
>
|
|
404
|
+
<SubSystemMenu
|
|
405
|
+
:dataList="treeDatas"
|
|
406
|
+
:preps="preps"
|
|
407
|
+
@addData="addData"
|
|
408
|
+
@removeData="removeData"
|
|
409
|
+
@selectData="menuChange"
|
|
410
|
+
/>
|
|
411
|
+
</el-menu>
|
|
412
|
+
</el-scrollbar>
|
|
413
|
+
</div>
|
|
414
|
+
<div class="tree-footer" v-if="showPageBar">
|
|
415
|
+
<el-pagination
|
|
416
|
+
:total="pageInfo.totalData"
|
|
417
|
+
@current-change="pageChangeClick"
|
|
418
|
+
@size-change="pageSizeClick"
|
|
419
|
+
:size="compSize"
|
|
420
|
+
:page-sizes="[10,20,30,50]"
|
|
421
|
+
layout=" prev, pager, next,slot,sizes"
|
|
422
|
+
v-model:currentPage="pageInfo.currentPage"
|
|
423
|
+
v-model:page-size="pageInfo.pageSize"
|
|
424
|
+
v-model:pageCount="pageInfo.totalPage"
|
|
425
|
+
>
|
|
426
|
+
<el-button text icon="refresh" :size="compSize" @click="loadByPage" title="刷新"/>
|
|
427
|
+
</el-pagination>
|
|
428
|
+
</div>
|
|
429
|
+
</el-card>
|
|
430
|
+
</template>
|
|
431
|
+
|
|
432
|
+
<style scoped lang="scss">
|
|
433
|
+
:deep(.el-tag) {
|
|
434
|
+
margin-left: 5px;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.selected-data {
|
|
438
|
+
display: flex;
|
|
439
|
+
flex-direction: row;
|
|
440
|
+
flex-wrap: wrap;
|
|
441
|
+
justify-content: start;
|
|
442
|
+
align-items: center;
|
|
443
|
+
margin: 8px 5px;
|
|
444
|
+
border: 1px dashed var(--star-horse-shadow);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.tree-title {
|
|
448
|
+
width: 100%;
|
|
449
|
+
height: 35px;
|
|
450
|
+
display: flex;
|
|
451
|
+
align-items: center;
|
|
452
|
+
font-size: 13px;
|
|
453
|
+
font-weight: 800;
|
|
454
|
+
background: rgb(229, 230, 235);
|
|
455
|
+
border: 1px solid #33272729;
|
|
456
|
+
justify-content: space-between;
|
|
457
|
+
|
|
458
|
+
.title {
|
|
459
|
+
margin-left: 15px;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.btn,
|
|
463
|
+
svg {
|
|
464
|
+
cursor: pointer;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.search-input {
|
|
469
|
+
width: 98%;
|
|
470
|
+
align-items: center;
|
|
471
|
+
display: flex;
|
|
472
|
+
margin: 5px auto;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.tree-content {
|
|
476
|
+
margin: 5px;
|
|
477
|
+
flex: 1;
|
|
478
|
+
overflow: hidden;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
:deep(.el-sub-menu__icon-arrow) {
|
|
482
|
+
width: 20px !important;
|
|
483
|
+
right: 5px;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
:deep(.el-menu-item) {
|
|
487
|
+
height: 30px;
|
|
488
|
+
line-height: 30px;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
:deep(.el-divider--horizontal) {
|
|
492
|
+
margin: 5px 0 !important;
|
|
493
|
+
}
|
|
494
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as ShDynamicForm } from "./ShDynamicForm.vue";
|
|
2
|
+
export { default as ShTableListColumn } from "./ShTableListColumn.vue";
|
|
3
|
+
export { default as StarHorseDataSelector } from "./StarHorseDataSelector.vue";
|
|
4
|
+
export { default as StarHorseDataView } from "./StarHorseDataView.vue";
|
|
5
|
+
export { default as StarHorseDataViewItems } from "./StarHorseDataViewItems.vue";
|
|
6
|
+
export { default as StarHorseDataViewTable } from "./StarHorseDataViewTable.vue";
|
|
7
|
+
export { default as StarHorseDialog } from "./StarHorseDialog.vue";
|
|
8
|
+
export { default as StarHorseDraggable } from "./StarHorseDraggable.vue";
|
|
9
|
+
export { default as StarHorseForm } from "./StarHorseForm.vue";
|
|
10
|
+
export { default as StarHorseFormItem } from "./StarHorseFormItem.vue";
|
|
11
|
+
export { default as StarHorseFormList } from "./StarHorseFormList.vue";
|
|
12
|
+
export { default as StarHorseFormTable } from "./StarHorseFormTable.vue";
|
|
13
|
+
export { default as StarHorseIcon } from "./StarHorseIcon.vue";
|
|
14
|
+
export { default as StarHorseJsonEditor } from "./StarHorseJsonEditor.vue";
|
|
15
|
+
export { default as StarHorsePopover } from "./StarHorsePopover.vue";
|
|
16
|
+
export { default as StarHorseSearchComp } from "./StarHorseSearchComp.vue";
|
|
17
|
+
export { default as StarHorseStaticTable } from "./StarHorseStaticTable.vue";
|
|
18
|
+
export { default as StarHorseTableColumn } from "./StarHorseTableColumn.vue";
|
|
19
|
+
export { default as StarHorseTableComp } from "./StarHorseTableComp.vue";
|
|
20
|
+
export { default as StarHorseTableViewColumn } from "./StarHorseTableViewColumn.vue";
|
|
21
|
+
export { default as StarHorseTree } from "./StarHorseTree.vue";
|
|
22
|
+
export { default as ShForm } from "./ShForm.vue";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Config } from "@/api/settings";
|
|
3
|
+
import { batchFieldDefaultValues } from "@/api/star_horse_utils";
|
|
4
|
+
import { PropType } from "vue";
|
|
5
|
+
import { compKey } from "@/api/system";
|
|
6
|
+
|
|
7
|
+
defineProps({
|
|
8
|
+
item: { type: Object as PropType<any>, required: true },
|
|
9
|
+
rules: { type: Object },
|
|
10
|
+
staticColumn: { type: String, default: "Y" },
|
|
11
|
+
size: { type: String, default: Config.compSize },
|
|
12
|
+
batchName: { type: String, default: "batchDataList" },
|
|
13
|
+
primaryKey: { type: [String, Object] as PropType<string | any> },
|
|
14
|
+
source: { type: Number, default: 1 },
|
|
15
|
+
});
|
|
16
|
+
const _compKey = compKey;
|
|
17
|
+
const exclusionFields: string[] = ["divider", "button", "usercomp"];
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<el-table-column
|
|
22
|
+
:prop="item.fieldName"
|
|
23
|
+
:label="item.label"
|
|
24
|
+
sortable
|
|
25
|
+
:min-width="item.minWidth || Config.defaultColumnWidth + 'px'"
|
|
26
|
+
v-if="item.formVisible && !exclusionFields.includes(item.type)"
|
|
27
|
+
>
|
|
28
|
+
<template #default="scope">
|
|
29
|
+
<template v-if="item.batchFieldList?.length > 0">
|
|
30
|
+
<star-horse-form-list
|
|
31
|
+
v-for="sitem in item.batchFieldList"
|
|
32
|
+
:key="_compKey(sitem, sitem.batchName)"
|
|
33
|
+
style="min-height: 100px; width: 100% !important"
|
|
34
|
+
v-model:dataForm="scope.row"
|
|
35
|
+
:compUrl="sitem['compUrl']"
|
|
36
|
+
:primaryKey="sitem['primaryKey']"
|
|
37
|
+
:batchName="sitem['batchName']"
|
|
38
|
+
:initRows="sitem['initRows']"
|
|
39
|
+
:subFlag="true"
|
|
40
|
+
:size="size"
|
|
41
|
+
:source="source"
|
|
42
|
+
:staticColumn="sitem.staticColumn ?? 'Y'"
|
|
43
|
+
:defaultValues="batchFieldDefaultValues(sitem, scope.row)"
|
|
44
|
+
:field-list="sitem['fieldList']"
|
|
45
|
+
:rules="sitem['rules'] || rules"
|
|
46
|
+
/>
|
|
47
|
+
</template>
|
|
48
|
+
<template v-else>
|
|
49
|
+
<sh-table-list-column
|
|
50
|
+
:primaryKey="primaryKey"
|
|
51
|
+
:batchName="batchName"
|
|
52
|
+
:dataForm="scope.row"
|
|
53
|
+
:size="size"
|
|
54
|
+
:source="source"
|
|
55
|
+
:rules="rules"
|
|
56
|
+
:staticColumn="staticColumn"
|
|
57
|
+
:item="item"
|
|
58
|
+
:index="scope.$index"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
</template>
|
|
62
|
+
</el-table-column>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<style scoped lang="scss"></style>
|