@lambo-design/upload-file 1.0.0-beta.11 → 1.0.0-beta.12

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/.versionrc ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "tagPrefix": "@lambo-design/upload-file@",
3
+ "header": "# Changelog",
4
+ "types": [
5
+ {"type": "chore", "section":"'🎫 Chores | 其他更新", "hidden": false},
6
+ {"type": "revert", "section":"⏪ Reverts | 回退", "hidden": false},
7
+ {"type": "feat", "section": "✨ Features | 新功能", "hidden": false},
8
+ {"type": "fix", "section": "🐛 Bug Fixes | Bug 修复", "hidden": false},
9
+ {"type": "improvement", "section": "Feature Improvements", "hidden": false},
10
+ {"type": "docs", "section":"📝 Documentation | 文档", "hidden": false},
11
+ {"type": "style", "section":"💄 Styles | 风格", "hidden": false},
12
+ {"type": "refactor", "section":"💄 Styles | 风格", "hidden": false},
13
+ {"type": "perf", "section":"⚡ Performance Improvements | 性能优化", "hidden": false},
14
+ {"type": "test", "section":"✅ Tests | 测试", "hidden": false},
15
+ {"type": "build", "section":"👷‍ Build System | 构建", "hidden": false},
16
+ {"type": "ci", "section":"🔧 Continuous Integration | CI 配置", "hidden":false}
17
+ ],
18
+ "commitUrlFormat": "http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/{{hash}}",
19
+ "compareUrlFormat": "http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/{{previousTag}}...{{currentTag}}",
20
+ "issueUrlFormat": "http://git.inspur.com/ecbh/lambo-design/lambo-design/-/issues/{{id}}"
21
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+ ## 1.0.0-beta.12 (2024-04-12)
3
+
4
+
5
+ ### 🐛 Bug Fixes | Bug 修复
6
+
7
+ * **schema-paging-table:** 边界问题处理 ([79a0072](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/79a007219e6f750b1e6dc18660fb8e892ae45407))
8
+ * **schema-paging-table:** 处理没有表格上按钮的情况 ([aa3adf9](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/aa3adf913fa9e1acd5b4c158b4e36b14d93b754e))
9
+
10
+
11
+ ### 💄 Styles | 风格
12
+
13
+ * **CHANGELOG合规性改造:** CHANGELOG模板变更 ([f3d224b](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/f3d224bad70714fe23f6352629301118a3a2f54e))
14
+ * **CHANGELOG合规性改造:** CHANGELOG模板变更 ([5fec210](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/5fec210992acff0ca71d4945402e41d72b0d18b8))
15
+
16
+
17
+ ### '🎫 Chores | 其他更新
18
+
19
+ * **release:** 1.0.0-beta.153 ([35bdda2](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/35bdda24ea3705d343a7f04955a2d2389d27c194))
20
+ * **release:** 1.0.0-beta.21 ([c0d6e8a](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/c0d6e8a19aefc1ddb2824ac8909697d68bf2a636))
21
+ * **release:** 1.0.0-beta.22 ([707ce23](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/707ce23d97fc664ae7e8d7a5b8cd12f63c626ba6))
22
+ * **release:** 1.0.0-beta.23 ([9f89a98](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/9f89a9838ccc441b3acc8a109505602a1504a9e1))
23
+ * **release:** 1.0.0-beta.24 ([df77122](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/df77122bdafb5f82c23ab9b2f56a93a4fca36341))
24
+ * **release:** 1.0.0-beta.25 ([90e96a6](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/90e96a6108eac5dc218bf75f407fa811b36ed162))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/upload-file",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -12,8 +12,15 @@
12
12
  "devDependencies": {
13
13
  "axios": "^0.24.0",
14
14
  "axios-cache-plugin": "^0.1.0",
15
- "@lambo-design/core": "^4.7.1-beta.56",
16
- "@lambo-design/shared": "^1.0.0-beta.41"
15
+ "@lambo-design/core": "^4.7.1-beta.130",
16
+ "@lambo-design/shared": "^1.0.0-beta.153"
17
17
  },
