apply-clients 3.5.5-3 → 3.5.5-4
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/build/dev-server.js +5 -9
- package/package.json +1 -1
- package/src/App.vue +25 -25
- package/src/apply.js +141 -141
- package/src/components/android/AppTakePic.vue +182 -182
- package/src/components/product/Function/Service/FunctionServiceControl.vue +497 -497
- package/src/components/product/Material/MaterialDetailed.vue +268 -268
- package/src/components/product/MaterialsManage/MaterialsBase.vue +181 -181
- package/src/components/product/MaterialsManage/MaterialsManage.vue +60 -60
- package/src/components/product/Process/Processes/contractModel.vue +458 -458
- package/src/components/product/ServiceView.vue +1028 -1028
- package/src/components/product/Supervisory/SupervisoryList.vue +452 -452
- package/src/filiale/dingcheng/pc/SupervisoryList.vue +441 -441
- package/src/filiale/fugou/android/AppAddMaterialScience.vue +440 -440
- package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
- package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -541
- package/src/filiale/fugou/android/AppServiceControl.vue +1836 -1836
- package/src/filiale/fugou/android/printCharge.vue +162 -162
- package/src/filiale/fugou/android.js +16 -16
- package/src/filiale/fugou/pc/ExplorationSelect.vue +525 -525
- package/src/filiale/fugou/pc/ServiceControl.vue +1705 -1705
- package/src/filiale/fugou/pc/ServiceView.vue +941 -941
- package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
- package/src/filiale/fugou/pc/printChargepc.vue +148 -148
- package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
- package/src/filiale/gongyi/android/AppDisclosurerecord.vue +214 -214
- package/src/filiale/gongyi/android/AppInstallationDetails.vue +500 -500
- package/src/filiale/gongyi/android/AppLegacyIssues.vue +309 -309
- package/src/filiale/gongyi/android/AppSign.vue +170 -170
- package/src/filiale/gongyi/android/AppSupplementalAgreement.vue +298 -298
- package/src/filiale/gongyi/android.js +18 -18
- package/src/filiale/gongyi/pc/ApplyUpload.vue +371 -371
- package/src/filiale/gongyi/pc/PcAddLogs.vue +221 -221
- package/src/filiale/gongyi/pc/PcDisclosurerecord.vue +218 -218
- package/src/filiale/gongyi/pc/PcLegacyIssues.vue +309 -309
- package/src/filiale/gongyi/pc/SupervisoryServiceControl.vue +894 -894
- package/src/filiale/gongyi/pc/SupervisoryServiceView.vue +1005 -1005
- package/src/filiale/gongyi/pc/addMaterialScience.vue +575 -575
- package/src/filiale/gongyi/pc/chargeManagement.vue +765 -765
- package/src/filiale/gongyi/pc/supplementalAgreement.vue +277 -277
- package/src/filiale/gongyi/pc.js +24 -24
- package/src/filiale/hongda/pc/SupervisoryList.vue +422 -422
- package/src/filiale/jingyang/pc/SupervisoryList.vue +459 -459
- package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
- package/src/filiale/qianneng/android.js +15 -15
- package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -261
- package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
- package/src/filiale/qianneng/pc.js +29 -29
- package/src/filiale/ruihua/pc/ServiceControl.vue +1966 -1966
- package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +520 -520
- package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +645 -645
- package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1703 -1706
- package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +547 -547
- package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2112 -2115
- package/src/filiale/yangchunboneng/pc/ServiceView.vue +1007 -1007
- package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +605 -605
- package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +683 -683
- package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1052 -1052
- package/src/filiale/yangchunboneng/pc/devicesManagement.vue +574 -574
- package/src/main.js +3 -3
- package/~/chatbot/main.py +0 -57
|
@@ -1,371 +1,371 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="col-sm-12" style="background-color: #FFFFFF">
|
|
3
|
-
<div class="col-sm-12" style="padding:50px 100px;height: 25%">
|
|
4
|
-
<div class="form-group col-sm-5" v-if="issearch">
|
|
5
|
-
<label class="col-sm-2 control-label">文件类型:</label>
|
|
6
|
-
<v-select
|
|
7
|
-
class="select select_list"
|
|
8
|
-
:value.sync="useType"
|
|
9
|
-
width="50%"
|
|
10
|
-
v-model="useType"
|
|
11
|
-
:options='typeOfUse'
|
|
12
|
-
:valueSingle="true"></v-select>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="form-group col-sm-5" v-if="issearch" >
|
|
15
|
-
<label class="col-sm-2 control-label">环节:</label>
|
|
16
|
-
<v-select
|
|
17
|
-
class="select select_list"
|
|
18
|
-
:value.sync="defname"
|
|
19
|
-
width="50%"
|
|
20
|
-
v-model="defname"
|
|
21
|
-
:options='defnames'
|
|
22
|
-
:valueSingle="true"></v-select>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="form-group col-sm-2" style="text-align: center" v-if="issearch">
|
|
25
|
-
<button type="button" class="btn btn-primary item_btn" @click="load">搜索</button>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="form-group col-sm-2" style="text-align: center" v-if="isupload">
|
|
28
|
-
<button type="button" class="btn btn-primary item_btn" @click="showUpload = !showUpload">本地上传</button>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="form-group col-sm-2" style="text-align: center" v-if="takeimg">
|
|
31
|
-
<button type="button" class="btn btn-primary item_btn" @click="upload()">拍照</button>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
<hr style="width: 90%;margin: 0px auto;border: #999999 1px solid;"/>
|
|
35
|
-
<div class="col-sm-12" style="overflow: scroll;height: 75%">
|
|
36
|
-
<div :class="bootstraped ? bootstraped + ' showData' : 'col-sm-6 showData'" v-for="row in fileInfoData">
|
|
37
|
-
<div class="col-sm-12 item">
|
|
38
|
-
<div class="left col-sm-5">
|
|
39
|
-
<a href="#" class="thumbnail" style="width: 100%;height: 100%">
|
|
40
|
-
<img v-if="row.f_filetype === 'jpg'||row.f_filetype === 'png'||row.f_filetype === 'gif'||row.f_filetype === 'bmp'" :src="row.f_downloadURL" alt="..."/>
|
|
41
|
-
<img v-if="row.f_filetype === 'pdf'" src="../../../components/image/pdf.jpg" alt="" />
|
|
42
|
-
<img v-if="row.f_filetype === 'xls'||row.f_filetype === 'xlsx'" src="../../../components/image/excel.jpg" alt="" />
|
|
43
|
-
<img v-if="row.f_filetype === 'doc'||row.f_filetype === 'docx'" src="../../../components/image/doc.jpg" alt="" />
|
|
44
|
-
<img v-if="row.f_filetype === 'dwg'" src="../../../components/image/dwg.jpg" alt="" />
|
|
45
|
-
<img v-if="row.f_filetype === 'txt'" src="../../../components/image/txt.jpg" alt="" />
|
|
46
|
-
</a>
|
|
47
|
-
</div>
|
|
48
|
-
<div class="right col-sm-7">
|
|
49
|
-
<p :title="row.f_filename" class="clears"><strong>文件名:</strong>{{row.f_filename}}</p>
|
|
50
|
-
<p :title="row.f_username" class="clears"><strong>操作员:</strong><span>{{row.f_username}}</span></p>
|
|
51
|
-
<p :title="row.fusetype" class="clears"><strong>使用类型:</strong><span>{{row.fusetype}}</span></p>
|
|
52
|
-
<p :title="row.defname" class="clears"><strong>上传环节:</strong><span>{{row.defname}}</span></p>
|
|
53
|
-
<p :title="row.f_uploaddate" class="clears"><strong>上传时间:</strong><span>{{row.f_uploaddate}}</span></p>
|
|
54
|
-
<p :title="row.fremarks" class="clears"><strong>文件说明:</strong>{{row.fremarks}}</p>
|
|
55
|
-
<p class="clears">
|
|
56
|
-
<a v-if="row.f_filetype === 'jpg' || row.f_filetype === 'txt' || row.f_filetype==='png' || row.f_filetype==='gif' || row.f_filetype==='bmp'" :href="row.f_downloadURL" style="background:#6aa6e2" class="btn btn-primary" target="_blank" role="button">预览</a>
|
|
57
|
-
<a v-else @click="downloadfile(row.f_downloadURL,row)" style="background:#6aa6e2" class="btn btn-primary" role="button">下载</a>
|
|
58
|
-
<a v-if="isdelete" @click="delet($index, row)" href="#" class="btn btn-default" role="button" role="button">删除</a>
|
|
59
|
-
</p>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
<apply-high-meter
|
|
66
|
-
v-if="showhighmeter"
|
|
67
|
-
:show.sync="showhighmeter"
|
|
68
|
-
:isusetype="isusetype"
|
|
69
|
-
:isremark="isremark"
|
|
70
|
-
@photo-finish="newPhoto"
|
|
71
|
-
v-ref:ltgao
|
|
72
|
-
></apply-high-meter>
|
|
73
|
-
<modal :show.sync="showUpload" v-ref:modal backdrop="false">
|
|
74
|
-
<header slot="modal-header" class="modal-header">
|
|
75
|
-
<button type="button" class="close" @click="close"><span class="glyphicon glyphicon-remove"></span></button>
|
|
76
|
-
<h4 class="modal-title" style="text-align: center">文件上传</h4>
|
|
77
|
-
</header>
|
|
78
|
-
<article slot="modal-body" class="modal-body form-horizontal">
|
|
79
|
-
<div class="form-group" style="text-align: center">
|
|
80
|
-
<file-upload class="my-file-uploader" :name="'myFile' + blodid"
|
|
81
|
-
action="rs/file/uploadFile" tagname="文件上传" :headers="headers" multiple v-ref:file></file-upload>
|
|
82
|
-
</div>
|
|
83
|
-
<div class="form-group" v-if="isusetype">
|
|
84
|
-
<label class="col-sm-2 control-label">文件类型:</label>
|
|
85
|
-
<div class="col-sm-10">
|
|
86
|
-
<input-select
|
|
87
|
-
class="select select_list"
|
|
88
|
-
:value.sync="headers.fusetype"
|
|
89
|
-
v-model="headers.fusetype"
|
|
90
|
-
:options="$appdata.getParam('报建-使用类型')"
|
|
91
|
-
:valueSingle="true"></input-select>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
<div class="form-group" v-if="isremark">
|
|
95
|
-
<label class="col-sm-2 control-label">文件说明:</label>
|
|
96
|
-
<div class="col-sm-10">
|
|
97
|
-
<input class="form-control input_view" style=""
|
|
98
|
-
v-model="headers.fremarks"
|
|
99
|
-
:value="headers.fremarks"/>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</article>
|
|
103
|
-
<footer slot="modal-footer" class="modal-footer">
|
|
104
|
-
</footer>
|
|
105
|
-
</modal>
|
|
106
|
-
</template>
|
|
107
|
-
|
|
108
|
-
<script>
|
|
109
|
-
import {HttpResetClass} from 'vue-client'
|
|
110
|
-
import {isEmpty} from "../../../components/Util";
|
|
111
|
-
export default {
|
|
112
|
-
title: '附件',
|
|
113
|
-
props: ['blodid', 'businessid', 'isremark', 'isusetype', 'takeimg', 'defname', 'isupload', 'isdelete', 'bootstraped', 'issearch','source'],
|
|
114
|
-
data () {
|
|
115
|
-
return {
|
|
116
|
-
unlookfile: [ ...this.$appdata.getParam('附件限制类型')],
|
|
117
|
-
defnames: [{label: '全部', value: ''}, ...this.$appdata.getParam('报建节点')],
|
|
118
|
-
fileInfoData: [], // 数据库存储的文件记录对象数组
|
|
119
|
-
headers: {'username': this.$login.f.name, 'blodid': '','businessid':'', 'fremarks': '','defname':'','fusetype':''}, // 调用rs/file/uploadFile 的参数
|
|
120
|
-
showUpload: false, // 上传模态框控制
|
|
121
|
-
showhighmeter: false, // 高拍仪组件控制
|
|
122
|
-
useType: null,
|
|
123
|
-
defname:null
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
ready () {
|
|
127
|
-
this.headers.blodid = this.blodid
|
|
128
|
-
this.headers.businessid = this.businessid
|
|
129
|
-
this.headers.defname = this.defname
|
|
130
|
-
if (this.blodid || this.businessid) {
|
|
131
|
-
this.load()
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
methods: {
|
|
135
|
-
delet(index, row) {
|
|
136
|
-
//判断是否有删除文件的权限
|
|
137
|
-
if(this.$login.r.includes('附件删除')){
|
|
138
|
-
this.$resetdelete('rs/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
|
|
139
|
-
this.$dispatch("delResid",row.id)
|
|
140
|
-
this.load()
|
|
141
|
-
})
|
|
142
|
-
}else{
|
|
143
|
-
this.$showMessage('您暂无删除附件的权限')
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
// 下载
|
|
147
|
-
downloadfile(filepath,row){
|
|
148
|
-
//判断当前文件的使用类型,是否是限制查看的附件
|
|
149
|
-
for (let i = 0; i < this.unlookfile.length; i++) {
|
|
150
|
-
if(row.fusetype===this.unlookfile[i].value){
|
|
151
|
-
if(!this.$login.r.includes('查看全部附件')){
|
|
152
|
-
this.$showMessage('您暂无查看当前附件的权限')
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
let name1= this.extractFileNameFromUrl(filepath)
|
|
158
|
-
let name=this.extractFileName(name1)
|
|
159
|
-
if(filepath.toString().endsWith(".dwg")){
|
|
160
|
-
var xhr = new XMLHttpRequest();
|
|
161
|
-
xhr.open('GET', filepath, true);
|
|
162
|
-
// 设置Accept头以指定下载.dwg文件
|
|
163
|
-
xhr.setRequestHeader('Accept', ' application/acad, application/x-acad, image/x-dwg');
|
|
164
|
-
xhr.onload = function() {
|
|
165
|
-
if (xhr.status === 200) {
|
|
166
|
-
// 创建隐藏的a元素并设置其href属性为下载的数据
|
|
167
|
-
var link = document.createElement('a');
|
|
168
|
-
link.href =filepath;
|
|
169
|
-
// 设置文件名
|
|
170
|
-
link.download =name+'.dwg';// 假设存在getFileNameFromUrl函数来获取文件名
|
|
171
|
-
// 触发下载事件
|
|
172
|
-
link.dispatchEvent(new MouseEvent('click'));
|
|
173
|
-
} else {
|
|
174
|
-
console.error('Failed to download file:', xhr.statusText);
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
xhr.send();
|
|
178
|
-
}else{
|
|
179
|
-
var link = document.createElement('a');
|
|
180
|
-
link.href = filepath;
|
|
181
|
-
link.target='_blank'
|
|
182
|
-
link.dispatchEvent(new MouseEvent('click'));
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
extractFileNameFromUrl(url) {
|
|
186
|
-
// 使用split分割URL
|
|
187
|
-
var parts = url.split('/');
|
|
188
|
-
// 获取最后一个部分,这通常是文件名
|
|
189
|
-
var fileName = parts[parts.length - 1];
|
|
190
|
-
// 返回文件名(不包括扩展名)
|
|
191
|
-
return fileName.split('.')[0];
|
|
192
|
-
},
|
|
193
|
-
extractFileName(str) {
|
|
194
|
-
// 使用split分割字符串
|
|
195
|
-
var parts = str.split('\\');
|
|
196
|
-
// 获取最后一个部分,这通常是文件名
|
|
197
|
-
var fileName = parts[parts.length - 1];
|
|
198
|
-
// 返回文件名
|
|
199
|
-
return fileName;
|
|
200
|
-
},
|
|
201
|
-
// 关闭文件上传对话框
|
|
202
|
-
close () {
|
|
203
|
-
this.showUpload = false
|
|
204
|
-
this.showhighmeter = false
|
|
205
|
-
// 将选的文件清空
|
|
206
|
-
this.$refs.file.$el.querySelector('input').value = ''
|
|
207
|
-
this.headers.fusetype = ''
|
|
208
|
-
this.headers.fremarks = ''
|
|
209
|
-
this.load()
|
|
210
|
-
},
|
|
211
|
-
// 查询
|
|
212
|
-
async load() {
|
|
213
|
-
let condition = ''
|
|
214
|
-
if(!isEmpty(this.businessid)){
|
|
215
|
-
condition = `f_businessid= '${this.headers.businessid}' `
|
|
216
|
-
}else{
|
|
217
|
-
condition = `f_blobid= '${this.headers.blodid}' `
|
|
218
|
-
}
|
|
219
|
-
if (!isEmpty(this.useType)) {
|
|
220
|
-
condition += `and fusetype like '${this.useType}'`
|
|
221
|
-
}
|
|
222
|
-
if (!isEmpty(this.defname)) {
|
|
223
|
-
condition += `and defname = '${this.defname}'`
|
|
224
|
-
}
|
|
225
|
-
let http = new HttpResetClass()
|
|
226
|
-
let data = {
|
|
227
|
-
tablename: 't_files',
|
|
228
|
-
condition: condition + ` order by f_uploaddate desc `
|
|
229
|
-
}
|
|
230
|
-
let getFile = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
|
|
231
|
-
warnMsg: null,
|
|
232
|
-
resolveMsg: null
|
|
233
|
-
})
|
|
234
|
-
|
|
235
|
-
for (var i = 0; i < getFile.data.length; i++) {
|
|
236
|
-
// 如果使用类型包含导入字样,则是execl文件导入的,不做显示
|
|
237
|
-
if(getFile.data[i].fusetype&&(getFile.data[i].fusetype.includes('execl导入'))){
|
|
238
|
-
getFile.data.splice(i,1)
|
|
239
|
-
i--
|
|
240
|
-
continue
|
|
241
|
-
}
|
|
242
|
-
let temp = getFile.data[i].f_downloadpath
|
|
243
|
-
let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
|
|
244
|
-
getFile.data[i].f_downloadURL = "http://" + location.host + "/" + URL
|
|
245
|
-
}
|
|
246
|
-
for (var i = 0; i < getFile.data.length; i++) {
|
|
247
|
-
if(getFile.data[i].f_downloadpath.includes('http:')){
|
|
248
|
-
let temp = getFile.data[i].f_downloadpath
|
|
249
|
-
getFile.data[i].f_downloadURL = temp
|
|
250
|
-
console.log('打印',i)
|
|
251
|
-
}else{
|
|
252
|
-
if(getFile.data[i].f_downloadpath.includes('http:')){
|
|
253
|
-
let temp = getFile.data[i].f_downloadpath
|
|
254
|
-
getFile.data[i].f_downloadURL = temp
|
|
255
|
-
console.log('打印',i)
|
|
256
|
-
}else{
|
|
257
|
-
let temp = getFile.data[i].f_downloadpath
|
|
258
|
-
let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
|
|
259
|
-
if(temp.includes('afFiles')){
|
|
260
|
-
let modifiedString = URL.replace(/^:\/\//, '/');
|
|
261
|
-
modifiedString = modifiedString.replace(/\/\//g, '/');
|
|
262
|
-
console.log( modifiedString)
|
|
263
|
-
getFile.data[i].f_downloadURL ="http://" + location.host + modifiedString
|
|
264
|
-
}else{
|
|
265
|
-
getFile.data[i].f_downloadURL ="http://" + location.host + "/" + URL
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
this.fileInfoData = []
|
|
272
|
-
this.fileInfoData = getFile.data
|
|
273
|
-
},
|
|
274
|
-
// 打开高拍仪
|
|
275
|
-
upload () {
|
|
276
|
-
if(this.showhighmeter){
|
|
277
|
-
this.$refs.ltgao.closeVideo()
|
|
278
|
-
}
|
|
279
|
-
this.showhighmeter = !this.showhighmeter
|
|
280
|
-
},
|
|
281
|
-
// 高拍仪回调
|
|
282
|
-
newPhoto(Imgbase64, fusetype, fremarks) {
|
|
283
|
-
this.headers.fusetype = fusetype
|
|
284
|
-
this.headers.fremarks = fremarks
|
|
285
|
-
|
|
286
|
-
let form = new FormData()
|
|
287
|
-
let xhr = new XMLHttpRequest()
|
|
288
|
-
let formDataBoundary = "----WebkitFormBoundary" + "GaoPaiYi";
|
|
289
|
-
form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
|
|
290
|
-
form.append('file', this.convertBase64ToBlob(Imgbase64), "GaoPaiYi.jpg")
|
|
291
|
-
xhr.open("POST", "rs/file/uploadFile")
|
|
292
|
-
|
|
293
|
-
if (this.headers) {
|
|
294
|
-
for (var header in this.headers) {
|
|
295
|
-
xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
xhr.send(form)
|
|
299
|
-
setTimeout(() => {
|
|
300
|
-
this.close()
|
|
301
|
-
}, 5000)
|
|
302
|
-
},
|
|
303
|
-
convertBase64ToBlob(base64String) {
|
|
304
|
-
// 将base64解码
|
|
305
|
-
var bytes = atob(base64String);
|
|
306
|
-
//var bytes = base64;
|
|
307
|
-
var bytesCode = new ArrayBuffer(bytes.length);
|
|
308
|
-
// 转换为类型化数组
|
|
309
|
-
var byteArray = new Uint8Array(bytesCode);
|
|
310
|
-
|
|
311
|
-
// 将base64转换为ascii码
|
|
312
|
-
for (var i = 0; i < bytes.length; i++) {
|
|
313
|
-
byteArray[i] = bytes.charCodeAt(i);
|
|
314
|
-
}
|
|
315
|
-
// 生成Blob对象(文件对象)
|
|
316
|
-
return new Blob([bytesCode], {type: 'image/jpeg'});
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
computed: {
|
|
320
|
-
typeOfUse () {
|
|
321
|
-
return [{label: '全部', value: ''}, ...this.$appdata.getParam('报建-使用类型')]
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
events: {
|
|
325
|
-
onFileUpload: function (file, res) {
|
|
326
|
-
this.$dispatch("resid",res.id)
|
|
327
|
-
this.headers.fremarks=''
|
|
328
|
-
this.close()
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
</script>
|
|
333
|
-
|
|
334
|
-
<style scoped>
|
|
335
|
-
.clears{
|
|
336
|
-
overflow:hidden;
|
|
337
|
-
text-overflow:ellipsis;
|
|
338
|
-
white-space:nowrap;
|
|
339
|
-
}
|
|
340
|
-
.showData {
|
|
341
|
-
padding: 15px 10px 0px 10px;
|
|
342
|
-
box-sizing: border-box;
|
|
343
|
-
height: 230px;
|
|
344
|
-
font-family: "微软雅黑";
|
|
345
|
-
}
|
|
346
|
-
.showData .item{
|
|
347
|
-
padding-bottom: 10px;
|
|
348
|
-
border-bottom: solid 1px #c1c1c1;
|
|
349
|
-
}
|
|
350
|
-
.left {
|
|
351
|
-
padding-right: 10px;
|
|
352
|
-
}
|
|
353
|
-
.left img{
|
|
354
|
-
height: 100%;
|
|
355
|
-
width: 100%;
|
|
356
|
-
}
|
|
357
|
-
.right{
|
|
358
|
-
height: 100%;
|
|
359
|
-
/*display: -webkit-flex;*/
|
|
360
|
-
/*display: flex;*/
|
|
361
|
-
/*flex-direction: column;*/
|
|
362
|
-
/*justify-content: space-around;*/
|
|
363
|
-
}
|
|
364
|
-
.item_btn{
|
|
365
|
-
width: 80%;
|
|
366
|
-
background-color: #6aa6e2;
|
|
367
|
-
border-radius: 4px;
|
|
368
|
-
color: #FFFFFF;
|
|
369
|
-
font-family: PingFang;
|
|
370
|
-
}
|
|
371
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="col-sm-12" style="background-color: #FFFFFF">
|
|
3
|
+
<div class="col-sm-12" style="padding:50px 100px;height: 25%">
|
|
4
|
+
<div class="form-group col-sm-5" v-if="issearch">
|
|
5
|
+
<label class="col-sm-2 control-label">文件类型:</label>
|
|
6
|
+
<v-select
|
|
7
|
+
class="select select_list"
|
|
8
|
+
:value.sync="useType"
|
|
9
|
+
width="50%"
|
|
10
|
+
v-model="useType"
|
|
11
|
+
:options='typeOfUse'
|
|
12
|
+
:valueSingle="true"></v-select>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="form-group col-sm-5" v-if="issearch" >
|
|
15
|
+
<label class="col-sm-2 control-label">环节:</label>
|
|
16
|
+
<v-select
|
|
17
|
+
class="select select_list"
|
|
18
|
+
:value.sync="defname"
|
|
19
|
+
width="50%"
|
|
20
|
+
v-model="defname"
|
|
21
|
+
:options='defnames'
|
|
22
|
+
:valueSingle="true"></v-select>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="form-group col-sm-2" style="text-align: center" v-if="issearch">
|
|
25
|
+
<button type="button" class="btn btn-primary item_btn" @click="load">搜索</button>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="form-group col-sm-2" style="text-align: center" v-if="isupload">
|
|
28
|
+
<button type="button" class="btn btn-primary item_btn" @click="showUpload = !showUpload">本地上传</button>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="form-group col-sm-2" style="text-align: center" v-if="takeimg">
|
|
31
|
+
<button type="button" class="btn btn-primary item_btn" @click="upload()">拍照</button>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<hr style="width: 90%;margin: 0px auto;border: #999999 1px solid;"/>
|
|
35
|
+
<div class="col-sm-12" style="overflow: scroll;height: 75%">
|
|
36
|
+
<div :class="bootstraped ? bootstraped + ' showData' : 'col-sm-6 showData'" v-for="row in fileInfoData">
|
|
37
|
+
<div class="col-sm-12 item">
|
|
38
|
+
<div class="left col-sm-5">
|
|
39
|
+
<a href="#" class="thumbnail" style="width: 100%;height: 100%">
|
|
40
|
+
<img v-if="row.f_filetype === 'jpg'||row.f_filetype === 'png'||row.f_filetype === 'gif'||row.f_filetype === 'bmp'" :src="row.f_downloadURL" alt="..."/>
|
|
41
|
+
<img v-if="row.f_filetype === 'pdf'" src="../../../components/image/pdf.jpg" alt="" />
|
|
42
|
+
<img v-if="row.f_filetype === 'xls'||row.f_filetype === 'xlsx'" src="../../../components/image/excel.jpg" alt="" />
|
|
43
|
+
<img v-if="row.f_filetype === 'doc'||row.f_filetype === 'docx'" src="../../../components/image/doc.jpg" alt="" />
|
|
44
|
+
<img v-if="row.f_filetype === 'dwg'" src="../../../components/image/dwg.jpg" alt="" />
|
|
45
|
+
<img v-if="row.f_filetype === 'txt'" src="../../../components/image/txt.jpg" alt="" />
|
|
46
|
+
</a>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="right col-sm-7">
|
|
49
|
+
<p :title="row.f_filename" class="clears"><strong>文件名:</strong>{{row.f_filename}}</p>
|
|
50
|
+
<p :title="row.f_username" class="clears"><strong>操作员:</strong><span>{{row.f_username}}</span></p>
|
|
51
|
+
<p :title="row.fusetype" class="clears"><strong>使用类型:</strong><span>{{row.fusetype}}</span></p>
|
|
52
|
+
<p :title="row.defname" class="clears"><strong>上传环节:</strong><span>{{row.defname}}</span></p>
|
|
53
|
+
<p :title="row.f_uploaddate" class="clears"><strong>上传时间:</strong><span>{{row.f_uploaddate}}</span></p>
|
|
54
|
+
<p :title="row.fremarks" class="clears"><strong>文件说明:</strong>{{row.fremarks}}</p>
|
|
55
|
+
<p class="clears">
|
|
56
|
+
<a v-if="row.f_filetype === 'jpg' || row.f_filetype === 'txt' || row.f_filetype==='png' || row.f_filetype==='gif' || row.f_filetype==='bmp'" :href="row.f_downloadURL" style="background:#6aa6e2" class="btn btn-primary" target="_blank" role="button">预览</a>
|
|
57
|
+
<a v-else @click="downloadfile(row.f_downloadURL,row)" style="background:#6aa6e2" class="btn btn-primary" role="button">下载</a>
|
|
58
|
+
<a v-if="isdelete" @click="delet($index, row)" href="#" class="btn btn-default" role="button" role="button">删除</a>
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<apply-high-meter
|
|
66
|
+
v-if="showhighmeter"
|
|
67
|
+
:show.sync="showhighmeter"
|
|
68
|
+
:isusetype="isusetype"
|
|
69
|
+
:isremark="isremark"
|
|
70
|
+
@photo-finish="newPhoto"
|
|
71
|
+
v-ref:ltgao
|
|
72
|
+
></apply-high-meter>
|
|
73
|
+
<modal :show.sync="showUpload" v-ref:modal backdrop="false">
|
|
74
|
+
<header slot="modal-header" class="modal-header">
|
|
75
|
+
<button type="button" class="close" @click="close"><span class="glyphicon glyphicon-remove"></span></button>
|
|
76
|
+
<h4 class="modal-title" style="text-align: center">文件上传</h4>
|
|
77
|
+
</header>
|
|
78
|
+
<article slot="modal-body" class="modal-body form-horizontal">
|
|
79
|
+
<div class="form-group" style="text-align: center">
|
|
80
|
+
<file-upload class="my-file-uploader" :name="'myFile' + blodid"
|
|
81
|
+
action="rs/file/uploadFile" tagname="文件上传" :headers="headers" multiple v-ref:file></file-upload>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="form-group" v-if="isusetype">
|
|
84
|
+
<label class="col-sm-2 control-label">文件类型:</label>
|
|
85
|
+
<div class="col-sm-10">
|
|
86
|
+
<input-select
|
|
87
|
+
class="select select_list"
|
|
88
|
+
:value.sync="headers.fusetype"
|
|
89
|
+
v-model="headers.fusetype"
|
|
90
|
+
:options="$appdata.getParam('报建-使用类型')"
|
|
91
|
+
:valueSingle="true"></input-select>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="form-group" v-if="isremark">
|
|
95
|
+
<label class="col-sm-2 control-label">文件说明:</label>
|
|
96
|
+
<div class="col-sm-10">
|
|
97
|
+
<input class="form-control input_view" style=""
|
|
98
|
+
v-model="headers.fremarks"
|
|
99
|
+
:value="headers.fremarks"/>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</article>
|
|
103
|
+
<footer slot="modal-footer" class="modal-footer">
|
|
104
|
+
</footer>
|
|
105
|
+
</modal>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<script>
|
|
109
|
+
import {HttpResetClass} from 'vue-client'
|
|
110
|
+
import {isEmpty} from "../../../components/Util";
|
|
111
|
+
export default {
|
|
112
|
+
title: '附件',
|
|
113
|
+
props: ['blodid', 'businessid', 'isremark', 'isusetype', 'takeimg', 'defname', 'isupload', 'isdelete', 'bootstraped', 'issearch','source'],
|
|
114
|
+
data () {
|
|
115
|
+
return {
|
|
116
|
+
unlookfile: [ ...this.$appdata.getParam('附件限制类型')],
|
|
117
|
+
defnames: [{label: '全部', value: ''}, ...this.$appdata.getParam('报建节点')],
|
|
118
|
+
fileInfoData: [], // 数据库存储的文件记录对象数组
|
|
119
|
+
headers: {'username': this.$login.f.name, 'blodid': '','businessid':'', 'fremarks': '','defname':'','fusetype':''}, // 调用rs/file/uploadFile 的参数
|
|
120
|
+
showUpload: false, // 上传模态框控制
|
|
121
|
+
showhighmeter: false, // 高拍仪组件控制
|
|
122
|
+
useType: null,
|
|
123
|
+
defname:null
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
ready () {
|
|
127
|
+
this.headers.blodid = this.blodid
|
|
128
|
+
this.headers.businessid = this.businessid
|
|
129
|
+
this.headers.defname = this.defname
|
|
130
|
+
if (this.blodid || this.businessid) {
|
|
131
|
+
this.load()
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
methods: {
|
|
135
|
+
delet(index, row) {
|
|
136
|
+
//判断是否有删除文件的权限
|
|
137
|
+
if(this.$login.r.includes('附件删除')){
|
|
138
|
+
this.$resetdelete('rs/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
|
|
139
|
+
this.$dispatch("delResid",row.id)
|
|
140
|
+
this.load()
|
|
141
|
+
})
|
|
142
|
+
}else{
|
|
143
|
+
this.$showMessage('您暂无删除附件的权限')
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
// 下载
|
|
147
|
+
downloadfile(filepath,row){
|
|
148
|
+
//判断当前文件的使用类型,是否是限制查看的附件
|
|
149
|
+
for (let i = 0; i < this.unlookfile.length; i++) {
|
|
150
|
+
if(row.fusetype===this.unlookfile[i].value){
|
|
151
|
+
if(!this.$login.r.includes('查看全部附件')){
|
|
152
|
+
this.$showMessage('您暂无查看当前附件的权限')
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
let name1= this.extractFileNameFromUrl(filepath)
|
|
158
|
+
let name=this.extractFileName(name1)
|
|
159
|
+
if(filepath.toString().endsWith(".dwg")){
|
|
160
|
+
var xhr = new XMLHttpRequest();
|
|
161
|
+
xhr.open('GET', filepath, true);
|
|
162
|
+
// 设置Accept头以指定下载.dwg文件
|
|
163
|
+
xhr.setRequestHeader('Accept', ' application/acad, application/x-acad, image/x-dwg');
|
|
164
|
+
xhr.onload = function() {
|
|
165
|
+
if (xhr.status === 200) {
|
|
166
|
+
// 创建隐藏的a元素并设置其href属性为下载的数据
|
|
167
|
+
var link = document.createElement('a');
|
|
168
|
+
link.href =filepath;
|
|
169
|
+
// 设置文件名
|
|
170
|
+
link.download =name+'.dwg';// 假设存在getFileNameFromUrl函数来获取文件名
|
|
171
|
+
// 触发下载事件
|
|
172
|
+
link.dispatchEvent(new MouseEvent('click'));
|
|
173
|
+
} else {
|
|
174
|
+
console.error('Failed to download file:', xhr.statusText);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
xhr.send();
|
|
178
|
+
}else{
|
|
179
|
+
var link = document.createElement('a');
|
|
180
|
+
link.href = filepath;
|
|
181
|
+
link.target='_blank'
|
|
182
|
+
link.dispatchEvent(new MouseEvent('click'));
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
extractFileNameFromUrl(url) {
|
|
186
|
+
// 使用split分割URL
|
|
187
|
+
var parts = url.split('/');
|
|
188
|
+
// 获取最后一个部分,这通常是文件名
|
|
189
|
+
var fileName = parts[parts.length - 1];
|
|
190
|
+
// 返回文件名(不包括扩展名)
|
|
191
|
+
return fileName.split('.')[0];
|
|
192
|
+
},
|
|
193
|
+
extractFileName(str) {
|
|
194
|
+
// 使用split分割字符串
|
|
195
|
+
var parts = str.split('\\');
|
|
196
|
+
// 获取最后一个部分,这通常是文件名
|
|
197
|
+
var fileName = parts[parts.length - 1];
|
|
198
|
+
// 返回文件名
|
|
199
|
+
return fileName;
|
|
200
|
+
},
|
|
201
|
+
// 关闭文件上传对话框
|
|
202
|
+
close () {
|
|
203
|
+
this.showUpload = false
|
|
204
|
+
this.showhighmeter = false
|
|
205
|
+
// 将选的文件清空
|
|
206
|
+
this.$refs.file.$el.querySelector('input').value = ''
|
|
207
|
+
this.headers.fusetype = ''
|
|
208
|
+
this.headers.fremarks = ''
|
|
209
|
+
this.load()
|
|
210
|
+
},
|
|
211
|
+
// 查询
|
|
212
|
+
async load() {
|
|
213
|
+
let condition = ''
|
|
214
|
+
if(!isEmpty(this.businessid)){
|
|
215
|
+
condition = `f_businessid= '${this.headers.businessid}' `
|
|
216
|
+
}else{
|
|
217
|
+
condition = `f_blobid= '${this.headers.blodid}' `
|
|
218
|
+
}
|
|
219
|
+
if (!isEmpty(this.useType)) {
|
|
220
|
+
condition += `and fusetype like '${this.useType}'`
|
|
221
|
+
}
|
|
222
|
+
if (!isEmpty(this.defname)) {
|
|
223
|
+
condition += `and defname = '${this.defname}'`
|
|
224
|
+
}
|
|
225
|
+
let http = new HttpResetClass()
|
|
226
|
+
let data = {
|
|
227
|
+
tablename: 't_files',
|
|
228
|
+
condition: condition + ` order by f_uploaddate desc `
|
|
229
|
+
}
|
|
230
|
+
let getFile = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
|
|
231
|
+
warnMsg: null,
|
|
232
|
+
resolveMsg: null
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
for (var i = 0; i < getFile.data.length; i++) {
|
|
236
|
+
// 如果使用类型包含导入字样,则是execl文件导入的,不做显示
|
|
237
|
+
if(getFile.data[i].fusetype&&(getFile.data[i].fusetype.includes('execl导入'))){
|
|
238
|
+
getFile.data.splice(i,1)
|
|
239
|
+
i--
|
|
240
|
+
continue
|
|
241
|
+
}
|
|
242
|
+
let temp = getFile.data[i].f_downloadpath
|
|
243
|
+
let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
|
|
244
|
+
getFile.data[i].f_downloadURL = "http://" + location.host + "/" + URL
|
|
245
|
+
}
|
|
246
|
+
for (var i = 0; i < getFile.data.length; i++) {
|
|
247
|
+
if(getFile.data[i].f_downloadpath.includes('http:')){
|
|
248
|
+
let temp = getFile.data[i].f_downloadpath
|
|
249
|
+
getFile.data[i].f_downloadURL = temp
|
|
250
|
+
console.log('打印',i)
|
|
251
|
+
}else{
|
|
252
|
+
if(getFile.data[i].f_downloadpath.includes('http:')){
|
|
253
|
+
let temp = getFile.data[i].f_downloadpath
|
|
254
|
+
getFile.data[i].f_downloadURL = temp
|
|
255
|
+
console.log('打印',i)
|
|
256
|
+
}else{
|
|
257
|
+
let temp = getFile.data[i].f_downloadpath
|
|
258
|
+
let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
|
|
259
|
+
if(temp.includes('afFiles')){
|
|
260
|
+
let modifiedString = URL.replace(/^:\/\//, '/');
|
|
261
|
+
modifiedString = modifiedString.replace(/\/\//g, '/');
|
|
262
|
+
console.log( modifiedString)
|
|
263
|
+
getFile.data[i].f_downloadURL ="http://" + location.host + modifiedString
|
|
264
|
+
}else{
|
|
265
|
+
getFile.data[i].f_downloadURL ="http://" + location.host + "/" + URL
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
}
|
|
271
|
+
this.fileInfoData = []
|
|
272
|
+
this.fileInfoData = getFile.data
|
|
273
|
+
},
|
|
274
|
+
// 打开高拍仪
|
|
275
|
+
upload () {
|
|
276
|
+
if(this.showhighmeter){
|
|
277
|
+
this.$refs.ltgao.closeVideo()
|
|
278
|
+
}
|
|
279
|
+
this.showhighmeter = !this.showhighmeter
|
|
280
|
+
},
|
|
281
|
+
// 高拍仪回调
|
|
282
|
+
newPhoto(Imgbase64, fusetype, fremarks) {
|
|
283
|
+
this.headers.fusetype = fusetype
|
|
284
|
+
this.headers.fremarks = fremarks
|
|
285
|
+
|
|
286
|
+
let form = new FormData()
|
|
287
|
+
let xhr = new XMLHttpRequest()
|
|
288
|
+
let formDataBoundary = "----WebkitFormBoundary" + "GaoPaiYi";
|
|
289
|
+
form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
|
|
290
|
+
form.append('file', this.convertBase64ToBlob(Imgbase64), "GaoPaiYi.jpg")
|
|
291
|
+
xhr.open("POST", "rs/file/uploadFile")
|
|
292
|
+
|
|
293
|
+
if (this.headers) {
|
|
294
|
+
for (var header in this.headers) {
|
|
295
|
+
xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
xhr.send(form)
|
|
299
|
+
setTimeout(() => {
|
|
300
|
+
this.close()
|
|
301
|
+
}, 5000)
|
|
302
|
+
},
|
|
303
|
+
convertBase64ToBlob(base64String) {
|
|
304
|
+
// 将base64解码
|
|
305
|
+
var bytes = atob(base64String);
|
|
306
|
+
//var bytes = base64;
|
|
307
|
+
var bytesCode = new ArrayBuffer(bytes.length);
|
|
308
|
+
// 转换为类型化数组
|
|
309
|
+
var byteArray = new Uint8Array(bytesCode);
|
|
310
|
+
|
|
311
|
+
// 将base64转换为ascii码
|
|
312
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
313
|
+
byteArray[i] = bytes.charCodeAt(i);
|
|
314
|
+
}
|
|
315
|
+
// 生成Blob对象(文件对象)
|
|
316
|
+
return new Blob([bytesCode], {type: 'image/jpeg'});
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
computed: {
|
|
320
|
+
typeOfUse () {
|
|
321
|
+
return [{label: '全部', value: ''}, ...this.$appdata.getParam('报建-使用类型')]
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
events: {
|
|
325
|
+
onFileUpload: function (file, res) {
|
|
326
|
+
this.$dispatch("resid",res.id)
|
|
327
|
+
this.headers.fremarks=''
|
|
328
|
+
this.close()
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
</script>
|
|
333
|
+
|
|
334
|
+
<style scoped>
|
|
335
|
+
.clears{
|
|
336
|
+
overflow:hidden;
|
|
337
|
+
text-overflow:ellipsis;
|
|
338
|
+
white-space:nowrap;
|
|
339
|
+
}
|
|
340
|
+
.showData {
|
|
341
|
+
padding: 15px 10px 0px 10px;
|
|
342
|
+
box-sizing: border-box;
|
|
343
|
+
height: 230px;
|
|
344
|
+
font-family: "微软雅黑";
|
|
345
|
+
}
|
|
346
|
+
.showData .item{
|
|
347
|
+
padding-bottom: 10px;
|
|
348
|
+
border-bottom: solid 1px #c1c1c1;
|
|
349
|
+
}
|
|
350
|
+
.left {
|
|
351
|
+
padding-right: 10px;
|
|
352
|
+
}
|
|
353
|
+
.left img{
|
|
354
|
+
height: 100%;
|
|
355
|
+
width: 100%;
|
|
356
|
+
}
|
|
357
|
+
.right{
|
|
358
|
+
height: 100%;
|
|
359
|
+
/*display: -webkit-flex;*/
|
|
360
|
+
/*display: flex;*/
|
|
361
|
+
/*flex-direction: column;*/
|
|
362
|
+
/*justify-content: space-around;*/
|
|
363
|
+
}
|
|
364
|
+
.item_btn{
|
|
365
|
+
width: 80%;
|
|
366
|
+
background-color: #6aa6e2;
|
|
367
|
+
border-radius: 4px;
|
|
368
|
+
color: #FFFFFF;
|
|
369
|
+
font-family: PingFang;
|
|
370
|
+
}
|
|
371
|
+
</style>
|