sohelp-eleplus 1.1.13
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 +7 -0
- package/cache/DictCache.js +58 -0
- package/cache/ModuleCache.js +352 -0
- package/components.js +45 -0
- package/core-export.js +4 -0
- package/http/CrudHttp.js +115 -0
- package/http/DictHttp.js +12 -0
- package/http/ModuleHttp.js +68 -0
- package/http/SohelpHttp.js +125 -0
- package/index.js +6 -0
- package/installer.js +8 -0
- package/lang/en_US.js +4 -0
- package/lang/zh_CN.js +4 -0
- package/lang/zh_TW.js +4 -0
- package/package.json +9 -0
- package/sohelp-ace-editor/index.vue +198 -0
- package/sohelp-application-select/index.vue +15 -0
- package/sohelp-autocode/index.vue +53 -0
- package/sohelp-calendar-view/index.vue +11 -0
- package/sohelp-card-view/index.vue +11 -0
- package/sohelp-condition/index.vue +210 -0
- package/sohelp-cry-input/index.vue +64 -0
- package/sohelp-date/index.vue +27 -0
- package/sohelp-datetime/index.vue +44 -0
- package/sohelp-datetime-picker/index.vue +86 -0
- package/sohelp-datetime-range/index.vue +59 -0
- package/sohelp-dict/index.vue +207 -0
- package/sohelp-dict/props.js +68 -0
- package/sohelp-drawer/index.vue +31 -0
- package/sohelp-drop-card/index.vue +94 -0
- package/sohelp-drop-card/props.js +68 -0
- package/sohelp-dyn-select/index.vue +99 -0
- package/sohelp-dyn-select/props.js +67 -0
- package/sohelp-dyn-tree/index.vue +82 -0
- package/sohelp-dyn-tree-select/index.vue +114 -0
- package/sohelp-entity-form/index.vue +524 -0
- package/sohelp-entity-grid/index.vue +30 -0
- package/sohelp-file-upload/index.vue +218 -0
- package/sohelp-filter-scheme/components/condition.vue +102 -0
- package/sohelp-filter-scheme/components/filter.vue +45 -0
- package/sohelp-filter-scheme/components/keywords.vue +15 -0
- package/sohelp-filter-scheme/components/scheme.vue +49 -0
- package/sohelp-filter-scheme/index.vue +113 -0
- package/sohelp-grid/SohelpGridConfig.js~ +408 -0
- package/sohelp-grid/components/filter-condition-item.vue +298 -0
- package/sohelp-grid/index.vue +1886 -0
- package/sohelp-grid/js/ConditionType.js +101 -0
- package/sohelp-grid/js/DefaultGridOptions.js +141 -0
- package/sohelp-grid/js/DefaultProps.js +27 -0
- package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
- package/sohelp-grid/js/SohelpGridConfig.js +101 -0
- package/sohelp-grid/js/useSohelpGridConfig.js +519 -0
- package/sohelp-grid-select/index.vue +245 -0
- package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
- package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
- package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
- package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
- package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
- package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
- package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
- package/sohelp-grid-view/filter/config/index.vue +206 -0
- package/sohelp-grid-view/filter/filter-form.vue +427 -0
- package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
- package/sohelp-grid-view/filter/index.vue +160 -0
- package/sohelp-grid-view/index.vue +379 -0
- package/sohelp-grid-view-select/index.vue +141 -0
- package/sohelp-group-view/index.vue +11 -0
- package/sohelp-icon-select/index.vue +96 -0
- package/sohelp-icon-select/vxeui-icon.js +90 -0
- package/sohelp-image-upload/index.vue +286 -0
- package/sohelp-input/index.vue +39 -0
- package/sohelp-modal/index.vue +49 -0
- package/sohelp-module/index.vue +54 -0
- package/sohelp-module/useModalManager.js +89 -0
- package/sohelp-module/useSohelpModule.js +66 -0
- package/sohelp-number-input/index.vue +32 -0
- package/sohelp-number-range/index.vue +135 -0
- package/sohelp-org-select/index.vue +30 -0
- package/sohelp-org-tree/index.vue +18 -0
- package/sohelp-org-tree-select/index.vue +93 -0
- package/sohelp-org-user-tree/index.vue +26 -0
- package/sohelp-org-user-tree-select/index.vue +11 -0
- package/sohelp-pagination/index.vue +11 -0
- package/sohelp-power/index.vue +105 -0
- package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
- package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
- package/sohelp-pro-form/index.vue +257 -0
- package/sohelp-pro-form/util.js +140 -0
- package/sohelp-pro-layout/index.vue +11 -0
- package/sohelp-pro-table/index.vue +14 -0
- package/sohelp-process/index.vue +216 -0
- package/sohelp-rate/index.vue +56 -0
- package/sohelp-rate/props.js +71 -0
- package/sohelp-relation/index.vue +11 -0
- package/sohelp-rich-text/index.vue +242 -0
- package/sohelp-rich-text/util.js +231 -0
- package/sohelp-richtext/index.vue +10 -0
- package/sohelp-role-select/index.vue +33 -0
- package/sohelp-search/components/search-config.vue +0 -0
- package/sohelp-search/index.vue +49 -0
- package/sohelp-search-pro-form/index.vue +11 -0
- package/sohelp-select/index.vue +120 -0
- package/sohelp-split-panel/index.vue +15 -0
- package/sohelp-switch/index.vue +56 -0
- package/sohelp-table/index.vue +151 -0
- package/sohelp-tenant-select/index.vue +128 -0
- package/sohelp-text/index.vue +14 -0
- package/sohelp-textarea-input/index.vue +36 -0
- package/sohelp-time/index.vue +10 -0
- package/sohelp-tree/index.vue +37 -0
- package/sohelp-tree-select/index.vue +18 -0
- package/sohelp-user-select/index.vue +44 -0
- package/sohelp-user-select/index.vue~ +53 -0
- package/sohelp-user-select/props.js +71 -0
- package/sohelp-user-tag/index.vue +12 -0
- package/sohelp-user-tree/index.vue +11 -0
- package/sohelp-vform-drawer/index.vue +40 -0
- package/sohelp-vform-eleplus/favicon.ico +0 -0
- package/sohelp-vform-eleplus/index.vue +297 -0
- package/sohelp-vform-eleplus/preview.html +91 -0
- package/sohelp-vform-eleplus/render.es.js +72433 -0
- package/sohelp-vform-eleplus/render.style.css +16 -0
- package/sohelp-vform-eleplus/render.umd.js +57 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-modal/index.vue +41 -0
- package/sohelp-vform-select/index.vue +11 -0
- package/sohelp-vform-vant/favicon.ico +0 -0
- package/sohelp-vform-vant/render.es.js +14608 -0
- package/sohelp-vform-vant/render.style.css +1 -0
- package/sohelp-vform-vant/render.umd.js +22 -0
- package/sohelp-vxe-grid/DefaultGridOptions.js +102 -0
- package/sohelp-vxe-grid/DefaultProps.js +37 -0
- package/sohelp-vxe-grid/SohelpGridConfig.js +142 -0
- package/sohelp-vxe-grid/index.vue +518 -0
- package/sohelp-vxe-grid-select/index.vue +148 -0
- package/sohelp-vxe-table/index.vue +184 -0
- package/sohelp-workflow/index.vue +495 -0
- package/sohelp-workflow/nodeWrap.vue +53 -0
- package/sohelp-workflow/nodes/addNode.vue +27 -0
- package/sohelp-workflow/nodes/approver.vue +125 -0
- package/sohelp-workflow/nodes/branch.vue +434 -0
- package/sohelp-workflow/nodes/promoter.vue +80 -0
- package/sohelp-workflow/nodes/send.vue +95 -0
- package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
- package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
- package/sohelp-workflow-drawer/components/form.vue +79 -0
- package/sohelp-workflow-drawer/components/table.vue +153 -0
- package/sohelp-workflow-drawer/components/timeline.vue +189 -0
- package/sohelp-workflow-drawer/components/workflow.vue +68 -0
- package/sohelp-workflow-drawer/index.vue +311 -0
- package/sohelp-workflow-drawer/js/index.js +119 -0
- package/style/index.scss +0 -0
- package/utils/ProFormConvertUtil.js +76 -0
- package/utils/core.js +310 -0
- package/utils/use-form-data.js +48 -0
- package/utils/use-mobile.js +43 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-select
|
|
3
|
+
clearable
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:multiple="multiple"
|
|
6
|
+
@update:modelValue="updateValue"
|
|
7
|
+
:model-value="dataValue"
|
|
8
|
+
style="min-width: 60px"
|
|
9
|
+
>
|
|
10
|
+
<el-option
|
|
11
|
+
v-for="item in data"
|
|
12
|
+
:key="item.value"
|
|
13
|
+
:label="item.i18n ? t(item.i18n) : item.label"
|
|
14
|
+
:value="item.value"
|
|
15
|
+
@click="optionClick(item.value)"
|
|
16
|
+
></el-option>
|
|
17
|
+
<slot name="footer"></slot>
|
|
18
|
+
</el-select>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
import { onMounted, ref, watch } from 'vue';
|
|
22
|
+
import { useI18n } from 'vue-i18n';
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'SohelpSelect',
|
|
26
|
+
props: {
|
|
27
|
+
datasource: {
|
|
28
|
+
type: [Array, Function, Promise],
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
labelField: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'label'
|
|
34
|
+
},
|
|
35
|
+
valueField: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'value'
|
|
38
|
+
},
|
|
39
|
+
multiple: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: [String, Number, Boolean, Array],
|
|
45
|
+
required: true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
emit: ['update:modelValue', 'change', 'optionClick'],
|
|
49
|
+
|
|
50
|
+
setup(props, { emit, attrs }) {
|
|
51
|
+
const { t } = useI18n();
|
|
52
|
+
const data = ref([]);
|
|
53
|
+
const dataValue = ref('');
|
|
54
|
+
|
|
55
|
+
const mapData = (items) => {
|
|
56
|
+
return items?.map((item) => ({
|
|
57
|
+
...item,
|
|
58
|
+
value: item[props.valueField],
|
|
59
|
+
label: item[props.labelField]
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
onMounted(async () => {
|
|
63
|
+
if (Array.isArray(props.datasource)) {
|
|
64
|
+
data.value = mapData(props.datasource);
|
|
65
|
+
} else if (typeof props.datasource === 'function') {
|
|
66
|
+
const result = await props.datasource();
|
|
67
|
+
data.value = mapData(result);
|
|
68
|
+
} else if (props.datasource instanceof Promise) {
|
|
69
|
+
const result = await props.datasource;
|
|
70
|
+
data.value = mapData(result);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
watch(
|
|
75
|
+
() => props.modelValue,
|
|
76
|
+
(val) => {
|
|
77
|
+
let value = val + '';
|
|
78
|
+
if (props.multiple) {
|
|
79
|
+
// 转换成数组
|
|
80
|
+
if (!Array.isArray(value)) {
|
|
81
|
+
value = value
|
|
82
|
+
?.toString()
|
|
83
|
+
.split(',')
|
|
84
|
+
?.filter((item) => item);
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
value = value?.split(',')[0];
|
|
88
|
+
}
|
|
89
|
+
dataValue.value = value;
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
immediate: true
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const optionClick = (val) => {
|
|
97
|
+
emit('optionClick', val);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const change = (val, e) => {
|
|
101
|
+
emit('change', val);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** 更新选中数据 */
|
|
105
|
+
const updateValue = (value) => {
|
|
106
|
+
emit('update:modelValue', value);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
data,
|
|
111
|
+
dataValue,
|
|
112
|
+
change,
|
|
113
|
+
optionClick,
|
|
114
|
+
updateValue,
|
|
115
|
+
t
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
</script>
|
|
120
|
+
<style></style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-split-panel">
|
|
3
|
+
<ele-split-panel v-bind="$attrs">
|
|
4
|
+
<template v-for="(_, slot) in $slots" #[slot]="slotProps">
|
|
5
|
+
<slot :name="slot" v-bind="slotProps" />
|
|
6
|
+
</template>
|
|
7
|
+
</ele-split-panel>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'SohelpSplitPanel'
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
<style></style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-switch">
|
|
3
|
+
<ele-text v-if="readonly" :type="modelValue ? 'success' : 'danger'">
|
|
4
|
+
{{ modelValue ? activeValue || '开启' : inactiveValue || '关闭' }}
|
|
5
|
+
</ele-text>
|
|
6
|
+
<el-switch
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:active-value="activeValue"
|
|
10
|
+
:inactive-value="inactiveValue"
|
|
11
|
+
v-else
|
|
12
|
+
@change="change"
|
|
13
|
+
></el-switch>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
import { ref, watch } from 'vue';
|
|
18
|
+
export default {
|
|
19
|
+
name: 'SohelpSwitch',
|
|
20
|
+
props: {
|
|
21
|
+
readonly: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
modelValue: [String, Number, Boolean],
|
|
26
|
+
activeValue: {
|
|
27
|
+
type: [String, Number, Boolean],
|
|
28
|
+
default: true
|
|
29
|
+
},
|
|
30
|
+
inactiveValue: {
|
|
31
|
+
type: [String, Number, Boolean],
|
|
32
|
+
default: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ['update:modelValue'],
|
|
36
|
+
setup(props, { emit }) {
|
|
37
|
+
const value = ref();
|
|
38
|
+
const change = (v) => {
|
|
39
|
+
emit('update:modelValue', v);
|
|
40
|
+
value.value = v;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
watch(
|
|
44
|
+
() => props.modelValue,
|
|
45
|
+
(val) => {
|
|
46
|
+
value.value = val;
|
|
47
|
+
},{
|
|
48
|
+
immediate: true
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
return { value, change };
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
</script>
|
|
56
|
+
<style></style>
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ele-pro-table
|
|
3
|
+
ref="sohelpTableRef"
|
|
4
|
+
:columns="columns"
|
|
5
|
+
:datasource="datasource"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
:loadOnCreated="loadOnCreated"
|
|
8
|
+
row-key="id"
|
|
9
|
+
:where="where"
|
|
10
|
+
:show-overflow-tooltip="true"
|
|
11
|
+
v-model:selections="selections"
|
|
12
|
+
highlight-current-row>
|
|
13
|
+
<slot>
|
|
14
|
+
<template v-for="(slotProps, slotName) in $scopedSlots" :key="slotName">
|
|
15
|
+
<slot :name="slotName" v-bind="slotProps"/>
|
|
16
|
+
</template>
|
|
17
|
+
</slot>
|
|
18
|
+
<template #toolbar="{ row }">
|
|
19
|
+
<slot name="toolbar" :row="row"></slot>
|
|
20
|
+
</template>
|
|
21
|
+
<slot name=""></slot>
|
|
22
|
+
<template #action="{ row }">
|
|
23
|
+
<slot name="action" :row="row"></slot>
|
|
24
|
+
</template>
|
|
25
|
+
</ele-pro-table>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
import {reactive, ref} from 'vue';
|
|
29
|
+
import {moduleCache} from '../cache/ModuleCache';
|
|
30
|
+
import {EleMessage} from "@/components/ele-admin-plus/components";
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: "SohelpTable",
|
|
35
|
+
props: {
|
|
36
|
+
/**网格列表配置ID*/
|
|
37
|
+
refid: {
|
|
38
|
+
type: String,
|
|
39
|
+
defaultValue: "",
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
/**数据源URL**/
|
|
43
|
+
url: {
|
|
44
|
+
type: String,
|
|
45
|
+
defaultValue: ""
|
|
46
|
+
},
|
|
47
|
+
/**数据源URL**/
|
|
48
|
+
where: {
|
|
49
|
+
type: Object,
|
|
50
|
+
defaultValue: {}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(props, {emit}) {
|
|
54
|
+
/**列表实例*/
|
|
55
|
+
const sohelpTableRef = ref(null);
|
|
56
|
+
/**存储表格配置*/
|
|
57
|
+
const sohelpConfig = reactive({});
|
|
58
|
+
/**在放选中数据列表**/
|
|
59
|
+
const selections = ref([]);
|
|
60
|
+
/**默认加载数据**/
|
|
61
|
+
const loadOnCreated = ref(false);
|
|
62
|
+
|
|
63
|
+
/**自定义列配置 **/
|
|
64
|
+
const columns = reactive([{
|
|
65
|
+
type: 'selection',
|
|
66
|
+
columnKey: 'selection',
|
|
67
|
+
width: 50,
|
|
68
|
+
align: 'center',
|
|
69
|
+
fixed: 'left'
|
|
70
|
+
}, {
|
|
71
|
+
type: 'index',
|
|
72
|
+
columnKey: 'index',
|
|
73
|
+
width: 50,
|
|
74
|
+
align: 'center',
|
|
75
|
+
fixed: 'left'
|
|
76
|
+
}]);
|
|
77
|
+
|
|
78
|
+
/** 表格数据源 */
|
|
79
|
+
const datasource = async ({page, limit, where, orders}) => {
|
|
80
|
+
if (!loadOnCreated.value) {
|
|
81
|
+
return {total: 0, results: []}
|
|
82
|
+
}
|
|
83
|
+
const res = await SohelpHttp.get(props.url || sohelpConfig.requestValue, {
|
|
84
|
+
page,
|
|
85
|
+
limit,
|
|
86
|
+
...where,
|
|
87
|
+
...props.where,
|
|
88
|
+
orders
|
|
89
|
+
}).catch(e => {
|
|
90
|
+
EleMessage.error(e.message);
|
|
91
|
+
});
|
|
92
|
+
return res.data;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**根据配置列转成ProTable格式的列*/
|
|
96
|
+
const switchProperty = (property) => {
|
|
97
|
+
return {
|
|
98
|
+
prop: property.name,
|
|
99
|
+
columnKey: property.name,
|
|
100
|
+
label: property.label,
|
|
101
|
+
width: property.width || 100
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/***初始化网格列表配置**/
|
|
106
|
+
const initProTableConfiguration = (cfg) => {
|
|
107
|
+
loadOnCreated.value = true;
|
|
108
|
+
reload();
|
|
109
|
+
}
|
|
110
|
+
/**获取列表配置*/
|
|
111
|
+
moduleCache.getGrid(props.refid).then(data => {
|
|
112
|
+
Object.assign(sohelpConfig, {...data});
|
|
113
|
+
//初始化属性列表配置
|
|
114
|
+
data.properties.map(property => {
|
|
115
|
+
columns.push(switchProperty(property));
|
|
116
|
+
});
|
|
117
|
+
/**添加操作列**/
|
|
118
|
+
columns.push({
|
|
119
|
+
columnKey: 'action',
|
|
120
|
+
label: '操作',
|
|
121
|
+
width: 200,
|
|
122
|
+
align: 'center',
|
|
123
|
+
slot: 'action'
|
|
124
|
+
});
|
|
125
|
+
//初始化表格配置
|
|
126
|
+
initProTableConfiguration();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
const reload = (param) => {
|
|
131
|
+
sohelpTableRef.value?.reload?.(param);
|
|
132
|
+
}
|
|
133
|
+
const getData = () => {
|
|
134
|
+
return sohelpTableRef.value?.getData?.();
|
|
135
|
+
}
|
|
136
|
+
const getTableRef = () => {
|
|
137
|
+
return sohelpTableRef.value?.getTableRef?.();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// defineExpose({
|
|
141
|
+
// reload, getData,getTableRef,datasource
|
|
142
|
+
// })
|
|
143
|
+
return {columns, reload, getData, getTableRef, datasource, selections, sohelpTableRef, sohelpConfig}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
</script>
|
|
149
|
+
<style scoped>
|
|
150
|
+
|
|
151
|
+
</style>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sohelp-vxe-grid-select label-field="tenant_name" :title="title" ref="vxeGridSelectRef" v-bind="$attrs" :gridOptions="gridOptions" @show="show" @confirm="confirm"></sohelp-vxe-grid-select>
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
import SohelpVxeGridSelect from "../sohelp-vxe-grid-select/index.vue";
|
|
6
|
+
import { nextTick, reactive, ref } from "vue";
|
|
7
|
+
import { EleMessage } from "@/components/ele-admin-plus/components";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: "SohelpTenantSelect",
|
|
11
|
+
components: {SohelpVxeGridSelect},
|
|
12
|
+
props:{
|
|
13
|
+
url:{
|
|
14
|
+
type:String,
|
|
15
|
+
default:'/engine/web/tenant/page'
|
|
16
|
+
},
|
|
17
|
+
title:{
|
|
18
|
+
type:String,
|
|
19
|
+
default:'选择租户'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
},
|
|
23
|
+
setup(props,{emit}){
|
|
24
|
+
const vxeGridSelectRef= ref();
|
|
25
|
+
const show = (options) => {
|
|
26
|
+
SohelpHttp.get(props.url,{}).then(res=>{
|
|
27
|
+
if(res.meta.success){
|
|
28
|
+
nextTick(()=>{
|
|
29
|
+
gridOptions.pagerConfig.total = res.data.total;
|
|
30
|
+
vxeGridSelectRef.value.$grid.loadData(res.data.results);
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
}else{
|
|
34
|
+
EleMessage.error(res.meta.message);
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const confirm = (rows) => {
|
|
40
|
+
emit('confirm',rows);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** 表格配置 */
|
|
44
|
+
const gridOptions = reactive({
|
|
45
|
+
customConfig: {
|
|
46
|
+
placement: 'top-right' // 自定义列工具栏位置
|
|
47
|
+
},
|
|
48
|
+
rowConfig: {
|
|
49
|
+
useKey: true,
|
|
50
|
+
sHover: true,
|
|
51
|
+
isCurrent: true
|
|
52
|
+
},
|
|
53
|
+
keyboardConfig: {
|
|
54
|
+
isEdit: true,
|
|
55
|
+
isArrow: true,
|
|
56
|
+
isEnter: true,
|
|
57
|
+
isTab: true,
|
|
58
|
+
isDel: true,
|
|
59
|
+
isBack: true
|
|
60
|
+
},
|
|
61
|
+
mouseConfig: {
|
|
62
|
+
selected: false
|
|
63
|
+
},
|
|
64
|
+
checkboxConfig: {
|
|
65
|
+
highlight: true,
|
|
66
|
+
range: true
|
|
67
|
+
},
|
|
68
|
+
pagerConfig: {
|
|
69
|
+
enabled: true,
|
|
70
|
+
total: 0,
|
|
71
|
+
currentPage: 1,
|
|
72
|
+
pageSize: 50,
|
|
73
|
+
align: 'center'
|
|
74
|
+
},
|
|
75
|
+
border: true,
|
|
76
|
+
stripe: true,
|
|
77
|
+
loading: false,
|
|
78
|
+
minHeight: 200,
|
|
79
|
+
maxHeight: '100%',
|
|
80
|
+
size: 'mini',
|
|
81
|
+
columnConfig: {
|
|
82
|
+
resizable: true
|
|
83
|
+
},
|
|
84
|
+
columns: [
|
|
85
|
+
{ field: 'checkbox', fixed: 'left', type: 'checkbox', align: 'center', width: 40 },
|
|
86
|
+
{
|
|
87
|
+
type: 'seq',
|
|
88
|
+
title: '#',
|
|
89
|
+
fixe: 'left',
|
|
90
|
+
align: 'center',
|
|
91
|
+
width: 40
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: 'id',
|
|
95
|
+
width: 200,
|
|
96
|
+
field: 'id',
|
|
97
|
+
visible: false
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: '租户',
|
|
101
|
+
width: 200,
|
|
102
|
+
field: 'tenant_name',
|
|
103
|
+
showOverflow: 'tooltip'
|
|
104
|
+
}, {
|
|
105
|
+
title: '备注',
|
|
106
|
+
minWidth: 200,
|
|
107
|
+
field: 'comments',
|
|
108
|
+
showOverflow: 'tooltip'
|
|
109
|
+
}, {
|
|
110
|
+
title: '创建日期',
|
|
111
|
+
width: 160,
|
|
112
|
+
field: 'create_time'
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
data: []
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
return {vxeGridSelectRef,gridOptions,show,confirm}
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<style scoped>
|
|
127
|
+
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-input v-bind="$attrs" :maxlength="maxlength" :rows="$attrs.rows" ref="inputRef" type="textarea" show-word-limit clearable ></el-input>
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
|
+
import { nextTick, onMounted, ref } from 'vue';
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
autoFocus: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: false
|
|
11
|
+
},
|
|
12
|
+
maxlength: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 250
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const modelValue = ref('');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const inputRef = ref(null);
|
|
22
|
+
|
|
23
|
+
onMounted(() => {
|
|
24
|
+
nextTick(() => {
|
|
25
|
+
if (props.autoFocus) {
|
|
26
|
+
inputRef.value.focus();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
<script>
|
|
32
|
+
export default {
|
|
33
|
+
name: 'SohelpTextareaInput'
|
|
34
|
+
};
|
|
35
|
+
</script>
|
|
36
|
+
<style></style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-tree
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
:data="data"
|
|
5
|
+
v-loading="loading"
|
|
6
|
+
@node-click="handleClick"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
<script>
|
|
10
|
+
import { onMounted, ref } from 'vue';
|
|
11
|
+
export default {
|
|
12
|
+
name: 'SohelpTree',
|
|
13
|
+
props: {
|
|
14
|
+
data: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
emits: ['node-click'],
|
|
20
|
+
setup(props, { emit }) {
|
|
21
|
+
const loading = ref(true);
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
loading.value = false;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const handleClick = (data, node, el) => {
|
|
27
|
+
emit('node-click', data, node, el);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
handleClick,
|
|
32
|
+
loading
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
<style scoped></style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ele-tree-select filterable ref="treeSelectRef" v-model="modelValue" v-bind="$attrs" :size="globalConfig.size" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { inject } from "vue";
|
|
7
|
+
const modelValue= defineModel("modelValue", { type: [String, Number, Array], default: "" });
|
|
8
|
+
const globalConfig = inject("globalConfig");
|
|
9
|
+
defineExpose({
|
|
10
|
+
globalConfig
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
name: "SohelpTreeSelect"
|
|
16
|
+
};
|
|
17
|
+
</script>
|
|
18
|
+
<style></style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-user-select">
|
|
3
|
+
<sohelp-dyn-select
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:url="url"
|
|
6
|
+
:labelField="labelField"
|
|
7
|
+
:valueField="valueField"
|
|
8
|
+
:datasource="datasource"
|
|
9
|
+
v-model="modelValue"
|
|
10
|
+
></sohelp-dyn-select>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
<script setup>
|
|
14
|
+
import SohelpDynSelect from '../sohelp-dyn-select/index.vue';
|
|
15
|
+
|
|
16
|
+
const modelValue = defineModel('modelValue', { type: [String, Number, Array], default: '' });
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
datasource: {
|
|
20
|
+
type: [Array, Function, Promise],
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
url: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '/engine/web/user/list'
|
|
26
|
+
},
|
|
27
|
+
labelField: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'user_name'
|
|
30
|
+
},
|
|
31
|
+
valueField: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'id'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
// 暴露子组件特有方法
|
|
37
|
+
defineExpose({});
|
|
38
|
+
</script>
|
|
39
|
+
<script>
|
|
40
|
+
export default {
|
|
41
|
+
name: 'SohelpUserSelect'
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
<style></style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-user-select">
|
|
3
|
+
<sohelp-dyn-select
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:url="url"
|
|
6
|
+
:labelField="labelField"
|
|
7
|
+
:valueField="valueField"
|
|
8
|
+
:readonly="readonly"
|
|
9
|
+
:datasource="datasource"
|
|
10
|
+
v-model="modelValue"
|
|
11
|
+
></sohelp-dyn-select>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script setup>
|
|
15
|
+
import SohelpDynSelect from "../sohelp-dyn-select/index.vue";
|
|
16
|
+
|
|
17
|
+
const modelValue = defineModel("modelValue", { type: [String, Number, Array], default: "" });
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
datasource: {
|
|
21
|
+
type: [Array, Function, Promise],
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
url: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "/engine/web/user/list"
|
|
27
|
+
},
|
|
28
|
+
labelField: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "user_name"
|
|
31
|
+
},
|
|
32
|
+
valueField: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "id"
|
|
35
|
+
},
|
|
36
|
+
readonly: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
console.error(exposedMethods)
|
|
42
|
+
// 暴露子组件特有方法
|
|
43
|
+
defineExpose({
|
|
44
|
+
...exposedMethods
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
</script>
|
|
48
|
+
<script>
|
|
49
|
+
export default {
|
|
50
|
+
name: "SohelpUserSelect"
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
<style></style>
|