cnhis-design-vue 3.0.7 → 3.0.8
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/CHANGELOG.md +14 -0
- package/es/big-table/index.js +26 -13
- package/es/button-print/index.css +31 -31
- package/es/drag-layout/index.css +31 -31
- package/es/field-set/index.css +73 -73
- package/es/grid/index.css +73 -73
- package/es/index.css +275 -0
- package/es/index.js +1327 -169
- package/es/select-person/index.css +1319 -0
- package/es/select-person/index.js +13191 -0
- package/package.json +3 -3
- package/packages/big-table/src/BigTable.vue +21 -10
- package/packages/big-table/src/bigTableEmits.ts +2 -1
- package/packages/big-table/src/bigTableProps.ts +1 -1
- package/packages/big-table/src/hooks/useEdit.ts +3 -3
- package/packages/index.ts +5 -2
- package/packages/select-person/src/SelectPerson.vue +1065 -707
- package/packages/select-person/src/search-tree.vue +326 -0
- package/packages/select-person/src/utils/index.js +66 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.8",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@vicons/ionicons5": "^0.12.0",
|
|
18
|
-
"naive-ui": "^2.
|
|
18
|
+
"naive-ui": "^2.29.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@vicons/ionicons5": "^0.12.0",
|
|
22
22
|
"crypto-js": "^4.1.1",
|
|
23
23
|
"moment": "^2.29.1",
|
|
24
|
-
"naive-ui": "^2.
|
|
24
|
+
"naive-ui": "^2.29.0",
|
|
25
25
|
"vue": "^3.2.25",
|
|
26
26
|
"vue-router": "^4.0.13",
|
|
27
27
|
"vuedraggable": "^4.1.0",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
</p>
|
|
27
27
|
<template v-if="state.visibleCheckAllWrapMore && !props.asyncCount">
|
|
28
28
|
<p v-if="!visibleCancelCheckAllBtn" class="check-wrap-btn" @click="handleCheckAll">
|
|
29
|
-
<span v-if="pageVO.total >
|
|
30
|
-
<!-- {{ `最大勾选“${tableName}” ${
|
|
31
|
-
{{ `勾选全部页 ${
|
|
29
|
+
<span v-if="pageVO.total > maxCheckSize">
|
|
30
|
+
<!-- {{ `最大勾选“${tableName}” ${maxCheckSize}条数据` }} -->
|
|
31
|
+
{{ `勾选全部页 ${maxCheckSize}条数据` }}
|
|
32
32
|
</span>
|
|
33
33
|
<span v-else>
|
|
34
34
|
<!-- {{ $t("1.9.598", { name: tableName, total }) }} -->
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
iconOpen: 'iconfont icon-a-xitongtubiaozhediejian',
|
|
97
97
|
iconClose: 'iconfont icon-a-xitongtubiaotianjia',
|
|
98
98
|
}"
|
|
99
|
+
:keyboard-config="columnConfig.keyboardConfig || {}"
|
|
99
100
|
@cell-dblclick="rowdblclick"
|
|
100
101
|
@cell-click="handlerClickRow"
|
|
101
102
|
@checkbox-change="selectionChange"
|
|
@@ -289,7 +290,7 @@ const currentCheckedKeys = computed(() => {
|
|
|
289
290
|
});
|
|
290
291
|
const visibleCancelCheckAllBtn = computed(() => {
|
|
291
292
|
let isCurrentPageAllCheck = state.currentPageSelectedLength === state.curAbleCheckedLen;
|
|
292
|
-
let isMaxChecked = currentCheckedKeys.value.length === props.
|
|
293
|
+
let isMaxChecked = currentCheckedKeys.value.length === props.maxCheckSize;
|
|
293
294
|
let isCheckedTotal = currentCheckedKeys.value.length === props.pageVO.total;
|
|
294
295
|
|
|
295
296
|
return isMaxChecked || !isCurrentPageAllCheck || isCheckedTotal;
|
|
@@ -1218,8 +1219,8 @@ const refreshTable = () => {
|
|
|
1218
1219
|
};
|
|
1219
1220
|
/* 全选相关 */
|
|
1220
1221
|
const handleCheckAll = () => {
|
|
1221
|
-
if (props.pageVO.total > props.
|
|
1222
|
-
let text = `当前列表共${props.pageVO.total}条数据,为了确保系统安全,只能单次操作${props.
|
|
1222
|
+
if (props.pageVO.total > props.maxCheckSize) {
|
|
1223
|
+
let text = `当前列表共${props.pageVO.total}条数据,为了确保系统安全,只能单次操作${props.maxCheckSize}条,你可以通过高级筛选过滤再次尝试`;
|
|
1223
1224
|
(window as any).$message.warning(text);
|
|
1224
1225
|
// return false;
|
|
1225
1226
|
}
|
|
@@ -1325,8 +1326,7 @@ const getAsyncTableData = (params: any) => {
|
|
|
1325
1326
|
};
|
|
1326
1327
|
const setChecklist = (list: any) => {
|
|
1327
1328
|
return list.map((i: any) => {
|
|
1328
|
-
|
|
1329
|
-
i["checked"] = false;
|
|
1329
|
+
i["checked"] = i.checked || false;
|
|
1330
1330
|
if (state.isTree == 2) {
|
|
1331
1331
|
const treeNodeKey = state.levelLazyLoadSetting.childCountKey;
|
|
1332
1332
|
const { isTreeOrList = "" } = props.tableParams;
|
|
@@ -1611,8 +1611,8 @@ const addCheckedRows = (rows: any) => {
|
|
|
1611
1611
|
removeCheckedDisabledRows(state);
|
|
1612
1612
|
let checkedRows = state.checkedRows;
|
|
1613
1613
|
|
|
1614
|
-
if (currentCheckedKeys.value.length + rows.length > props.
|
|
1615
|
-
(window as any).$message.warning(`为了保证系统安全,单次操作数据量限额为${props.
|
|
1614
|
+
if (currentCheckedKeys.value.length + rows.length > props.maxCheckSize) {
|
|
1615
|
+
(window as any).$message.warning(`为了保证系统安全,单次操作数据量限额为${props.maxCheckSize}条,你可以通过高级筛选过滤后再次尝试`);
|
|
1616
1616
|
return false;
|
|
1617
1617
|
}
|
|
1618
1618
|
|
|
@@ -1685,10 +1685,21 @@ const showDrawer = () => {
|
|
|
1685
1685
|
emit("setNestTableClickSetting", props.isNestTable);
|
|
1686
1686
|
emit("showDrawer", theads);
|
|
1687
1687
|
};
|
|
1688
|
+
let scrollEvent = (params: any) => {
|
|
1689
|
+
emit('scroll', params)
|
|
1690
|
+
}
|
|
1691
|
+
const initScroll = () => {
|
|
1692
|
+
const { throttle = false, throttleTime = 800, throttleOptions = {} } = props.columnConfig?.scrollConfig
|
|
1693
|
+
if (throttle) {
|
|
1694
|
+
scrollEvent = vexutils.throttle(scrollEvent, throttleTime, throttleOptions)
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
initScroll()
|
|
1688
1698
|
const handlerScroll = (params: any) => {
|
|
1689
1699
|
if (params.isX) {
|
|
1690
1700
|
hideFilterWrap(state, props);
|
|
1691
1701
|
}
|
|
1702
|
+
scrollEvent(params)
|
|
1692
1703
|
};
|
|
1693
1704
|
const handleCellMouseenter = ({ column, $event }: any) => {
|
|
1694
1705
|
// vxe-table@2.10+ 触发tooltip给vxe-cell父节点设置了title 导致显示有误
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const bigTableProps = {
|
|
2
2
|
data: { type: Array, default: () => [] },
|
|
3
|
-
|
|
3
|
+
maxCheckSize: { type: Number, default: 0 },
|
|
4
4
|
showFooter: Boolean,
|
|
5
5
|
sumData: { type: Object, default: () => ({}) },
|
|
6
6
|
avgData: { type: Object, default: () => ({}) },
|
|
@@ -82,16 +82,16 @@ export const useEdit = (props: any, state: any, emit: any, xGrid: any) => {
|
|
|
82
82
|
xGrid.value.clearActived()
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const onFormChange = ({ value, row, column }: {value: number | string | null, row: any, column: any}) => {
|
|
85
|
+
const onFormChange = ({ value, row, column, index }: {value: number | string | null, row: any, column: any, index: number}) => {
|
|
86
86
|
row[column.columnName] = value
|
|
87
|
-
emit('formChange', { value, row, column })
|
|
87
|
+
emit('formChange', { value, row, column, index })
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
const getDefaultValue = (params: any, item: any) => {
|
|
91
91
|
const value = params.row[item.columnName]
|
|
92
92
|
if (item.formType === 'select') {
|
|
93
93
|
if (item.options) {
|
|
94
|
-
return item.options.find((v: any) => v.value
|
|
94
|
+
return item.options.find((v: any) => v.value == value)?.label || ''
|
|
95
95
|
}
|
|
96
96
|
if (item.queryOptions) {
|
|
97
97
|
return (params.row[`${item.columnName}_options`]?.find((v: any) => v.value === value)?.label) || ''
|
package/packages/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { default as CBigTable } from './big-table';
|
|
|
5
5
|
import { default as CFieldSet } from './field-set';
|
|
6
6
|
import { default as CDragLayout } from './drag-layout';
|
|
7
7
|
import { default as CButtonPrint } from './button-print';
|
|
8
|
+
import { default as CSelectPerson } from './select-person';
|
|
8
9
|
|
|
9
10
|
// 存储组件列表
|
|
10
11
|
const components: any[] = [
|
|
@@ -12,7 +13,8 @@ const components: any[] = [
|
|
|
12
13
|
CBigTable,
|
|
13
14
|
CFieldSet,
|
|
14
15
|
CDragLayout,
|
|
15
|
-
CButtonPrint
|
|
16
|
+
CButtonPrint,
|
|
17
|
+
CSelectPerson
|
|
16
18
|
];
|
|
17
19
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
18
20
|
const install = function(app: App) {
|
|
@@ -27,7 +29,8 @@ export {
|
|
|
27
29
|
CBigTable,
|
|
28
30
|
CFieldSet,
|
|
29
31
|
CDragLayout,
|
|
30
|
-
CButtonPrint
|
|
32
|
+
CButtonPrint,
|
|
33
|
+
CSelectPerson
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export default {
|