18
- "scripts": {}
18
+ "scripts": {
19
+ "release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
20
+ "release-major": "standard-version --release-as major",
21
+ "release-minor": "standard-version --release-as minor",
22
+ "release-patch": "standard-version --release-as patch",
23
+ "release-beta": "standard-version --prerelease beta",
24
+ "re-publish": "pnpm publish --access public --no-git-checks"
25
+ }
19
26
  }
package/src/index.vue CHANGED
@@ -19,12 +19,13 @@
19
19
  <List border size="small">
20
20
  <ListItem v-for="item in resultList" :key="item.fileCode">
21
21
  <div span="21">
22
- <a :href="item.fileUrl">
22
+ <a :href="item.fileUrl ? item.fileUrl : downloadUrl + item.fileCode">
23
23
  {{item.fileName}}
24
24
  <span class="size" style="margin-left: 5px" v-if="item.showSize">({{item.showSize}})</span>
25
25
  </a>
26
26
  </div>
27
27
  <div span="3" style="text-align: right">
28
+ <Button v-if="showPreview" @click="previewFile(item)" type="text">预览</Button>
28
29
  <Button @click="deleteFile(item.fileCode)" type="text">删除</Button>
29
30
  </div>
30
31
  </ListItem>
@@ -35,6 +36,7 @@
35
36
 
36
37
  <script>
37
38
  import axios from 'axios';
39
+ import config from '../../config'
38
40
  import {formatterSizeUnit} from "@lambo-design/shared/utils/date";
39
41
 
40
42
  export default {
@@ -74,6 +76,12 @@ export default {
74
76
  required: false,
75
77
  default: true
76
78
  },
79
+ //是否显示预览文件按钮
80
+ showPreview: {
81
+ type: Boolean,
82
+ required: false,
83
+ default: false
84
+ },
77
85
  //其他需要传递的参数
78
86
  otherParam: {//其他需要传递的参数
79
87
  type: String,
@@ -102,6 +110,16 @@ export default {
102
110
  ossFileGetUrl:{
103
111
  type:String,
104
112
  default:"/oss/file/get/"
113
+ },
114
+ //文件预览所需文件流服务host
115
+ fileOnlinePreviewHost:{
116
+ type: String,
117
+ default: "http://pub-manage-server:8080"
118
+ },
119
+ //预览文件url
120
+ ossFilePreviewUrl:{
121
+ type:String,
122
+ default:"/anon/oss/file/getObjToOutputStream/"
105
123
  }
106
124
  },
107
125
 
@@ -120,6 +138,11 @@ export default {
120
138
  resultList: []
121
139
  }
122
140
  },
141
+ computed: {
142
+ downloadUrl: function () {
143
+ return this.ossServerContext + this.ossFileGetUrl;
144
+ }
145
+ },
123
146
  methods: {
124
147
  UploadFile: function () {
125
148
  this.$refs.uploadInput.click();
@@ -200,6 +223,31 @@ export default {
200
223
  self.$refs.uploadInput.value = null
201
224
  });
202
225
  },
226
+
227
+ encode64(value) {
228
+ let typeValue = typeof value;
229
+ if (typeValue == 'string' || typeValue == 'number') {
230
+ return window.btoa(
231
+ window.encodeURIComponent(value)
232
+ .replace(/%([0-9A-F]{2})/g,
233
+ function toSolidBytes(match, p1) {
234
+ return String.fromCharCode('0x' + p1);
235
+ }
236
+ )
237
+ );
238
+ } else {
239
+ return value;
240
+ }
241
+ },
242
+ previewFile: function (item) {
243
+ var fileCode = item.fileCode;
244
+ var fileName = item.fileName;
245
+ var fileType = item.fileType;
246
+ if(fileCode) {
247
+ let url = this.fileOnlinePreviewHost + this.ossServerContext + this.ossFilePreviewUrl + fileCode + "?fullfilename=" + fileName + "." + fileType;
248
+ window.open(config.fileOnlinePreviewContext + '/onlinePreview?url='+encodeURIComponent(this.encode64(url)));
249
+ }
250
+ },
203
251
  deleteFile: function (fileCode) {
204
252
  if (fileCode) {
205
253
  var result = [];