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,177 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<star-horse-dialog
|
|
3
|
+
:title="field.label + '数据选择'"
|
|
4
|
+
:self-func="true"
|
|
5
|
+
:dialog-visible="dialogInputVisible"
|
|
6
|
+
@merge="selectItem"
|
|
7
|
+
:box-height="'500px'"
|
|
8
|
+
@closeAction="closeAction"
|
|
9
|
+
>
|
|
10
|
+
<div style="width: 100%">
|
|
11
|
+
<component
|
|
12
|
+
:is="field.preps.compName"
|
|
13
|
+
:params="field.preps"
|
|
14
|
+
ref="userTableRef"
|
|
15
|
+
style="flex: 1"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
</star-horse-dialog>
|
|
19
|
+
<starhorse-form-item
|
|
20
|
+
:showFormItem="showFormItem"
|
|
21
|
+
:isDesign="isDesign"
|
|
22
|
+
:disabled="disabled"
|
|
23
|
+
:bareFlag="bareFlag"
|
|
24
|
+
:formItem="field"
|
|
25
|
+
:parentField="parentField"
|
|
26
|
+
>
|
|
27
|
+
<el-mention
|
|
28
|
+
:disabled="checkIsDisabled(props)"
|
|
29
|
+
:options="userOptionList"
|
|
30
|
+
:whole="true"
|
|
31
|
+
:fid="field.fieldName"
|
|
32
|
+
v-bind="field.preps"
|
|
33
|
+
v-on="getDynamicEvents(props, itemAction)"
|
|
34
|
+
v-model="formData[field.fieldName]"
|
|
35
|
+
>
|
|
36
|
+
<template #append>
|
|
37
|
+
<star-horse-icon
|
|
38
|
+
icon-class="user-add"
|
|
39
|
+
@click="showVisible"
|
|
40
|
+
:disabled="field.preps['disabled']"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
43
|
+
</el-mention>
|
|
44
|
+
</starhorse-form-item>
|
|
45
|
+
</template>
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { nextTick, PropType, shallowRef } from "vue";
|
|
48
|
+
import { FieldMapping } from "@/components/types/PageFieldInfo";
|
|
49
|
+
import { warning } from "@/utils/message";
|
|
50
|
+
import {
|
|
51
|
+
allAction,
|
|
52
|
+
checkIsDisabled,
|
|
53
|
+
} from "@/components/formcomp/utils/ItemRelationEventUtils";
|
|
54
|
+
import { getDynamicEvents } from "@/api/system";
|
|
55
|
+
|
|
56
|
+
const props = defineProps({
|
|
57
|
+
isDesign: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
disabled: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false,
|
|
64
|
+
},
|
|
65
|
+
showFormItem: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
bareFlag: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false,
|
|
72
|
+
},
|
|
73
|
+
isSearch: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
77
|
+
field: {
|
|
78
|
+
type: Object as PropType<any>,
|
|
79
|
+
required: true,
|
|
80
|
+
},
|
|
81
|
+
parentField: {
|
|
82
|
+
type: Object as PropType<any>,
|
|
83
|
+
},
|
|
84
|
+
formInfo: {
|
|
85
|
+
type: Object as PropType<any>,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
89
|
+
const formData = defineModel("formData");
|
|
90
|
+
let userTableRef = shallowRef();
|
|
91
|
+
let dialogInputVisible = shallowRef<boolean>(false);
|
|
92
|
+
let userOptionList = shallowRef<Array<any>>([]);
|
|
93
|
+
const itemAction = (prep: any) => {
|
|
94
|
+
allAction(props, emits, formData, prep);
|
|
95
|
+
};
|
|
96
|
+
const selectItem = (_row: any) => {
|
|
97
|
+
userOptionList.value = [];
|
|
98
|
+
let needField = props.field.preps["needField"];
|
|
99
|
+
let selectDatas = userTableRef.value.$refs.employeeInfoRef.multipleSelection;
|
|
100
|
+
if (!selectDatas) {
|
|
101
|
+
warning("请选择数据");
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
//如果没有指定属性,则默认取相同的属性
|
|
105
|
+
let name = props.field.fieldName;
|
|
106
|
+
let aliasName = props.field.preps["aliasName"];
|
|
107
|
+
let temp: any = {};
|
|
108
|
+
for (let i in selectDatas) {
|
|
109
|
+
let data = selectDatas[i];
|
|
110
|
+
if (!needField) {
|
|
111
|
+
if (!Object.keys(temp).includes(name)) {
|
|
112
|
+
temp[name] = [];
|
|
113
|
+
temp[aliasName] = [];
|
|
114
|
+
}
|
|
115
|
+
userOptionList.value.push({
|
|
116
|
+
label: data["name"],
|
|
117
|
+
value: data["employeeNo"],
|
|
118
|
+
});
|
|
119
|
+
temp[name].push(data["name"]);
|
|
120
|
+
temp[aliasName].push(data["employeeNo"]);
|
|
121
|
+
} else {
|
|
122
|
+
needField.forEach((item: FieldMapping) => {
|
|
123
|
+
if (needField.length == 1) {
|
|
124
|
+
if (!Object.keys(temp).includes(item.sourceField)) {
|
|
125
|
+
temp[item.sourceField] = [];
|
|
126
|
+
}
|
|
127
|
+
temp[name].push(data[item.sourceField]);
|
|
128
|
+
} else {
|
|
129
|
+
if (!Object.keys(temp).includes(item.distField)) {
|
|
130
|
+
temp[item.distField] = [];
|
|
131
|
+
}
|
|
132
|
+
temp[item.distField] = data[item.sourceField];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (!needField) {
|
|
139
|
+
formData.value[name] = temp[name].join(" ");
|
|
140
|
+
formData.value[aliasName] = temp[aliasName].join(" ");
|
|
141
|
+
} else {
|
|
142
|
+
needField.forEach((item: FieldMapping) => {
|
|
143
|
+
if (needField.length == 1) {
|
|
144
|
+
formData.value[name] = temp[item.sourceField].join(" ");
|
|
145
|
+
} else {
|
|
146
|
+
formData.value[item.distField] = temp[item.distField].join(" ");
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (props.field.preps["recall"]) {
|
|
151
|
+
props.field.preps["recall"](selectDatas);
|
|
152
|
+
}
|
|
153
|
+
closeAction();
|
|
154
|
+
};
|
|
155
|
+
const closeAction = () => {
|
|
156
|
+
dialogInputVisible.value = false;
|
|
157
|
+
};
|
|
158
|
+
const showVisible = () => {
|
|
159
|
+
dialogInputVisible.value = true;
|
|
160
|
+
nextTick(() => {
|
|
161
|
+
let fields = props.field.preps["needField"];
|
|
162
|
+
let name = props.field.fieldName;
|
|
163
|
+
let realName = name;
|
|
164
|
+
if (props.field.preps["aliasName"]) {
|
|
165
|
+
realName = props.field.preps["aliasName"];
|
|
166
|
+
}
|
|
167
|
+
if (fields) {
|
|
168
|
+
name = fields.map((item: FieldMapping) => item.sourceField)[0];
|
|
169
|
+
}
|
|
170
|
+
userTableRef.value.$refs.employeeInfoRef.setDataInfo(
|
|
171
|
+
name,
|
|
172
|
+
formData.value[realName],
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
</script>
|
|
177
|
+
<style lang="less" scoped></style>
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
<component
|
|
11
|
+
:is="currentComponent"
|
|
12
|
+
:showFormItem="showFormItem"
|
|
13
|
+
:isDesign="isDesign"
|
|
14
|
+
:disabled="disabled"
|
|
15
|
+
:bareFlag="bareFlag"
|
|
16
|
+
v-bind="field['preps']"
|
|
17
|
+
v-model:dataForm="formData"
|
|
18
|
+
/>
|
|
19
|
+
</starhorse-form-item>
|
|
20
|
+
</template>
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { onMounted, PropType, shallowRef, watch } from "vue";
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
isDesign: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
showFormItem: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
bareFlag: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
isSearch: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
field: {
|
|
46
|
+
type: Object as PropType<any>,
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
parentField: {
|
|
50
|
+
type: Object as PropType<any>,
|
|
51
|
+
},
|
|
52
|
+
formInfo: {
|
|
53
|
+
type: Object as PropType<any>,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
57
|
+
const formData = defineModel("formData");
|
|
58
|
+
|
|
59
|
+
const currentComponent = shallowRef(null);
|
|
60
|
+
const loadComponent = async () => {
|
|
61
|
+
let compName = props.field["preps"].compName;
|
|
62
|
+
if (compName) {
|
|
63
|
+
try {
|
|
64
|
+
let comp = await import(`@/components/${compName}.vue`);
|
|
65
|
+
currentComponent.value = comp.default;
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.log(e.message);
|
|
68
|
+
currentComponent.value = null;
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
currentComponent.value = props.field?.preps["name"];
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
onMounted(() => {
|
|
75
|
+
loadComponent();
|
|
76
|
+
});
|
|
77
|
+
watch(
|
|
78
|
+
() => [props.field.preps?.compName, props.field.preps?.name],
|
|
79
|
+
() => {
|
|
80
|
+
loadComponent();
|
|
81
|
+
},
|
|
82
|
+
{ immediate: false },
|
|
83
|
+
);
|
|
84
|
+
</script>
|
|
85
|
+
<style scoped></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
|
+
<div
|
|
11
|
+
ref="markdownEditor"
|
|
12
|
+
class="markdown-editor"
|
|
13
|
+
v-html="markdown.render(formData[field.fieldName] || '')"
|
|
14
|
+
/>
|
|
15
|
+
</starhorse-form-item>
|
|
16
|
+
</template>
|
|
17
|
+
<script setup lang="ts" name="view-markdown">
|
|
18
|
+
import { nextTick, onMounted, onUpdated, PropType, ref } from "vue";
|
|
19
|
+
import MarkdownIt from "markdown-it";
|
|
20
|
+
|
|
21
|
+
defineProps({
|
|
22
|
+
isDesign: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
showFormItem: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
bareFlag: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
isSearch: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
field: {
|
|
43
|
+
type: Object as PropType<any>,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
parentField: {
|
|
47
|
+
type: Object as PropType<any>,
|
|
48
|
+
},
|
|
49
|
+
formInfo: {
|
|
50
|
+
type: Object as PropType<any>,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
54
|
+
const formData = defineModel("formData");
|
|
55
|
+
|
|
56
|
+
let markdownEditor = ref();
|
|
57
|
+
let markdown = ref<MarkdownIt>(null);
|
|
58
|
+
const init = async () => {
|
|
59
|
+
await nextTick(() => {
|
|
60
|
+
if (!markdown.value && markdownEditor.value) {
|
|
61
|
+
markdown.value = new MarkdownIt(markdownEditor.value, {});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
onMounted(() => {
|
|
66
|
+
init();
|
|
67
|
+
});
|
|
68
|
+
onUpdated(() => {
|
|
69
|
+
init();
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
<style lang="scss" scoped>
|
|
73
|
+
.markdown-editor {
|
|
74
|
+
width: 100% !important;
|
|
75
|
+
min-height: 400px !important;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<star-horse-dialog
|
|
3
|
+
:title="title"
|
|
4
|
+
:box-width="boxWidth"
|
|
5
|
+
:self-func="true"
|
|
6
|
+
@resetForm="handleReset"
|
|
7
|
+
:hideFullScreenIcon="true"
|
|
8
|
+
:dialog-visible="modelValue"
|
|
9
|
+
@merge="handleConfirm"
|
|
10
|
+
@closeAction="$emit('update:modelValue', false)"
|
|
11
|
+
>
|
|
12
|
+
<el-input
|
|
13
|
+
v-model="content"
|
|
14
|
+
type="textarea"
|
|
15
|
+
:rows="20"
|
|
16
|
+
:disabled="disabled"
|
|
17
|
+
resize="both"
|
|
18
|
+
show-word-limit
|
|
19
|
+
:placeholder="placeholder"
|
|
20
|
+
/>
|
|
21
|
+
</star-horse-dialog>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { ref, watch } from "vue";
|
|
26
|
+
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
modelValue: Boolean,
|
|
29
|
+
title: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "编辑数据",
|
|
32
|
+
},
|
|
33
|
+
boxWidth: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "50%",
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
showFormItem: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
placeholder: String,
|
|
46
|
+
initialContent: String,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const content = ref("");
|
|
50
|
+
const emit = defineEmits(["update:modelValue", "confirm"]);
|
|
51
|
+
|
|
52
|
+
const handleConfirm = () => {
|
|
53
|
+
emit("confirm", content.value);
|
|
54
|
+
emit("update:modelValue", false);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleReset = () => {
|
|
58
|
+
content.value = "";
|
|
59
|
+
};
|
|
60
|
+
// 新增内容监听
|
|
61
|
+
watch(
|
|
62
|
+
() => props.initialContent,
|
|
63
|
+
(newVal) => {
|
|
64
|
+
content.value = newVal || "";
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useDesignFormStore } from "@/store/DesignForm";
|
|
3
|
+
import piniaInstance from "@/store";
|
|
4
|
+
import { computed, ComputedRef, ref } from "vue";
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
name: "FieldList",
|
|
8
|
+
});
|
|
9
|
+
const containerRef = ref();
|
|
10
|
+
const emits = defineEmits(["selectData"]);
|
|
11
|
+
let designForm = useDesignFormStore(piniaInstance);
|
|
12
|
+
let formDataList: ComputedRef = computed(() => designForm.formDataList);
|
|
13
|
+
let containerList: ComputedRef = computed(() => designForm.containerList);
|
|
14
|
+
let selfFormDataList: ComputedRef = computed(() => designForm.selfFormDataList);
|
|
15
|
+
const selectData = (item: any) => {
|
|
16
|
+
emits("selectData", item);
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div class="component-list">
|
|
22
|
+
<div class="title">
|
|
23
|
+
<el-anchor type="underline" :container="containerRef" :offset="70">
|
|
24
|
+
<el-anchor-link :href="`#container`"> 容器 </el-anchor-link>
|
|
25
|
+
<el-anchor-link :href="`#basic`"> 基础组件 </el-anchor-link>
|
|
26
|
+
<el-anchor-link :href="`#self`"> 自定义组件 </el-anchor-link>
|
|
27
|
+
</el-anchor>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="content" ref="containerRef">
|
|
30
|
+
<el-scrollbar>
|
|
31
|
+
<el-divider content-position="left">容器</el-divider>
|
|
32
|
+
<ul id="container">
|
|
33
|
+
<template v-for="item in containerList">
|
|
34
|
+
<li class="field-item" @click="selectData(item)">
|
|
35
|
+
|
|
36
|
+
<div>
|
|
37
|
+
<star-horse-icon :icon-class="item.itemIcon" /> {{
|
|
38
|
+
item.itemName
|
|
39
|
+
}}
|
|
40
|
+
</div>
|
|
41
|
+
</li>
|
|
42
|
+
</template>
|
|
43
|
+
</ul>
|
|
44
|
+
<el-divider content-position="left">基础组件</el-divider>
|
|
45
|
+
<ul id="basic">
|
|
46
|
+
<template v-for="item in formDataList">
|
|
47
|
+
<li class="field-item" @click="selectData(item)">
|
|
48
|
+
|
|
49
|
+
<div>
|
|
50
|
+
<star-horse-icon :icon-class="item.itemIcon" /> {{
|
|
51
|
+
item.itemName
|
|
52
|
+
}}
|
|
53
|
+
</div>
|
|
54
|
+
</li>
|
|
55
|
+
</template>
|
|
56
|
+
</ul>
|
|
57
|
+
<el-divider content-position="left">自定义组件</el-divider>
|
|
58
|
+
<ul id="self">
|
|
59
|
+
<template v-for="item in selfFormDataList">
|
|
60
|
+
<li class="field-item" @click="selectData(item)">
|
|
61
|
+
|
|
62
|
+
<div>
|
|
63
|
+
<star-horse-icon :icon-class="item.itemIcon" /> {{
|
|
64
|
+
item.itemName
|
|
65
|
+
}}
|
|
66
|
+
</div>
|
|
67
|
+
</li>
|
|
68
|
+
</template>
|
|
69
|
+
</ul>
|
|
70
|
+
</el-scrollbar>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<style scoped lang="scss">
|
|
76
|
+
:deep(.el-divider) {
|
|
77
|
+
margin: 15px auto;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.component-list {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
height: inherit;
|
|
84
|
+
width: 100%;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
|
|
87
|
+
.title {
|
|
88
|
+
width: 100px;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.content {
|
|
93
|
+
margin-left: 10px;
|
|
94
|
+
height: 100%;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
flex: 1;
|
|
97
|
+
|
|
98
|
+
ul {
|
|
99
|
+
list-style: none;
|
|
100
|
+
margin-top: 0 !important;
|
|
101
|
+
padding-top: 0 !important;
|
|
102
|
+
|
|
103
|
+
li {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
display: block;
|
|
106
|
+
height: 30px;
|
|
107
|
+
padding: 0 !important;
|
|
108
|
+
margin: 0;
|
|
109
|
+
|
|
110
|
+
&:hover {
|
|
111
|
+
background-color: #f5f7fa;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
div {
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
height: 100%;
|
|
117
|
+
align-items: center;
|
|
118
|
+
margin-top: 0 !important;
|
|
119
|
+
padding-top: 0 !important;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</style>
|