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,153 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="tab-container">
|
|
2
|
-
import { computed, onMounted, PropType, ref, watch } from "vue";
|
|
3
|
-
import { useDesignFormStore } from "@/store/DesignForm";
|
|
4
|
-
import piniaInstance from "@/store/index";
|
|
5
|
-
import { compKey, itemCheck, uuid } from "@/api/system";
|
|
6
|
-
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
parentField: { type: String },
|
|
9
|
-
isDesign: { type: Boolean, default: false },
|
|
10
|
-
showFormItem: { type: Boolean, default: false },
|
|
11
|
-
disabled: { type: Object as PropType<Boolean | String> },
|
|
12
|
-
formInfo: { type: Object as PropType<any> },
|
|
13
|
-
field: { type: Object as PropType<any> },
|
|
14
|
-
});
|
|
15
|
-
let designForm = useDesignFormStore(piniaInstance);
|
|
16
|
-
const isDragging = computed(() => designForm.isDragging);
|
|
17
|
-
const formData = defineModel("formData");
|
|
18
|
-
let containerType: Array<string> = [
|
|
19
|
-
"tab",
|
|
20
|
-
"box",
|
|
21
|
-
"table",
|
|
22
|
-
"card",
|
|
23
|
-
"dytable",
|
|
24
|
-
"collapse",
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const isContainer = (data: any) => {
|
|
28
|
-
return containerType.includes(data.itemType);
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* 如果没有items,动态添加
|
|
32
|
-
* @param adata
|
|
33
|
-
*/
|
|
34
|
-
const checkItem = (adata: any) => {
|
|
35
|
-
if (!adata["items"]) {
|
|
36
|
-
adata["items"] = [];
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const onDragAdd = (evt: Event | any, dataList: any) => {
|
|
40
|
-
let newIndex = evt.newIndex;
|
|
41
|
-
if (newIndex != null && newIndex != "undefined") {
|
|
42
|
-
let dataInfo = dataList[newIndex];
|
|
43
|
-
// designForm.setDraggingItem({});
|
|
44
|
-
designForm.selectItem(dataInfo, dataInfo.itemType, "");
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const activeTabName = ref();
|
|
48
|
-
onMounted(() => {
|
|
49
|
-
if (!props.field["preps"]["elements"]) {
|
|
50
|
-
props.field["preps"]["elements"] = [
|
|
51
|
-
{
|
|
52
|
-
label: "Tab1",
|
|
53
|
-
tabName: "tab1",
|
|
54
|
-
objectName: "tab1",
|
|
55
|
-
subFormFlag: "Y",
|
|
56
|
-
items: [],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: "Tab2",
|
|
60
|
-
tabName: "tab2",
|
|
61
|
-
objectName: "tab2",
|
|
62
|
-
subFormFlag: "Y",
|
|
63
|
-
items: [],
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
props.field["stretch"] = "N";
|
|
67
|
-
}
|
|
68
|
-
activeTabName.value = props.field.preps.elements[0].tabName;
|
|
69
|
-
});
|
|
70
|
-
watch(
|
|
71
|
-
() => activeTabName.value,
|
|
72
|
-
(val) => {
|
|
73
|
-
props.field["activeItemName"] = val;
|
|
74
|
-
},
|
|
75
|
-
{ immediate: true, deep: true },
|
|
76
|
-
);
|
|
77
|
-
const dynamicFunc = (funcType: string, funcCode: any) => {
|
|
78
|
-
let func = new Function(funcCode);
|
|
79
|
-
func.call(this);
|
|
80
|
-
};
|
|
81
|
-
const addTab = () => {};
|
|
82
|
-
</script>
|
|
83
|
-
<template>
|
|
84
|
-
<group-box-container
|
|
85
|
-
class="star-horse-form-container"
|
|
86
|
-
:showFormItem="showFormItem"
|
|
87
|
-
:isDesign="isDesign"
|
|
88
|
-
:disabled="disabled"
|
|
89
|
-
:parentField="parentField"
|
|
90
|
-
:form-item="field"
|
|
91
|
-
>
|
|
92
|
-
<el-tabs
|
|
93
|
-
class="tab-container"
|
|
94
|
-
:tab-position="field.preps['tablePosition'] || 'top'"
|
|
95
|
-
:type="field.preps['type'] || ''"
|
|
96
|
-
:closable="field.preps['closable']"
|
|
97
|
-
:addable="field.preps['addable']"
|
|
98
|
-
:editable="field.preps['editable']"
|
|
99
|
-
:stretch="field.preps['stretch']"
|
|
100
|
-
v-model="activeTabName"
|
|
101
|
-
@tab-add="addTab()"
|
|
102
|
-
@tab-click="dynamicFunc('tabClick', field['tabClick'])"
|
|
103
|
-
@tab-change="dynamicFunc('tabChange', field['tabChange'])"
|
|
104
|
-
@tab-remove="dynamicFunc('tabRemove', field['tabRemove'])"
|
|
105
|
-
>
|
|
106
|
-
<el-tab-pane
|
|
107
|
-
v-for="(adata, key) in field['preps']['elements']"
|
|
108
|
-
:key="compKey(adata, key)"
|
|
109
|
-
:label="adata['label']"
|
|
110
|
-
:name="adata['tabName']"
|
|
111
|
-
>
|
|
112
|
-
<el-scrollbar height="100%" :class="{ 'dragging-area': isDragging }">
|
|
113
|
-
<draggable
|
|
114
|
-
@add="(evt: Event) => onDragAdd(evt, adata['items'])"
|
|
115
|
-
@dragover="checkItem(adata)"
|
|
116
|
-
class="tab-design"
|
|
117
|
-
group="starHorseGroup"
|
|
118
|
-
animation="100"
|
|
119
|
-
:item-key="uuid()"
|
|
120
|
-
ghostClass="ghost"
|
|
121
|
-
:list="adata['items']"
|
|
122
|
-
>
|
|
123
|
-
<template #item="{ element: data }">
|
|
124
|
-
<div
|
|
125
|
-
class="comp-item"
|
|
126
|
-
:style="{ marginTop: isContainer(data) ? '25px' : '10px' }"
|
|
127
|
-
>
|
|
128
|
-
<component
|
|
129
|
-
:key="data.id"
|
|
130
|
-
:field="data"
|
|
131
|
-
:isDesign="isDesign"
|
|
132
|
-
:disabled="disabled"
|
|
133
|
-
:showFormItem="showFormItem"
|
|
134
|
-
:formInfo="formInfo"
|
|
135
|
-
:is="itemCheck(data)"
|
|
136
|
-
:parentField="field"
|
|
137
|
-
v-model:formData="formData"
|
|
138
|
-
/>
|
|
139
|
-
</div>
|
|
140
|
-
</template>
|
|
141
|
-
</draggable>
|
|
142
|
-
</el-scrollbar>
|
|
143
|
-
</el-tab-pane>
|
|
144
|
-
</el-tabs>
|
|
145
|
-
</group-box-container>
|
|
146
|
-
</template>
|
|
147
|
-
<style lang="scss" scoped>
|
|
148
|
-
.tab-design {
|
|
149
|
-
height: 100%;
|
|
150
|
-
min-height: 200px;
|
|
151
|
-
overflow-y: auto;
|
|
152
|
-
}
|
|
153
|
-
</style>
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="table-container">
|
|
2
|
-
// 右键菜单组件
|
|
3
|
-
import { computed, PropType, ref } from "vue";
|
|
4
|
-
import { operationConfirm, warning } from "@/utils/message";
|
|
5
|
-
import { useDesignFormStore } from "@/store/DesignForm";
|
|
6
|
-
import piniaInstance from "@/store/index";
|
|
7
|
-
import StarHorseIcon from "@/components/comp/StarHorseIcon.vue";
|
|
8
|
-
import { itemCheck, uuid } from "@/api/system";
|
|
9
|
-
|
|
10
|
-
let containerTableRef = ref(); // 强制刷新表格
|
|
11
|
-
const props = defineProps({
|
|
12
|
-
parentField: { type: String },
|
|
13
|
-
isDesign: { type: Boolean, default: false },
|
|
14
|
-
showFormItem: { type: Boolean, default: false },
|
|
15
|
-
disabled: { type: Object as PropType<Boolean | String> },
|
|
16
|
-
formInfo: { type: Object as PropType<any> },
|
|
17
|
-
field: { type: Object as PropType<any> },
|
|
18
|
-
});
|
|
19
|
-
let designForm = useDesignFormStore(piniaInstance);
|
|
20
|
-
let draggingItem = computed(() => designForm.draggingItem);
|
|
21
|
-
let excludeContainerType: Array<string> = [
|
|
22
|
-
"box",
|
|
23
|
-
"tab",
|
|
24
|
-
"table",
|
|
25
|
-
"dytable",
|
|
26
|
-
"collapse",
|
|
27
|
-
"card",
|
|
28
|
-
];
|
|
29
|
-
let isEdit = computed(() => props.isDesign);
|
|
30
|
-
const isDragging = computed(() => designForm.isDragging);
|
|
31
|
-
const formData = defineModel("formData");
|
|
32
|
-
const onDragAdd = (evt: Event | any, dataList: any) => {
|
|
33
|
-
let newIndex = evt.newIndex;
|
|
34
|
-
if (excludeContainerType.includes(draggingItem.value.itemType)) {
|
|
35
|
-
warning("容器不能嵌套容器");
|
|
36
|
-
let elements = props.field.preps.elements;
|
|
37
|
-
for (let inde in elements) {
|
|
38
|
-
let element = elements[inde];
|
|
39
|
-
for (let sind in element?.columns) {
|
|
40
|
-
let column = element.columns[sind];
|
|
41
|
-
for (let i in column?.items) {
|
|
42
|
-
let item = column.items[i];
|
|
43
|
-
if (draggingItem.value.id == item.id) {
|
|
44
|
-
column.items.splice(i, 1);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
if (newIndex != null && newIndex != "undefined") {
|
|
52
|
-
let dataInfo = dataList[newIndex];
|
|
53
|
-
designForm.selectItem(dataInfo, dataInfo.itemType, "");
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
const analysisData = (index: number) => {
|
|
57
|
-
let field = props.field?.preps;
|
|
58
|
-
let elements = field?.elements;
|
|
59
|
-
let f = elements.find((item: any) => item.colIndex == index);
|
|
60
|
-
if (index > 1) {
|
|
61
|
-
if (!f) {
|
|
62
|
-
elements.push({
|
|
63
|
-
colIndex: index,
|
|
64
|
-
items: [],
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return f?.items[0]?.preps?.label || `Title${index}`;
|
|
69
|
-
};
|
|
70
|
-
let currentIndex = ref<number>(-1);
|
|
71
|
-
const tdOver = (evt: MouseEvent, index: number) => {
|
|
72
|
-
evt.preventDefault();
|
|
73
|
-
evt.stopPropagation();
|
|
74
|
-
if (currentIndex.value == index) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
currentIndex.value = index;
|
|
78
|
-
};
|
|
79
|
-
const tdOut = (evt: MouseEvent, _index: number) => {
|
|
80
|
-
evt.preventDefault();
|
|
81
|
-
evt.stopPropagation();
|
|
82
|
-
currentIndex.value = 0;
|
|
83
|
-
};
|
|
84
|
-
const deleteCol = (index: number) => {
|
|
85
|
-
operationConfirm("列删除后,对应的组件也会删除,确认删除吗?").then(
|
|
86
|
-
(res: boolean) => {
|
|
87
|
-
if (res) {
|
|
88
|
-
let elements = props.field.preps.elements;
|
|
89
|
-
elements.splice(index - 1, 1);
|
|
90
|
-
for (let index in elements) {
|
|
91
|
-
elements[index].colIndex = parseInt(index) + 1;
|
|
92
|
-
}
|
|
93
|
-
props.field.preps.columns = props.field.preps.columns - 1;
|
|
94
|
-
currentIndex.value = 0;
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
</script>
|
|
100
|
-
<template>
|
|
101
|
-
<group-box-container
|
|
102
|
-
class="star-horse-form-container"
|
|
103
|
-
:showFormItem="showFormItem"
|
|
104
|
-
:isDesign="isDesign"
|
|
105
|
-
:disabled="disabled"
|
|
106
|
-
:parentField="parentField"
|
|
107
|
-
:form-item="field"
|
|
108
|
-
>
|
|
109
|
-
<table
|
|
110
|
-
ref="containerTableRef"
|
|
111
|
-
class="dynamic-table"
|
|
112
|
-
:style="{
|
|
113
|
-
border: isEdit && isDesign ? '1px solid #dfe6ec' : 'none',
|
|
114
|
-
}"
|
|
115
|
-
>
|
|
116
|
-
<thead class="container-thead">
|
|
117
|
-
<tr>
|
|
118
|
-
<th
|
|
119
|
-
v-for="td of parseInt(field.preps.columns || 1)"
|
|
120
|
-
@mouseenter="(evt) => tdOver(evt, td)"
|
|
121
|
-
@mouseleave="(evt) => tdOut(evt, td)"
|
|
122
|
-
>
|
|
123
|
-
<div class="td-operator" v-if="currentIndex == td && isDesign">
|
|
124
|
-
<el-tooltip content="删除列">
|
|
125
|
-
<star-horse-icon
|
|
126
|
-
icon-class="delete"
|
|
127
|
-
cursor="pointer"
|
|
128
|
-
@click="deleteCol(td)"
|
|
129
|
-
/>
|
|
130
|
-
</el-tooltip>
|
|
131
|
-
</div>
|
|
132
|
-
{{ analysisData(td) }}
|
|
133
|
-
</th>
|
|
134
|
-
</tr>
|
|
135
|
-
</thead>
|
|
136
|
-
<tbody>
|
|
137
|
-
<tr>
|
|
138
|
-
<template v-for="td of parseInt(field.preps.columns || 1)">
|
|
139
|
-
<td
|
|
140
|
-
:style="{
|
|
141
|
-
width: 100 / parseInt(field.preps.columns || 1) + '%',
|
|
142
|
-
'margin-top': '5px',
|
|
143
|
-
}"
|
|
144
|
-
class="td-clz"
|
|
145
|
-
:class="{ 'dragging-area': isDragging }"
|
|
146
|
-
@mouseenter="(evt) => tdOver(evt, td)"
|
|
147
|
-
@mouseleave="(evt) => tdOut(evt, td)"
|
|
148
|
-
>
|
|
149
|
-
<draggable
|
|
150
|
-
@add="
|
|
151
|
-
(evt: Event) =>
|
|
152
|
-
onDragAdd(evt, field.preps.elements[td - 1].items)
|
|
153
|
-
"
|
|
154
|
-
class="smain-design"
|
|
155
|
-
tag="div"
|
|
156
|
-
group="starHorseGroup"
|
|
157
|
-
ghostClass="ghost"
|
|
158
|
-
animation="200"
|
|
159
|
-
:item-key="uuid()"
|
|
160
|
-
:list="field.preps.elements[td - 1].items"
|
|
161
|
-
>
|
|
162
|
-
<template #item="{ element: data }">
|
|
163
|
-
<div class="comp-item">
|
|
164
|
-
<component
|
|
165
|
-
:key="data?.id"
|
|
166
|
-
:field="data"
|
|
167
|
-
:showFormItem="showFormItem"
|
|
168
|
-
:isDesign="isDesign"
|
|
169
|
-
:disabled="disabled"
|
|
170
|
-
:formInfo="formInfo"
|
|
171
|
-
:is="itemCheck(data)"
|
|
172
|
-
:parentField="field"
|
|
173
|
-
v-model:formData="formData"
|
|
174
|
-
/>
|
|
175
|
-
</div>
|
|
176
|
-
</template>
|
|
177
|
-
</draggable>
|
|
178
|
-
</td>
|
|
179
|
-
</template>
|
|
180
|
-
</tr>
|
|
181
|
-
</tbody>
|
|
182
|
-
</table>
|
|
183
|
-
</group-box-container>
|
|
184
|
-
</template>
|
|
185
|
-
<style lang="scss" scoped>
|
|
186
|
-
table {
|
|
187
|
-
display: table;
|
|
188
|
-
border-collapse: separate;
|
|
189
|
-
box-sizing: border-box;
|
|
190
|
-
text-indent: initial;
|
|
191
|
-
unicode-bidi: isolate;
|
|
192
|
-
border-spacing: 2px;
|
|
193
|
-
border-color: gray;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
tr {
|
|
197
|
-
display: table-row;
|
|
198
|
-
vertical-align: inherit;
|
|
199
|
-
unicode-bidi: isolate;
|
|
200
|
-
border-color: inherit;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.container-thead tr {
|
|
204
|
-
background: var(--star-horse-shadow);
|
|
205
|
-
height: 35px;
|
|
206
|
-
border-radius: 3px;
|
|
207
|
-
margin-bottom: 5px;
|
|
208
|
-
border: 1px solid #dfe6ec;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
th {
|
|
212
|
-
position: relative;
|
|
213
|
-
border: 1px solid #dfe6ec;
|
|
214
|
-
|
|
215
|
-
.td-operator {
|
|
216
|
-
position: absolute;
|
|
217
|
-
right: 0;
|
|
218
|
-
top: 0;
|
|
219
|
-
z-index: 9999;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
tr {
|
|
224
|
-
width: 100%;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.td-clz {
|
|
228
|
-
flex-direction: row;
|
|
229
|
-
padding: 5px;
|
|
230
|
-
border: 1px solid #dfe6ec;
|
|
231
|
-
border-top: none;
|
|
232
|
-
height: 35px;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.comp-item {
|
|
236
|
-
margin: unset;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.dynamic-table {
|
|
240
|
-
width: 100%;
|
|
241
|
-
border-collapse: collapse;
|
|
242
|
-
|
|
243
|
-
thead {
|
|
244
|
-
background: var(--star-horse-font-color);
|
|
245
|
-
height: 30px;
|
|
246
|
-
font-size: 14px;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
</style>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { App, defineAsyncComponent } from "vue";
|
|
2
|
-
|
|
3
|
-
const items = import.meta.glob("@/components/formcomp/items/*.vue");
|
|
4
|
-
export default function install(app: App<Element>) {
|
|
5
|
-
for (const [key, value] of Object.entries(items)) {
|
|
6
|
-
const name = key.slice(key.lastIndexOf("/") + 1, key.lastIndexOf("."));
|
|
7
|
-
app.component(name, defineAsyncComponent(value as any));
|
|
8
|
-
}
|
|
9
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
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-cascader
|
|
11
|
-
:fid="field.fieldName"
|
|
12
|
-
v-bind="field.preps"
|
|
13
|
-
:disabled="checkIsDisabled(props)"
|
|
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 { nextTick, onMounted, PropType, watch } from "vue";
|
|
21
|
-
import { compDynamicData } from "@/api/star_horse_utils";
|
|
22
|
-
import areaData from "@/api/pcas-code.json";
|
|
23
|
-
import {
|
|
24
|
-
allAction,
|
|
25
|
-
checkIsDisabled,
|
|
26
|
-
initCompCallEvent,
|
|
27
|
-
} from "@/components/formcomp/utils/ItemRelationEventUtils";
|
|
28
|
-
import { getDynamicEvents } from "@/api/system";
|
|
29
|
-
|
|
30
|
-
const props = defineProps({
|
|
31
|
-
isDesign: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false,
|
|
34
|
-
},
|
|
35
|
-
disabled: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: false,
|
|
38
|
-
},
|
|
39
|
-
showFormItem: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false,
|
|
42
|
-
},
|
|
43
|
-
bareFlag: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: false,
|
|
46
|
-
},
|
|
47
|
-
isSearch: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: false,
|
|
50
|
-
},
|
|
51
|
-
field: {
|
|
52
|
-
type: Object as PropType<any>,
|
|
53
|
-
required: true,
|
|
54
|
-
},
|
|
55
|
-
parentField: {
|
|
56
|
-
type: Object as PropType<any>,
|
|
57
|
-
},
|
|
58
|
-
formInfo: {
|
|
59
|
-
type: Object as PropType<any>,
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
63
|
-
const formData = defineModel("formData");
|
|
64
|
-
const itemAction = (prep: any) => {
|
|
65
|
-
allAction(props, emits, formData, prep);
|
|
66
|
-
};
|
|
67
|
-
const initData = async () => {
|
|
68
|
-
if (!props.field.preps) {
|
|
69
|
-
props.field.preps = {};
|
|
70
|
-
}
|
|
71
|
-
if (props.field.preps.user) {
|
|
72
|
-
const data = await compDynamicData(props.field);
|
|
73
|
-
if (data?.length) {
|
|
74
|
-
props.field.preps["options"] = data;
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
props.field.preps["props"] = {
|
|
78
|
-
label: "name",
|
|
79
|
-
value: "code",
|
|
80
|
-
};
|
|
81
|
-
props.field.preps["options"] = areaData;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
await nextTick();
|
|
85
|
-
let data: any = formData.value[props.field.fieldName];
|
|
86
|
-
if (data) {
|
|
87
|
-
formData.value[props.field.fieldName] = JSON.parse(data);
|
|
88
|
-
} else {
|
|
89
|
-
//解决加载慢问题,导致数据没法回显
|
|
90
|
-
setTimeout(() => {
|
|
91
|
-
let data: any = formData.value[props.field.fieldName];
|
|
92
|
-
formData.value[props.field.fieldName] = data ? JSON.parse(data) : [];
|
|
93
|
-
}, 200);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
onMounted(() => {
|
|
97
|
-
initData();
|
|
98
|
-
initCompCallEvent(props, emits, formData);
|
|
99
|
-
});
|
|
100
|
-
watch(
|
|
101
|
-
() => formData.value[props.field.fieldName + "OptionList"],
|
|
102
|
-
(val) => {
|
|
103
|
-
if (val?.length > 0) {
|
|
104
|
-
props.field.preps["options"] = val;
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
immediate: true,
|
|
109
|
-
},
|
|
110
|
-
);
|
|
111
|
-
</script>
|
|
112
|
-
<style lang="scss" scoped>
|
|
113
|
-
:deep(.el-cascader) {
|
|
114
|
-
width: 100%;
|
|
115
|
-
}
|
|
116
|
-
</style>
|
|
@@ -1,163 +0,0 @@
|
|
|
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
|
-
<audio :fid="field.fieldName" ref="audio" controls></audio>
|
|
11
|
-
</starhorse-form-item>
|
|
12
|
-
</template>
|
|
13
|
-
<script setup lang="ts" name="audioItem">
|
|
14
|
-
import { onMounted, PropType, ref } from "vue";
|
|
15
|
-
import { blobData } from "@/api/star_horse_apis";
|
|
16
|
-
|
|
17
|
-
const props = defineProps({
|
|
18
|
-
isDesign: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false,
|
|
21
|
-
},
|
|
22
|
-
disabled: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false,
|
|
25
|
-
},
|
|
26
|
-
showFormItem: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false,
|
|
29
|
-
},
|
|
30
|
-
bareFlag: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false,
|
|
33
|
-
},
|
|
34
|
-
isSearch: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false,
|
|
37
|
-
},
|
|
38
|
-
field: {
|
|
39
|
-
type: Object as PropType<any>,
|
|
40
|
-
required: true,
|
|
41
|
-
},
|
|
42
|
-
parentField: {
|
|
43
|
-
type: Object as PropType<any>,
|
|
44
|
-
},
|
|
45
|
-
formInfo: {
|
|
46
|
-
type: Object as PropType<any>,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
const emits = defineEmits(["selfFunc", "selectItem"]);
|
|
50
|
-
// const formData = defineModel("formData");
|
|
51
|
-
let audio = ref();
|
|
52
|
-
const init = async () => {
|
|
53
|
-
let file = await blobData(props.field["audioUrl"]);
|
|
54
|
-
if (!file) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
// 开始识别
|
|
58
|
-
let reader = new FileReader();
|
|
59
|
-
reader.readAsArrayBuffer(file);
|
|
60
|
-
reader.onload = function (event) {
|
|
61
|
-
let arrBuffer = event.target.result as ArrayBuffer;
|
|
62
|
-
let audioCtx = new AudioContext();
|
|
63
|
-
audioCtx.decodeAudioData(arrBuffer, function (audioBuffer) {
|
|
64
|
-
// let duration = audioBuffer.duration;
|
|
65
|
-
let channels = audioBuffer.numberOfChannels;
|
|
66
|
-
let rate = audioBuffer.sampleRate;
|
|
67
|
-
// 3秒
|
|
68
|
-
let startOffset = 0;
|
|
69
|
-
let endOffset = rate * 3;
|
|
70
|
-
let frameCount = endOffset - startOffset;
|
|
71
|
-
let newAudioBuffer;
|
|
72
|
-
newAudioBuffer = new AudioContext().createBuffer(
|
|
73
|
-
channels,
|
|
74
|
-
endOffset - startOffset,
|
|
75
|
-
rate,
|
|
76
|
-
);
|
|
77
|
-
let anotherArray = new Float32Array(frameCount);
|
|
78
|
-
let offset = 0;
|
|
79
|
-
for (let channel = 0; channel < channels; channel++) {
|
|
80
|
-
audioBuffer.copyFromChannel(anotherArray, channel, startOffset);
|
|
81
|
-
newAudioBuffer.copyToChannel(anotherArray, channel, offset);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* 直接播放使用下面的代码
|
|
85
|
-
// 创建AudioBufferSourceNode对象
|
|
86
|
-
let source = audioCtx.createBufferSource();
|
|
87
|
-
// 设置AudioBufferSourceNode对象的buffer为复制的3秒AudioBuffer对象
|
|
88
|
-
source.buffer = newAudioBuffer;
|
|
89
|
-
// 这一句是必须的,表示结束,没有这一句没法播放,没有声音
|
|
90
|
-
// 这里直接结束,实际上可以对结束做一些特效处理
|
|
91
|
-
source.connect(audioCtx.destination);
|
|
92
|
-
// 资源开始播放
|
|
93
|
-
source.start();
|
|
94
|
-
*/
|
|
95
|
-
let blob = bufferToWave(newAudioBuffer, frameCount);
|
|
96
|
-
/**
|
|
97
|
-
* 转换成Base64使用下面的代码
|
|
98
|
-
let reader2 = new FileReader();
|
|
99
|
-
reader2.onload = function(evt){
|
|
100
|
-
audio.src = evt.target.result;
|
|
101
|
-
};
|
|
102
|
-
reader2.readAsDataURL(blob);
|
|
103
|
-
*/
|
|
104
|
-
// 使用Blob地址
|
|
105
|
-
audio.value.src = URL.createObjectURL(blob);
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
// Convert AudioBuffer to a Blob using WAVE representation
|
|
110
|
-
const bufferToWave = (abuffer: any, len: number) => {
|
|
111
|
-
let numOfChan = abuffer.numberOfChannels,
|
|
112
|
-
length = len * numOfChan * 2 + 44,
|
|
113
|
-
buffer = new ArrayBuffer(length),
|
|
114
|
-
view = new DataView(buffer),
|
|
115
|
-
channels = [],
|
|
116
|
-
i,
|
|
117
|
-
sample,
|
|
118
|
-
offset = 0,
|
|
119
|
-
pos = 0;
|
|
120
|
-
const setUint16 = (data: any) => {
|
|
121
|
-
view.setUint16(pos, data, true);
|
|
122
|
-
pos += 2;
|
|
123
|
-
};
|
|
124
|
-
const setUint32 = (data: any) => {
|
|
125
|
-
view.setUint32(pos, data, true);
|
|
126
|
-
pos += 4;
|
|
127
|
-
};
|
|
128
|
-
// write WAVE header
|
|
129
|
-
setUint32(0x46464952); // "RIFF"
|
|
130
|
-
setUint32(length - 8); // file length - 8
|
|
131
|
-
setUint32(0x45564157); // "WAVE"
|
|
132
|
-
setUint32(0x20746d66); // "fmt " chunk
|
|
133
|
-
setUint32(16); // length = 16
|
|
134
|
-
setUint16(1); // PCM (uncompressed)
|
|
135
|
-
setUint16(numOfChan);
|
|
136
|
-
setUint32(abuffer.sampleRate);
|
|
137
|
-
setUint32(abuffer.sampleRate * 2 * numOfChan); // avg. bytes/sec
|
|
138
|
-
setUint16(numOfChan * 2); // block-align
|
|
139
|
-
setUint16(16); // 16-bit (hardcoded in this demo)
|
|
140
|
-
setUint32(0x61746164); // "data" - chunk
|
|
141
|
-
setUint32(length - pos - 4); // chunk length
|
|
142
|
-
// write interleaved data
|
|
143
|
-
for (i = 0; i < abuffer.numberOfChannels; i++) {
|
|
144
|
-
channels.push(abuffer.getChannelData(i));
|
|
145
|
-
}
|
|
146
|
-
while (pos < length) {
|
|
147
|
-
for (i = 0; i < numOfChan; i++) {
|
|
148
|
-
// interleave channels
|
|
149
|
-
sample = Math.max(-1, Math.min(1, channels[i][offset])); // clamp
|
|
150
|
-
sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767) | 0; // scale to 16-bit signed int
|
|
151
|
-
view.setInt16(pos, sample, true); // write 16-bit sample
|
|
152
|
-
pos += 2;
|
|
153
|
-
}
|
|
154
|
-
offset++; // next source sample
|
|
155
|
-
}
|
|
156
|
-
// create Blob
|
|
157
|
-
return new Blob([buffer], { type: "audio/wav" });
|
|
158
|
-
};
|
|
159
|
-
onMounted(() => {
|
|
160
|
-
init();
|
|
161
|
-
});
|
|
162
|
-
</script>
|
|
163
|
-
<style scoped></style>
|