t20-common-lib 0.7.5 → 0.7.7
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "t20-common-lib",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"description": "T20",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,22 +30,33 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"core-js": "^2.6.12",
|
|
32
32
|
"element-ui": "^2.15.13",
|
|
33
|
+
"n20-common-lib": "^2.16.24",
|
|
33
34
|
"normalize.css": "^8.0.1",
|
|
34
35
|
"vue": "^2.6.14",
|
|
35
|
-
"vue-server-renderer": "^2.6.14"
|
|
36
|
+
"vue-server-renderer": "^2.6.14",
|
|
37
|
+
"vxe-table": "^3.6.17"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
40
|
+
"@babel/core": "^7.28.4",
|
|
41
|
+
"@babel/preset-env": "^7.28.3",
|
|
42
|
+
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
|
|
43
|
+
"@vue/babel-preset-jsx": "^1.4.0",
|
|
38
44
|
"@vue/cli-plugin-babel": "~4.5.19",
|
|
39
45
|
"@vue/cli-plugin-eslint": "~4.5.19",
|
|
40
46
|
"@vue/cli-service": "~4.5.19",
|
|
41
47
|
"@vue/component-compiler-utils": "^3.3.0",
|
|
42
48
|
"babel-eslint": "^10.1.0",
|
|
49
|
+
"babel-loader": "^10.0.0",
|
|
43
50
|
"babel-plugin-component": "^1.1.1",
|
|
51
|
+
"browserify-fs": "^1.0.0",
|
|
44
52
|
"cross-env": "^7.0.3",
|
|
45
53
|
"eslint": "^6.7.2",
|
|
46
54
|
"eslint-plugin-vue": "^6.2.2",
|
|
47
55
|
"node-sass": "^4.14.1",
|
|
56
|
+
"os-browserify": "^0.3.0",
|
|
57
|
+
"path-browserify": "^1.0.1",
|
|
48
58
|
"postcss-loader": "^3.0.0",
|
|
59
|
+
"process": "^0.11.10",
|
|
49
60
|
"rimraf": "^3.0.2",
|
|
50
61
|
"sass-loader": "^8.0.2",
|
|
51
62
|
"vue-template-compiler": "^2.6.14",
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="collapse" :class="{ 'm-b-s': !_isCollapse }">
|
|
3
|
+
<el-collapse-transition v-if="$slots.default && showCard">
|
|
4
|
+
<div class="collapse-content" v-show="!_isCollapse">
|
|
5
|
+
<slot />
|
|
6
|
+
</div>
|
|
7
|
+
</el-collapse-transition>
|
|
8
|
+
<div class="collapse-slot">
|
|
9
|
+
<el-button v-if="showCard" class="rotate90" :icon="_isCollapse? 'el-icon-d-arrow-right': 'el-icon-d-arrow-left'" plain onlyicon size="mini" @click="handleToggle"/>
|
|
10
|
+
<el-button icon="el-icon-setting" plain onlyicon size="mini" @click="toSettings" />
|
|
11
|
+
<slot name="action" />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'CommonCollapse',
|
|
19
|
+
props: {
|
|
20
|
+
permission: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ''
|
|
23
|
+
},
|
|
24
|
+
value: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
showCard: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
isCollapse: false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
hasUsedVModel() {
|
|
40
|
+
return 'value' in this.$options.propsData
|
|
41
|
+
},
|
|
42
|
+
_isCollapse: {
|
|
43
|
+
get() {
|
|
44
|
+
return this.hasUsedVModel ? this.value : this.isCollapse
|
|
45
|
+
},
|
|
46
|
+
set(val) {
|
|
47
|
+
if (this.hasUsedVModel) {
|
|
48
|
+
this.$emit('input', val)
|
|
49
|
+
} else {
|
|
50
|
+
this.isCollapse = val
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
toSettings() {
|
|
57
|
+
this.$emit('toSettings')
|
|
58
|
+
},
|
|
59
|
+
// 切换 显示/隐藏
|
|
60
|
+
handleToggle() {
|
|
61
|
+
this._isCollapse = !this._isCollapse
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style lang="scss" scoped>
|
|
68
|
+
.collapse {
|
|
69
|
+
position: relative;
|
|
70
|
+
&-slot {
|
|
71
|
+
z-index: 99999;
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: -28px;
|
|
74
|
+
right: 0;
|
|
75
|
+
height: 24px;
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: space-around;
|
|
78
|
+
align-items: center;
|
|
79
|
+
.el-icon {
|
|
80
|
+
color: var(--color-text-regular);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
font-weight: bold;
|
|
83
|
+
font-size: 18px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
88
|
+
|
|
89
|
+
<style lang="scss">
|
|
90
|
+
$--button-margin-left: 6px;
|
|
91
|
+
|
|
92
|
+
.el-button--primary,
|
|
93
|
+
.el-button--default,
|
|
94
|
+
.el-button--default.is-plain,
|
|
95
|
+
.el-button--warning.is-plain,
|
|
96
|
+
.el-button--danger.is-plain {
|
|
97
|
+
min-width: 72px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.el-dropdown__caret-button,
|
|
101
|
+
.el-button[onlyicon] {
|
|
102
|
+
min-width: auto;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.el-button.button-4em {
|
|
106
|
+
min-width: 72px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.el-button+.el-button {
|
|
110
|
+
margin-left: $--button-margin-left;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.el-button+.el-dropdown {
|
|
114
|
+
margin-left: $--button-margin-left;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.el-button--mini+.el-button--mini {
|
|
118
|
+
margin-left: $--button-margin-left;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.el-button[onlyicon] {
|
|
122
|
+
|
|
123
|
+
&.el-button--default,
|
|
124
|
+
&.el-button--medium,
|
|
125
|
+
&.el-button--small {
|
|
126
|
+
padding: 8px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.el-button--mini {
|
|
130
|
+
padding: 5px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.el-button--info {
|
|
135
|
+
|
|
136
|
+
&,
|
|
137
|
+
&:focus {
|
|
138
|
+
background-color: var(--color-info);
|
|
139
|
+
border-color: var(--color-info);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&:hover {
|
|
143
|
+
background: var(--color-info-hover);
|
|
144
|
+
border-color: var(--color-info-hover);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex-column">
|
|
2
|
+
<div class="flex-column" :class="$slots.header ? 'main-page' : ''">
|
|
3
3
|
<div v-if="$slots.header" class="header">
|
|
4
4
|
<slot name="header"></slot>
|
|
5
5
|
</div>
|
|
@@ -40,4 +40,9 @@ export default {
|
|
|
40
40
|
height: 32px;
|
|
41
41
|
line-height: 32px;
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
.main-page {
|
|
45
|
+
padding: 0 !important;
|
|
46
|
+
background: #f0f2f5;
|
|
47
|
+
}
|
|
43
48
|
</style>
|
|
@@ -125,4 +125,62 @@ export default {
|
|
|
125
125
|
margin-right: 0!important;
|
|
126
126
|
margin-left: 10px!important;
|
|
127
127
|
}
|
|
128
|
+
|
|
128
129
|
</style>
|
|
130
|
+
|
|
131
|
+
<style lang="scss">
|
|
132
|
+
|
|
133
|
+
.n20-secondary-tab {
|
|
134
|
+
.el-tabs__header {
|
|
135
|
+
margin-bottom: 0;
|
|
136
|
+
}
|
|
137
|
+
.el-tabs__nav-wrap::after {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
140
|
+
.el-tabs__item {
|
|
141
|
+
font-weight: 400;
|
|
142
|
+
height: 27px;
|
|
143
|
+
line-height: 26px;
|
|
144
|
+
padding: 0 10px;
|
|
145
|
+
&.is-active {
|
|
146
|
+
font-weight: 500;
|
|
147
|
+
&::after {
|
|
148
|
+
content: '';
|
|
149
|
+
height: 2px;
|
|
150
|
+
background-color: #007aff;
|
|
151
|
+
display: block;
|
|
152
|
+
margin-top: -1px;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
&.is-disabled {
|
|
156
|
+
cursor: no-drop;
|
|
157
|
+
&::after {
|
|
158
|
+
background-color: #cccccc;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.el-tabs__item-badge {
|
|
164
|
+
width: 6px;
|
|
165
|
+
height: 6px;
|
|
166
|
+
background: var(--color-danger);
|
|
167
|
+
position: absolute;
|
|
168
|
+
right: 6px;
|
|
169
|
+
top: 2px;
|
|
170
|
+
border-radius: 3px;
|
|
171
|
+
}
|
|
172
|
+
.el-tabs__item.is-top:last-child {
|
|
173
|
+
.el-tabs__item-badge {
|
|
174
|
+
right: -4px;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
.el-tabs__active-bar {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.el-tabs__nav-prev,
|
|
182
|
+
.el-tabs__nav-next {
|
|
183
|
+
line-height: 28px;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</style>
|
package/src/index.js
CHANGED
|
@@ -7,13 +7,15 @@ import MainPage from '../packages/main-page/index.js'
|
|
|
7
7
|
import TablePage from '../packages/table-page/index.js'
|
|
8
8
|
import TabPane from '../packages/tab-pane/index.js'
|
|
9
9
|
import StatisCard from '../packages/statis-card/index.js'
|
|
10
|
+
import CommonCollapse from '../packages/common-collapse/index.js'
|
|
10
11
|
|
|
11
12
|
// 存储组件列表
|
|
12
13
|
const components = [
|
|
13
14
|
MainPage,
|
|
14
15
|
TablePage,
|
|
15
16
|
TabPane,
|
|
16
|
-
StatisCard
|
|
17
|
+
StatisCard,
|
|
18
|
+
CommonCollapse
|
|
17
19
|
]
|
|
18
20
|
|
|
19
21
|
// 定义 install 方法,接收 Vue 作为参数
|
|
@@ -45,6 +47,7 @@ export {
|
|
|
45
47
|
MainPage,
|
|
46
48
|
TablePage,
|
|
47
49
|
StatisCard,
|
|
50
|
+
CommonCollapse,
|
|
48
51
|
TabPane,
|
|
49
52
|
repairEl,
|
|
50
53
|
getColumnWidth,
|