sohelp-eleplus 1.1.17 → 1.1.19
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/package.json +1 -1
- package/sohelp-entity-grid/index.vue +3 -3
- package/sohelp-grid/index.vue +93 -18
- package/sohelp-grid/js/DefaultGridOptions.js +5 -1
- package/sohelp-grid/js/DefaultProps.js +3 -3
- package/sohelp-grid/js/useSohelpGridConfig.js +7 -1
- package/sohelp-grid-select/index.vue +2 -2
- package/sohelp-grid-view/filter/config/grid-filter-field.vue +1 -1
- package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +1 -1
- package/sohelp-grid-view/filter/config/grid-filter-list.vue +1 -1
- package/sohelp-grid-view/filter/config/grid-filter-sort.vue +1 -1
- package/sohelp-grid-view/filter/filter-form.vue +31 -12
- package/sohelp-grid-view/filter/index.vue +1 -1
- package/sohelp-icon-select/index.vue +3 -3
- package/sohelp-modal/index.vue +28 -21
- package/sohelp-module/useSohelpModule.js +9 -11
- package/sohelp-org-user-tree/index.vue +1 -1
- package/sohelp-table/index.vue +3 -3
- package/sohelp-vform-drawer/index.vue +1 -1
- package/sohelp-vxe-grid/DefaultGridOptions.js +7 -16
- package/sohelp-vxe-grid/DefaultProps.js +10 -20
- package/sohelp-vxe-grid/SohelpGridConfig.js +28 -27
- package/sohelp-vxe-grid/index.vue +397 -440
- package/sohelp-vxe-table/index.vue +4 -4
- package/style/index.scss +0 -0
package/README.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
* 2) npm install sohelp-eleplus
|
|
4
4
|
|
|
5
5
|
# 相关依赖
|
|
6
|
+
* 1) Element-Plus
|
|
7
|
+
* 2) Admin-Element-Plus
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# 如何开发调试
|
|
11
|
+
|
|
12
|
+
通过npm link进行安装关联
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
# 关联连接
|
|
16
|
+
npm link sohelp-eleplus
|
|
17
|
+
|
|
18
|
+
# 导入组件库
|
|
19
|
+
import SohelpEleplus from 'sohelp-eleplus';
|
|
20
|
+
|
|
21
|
+
# 导入样式
|
|
22
|
+
import 'sohelp-eleplus/style/index.scss';
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# 全局安装注册组件库
|
|
26
|
+
app.use(SohelpEleplus);
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
6
30
|
|
|
7
31
|
|
|
8
32
|
# 如何发布
|
package/cache/ModuleCache.js
CHANGED
|
@@ -71,16 +71,6 @@ class ModuleCache {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
/**初始化实体列表*/
|
|
75
|
-
const entityGrid = moduleData?.entityGrid;
|
|
76
|
-
if (entityGrid) {
|
|
77
|
-
for (const key in entityGrid) {
|
|
78
|
-
const grid = entityGrid[key];
|
|
79
|
-
if (grid && grid.refid) {
|
|
80
|
-
this.setEntityGrid(grid.refid, grid);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
74
|
|
|
85
75
|
/**初始化工作流列表*/
|
|
86
76
|
const workflowList = moduleData?.workflow;
|
|
@@ -142,16 +132,7 @@ class ModuleCache {
|
|
|
142
132
|
this.gridCache.set(refid, value);
|
|
143
133
|
}
|
|
144
134
|
|
|
145
|
-
|
|
146
|
-
* 设置实体网格缓存
|
|
147
|
-
*
|
|
148
|
-
* @param {string} refid - 实体网格的引用ID
|
|
149
|
-
* @param {any} value - 要设置的缓存值
|
|
150
|
-
*/
|
|
151
|
-
setEntityGrid(refid, value) {
|
|
152
|
-
if (!refid) return;
|
|
153
|
-
this.entityGridCache.set(refid, value);
|
|
154
|
-
}
|
|
135
|
+
|
|
155
136
|
|
|
156
137
|
/**
|
|
157
138
|
* 设置实体表单的值
|
|
@@ -214,18 +195,7 @@ class ModuleCache {
|
|
|
214
195
|
return this.layoutCache.has(refid) ? this.layoutCache.get(refid) : null;
|
|
215
196
|
}
|
|
216
197
|
|
|
217
|
-
|
|
218
|
-
* 异步获取实体网格数据
|
|
219
|
-
*
|
|
220
|
-
* @param refid 模块引用ID
|
|
221
|
-
* @returns 返回对应refid的实体网格数据,如果不存在则返回null
|
|
222
|
-
*/
|
|
223
|
-
async getEntityGrid(refid) {
|
|
224
|
-
if (!this.hasModule(refid)) {
|
|
225
|
-
await this.init(refid);
|
|
226
|
-
}
|
|
227
|
-
return this.entityGridCache.has(refid) ? this.entityGridCache.get(refid) : null;
|
|
228
|
-
}
|
|
198
|
+
|
|
229
199
|
|
|
230
200
|
/**
|
|
231
201
|
* 获取实体表单
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<sohelp-
|
|
2
|
+
<sohelp-grid-view v-bind="$attrs" ref="sohelpEntityGridRef" :refid="refid" :isEntityGrid="true"></sohelp-grid-view>
|
|
3
3
|
</template>
|
|
4
4
|
<script>
|
|
5
|
-
import
|
|
5
|
+
import SohelpGridView from '../sohelp-grid-view/index.vue'
|
|
6
6
|
import {ref} from "vue";
|
|
7
7
|
export default {
|
|
8
8
|
name: "SohelpEntityGrid",
|
|
9
|
-
components: {
|
|
9
|
+
components: {SohelpGridView},
|
|
10
10
|
props:{
|
|
11
11
|
modelValue: Object,
|
|
12
12
|
/** 实体配置 */
|
package/sohelp-grid/index.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { Filter, Search, Sort, SortDown, SortUp } from "@element-plus/icons-vue";
|
|
2
|
+
import { Filter, Search, Sort, SortDown, SortUp,Setting,Tickets,Postcard, Files, Grid} from "@element-plus/icons-vue";
|
|
3
3
|
import { useMobile } from "@/utils/use-mobile";
|
|
4
4
|
import { usePermission } from "@/utils/use-permission";
|
|
5
5
|
import DefaultProps from "./js/DefaultProps";
|
|
@@ -11,8 +11,11 @@ import { ElMessageBox } from "element-plus/es";
|
|
|
11
11
|
import { useFormData } from "@/utils/use-form-data";
|
|
12
12
|
import { resetCommonConfig, updateCommonConfig } from "../http/ModuleHttp.js";
|
|
13
13
|
import CrudHttp from "../http/CrudHttp.js";
|
|
14
|
+
import {merge, cloneDeep } from "lodash-es";
|
|
15
|
+
|
|
14
16
|
import ApprovalModal from "../sohelp-workflow-drawer/components/approval-modal.vue";
|
|
15
17
|
import WorkflowDrawer from "../sohelp-workflow-drawer/index.vue";
|
|
18
|
+
|
|
16
19
|
import SohelpTextareaInput from "../sohelp-textarea-input/index.vue";
|
|
17
20
|
import SohelpPower from "../sohelp-power/index.vue";
|
|
18
21
|
import FilterConditionItem from "./components/filter-condition-item.vue";
|
|
@@ -21,7 +24,10 @@ import { useI18n } from "vue-i18n";
|
|
|
21
24
|
import SohelpEntityForm from "../sohelp-entity-form/index.vue";
|
|
22
25
|
import * as ElementPlusIcons from '@element-plus/icons-vue';
|
|
23
26
|
import * as EleAdminPlusIcons from '@/components/icons';
|
|
24
|
-
|
|
27
|
+
import { moduleCache } from "../cache/ModuleCache.js";
|
|
28
|
+
import SohelpModal from "../sohelp-modal/index.vue";
|
|
29
|
+
import { useUserStore } from '@/store/modules/user';
|
|
30
|
+
import { Alert } from "vxe-pc-ui";
|
|
25
31
|
const { initial, isConfigDone } = useSohelpGridConfig();
|
|
26
32
|
const { t } = useI18n();
|
|
27
33
|
const { mobile } = useMobile();
|
|
@@ -36,6 +42,7 @@ const current = ref(null);
|
|
|
36
42
|
const isPage = ref(false);
|
|
37
43
|
const approvalModalVisible = ref(false);
|
|
38
44
|
const approvalData = ref({});
|
|
45
|
+
const userStore = useUserStore();
|
|
39
46
|
|
|
40
47
|
//报表打印
|
|
41
48
|
const currentReportValue = ref(null);
|
|
@@ -130,7 +137,7 @@ const propertiesMap = defineModel("propertiesMap");
|
|
|
130
137
|
// Grid实例
|
|
131
138
|
const sohelpVxeGridRef = ref(null);
|
|
132
139
|
// GridOptions配置
|
|
133
|
-
const gridOptions = reactive(
|
|
140
|
+
const gridOptions = reactive(cloneDeep(DefaultGridOptions));
|
|
134
141
|
const batchButtonsIndex = ref(2);
|
|
135
142
|
const sortValue = ref("");
|
|
136
143
|
/**
|
|
@@ -1160,7 +1167,7 @@ const updateProperties = (obj, properties, key, propertiesMap) => {
|
|
|
1160
1167
|
*/
|
|
1161
1168
|
const sortPropertiesInPlace = (properties, sortData) => {
|
|
1162
1169
|
const sortOrder = {};
|
|
1163
|
-
Object.entries(sortData)
|
|
1170
|
+
Object.entries(sortData || {})
|
|
1164
1171
|
.sort((a, b) => a[1] - b[1])
|
|
1165
1172
|
.forEach(([key], index) => {
|
|
1166
1173
|
sortOrder[key] = index;
|
|
@@ -1200,6 +1207,7 @@ const handleCustom = async ({ type, $grid }) => {
|
|
|
1200
1207
|
if (type === "confirm") {
|
|
1201
1208
|
//获取当前列配置
|
|
1202
1209
|
const { sortData, ...columnsData } = filterUnderscoreProps($grid?.getCustomStoreData());
|
|
1210
|
+
|
|
1203
1211
|
const properties = JSON.parse(JSON.stringify([...sohelpConfig.value.properties])).map(item => {
|
|
1204
1212
|
return {
|
|
1205
1213
|
...item,
|
|
@@ -1243,6 +1251,10 @@ const handleCustom = async ({ type, $grid }) => {
|
|
|
1243
1251
|
EleMessage.success(message);
|
|
1244
1252
|
}
|
|
1245
1253
|
|
|
1254
|
+
//清除缓存
|
|
1255
|
+
moduleCache?.clear();
|
|
1256
|
+
loadConfig();
|
|
1257
|
+
|
|
1246
1258
|
localStorage.setItem("VXE_CUSTOM_STORE", "");
|
|
1247
1259
|
loading.close();
|
|
1248
1260
|
}
|
|
@@ -1310,6 +1322,28 @@ const currentColumnChange = (props) => {
|
|
|
1310
1322
|
emit("currentColumnChange", props);
|
|
1311
1323
|
};
|
|
1312
1324
|
|
|
1325
|
+
const columnCheckbox = ref(false);
|
|
1326
|
+
const toggleAllEvent = () => {
|
|
1327
|
+
const $grid = sohelpVxeGridRef.value
|
|
1328
|
+
if ($grid) {
|
|
1329
|
+
$grid.toggleCustomAllCheckbox()
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
const settingClick = (command) => {
|
|
1334
|
+
const baseUrl = SohelpHttp.getBaseUrl();
|
|
1335
|
+
const { refid,extendEntity,name } = sohelpConfig.value;
|
|
1336
|
+
if(refid && extendEntity && name){
|
|
1337
|
+
const url = {
|
|
1338
|
+
form: baseUrl + `/dev/index.html#/dev/form?datasource=${name}&name=${extendEntity}&refid=${refid}`,
|
|
1339
|
+
entity: baseUrl + `/dev/index.html#/dev/module/entity?datasource=${name}&name=${extendEntity}`,
|
|
1340
|
+
workflow: baseUrl + `/dev/index.html#/dev/form?datasource=${name}&name=${extendEntity}&refid=${refid}`,
|
|
1341
|
+
grid: baseUrl + `/dev/index.html#/dev/module/grid?refid=${refid}`
|
|
1342
|
+
}
|
|
1343
|
+
window.open(url[command],'_blank');
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1313
1347
|
/**
|
|
1314
1348
|
* 监听是否被选中,更新工具栏批量操作
|
|
1315
1349
|
*/
|
|
@@ -1366,6 +1400,22 @@ defineExpose({
|
|
|
1366
1400
|
@currentColumnChange="currentColumnChange"
|
|
1367
1401
|
@filter-visible="filterVisible"
|
|
1368
1402
|
>
|
|
1403
|
+
|
|
1404
|
+
<template #setting>
|
|
1405
|
+
<div class="column-setting">
|
|
1406
|
+
<vxe-checkbox @change="toggleAllEvent" v-model="columnCheckbox">全选</vxe-checkbox>
|
|
1407
|
+
<vxe-pulldown trigger="click" :transfer="true" :show-popup-shadow="true" v-if="userStore.info.is_developer">
|
|
1408
|
+
<template #default>
|
|
1409
|
+
<el-link :icon="Setting" :underline="false"></el-link>
|
|
1410
|
+
</template>
|
|
1411
|
+
<template #dropdown>
|
|
1412
|
+
<ele-text @click="settingClick('grid')">数据列表配置</ele-text>
|
|
1413
|
+
<ele-text @click="settingClick('entity')">实体配置</ele-text>
|
|
1414
|
+
</template>
|
|
1415
|
+
</vxe-pulldown>
|
|
1416
|
+
</div>
|
|
1417
|
+
</template>
|
|
1418
|
+
|
|
1369
1419
|
<!--定义国际化I18n-->
|
|
1370
1420
|
<template
|
|
1371
1421
|
v-for="item in sohelpConfig?.properties?.map(item => item)"
|
|
@@ -1442,6 +1492,7 @@ defineExpose({
|
|
|
1442
1492
|
</div>
|
|
1443
1493
|
</sohelp-drop-card>
|
|
1444
1494
|
<el-button :icon="Filter" size="small" @click="showFilter()"
|
|
1495
|
+
plain
|
|
1445
1496
|
:type="(sohelpConfig?.filter?.config?.visibleFilter && sohelpConfig?.filter?.config?.filterPosition !== 'NONE')?'primary':''"
|
|
1446
1497
|
v-if="sohelpConfig?.filter?.config?._visibleFilter">
|
|
1447
1498
|
</el-button>
|
|
@@ -1457,6 +1508,7 @@ defineExpose({
|
|
|
1457
1508
|
:key="name"
|
|
1458
1509
|
>
|
|
1459
1510
|
|
|
1511
|
+
|
|
1460
1512
|
<sohelp-dict
|
|
1461
1513
|
type="text"
|
|
1462
1514
|
v-model="row[name]"
|
|
@@ -1663,7 +1715,7 @@ defineExpose({
|
|
|
1663
1715
|
<template #dropdown>
|
|
1664
1716
|
<el-dropdown-menu>
|
|
1665
1717
|
<el-dropdown-item v-for="item in getOperationButtonsByType(row,'more')" :key="item.code"
|
|
1666
|
-
@click="operationHandler({item:item, row:row,$grid:sohelpVxeGridRef})"
|
|
1718
|
+
@click.stop="operationHandler({item:item, row:row,$grid:sohelpVxeGridRef})"
|
|
1667
1719
|
v-bind="item.props">
|
|
1668
1720
|
<el-icon v-if="item.icon">
|
|
1669
1721
|
<component :is="ElementPlusIcons[item.icon]" v-if="ElementPlusIcons[item.icon]" />
|
|
@@ -1721,21 +1773,36 @@ defineExpose({
|
|
|
1721
1773
|
</ele-modal>
|
|
1722
1774
|
|
|
1723
1775
|
<!--实体表单-->
|
|
1724
|
-
<
|
|
1776
|
+
<sohelp-modal
|
|
1777
|
+
:title="toolbarButtonParams?.title || ''"
|
|
1725
1778
|
:width="toolbarButtonParams?.width || 860"
|
|
1779
|
+
:draggable="false"
|
|
1726
1780
|
v-model="visibleEntityForm" v-loading="loading">
|
|
1727
|
-
<
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
</
|
|
1738
|
-
</
|
|
1781
|
+
<template #setting v-if="userStore.info.is_developer">
|
|
1782
|
+
<ele-dropdown
|
|
1783
|
+
:items="[
|
|
1784
|
+
{ title: '表单配置', command: 'form' , icon:Postcard},
|
|
1785
|
+
{ title: '实体配置', command: 'entity', icon:Tickets},
|
|
1786
|
+
{ title: '流程配置', command: 'workflow', icon:Files }
|
|
1787
|
+
]"
|
|
1788
|
+
@command="settingClick"
|
|
1789
|
+
>
|
|
1790
|
+
<el-link :icon="Setting" :underline="false"></el-link>
|
|
1791
|
+
</ele-dropdown>
|
|
1792
|
+
</template>
|
|
1793
|
+
|
|
1794
|
+
<sohelp-entity-form ref="entityFormRef"
|
|
1795
|
+
:refid="props.refid"
|
|
1796
|
+
v-model="entityFormValue"
|
|
1797
|
+
:data="entityFormData"
|
|
1798
|
+
:config="entityFormConfig"
|
|
1799
|
+
:readonly="toolbarButtonParams?.readonly"
|
|
1800
|
+
></sohelp-entity-form>
|
|
1801
|
+
<template #footer v-if="!toolbarButtonParams?.readonly">
|
|
1802
|
+
<el-button @click="closeEntityForm()">{{ t("common.close") }}</el-button>
|
|
1803
|
+
<el-button type="primary" @click="saveEntityForm()" v-loading="loading">{{ t("common.save") }}</el-button>
|
|
1804
|
+
</template>
|
|
1805
|
+
</sohelp-modal>
|
|
1739
1806
|
<!--打印报表-->
|
|
1740
1807
|
<ele-modal :title="toolbarButtonParams?.title|| t('grid.report.title')" :width="toolbarButtonParams?.width|| 600"
|
|
1741
1808
|
v-model="visibleReport">
|
|
@@ -1886,5 +1953,13 @@ defineExpose({
|
|
|
1886
1953
|
}
|
|
1887
1954
|
}
|
|
1888
1955
|
|
|
1956
|
+
.column-setting{
|
|
1957
|
+
padding: 5px 10px;
|
|
1958
|
+
display: flex;
|
|
1959
|
+
align-items: center;
|
|
1960
|
+
justify-content: space-between;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
|
|
1889
1964
|
|
|
1890
1965
|
</style>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
id: 'sohelp-grid',
|
|
3
3
|
customConfig: {
|
|
4
|
+
//默认不会将列设置保存到本地存储中
|
|
5
|
+
storage: false,
|
|
4
6
|
placement: 'top-right' // 自定义列工具栏位置
|
|
5
7
|
},
|
|
6
8
|
rowConfig: {
|
|
@@ -82,13 +84,15 @@ export default {
|
|
|
82
84
|
resizable: true, // 保存列宽调整
|
|
83
85
|
sort: true, // 保存列排序
|
|
84
86
|
fixed: true
|
|
87
|
+
},
|
|
88
|
+
slots: {
|
|
89
|
+
header: 'setting'
|
|
85
90
|
}
|
|
86
91
|
},
|
|
87
92
|
columnConfig: {
|
|
88
93
|
isCurrent: true,
|
|
89
94
|
resizable: true
|
|
90
95
|
},
|
|
91
|
-
|
|
92
96
|
sortConfig: {
|
|
93
97
|
remote: true
|
|
94
98
|
},
|
|
@@ -2,18 +2,18 @@ export default {
|
|
|
2
2
|
/**网格列表配置ID*/
|
|
3
3
|
refid: {
|
|
4
4
|
type: String,
|
|
5
|
-
|
|
5
|
+
default: '',
|
|
6
6
|
required: true
|
|
7
7
|
},
|
|
8
8
|
/**自动加载数据*/
|
|
9
9
|
autoLoad: {
|
|
10
10
|
type: Boolean,
|
|
11
|
-
|
|
11
|
+
default: true
|
|
12
12
|
},
|
|
13
13
|
/**数据源URL**/
|
|
14
14
|
url: {
|
|
15
15
|
type: String,
|
|
16
|
-
|
|
16
|
+
default: ''
|
|
17
17
|
},
|
|
18
18
|
/**允许行拖动*/
|
|
19
19
|
rowDrag: Boolean,
|
|
@@ -93,7 +93,13 @@ const switchVxeProperty = (property, sortList, f, formulaMap) => {
|
|
|
93
93
|
editor.editRender["code"] = property.dict;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
//
|
|
96
|
+
// 取默认显示值
|
|
97
|
+
if (property.type === "RELATION" && editor.labelField === "") {
|
|
98
|
+
const fields = property.relationList?.split(",");
|
|
99
|
+
editor.labelField = fields.includes("id") && fields.length > 1 ? fields[1] : fields[0];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 自定义编辑插槽
|
|
97
103
|
if (property.edit) {
|
|
98
104
|
editor.slots.edit = "edit_" + property.name;
|
|
99
105
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<el-option style="height: auto; padding: 0; height: 262px; overflow: hidden; align-items: flex-start">
|
|
18
|
-
<sohelp-
|
|
18
|
+
<sohelp-grid-view
|
|
19
19
|
:refid="refid"
|
|
20
20
|
ref="tableRef"
|
|
21
21
|
class="vxe-grid-main"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
v-model:data="selectedData"
|
|
26
26
|
:url="url"
|
|
27
27
|
>
|
|
28
|
-
</sohelp-
|
|
28
|
+
</sohelp-grid-view>
|
|
29
29
|
</el-option>
|
|
30
30
|
|
|
31
31
|
<template #footer>
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
import { ref, watch, computed, toRaw } from 'vue';
|
|
164
164
|
import VueDraggable from 'vuedraggable';
|
|
165
165
|
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
|
166
|
-
import { DragOutlined } from '
|
|
166
|
+
import { DragOutlined } from '../../../sohelp-icon-select/icons';
|
|
167
167
|
|
|
168
168
|
const CondictionOptions = [
|
|
169
169
|
{
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
import { ref, watch, computed } from 'vue';
|
|
164
164
|
import VueDraggable from 'vuedraggable';
|
|
165
165
|
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
|
166
|
-
import { DragOutlined } from '
|
|
166
|
+
import { DragOutlined } from '../../../sohelp-icon-select/icons';
|
|
167
167
|
|
|
168
168
|
const props = defineProps({
|
|
169
169
|
modelValue: {
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
import { ref, watch, computed } from 'vue';
|
|
166
166
|
import VueDraggable from 'vuedraggable';
|
|
167
167
|
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
|
168
|
-
import { DragOutlined } from '
|
|
168
|
+
import { DragOutlined } from '../../../sohelp-icon-select/icons';
|
|
169
169
|
|
|
170
170
|
const props = defineProps({
|
|
171
171
|
modelValue: {
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
import { ref, watch, computed } from 'vue';
|
|
164
164
|
import VueDraggable from 'vuedraggable';
|
|
165
165
|
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
|
166
|
-
import { DragOutlined } from '
|
|
166
|
+
import { DragOutlined } from '../../../sohelp-icon-select/icons';
|
|
167
167
|
|
|
168
168
|
const props = defineProps({
|
|
169
169
|
modelValue: {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
</template>
|
|
59
59
|
|
|
60
60
|
<script setup>
|
|
61
|
-
import { computed, nextTick, onMounted, reactive, ref, onBeforeUnmount } from 'vue';
|
|
61
|
+
import { computed, nextTick, onMounted, reactive, ref, onBeforeUnmount, watch } from 'vue';
|
|
62
62
|
import FilterConditionItem from '../../sohelp-grid/components/filter-condition-item.vue';
|
|
63
63
|
import { useMobile } from '@/utils/use-mobile';
|
|
64
64
|
import { useI18n } from 'vue-i18n';
|
|
@@ -159,16 +159,10 @@
|
|
|
159
159
|
});
|
|
160
160
|
|
|
161
161
|
const load = () => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
onMounted(() => {
|
|
167
|
-
loading.value = true;
|
|
168
|
-
nextTick(() => {
|
|
169
|
-
loading.value = false;
|
|
170
|
-
// 高级筛选高度
|
|
171
|
-
maxRowsConfig.height = advancedBoxRef.value.offsetHeight + 'px';
|
|
162
|
+
const { filterPosition } = config.value.filter?.config;
|
|
163
|
+
if (filterPosition?.toUpperCase() === 'TOP') {
|
|
164
|
+
maxRowsConfig.current.index = filterList.value.length;
|
|
165
|
+
maxRowsConfig.height = advancedBoxRef.value?.offsetHeight + 'px';
|
|
172
166
|
const advancedRow = advancedBoxRef.value.querySelector('.sohelp-filter-condition');
|
|
173
167
|
if (advancedRow) {
|
|
174
168
|
maxRowsConfig.rowHeight = advancedRow.offsetHeight;
|
|
@@ -176,8 +170,22 @@
|
|
|
176
170
|
nextTick(() => {
|
|
177
171
|
maxRowsConfig.searchButtonWidth = searchButtonRef.value?.offsetWidth + 35;
|
|
178
172
|
maxRowsConfig.itemWidth = getAllHeights();
|
|
179
|
-
|
|
173
|
+
|
|
174
|
+
maxRowsConfig.width = advancedBoxRef.value?.offsetWidth || 160;
|
|
175
|
+
maxRowsConfig.current = findAccumulateIndex(
|
|
176
|
+
maxRowsConfig.itemWidth,
|
|
177
|
+
maxRowsConfig.width * maxRowsConfig.maxRows
|
|
178
|
+
);
|
|
180
179
|
});
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
onMounted(() => {
|
|
184
|
+
loading.value = true;
|
|
185
|
+
nextTick(() => {
|
|
186
|
+
loading.value = false;
|
|
187
|
+
// 高级筛选高度
|
|
188
|
+
load();
|
|
181
189
|
});
|
|
182
190
|
});
|
|
183
191
|
|
|
@@ -229,6 +237,17 @@
|
|
|
229
237
|
onBeforeUnmount(() => {
|
|
230
238
|
removeEventListener('resize', () => {});
|
|
231
239
|
});
|
|
240
|
+
|
|
241
|
+
watch(
|
|
242
|
+
() => config.value.filter.config.filterPosition,
|
|
243
|
+
(val) => {
|
|
244
|
+
if (val.toUpperCase() === 'TOP') {
|
|
245
|
+
nextTick(() => {
|
|
246
|
+
load();
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
);
|
|
232
251
|
</script>
|
|
233
252
|
<script>
|
|
234
253
|
export default {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}"
|
|
74
74
|
:class="['sohelp-filter-card', config.filter.config.filterPosition]"
|
|
75
75
|
:header="t('grid.toolbar.adv_filter')"
|
|
76
|
-
:headerStyle="{ padding: '0
|
|
76
|
+
:headerStyle="{ padding: '0 0 5px 0', fontWeight: 'normal', fontSize: '14px' }"
|
|
77
77
|
:bodyStyle="{ padding: '0', height: 'calc(100% - 40px)', background: '#fff' }"
|
|
78
78
|
>
|
|
79
79
|
<template #extra>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
placeholder="请选择图标"
|
|
5
5
|
filterable
|
|
6
6
|
class="sohelp-icon-select"
|
|
7
|
-
width="100%"
|
|
8
|
-
style="min-width: 60px"
|
|
9
7
|
clearable
|
|
8
|
+
fit-input-width
|
|
9
|
+
style="min-width: 60px; width: 100%"
|
|
10
10
|
>
|
|
11
11
|
<template #prefix>
|
|
12
12
|
<el-icon :size="14" color="#666" style="margin-right: 5px">
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<script setup>
|
|
41
41
|
import { ref } from 'vue';
|
|
42
42
|
import * as ElementPlusIcons from '@element-plus/icons-vue';
|
|
43
|
-
import * as EleAdminPlusIcons from '
|
|
43
|
+
import * as EleAdminPlusIcons from './icons';
|
|
44
44
|
import { VxeIcon } from './vxeui-icon.js';
|
|
45
45
|
const modelValue = defineModel('modelValue');
|
|
46
46
|
const iconData = ref([]);
|
package/sohelp-modal/index.vue
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
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>
|
|
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 type="primary" @click="confirm">确认</el-button>
|
|
21
|
+
<el-button @click="cancel">关闭</el-button>
|
|
22
|
+
</slot>
|
|
23
|
+
</template>
|
|
18
24
|
</ele-modal>
|
|
19
25
|
</template>
|
|
20
26
|
<script setup>
|
|
@@ -52,14 +58,15 @@
|
|
|
52
58
|
name: 'SohelpModal'
|
|
53
59
|
};
|
|
54
60
|
</script>
|
|
55
|
-
<style scoped>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/* 样式定义 */
|
|
59
|
-
height: 100%;
|
|
60
|
-
}
|
|
61
|
+
<style scoped lang="scss">
|
|
62
|
+
.modal-header {
|
|
63
|
+
display: flex;
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
.right {
|
|
66
|
+
margin-left: auto;
|
|
67
|
+
padding: 0 10px;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
}
|
|
64
71
|
}
|
|
65
72
|
</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
|
};
|