apply-clients 3.5.4-82 → 3.5.4-83

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