sohelp-eleplus 1.1.18 → 1.1.20
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 +24 -0
- package/cache/ModuleCache.js +2 -32
- package/components.js +2 -0
- package/http/SohelpHttp.js +14 -5
- package/package.json +1 -1
- package/sohelp-card/index.vue +13 -0
- package/sohelp-dict/index.vue +25 -1
- package/sohelp-entity-grid/index.vue +3 -3
- package/sohelp-grid/components/filter-condition-item.vue +7 -3
- package/sohelp-grid/index.vue +341 -125
- package/sohelp-grid/js/DefaultGridOptions.js +30 -17
- package/sohelp-grid/js/DefaultProps.js +3 -3
- package/sohelp-grid/js/useSohelpGridConfig.js +163 -87
- package/sohelp-grid-select/index.vue +2 -2
- package/sohelp-grid-view/filter/filter-form.vue +41 -16
- package/sohelp-grid-view/filter/index.vue +6 -3
- package/sohelp-grid-view/index.vue +15 -6
- package/sohelp-icon-select/index.vue +2 -2
- package/sohelp-import/index.vue +470 -0
- package/sohelp-modal/index.vue +33 -22
- package/sohelp-module/useSohelpModule.js +9 -11
- package/sohelp-org-user-tree/index.vue +1 -1
- package/sohelp-page/index.vue +13 -0
- package/sohelp-table/index.vue +3 -3
- package/sohelp-vform-drawer/index.vue +1 -1
- package/sohelp-vxe-grid/DefaultGridOptions.js +56 -40
- package/sohelp-vxe-grid/DefaultProps.js +10 -20
- package/sohelp-vxe-grid/SohelpGridConfig.js +28 -27
- package/sohelp-vxe-grid/index.vue +345 -387
- package/sohelp-vxe-table/index.vue +3 -3
- package/sohelp-workflow/nodes/approver.vue +0 -1
- package/style/index.scss +0 -0
package/sohelp-modal/index.vue
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ele-modal v-bind="$attrs" v-model="modelValue">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<slot :name="slotName" v-bind="slotProps" />
|
|
8
|
-
</template>
|
|
9
|
-
</slot>
|
|
10
|
-
<!-- 底部插槽 -->
|
|
11
|
-
<div class="modal__footer" v-if="showFooter">
|
|
12
|
-
<slot name="footer">
|
|
13
|
-
<el-button type="primary" @click="confirm">确认</el-button>
|
|
14
|
-
<el-button @click="cancel">关闭</el-button>
|
|
2
|
+
<ele-modal v-bind="$attrs" v-model="modelValue" :close-on-click-modal="closeOnClickModal">
|
|
3
|
+
<template #header>
|
|
4
|
+
<div class="modal-header">
|
|
5
|
+
<slot name="header">
|
|
6
|
+
{{ $attrs.title }}
|
|
15
7
|
</slot>
|
|
8
|
+
<div class="right">
|
|
9
|
+
<slot name="setting"></slot>
|
|
10
|
+
</div>
|
|
16
11
|
</div>
|
|
17
|
-
</
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<!-- 主内容插槽 -->
|
|
15
|
+
<slot></slot>
|
|
16
|
+
<!-- 底部插槽 -->
|
|
17
|
+
|
|
18
|
+
<template #footer>
|
|
19
|
+
<slot name="footer" v-if="showFooter">
|
|
20
|
+
<el-button @click="cancel">关闭</el-button>
|
|
21
|
+
<el-button type="primary" @click="confirm">确认</el-button>
|
|
22
|
+
</slot>
|
|
23
|
+
</template>
|
|
18
24
|
</ele-modal>
|
|
19
25
|
</template>
|
|
20
26
|
<script setup>
|
|
@@ -24,6 +30,10 @@
|
|
|
24
30
|
showFooter: {
|
|
25
31
|
type: Boolean,
|
|
26
32
|
default: true
|
|
33
|
+
},
|
|
34
|
+
closeOnClickModal: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
27
37
|
}
|
|
28
38
|
});
|
|
29
39
|
|
|
@@ -52,14 +62,15 @@
|
|
|
52
62
|
name: 'SohelpModal'
|
|
53
63
|
};
|
|
54
64
|
</script>
|
|
55
|
-
<style scoped>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/* 样式定义 */
|
|
59
|
-
height: 100%;
|
|
60
|
-
}
|
|
65
|
+
<style scoped lang="scss">
|
|
66
|
+
.modal-header {
|
|
67
|
+
display: flex;
|
|
61
68
|
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
.right {
|
|
70
|
+
margin-left: auto;
|
|
71
|
+
padding: 0 10px;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
}
|
|
64
75
|
}
|
|
65
76
|
</style>
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { useRouter } from "vue-router";
|
|
2
1
|
import { usePageTab } from "@/utils/use-page-tab";
|
|
3
2
|
|
|
4
3
|
function objectToUrlParams(obj) {
|
|
5
4
|
if (!obj) {
|
|
6
|
-
return
|
|
5
|
+
return "";
|
|
7
6
|
}
|
|
8
|
-
return "&"+Object.keys(obj)
|
|
7
|
+
return "&" + Object.keys(obj)
|
|
9
8
|
.map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`)
|
|
10
|
-
.join(
|
|
9
|
+
.join("&");
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
export function useSohelpModule(sohelpModuleRef)
|
|
14
|
-
const { push } = useRouter();
|
|
12
|
+
export function useSohelpModule(sohelpModuleRef, push){
|
|
15
13
|
return {
|
|
16
14
|
/**
|
|
17
15
|
* 打开抽屉
|
|
@@ -19,8 +17,8 @@ export function useSohelpModule(sohelpModuleRef) {
|
|
|
19
17
|
* @param params 参数
|
|
20
18
|
* @param props 属性
|
|
21
19
|
*/
|
|
22
|
-
openDrawer: (refid,params={}, props={}) => {
|
|
23
|
-
sohelpModuleRef.value.openDrawer(refid,params,props);
|
|
20
|
+
openDrawer: (refid, params = {}, props = {}) => {
|
|
21
|
+
sohelpModuleRef.value.openDrawer(refid, params, props);
|
|
24
22
|
},
|
|
25
23
|
/**
|
|
26
24
|
*打开对话框
|
|
@@ -28,8 +26,8 @@ export function useSohelpModule(sohelpModuleRef) {
|
|
|
28
26
|
* @param params
|
|
29
27
|
* @param props
|
|
30
28
|
*/
|
|
31
|
-
openModal: (refid, params= {},props={},callback) => {
|
|
32
|
-
sohelpModuleRef.value.openModal(refid, params,props,callback);
|
|
29
|
+
openModal: (refid, params = {}, props = {}, callback) => {
|
|
30
|
+
sohelpModuleRef.value.openModal(refid, params, props, callback);
|
|
33
31
|
},
|
|
34
32
|
/**
|
|
35
33
|
* 关闭对话框
|
|
@@ -59,7 +57,7 @@ export function useSohelpModule(sohelpModuleRef) {
|
|
|
59
57
|
* @param refid 模块地址
|
|
60
58
|
*/
|
|
61
59
|
closeTab: (refid) => {
|
|
62
|
-
const { finishPageTab, setPageTabTitle,addPageTab
|
|
60
|
+
const { finishPageTab, setPageTabTitle, addPageTab } = usePageTab();
|
|
63
61
|
finishPageTab();
|
|
64
62
|
}
|
|
65
63
|
};
|
package/sohelp-table/index.vue
CHANGED
|
@@ -36,18 +36,18 @@ export default {
|
|
|
36
36
|
/**网格列表配置ID*/
|
|
37
37
|
refid: {
|
|
38
38
|
type: String,
|
|
39
|
-
|
|
39
|
+
default: "",
|
|
40
40
|
required: true
|
|
41
41
|
},
|
|
42
42
|
/**数据源URL**/
|
|
43
43
|
url: {
|
|
44
44
|
type: String,
|
|
45
|
-
|
|
45
|
+
default: ""
|
|
46
46
|
},
|
|
47
47
|
/**数据源URL**/
|
|
48
48
|
where: {
|
|
49
49
|
type: Object,
|
|
50
|
-
|
|
50
|
+
default: {}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
setup(props, {emit}) {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</sohelp-drawer>
|
|
14
14
|
</template>
|
|
15
15
|
<script lang="ts">
|
|
16
|
-
import SohelpVform from "../sohelp-vform/index.vue"
|
|
16
|
+
import SohelpVform from "../sohelp-vform-eleplus/index.vue"
|
|
17
17
|
import SohelpDrawer from "../sohelp-drawer/index.vue"
|
|
18
18
|
import {ref} from "vue";
|
|
19
19
|
export default {
|
|
@@ -1,54 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VxeGrid默认值选项
|
|
3
|
+
*/
|
|
1
4
|
export default {
|
|
2
5
|
loading: false,
|
|
6
|
+
showFooter: false,
|
|
7
|
+
round: true,
|
|
8
|
+
border: true,
|
|
9
|
+
stripe: true,
|
|
10
|
+
maxHeight: '100%',
|
|
11
|
+
size: 'mini',
|
|
12
|
+
minHeight: 200,
|
|
13
|
+
params: {},
|
|
14
|
+
columnConfig: {
|
|
15
|
+
resizable: true
|
|
16
|
+
},
|
|
3
17
|
customConfig: {
|
|
4
|
-
|
|
18
|
+
immediate: false,
|
|
19
|
+
isCurrent: false,
|
|
20
|
+
resizable: true,
|
|
21
|
+
storage: {
|
|
22
|
+
visible: true, // 保存列显示/隐藏状态
|
|
23
|
+
resizable: true, // 保存列宽调整
|
|
24
|
+
sort: true, // 保存列排序
|
|
25
|
+
fixed: true
|
|
26
|
+
},
|
|
27
|
+
slots: {
|
|
28
|
+
header: 'setting'
|
|
29
|
+
}
|
|
5
30
|
},
|
|
6
|
-
|
|
7
|
-
params: {},
|
|
8
|
-
|
|
9
31
|
rowConfig: {
|
|
10
|
-
useKey: true,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
drag: true
|
|
15
|
-
keyField: "id"
|
|
32
|
+
useKey: true, //sortable 排序
|
|
33
|
+
isHover: true,
|
|
34
|
+
isCurrent: true,
|
|
35
|
+
resizable: false,
|
|
36
|
+
drag: true
|
|
16
37
|
},
|
|
17
38
|
rowDragConfig: {
|
|
18
|
-
trigger: "cell",
|
|
19
39
|
showGuidesStatus: true
|
|
20
40
|
},
|
|
41
|
+
editConfig: {
|
|
42
|
+
trigger: 'click',
|
|
43
|
+
mode: 'cell',
|
|
44
|
+
autoClear: false,
|
|
45
|
+
autoFocus: true,
|
|
46
|
+
showInsertStatus: true,
|
|
47
|
+
showUpdateStatus: true
|
|
48
|
+
},
|
|
21
49
|
keyboardConfig: {
|
|
22
50
|
isEdit: true,
|
|
23
51
|
isArrow: true,
|
|
24
52
|
isEnter: true,
|
|
25
53
|
isTab: true,
|
|
26
54
|
isDel: true,
|
|
27
|
-
isBack: true
|
|
55
|
+
isBack: true,
|
|
56
|
+
editMode: 'insert'
|
|
28
57
|
},
|
|
29
58
|
mouseConfig: {
|
|
30
59
|
selected: true
|
|
31
60
|
},
|
|
32
61
|
checkboxConfig: {
|
|
33
|
-
checkRowKey: "id",
|
|
34
62
|
highlight: true,
|
|
35
63
|
range: true,
|
|
36
|
-
|
|
37
|
-
reserve: true // 跨页保留选中状态
|
|
64
|
+
reserve: true
|
|
38
65
|
},
|
|
39
66
|
radioConfig: {
|
|
40
67
|
strict: false,
|
|
41
68
|
checkRowKey: "id",
|
|
42
69
|
highlight: true,
|
|
43
70
|
reserve: true,
|
|
44
|
-
trigger: "
|
|
71
|
+
trigger: "cell" // 关键配置:点击行触发选中
|
|
45
72
|
},
|
|
46
|
-
border: true,
|
|
47
|
-
stripe: true,
|
|
48
|
-
loading: false,
|
|
49
|
-
minHeight: 200,
|
|
50
|
-
maxHeight: "100%",
|
|
51
|
-
size: "mini",
|
|
52
73
|
pagerConfig: {
|
|
53
74
|
enabled: true,
|
|
54
75
|
total: 0,
|
|
@@ -56,10 +77,7 @@ export default {
|
|
|
56
77
|
pageSize: 50,
|
|
57
78
|
align: "right"
|
|
58
79
|
},
|
|
59
|
-
|
|
60
|
-
resizable: true,
|
|
61
|
-
isCurrent: false
|
|
62
|
-
},
|
|
80
|
+
|
|
63
81
|
formConfig: {
|
|
64
82
|
data: {},
|
|
65
83
|
items: []
|
|
@@ -68,32 +86,30 @@ export default {
|
|
|
68
86
|
refresh: true,
|
|
69
87
|
custom: true, //是否开启自定义列工具栏
|
|
70
88
|
slots: {
|
|
71
|
-
|
|
89
|
+
tools: "keywords"
|
|
72
90
|
}
|
|
73
91
|
},
|
|
74
|
-
proxyConfig: {
|
|
75
|
-
response: {
|
|
76
|
-
result: "result",
|
|
77
|
-
total: "page.total"
|
|
78
|
-
},
|
|
79
|
-
ajax: {}
|
|
80
|
-
},
|
|
81
92
|
menuConfig: {
|
|
82
93
|
//右键菜单配置
|
|
83
94
|
header: {
|
|
84
95
|
options: []
|
|
85
96
|
},
|
|
86
97
|
body: {
|
|
87
|
-
options: [
|
|
88
|
-
[
|
|
89
|
-
{ code: "insert", name: "插入行", visible: true, disabled: false },
|
|
90
|
-
{ code: "copy", name: "复制行", prefixIcon: "vxe-icon-copy", visible: true, disabled: false }
|
|
91
|
-
]
|
|
92
|
-
]
|
|
98
|
+
options: []
|
|
93
99
|
},
|
|
94
100
|
footer: {
|
|
95
101
|
options: []
|
|
96
102
|
}
|
|
97
103
|
},
|
|
104
|
+
scrollX: {
|
|
105
|
+
gt: 0,
|
|
106
|
+
//自动启用纵向虚拟滚动
|
|
107
|
+
enabled: true
|
|
108
|
+
},
|
|
109
|
+
scrollY: {
|
|
110
|
+
gt: 0,
|
|
111
|
+
//自动启用纵向虚拟滚动
|
|
112
|
+
enabled: true
|
|
113
|
+
},
|
|
98
114
|
columns: []
|
|
99
115
|
};
|
|
@@ -1,37 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SohelpVxeGrid对外默认属性
|
|
3
|
+
*/
|
|
1
4
|
export default {
|
|
2
5
|
value: [Array, String],
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
refid: {
|
|
6
|
+
/**读取数据源URL**/
|
|
7
|
+
url: {
|
|
6
8
|
type: String,
|
|
7
|
-
|
|
8
|
-
required: true
|
|
9
|
+
default: ""
|
|
9
10
|
},
|
|
10
11
|
/**自动加载数据*/
|
|
11
12
|
autoLoad: {
|
|
12
13
|
type: Boolean,
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
gridOptions:Object,
|
|
16
|
-
/**数据源URL**/
|
|
17
|
-
url: {
|
|
18
|
-
type: String,
|
|
19
|
-
defaultValue: ''
|
|
14
|
+
default: true
|
|
20
15
|
},
|
|
16
|
+
gridOptions: Object,
|
|
21
17
|
/**允许拖动记录*/
|
|
22
18
|
drag: {
|
|
23
19
|
type: Boolean,
|
|
24
20
|
default: false
|
|
25
21
|
},
|
|
26
|
-
|
|
27
|
-
* 是否实体列表
|
|
28
|
-
*/
|
|
29
|
-
isEntityGrid: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false
|
|
32
|
-
},
|
|
22
|
+
/**是否可以多选*/
|
|
33
23
|
multiple: {
|
|
34
24
|
type: Boolean,
|
|
35
25
|
default: true
|
|
36
26
|
}
|
|
37
|
-
}
|
|
27
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import DefaultGridOptions from
|
|
2
|
-
import { nextTick, reactive, ref } from
|
|
3
|
-
import Sortable from
|
|
4
|
-
import { moduleCache } from
|
|
1
|
+
import DefaultGridOptions from "./DefaultGridOptions";
|
|
2
|
+
import { nextTick, reactive, ref } from "vue";
|
|
3
|
+
import Sortable from "sortablejs";
|
|
4
|
+
import { moduleCache } from "../cache/ModuleCache";
|
|
5
5
|
|
|
6
6
|
/**列转换*/
|
|
7
7
|
const switchVxeProperty = (property) => {
|
|
@@ -12,14 +12,14 @@ const switchVxeProperty = (property) => {
|
|
|
12
12
|
showOverflow: true
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
if (property.name ===
|
|
16
|
-
editor[
|
|
15
|
+
if (property.name === "id") {
|
|
16
|
+
editor["width"] = 50;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
if (property.edit) {
|
|
20
|
-
editor[
|
|
20
|
+
editor["editRender"] = {
|
|
21
21
|
enabled: true,
|
|
22
|
-
name: property.editor ||
|
|
22
|
+
name: property.editor || "input"
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
return editor;
|
|
@@ -30,9 +30,10 @@ const sortable = ref();
|
|
|
30
30
|
const rowDrop = (sohelpVxeGridRef) => {
|
|
31
31
|
nextTick(() => {
|
|
32
32
|
const xGTable = sohelpVxeGridRef.value;
|
|
33
|
-
sortable.value = Sortable.create(xGTable.$el.querySelector(
|
|
34
|
-
handle:
|
|
35
|
-
onEnd: ({ newIndex, oldIndex }) => {
|
|
33
|
+
sortable.value = Sortable.create(xGTable.$el.querySelector(".body--wrapper>.vxe-table--body tbody"), {
|
|
34
|
+
handle: ".drag-btn",
|
|
35
|
+
onEnd: ({ newIndex, oldIndex }) => {
|
|
36
|
+
}
|
|
36
37
|
});
|
|
37
38
|
});
|
|
38
39
|
};
|
|
@@ -55,7 +56,7 @@ const filterFieldsByProperties = (_filter) => {
|
|
|
55
56
|
filter.list = filterArray(filter.list);
|
|
56
57
|
filter.filter.keywords = filterArray(filter.filter.keywords);
|
|
57
58
|
filter.filter.sort = filterArray(filter.filter.sort);
|
|
58
|
-
filter.filter.field = filterArray(filter.filter.field,
|
|
59
|
+
filter.filter.field = filterArray(filter.filter.field, "name");
|
|
59
60
|
return filter;
|
|
60
61
|
};
|
|
61
62
|
|
|
@@ -63,10 +64,10 @@ const filterFieldsByProperties = (_filter) => {
|
|
|
63
64
|
export async function initial(sohelpVxeGridRef, props) {
|
|
64
65
|
var data = null;
|
|
65
66
|
if (props.refid) {
|
|
66
|
-
data =
|
|
67
|
+
data = await moduleCache.getGrid(props.refid);
|
|
67
68
|
|
|
68
69
|
if (!data) {
|
|
69
|
-
throw new Error(
|
|
70
|
+
throw new Error(props.refid+" 不存在!");
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
try {
|
|
@@ -88,17 +89,17 @@ export async function initial(sohelpVxeGridRef, props) {
|
|
|
88
89
|
//初始化属性列表配置
|
|
89
90
|
DefaultGridOptions.columns = [
|
|
90
91
|
{
|
|
91
|
-
field: props.multiple ?
|
|
92
|
-
fixed:
|
|
93
|
-
type: props.multiple ?
|
|
92
|
+
field: props.multiple ? "checkbox" : "radio",
|
|
93
|
+
fixed: "left",
|
|
94
|
+
type: props.multiple ? "checkbox" : "radio",
|
|
94
95
|
width: 35,
|
|
95
|
-
align:
|
|
96
|
+
align: "center"
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
|
-
type:
|
|
99
|
-
title:
|
|
100
|
-
fixe:
|
|
101
|
-
align:
|
|
99
|
+
type: "seq",
|
|
100
|
+
title: "#",
|
|
101
|
+
fixe: "left",
|
|
102
|
+
align: "center",
|
|
102
103
|
width: 40
|
|
103
104
|
}
|
|
104
105
|
];
|
|
@@ -118,13 +119,13 @@ export async function initial(sohelpVxeGridRef, props) {
|
|
|
118
119
|
|
|
119
120
|
if (drag) {
|
|
120
121
|
DefaultGridOptions.columns.unshift({
|
|
121
|
-
title:
|
|
122
|
-
fixed:
|
|
122
|
+
title: "",
|
|
123
|
+
fixed: "left",
|
|
123
124
|
width: 40,
|
|
124
|
-
align:
|
|
125
|
+
align: "center",
|
|
125
126
|
dragSort: true,
|
|
126
127
|
slots: {
|
|
127
|
-
default:
|
|
128
|
+
default: "draggableDefault"
|
|
128
129
|
}
|
|
129
130
|
});
|
|
130
131
|
}
|
|
@@ -136,7 +137,7 @@ export async function initial(sohelpVxeGridRef, props) {
|
|
|
136
137
|
}
|
|
137
138
|
const gridOptions = props.refid ? DefaultGridOptions : props.gridOptions || DefaultGridOptions;
|
|
138
139
|
|
|
139
|
-
return { gridOptions, sohelpConfig: SohelpConfig, propertiesMap};
|
|
140
|
+
return { gridOptions, sohelpConfig: SohelpConfig, propertiesMap };
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
export default initial;
|