n20-common-lib 2.2.39 → 2.2.41

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": "2.2.39",
3
+ "version": "2.2.41",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -38,7 +38,7 @@ export default {
38
38
  }
39
39
  },
40
40
  mounted() {
41
- this.init('mount', this.id, this.title)
41
+ this.init('mount', this.id, this.title, this.$slots.title)
42
42
  },
43
43
  beforeDestroy() {
44
44
  this.init('destroy', this.id, this.title)
@@ -19,6 +19,7 @@ import { debounce } from 'throttle-debounce'
19
19
  import { addListener, removeListener } from 'resize-detector'
20
20
 
21
21
  import AnchorSidebar from './sidebar.vue'
22
+ console.log(AnchorSidebar, 124)
22
23
  export default {
23
24
  name: 'Anchor',
24
25
  components: {
@@ -91,14 +92,15 @@ export default {
91
92
  }
92
93
  }
93
94
  },
94
- itemWatch(type, id, title) {
95
+ itemWatch(type, id, title, slotT) {
95
96
  if (type === 'mount') {
96
97
  let item = this.navList.find((c) => c.id === id)
97
98
  if (!item) {
98
- item = { id: id, title: title, height: 48 }
99
+ item = { id: id, title: title, slotT: slotT, height: 48 }
99
100
  this.navList.push(item)
100
101
  } else {
101
102
  item.title = title
103
+ item.slotT = slotT
102
104
  }
103
105
 
104
106
  let dom = this.$refs['anchor-content'].querySelector(`[anchor-item-id="${id}"]`)
@@ -1,17 +1,3 @@
1
- <template>
2
- <div class="p-t-m">
3
- <div
4
- v-for="item in navList"
5
- :key="item.id"
6
- class="n20-anchor2-nav"
7
- :class="{ 'n20-anchor2-nav-activit': item.id === activit }"
8
- @click="$emit('click', item)"
9
- >
10
- {{ item.title }}
11
- </div>
12
- </div>
13
- </template>
14
-
15
1
  <script>
16
2
  export default {
17
3
  props: {
@@ -23,6 +9,32 @@ export default {
23
9
  type: [String, Number],
24
10
  default: undefined
25
11
  }
12
+ },
13
+ render() {
14
+ let _vm = this
15
+ let { navList, activit, _c, _l, _v, _s } = _vm
16
+
17
+ return _c(
18
+ 'div',
19
+ { staticClass: 'p-t-m' },
20
+ _l(navList, function (item) {
21
+ return _c(
22
+ 'div',
23
+ {
24
+ key: item.id,
25
+ staticClass: 'n20-anchor2-nav',
26
+ class: { 'n20-anchor2-nav-activit': item.id === activit },
27
+ on: {
28
+ click: function ($event) {
29
+ return _vm.$emit('click', item)
30
+ }
31
+ }
32
+ },
33
+ item.slotT ? item.slotT : [_v(_s(item.title))]
34
+ )
35
+ }),
36
+ 0
37
+ )
26
38
  }
27
39
  }
28
40
  </script>
@@ -16,15 +16,15 @@
16
16
  >
17
17
  <span ref="upload-trigger" slot="trigger">upload</span>
18
18
  </Upload>
19
- <uploadMsg v-else
19
+ <uploadMsg
20
+ v-else
20
21
  :title="'导入文件' | $lc"
21
22
  :visible.sync="errorV"
22
23
  :validate-result="validateResult"
23
24
  :hide-percent="true"
24
- :footerBtn="footer"
25
+ :footer-btn="footer"
25
26
  :validate-confirm="validateConfirm"
26
27
  />
27
-
28
28
  </div>
29
29
  </el-dropdown>
30
30
  </template>
@@ -43,6 +43,10 @@ export default {
43
43
  type: String,
44
44
  default: ''
45
45
  },
46
+ templateOpt: {
47
+ type: Object,
48
+ default: undefined
49
+ },
46
50
  fileName: {
47
51
  type: String,
48
52
  default: $lc('下载.xlsx')
@@ -84,7 +88,7 @@ export default {
84
88
  watch: {
85
89
  validateDialog(val) {
86
90
  this.errorV = val
87
- },
91
+ }
88
92
  },
89
93
  mounted() {
90
94
  console.log(this.footer)
@@ -114,7 +118,7 @@ export default {
114
118
  })
115
119
  },
116
120
  downFn() {
117
- axios.get(this.templateUrl, null, { responseType: 'blob' }).then((blob) => {
121
+ axios.get(this.templateUrl, null, { responseType: 'blob', ...this.templateOpt }).then((blob) => {
118
122
  downloadBlob(blob, this.fileName)
119
123
  })
120
124
  }
@@ -3,6 +3,7 @@
3
3
  v-if="!bigData"
4
4
  ref="el-table"
5
5
  :key="colsKey"
6
+ :class="{ 'cell-default-set--': cellDefault, 'clear-in-form-margin': clearInFormMargin }"
6
7
  :header-cell-style="{ 'text-align': 'center' }"
7
8
  :data="data"
8
9
  :height="height"
@@ -152,6 +153,14 @@ export default {
152
153
  showSetsize: {
153
154
  type: Boolean,
154
155
  default: false
156
+ },
157
+ cellDefault: {
158
+ type: Boolean,
159
+ default: false
160
+ },
161
+ clearInFormMargin: {
162
+ type: Boolean,
163
+ default: false
155
164
  }
156
165
  },
157
166
  data() {
@@ -246,3 +255,11 @@ export default {
246
255
  }
247
256
  }
248
257
  </script>
258
+ <style>
259
+ .cell-default-set-- .el-table__body .el-table__cell .cell:empty::before {
260
+ content: '--';
261
+ }
262
+ .clear-in-form-margin .el-table__body .el-table__cell .cell .el-form-item {
263
+ margin-bottom: 0;
264
+ }
265
+ </style>