n20-common-lib 1.2.5 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,6 +1,7 @@
1
- $--s: 1366px - 160px;
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 200 {
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,15 +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;
111
115
  }
112
116
 
113
- .w-224-max {
114
- max-width: 224px;
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
+ }
115
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
+ }
116
182
 
117
- .w-786-max {
118
- max-width: 786px;
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
+ }
119
234
  }
120
235
 
121
236
  .el-input,
@@ -4,7 +4,7 @@ $--border-radius-base: 4px !default;
4
4
  $--input-width: 224px !default;
5
5
 
6
6
  // 项目中可以直接使用
7
- // .w-224 {width: $--input-width;}
7
+ // .input-w {width: $--input-width;}
8
8
  // .button-4em{min-width: 72px;}
9
9
  /* 格式化样式
10
10
  ---------------- */
@@ -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
  }
@@ -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.00[00]')
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-224" />
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-224">
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-224"
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-224" />
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-224 flex-box">
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>
@@ -4,7 +4,7 @@ $--border-radius-base: 4px !default;
4
4
  $--input-width: 224px !default;
5
5
 
6
6
  // 项目中可以直接使用
7
- // .w-224 {width: $--input-width;}
7
+ // .input-w {width: $--input-width;}
8
8
  // .button-4em{min-width: 72px;}
9
9
  /* 格式化样式
10
10
  ---------------- */