n20-common-lib 2.7.0-beta.2 → 2.7.0-beta.21

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.
Files changed (101) hide show
  1. package/package.json +1 -1
  2. package/src/assets/.DS_Store +0 -0
  3. package/src/assets/css/_coreLib.scss +4 -1
  4. package/src/assets/css/advanced-filter.scss +356 -0
  5. package/src/assets/css/cl-layout-header.scss +79 -15
  6. package/src/assets/css/cl-pagination.scss +34 -4
  7. package/src/assets/css/{cl-dialog.scss → dialog.scss} +10 -7
  8. package/src/assets/css/filter.scss +1 -178
  9. package/src/assets/css/font-icon.scss +3 -8
  10. package/src/assets/css/normalize.scss +12 -1
  11. package/src/assets/getJsonc.js +2 -2
  12. package/src/assets/iconFont/demo_index.html +1950 -1129
  13. package/src/assets/iconFont/iconfont.css +182 -68
  14. package/src/assets/iconFont/iconfont.js +1 -66
  15. package/src/assets/iconFont/iconfont.json +196 -0
  16. package/src/assets/iconFont/iconfont.ttf +0 -0
  17. package/src/assets/iconFont/iconfont.woff +0 -0
  18. package/src/assets/iconFont/iconfont.woff2 +0 -0
  19. package/src/assets/realUrl.js +1 -1
  20. package/src/components/.DS_Store +0 -0
  21. package/src/components/AdvancedFilter/filterItem.vue +7 -1
  22. package/src/components/AdvancedFilter/formItemRender.vue +248 -63
  23. package/src/components/AdvancedFilter/index.vue +113 -23
  24. package/src/components/AdvancedFilter/main/Form/form-item.vue +87 -0
  25. package/src/components/AdvancedFilter/main/Form/form.vue +59 -0
  26. package/src/components/AdvancedFilter/main/index.vue +34 -0
  27. package/src/components/AdvancedFilter/utils.js +2 -4
  28. package/src/components/Anchor/AnchorItem.vue +5 -0
  29. package/src/components/Anchor/index.vue +23 -1
  30. package/src/components/ApprovalButtons/index.vue +49 -10
  31. package/src/components/ApprovalButtons/showAppOpi.vue +5 -3
  32. package/src/components/ApprovalCard/index.vue +1 -1
  33. package/src/components/DateChoose/index.vue +278 -0
  34. package/src/components/DatePicker/por.vue +1 -1
  35. package/src/components/Descriptions/index.vue +4 -0
  36. package/src/components/ElectronicArchive/index.vue +1 -0
  37. package/src/components/FileUploadTable/index.vue +93 -28
  38. package/src/components/InputNumber/index.vue +1 -0
  39. package/src/components/Layout/HeaderWrap/changePwd.vue +2 -2
  40. package/src/components/Layout/HeaderWrap/indexN.vue +151 -84
  41. package/src/components/Layout/HeaderWrap/menuDrawer.vue +47 -38
  42. package/src/components/Layout/indexN.vue +30 -5
  43. package/src/components/LoginTemporary/indexN.vue +10 -57
  44. package/src/components/Pagination/index.vue +25 -137
  45. package/src/components/Pagination/remotePagination.vue +201 -0
  46. package/src/components/Pagination/staticPagination.vue +156 -0
  47. package/src/components/SecondaryTab/index.vue +27 -1
  48. package/src/components/TablePro/index.vue +15 -8
  49. package/src/directives/VRuleKey/index.js +5 -4
  50. package/src/index.js +3 -4
  51. package/src/plugins/Print/.DS_Store +0 -0
  52. package/style/fonts/iconfont.1676b4d9.woff2 +0 -0
  53. package/{src/assets/iconFont5/iconfont.ttf → style/fonts/iconfont.2be34155.ttf} +0 -0
  54. package/style/fonts/iconfont.ac432622.woff +0 -0
  55. package/style/index.css +2 -2
  56. package/theme/blue.css +2 -2
  57. package/theme/cctcRed.css +2 -2
  58. package/theme/fonts/iconfont.1676b4d9.woff2 +0 -0
  59. package/{style/fonts/iconfont.06971f9f.ttf → theme/fonts/iconfont.2be34155.ttf} +0 -0
  60. package/theme/fonts/iconfont.ac432622.woff +0 -0
  61. package/theme/green.css +2 -2
  62. package/theme/lightBlue.css +2 -2
  63. package/theme/orange.css +2 -2
  64. package/theme/purple.css +2 -2
  65. package/theme/red.css +2 -2
  66. package/theme/yellow.css +2 -2
  67. package/src/assets/iconFont3/demo.css +0 -539
  68. package/src/assets/iconFont3/demo_index.html +0 -1936
  69. package/src/assets/iconFont3/iconfont.css +0 -319
  70. package/src/assets/iconFont3/iconfont.js +0 -1
  71. package/src/assets/iconFont3/iconfont.json +0 -541
  72. package/src/assets/iconFont3/iconfont.ttf +0 -0
  73. package/src/assets/iconFont3/iconfont.woff +0 -0
  74. package/src/assets/iconFont3/iconfont.woff2 +0 -0
  75. package/src/assets/iconFont4/demo.css +0 -539
  76. package/src/assets/iconFont4/demo_index.html +0 -2005
  77. package/src/assets/iconFont4/iconfont.css +0 -331
  78. package/src/assets/iconFont4/iconfont.js +0 -1
  79. package/src/assets/iconFont4/iconfont.json +0 -562
  80. package/src/assets/iconFont4/iconfont.ttf +0 -0
  81. package/src/assets/iconFont4/iconfont.woff +0 -0
  82. package/src/assets/iconFont4/iconfont.woff2 +0 -0
  83. package/src/assets/iconFont5/demo.css +0 -539
  84. package/src/assets/iconFont5/demo_index.html +0 -2281
  85. package/src/assets/iconFont5/iconfont.css +0 -379
  86. package/src/assets/iconFont5/iconfont.js +0 -1
  87. package/src/assets/iconFont5/iconfont.json +0 -646
  88. package/src/assets/iconFont5/iconfont.woff +0 -0
  89. package/src/assets/iconFont5/iconfont.woff2 +0 -0
  90. package/src/components/Pagination/mixins/index.js +0 -39
  91. package/style/fonts/iconfont.47f5da25.woff2 +0 -0
  92. package/style/fonts/iconfont.6ad948fe.woff +0 -0
  93. package/style/fonts/iconfont.76d19005.woff2 +0 -0
  94. package/style/fonts/iconfont.84848783.woff2 +0 -0
  95. package/style/fonts/iconfont.85c70ef9.ttf +0 -0
  96. package/style/fonts/iconfont.a3597821.woff +0 -0
  97. package/style/fonts/iconfont.ab8c366d.ttf +0 -0
  98. package/style/fonts/iconfont.b7ea4726.woff +0 -0
  99. package/style/fonts/iconfont.e6bdbf43.woff2 +0 -0
  100. package/style/fonts/iconfont.f1777a50.woff +0 -0
  101. package/style/fonts/iconfont.fbdd69b3.ttf +0 -0
