n20-common-lib 1.2.3 → 1.2.6
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 +2 -26
- package/package.json +1 -1
- package/src/assets/css/cl-expandable-pane.scss +0 -1
- package/src/assets/css/cl-expandable.scss +0 -1
- package/src/assets/css/cl-form-item.scss +126 -3
- package/src/assets/css/normalize.scss +1 -1
- package/src/components/Filters/index.vue +6 -0
- package/src/components/SelectTree/index.vue +2 -5
- package/src/components/Table/index.vue +10 -1
- package/src/plugins/SetMenuTree/setmenutree.vue +5 -5
- package/style/css/normalize.scss +1 -1
- package/style/index.css +2 -2
- package/style/index.css.map +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# n20-common-lib
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
```
|
|
5
|
-
npm install
|
|
6
|
-
```
|
|
7
|
-
|
|
8
|
-
### Compiles and hot-reloads for development
|
|
9
|
-
```
|
|
10
|
-
npm run serve
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Compiles and minifies for production
|
|
14
|
-
```
|
|
15
|
-
npm run build
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Lints and
|
|
19
|
-
|
|
20
|
-
### Customize configuration
|
|
21
|
-
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
22
|
-
|
|
23
|
-
[element-ui](/node_modules/element-ui/src)
|
|
24
|
-
|
|
25
|
-
[element-ui/packages](/node_modules/element-ui/packages)
|
|
26
|
-
|
|
27
|
-
[element-ui/lib](/node_modules/element-ui/lib)
|
|
3
|
+
## nstc web pc
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
$--s:
|
|
1
|
+
$--s: 1024px;
|
|
2
2
|
$--m: 1366px + 160px;
|
|
3
3
|
$--l: 1920px;
|
|
4
|
+
$--input-max: 304px;
|
|
4
5
|
|
|
5
6
|
.el-form-item[span],
|
|
6
7
|
.el-form-item[span-s],
|
|
@@ -52,7 +53,7 @@ $--l: 1920px;
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
@for $i from 1 through
|
|
56
|
+
@for $i from 1 through 20 {
|
|
56
57
|
.el-form[gutter='#{$i}0'] {
|
|
57
58
|
margin-left: $i * -5px;
|
|
58
59
|
margin-right: $i * -5px;
|
|
@@ -107,7 +108,129 @@ $--l: 1920px;
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
.w-224 {
|
|
110
|
-
width: $--input-width;
|
|
111
|
+
width: $--input-width !important;
|
|
112
|
+
}
|
|
113
|
+
.input-w {
|
|
114
|
+
width: $--input-width !important;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.el-form.label-width-6em {
|
|
118
|
+
margin-left: 96px;
|
|
119
|
+
margin-right: 14px;
|
|
120
|
+
.n20-title {
|
|
121
|
+
margin-left: -96px;
|
|
122
|
+
margin-right: -14px;
|
|
123
|
+
}
|
|
124
|
+
.el-form-item.col-span-24 {
|
|
125
|
+
@media only screen and (min-width: ($--l + 1px)) {
|
|
126
|
+
.el-textarea {
|
|
127
|
+
max-width: calc(25% + 1.5em + #{$--input-max});
|
|
128
|
+
width: calc(50% - 3em);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media only screen and (max-width: $--l) {
|
|
133
|
+
.el-textarea {
|
|
134
|
+
max-width: calc(33.33% + 2em + #{$--input-max});
|
|
135
|
+
width: calc(66.66% - 2em);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@media only screen and (max-width: $--m) {
|
|
140
|
+
.el-textarea {
|
|
141
|
+
max-width: calc(50% + 3em + #{$--input-max});
|
|
142
|
+
width: 100%;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@media only screen and (max-width: $--s) {
|
|
147
|
+
.el-form-item {
|
|
148
|
+
max-width: none;
|
|
149
|
+
width: 100%;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
.el-form.label-width-10em {
|
|
155
|
+
margin-left: 40px;
|
|
156
|
+
margin-right: 70px;
|
|
157
|
+
.n20-title {
|
|
158
|
+
margin-left: -40px;
|
|
159
|
+
margin-right: -70px;
|
|
160
|
+
}
|
|
161
|
+
.el-form-item.col-span-24 {
|
|
162
|
+
@media only screen and (min-width: ($--l + 1px)) {
|
|
163
|
+
.el-textarea {
|
|
164
|
+
max-width: calc(25% + 2.5em + #{$--input-max});
|
|
165
|
+
width: calc(50% - 5em);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@media only screen and (max-width: $--l) {
|
|
170
|
+
.el-textarea {
|
|
171
|
+
max-width: calc(33.33% + 3.33em + #{$--input-max});
|
|
172
|
+
width: calc(66.66% - 3.33em);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@media only screen and (max-width: $--m) {
|
|
177
|
+
.el-textarea {
|
|
178
|
+
max-width: calc(50% + 5em + #{$--input-max});
|
|
179
|
+
width: 100%;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@media only screen and (max-width: $--s) {
|
|
184
|
+
.el-form-item {
|
|
185
|
+
max-width: none;
|
|
186
|
+
width: 100%;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
.el-form.label-width-6em,
|
|
192
|
+
.label-width-10em {
|
|
193
|
+
.el-form-item {
|
|
194
|
+
width: 50%;
|
|
195
|
+
display: inline-block;
|
|
196
|
+
box-sizing: border-box;
|
|
197
|
+
margin-right: 0;
|
|
198
|
+
}
|
|
199
|
+
@media only screen and (min-width: ($--s + 1px)) {
|
|
200
|
+
.el-form-item__content {
|
|
201
|
+
max-width: $--input-max;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
.el-form-item.col-span-24 {
|
|
205
|
+
width: 100%;
|
|
206
|
+
.el-form-item__content {
|
|
207
|
+
max-width: none;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@media only screen and (min-width: ($--l + 1px)) {
|
|
212
|
+
.el-form-item {
|
|
213
|
+
width: 25%;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@media only screen and (max-width: $--l) {
|
|
218
|
+
.el-form-item {
|
|
219
|
+
width: 33.33%;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@media only screen and (max-width: $--m) {
|
|
224
|
+
.el-form-item {
|
|
225
|
+
width: 50%;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@media only screen and (max-width: $--s) {
|
|
230
|
+
.el-form-item {
|
|
231
|
+
width: 100%;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
111
234
|
}
|
|
112
235
|
|
|
113
236
|
.el-input,
|
|
@@ -357,6 +357,12 @@ export default {
|
|
|
357
357
|
if (elPoppers.length <= 1) {
|
|
358
358
|
this.showPop = false
|
|
359
359
|
}
|
|
360
|
+
},
|
|
361
|
+
setOptions(key, opts) {
|
|
362
|
+
let item = this.filterList.find((f) => f.value === key)
|
|
363
|
+
if (item) {
|
|
364
|
+
item.options = opts || []
|
|
365
|
+
}
|
|
360
366
|
}
|
|
361
367
|
}
|
|
362
368
|
}
|
|
@@ -130,21 +130,18 @@ export default {
|
|
|
130
130
|
if (!val && !this.multiple) {
|
|
131
131
|
this.wCdList = []
|
|
132
132
|
this.$refs['tree']?.setCurrentKey(null)
|
|
133
|
-
this.$emit('change', val, undefined)
|
|
134
133
|
return
|
|
135
134
|
}
|
|
136
135
|
if (!this.multiple) {
|
|
137
136
|
if (val === undefined || val === null) {
|
|
138
137
|
this.wCdList = []
|
|
139
138
|
this.$refs['tree']?.setCurrentKey(null)
|
|
140
|
-
this.$emit('change', val, undefined)
|
|
141
139
|
return
|
|
142
140
|
}
|
|
143
141
|
} else {
|
|
144
142
|
if (val.length === 0) {
|
|
145
143
|
this.wCdList = []
|
|
146
144
|
this.$refs['tree']?.setCurrentKey(null)
|
|
147
|
-
this.$emit('change', val, undefined)
|
|
148
145
|
return
|
|
149
146
|
}
|
|
150
147
|
}
|
|
@@ -156,13 +153,11 @@ export default {
|
|
|
156
153
|
let valueObj = dataList.find((d) => d[this.props.value] === val)
|
|
157
154
|
this.wCdList = valueObj ? [valueObj] : []
|
|
158
155
|
this.$refs['tree']?.setCurrentKey(val)
|
|
159
|
-
this.$emit('change', val, valueObj)
|
|
160
156
|
} else {
|
|
161
157
|
this.wCdList = dataList.filter((d) =>
|
|
162
158
|
val.includes(d[this.props.value])
|
|
163
159
|
)
|
|
164
160
|
this.$refs['tree']?.setCheckedKeys(val)
|
|
165
|
-
this.$emit('change', val, this.wCdList)
|
|
166
161
|
}
|
|
167
162
|
},
|
|
168
163
|
immediate: true
|
|
@@ -192,11 +187,13 @@ export default {
|
|
|
192
187
|
|
|
193
188
|
let vK = this.props.value
|
|
194
189
|
this.$emit('input', data[vK])
|
|
190
|
+
this.$emit('change', data[vK], data)
|
|
195
191
|
this.$refs['select'].blur()
|
|
196
192
|
}
|
|
197
193
|
},
|
|
198
194
|
checkChange(data, { checkedKeys, checkedNodes }) {
|
|
199
195
|
this.$emit('input', checkedKeys)
|
|
196
|
+
this.$emit('change', checkedKeys, checkedNodes)
|
|
200
197
|
},
|
|
201
198
|
filterNode(value, data) {
|
|
202
199
|
if (!value) return true
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
v-else
|
|
22
22
|
:key="'cl-table-' + i"
|
|
23
23
|
:formatter="item.formatter | colfF"
|
|
24
|
+
:filters="item.filters | colftF(filtersMap)"
|
|
24
25
|
v-bind="item"
|
|
25
26
|
/>
|
|
26
27
|
</template>
|
|
@@ -104,7 +105,7 @@ export default {
|
|
|
104
105
|
let mc = colf.match(/{(\S+)\|rate}/)
|
|
105
106
|
let key = mc && mc[1]
|
|
106
107
|
|
|
107
|
-
return (row) => numerify(row[key], '0.
|
|
108
|
+
return (row) => numerify(row[key], '0.000000')
|
|
108
109
|
} else {
|
|
109
110
|
let mc = colf.match(/{[^}]+}/g) || []
|
|
110
111
|
let mcv = mc.map((m) => m.replace(/{|}/g, ''))
|
|
@@ -117,6 +118,10 @@ export default {
|
|
|
117
118
|
return str
|
|
118
119
|
}
|
|
119
120
|
}
|
|
121
|
+
},
|
|
122
|
+
colftF(colft, fMap) {
|
|
123
|
+
if (typeof colft !== 'string') return colft
|
|
124
|
+
return fMap[colft]
|
|
120
125
|
}
|
|
121
126
|
},
|
|
122
127
|
props: {
|
|
@@ -133,6 +138,10 @@ export default {
|
|
|
133
138
|
require: true,
|
|
134
139
|
default: () => []
|
|
135
140
|
},
|
|
141
|
+
filtersMap: {
|
|
142
|
+
type: Object,
|
|
143
|
+
default: () => ({})
|
|
144
|
+
},
|
|
136
145
|
pageObj: {
|
|
137
146
|
type: Object,
|
|
138
147
|
default: undefined
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
{ required: true, message: '请输入名称', trigger: 'blur' }
|
|
80
80
|
]"
|
|
81
81
|
>
|
|
82
|
-
<el-input v-model="activeMenu.label" class="w
|
|
82
|
+
<el-input v-model="activeMenu.label" class="input-w" />
|
|
83
83
|
</el-form-item>
|
|
84
84
|
<el-form-item label="属性:">
|
|
85
|
-
<el-select v-model="activeMenu.resType" class="w
|
|
85
|
+
<el-select v-model="activeMenu.resType" class="input-w">
|
|
86
86
|
<el-option value="1" label="左边栏菜单" />
|
|
87
87
|
<el-option value="2" label="隐藏菜单" />
|
|
88
88
|
<el-option value="3" label="权限按钮" />
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
>
|
|
100
100
|
<el-input
|
|
101
101
|
v-model="activeMenu.appNo"
|
|
102
|
-
class="w
|
|
102
|
+
class="input-w"
|
|
103
103
|
@change="(val) => setAppNo(val, activeMenu)"
|
|
104
104
|
/>
|
|
105
105
|
</el-form-item>
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
{ required: true, message: '请输入访问路径', trigger: 'blur' }
|
|
113
113
|
]"
|
|
114
114
|
>
|
|
115
|
-
<el-input v-model="activeMenu.pageurl" class="w
|
|
115
|
+
<el-input v-model="activeMenu.pageurl" class="input-w" />
|
|
116
116
|
</el-form-item>
|
|
117
117
|
<el-form-item label="图标:">
|
|
118
118
|
<div class="flex-box">
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
</el-form-item>
|
|
152
152
|
</template>
|
|
153
153
|
<el-form-item v-if="activeMenu.treeno" label="权限编码:">
|
|
154
|
-
<div class="w
|
|
154
|
+
<div class="input-w flex-box">
|
|
155
155
|
<el-input class="flex-item" :value="activeMenu.treeno" readonly />
|
|
156
156
|
</div>
|
|
157
157
|
</el-form-item>
|
package/style/css/normalize.scss
CHANGED