@ddwl/ddwl-ui 1.0.26 → 1.0.28

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": "@ddwl/ddwl-ui",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "private": false,
5
5
  "main": "src/main.js",
6
6
  "style": "lib/theme/index.css",
@@ -4,7 +4,7 @@
4
4
  class="container"
5
5
  >
6
6
  <div
7
- id="left"
7
+ ref="leftRef"
8
8
  class="left"
9
9
  >
10
10
  <el-tabs
@@ -115,7 +115,6 @@ export default {
115
115
  return this.value
116
116
  },
117
117
  set (value) {
118
- this.removeEventFun()
119
118
  this.$emit('change', value)
120
119
  }
121
120
  }
@@ -148,11 +147,17 @@ export default {
148
147
  },
149
148
  immediate: true,
150
149
  deep: true
150
+ },
151
+ visible: {
152
+ handler (val) {
153
+ if (val) {
154
+ this.addEventEventFun()
155
+ } else {
156
+ this.removeEventFun()
157
+ }
158
+ }
151
159
  }
152
160
  },
153
- mounted () {
154
- this.addEventEventFun()
155
- },
156
161
  methods: {
157
162
  deviceSupportUninstall () {
158
163
  this.$refs.viewer.deviceSupportUninstall()
@@ -161,14 +166,14 @@ export default {
161
166
  this.$refs.viewer.deviceSupportInstall()
162
167
  },
163
168
  addEventEventFun () {
164
- const element = document.getElementById('left')
165
- element.addEventListener('mouseenter', this.deviceSupportUninstall)
166
- element.addEventListener('mouseleave', this.deviceSupportInstall)
169
+ const elRef = this.$refs.leftRef
170
+ elRef.addEventListener('mouseenter', this.deviceSupportUninstall)
171
+ elRef.addEventListener('mouseleave', this.deviceSupportInstall)
167
172
  },
168
173
  removeEventFun () {
169
- const element = document.getElementById('left')
170
- element.removeEventListener('mouseenter', this.deviceSupportUninstall)
171
- element.removeEventListener('mouseleave', this.deviceSupportInstall)
174
+ const elRef = this.$refs.leftRef
175
+ elRef.removeEventListener('mouseenter', this.deviceSupportUninstall)
176
+ elRef.removeEventListener('mouseleave', this.deviceSupportInstall)
172
177
  },
173
178
  close () {
174
179
  this.visible = false
@@ -181,10 +181,7 @@ export default {
181
181
  }
182
182
  this.config.onChange(value, data)
183
183
  })
184
- }
185
-
186
- // 处理下拉选择器
187
- if (this.config.component === 'el-select') {
184
+ } else if (this.config.component === 'el-select') { // 处理下拉选择器
188
185
  data = this.config.options
189
186
  if (Array.isArray(value)) {
190
187
  data = data.filter(i => value.includes(i.value)) || []
@@ -192,6 +189,8 @@ export default {
192
189
  data = data.find(i => value === i.value) || {}
193
190
  }
194
191
  this.config.onChange(value, data)
192
+ } else {
193
+ this.config.onChange(value)
195
194
  }
196
195
  }
197
196
  }
@@ -91,6 +91,10 @@ export default {
91
91
  fileSize: {
92
92
  default: 5,
93
93
  type: Number
94
+ },
95
+ token: {
96
+ required: true,
97
+ type: String
94
98
  }
95
99
  },
96
100
  data () {
@@ -116,7 +120,7 @@ export default {
116
120
  },
117
121
  methods: {
118
122
  downloadFile () {
119
- window.location.href = this.templateUrl
123
+ window.location.href = `${this.templateUrl}?authToken=${this.token}`
120
124
  },
121
125
  uploadChange (file, fileList) {
122
126
  const isLimit = file.size / 1024 / 1024 < this.fileSize
@@ -25,7 +25,7 @@
25
25
  <el-col :span="submitSpan">
26
26
  <div
27
27
  :style="{
28
- 'margin-top': hasSlot && expend && !suffixSlot ? '0px' : '20px'
28
+ 'margin-top': hasSlot && expend && !suffixSlot ? '0px' : '24px'
29
29
  }"
30
30
  class="d-search-form-btn"
31
31
  >
@@ -3,6 +3,7 @@
3
3
  <div
4
4
  :key="key"
5
5
  v-loading="loading"
6
+ class="d-table"
6
7
  :class="draggable && 'drag-query-table'"
7
8
  >
8
9
  <el-table
@@ -307,7 +308,7 @@ export default {
307
308
 
308
309
  this.$emit('loaded', this.list)
309
310
 
310
- // 如果当前页码大于0且当前数据列表为空,自动返回上一页并查询
311
+ // 如果当前页码大于1且当前数据列表为空,自动返回上一页并查询
311
312
  if (this.list.length === 0 && this.pageNum > 1) {
312
313
  this.pageNum = this.pageNum - 1
313
314
  this.search()
@@ -434,6 +435,10 @@ export default {
434
435
  </script>
435
436
 
436
437
  <style lang="scss" scoped>
438
+ .d-table {
439
+ display: flex;
440
+ flex-direction: column;
441
+ }
437
442
  .drag-query-table {
438
443
  :deep(.hover-row) {
439
444
  td {