@@ -5,6 +5,202 @@
5
5
  "css_prefix_text": "n20-icon-",
6
6
  "description": "",
7
7
  "glyphs": [
8
+ {
9
+ "icon_id": "39632933",
10
+ "name": "语言切换",
11
+ "font_class": "yuyanqiehuan",
12
+ "unicode": "e62f",
13
+ "unicode_decimal": 58927
14
+ },
15
+ {
16
+ "icon_id": "39546292",
17
+ "name": "arrows",
18
+ "font_class": "lujing",
19
+ "unicode": "e62e",
20
+ "unicode_decimal": 58926
21
+ },
22
+ {
23
+ "icon_id": "39545500",
24
+ "name": "menu",
25
+ "font_class": "caidan",
26
+ "unicode": "e61e",
27
+ "unicode_decimal": 58910
28
+ },
29
+ {
30
+ "icon_id": "39545088",
31
+ "name": "jtskywgk",
32
+ "font_class": "a-bianzu701",
33
+ "unicode": "e613",
34
+ "unicode_decimal": 58899
35
+ },
36
+ {
37
+ "icon_id": "39545089",
38
+ "name": "cszhyw",
39
+ "font_class": "zhcsyw",
40
+ "unicode": "e614",
41
+ "unicode_decimal": 58900
42
+ },
43
+ {
44
+ "icon_id": "39545090",
45
+ "name": "jrwg",
46
+ "font_class": "a-bianzu1",
47
+ "unicode": "e615",
48
+ "unicode_decimal": 58901
49
+ },
50
+ {
51
+ "icon_id": "39545091",
52
+ "name": "csywgl",
53
+ "font_class": "bianzu",
54
+ "unicode": "e616",
55
+ "unicode_decimal": 58902
56
+ },
57
+ {
58
+ "icon_id": "39545092",
59
+ "name": "cszlpt",
60
+ "font_class": "a-bianzu3",
61
+ "unicode": "e617",
62
+ "unicode_decimal": 58903
63
+ },
64
+ {
65
+ "icon_id": "39545093",
66
+ "name": "cswy",
67
+ "font_class": "a-bianzu69",
68
+ "unicode": "e618",
69
+ "unicode_decimal": 58904
70
+ },
71
+ {
72
+ "icon_id": "39545094",
73
+ "name": "jtsjfx",
74
+ "font_class": "a-bianzu2",
75
+ "unicode": "e619",
76
+ "unicode_decimal": 58905
77
+ },
78
+ {
79
+ "icon_id": "39545095",
80
+ "name": "csfzjc",
81
+ "font_class": "a-bianzu70",
82
+ "unicode": "e61a",
83
+ "unicode_decimal": 58906
84
+ },
85
+ {
86
+ "icon_id": "39130753",
87
+ "name": "query",
88
+ "font_class": "query",
89
+ "unicode": "e612",
90
+ "unicode_decimal": 58898
91
+ },
92
+ {
93
+ "icon_id": "38017865",
94
+ "name": "风控管理",
95
+ "font_class": "fengkongguanli",
96
+ "unicode": "e611",
97
+ "unicode_decimal": 58897
98
+ },
99
+ {
100
+ "icon_id": "37668679",
101
+ "name": "清除",
102
+ "font_class": "qingchu",
103
+ "unicode": "e610",
104
+ "unicode_decimal": 58896
105
+ },
106
+ {
107
+ "icon_id": "37667394",
108
+ "name": "移除",
109
+ "font_class": "yichu",
110
+ "unicode": "e60f",
111
+ "unicode_decimal": 58895
112
+ },
113
+ {
114
+ "icon_id": "37355986",
115
+ "name": "增加 copy",
116
+ "font_class": "a-zengjiacopy",
117
+ "unicode": "e62d",
118
+ "unicode_decimal": 58925
119
+ },
120
+ {
121
+ "icon_id": "37315078",
122
+ "name": "图钉",
123
+ "font_class": "tuding",
124
+ "unicode": "e60c",
125
+ "unicode_decimal": 58892
126
+ },
127
+ {
128
+ "icon_id": "35627211",
129
+ "name": "出口",
130
+ "font_class": "chukou",
131
+ "unicode": "e621",
132
+ "unicode_decimal": 58913
133
+ },
134
+ {
135
+ "icon_id": "35627212",
136
+ "name": "步骤",
137
+ "font_class": "buzhou",
138
+ "unicode": "e622",
139
+ "unicode_decimal": 58914
140
+ },
141
+ {
142
+ "icon_id": "35627213",
143
+ "name": "撤销",
144
+ "font_class": "chexiao",
145
+ "unicode": "e623",
146
+ "unicode_decimal": 58915
147
+ },
148
+ {
149
+ "icon_id": "35627214",
150
+ "name": "并行网关",
151
+ "font_class": "binghangwangguan",
152
+ "unicode": "e624",
153
+ "unicode_decimal": 58916
154
+ },
155
+ {
156
+ "icon_id": "35627215",
157
+ "name": "保存",
158
+ "font_class": "baocun",
159
+ "unicode": "e626",
160
+ "unicode_decimal": 58918
161
+ },
162
+ {
163
+ "icon_id": "35627216",
164
+ "name": "框选",
165
+ "font_class": "kuangxuan",
166
+ "unicode": "e627",
167
+ "unicode_decimal": 58919
168
+ },
169
+ {
170
+ "icon_id": "35627217",
171
+ "name": "分支网关",
172
+ "font_class": "fenzhiwangguan",
173
+ "unicode": "e628",
174
+ "unicode_decimal": 58920
175
+ },
176
+ {
177
+ "icon_id": "35627218",
178
+ "name": "预览",
179
+ "font_class": "yulan",
180
+ "unicode": "e629",
181
+ "unicode_decimal": 58921
182
+ },
183
+ {
184
+ "icon_id": "35627219",
185
+ "name": "入口",
186
+ "font_class": "rukou",
187
+ "unicode": "e62a",
188
+ "unicode_decimal": 58922
189
+ },
190
+ {
191
+ "icon_id": "35627220",
192
+ "name": "合并网关",
193
+ "font_class": "hebingwangguan",
194
+ "unicode": "e62b",
195
+ "unicode_decimal": 58923
196
+ },
197
+ {
198
+ "icon_id": "35627221",
199
+ "name": "恢复",
200
+ "font_class": "huifu",
201
+ "unicode": "e62c",
202
+ "unicode_decimal": 58924
203
+ },
8
204
  {
9
205
  "icon_id": "34742144",
10
206
  "name": "收起折叠(去边框)",
Binary file
Binary file
Binary file
@@ -6,7 +6,7 @@ export default function realUrl(url, rest = false) {
6
6
  return url
7
7
  } else if (/^\//.test(url)) {
8
8
  return prefix + url.replace(/^\//, '')
9
- } else if (!rest) {
9
+ } else if (rest) {
10
10
  return '/' + url
11
11
  } else {
12
12
  return url
Binary file
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <el-checkbox-group v-model="checkArrayCalc" class="popover-check-box" @change="checkChange">
2
+ <el-checkbox-group v-model="checkArrayCalc" :max="maxLength" class="popover-check-box" @change="checkChange">
3
3
  <vue-draggable
4
4
  :list="filterList"
5
5
  :animation="200"
@@ -30,6 +30,9 @@ export default {
30
30
  checkArray: {
31
31
  type: Array,
32
32
  default: () => []
33
+ },
34
+ maxLength: {
35
+ type: Number
33
36
  }
34
37
  },
35
38
  computed: {
@@ -48,6 +51,9 @@ export default {
48
51
  },
49
52
  methods: {
50
53
  checkChange(keys) {
54
+ if (keys.length > this.maxLength) {
55
+ return this.$message.warning(`最多只能添加${this.maxLength}个筛选条件!`)
56
+ }
51
57
  this.$emit('checked', keys)
52
58
  },
53
59
  dragChange() {
@@ -1,14 +1,16 @@
1
1
  <script>
2
+ import asciiWidth from '../../utils/asciiWidth'
2
3
  import axios from '../../utils/axios'
4
+ import forEachs from '../../utils/forEachs'
5
+ import { $lc } from '../../utils/i18n/index.js'
6
+ import datePickerPor from '../DatePicker/por.vue'
3
7
  import inputNumber from '../InputNumber/index.vue'
4
8
  import InputNumberRange from '../InputNumber/numberRange.vue'
5
- import datePickerPor from '../DatePicker/por.vue'
6
9
  import selectTree from '../SelectTree/index.vue'
7
10
  import selectTreePro from '../SelectTree/pro.vue'
8
- import { $lc } from '../../utils/i18n/index.js'
9
- import asciiWidth from '../../utils/asciiWidth'
10
11
  const canvas = document.createElement('canvas')
11
12
  const context = canvas.getContext('2d')
13
+ context.font = '14px Ping Fang SC'
12
14
  export default {
13
15
  name: 'formItemRender',
14
16
  components: {
@@ -49,6 +51,9 @@ export default {
49
51
  handleFilter() {
50
52
  this.$emit('filter')
51
53
  },
54
+ handleEnter() {
55
+ this.$emit('enter')
56
+ },
52
57
  handleVisibleChange(value) {
53
58
  if (!value) {
54
59
  this.handleFilter()
@@ -77,7 +82,7 @@ export default {
77
82
  },
78
83
  render(h) {
79
84
  const { item, form, context } = this
80
- const MAX_WIDTH = 335
85
+
81
86
  let elementDom = null
82
87
 
83
88
  let typeEnum = (type) => {
@@ -103,70 +108,237 @@ export default {
103
108
  }
104
109
  }
105
110
 
106
- let w = asciiWidth(item.placeholder || typeEnum(item.type)) + 40
107
- if (/px$/.test(item.width)) {
108
- w = item.width.replace(/px$/, '')
111
+ // 获取文本宽度
112
+ const getWidth = (label, type) => {
113
+ if (!label) {
114
+ return 0
115
+ }
116
+ if (!type) {
117
+ return context.measureText(label).width
118
+ }
119
+ return (context.measureText(label).width * 1.4 + 100) * 2
109
120
  }
110
121
 
111
- const getWidth = (value, type) => {
112
- if (!type) {
113
- return context.measureText(value).width * 1.4 + 55
122
+ let w = 76
123
+ if (item.placeholder) {
124
+ w = asciiWidth(item.placeholder || typeEnum(item.type)) + 34
125
+ if (/px$/.test(item.width)) {
126
+ w = item.width.replace(/px$/, '')
114
127
  }
115
- return (context.measureText(value).width * 1.4 + 100) * 2
116
128
  }
117
129
 
118
- const calcWidth = (value, type) => {
119
- let W = null
130
+ // 计算text框内容宽度
131
+ const calcTextWidth = (item, value) => {
132
+ let textMaxWidth,
133
+ textMinWidth = 76
134
+ if (item.required) {
135
+ textMaxWidth = 426 - getWidth(item.label) - 33
136
+ } else {
137
+ textMaxWidth = 426 - getWidth(item.label) - 14
138
+ }
139
+
140
+ // 没有内容时
120
141
  if (!value) {
121
- if (type) {
142
+ return textMinWidth + 'px'
143
+ }
144
+ // 输入内容+边距小于最小默认值时
145
+ if (getWidth(value) + 32 < textMinWidth) {
146
+ return textMinWidth + 'px'
147
+ }
148
+ // 输入内容+边距大于最大默认值时
149
+ if (getWidth(value) + 32 > textMaxWidth) {
150
+ return textMaxWidth + 'px'
151
+ }
152
+
153
+ return getWidth(value) + 32 + 'px'
154
+ }
155
+
156
+ const calcWidth = (value, type, label) => {
157
+ let MAX_WIDTH = 426 - getWidth(label) - 16
158
+ let W = null
159
+ if (!Array.isArray(value)) {
160
+ if (!value) {
161
+ if (type) {
162
+ return Number(w) + 110 + 'px'
163
+ }
164
+ return w + 'px'
165
+ }
166
+ if (getWidth(value, type) > w) {
167
+ if (getWidth(value, type) > MAX_WIDTH) {
168
+ W = MAX_WIDTH
169
+ } else {
170
+ W = getWidth(value, type)
171
+ }
172
+ } else {
173
+ if (type) {
174
+ W = w ? w : asciiWidth(item.placeholder || typeEnum[item.type]) + 150
175
+ } else {
176
+ W = w ? w : asciiWidth(item.placeholder || typeEnum[item.type]) + 40
177
+ }
178
+ }
179
+ } else {
180
+ if (!value[0] && !value[1]) {
122
181
  return Number(w) + 110 + 'px'
123
182
  }
124
- return w + 'px'
183
+ let widthMax = getWidth(value[0]) + getWidth(value[1]) + 35
184
+ if (widthMax > w) {
185
+ if (widthMax > MAX_WIDTH) {
186
+ W = MAX_WIDTH
187
+ } else {
188
+ W = widthMax
189
+ }
190
+ }
125
191
  }
126
- if (getWidth(value, type) > w) {
127
- if (getWidth(value, type) > MAX_WIDTH) {
128
- W = MAX_WIDTH
192
+
193
+ return W + 'px'
194
+ }
195
+ const recursionFind = (data, value, key, name) => {
196
+ let found
197
+ forEachs(data, (item) => {
198
+ if (item[key] === value) {
199
+ found = item[name]
200
+ }
201
+ if (item.children && !found) {
202
+ found = recursionFind(item.children, value, key, name)
203
+ }
204
+ })
205
+
206
+ return found
207
+ }
208
+
209
+ // 计算selectTree内容宽度
210
+ const calcSelectTreeWidth = (item, value) => {
211
+ let textMaxWidth = 346 - getWidth(item.label) - 16
212
+ const multiple = item?.props?.multiple
213
+ const textMinWidth = 76
214
+
215
+ if (!multiple) {
216
+ if (!value) {
217
+ return textMinWidth + 'px'
129
218
  } else {
130
- W = getWidth(value, type)
219
+ let selectedName = ''
220
+ selectedName = recursionFind(
221
+ item.options,
222
+ value,
223
+ item?.props?.props?.value || item?.props?.defineProps?.value || 'value',
224
+ item?.props?.props?.label || item?.props?.defineProps?.label || 'label'
225
+ )
226
+
227
+ return getWidth(selectedName) + 'px'
131
228
  }
132
229
  } else {
133
- if (type) {
134
- W = w ? w : asciiWidth(item.placeholder || typeEnum[item.type]) + 150
230
+ if (!value?.length) {
231
+ return textMinWidth + 'px'
135
232
  } else {
136
- W = w ? w : asciiWidth(item.placeholder || typeEnum[item.type]) + 40
233
+ let selectedName = recursionFind(
234
+ item.options,
235
+ value[0],
236
+ item?.props?.props?.value || item?.props?.defineProps?.value || 'value',
237
+ item?.props?.props?.label || item?.props?.defineProps?.label || 'label'
238
+ )
239
+ if (value?.length > 1) {
240
+ return getWidth(selectedName) + 32 > textMaxWidth
241
+ ? textMaxWidth + 'px'
242
+ : getWidth(selectedName) + 110 + 'px'
243
+ } else {
244
+ return getWidth(selectedName) + 32 < textMinWidth ? textMinWidth + 'px' : getWidth(selectedName) + 84 + 'px'
245
+ }
137
246
  }
138
247
  }
139
- return W + 'px'
140
248
  }
141
-
142
- const calcSelectWidth = (value, type) => {
143
- let W = null
144
- if (!value) {
145
- return w + 'px'
249
+ // 计算select内容宽度
250
+ const calcSelectWidth = (item, value) => {
251
+ let textMaxWidth = 426 - getWidth(item.label) - 16
252
+ let textMinWidth = 76
253
+ const multiple = item.props?.multiple || false
254
+ if (!multiple) {
255
+ if (!value) {
256
+ return textMinWidth + 'px'
257
+ } else {
258
+ let selectedName = recursionFind(
259
+ item.options,
260
+ value,
261
+ item.props?.valueKey || 'value',
262
+ item.props?.labelKey || 'label'
263
+ )
264
+ if (getWidth(selectedName) + 32 > textMaxWidth) {
265
+ return textMaxWidth + 'px'
266
+ }
267
+ if (getWidth(selectedName) + 32 < textMinWidth) {
268
+ return textMinWidth + 'px'
269
+ }
270
+ return getWidth(selectedName) + 32 + 'px'
271
+ }
146
272
  } else {
147
- let label = item.options.find((res) => (res.value || res[item.props.valueKey]) === value)?.label
148
- const width = getWidth(label)
149
- if (width > w) {
150
- if (width > MAX_WIDTH) {
151
- W = MAX_WIDTH
273
+ if (!value?.length) {
274
+ return textMinWidth + 'px'
275
+ } else {
276
+ let selectedName = recursionFind(
277
+ item.options,
278
+ value[0],
279
+ item.props?.valueKey || 'value',
280
+ item.props?.labelKey || 'label'
281
+ )
282
+ if (value?.length > 1) {
283
+ return getWidth(selectedName) + 32 > textMaxWidth
284
+ ? textMaxWidth + 'px'
285
+ : getWidth(selectedName) + 110 + 'px'
152
286
  } else {
153
- if (type) {
154
- W = width + 45
155
- } else {
156
- W = width
157
- }
287
+ return getWidth(selectedName) + 32 < textMinWidth ? textMinWidth + 'px' : getWidth(selectedName) + 84 + 'px'
288
+ }
289
+ }
290
+ }
291
+ }
292
+ // 计算区间内容宽度
293
+ const calcRangeWidth = (item, value, value2) => {
294
+ let textMaxWidth = 284 - getWidth(item.label) - 16
295
+ let textMinWidth = 160
296
+ if (!value && !value2) {
297
+ return textMinWidth + 'px'
298
+ } else {
299
+ console.log(value, value2, getWidth(value))
300
+ if (!value || !value2) {
301
+ let widthMax = (getWidth(value) + getWidth(value2) + 72) * 2
302
+ if (widthMax < textMinWidth) {
303
+ return textMinWidth + 'px'
158
304
  }
305
+ if (widthMax > textMaxWidth) {
306
+ return textMaxWidth + 'px'
307
+ }
308
+ return widthMax + 'px'
159
309
  } else {
160
- W = w
310
+ let widthMax = getWidth(value) + getWidth(value2) + 140
311
+ if (widthMax < textMinWidth) {
312
+ return textMinWidth + 'px'
313
+ }
314
+ if (widthMax > textMaxWidth) {
315
+ return textMaxWidth + 'px'
316
+ }
317
+ return widthMax + 'px'
161
318
  }
162
319
  }
163
- return W + 'px'
320
+ }
321
+
322
+ const calcDateWidth = (item, value) => {
323
+ let textMaxWidth = 282 - getWidth(item.label) - 16
324
+ let textMinWidth = 76
325
+ if (!value) {
326
+ return textMinWidth + 'px'
327
+ } else {
328
+ if (getWidth(value) + 32 < textMinWidth) {
329
+ return textMinWidth + 'px'
330
+ }
331
+ if (getWidth(value) + 32 > textMaxWidth) {
332
+ return textMaxWidth + 'px'
333
+ }
334
+ return getWidth(value) + 32 + 'px'
335
+ }
164
336
  }
165
337
 
166
338
  const keyup = (ev) => {
167
339
  if (ev.keyCode === 13) {
168
340
  ev.target.blur()
169
- this.handleFilter()
341
+ this.handleEnter()
170
342
  }
171
343
  }
172
344
 
@@ -178,7 +350,7 @@ export default {
178
350
  {
179
351
  attrs: {
180
352
  style: {
181
- width: calcWidth(form[item.value])
353
+ width: calcTextWidth(item, form[item.value])
182
354
  },
183
355
  ruleField: true,
184
356
  'rule-form': 'ruleValidate',
@@ -273,7 +445,7 @@ export default {
273
445
  collapseTags: true
274
446
  },
275
447
  style: {
276
- width: calcSelectWidth(form[item.value], item.multiple)
448
+ width: calcSelectWidth(item, form[item.value])
277
449
  },
278
450
  props: selectProps,
279
451
 
@@ -338,7 +510,7 @@ export default {
338
510
  ruleErrorHide: item.ruleErrorHide
339
511
  },
340
512
  style: {
341
- width: calcWidth(form[item.startValue], true)
513
+ width: calcRangeWidth(item, form[item.startValue], form[item.endValue])
342
514
  },
343
515
  props: inputRangeProps,
344
516
  on: {
@@ -365,15 +537,24 @@ export default {
365
537
  const datePickerProps = {
366
538
  value: form[item.value],
367
539
  type: item.type,
540
+ 'prefix-icon': (item.props && item.props.prefixIcon) ?? '',
368
541
  clearable: (item.props && item.props.clearable) ?? true,
369
542
  // 将 props 对象中的属性应用到 datePicker 上
370
543
  ...item.props
371
544
  }
372
- elementDom = h('datePickerPor', {
545
+ elementDom = h('el-date-picker', {
373
546
  directives: [{ name: 'rule-key' }],
374
- attrs: { 'rule-form': 'ruleValidate', ruleField: true, rules: item.rules, ruleErrorHide: item.ruleErrorHide },
547
+ attrs: {
548
+ 'rule-form': 'ruleValidate',
549
+ ruleField: true,
550
+ class: `n20-date-editor`,
551
+ 'value-format': (item.props && item.props.valueFormat) ?? 'yyyy-MM-dd',
552
+ placeholder: (item.props && item.props.placeholder) ?? $lc('请选择'),
553
+ rules: item.rules,
554
+ ruleErrorHide: item.ruleErrorHide
555
+ },
375
556
  style: {
376
- width: calcWidth(form[item.value])
557
+ width: calcDateWidth(item, form[item.value])
377
558
  },
378
559
  props: datePickerProps,
379
560
  model: {
@@ -396,29 +577,33 @@ export default {
396
577
  case 'monthrange':
397
578
  const pickerProps = {
398
579
  type: item.type,
399
- startDate: form[item.startDate],
400
- endDate: form[item.endDate],
580
+ startDate: form[item.startDate] || null,
581
+ endDate: form[item.endDate] || null,
582
+ rules: item.rules,
401
583
  clearable: (item.props && item.props.clearable) ?? true,
402
584
  ...item.props
403
585
  }
404
-
405
586
  elementDom = h('datePickerPor', {
406
587
  directives: [{ name: 'rule-key', value: 'startDate' }],
407
- attrs: { 'rule-form': 'ruleValidate', ruleField: true, rules: item.rules, ruleErrorHide: item.ruleErrorHide },
588
+ attrs: {
589
+ ruleField: true,
590
+ 'rule-form': 'ruleValidate',
591
+ ruleErrorHide: item.ruleErrorHide,
592
+ rules: item.rules
593
+ },
408
594
  props: pickerProps,
409
595
  style: {
410
- width: calcWidth(form[item.startDate], true)
596
+ width: calcRangeWidth(item, form[item.startDate], form[item.endDate])
411
597
  },
412
598
  on: {
599
+ 'update:start-date': (val) => {
600
+ this.$set(form, item.startDate, val)
601
+ },
602
+ 'update:end-date': (val) => {
603
+ this.$set(form, item.endDate, val)
604
+ },
413
605
  clear: this.handleClear,
414
- change: (value) => {
415
- if (value) {
416
- this.$set(form, item.startDate, value[0])
417
- this.$set(form, item.endDate, value[1])
418
- } else {
419
- this.$set(form, item.startDate, null)
420
- this.$set(form, item.endDate, null)
421
- }
606
+ change: () => {
422
607
  this.handleFilter()
423
608
  }
424
609
  },
@@ -501,7 +686,7 @@ export default {
501
686
  elementDom = h('selectTree', {
502
687
  directives: [{ name: 'rule-key' }],
503
688
  style: {
504
- width: calcSelectWidth(form[item.value])
689
+ width: calcSelectTreeWidth(item, form[item.value])
505
690
  },
506
691
  attrs: {
507
692
  ruleField: true,
@@ -546,7 +731,7 @@ export default {
546
731
  clearable: (item.props && item.props.clearable) ?? true
547
732
  },
548
733
  style: {
549
- width: item.width || '200px'
734
+ width: calcSelectTreeWidth(item, form[item.value])
550
735
  },
551
736
  model: {
552
737
  value: form[item.value],
@@ -574,7 +759,7 @@ export default {
574
759
  elementDom = h('el-input', {
575
760
  attrs: {
576
761
  style: {
577
- width: item.width || '224px'
762
+ width: calcTextWidth(item.label, form[item.value])
578
763
  },
579
764
  ruleField: true,
580
765
  'rule-form': 'ruleValidate',