star-horse-lowcode 2.7.65 → 2.7.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/assets/index.css +1 -1
- package/dist/index.es.js +597 -188
- package/dist/types/index.d.ts +30 -0
- package/package.json +3 -3
- package/.env.development +0 -3
- package/.env.production +0 -3
- package/.eslintrc-auto-import.json +0 -77
- package/.gitignore +0 -27
- package/.idea/.gitignore +0 -5
- package/.idea/MarsCodeWorkspaceAppSettings.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/testcode.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.idea/watcherTasks.xml +0 -4
- package/.idea/workspace.xml +0 -207
- package/.npmignore +0 -21
- package/.prettierignore +0 -26
- package/auto-imports.d.ts +0 -137
- package/components.d.ts +0 -189
- package/eslint.config.js +0 -37
- package/index.html +0 -14
- package/package-lock.json +0 -8276
- package/prettier.config.js +0 -20
- package/public/logo.svg +0 -660
- package/src/App.vue +0 -11
- package/src/api/date_utils.ts +0 -219
- package/src/api/finger_utils.ts +0 -71
- package/src/api/form_utils.ts +0 -281
- package/src/api/jquery.min.js +0 -2
- package/src/api/pcas-code.json +0 -1
- package/src/api/settings.ts +0 -81
- package/src/api/star_horse_apis.ts +0 -196
- package/src/api/star_horse_utils.ts +0 -797
- package/src/api/system.ts +0 -351
- package/src/api/user_func.ts +0 -147
- package/src/api/valid_utils.ts +0 -165
- package/src/assets/css/index.scss +0 -908
- package/src/assets/icons.css +0 -574
- package/src/assets/star-horse-icons.woff +0 -0
- package/src/components/comp/ShDynamicForm.vue +0 -160
- package/src/components/comp/ShForm.vue +0 -30
- package/src/components/comp/ShTableListColumn.vue +0 -61
- package/src/components/comp/StarHorseDataSelector.vue +0 -139
- package/src/components/comp/StarHorseDataView.vue +0 -110
- package/src/components/comp/StarHorseDataViewItems.vue +0 -61
- package/src/components/comp/StarHorseDataViewTable.vue +0 -102
- package/src/components/comp/StarHorseDialog.vue +0 -383
- package/src/components/comp/StarHorseDraggable.vue +0 -401
- package/src/components/comp/StarHorseForm.vue +0 -458
- package/src/components/comp/StarHorseFormItem.vue +0 -82
- package/src/components/comp/StarHorseFormList.vue +0 -516
- package/src/components/comp/StarHorseFormTable.vue +0 -56
- package/src/components/comp/StarHorseIcon.vue +0 -76
- package/src/components/comp/StarHorseItem.vue +0 -302
- package/src/components/comp/StarHorseJsonEditor.vue +0 -115
- package/src/components/comp/StarHorsePopover.vue +0 -66
- package/src/components/comp/StarHorseSearchComp.vue +0 -253
- package/src/components/comp/StarHorseStaticTable.vue +0 -395
- package/src/components/comp/StarHorseTableColumn.vue +0 -249
- package/src/components/comp/StarHorseTableComp.vue +0 -1193
- package/src/components/comp/StarHorseTableViewColumn.vue +0 -61
- package/src/components/comp/StarHorseTree.vue +0 -494
- package/src/components/comp/index.ts +0 -22
- package/src/components/comp/items/UTableColumn.vue +0 -65
- package/src/components/comp/items/boxItem.vue +0 -98
- package/src/components/comp/items/callitem.ts +0 -9
- package/src/components/comp/items/cardItem.vue +0 -152
- package/src/components/comp/items/collapseItem.vue +0 -134
- package/src/components/comp/items/dytableItem.vue +0 -135
- package/src/components/comp/items/otherItem.vue +0 -65
- package/src/components/comp/items/tabItem.vue +0 -155
- package/src/components/comp/items/tabPanelItem.vue +0 -110
- package/src/components/comp/items/tableColumn.vue +0 -129
- package/src/components/comp/items/tableItem.vue +0 -97
- package/src/components/comp/items/tablebtn.vue +0 -158
- package/src/components/comp/items/viewBoxItem.vue +0 -55
- package/src/components/comp/items/viewCardItem.vue +0 -47
- package/src/components/comp/items/viewCollapseItem.vue +0 -71
- package/src/components/comp/items/viewDytableItem.vue +0 -77
- package/src/components/comp/items/viewOtherItem.vue +0 -55
- package/src/components/comp/items/viewTabItem.vue +0 -77
- package/src/components/comp/items/viewTabPanelItem.vue +0 -54
- package/src/components/comp/items/viewTableItem.vue +0 -74
- package/src/components/comp/selfcomp.ts +0 -9
- package/src/components/comp/utils/DataPicker.vue +0 -302
- package/src/components/comp/utils/DataTag.vue +0 -51
- package/src/components/cron/Crontab-Day.vue +0 -230
- package/src/components/cron/Crontab-Hour.vue +0 -165
- package/src/components/cron/Crontab-Min.vue +0 -166
- package/src/components/cron/Crontab-Month.vue +0 -166
- package/src/components/cron/Crontab-Result.vue +0 -615
- package/src/components/cron/Crontab-Second.vue +0 -185
- package/src/components/cron/Crontab-Week.vue +0 -208
- package/src/components/cron/Crontab-Year.vue +0 -183
- package/src/components/cron/Crontab.vue +0 -474
- package/src/components/enums/ModuleEnums.ts +0 -10
- package/src/components/enums/ServiceEnums.ts +0 -18
- package/src/components/formcomp/container/box-container.vue +0 -162
- package/src/components/formcomp/container/callitem.ts +0 -9
- package/src/components/formcomp/container/card-container.vue +0 -170
- package/src/components/formcomp/container/collapse-container.vue +0 -133
- package/src/components/formcomp/container/dytable-col.vue +0 -448
- package/src/components/formcomp/container/dytable-container.vue +0 -57
- package/src/components/formcomp/container/dytableUtils.ts +0 -358
- package/src/components/formcomp/container/group-box-container.vue +0 -331
- package/src/components/formcomp/container/index.ts +0 -6
- package/src/components/formcomp/container/tab-container.vue +0 -153
- package/src/components/formcomp/container/table-container.vue +0 -249
- package/src/components/formcomp/items/allitem.ts +0 -9
- package/src/components/formcomp/items/area-item.vue +0 -116
- package/src/components/formcomp/items/audio-item.vue +0 -163
- package/src/components/formcomp/items/autocomplete-item.vue +0 -118
- package/src/components/formcomp/items/barcode-item.vue +0 -87
- package/src/components/formcomp/items/base-json-item.vue +0 -207
- package/src/components/formcomp/items/button-item.vue +0 -228
- package/src/components/formcomp/items/cascade-item.vue +0 -113
- package/src/components/formcomp/items/checkbox-item.vue +0 -97
- package/src/components/formcomp/items/color-item.vue +0 -70
- package/src/components/formcomp/items/cron-item.vue +0 -115
- package/src/components/formcomp/items/datetime-item.vue +0 -99
- package/src/components/formcomp/items/depart-item.vue +0 -51
- package/src/components/formcomp/items/dialog-input-item.vue +0 -207
- package/src/components/formcomp/items/divider-item.vue +0 -66
- package/src/components/formcomp/items/html-item.vue +0 -65
- package/src/components/formcomp/items/htmleditor-item.vue +0 -104
- package/src/components/formcomp/items/icon-item.vue +0 -195
- package/src/components/formcomp/items/image-item.vue +0 -247
- package/src/components/formcomp/items/index.ts +0 -44
- package/src/components/formcomp/items/input-item.vue +0 -150
- package/src/components/formcomp/items/json-array-item.vue +0 -67
- package/src/components/formcomp/items/json-item.vue +0 -66
- package/src/components/formcomp/items/markdown-item.vue +0 -77
- package/src/components/formcomp/items/number-item.vue +0 -94
- package/src/components/formcomp/items/number-range-item.vue +0 -278
- package/src/components/formcomp/items/page-select-item.vue +0 -407
- package/src/components/formcomp/items/password-item.vue +0 -71
- package/src/components/formcomp/items/qrcode-item.vue +0 -84
- package/src/components/formcomp/items/radio-item.vue +0 -112
- package/src/components/formcomp/items/rate-item.vue +0 -68
- package/src/components/formcomp/items/select-item.vue +0 -133
- package/src/components/formcomp/items/signature-item.vue +0 -216
- package/src/components/formcomp/items/slider-item.vue +0 -68
- package/src/components/formcomp/items/starhorse-form-item.vue +0 -334
- package/src/components/formcomp/items/switch-item.vue +0 -77
- package/src/components/formcomp/items/tag-item.vue +0 -77
- package/src/components/formcomp/items/text-item.vue +0 -75
- package/src/components/formcomp/items/textarea-item.vue +0 -85
- package/src/components/formcomp/items/time-item.vue +0 -77
- package/src/components/formcomp/items/time-picker-item.vue +0 -74
- package/src/components/formcomp/items/transfer-item.vue +0 -93
- package/src/components/formcomp/items/tselect-item.vue +0 -121
- package/src/components/formcomp/items/unknown-item.vue +0 -51
- package/src/components/formcomp/items/upload-item.vue +0 -189
- package/src/components/formcomp/items/user-item.vue +0 -177
- package/src/components/formcomp/items/usercomp-item.vue +0 -85
- package/src/components/formcomp/items/view-markdown-item.vue +0 -77
- package/src/components/formcomp/utils/EditDataDialog.vue +0 -67
- package/src/components/formcomp/utils/FieldList.vue +0 -125
- package/src/components/formcomp/utils/ItemRelationEventUtils.ts +0 -284
- package/src/components/help.vue +0 -31
- package/src/components/menu/MenuItem.vue +0 -95
- package/src/components/menu/SubMenu.vue +0 -68
- package/src/components/menu/SubSystemMenu.vue +0 -142
- package/src/components/register.ts +0 -24
- package/src/components/system/ContentMenu.vue +0 -260
- package/src/components/system/StarHorseButtonList.vue +0 -344
- package/src/components/system/StarHorseMenu.vue +0 -97
- package/src/components/system/StarHorseSvg.vue +0 -62
- package/src/components/system/SystemComp.ts +0 -9
- package/src/components/system/index.ts +0 -4
- package/src/components/types/ApiUrls.ts +0 -168
- package/src/components/types/BtnAction.ts +0 -51
- package/src/components/types/BtnAuth.ts +0 -43
- package/src/components/types/CompInfo.ts +0 -81
- package/src/components/types/DialogProps.ts +0 -55
- package/src/components/types/DyCompField.ts +0 -23
- package/src/components/types/DynamicNode.ts +0 -42
- package/src/components/types/MenusInfo.ts +0 -45
- package/src/components/types/PageFieldInfo.ts +0 -530
- package/src/components/types/PageProps.ts +0 -25
- package/src/components/types/Params.ts +0 -93
- package/src/components/types/RuleType.ts +0 -10
- package/src/components/types/SearchProps.ts +0 -42
- package/src/components/types/ShortKey.ts +0 -30
- package/src/components/types/StarHorseType.ts +0 -18
- package/src/components/types/index.ts +0 -15
- package/src/config/element.ts +0 -15
- package/src/config/styles.ts +0 -4
- package/src/index.ts +0 -98
- package/src/install.ts +0 -33
- package/src/lang/en_US.ts +0 -81
- package/src/lang/index.ts +0 -35
- package/src/lang/zh_CN.ts +0 -84
- package/src/main.ts +0 -57
- package/src/plugins/AblesPlugin.ts +0 -618
- package/src/plugins/registerCompPlugin.ts +0 -15
- package/src/sample/test.vue +0 -9
- package/src/store/ButtonPermission.ts +0 -101
- package/src/store/ConsumerView.ts +0 -52
- package/src/store/ContinusConfig.ts +0 -78
- package/src/store/CopyerOperation.ts +0 -74
- package/src/store/DesignForm.ts +0 -481
- package/src/store/DesignPage.ts +0 -59
- package/src/store/DynamicForm.ts +0 -241
- package/src/store/GlobalConfig.ts +0 -90
- package/src/store/SelfOperation.ts +0 -95
- package/src/store/UserInfo.ts +0 -88
- package/src/store/index.ts +0 -6
- package/src/theme/localStorge.ts +0 -16
- package/src/theme/theme.ts +0 -27
- package/src/utils/FieldOperationUtils.ts +0 -91
- package/src/utils/auth.ts +0 -83
- package/src/utils/message.ts +0 -69
- package/src/utils/preview.ts +0 -125
- package/tsconfig.json +0 -39
- package/tsconfig.node.json +0 -10
- package/vite-env.d.ts +0 -16
- package/vite.config.ts +0 -162
- package/yarn.lock +0 -4627
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="ShDynamicForm">
|
|
2
|
-
import { inject, PropType, ref, ShallowReactive, watch } from "vue";
|
|
3
|
-
import { ApiUrls } from "@/components/types/ApiUrls";
|
|
4
|
-
import { error, success, warning } from "@/utils/message";
|
|
5
|
-
import { postRequest } from "@/api/star_horse_apis";
|
|
6
|
-
import { closeLoad, load, loadById } from "@/api/star_horse_utils";
|
|
7
|
-
import { DialogProps } from "@/components/types/DialogProps";
|
|
8
|
-
import { compKey, itemCheck } from "@/api/system";
|
|
9
|
-
|
|
10
|
-
const props = defineProps({
|
|
11
|
-
compUrl: { type: Object as PropType<ApiUrls>, required: true },
|
|
12
|
-
fieldList: { type: Object as PropType<any>, required: true },
|
|
13
|
-
formInfo: { type: Object as PropType<any>, required: true },
|
|
14
|
-
rules: { type: Object },
|
|
15
|
-
typeModel: { type: String, default: "normal" },
|
|
16
|
-
});
|
|
17
|
-
const emits = defineEmits(["refresh"]);
|
|
18
|
-
const starHorseFormRef = ref();
|
|
19
|
-
const dataForm = ref<any>({});
|
|
20
|
-
const closeDialog = inject("closeDialog") as Function;
|
|
21
|
-
const dialogOperation = inject("dialogOperation") as ShallowReactive<any>;
|
|
22
|
-
const dialogProps = inject<DialogProps>("dialogProps", {});
|
|
23
|
-
|
|
24
|
-
const assignDefault = () => {
|
|
25
|
-
dataForm.value = {};
|
|
26
|
-
};
|
|
27
|
-
const loadData = async () => {
|
|
28
|
-
dataForm.value = await loadById(props.compUrl!.loadByIdUrl!, dialogProps.ids);
|
|
29
|
-
//解决关闭并再次打开不触发watch监听
|
|
30
|
-
dialogProps.ids = -2;
|
|
31
|
-
};
|
|
32
|
-
const merge = (_type: string) => {
|
|
33
|
-
starHorseFormRef.value.validate((result: boolean) => {
|
|
34
|
-
if (!result) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
doMerge();
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
const mergeDraft = (type: string) => {
|
|
41
|
-
console.log("mergeDraft", type);
|
|
42
|
-
doMerge();
|
|
43
|
-
};
|
|
44
|
-
const doMerge = () => {
|
|
45
|
-
load("数据处理中");
|
|
46
|
-
postRequest(props.compUrl.mergeUrl!, dataForm.value)
|
|
47
|
-
.then((res) => {
|
|
48
|
-
closeLoad();
|
|
49
|
-
if (res.data.code != 0) {
|
|
50
|
-
warning(res.data.cnMessage);
|
|
51
|
-
return;
|
|
52
|
-
} else {
|
|
53
|
-
success(res.data.cnMessage);
|
|
54
|
-
}
|
|
55
|
-
emits("refresh");
|
|
56
|
-
resetForm();
|
|
57
|
-
closeDialog();
|
|
58
|
-
//关闭弹窗
|
|
59
|
-
})
|
|
60
|
-
.catch((err) => {
|
|
61
|
-
error("接口调用异常" + err);
|
|
62
|
-
})
|
|
63
|
-
.finally(() => {
|
|
64
|
-
closeLoad();
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const resetForm = () => {
|
|
68
|
-
assignDefault();
|
|
69
|
-
};
|
|
70
|
-
watch(
|
|
71
|
-
() => dialogOperation,
|
|
72
|
-
(val: any) => {
|
|
73
|
-
if (val["funcName"] == "merge") {
|
|
74
|
-
merge(val["type"]);
|
|
75
|
-
} else if (val["funcName"] == "mergeDraft") {
|
|
76
|
-
mergeDraft(val["type"]);
|
|
77
|
-
} else if (val["funcName"] == "resetForm") {
|
|
78
|
-
resetForm();
|
|
79
|
-
}
|
|
80
|
-
//为了触发多次点击响应
|
|
81
|
-
dialogOperation["funcName"] = "";
|
|
82
|
-
dialogOperation["type"] = "";
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
immediate: false,
|
|
86
|
-
deep: true,
|
|
87
|
-
},
|
|
88
|
-
);
|
|
89
|
-
watch(
|
|
90
|
-
() => dialogProps.ids,
|
|
91
|
-
(val) => {
|
|
92
|
-
if (val == -2) {
|
|
93
|
-
} else if (!val || val == -1) {
|
|
94
|
-
assignDefault();
|
|
95
|
-
} else {
|
|
96
|
-
loadData();
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
immediate: true,
|
|
101
|
-
},
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
defineExpose({
|
|
105
|
-
merge,
|
|
106
|
-
mergeDraft,
|
|
107
|
-
resetForm,
|
|
108
|
-
assignDefault,
|
|
109
|
-
});
|
|
110
|
-
</script>
|
|
111
|
-
|
|
112
|
-
<template>
|
|
113
|
-
<el-form
|
|
114
|
-
:model="dataForm"
|
|
115
|
-
:rules="rules"
|
|
116
|
-
class="data-form"
|
|
117
|
-
ref="starHorseFormRef"
|
|
118
|
-
:disabled="formInfo['disabled'] ?? false"
|
|
119
|
-
:hide-required-asterisk="formInfo['hideRequiredAsterisk'] ?? false"
|
|
120
|
-
:inline="formInfo.inline ?? false"
|
|
121
|
-
:inline-message="formInfo['inlineMessage'] ?? false"
|
|
122
|
-
:label-position="formInfo['labelPosition']"
|
|
123
|
-
:label-suffix="formInfo['labelSuffix']"
|
|
124
|
-
:label-width="formInfo['labelWidth']"
|
|
125
|
-
:require-asterisk-position="formInfo['requireAsteriskPosition']"
|
|
126
|
-
:scroll-to-error="formInfo['scrollToError'] ?? true"
|
|
127
|
-
:show-message="formInfo['showMessage'] ?? true"
|
|
128
|
-
:size="formInfo['size']"
|
|
129
|
-
:status-icon="formInfo['statusIcon'] ?? true"
|
|
130
|
-
:validate-on-rule-change="formInfo['validateOnRuleChange'] ?? true"
|
|
131
|
-
>
|
|
132
|
-
<component
|
|
133
|
-
v-for="(data, key) in fieldList"
|
|
134
|
-
:key="compKey(data, key, false, 'dyform')"
|
|
135
|
-
:field="data"
|
|
136
|
-
:formData="dataForm"
|
|
137
|
-
:is="itemCheck(data)"
|
|
138
|
-
/>
|
|
139
|
-
<el-form-item v-if="typeModel == 'tab'">
|
|
140
|
-
<el-button
|
|
141
|
-
@click="merge"
|
|
142
|
-
style="
|
|
143
|
-
background: var(--star-horse-style);
|
|
144
|
-
color: var(--star-horse-white);
|
|
145
|
-
"
|
|
146
|
-
>
|
|
147
|
-
<star-horse-icon
|
|
148
|
-
icon-class="save"
|
|
149
|
-
style="color: var(--star-horse-white)"
|
|
150
|
-
/>
|
|
151
|
-
提交
|
|
152
|
-
</el-button>
|
|
153
|
-
<el-button @click="resetForm" link>
|
|
154
|
-
<star-horse-icon icon-class="undo" />
|
|
155
|
-
重置
|
|
156
|
-
</el-button>
|
|
157
|
-
</el-form-item>
|
|
158
|
-
</el-form>
|
|
159
|
-
</template>
|
|
160
|
-
<style scoped></style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from "vue";
|
|
3
|
-
defineProps({
|
|
4
|
-
needScroller: {
|
|
5
|
-
type: Boolean,
|
|
6
|
-
default: true,
|
|
7
|
-
},
|
|
8
|
-
});
|
|
9
|
-
const shFormRef = ref();
|
|
10
|
-
const dataForm = defineModel("dataForm");
|
|
11
|
-
</script>
|
|
12
|
-
<template>
|
|
13
|
-
<slot name="header"></slot>
|
|
14
|
-
<el-form :model="dataForm" v-bind="$attrs" class="data-form" ref="shFormRef">
|
|
15
|
-
<el-scrollbar height="100%" v-if="needScroller">
|
|
16
|
-
<template v-if="$slots.default">
|
|
17
|
-
<slot></slot>
|
|
18
|
-
</template>
|
|
19
|
-
<slot v-else name="empty"></slot>
|
|
20
|
-
</el-scrollbar>
|
|
21
|
-
<template v-else>
|
|
22
|
-
<template v-if="$slots.default">
|
|
23
|
-
<slot></slot>
|
|
24
|
-
</template>
|
|
25
|
-
<slot v-else name="empty"></slot>
|
|
26
|
-
</template>
|
|
27
|
-
</el-form>
|
|
28
|
-
<slot name="button"></slot>
|
|
29
|
-
</template>
|
|
30
|
-
<style lang="scss" scoped></style>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="ShTableListColumn">
|
|
2
|
-
import { createDatetime } from "@/api/date_utils";
|
|
3
|
-
import { parseListData, validMsg } from "@/api/form_utils";
|
|
4
|
-
import { Config } from "@/api/settings";
|
|
5
|
-
import { PropType } from "vue";
|
|
6
|
-
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
dataForm: { type: Object, required: true },
|
|
9
|
-
index: { type: Object, required: true },
|
|
10
|
-
item: { type: Object as PropType<any>, required: true },
|
|
11
|
-
staticColumn: { type: String, default: "Y" },
|
|
12
|
-
primaryKey: { type: [String, Object] as PropType<string | any> },
|
|
13
|
-
batchName: { type: String, default: "batchDataList" },
|
|
14
|
-
rules: { type: Object },
|
|
15
|
-
size: { type: String, default: Config.compSize },
|
|
16
|
-
source: { type: Number, default: 1 },
|
|
17
|
-
});
|
|
18
|
-
const dataFormat = (val: any) => {
|
|
19
|
-
const type: string = props.item.type;
|
|
20
|
-
if (val) {
|
|
21
|
-
if (type == "date" || type == "datetime") {
|
|
22
|
-
return createDatetime(val);
|
|
23
|
-
}
|
|
24
|
-
if (type == "switch") {
|
|
25
|
-
return val === true || val == "1" || val == "Y" ? "是" : "否";
|
|
26
|
-
}
|
|
27
|
-
if (
|
|
28
|
-
type == "select" ||
|
|
29
|
-
type == "radio" ||
|
|
30
|
-
type == "checkbox" ||
|
|
31
|
-
type == "cascader" ||
|
|
32
|
-
type == "tselect"
|
|
33
|
-
) {
|
|
34
|
-
return parseListData(props.item, val);
|
|
35
|
-
}
|
|
36
|
-
return val;
|
|
37
|
-
}
|
|
38
|
-
return "--";
|
|
39
|
-
};
|
|
40
|
-
</script>
|
|
41
|
-
<template>
|
|
42
|
-
<template v-if="staticColumn == 'Y'">
|
|
43
|
-
{{ dataFormat(dataForm[item.fieldName]) }}
|
|
44
|
-
</template>
|
|
45
|
-
<el-form-item
|
|
46
|
-
v-else
|
|
47
|
-
:size="size"
|
|
48
|
-
:rules="validMsg(item, dataForm)"
|
|
49
|
-
:prop="`${batchName}.${index}.${item.fieldName}`"
|
|
50
|
-
>
|
|
51
|
-
<star-horse-item
|
|
52
|
-
:primaryKey="primaryKey"
|
|
53
|
-
:compSize="size"
|
|
54
|
-
:batchName="batchName"
|
|
55
|
-
:item="item"
|
|
56
|
-
:data-form="dataForm"
|
|
57
|
-
:source="source"
|
|
58
|
-
/>
|
|
59
|
-
</el-form-item>
|
|
60
|
-
</template>
|
|
61
|
-
<style scoped></style>
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useVModel } from "@vueuse/core";
|
|
3
|
-
import DataTag from "@/components/comp/utils/DataTag.vue";
|
|
4
|
-
import DataPicker, {
|
|
5
|
-
type ModelValueType,
|
|
6
|
-
} from "@/components/comp/utils/DataPicker.vue";
|
|
7
|
-
import { useFormDisabled } from "element-plus";
|
|
8
|
-
import type { CSSProperties } from "vue";
|
|
9
|
-
import { computed, ref } from "vue";
|
|
10
|
-
import StarHorseIcon from "@/components/comp/StarHorseIcon.vue";
|
|
11
|
-
import { compKey } from "@/api/system";
|
|
12
|
-
|
|
13
|
-
export interface DataSelectorProps {
|
|
14
|
-
modelValue: ModelValueType;
|
|
15
|
-
selectedData?: any;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
dataUrl?: string;
|
|
18
|
-
datas?: Array<any>;
|
|
19
|
-
pageSize?: number;
|
|
20
|
-
title?: string;
|
|
21
|
-
compSize?: string;
|
|
22
|
-
displayName?: string;
|
|
23
|
-
displayValue?: string;
|
|
24
|
-
multiple?: boolean;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
checkStrictly?: boolean;
|
|
27
|
-
style?: CSSProperties;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const props = withDefaults(defineProps<DataSelectorProps>(), {
|
|
31
|
-
multiple: false,
|
|
32
|
-
disabled: false,
|
|
33
|
-
compSize: "small",
|
|
34
|
-
pageSize: 0,
|
|
35
|
-
displayName: "name",
|
|
36
|
-
displayValue: "value",
|
|
37
|
-
checkStrictly: true,
|
|
38
|
-
placeholder: "请选择数据",
|
|
39
|
-
});
|
|
40
|
-
const emits = defineEmits<{
|
|
41
|
-
(e: "update:modelValue", modelValue: ModelValueType): void;
|
|
42
|
-
(e: "selectedData", selectData: any): void;
|
|
43
|
-
}>();
|
|
44
|
-
const value: any = useVModel(props, "modelValue", emits);
|
|
45
|
-
const emitData: any = useVModel(props, "selectedData", emits);
|
|
46
|
-
const selectData: any = ref<any>();
|
|
47
|
-
const valueArr = computed<string[]>(() => {
|
|
48
|
-
emitData.value = selectData.value;
|
|
49
|
-
if (!selectData.value) return [];
|
|
50
|
-
if (Array.isArray(selectData.value)) {
|
|
51
|
-
value.value = selectData.value.map((v: any) => v[props.displayValue]);
|
|
52
|
-
return selectData.value;
|
|
53
|
-
} else {
|
|
54
|
-
value.value = selectData.value[props.displayValue];
|
|
55
|
-
return [selectData.value];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
const dataPickerRef = ref<InstanceType<typeof DataPicker>>();
|
|
59
|
-
const formDisabled = useFormDisabled();
|
|
60
|
-
const disabled = computed<boolean>(() => {
|
|
61
|
-
return formDisabled.value || props.disabled;
|
|
62
|
-
});
|
|
63
|
-
const openDataPicker = () => {
|
|
64
|
-
if (props.disabled) return;
|
|
65
|
-
dataPickerRef.value?.open();
|
|
66
|
-
};
|
|
67
|
-
const onClose = (data: any) => {
|
|
68
|
-
if (!selectData.value) return;
|
|
69
|
-
if (props.multiple && Array.isArray(selectData.value)) {
|
|
70
|
-
selectData.value.splice(selectData.value.indexOf(data), 1);
|
|
71
|
-
value.value.splice(selectData.value.indexOf(data[props.displayValue]), 1);
|
|
72
|
-
} else {
|
|
73
|
-
selectData.value = null;
|
|
74
|
-
value.value = null;
|
|
75
|
-
}
|
|
76
|
-
emits("selectedData", selectData.value);
|
|
77
|
-
};
|
|
78
|
-
</script>
|
|
79
|
-
|
|
80
|
-
<template>
|
|
81
|
-
<data-picker
|
|
82
|
-
ref="dataPickerRef"
|
|
83
|
-
:title="title"
|
|
84
|
-
:datas="datas"
|
|
85
|
-
:data-url="dataUrl"
|
|
86
|
-
:page-size="pageSize"
|
|
87
|
-
:display-name="displayName"
|
|
88
|
-
:display-value="displayValue"
|
|
89
|
-
:checkStrictly="checkStrictly"
|
|
90
|
-
:multiple="multiple"
|
|
91
|
-
v-model="selectData"
|
|
92
|
-
/>
|
|
93
|
-
<div class="data-wrapper">
|
|
94
|
-
<star-horse-icon
|
|
95
|
-
@click="openDataPicker"
|
|
96
|
-
cursor="pointer"
|
|
97
|
-
icon-class="select-data"
|
|
98
|
-
:border="true"
|
|
99
|
-
/>
|
|
100
|
-
<DataTag
|
|
101
|
-
v-for="(item, key) in valueArr"
|
|
102
|
-
:key="compKey(item, key)"
|
|
103
|
-
:closable="!disabled"
|
|
104
|
-
:data="item"
|
|
105
|
-
:display-name="displayName"
|
|
106
|
-
:display-value="displayValue"
|
|
107
|
-
@close="onClose"
|
|
108
|
-
/>
|
|
109
|
-
<el-text v-show="!value || value.length === 0" class="placeholder">
|
|
110
|
-
{{ placeholder }}
|
|
111
|
-
</el-text>
|
|
112
|
-
</div>
|
|
113
|
-
</template>
|
|
114
|
-
|
|
115
|
-
<style scoped lang="scss">
|
|
116
|
-
.el-tag {
|
|
117
|
-
padding: 0 3px;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.data-wrapper {
|
|
121
|
-
display: flex;
|
|
122
|
-
flex-wrap: wrap;
|
|
123
|
-
align-items: center;
|
|
124
|
-
grid-gap: 7px;
|
|
125
|
-
gap: 7px;
|
|
126
|
-
|
|
127
|
-
.placeholder {
|
|
128
|
-
color: var(--el-text-color-placeholder);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.data-but-item {
|
|
132
|
-
border-style: dashed;
|
|
133
|
-
|
|
134
|
-
&:hover {
|
|
135
|
-
border-style: solid;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
</style>
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="StarHorseDataView">
|
|
2
|
-
import { ApiUrls } from "@/components/types/ApiUrls";
|
|
3
|
-
import { inject, nextTick, onMounted, PropType, ref, watch } from "vue";
|
|
4
|
-
import { DialogProps } from "@/components/types/DialogProps";
|
|
5
|
-
import { formFieldMapping, isJson, loadById } from "@/api/star_horse_utils";
|
|
6
|
-
|
|
7
|
-
const dataForm = ref<any>({});
|
|
8
|
-
const props = defineProps({
|
|
9
|
-
compUrl: { type: Object as PropType<ApiUrls> },
|
|
10
|
-
objectName: { type: String },
|
|
11
|
-
subFormFlag: { type: String, default: "N" },
|
|
12
|
-
fieldList: { type: Object, required: true },
|
|
13
|
-
globalCondition: { type: Object },
|
|
14
|
-
outerData: { type: Object },
|
|
15
|
-
dynamicForm: { type: Boolean, default: false },
|
|
16
|
-
primaryKey: {
|
|
17
|
-
type: [String, Object] as PropType<string | any>,
|
|
18
|
-
default: "id",
|
|
19
|
-
},
|
|
20
|
-
batchFieldName: { type: String, default: "batchFieldList" },
|
|
21
|
-
dataFormat: { type: Function, default: null },
|
|
22
|
-
});
|
|
23
|
-
const emits = defineEmits(["dataLoaded"]);
|
|
24
|
-
const dialogProps = inject<DialogProps>("dialogProps");
|
|
25
|
-
watch(
|
|
26
|
-
() => dialogProps?.ids,
|
|
27
|
-
(val) => {
|
|
28
|
-
if (val == -2) {
|
|
29
|
-
} else if (!val || val == -1) {
|
|
30
|
-
dataForm.value = {};
|
|
31
|
-
} else {
|
|
32
|
-
loadData();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
// immediate: true,
|
|
37
|
-
deep: true,
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
onMounted(() => {
|
|
41
|
-
if (dialogProps?.ids) {
|
|
42
|
-
loadData();
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const loadData = async () => {
|
|
46
|
-
await nextTick();
|
|
47
|
-
let id = Array.isArray(dialogProps?.ids)
|
|
48
|
-
? dialogProps.ids[0]
|
|
49
|
-
: dialogProps?.ids;
|
|
50
|
-
if (!props.compUrl) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
let objData;
|
|
54
|
-
let params = props.globalCondition || {};
|
|
55
|
-
//如果是Json 对象
|
|
56
|
-
if (isJson(id)) {
|
|
57
|
-
params = { ...params, ...id };
|
|
58
|
-
objData = await loadById(props.compUrl?.loadByIdForViewUrl!, "", params);
|
|
59
|
-
} else {
|
|
60
|
-
objData = await loadById(props.compUrl?.loadByIdForViewUrl!, id, params);
|
|
61
|
-
}
|
|
62
|
-
let data = formFieldMapping(props.fieldList);
|
|
63
|
-
dataForm.value = objData;
|
|
64
|
-
//如果是动态表单
|
|
65
|
-
if (props.dynamicForm) {
|
|
66
|
-
for (let i in params) {
|
|
67
|
-
let temp = params[i];
|
|
68
|
-
if (!temp.subTabFlag) {
|
|
69
|
-
dataForm.value[temp.tableName] = [objData];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
let mapping = data.mappingFields;
|
|
74
|
-
if (mapping) {
|
|
75
|
-
for (let index in mapping) {
|
|
76
|
-
let temp = mapping[index];
|
|
77
|
-
dataForm.value[temp.name] = dataForm.value[temp.alias];
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
await nextTick(() => {
|
|
81
|
-
emits("dataLoaded", objData, true);
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const setData = (data: any) => {
|
|
85
|
-
dataForm.value = data;
|
|
86
|
-
};
|
|
87
|
-
//更新外面传进来的数据
|
|
88
|
-
watch(
|
|
89
|
-
() => props.outerData,
|
|
90
|
-
(val: any) => {
|
|
91
|
-
if (val) {
|
|
92
|
-
dataForm.value = { ...dataForm.value, ...val };
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{ immediate: true, deep: true },
|
|
96
|
-
);
|
|
97
|
-
defineExpose({
|
|
98
|
-
setData,
|
|
99
|
-
});
|
|
100
|
-
</script>
|
|
101
|
-
<template>
|
|
102
|
-
<div class="flex h-full w-full flex-col">
|
|
103
|
-
<star-horse-data-view-items
|
|
104
|
-
:commonFormat="dataFormat"
|
|
105
|
-
:field-list="fieldList"
|
|
106
|
-
v-model:data-form="dataForm"
|
|
107
|
-
/>
|
|
108
|
-
</div>
|
|
109
|
-
</template>
|
|
110
|
-
<style lang="scss" scoped></style>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="StarHorseDataViewObject">
|
|
2
|
-
import { ModelRef, PropType } from "vue";
|
|
3
|
-
import { PageFieldInfo } from "@/components/types/PageFieldInfo";
|
|
4
|
-
import { commonParseCodeToName } from "@/api/star_horse_utils";
|
|
5
|
-
import { compKey } from "@/api/system";
|
|
6
|
-
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
// compUrl: {type: Object as PropType<ApiUrls>},
|
|
9
|
-
fieldList: { type: Object as PropType<PageFieldInfo>, required: true },
|
|
10
|
-
objectName: { type: String },
|
|
11
|
-
subFormFlag: { type: String, default: "N" },
|
|
12
|
-
batchName: { type: String, default: "batchDataList" },
|
|
13
|
-
batchFieldName: { type: String, default: "batchFieldList" },
|
|
14
|
-
primaryKey: { type: [String, Object] as PropType<string | any> },
|
|
15
|
-
commonFormat: { type: Function, required: true },
|
|
16
|
-
});
|
|
17
|
-
const dataForm: ModelRef<any> = defineModel("dataForm");
|
|
18
|
-
const _compKey = compKey;
|
|
19
|
-
const itemCommonFormat = (name: string, cellValue: any, row: any) => {
|
|
20
|
-
cellValue = commonParseCodeToName(name, cellValue);
|
|
21
|
-
if (name == "isDel") {
|
|
22
|
-
return cellValue == 1 ? "是" : "否";
|
|
23
|
-
}
|
|
24
|
-
return null == props.commonFormat
|
|
25
|
-
? cellValue
|
|
26
|
-
: props.commonFormat(name, cellValue, row);
|
|
27
|
-
};
|
|
28
|
-
const checkItemType = (item: any) => {
|
|
29
|
-
if (Array.isArray(item)) {
|
|
30
|
-
return "view-box-item";
|
|
31
|
-
} else if (item.cardList?.length > 0) {
|
|
32
|
-
return "view-card-item";
|
|
33
|
-
} else if (item.collapseList?.length > 0) {
|
|
34
|
-
return "view-collapse-item";
|
|
35
|
-
} else if (item.tabList?.length > 0 || item.batchFieldList?.length > 0) {
|
|
36
|
-
return "view-tab-item";
|
|
37
|
-
} else if (item.dytableList?.length > 0) {
|
|
38
|
-
return "view-dytable-item";
|
|
39
|
-
} else {
|
|
40
|
-
return "view-other-item";
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
</script>
|
|
44
|
-
<template>
|
|
45
|
-
<component
|
|
46
|
-
v-for="item in fieldList.fieldList"
|
|
47
|
-
:key="_compKey(item, checkItemType(item))"
|
|
48
|
-
:is="checkItemType(item)"
|
|
49
|
-
:item="item"
|
|
50
|
-
v-model:dataForm="dataForm"
|
|
51
|
-
:commonFormat="itemCommonFormat"
|
|
52
|
-
/>
|
|
53
|
-
<view-table-item
|
|
54
|
-
:item="fieldList"
|
|
55
|
-
:batch-field-name="batchFieldName"
|
|
56
|
-
v-model:dataForm="dataForm"
|
|
57
|
-
:commonFormat="itemCommonFormat"
|
|
58
|
-
/>
|
|
59
|
-
<div class="h-[30px]"></div>
|
|
60
|
-
</template>
|
|
61
|
-
<style lang="scss" scoped></style>
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="StarHorseDataViewObject">
|
|
2
|
-
import { ModelRef, PropType } from "vue";
|
|
3
|
-
import { FieldInfo } from "@/components/types/PageFieldInfo";
|
|
4
|
-
import { rowClassName } from "@/api/star_horse_utils";
|
|
5
|
-
import { Config } from "@/api/settings";
|
|
6
|
-
import { compKey } from "@/api/system";
|
|
7
|
-
|
|
8
|
-
defineProps({
|
|
9
|
-
item: { type: Array as PropType<Array<FieldInfo> | any>, required: true },
|
|
10
|
-
batchName: { type: String, required: true },
|
|
11
|
-
compSize: { type: String, default: Config.compSize },
|
|
12
|
-
commonFormat: { type: Function, required: true },
|
|
13
|
-
});
|
|
14
|
-
const dataForm: ModelRef<any> = defineModel("dataForm");
|
|
15
|
-
</script>
|
|
16
|
-
<template>
|
|
17
|
-
<div
|
|
18
|
-
class="flex justify-between w-full"
|
|
19
|
-
style="border-bottom: var(--star-horse-style) 1px solid"
|
|
20
|
-
>
|
|
21
|
-
<div class="tb_title flex flex-row items-center">
|
|
22
|
-
<star-horse-icon icon-class="info" size="14px" />
|
|
23
|
-
{{ item.title }}
|
|
24
|
-
</div>
|
|
25
|
-
<div class="flex items-center flex-row-reverse"></div>
|
|
26
|
-
</div>
|
|
27
|
-
<el-table
|
|
28
|
-
:data="dataForm ? dataForm[batchName] : []"
|
|
29
|
-
fit
|
|
30
|
-
border
|
|
31
|
-
:stripe="true"
|
|
32
|
-
:row-class-name="rowClassName"
|
|
33
|
-
:highlight-current-row="true"
|
|
34
|
-
:size="compSize"
|
|
35
|
-
:row-style="{
|
|
36
|
-
height: '30px',
|
|
37
|
-
}"
|
|
38
|
-
:cell-style="{
|
|
39
|
-
height: '30px',
|
|
40
|
-
'font-size': '12px',
|
|
41
|
-
}"
|
|
42
|
-
:header-cell-style="{
|
|
43
|
-
background: '#f2f2f2',
|
|
44
|
-
color: '#707070',
|
|
45
|
-
'font-size': '13px',
|
|
46
|
-
'background-image':
|
|
47
|
-
'-webkit-gradient(linear,left 0,left 100%,from(#f8f8f8),to(#ececec))',
|
|
48
|
-
}"
|
|
49
|
-
>
|
|
50
|
-
<el-table-column label="序号" fixed align="center" prop="xh" width="60" />
|
|
51
|
-
<template
|
|
52
|
-
v-for="(aitem, index) in item?.fieldList"
|
|
53
|
-
:key="compKey(aitem, index)"
|
|
54
|
-
>
|
|
55
|
-
<template v-if="Array.isArray(aitem)">
|
|
56
|
-
<star-horse-table-view-column
|
|
57
|
-
:commonFormat="commonFormat"
|
|
58
|
-
:item="sitem"
|
|
59
|
-
v-for="(sitem, key) in aitem"
|
|
60
|
-
:key="compKey(sitem, key)"
|
|
61
|
-
/>
|
|
62
|
-
</template>
|
|
63
|
-
<template v-else-if="aitem.tabList?.length > 0">
|
|
64
|
-
<template
|
|
65
|
-
v-for="(tabItems, key) in aitem.tabList"
|
|
66
|
-
:key="compKey(tabItems, key)"
|
|
67
|
-
>
|
|
68
|
-
<star-horse-table-view-column
|
|
69
|
-
:commonFormat="commonFormat"
|
|
70
|
-
:item="sitem"
|
|
71
|
-
:key="compKey(sitem, skey)"
|
|
72
|
-
v-for="(sitem, skey) in tabItems.fieldList"
|
|
73
|
-
/>
|
|
74
|
-
</template>
|
|
75
|
-
</template>
|
|
76
|
-
<template v-else-if="aitem.batchFieldList?.length > 0">
|
|
77
|
-
<template
|
|
78
|
-
v-for="(batchItems, bkey) in aitem.batchFieldList"
|
|
79
|
-
:key="compKey(batchItems, bkey)"
|
|
80
|
-
>
|
|
81
|
-
<star-horse-table-view-column
|
|
82
|
-
:commonFormat="commonFormat"
|
|
83
|
-
:item="sitem"
|
|
84
|
-
:key="compKey(sitem, skey)"
|
|
85
|
-
v-for="(sitem, skey) in batchItems.fieldList"
|
|
86
|
-
/>
|
|
87
|
-
</template>
|
|
88
|
-
</template>
|
|
89
|
-
<star-horse-table-view-column
|
|
90
|
-
:commonFormat="commonFormat"
|
|
91
|
-
:item="aitem"
|
|
92
|
-
/>
|
|
93
|
-
</template>
|
|
94
|
-
</el-table>
|
|
95
|
-
</template>
|
|
96
|
-
<style lang="scss" scoped>
|
|
97
|
-
.el-table {
|
|
98
|
-
:deep(.cell) {
|
|
99
|
-
color: #000000;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
</style>
|