vue2-client 1.6.27 → 1.6.29
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.29",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
15
|
-
"@antv/g2plot": "^2.4.
|
|
15
|
+
"@antv/g2plot": "^2.4.29",
|
|
16
16
|
"lodash.get": "^4.4.2",
|
|
17
|
-
"js-base64": "^3.7.
|
|
18
|
-
"jsencrypt": "^3.2
|
|
17
|
+
"js-base64": "^3.7.5",
|
|
18
|
+
"jsencrypt": "^3.3.2",
|
|
19
19
|
"vue-json-viewer": "^2.2.22",
|
|
20
20
|
"xlsx": "0.18.5",
|
|
21
21
|
"file-saver": "^2.0.5",
|
|
@@ -25,37 +25,37 @@
|
|
|
25
25
|
"ant-design-vue": "^1.7.8",
|
|
26
26
|
"axios": "^0.27.2",
|
|
27
27
|
"clipboard": "^2.0.11",
|
|
28
|
-
"core-js": "^3.
|
|
29
|
-
"date-fns": "^2.
|
|
28
|
+
"core-js": "^3.30.1",
|
|
29
|
+
"date-fns": "^2.29.3",
|
|
30
30
|
"default-passive-events": "^2.0.0",
|
|
31
31
|
"enquire.js": "^2.1.6",
|
|
32
|
-
"highlight.js": "^
|
|
32
|
+
"highlight.js": "^11.7.0",
|
|
33
33
|
"js-cookie": "^2.2.1",
|
|
34
34
|
"mockjs": "^1.1.0",
|
|
35
35
|
"nprogress": "^0.2.0",
|
|
36
36
|
"viser-vue": "^2.4.8",
|
|
37
37
|
"vue": "2.6.14",
|
|
38
|
-
"vue-i18n": "^8.
|
|
39
|
-
"vue-router": "^3.5
|
|
38
|
+
"vue-i18n": "^8.28.2",
|
|
39
|
+
"vue-router": "^3.6.5",
|
|
40
40
|
"vuedraggable": "^2.24.3",
|
|
41
41
|
"vuex": "^3.6.2",
|
|
42
|
-
"vue-video-player": "5.0.2",
|
|
43
|
-
"videojs-contrib-hls": "5.
|
|
42
|
+
"vue-video-player": "^5.0.2",
|
|
43
|
+
"videojs-contrib-hls": "^5.15.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"script-loader": "^0.7.2",
|
|
47
|
-
"@ant-design/colors": "^
|
|
48
|
-
"@babel/core": "^7.
|
|
47
|
+
"@ant-design/colors": "^7.0.0",
|
|
48
|
+
"@babel/core": "^7.21.4",
|
|
49
49
|
"@vue/cli-plugin-babel": "^4.5.19",
|
|
50
50
|
"@vue/cli-plugin-eslint": "^4.5.19",
|
|
51
51
|
"@vue/cli-service": "^4.5.19",
|
|
52
52
|
"@vue/eslint-config-standard": "^4.0.0",
|
|
53
|
-
"@vuepress/plugin-back-to-top": "^1.9.
|
|
53
|
+
"@vuepress/plugin-back-to-top": "^1.9.9",
|
|
54
54
|
"babel-eslint": "^10.1.0",
|
|
55
55
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
56
56
|
"babel-polyfill": "^6.26.0",
|
|
57
57
|
"compression-webpack-plugin": "^4.0.1",
|
|
58
|
-
"deepmerge": "^4.
|
|
58
|
+
"deepmerge": "^4.3.1",
|
|
59
59
|
"eslint": "^6.8.0",
|
|
60
60
|
"eslint-plugin-import": "^2.26.0",
|
|
61
61
|
"eslint-plugin-node": "^11.1.0",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"style-resources-loader": "^1.5.0",
|
|
68
68
|
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
69
69
|
"vue-template-compiler": "2.6.14",
|
|
70
|
-
"vuepress": "^1.9.
|
|
70
|
+
"vuepress": "^1.9.9",
|
|
71
71
|
"webpack": "^4.46.0",
|
|
72
|
-
"webpack-theme-color-replacer": "1.4.
|
|
72
|
+
"webpack-theme-color-replacer": "^1.4.7",
|
|
73
73
|
"whatwg-fetch": "^3.6.2"
|
|
74
74
|
},
|
|
75
75
|
"browserslist": [
|
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-upload-dragger
|
|
4
|
-
v-if="model.type === 'file'"
|
|
5
|
-
:accept="model.accept.join('')"
|
|
6
|
-
:customRequest="uploadFiles"
|
|
7
|
-
:file-list="uploadedFileList"
|
|
8
|
-
:multiple="true"
|
|
9
|
-
:remove="deleteFileItem"
|
|
10
|
-
name="file">
|
|
11
|
-
<p class="ant-upload-drag-icon">
|
|
12
|
-
<a-icon type="inbox"/>
|
|
13
|
-
</p>
|
|
14
|
-
<p class="ant-upload-text">
|
|
15
|
-
点击或拖动文件到该区域上传
|
|
16
|
-
</p>
|
|
17
|
-
<p class="ant-upload-hint">
|
|
18
|
-
支持单个或多个文件
|
|
19
|
-
</p>
|
|
20
|
-
</a-upload-dragger>
|
|
21
|
-
<a-upload
|
|
22
|
-
v-if=" model.type === 'image'"
|
|
23
|
-
:accept="model.accept.join('')"
|
|
24
|
-
:customRequest="uploadFiles"
|
|
25
|
-
:file-list="uploadedFileList"
|
|
26
|
-
:remove="deleteFileItem"
|
|
27
|
-
list-type="picture-card">
|
|
28
|
-
<a-icon type="plus"/>
|
|
29
|
-
<div class="ant-upload-text">
|
|
30
|
-
Upload
|
|
31
|
-
</div>
|
|
32
|
-
</a-upload>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
|
|
38
|
-
import { post } from '@vue2-client/services/api'
|
|
39
|
-
import { mapState } from 'vuex'
|
|
40
|
-
import { upload } from '@vue2-client/services/api/common'
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
name: 'uploads',
|
|
44
|
-
data () {
|
|
45
|
-
return {
|
|
46
|
-
uploadedFileList: [],
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
props: {
|
|
50
|
-
// 表单属性
|
|
51
|
-
model: {
|
|
52
|
-
type: Object,
|
|
53
|
-
default: () => {
|
|
54
|
-
return {}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
files: {
|
|
58
|
-
type: Array,
|
|
59
|
-
default: () => {
|
|
60
|
-
return []
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
images: {
|
|
64
|
-
type: Array,
|
|
65
|
-
default: () => {
|
|
66
|
-
return []
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
serviceName: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: 'af-system'
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
computed: {
|
|
75
|
-
...mapState('account', { currUser: 'user' })
|
|
76
|
-
},
|
|
77
|
-
created () {
|
|
78
|
-
const list = this.model.type === 'file' ? [...this.files] : [...this.images]
|
|
79
|
-
if (this.model.useType) {
|
|
80
|
-
this.uploadedFileList = list.filter(item => item.f_use_type === this.model.useType)
|
|
81
|
-
} else {
|
|
82
|
-
this.uploadedFileList = list
|
|
83
|
-
}
|
|
84
|
-
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
|
|
85
|
-
},
|
|
86
|
-
methods: {
|
|
87
|
-
uploadFiles (info) {
|
|
88
|
-
if (this.uploadedFileList.length >= this.model.acceptCount) {
|
|
89
|
-
this.$message.error(`当前表单限制仅可上传 ${this.model.acceptCount} 个文件`)
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
|
-
// 初始化文件信息
|
|
93
|
-
const fileInfo = {
|
|
94
|
-
uid: info.file.uid,
|
|
95
|
-
name: info.file.name,
|
|
96
|
-
status: 'uploading',
|
|
97
|
-
response: '',
|
|
98
|
-
url: '',
|
|
99
|
-
}
|
|
100
|
-
// 放入上传列表中,以便于显示上传进度
|
|
101
|
-
this.uploadedFileList.push(fileInfo)
|
|
102
|
-
// 组装上传数据
|
|
103
|
-
const headers = {
|
|
104
|
-
'Content-Type': 'multipart/form-data',
|
|
105
|
-
}
|
|
106
|
-
const formData = new FormData()
|
|
107
|
-
formData.append('avatar', info.file)
|
|
108
|
-
formData.append('resUploadMode', this.model.resUploadMode ?? 'server')
|
|
109
|
-
if (this.model.pathKey) {
|
|
110
|
-
formData.append('pathKey', this.model.pathKey ?? 'Default')
|
|
111
|
-
}
|
|
112
|
-
// formData.append('stockAlias', this.model.stockAlias)
|
|
113
|
-
formData.append('formType', this.model.type)
|
|
114
|
-
formData.append('useType', this.model.useType ?? 'Default')
|
|
115
|
-
formData.append('resUploadStock', this.model.resUploadStock)
|
|
116
|
-
formData.append('filename', info.file.name)
|
|
117
|
-
formData.append('filesize', (info.file.size / 1024 / 1024).toFixed(4))
|
|
118
|
-
formData.append('f_operator', this.currUser ? this.currUser.username : '')
|
|
119
|
-
|
|
120
|
-
// const url = '/api/af-system/resource'
|
|
121
|
-
// if (process.env.NODE_ENV === 'production') {
|
|
122
|
-
// url = `/${this.model.stockAlias}/af-system/resource`
|
|
123
|
-
// }
|
|
124
|
-
upload(formData, this.serviceName, { headers, timeout:
|
|
125
|
-
// 根据服务端返回的结果判断成功与否,设置文件条目的状态
|
|
126
|
-
if (res.success) {
|
|
127
|
-
fileInfo.status = 'done'
|
|
128
|
-
let dataObj
|
|
129
|
-
if (typeof res.data === 'string') {
|
|
130
|
-
dataObj = JSON.parse(res.data)
|
|
131
|
-
} else {
|
|
132
|
-
dataObj = res.data
|
|
133
|
-
}
|
|
134
|
-
fileInfo.response = dataObj
|
|
135
|
-
fileInfo.id = dataObj.id
|
|
136
|
-
fileInfo.url = dataObj.f_downloadpath
|
|
137
|
-
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
|
|
138
|
-
this.$message.success('上传成功!')
|
|
139
|
-
} else {
|
|
140
|
-
fileInfo.status = 'error'
|
|
141
|
-
fileInfo.response = res.data
|
|
142
|
-
this.$message.error('上传失败!')
|
|
143
|
-
}
|
|
144
|
-
}).catch((e) => {
|
|
145
|
-
fileInfo.status = 'error'
|
|
146
|
-
fileInfo.response = e
|
|
147
|
-
this.$message.error(`请求失败!${e}`)
|
|
148
|
-
})
|
|
149
|
-
},
|
|
150
|
-
// 删除文件
|
|
151
|
-
deleteFileItem (file) {
|
|
152
|
-
if (file.id) {
|
|
153
|
-
post('/api/' + this.serviceName + '/entity/t_files', { id: file.id, f_state: '删除' }).then(res => {
|
|
154
|
-
}).catch(e => { })
|
|
155
|
-
}
|
|
156
|
-
// 找到当前文件所在列表的索引
|
|
157
|
-
const index = this.uploadedFileList.indexOf(file)
|
|
158
|
-
// 从列表中移除该文件
|
|
159
|
-
this.uploadedFileList.splice(index, 1)
|
|
160
|
-
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
|
|
161
|
-
return true
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
</script>
|
|
166
|
-
<style lang="less" scoped>
|
|
167
|
-
|
|
168
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-upload-dragger
|
|
4
|
+
v-if="model.type === 'file'"
|
|
5
|
+
:accept="model.accept.join('')"
|
|
6
|
+
:customRequest="uploadFiles"
|
|
7
|
+
:file-list="uploadedFileList"
|
|
8
|
+
:multiple="true"
|
|
9
|
+
:remove="deleteFileItem"
|
|
10
|
+
name="file">
|
|
11
|
+
<p class="ant-upload-drag-icon">
|
|
12
|
+
<a-icon type="inbox"/>
|
|
13
|
+
</p>
|
|
14
|
+
<p class="ant-upload-text">
|
|
15
|
+
点击或拖动文件到该区域上传
|
|
16
|
+
</p>
|
|
17
|
+
<p class="ant-upload-hint">
|
|
18
|
+
支持单个或多个文件
|
|
19
|
+
</p>
|
|
20
|
+
</a-upload-dragger>
|
|
21
|
+
<a-upload
|
|
22
|
+
v-if=" model.type === 'image'"
|
|
23
|
+
:accept="model.accept.join('')"
|
|
24
|
+
:customRequest="uploadFiles"
|
|
25
|
+
:file-list="uploadedFileList"
|
|
26
|
+
:remove="deleteFileItem"
|
|
27
|
+
list-type="picture-card">
|
|
28
|
+
<a-icon type="plus"/>
|
|
29
|
+
<div class="ant-upload-text">
|
|
30
|
+
Upload
|
|
31
|
+
</div>
|
|
32
|
+
</a-upload>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
|
|
38
|
+
import { post } from '@vue2-client/services/api'
|
|
39
|
+
import { mapState } from 'vuex'
|
|
40
|
+
import { upload } from '@vue2-client/services/api/common'
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'uploads',
|
|
44
|
+
data () {
|
|
45
|
+
return {
|
|
46
|
+
uploadedFileList: [],
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
props: {
|
|
50
|
+
// 表单属性
|
|
51
|
+
model: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => {
|
|
54
|
+
return {}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
files: {
|
|
58
|
+
type: Array,
|
|
59
|
+
default: () => {
|
|
60
|
+
return []
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
images: {
|
|
64
|
+
type: Array,
|
|
65
|
+
default: () => {
|
|
66
|
+
return []
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
serviceName: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: 'af-system'
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
computed: {
|
|
75
|
+
...mapState('account', { currUser: 'user' })
|
|
76
|
+
},
|
|
77
|
+
created () {
|
|
78
|
+
const list = this.model.type === 'file' ? [...this.files] : [...this.images]
|
|
79
|
+
if (this.model.useType) {
|
|
80
|
+
this.uploadedFileList = list.filter(item => item.f_use_type === this.model.useType)
|
|
81
|
+
} else {
|
|
82
|
+
this.uploadedFileList = list
|
|
83
|
+
}
|
|
84
|
+
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
uploadFiles (info) {
|
|
88
|
+
if (this.uploadedFileList.length >= this.model.acceptCount) {
|
|
89
|
+
this.$message.error(`当前表单限制仅可上传 ${this.model.acceptCount} 个文件`)
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
// 初始化文件信息
|
|
93
|
+
const fileInfo = {
|
|
94
|
+
uid: info.file.uid,
|
|
95
|
+
name: info.file.name,
|
|
96
|
+
status: 'uploading',
|
|
97
|
+
response: '',
|
|
98
|
+
url: '',
|
|
99
|
+
}
|
|
100
|
+
// 放入上传列表中,以便于显示上传进度
|
|
101
|
+
this.uploadedFileList.push(fileInfo)
|
|
102
|
+
// 组装上传数据
|
|
103
|
+
const headers = {
|
|
104
|
+
'Content-Type': 'multipart/form-data',
|
|
105
|
+
}
|
|
106
|
+
const formData = new FormData()
|
|
107
|
+
formData.append('avatar', info.file)
|
|
108
|
+
formData.append('resUploadMode', this.model.resUploadMode ?? 'server')
|
|
109
|
+
if (this.model.pathKey) {
|
|
110
|
+
formData.append('pathKey', this.model.pathKey ?? 'Default')
|
|
111
|
+
}
|
|
112
|
+
// formData.append('stockAlias', this.model.stockAlias)
|
|
113
|
+
formData.append('formType', this.model.type)
|
|
114
|
+
formData.append('useType', this.model.useType ?? 'Default')
|
|
115
|
+
formData.append('resUploadStock', this.model.resUploadStock)
|
|
116
|
+
formData.append('filename', info.file.name)
|
|
117
|
+
formData.append('filesize', (info.file.size / 1024 / 1024).toFixed(4))
|
|
118
|
+
formData.append('f_operator', this.currUser ? this.currUser.username : '')
|
|
119
|
+
|
|
120
|
+
// const url = '/api/af-system/resource'
|
|
121
|
+
// if (process.env.NODE_ENV === 'production') {
|
|
122
|
+
// url = `/${this.model.stockAlias}/af-system/resource`
|
|
123
|
+
// }
|
|
124
|
+
upload(formData, this.serviceName, { headers, timeout: 600 * 1000 }).then(res => {
|
|
125
|
+
// 根据服务端返回的结果判断成功与否,设置文件条目的状态
|
|
126
|
+
if (res.success) {
|
|
127
|
+
fileInfo.status = 'done'
|
|
128
|
+
let dataObj
|
|
129
|
+
if (typeof res.data === 'string') {
|
|
130
|
+
dataObj = JSON.parse(res.data)
|
|
131
|
+
} else {
|
|
132
|
+
dataObj = res.data
|
|
133
|
+
}
|
|
134
|
+
fileInfo.response = dataObj
|
|
135
|
+
fileInfo.id = dataObj.id
|
|
136
|
+
fileInfo.url = dataObj.f_downloadpath
|
|
137
|
+
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
|
|
138
|
+
this.$message.success('上传成功!')
|
|
139
|
+
} else {
|
|
140
|
+
fileInfo.status = 'error'
|
|
141
|
+
fileInfo.response = res.data
|
|
142
|
+
this.$message.error('上传失败!')
|
|
143
|
+
}
|
|
144
|
+
}).catch((e) => {
|
|
145
|
+
fileInfo.status = 'error'
|
|
146
|
+
fileInfo.response = e
|
|
147
|
+
this.$message.error(`请求失败!${e}`)
|
|
148
|
+
})
|
|
149
|
+
},
|
|
150
|
+
// 删除文件
|
|
151
|
+
deleteFileItem (file) {
|
|
152
|
+
if (file.id) {
|
|
153
|
+
post('/api/' + this.serviceName + '/entity/t_files', { id: file.id, f_state: '删除' }).then(res => {
|
|
154
|
+
}).catch(e => { })
|
|
155
|
+
}
|
|
156
|
+
// 找到当前文件所在列表的索引
|
|
157
|
+
const index = this.uploadedFileList.indexOf(file)
|
|
158
|
+
// 从列表中移除该文件
|
|
159
|
+
this.uploadedFileList.splice(index, 1)
|
|
160
|
+
this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
|
|
161
|
+
return true
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
</script>
|
|
166
|
+
<style lang="less" scoped>
|
|
167
|
+
|
|
168
|
+
</style>
|