xianniu-ui 0.7.1 → 0.7.3

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": "xianniu-ui",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -1,8 +1,18 @@
1
- .el-descriptions{
2
- .el-descriptions-item__label:not(.is-bordered-label){
1
+ .el-descriptions {
2
+ .el-descriptions-item__label:not(.is-bordered-label) {
3
3
  color: #909097;
4
4
  }
5
- &--small{
5
+ &--small {
6
6
  font-size: 14px;
7
7
  }
8
- }
8
+ }
9
+ .el-table {
10
+ tr.cus-table-header {
11
+ th {
12
+ background-color: #fafafa;
13
+ padding: 5px 0;
14
+ font-weight: 400;
15
+ color: #202131;
16
+ }
17
+ }
18
+ }
@@ -57,34 +57,6 @@
57
57
  plain
58
58
  ></el-button>
59
59
  </el-tooltip>
60
- <el-popover
61
- placement="bottom-end"
62
- popper-class="xn-table-box-tools__pop"
63
- class="ml-10"
64
- trigger="hover"
65
- :hidden="!showColumn && columns.length"
66
- >
67
- <el-scrollbar
68
- class="xn-table-box-tools__coll"
69
- wrap-style="overflow-x:hidden;"
70
- >
71
- <div v-for="(item, idx) in columns" :key="idx" class="mb-5">
72
- <el-checkbox
73
- :value="item.checked"
74
- :checked="item.checked"
75
- @change="handleChangeToolshow(item)"
76
- >{{ item.label }}</el-checkbox
77
- >
78
- </div>
79
- </el-scrollbar>
80
- <el-button
81
- plain
82
- size="mini"
83
- type="primary"
84
- icon="el-icon-setting"
85
- slot="reference"
86
- ></el-button>
87
- </el-popover>
88
60
  </div>
89
61
  </div>
90
62
  </div>
@@ -95,6 +67,7 @@
95
67
  v-bind="$attrs"
96
68
  :border="border"
97
69
  :stripe="stripe"
70
+ :header-row-class-name="headerRowClassName"
98
71
  @row-click="singleElection"
99
72
  @selection-change="selectionChange"
100
73
  :row-class-name="tableRowClassName"
@@ -196,7 +169,9 @@ export default {
196
169
  selectedData: [],
197
170
  };
198
171
  },
199
- computed: {},
172
+ computed: {
173
+
174
+ },
200
175
  created() {
201
176
 
202
177
  },
@@ -223,10 +198,7 @@ export default {
223
198
  handleToolsItem(row, index) {
224
199
  this.$emit("on-tools", { row, index });
225
200
  },
226
- handleChangeToolshow(item) {
227
- item.checked = item.checked === true ? false : true;
228
- this.$refs.table.doLayout();
229
- },
201
+
230
202
  selectionChange(val) {
231
203
  this.selectedData = val;
232
204
  this.$emit("selection-change", val);
@@ -248,6 +220,10 @@ export default {
248
220
  tableRowClassName({ row, rowIndex }) {
249
221
  row.rowIndex = rowIndex;
250
222
  },
223
+ headerRowClassName(row, rowIndex){
224
+ console.log('row, rowIndex: ', row, rowIndex);
225
+ return 'cus-table-header'
226
+ }
251
227
  },
252
228
  };
253
229
  </script>
@@ -190,7 +190,7 @@ export default {
190
190
  return Promise.all([
191
191
  this.checkFileExt(file),
192
192
  this.onExceedSize(file.size),
193
- this.getStsToken(),
193
+ this.getStsToken(file),
194
194
  ])
195
195
  .then(() => {
196
196
  return Promise.resolve();
@@ -280,6 +280,7 @@ export default {
280
280
  return this.$utils.download({url, name})
281
281
  },
282
282
  handleRemove(file, fileList) {
283
+ console.log('file, fileList: ', file, fileList,this.files);
283
284
  fileList.forEach((item, idx) => {
284
285
  if (file.uid === item.uid) {
285
286
  fileList.splice(idx, 1);
package/src/oss/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const OSS = require('ali-oss')
2
2
  import $dayjs from '@/utils/dayjs'
3
3
  const { v4: uuidv4 } = require('uuid');
4
-
4
+ import { Message } from 'element-ui';
5
5
  class Client {
6
6
  constructor(params = {}) {
7
7
  this.uploadHost = null
@@ -33,10 +33,12 @@ class Client {
33
33
  const uuid = uuidv4()
34
34
  return uuid
35
35
  }
36
- getStsToken() {
36
+ getStsToken(file) {
37
37
  return new Promise((resolve, reject) => {
38
38
  if (!this.stsUrl) {
39
- return console.error('获取临时凭证地址不能为空')
39
+ Message.error('获取临时凭证地址不能为空')
40
+ file.onError()
41
+ return
40
42
  }
41
43
 
42
44
  fetch(this.stsUrl + '?xnToken=' + this.getToken()).then(response => response.json()).then((res) => {