n20-common-lib 3.0.37 → 3.0.39
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/package.json +2 -2
- package/src/assets/css/_coreLib.scss +4 -1
- package/src/assets/css/button.scss +8 -19
- package/src/assets/css/element-variables.scss +11 -11
- package/src/assets/css/file-upload-table.scss +10 -0
- package/src/assets/css/layout-content.scss +1 -0
- package/src/{components/PageHeader/style.scss → assets/css/page-header.scss} +22 -7
- package/src/assets/css/page.scss +12 -0
- package/src/assets/css/pagination.scss +76 -17
- package/src/assets/css/rootvar.scss +1 -0
- package/src/assets/css/secondary-tab.scss +60 -43
- package/src/assets/css/table.scss +165 -19
- package/src/assets/css/tabs.scss +68 -0
- package/src/components/FileUploadTable/FileUploadTableV3.vue +2 -2
- package/src/components/FileUploadTable/aiCheckDialog.vue +2 -2
- package/src/components/PageHeader/index.vue +11 -6
- package/src/components/PageLayout/page.vue +15 -3
- package/src/components/Pagination/index.vue +7 -4
- package/src/components/Pagination/main.vue +113 -0
- package/src/components/SecondaryTab/index.vue +45 -34
- package/src/components/ShowColumn/index.vue +14 -4
- package/src/components/TableOperate/index.vue +124 -0
- package/src/components/TablePro/index.vue +185 -97
- package/src/components/TableSetSize/index.vue +3 -3
- package/src/components/TableSetSize/index1.vue +82 -0
- package/src/components/Tabs/index.vue +64 -0
- package/src/index.js +4 -1
- package/src/utils/asciiWidth.js +1 -1
- package/src/utils/axios.js +1 -1
- package/style/index.css +1 -1
- package/theme/blue.css +1 -1
- package/theme/cctcRed.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
- package/src/components/TableSetSize/index copy.vue +0 -69
- package/src/components/TableSetSize/style.scss +0 -81
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="n20-page-header">
|
|
3
|
-
<div
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
<
|
|
3
|
+
<div class="n20-page-header__wappr">
|
|
4
|
+
<div v-if="!disable" class="page-header__left" @click="$emit('back')">
|
|
5
|
+
<i :class="icon"></i>
|
|
6
|
+
<div class="page-header__title">
|
|
7
|
+
<slot name="title">{{ title }}</slot>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="page-header__content">
|
|
11
|
+
<slot name="content">{{ content }}</slot>
|
|
7
12
|
</div>
|
|
8
13
|
</div>
|
|
9
|
-
<div
|
|
10
|
-
<slot
|
|
14
|
+
<div>
|
|
15
|
+
<slot></slot>
|
|
11
16
|
</div>
|
|
12
17
|
</div>
|
|
13
18
|
</template>
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex-column">
|
|
3
3
|
<slot name="header"></slot>
|
|
4
|
-
<div class="n20-page-content flex-item">
|
|
4
|
+
<div class="n20-page-content flex-item" :class="{ is_padding: padding }">
|
|
5
5
|
<slot></slot>
|
|
6
6
|
</div>
|
|
7
|
-
<
|
|
7
|
+
<div class="n20-page-content__footer" :class="{ 'n20-page-content__footer--max__padding': maxPadding }">
|
|
8
|
+
<slot name="footer"></slot>
|
|
9
|
+
</div>
|
|
8
10
|
</div>
|
|
9
11
|
</template>
|
|
10
12
|
|
|
11
13
|
<script>
|
|
12
14
|
import { $lc } from '../../utils/i18n/index'
|
|
13
15
|
export default {
|
|
14
|
-
name: 'Page'
|
|
16
|
+
name: 'Page',
|
|
17
|
+
props: {
|
|
18
|
+
padding: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
maxPadding: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
15
27
|
}
|
|
16
28
|
</script>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import RemotePagination from './remotePagination.vue'
|
|
3
|
-
import
|
|
3
|
+
import Pagination from './main.vue'
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
name: 'Pagination',
|
|
7
7
|
components: {
|
|
8
8
|
RemotePagination,
|
|
9
|
-
|
|
9
|
+
Pagination
|
|
10
10
|
},
|
|
11
11
|
props: {
|
|
12
12
|
size: {
|
|
@@ -58,8 +58,11 @@ export default {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
})
|
|
61
|
-
: h(
|
|
62
|
-
props:
|
|
61
|
+
: h(Pagination, {
|
|
62
|
+
props: {
|
|
63
|
+
...this.$props,
|
|
64
|
+
static: true
|
|
65
|
+
},
|
|
63
66
|
on: {
|
|
64
67
|
change: (page) => this.$emit('change', page)
|
|
65
68
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="n20-pagination-1">
|
|
3
|
+
<el-pagination
|
|
4
|
+
layout="total,prev,pager,next,sizes"
|
|
5
|
+
:current-page="pageObj[pageKey.no]"
|
|
6
|
+
:page-size="pageObj[pageKey.size]"
|
|
7
|
+
:page-sizes="pageSizes"
|
|
8
|
+
:total="pageObj[pageKey.total]"
|
|
9
|
+
:size="size"
|
|
10
|
+
@prev-click="handlePageChange"
|
|
11
|
+
@next-click="handlePageChange"
|
|
12
|
+
@current-change="handlePageChange"
|
|
13
|
+
@size-change="handleSizeChange"
|
|
14
|
+
/>
|
|
15
|
+
<span class="m-l-s">{{ '前往' | $lc }}</span>
|
|
16
|
+
<el-input-number
|
|
17
|
+
v-model="toNo"
|
|
18
|
+
class="n20-pagination-jumper-1"
|
|
19
|
+
:min="1"
|
|
20
|
+
:max="max"
|
|
21
|
+
:step="1"
|
|
22
|
+
:step-strictly="true"
|
|
23
|
+
:controls="false"
|
|
24
|
+
:size="size"
|
|
25
|
+
@change="setnoOrsize"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import { $lc } from '../../utils/i18n/index'
|
|
32
|
+
export default {
|
|
33
|
+
name: 'Pagination',
|
|
34
|
+
props: {
|
|
35
|
+
size: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'mini'
|
|
38
|
+
},
|
|
39
|
+
pageObj: {
|
|
40
|
+
type: Object,
|
|
41
|
+
default: () => ({
|
|
42
|
+
no: 1,
|
|
43
|
+
size: 20,
|
|
44
|
+
total: 0
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
pageKey: {
|
|
48
|
+
type: Object,
|
|
49
|
+
default: () => ({
|
|
50
|
+
no: 'no',
|
|
51
|
+
size: 'size',
|
|
52
|
+
total: 'total'
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
pageSizes: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default: () => [20, 50, 100]
|
|
58
|
+
},
|
|
59
|
+
sizeMax: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 1000
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
settingV: false,
|
|
67
|
+
noOrsize: ''
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
max() {
|
|
72
|
+
let total = this.pageObj[this.pageKey.total]
|
|
73
|
+
let size = this.pageObj[this.pageKey.size]
|
|
74
|
+
|
|
75
|
+
return Math.ceil(total / size) || 1
|
|
76
|
+
},
|
|
77
|
+
toNo: {
|
|
78
|
+
get() {
|
|
79
|
+
return this.pageObj[this.pageKey.no]
|
|
80
|
+
},
|
|
81
|
+
set(val) {
|
|
82
|
+
if (val) {
|
|
83
|
+
this.pageObj[this.pageKey.no] = Math.ceil(val)
|
|
84
|
+
} else {
|
|
85
|
+
this.pageObj[this.pageKey.no] = 1
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
watch: {
|
|
91
|
+
noOrsize() {
|
|
92
|
+
this.$emit('change', { ...this.pageObj })
|
|
93
|
+
this.$emit('update:pageObj', { ...this.pageObj })
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
handlePageChange(val) {
|
|
98
|
+
this.$set(this.pageObj, this.pageKey.no, val)
|
|
99
|
+
this.setnoOrsize()
|
|
100
|
+
},
|
|
101
|
+
handleSizeChange(val) {
|
|
102
|
+
this.$set(this.pageObj, this.pageKey.size, val)
|
|
103
|
+
this.$set(this.pageObj, this.pageKey.no, 1)
|
|
104
|
+
this.setnoOrsize()
|
|
105
|
+
},
|
|
106
|
+
setnoOrsize() {
|
|
107
|
+
let no = this.pageObj[this.pageKey.no]
|
|
108
|
+
let size = this.pageObj[this.pageKey.size]
|
|
109
|
+
this.noOrsize = no + ',' + size + Date.now()
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<div class="
|
|
4
|
-
|
|
5
|
-
<div v-else-if="data.length === 1" class="n20-secondary-tab m-b-s">
|
|
6
|
-
<div class="el-tabs__item is-active">
|
|
7
|
-
<span v-if="data[0].icon" :class="data[0].icon"></span>
|
|
8
|
-
<sup v-if="data[0].badge" class="el-tabs__item-badge"></sup>
|
|
9
|
-
{{ data[0].name }}
|
|
2
|
+
<div class="n20-secondary-tab__wrapper">
|
|
3
|
+
<div v-if="data.length === 0" class="n20-secondary-tab m-b-s">
|
|
4
|
+
<div class="el-tabs__item is-active">{{ init }}</div>
|
|
10
5
|
</div>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
<div v-else-if="data.length === 1" class="n20-secondary-tab m-b-s">
|
|
7
|
+
<div class="el-tabs__item is-active">
|
|
8
|
+
<span v-if="data[0].icon" :class="data[0].icon"></span>
|
|
9
|
+
<sup v-if="data[0].badge" class="el-tabs__item-badge"></sup>
|
|
10
|
+
{{ data[0].name }}
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<el-tabs
|
|
14
|
+
v-else
|
|
15
|
+
:value="init"
|
|
16
|
+
:class="classes"
|
|
17
|
+
:tabPosition="tabPosition"
|
|
18
|
+
:before-leave="beforeFn"
|
|
19
|
+
@tab-click="clickFn"
|
|
20
20
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
<el-tab-pane
|
|
22
|
+
v-for="item of data"
|
|
23
|
+
:key="item.name"
|
|
24
|
+
:tab-info="item"
|
|
25
|
+
:name="item.name"
|
|
26
|
+
:icon="item.icon"
|
|
27
|
+
:disabled="item.disabled"
|
|
28
|
+
>
|
|
29
|
+
<template slot="label">
|
|
30
|
+
<span v-if="item.icon" :class="item.icon"></span>
|
|
31
|
+
<sup v-if="item.badge" class="el-tabs__item-badge"></sup>
|
|
32
|
+
<span v-if="item.content" v-title="`${item.content}`"> {{ item.name }}</span>
|
|
33
|
+
<span v-else>{{ item.name }}</span>
|
|
34
|
+
</template>
|
|
35
|
+
</el-tab-pane>
|
|
36
|
+
</el-tabs>
|
|
37
|
+
<div class="n20-secondary-tab__right">
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
29
41
|
</template>
|
|
30
42
|
|
|
31
43
|
<script>
|
|
@@ -51,10 +63,9 @@ export default {
|
|
|
51
63
|
}
|
|
52
64
|
},
|
|
53
65
|
computed: {
|
|
54
|
-
classes(){
|
|
66
|
+
classes() {
|
|
55
67
|
return {
|
|
56
68
|
'n20-secondary-tab': true,
|
|
57
|
-
'm-b-s': this.tabPosition == 'top',
|
|
58
69
|
'left-css': this.tabPosition == 'left'
|
|
59
70
|
}
|
|
60
71
|
}
|
|
@@ -106,17 +117,17 @@ export default {
|
|
|
106
117
|
.tooltip.show {
|
|
107
118
|
opacity: 1;
|
|
108
119
|
}
|
|
109
|
-
.left-css .el-tabs__item.is-active:after{
|
|
120
|
+
.left-css .el-tabs__item.is-active:after {
|
|
110
121
|
width: 2px;
|
|
111
|
-
height: 20px!important;
|
|
112
|
-
margin-top: -22px!important;
|
|
122
|
+
height: 20px !important;
|
|
123
|
+
margin-top: -22px !important;
|
|
113
124
|
margin-left: -10px;
|
|
114
125
|
}
|
|
115
126
|
.left-css .el-tabs__item.is-left {
|
|
116
|
-
text-align: left!important;
|
|
127
|
+
text-align: left !important;
|
|
117
128
|
}
|
|
118
|
-
.left-css .el-tabs__header.is-left{
|
|
119
|
-
margin-right: 0!important;
|
|
120
|
-
margin-left: 10px!important;
|
|
129
|
+
.left-css .el-tabs__header.is-left {
|
|
130
|
+
margin-right: 0 !important;
|
|
131
|
+
margin-left: 10px !important;
|
|
121
132
|
}
|
|
122
133
|
</style>
|
|
@@ -641,19 +641,29 @@ export default {
|
|
|
641
641
|
function saveTransform(list, labelKey, isFilter) {
|
|
642
642
|
let listN = []
|
|
643
643
|
if (!isFilter) {
|
|
644
|
+
// 遍历列配置列表,将每列转换为存储格式
|
|
644
645
|
list.forEach((c) => {
|
|
646
|
+
// 普通列:有prop属性、无子列、非新增列、无宽度设置
|
|
645
647
|
if (c.prop && !c.children && !c.isNew && !c.width & !c.isNew) {
|
|
646
648
|
listN.push({ _colKey: 'prop', _colVal: c.prop })
|
|
647
|
-
}
|
|
649
|
+
}
|
|
650
|
+
// 特殊类型列:多选/序号/展开列
|
|
651
|
+
else if (c.type && ['selection', 'index', 'expand'].includes(c.type)) {
|
|
648
652
|
listN.push({ _colKey: 'type', _colVal: c.type })
|
|
649
|
-
}
|
|
653
|
+
}
|
|
654
|
+
// 其他列:包含函数或需要完整保留的列
|
|
655
|
+
else {
|
|
650
656
|
let sFn = false
|
|
657
|
+
// 检查列配置中是否包含函数类型的属性
|
|
651
658
|
for (let k in c) {
|
|
652
659
|
if (typeof c[k] === 'function') sFn = true
|
|
653
660
|
}
|
|
661
|
+
// 包含函数且有标签的列,使用标签作为标识存储
|
|
654
662
|
if (sFn && c[labelKey]) {
|
|
655
|
-
listN.push({ _colKey: labelKey, _colVal: c[labelKey] })
|
|
656
|
-
}
|
|
663
|
+
listN.push({ _colKey: labelKey, _colVal: c[labelKey], ...c })
|
|
664
|
+
}
|
|
665
|
+
// 其他情况直接存储完整列配置
|
|
666
|
+
else {
|
|
657
667
|
listN.push(c)
|
|
658
668
|
}
|
|
659
669
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="el-table-set-size flex-box" :style="{ '--hover-width': hoverWidth }">
|
|
3
|
+
<div v-if="showColumn" class="el-table-set-size-item m-r-0">
|
|
4
|
+
<i
|
|
5
|
+
v-title="$lc('设置显示列')"
|
|
6
|
+
class="v3-icon-system-solution pointer color-white"
|
|
7
|
+
:class="hoverIconKey === 'showColumn' ? 'color-white' : ''"
|
|
8
|
+
@mouseenter="hoverIconKey = 'showColumn'"
|
|
9
|
+
@mouseleave="hoverIconKey = null"
|
|
10
|
+
@click="$emit('visible-column')"
|
|
11
|
+
></i>
|
|
12
|
+
</div>
|
|
13
|
+
<div v-if="showSetsize" class="el-table-set-size-item m-r-0">
|
|
14
|
+
<el-dropdown @command="setSize">
|
|
15
|
+
<i
|
|
16
|
+
v-title="$lc('行高')"
|
|
17
|
+
class="v3-icon-line-height pointer color-white"
|
|
18
|
+
:class="hoverIconKey === 'height' ? 'color-white' : ''"
|
|
19
|
+
@mouseenter="hoverIconKey = 'height'"
|
|
20
|
+
@mouseleave="hoverIconKey = null"
|
|
21
|
+
></i>
|
|
22
|
+
<el-dropdown-menu slot="dropdown">
|
|
23
|
+
<el-dropdown-item command="small">{{ _lang === 'zh' ? '默认' : 'small' }}</el-dropdown-item>
|
|
24
|
+
<el-dropdown-item command="mini">{{ _lang === 'zh' ? '紧凑' : 'mini' }}</el-dropdown-item>
|
|
25
|
+
</el-dropdown-menu>
|
|
26
|
+
</el-dropdown>
|
|
27
|
+
</div>
|
|
28
|
+
<div v-if="hasExpand" class="el-table-set-size-item m-r-0">
|
|
29
|
+
<i
|
|
30
|
+
v-title="!isExpand ? $lc('展开分组') : $lc('折叠分组')"
|
|
31
|
+
class="pointer"
|
|
32
|
+
:class="[
|
|
33
|
+
isExpand ? 'v3-icon-group-collapse' : 'v3-icon-group-expand',
|
|
34
|
+
hoverIconKey === 'toggleExpand' ? 'color-white' : ''
|
|
35
|
+
]"
|
|
36
|
+
@mouseenter="hoverIconKey = 'toggleExpand'"
|
|
37
|
+
@mouseleave="hoverIconKey = null"
|
|
38
|
+
@click="$emit('toggle-expand')"
|
|
39
|
+
></i>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script>
|
|
45
|
+
export default {
|
|
46
|
+
name: 'TableOperate',
|
|
47
|
+
props: {
|
|
48
|
+
showColumn: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
showSetsize: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
size: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'small'
|
|
59
|
+
},
|
|
60
|
+
mini: {
|
|
61
|
+
type: Object,
|
|
62
|
+
default: () => ({
|
|
63
|
+
border: false,
|
|
64
|
+
size: 'mini',
|
|
65
|
+
stripe: true
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
small: {
|
|
69
|
+
type: Object,
|
|
70
|
+
default: () => ({
|
|
71
|
+
border: false,
|
|
72
|
+
size: 'small',
|
|
73
|
+
stripe: false
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
// 是否显示展开/折叠按钮(配置了 treeConfig 才显示)
|
|
79
|
+
hasExpand() {
|
|
80
|
+
return !!(this.$attrs.treeConfig || this.$attrs['tree-config'])
|
|
81
|
+
},
|
|
82
|
+
// 当前可见操作项数量
|
|
83
|
+
activeItemCount() {
|
|
84
|
+
return [this.showColumn, this.showSetsize, this.hasExpand].filter(Boolean).length
|
|
85
|
+
},
|
|
86
|
+
// 根据可见项数动态计算宽度
|
|
87
|
+
hoverWidth() {
|
|
88
|
+
const widthMap = { 3: '112px', 2: '88px', 1: '40px', 0: '0px' }
|
|
89
|
+
return widthMap[this.activeItemCount] || '0px'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
data() {
|
|
93
|
+
let _this = this
|
|
94
|
+
return {
|
|
95
|
+
isExpand: false,
|
|
96
|
+
hoverIconKey: null, // 当前悬停的静态列头图标标识
|
|
97
|
+
sizeC: localStorage.getItem('table-size') || _this.size
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
watch: {
|
|
101
|
+
size() {
|
|
102
|
+
this.setSize(localStorage.getItem('table-size') || this.size, 'pasv')
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
created() {
|
|
106
|
+
this.setSize(localStorage.getItem('table-size') || this.size, 'pasv')
|
|
107
|
+
},
|
|
108
|
+
methods: {
|
|
109
|
+
setSize(type, t) {
|
|
110
|
+
this.sizeC = type
|
|
111
|
+
localStorage.setItem('table-size', type)
|
|
112
|
+
if (type === 'mini') {
|
|
113
|
+
this.$emit('resize', this.mini)
|
|
114
|
+
} else if (type === 'small') {
|
|
115
|
+
this.$emit('resize', this.small)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (t !== 'pasv') {
|
|
119
|
+
this.$emit('update:size', localStorage.getItem('table-size') || type)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</script>
|