star-horse-lowcode 2.7.63 → 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 +1 -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 +19 -19
- package/dist/types/index.d.ts +7 -7
- package/eslint.config.js +37 -0
- package/index.html +14 -0
- package/package-lock.json +8276 -0
- package/package.json +4 -4
- 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,334 @@
|
|
|
1
|
+
<script setup lang="ts" name="starhorse-form-item">
|
|
2
|
+
import { computed, onMounted, PropType, ref } from "vue";
|
|
3
|
+
import { useDesignFormStore } from "@/store/DesignForm";
|
|
4
|
+
import piniaInstance from "@/store/index";
|
|
5
|
+
import StarHorseDialog from "@/components/comp/StarHorseDialog.vue";
|
|
6
|
+
import FieldList from "@/components/formcomp/utils/FieldList.vue";
|
|
7
|
+
import {
|
|
8
|
+
dynamicFormContextMenuData,
|
|
9
|
+
getParentComp,
|
|
10
|
+
moveDownItem,
|
|
11
|
+
moveUpItem,
|
|
12
|
+
removeItem,
|
|
13
|
+
} from "@/plugins/AblesPlugin";
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
parentField: { type: Object as PropType<any> },
|
|
17
|
+
parentId: { type: Object as PropType<any> },
|
|
18
|
+
formItem: { type: Object as PropType<any>, required: true },
|
|
19
|
+
isDesign: { type: Boolean, default: false },
|
|
20
|
+
showFormItem: { type: Boolean, default: false },
|
|
21
|
+
disabled: { type: Boolean, default: false },
|
|
22
|
+
//是否需要css 修饰
|
|
23
|
+
bareFlag: { type: Boolean, default: false },
|
|
24
|
+
});
|
|
25
|
+
let designForm = useDesignFormStore(piniaInstance);
|
|
26
|
+
let isEdit = computed(() => props.isDesign);
|
|
27
|
+
let currentItemId = computed(() => designForm.currentItemId);
|
|
28
|
+
const isDisabled = computed(() => props.disabled);
|
|
29
|
+
|
|
30
|
+
let componentVisible = computed(() => {
|
|
31
|
+
return (
|
|
32
|
+
designForm.componentVisible &&
|
|
33
|
+
currentItemId.value == props.formItem?.preps.id
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
const selectParentContainer = () => {
|
|
37
|
+
if (!isEdit.value || isDisabled.value) return;
|
|
38
|
+
designForm.selectItem(props.parentField, "", "container");
|
|
39
|
+
};
|
|
40
|
+
const selectData = (data: any) => {
|
|
41
|
+
if (!isEdit.value || isDisabled.value) return;
|
|
42
|
+
designForm.selectItem(
|
|
43
|
+
props.formItem,
|
|
44
|
+
data.itemType,
|
|
45
|
+
getParentComp(props.parentField),
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const exchangeItem = () => {
|
|
50
|
+
designForm.setComponentVisible(true);
|
|
51
|
+
};
|
|
52
|
+
const close = () => {
|
|
53
|
+
designForm.setComponentVisible(false);
|
|
54
|
+
};
|
|
55
|
+
const changeItem = (item: any) => {
|
|
56
|
+
props.formItem["itemType"] = item["itemType"];
|
|
57
|
+
if (item.category == 2) {
|
|
58
|
+
props.formItem["compType"] = "container";
|
|
59
|
+
}
|
|
60
|
+
props.formItem["preps"] = {
|
|
61
|
+
...props.formItem["preps"],
|
|
62
|
+
itemNameLabel: item.itemName,
|
|
63
|
+
};
|
|
64
|
+
close();
|
|
65
|
+
selectData(props.formItem);
|
|
66
|
+
};
|
|
67
|
+
const itemContextMenuRef = ref();
|
|
68
|
+
const itemContextMenu = (evt: MouseEvent | any) => {
|
|
69
|
+
if (!isEdit.value || isDisabled.value) return;
|
|
70
|
+
evt.stopPropagation();
|
|
71
|
+
evt.preventDefault();
|
|
72
|
+
evt.props = props;
|
|
73
|
+
itemContextMenuRef.value?.show(evt);
|
|
74
|
+
};
|
|
75
|
+
onMounted(() => {});
|
|
76
|
+
</script>
|
|
77
|
+
<template>
|
|
78
|
+
<star-horse-dialog
|
|
79
|
+
box-width="450px"
|
|
80
|
+
:source="3"
|
|
81
|
+
:full-screen="false"
|
|
82
|
+
title="更换组件"
|
|
83
|
+
:self-func="true"
|
|
84
|
+
:dialog-visible="componentVisible"
|
|
85
|
+
@closeAction="close"
|
|
86
|
+
>
|
|
87
|
+
<template #footer>
|
|
88
|
+
<el-button type="primary" size="default" @click="close">确定</el-button>
|
|
89
|
+
</template>
|
|
90
|
+
<field-list @selectData="changeItem" />
|
|
91
|
+
</star-horse-dialog>
|
|
92
|
+
<div
|
|
93
|
+
class="w-fill"
|
|
94
|
+
:class="{ 'item-info': formItem.preps?.itemType != 'usercomp' }"
|
|
95
|
+
:style="{
|
|
96
|
+
margin: formItem.preps?.itemType == 'button' ? '5px auto' : 'unset',
|
|
97
|
+
}"
|
|
98
|
+
v-if="bareFlag === true"
|
|
99
|
+
>
|
|
100
|
+
<help :message="formItem.preps?.helpMsg" v-if="formItem.preps?.helpMsg" />
|
|
101
|
+
<slot></slot>
|
|
102
|
+
</div>
|
|
103
|
+
<div v-else class="form-item-operation">
|
|
104
|
+
<div
|
|
105
|
+
class="w-fill"
|
|
106
|
+
:class="{
|
|
107
|
+
'design-star-horse': isEdit && !disabled,
|
|
108
|
+
'field-item': true,
|
|
109
|
+
'active-item':
|
|
110
|
+
currentItemId == formItem?.preps.id && isEdit && !disabled,
|
|
111
|
+
}"
|
|
112
|
+
v-if="showFormItem"
|
|
113
|
+
@click="selectData(formItem)"
|
|
114
|
+
@contextmenu="itemContextMenu"
|
|
115
|
+
>
|
|
116
|
+
<el-form-item
|
|
117
|
+
:size="formItem?.preps['size'] || 'default'"
|
|
118
|
+
v-if="
|
|
119
|
+
parentField?.itemType != 'table' &&
|
|
120
|
+
formItem.preps?.itemType != 'divider' &&
|
|
121
|
+
formItem?.preps['headerFlag'] != 'Y'
|
|
122
|
+
"
|
|
123
|
+
:style="{
|
|
124
|
+
marginBottom: isEdit && !disabled ? '1px' : '18px',
|
|
125
|
+
}"
|
|
126
|
+
:label="formItem?.preps['hideLabel'] ? '' : formItem?.preps['label']"
|
|
127
|
+
:prop="formItem?.preps['name']"
|
|
128
|
+
:required="formItem?.preps['required']"
|
|
129
|
+
:rules="
|
|
130
|
+
formItem?.preps['required']
|
|
131
|
+
? [{ required: true, trigger: 'blur', message: '必须项不能为空' }]
|
|
132
|
+
: []
|
|
133
|
+
"
|
|
134
|
+
>
|
|
135
|
+
<help
|
|
136
|
+
:message="formItem.preps?.helpMsg"
|
|
137
|
+
v-if="formItem.preps?.helpMsg"
|
|
138
|
+
/>
|
|
139
|
+
<slot></slot>
|
|
140
|
+
</el-form-item>
|
|
141
|
+
<div
|
|
142
|
+
class="w-fill"
|
|
143
|
+
v-else
|
|
144
|
+
:class="{
|
|
145
|
+
'bare-item': true,
|
|
146
|
+
'item-info': formItem.preps?.itemType != 'usercomp',
|
|
147
|
+
}"
|
|
148
|
+
:style="{
|
|
149
|
+
margin: formItem?.itemType == 'button' ? '5px auto' : 'unset',
|
|
150
|
+
}"
|
|
151
|
+
@click.stop="selectData(formItem)"
|
|
152
|
+
>
|
|
153
|
+
<help
|
|
154
|
+
:message="formItem.preps?.helpMsg"
|
|
155
|
+
v-if="formItem.preps?.helpMsg"
|
|
156
|
+
/>
|
|
157
|
+
<slot></slot>
|
|
158
|
+
</div>
|
|
159
|
+
<div
|
|
160
|
+
class="field-action"
|
|
161
|
+
v-if="isEdit && !disabled && currentItemId == formItem?.preps.id"
|
|
162
|
+
>
|
|
163
|
+
<el-tooltip content="选择父容器" v-if="parentField?.itemType">
|
|
164
|
+
<star-horse-icon
|
|
165
|
+
@click.stop="selectParentContainer()"
|
|
166
|
+
icon-class="select-parent"
|
|
167
|
+
cursor="pointer"
|
|
168
|
+
style="color: var(--star-horse-white)"
|
|
169
|
+
/>
|
|
170
|
+
</el-tooltip>
|
|
171
|
+
<el-tooltip content="更换组件">
|
|
172
|
+
<star-horse-icon
|
|
173
|
+
@click.stop="exchangeItem"
|
|
174
|
+
icon-class="exchange"
|
|
175
|
+
cursor="pointer"
|
|
176
|
+
style="color: var(--star-horse-white)"
|
|
177
|
+
/>
|
|
178
|
+
</el-tooltip>
|
|
179
|
+
<el-tooltip content="上移" v-if="parentField?.itemType != 'table'">
|
|
180
|
+
<star-horse-icon
|
|
181
|
+
@click.stop="moveUpItem(isEdit, formItem?.preps, parentField)"
|
|
182
|
+
icon-class="move-up"
|
|
183
|
+
cursor="pointer"
|
|
184
|
+
style="color: var(--star-horse-white)"
|
|
185
|
+
/>
|
|
186
|
+
</el-tooltip>
|
|
187
|
+
<el-tooltip content="下移" v-if="parentField?.itemType != 'table'">
|
|
188
|
+
<star-horse-icon
|
|
189
|
+
@click.stop="moveDownItem(isEdit, formItem?.preps, parentField)"
|
|
190
|
+
icon-class="move-down"
|
|
191
|
+
cursor="pointer"
|
|
192
|
+
style="color: var(--star-horse-white)"
|
|
193
|
+
/>
|
|
194
|
+
</el-tooltip>
|
|
195
|
+
<el-tooltip content="删除组件">
|
|
196
|
+
<star-horse-icon
|
|
197
|
+
@click.stop="removeItem(isEdit, formItem?.preps, parentField)"
|
|
198
|
+
icon-class="clear-all"
|
|
199
|
+
cursor="pointer"
|
|
200
|
+
style="color: var(--star-horse-white)"
|
|
201
|
+
/>
|
|
202
|
+
</el-tooltip>
|
|
203
|
+
</div>
|
|
204
|
+
<div
|
|
205
|
+
class="drag-handler"
|
|
206
|
+
v-if="isEdit && currentItemId == formItem?.preps.id"
|
|
207
|
+
>
|
|
208
|
+
<el-tooltip content="拖动">
|
|
209
|
+
<star-horse-icon
|
|
210
|
+
icon-class="drag"
|
|
211
|
+
style="cursor: move; color: var(--star-horse-white)"
|
|
212
|
+
/>
|
|
213
|
+
</el-tooltip>
|
|
214
|
+
|
|
215
|
+
<el-tooltip :content="formItem?.preps['itemNameLabel']">
|
|
216
|
+
<span
|
|
217
|
+
style="color: var(--star-horse-white); cursor: pointer"
|
|
218
|
+
@click="selectData(formItem)"
|
|
219
|
+
>{{ formItem?.preps["itemNameLabel"] }}</span
|
|
220
|
+
>
|
|
221
|
+
</el-tooltip>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
<div
|
|
225
|
+
class="item-info"
|
|
226
|
+
:style="{
|
|
227
|
+
margin: formItem.preps?.itemType == 'button' ? '5px auto' : 'unset',
|
|
228
|
+
}"
|
|
229
|
+
v-else
|
|
230
|
+
>
|
|
231
|
+
<help :message="formItem.preps?.helpMsg" v-if="formItem.preps?.helpMsg" />
|
|
232
|
+
<slot></slot>
|
|
233
|
+
</div>
|
|
234
|
+
<Teleport to="body">
|
|
235
|
+
<ContentMenu
|
|
236
|
+
ref="itemContextMenuRef"
|
|
237
|
+
:menu-data="dynamicFormContextMenuData(formItem, parentField, 'item')"
|
|
238
|
+
/>
|
|
239
|
+
</Teleport>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
242
|
+
<style lang="scss" scoped>
|
|
243
|
+
.form-item-operation {
|
|
244
|
+
display: flex;
|
|
245
|
+
width: 100%;
|
|
246
|
+
flex: 1;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.item-info {
|
|
250
|
+
display: flex;
|
|
251
|
+
width: 100%;
|
|
252
|
+
flex: 1;
|
|
253
|
+
justify-content: start;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.active-item {
|
|
257
|
+
border: 1px dashed var(--star-horse-style);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.design-star-horse {
|
|
261
|
+
width: 100%;
|
|
262
|
+
display: flex;
|
|
263
|
+
justify-content: center;
|
|
264
|
+
vertical-align: middle;
|
|
265
|
+
align-items: center;
|
|
266
|
+
min-height: 50px;
|
|
267
|
+
z-index: 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.el-form-item {
|
|
271
|
+
//margin-bottom: 0 !important;
|
|
272
|
+
//margin-bottom: 6px;
|
|
273
|
+
//margin-top: 2px;
|
|
274
|
+
position: relative;
|
|
275
|
+
|
|
276
|
+
:deep(.el-form-item__label) {
|
|
277
|
+
white-space: nowrap;
|
|
278
|
+
text-overflow: ellipsis;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
span.custom-label i {
|
|
282
|
+
margin: 0 3px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* 隐藏Chrome浏览器中el-input数字输入框右侧的上下调整小箭头 */
|
|
286
|
+
:deep(.hide-spin-button) input::-webkit-outer-spin-button,
|
|
287
|
+
:deep(.hide-spin-button) input::-webkit-inner-spin-button {
|
|
288
|
+
-webkit-appearance: none !important;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* 隐藏Firefox浏览器中el-input数字输入框右侧的上下调整小箭头 */
|
|
292
|
+
:deep(.hide-spin-button) input[type="number"] {
|
|
293
|
+
-moz-appearance: textfield;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.required :deep(.el-form-item__label)::before {
|
|
298
|
+
content: "*";
|
|
299
|
+
color: #f56c6c;
|
|
300
|
+
margin-right: 4px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.static-content-item {
|
|
304
|
+
min-height: 20px;
|
|
305
|
+
display: flex;
|
|
306
|
+
/* 垂直居中 */
|
|
307
|
+
align-items: center;
|
|
308
|
+
|
|
309
|
+
/* 垂直居中 */
|
|
310
|
+
:deep(.el-divider--horizontal) {
|
|
311
|
+
margin: 0;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.el-form-item.selected,
|
|
316
|
+
.static-content-item.selected {
|
|
317
|
+
outline: 2px solid var(--star-horse-style);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
:deep(.label-left-align) .el-form-item__label {
|
|
321
|
+
text-align: left;
|
|
322
|
+
justify-content: flex-start !important;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
:deep(.label-center-align) .el-form-item__label {
|
|
326
|
+
text-align: center;
|
|
327
|
+
justify-content: center !important;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
:deep(.label-right-align) .el-form-item__label {
|
|
331
|
+
text-align: right;
|
|
332
|
+
justify-content: flex-end !important;
|
|
333
|
+
}
|
|
334
|
+
</style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<starhorse-form-item
|
|
3
|
+
:showFormItem="showFormItem"
|
|
4
|
+
:isDesign="isDesign"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:bareFlag="bareFlag"
|
|
7
|
+
:formItem="field"
|
|
8
|
+
:parentField="parentField"
|
|
9
|
+
>
|
|
10
|
+
<el-switch
|
|
11
|
+
:fid="field.fieldName"
|
|
12
|
+
:disabled="checkIsDisabled(props)"
|
|
13
|
+
v-bind="field.preps"
|
|
14
|
+
v-on="getDynamicEvents(props, itemAction)"
|
|
15
|
+
v-model="formData[field.fieldName]"
|
|
16
|
+
/>
|
|
17
|
+
</starhorse-form-item>
|
|
18
|
+
</template>
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { onMounted, PropType } from "vue";
|
|
21
|
+
import {
|
|
22
|
+
allAction,
|
|
23
|
+
checkIsDisabled,
|
|
24
|
+
initCompCallEvent,
|
|
25
|
+
} from "@/components/formcomp/utils/ItemRelationEventUtils";
|
|
26
|
+
import { getDynamicEvents } from "@/api/system";
|
|
27
|
+
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
isDesign: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
showFormItem: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
bareFlag: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
isSearch: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
field: {
|
|
50
|
+
type: Object as PropType<any>,
|
|
51
|
+
required: true,
|
|
52
|
+
},
|
|
53
|
+
parentField: {
|
|
54
|
+
type: Object as PropType<any>,
|
|
55
|
+
},
|
|
56
|
+
formInfo: {
|
|
57
|
+
type: Object as PropType<any>,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
61
|
+
const formData = defineModel("formData");
|
|
62
|
+
const itemAction = (prep: any) => {
|
|
63
|
+
allAction(props, emits, formData, prep);
|
|
64
|
+
};
|
|
65
|
+
onMounted(() => {
|
|
66
|
+
if (!props.field.preps) {
|
|
67
|
+
props.field.preps = {};
|
|
68
|
+
}
|
|
69
|
+
props.field.preps["activeText"] = props.field.preps["activeText"] ?? "是";
|
|
70
|
+
props.field.preps["inactiveText"] = props.field.preps["inactiveText"] ?? "否";
|
|
71
|
+
props.field.preps["activeValue"] = props.field.preps["activeValue"] ?? true;
|
|
72
|
+
props.field.preps["inactiveValue"] =
|
|
73
|
+
props.field.preps["inactiveValue"] ?? false;
|
|
74
|
+
initCompCallEvent(props, emits, formData);
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
77
|
+
<style scoped></style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
import { allAction } from "@/components/formcomp/utils/ItemRelationEventUtils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
isDesign: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false,
|
|
9
|
+
},
|
|
10
|
+
disabled: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
showFormItem: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
bareFlag: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
isSearch: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
field: {
|
|
27
|
+
type: Object as PropType<any>,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
parentField: {
|
|
31
|
+
type: Object as PropType<any>,
|
|
32
|
+
},
|
|
33
|
+
formInfo: {
|
|
34
|
+
type: Object as PropType<any>,
|
|
35
|
+
},
|
|
36
|
+
callBack: {
|
|
37
|
+
type: Function,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
41
|
+
const formData = defineModel("formData");
|
|
42
|
+
const itemAction = (prep: any) => {
|
|
43
|
+
allAction(props, emits, formData, prep);
|
|
44
|
+
};
|
|
45
|
+
const tagType = (val: any) => {
|
|
46
|
+
let tagMap = props.field?.preps?.tagMap;
|
|
47
|
+
if (tagMap && Object.keys(tagMap).length > 0) {
|
|
48
|
+
return tagMap[val] || "primary";
|
|
49
|
+
}
|
|
50
|
+
return props.field?.preps?.tagType || "primary";
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
<template>
|
|
54
|
+
<starhorse-form-item
|
|
55
|
+
:showFormItem="showFormItem"
|
|
56
|
+
:isDesign="isDesign"
|
|
57
|
+
:disabled="disabled"
|
|
58
|
+
:bareFlag="bareFlag"
|
|
59
|
+
:formItem="field"
|
|
60
|
+
:parentField="parentField"
|
|
61
|
+
>
|
|
62
|
+
<el-tag
|
|
63
|
+
v-bind="field.preps"
|
|
64
|
+
:type="tagType(formData[field.fieldName])"
|
|
65
|
+
@click="itemAction('click')"
|
|
66
|
+
class="relative"
|
|
67
|
+
>
|
|
68
|
+
{{
|
|
69
|
+
(callBack && callBack()) ||
|
|
70
|
+
formData[field.fieldName] ||
|
|
71
|
+
field.preps?.placeholder ||
|
|
72
|
+
"请赋值" + field.label
|
|
73
|
+
}}
|
|
74
|
+
</el-tag>
|
|
75
|
+
</starhorse-form-item>
|
|
76
|
+
</template>
|
|
77
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
import { allAction } from "@/components/formcomp/utils/ItemRelationEventUtils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
isDesign: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false,
|
|
9
|
+
},
|
|
10
|
+
disabled: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
showFormItem: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
bareFlag: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
isSearch: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
field: {
|
|
27
|
+
type: Object as PropType<any>,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
parentField: {
|
|
31
|
+
type: Object as PropType<any>,
|
|
32
|
+
},
|
|
33
|
+
formInfo: {
|
|
34
|
+
type: Object as PropType<any>,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
38
|
+
const formData = defineModel<any>("formData");
|
|
39
|
+
const itemAction = (prep: any) => {
|
|
40
|
+
allAction(props, emits, formData, prep);
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
<template>
|
|
44
|
+
<starhorse-form-item
|
|
45
|
+
:showFormItem="showFormItem"
|
|
46
|
+
:isDesign="isDesign"
|
|
47
|
+
:disabled="disabled"
|
|
48
|
+
:bareFlag="bareFlag"
|
|
49
|
+
:formItem="field"
|
|
50
|
+
:parentField="parentField"
|
|
51
|
+
>
|
|
52
|
+
<div class="h-full w-full" @click="itemAction('click')">
|
|
53
|
+
<div
|
|
54
|
+
class="flex"
|
|
55
|
+
:style="{
|
|
56
|
+
verticalAlign: field.preps?.verticalAlign ?? 'middle',
|
|
57
|
+
justifyContent: field.preps?.justifyContent ?? 'left',
|
|
58
|
+
alignItems: field.preps?.alignItems ?? 'left',
|
|
59
|
+
wordBreak: field.preps?.wordBreak ?? 'normal',
|
|
60
|
+
width: field.preps?.width ?? '100%',
|
|
61
|
+
height: field.preps?.height ?? '100%',
|
|
62
|
+
fontWeight: field.preps?.fontWeight ?? '600',
|
|
63
|
+
color: field.preps?.color ?? 'inherit',
|
|
64
|
+
backgroundColor: field.preps?.backgroundColor ?? 'none',
|
|
65
|
+
borderRadius: field.preps?.fontWeight ?? 'none',
|
|
66
|
+
border: field.preps?.border ?? 'none',
|
|
67
|
+
margin: ' 0 5px',
|
|
68
|
+
}"
|
|
69
|
+
>
|
|
70
|
+
{{ field.preps?.textContent || field.preps?.placeholder }}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</starhorse-form-item>
|
|
74
|
+
</template>
|
|
75
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<EditDataDialog
|
|
3
|
+
v-model="editorDialogVisible"
|
|
4
|
+
:disabled="checkIsDisabled(props)"
|
|
5
|
+
:initial-content="formData[field.fieldName]"
|
|
6
|
+
@confirm="handleContentConfirm"
|
|
7
|
+
/>
|
|
8
|
+
<starhorse-form-item
|
|
9
|
+
:showFormItem="showFormItem"
|
|
10
|
+
:isDesign="isDesign"
|
|
11
|
+
:disabled="disabled"
|
|
12
|
+
:bareFlag="bareFlag"
|
|
13
|
+
:formItem="field"
|
|
14
|
+
:parentField="parentField"
|
|
15
|
+
>
|
|
16
|
+
<el-input
|
|
17
|
+
@dblclick="maxEdit"
|
|
18
|
+
:disabled="checkIsDisabled(props)"
|
|
19
|
+
:fid="field.fieldName"
|
|
20
|
+
v-bind="field.preps"
|
|
21
|
+
type="textarea"
|
|
22
|
+
v-on="getDynamicEvents(props, itemAction)"
|
|
23
|
+
v-model="formData[field.fieldName]"
|
|
24
|
+
/>
|
|
25
|
+
</starhorse-form-item>
|
|
26
|
+
</template>
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { onMounted, PropType, shallowRef } from "vue";
|
|
29
|
+
import {
|
|
30
|
+
allAction,
|
|
31
|
+
checkIsDisabled,
|
|
32
|
+
initCompCallEvent,
|
|
33
|
+
} from "@/components/formcomp/utils/ItemRelationEventUtils";
|
|
34
|
+
import EditDataDialog from "@/components/formcomp/utils/EditDataDialog.vue";
|
|
35
|
+
import { getDynamicEvents } from "@/api/system";
|
|
36
|
+
|
|
37
|
+
const props = defineProps({
|
|
38
|
+
isDesign: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
showFormItem: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
bareFlag: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
isSearch: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
field: {
|
|
59
|
+
type: Object as PropType<any>,
|
|
60
|
+
required: true,
|
|
61
|
+
},
|
|
62
|
+
parentField: {
|
|
63
|
+
type: Object as PropType<any>,
|
|
64
|
+
},
|
|
65
|
+
formInfo: {
|
|
66
|
+
type: Object as PropType<any>,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
70
|
+
const formData = defineModel("formData");
|
|
71
|
+
const editorDialogVisible = shallowRef(false);
|
|
72
|
+
const itemAction = (prep: any) => {
|
|
73
|
+
allAction(props, emits, formData, prep);
|
|
74
|
+
};
|
|
75
|
+
const maxEdit = () => {
|
|
76
|
+
editorDialogVisible.value = true;
|
|
77
|
+
};
|
|
78
|
+
const handleContentConfirm = (newContent: string) => {
|
|
79
|
+
formData.value[props.field.fieldName] = newContent;
|
|
80
|
+
};
|
|
81
|
+
onMounted(() => {
|
|
82
|
+
initCompCallEvent(props, emits, formData);
|
|
83
|
+
});
|
|
84
|
+
</script>
|
|
85
|
+
<style scoped></style>
|