vue2-client 1.3.0 → 1.3.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/CHANGELOG.md +9 -1
- package/index.js +30 -28
- package/package.json +1 -1
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +777 -777
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +553 -553
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -163
- package/src/base-client/components/common/Upload/Upload.vue +161 -158
- package/src/base-client/components/common/XAddForm/XAddForm.vue +349 -349
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +321 -322
- package/src/base-client/components/common/XForm/XForm.vue +273 -268
- package/src/base-client/components/common/XForm/XFormItem.vue +387 -371
- package/src/base-client/components/common/XFormTable/XFormTable.vue +8 -7
- package/src/base-client/components/common/XTable/XTable.vue +278 -274
- package/src/base-client/components/{iot → system}/LogDetailsView/LogDetailsView.vue +0 -0
- package/src/base-client/components/{iot → system}/LogDetailsView/index.js +0 -0
- package/src/base-client/components/{iot → system}/LogDetailsView/index.md +0 -0
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -280
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +806 -804
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +24 -24
- package/src/base-client/plugins/PagedList.js +177 -176
- package/src/components/STable/index.js +318 -316
- package/src/components/index.js +36 -36
- package/src/components/table/StandardTable.vue +141 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/layouts/header/AdminHeader.vue +104 -109
- package/src/layouts/header/HeaderNotice.vue +167 -199
- package/src/layouts/header/InstitutionDetail.vue +181 -182
- package/src/pages/CreateQueryPage.vue +65 -59
- package/src/pages/system/dictionary/index.vue +43 -41
- package/src/pages/system/file/Info.vue +56 -0
- package/src/pages/system/file/index.vue +317 -0
- package/src/pages/system/queryParams/index.vue +43 -41
- package/src/pages/system/ticket/index.vue +458 -452
- package/src/pages/system/ticket/submitTicketSuccess.vue +206 -203
- package/src/router/async/config.async.js +2 -1
- package/src/router/async/router.map.js +56 -60
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +42 -40
- package/src/services/api/commonTempTable.js +10 -0
- package/src/services/api/index.js +2 -24
- package/src/services/api/manage.js +8 -16
- package/src/utils/excel/Blob.js +181 -181
- package/src/utils/excel/Export2Excel.js +141 -142
- package/src/utils/i18n.js +80 -80
- package/src/utils/request.js +4 -4
- package/src/utils/routerUtil.js +358 -350
- package/src/utils/theme-color-replacer-extend.js +91 -92
- package/vue.config.js +109 -163
- package/src/base-client/all.js +0 -62
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +0 -225
- package/src/base-client/components/iot/CustomerDetailsView/index.js +0 -3
- package/src/base-client/components/iot/CustomerDetailsView/index.md +0 -40
- package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +0 -127
- package/src/base-client/components/iot/DataAnalysisUser/index.js +0 -3
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +0 -452
- package/src/base-client/components/iot/DeviceBrandDetailsView/index.js +0 -3
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +0 -232
- package/src/base-client/components/iot/DeviceDetailsView/index.js +0 -3
- package/src/base-client/components/iot/DeviceDetailsView/index.md +0 -41
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +0 -678
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +0 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +0 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +0 -121
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +0 -269
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +0 -131
- package/src/base-client/components/iot/DeviceDetailsView/part/index.js +0 -8
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +0 -300
- package/src/base-client/components/iot/DeviceTypeDetailsView/index.js +0 -3
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +0 -464
- package/src/base-client/components/iot/InstructDetailsView/index.js +0 -3
- package/src/base-client/components/iot/InstructDetailsView/index.md +0 -43
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +0 -352
- package/src/base-client/components/iot/MeterDetailsView/index.js +0 -3
- package/src/base-client/components/iot/MeterDetailsView/index.md +0 -41
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +0 -330
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +0 -179
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +0 -285
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +0 -230
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +0 -251
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +0 -184
- package/src/base-client/components/iot/MeterDetailsView/part/index.js +0 -9
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +0 -960
- package/src/base-client/components/iot/WebmeterAnalysisView/index.js +0 -3
- package/src/base-client/components/iot/WebmeterAnalysisView/index.md +0 -42
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +0 -370
- package/src/base-client/components/ticket/EmployeeDetailsView/index.js +0 -3
- package/src/base-client/components/ticket/EmployeeDetailsView/index.md +0 -28
- package/src/components/Charts/DataUserOrderSituation.vue +0 -77
- package/src/components/Charts/DataUserReporting.vue +0 -74
- package/src/components/Charts/DataUserSituation.vue +0 -107
- package/src/services/api/CustomerDetailsViewApi.js +0 -6
- package/src/services/api/DeviceBrandDetailsViewApi.js +0 -14
- package/src/services/api/DeviceDetailsViewApi.js +0 -10
- package/src/services/api/DeviceTypeDetailsViewApi.js +0 -6
- package/src/services/api/EmployeeDetailsViewApi.js +0 -12
- package/src/services/api/FormGroupEditApi.js +0 -6
- package/src/services/api/InstructDetailsViewApi.js +0 -12
- package/src/services/api/MeterDetailsViewApi.js +0 -24
- package/src/services/api/WebmeterAnalysisViewApi.js +0 -24
- package/src/services/api/applyInstallApi.js +0 -14
- package/src/services/api/iot/DeviceDetailsView/DeviceDetailsCountApi.js +0 -18
- package/src/services/api/iot.js +0 -7
- package/src/services/api/service.js +0 -12
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
const TicketDetailsViewApi = {
|
|
2
|
-
// 查询:获取工单流转详情
|
|
3
|
-
getTicketWorkFlowDetails: '/
|
|
4
|
-
// 查询:获取工单详情
|
|
5
|
-
getTicketDetails: '/
|
|
6
|
-
// 手动关闭工单
|
|
7
|
-
manualCloseTicket: '/
|
|
8
|
-
// 转交工单给其他人
|
|
9
|
-
transferTicketToOthers: '/
|
|
10
|
-
// 确认工单,开始处理
|
|
11
|
-
confirmTicket: '/
|
|
12
|
-
// 获取工单序号
|
|
13
|
-
getTicketSerialNumber: '/
|
|
14
|
-
// 新增工单
|
|
15
|
-
addTicket: '/
|
|
16
|
-
// 查询:获取订单详情用于订单追踪
|
|
17
|
-
getTicketDetailsForUploader: '/
|
|
18
|
-
// 更新:将工单优先级增加
|
|
19
|
-
rushTicket: '/
|
|
20
|
-
// 客户手动关闭工单
|
|
21
|
-
manualCloseTicketByCustomer: '/
|
|
22
|
-
// 上传图片
|
|
23
|
-
uploadImage: '/
|
|
24
|
-
// 获取工单类别字典
|
|
25
|
-
getTicketCategoryDictionary: '/
|
|
26
|
-
// 在工单提交页面删除照片
|
|
27
|
-
revocationImage: '/
|
|
28
|
-
// 在工单提交页面删除照片
|
|
29
|
-
getTicketImages: '/
|
|
30
|
-
// 用户填写附加信息时取消了操作,将已上传的照片清空
|
|
31
|
-
removeAllImages: '/
|
|
32
|
-
// 提交用户填写附加信息
|
|
33
|
-
AddonDescriptionToTicket: '/
|
|
34
|
-
// 获取用户填写附加信息
|
|
35
|
-
getAddonDescription: '/
|
|
36
|
-
// 发起售后工单流程
|
|
37
|
-
createTicket: '/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
const TicketDetailsViewApi = {
|
|
2
|
+
// 查询:获取工单流转详情
|
|
3
|
+
getTicketWorkFlowDetails: '/af-system/getTicketWorkFlowDetails',
|
|
4
|
+
// 查询:获取工单详情
|
|
5
|
+
getTicketDetails: '/af-system/getTicketDetails',
|
|
6
|
+
// 手动关闭工单
|
|
7
|
+
manualCloseTicket: '/af-system/manualCloseTicket',
|
|
8
|
+
// 转交工单给其他人
|
|
9
|
+
transferTicketToOthers: '/af-system/transferTicketToOthers',
|
|
10
|
+
// 确认工单,开始处理
|
|
11
|
+
confirmTicket: '/af-system/confirmTicket',
|
|
12
|
+
// 获取工单序号
|
|
13
|
+
getTicketSerialNumber: '/af-system/getTicketSerialNumber',
|
|
14
|
+
// 新增工单
|
|
15
|
+
addTicket: '/af-system/addTicket',
|
|
16
|
+
// 查询:获取订单详情用于订单追踪
|
|
17
|
+
getTicketDetailsForUploader: '/af-system/getTicketDetailsForUploader',
|
|
18
|
+
// 更新:将工单优先级增加
|
|
19
|
+
rushTicket: '/af-system/rushTicket',
|
|
20
|
+
// 客户手动关闭工单
|
|
21
|
+
manualCloseTicketByCustomer: '/af-system/manualCloseTicketByCustomer',
|
|
22
|
+
// 上传图片
|
|
23
|
+
uploadImage: '/af-system/upload',
|
|
24
|
+
// 获取工单类别字典
|
|
25
|
+
getTicketCategoryDictionary: '/af-system/getTicketCategoryDictionary',
|
|
26
|
+
// 在工单提交页面删除照片
|
|
27
|
+
revocationImage: '/af-system/revocationImage',
|
|
28
|
+
// 在工单提交页面删除照片
|
|
29
|
+
getTicketImages: '/af-system/getTicketImages',
|
|
30
|
+
// 用户填写附加信息时取消了操作,将已上传的照片清空
|
|
31
|
+
removeAllImages: '/af-system/removeAllImages',
|
|
32
|
+
// 提交用户填写附加信息
|
|
33
|
+
AddonDescriptionToTicket: '/af-system/AddonDescriptionToTicket',
|
|
34
|
+
// 获取用户填写附加信息
|
|
35
|
+
getAddonDescription: '/af-system/getAddonDescription',
|
|
36
|
+
// 发起售后工单流程
|
|
37
|
+
createTicket: '/af-system/createTicket',
|
|
38
|
+
// 查询:获取所有员工名,供前端展示备选项
|
|
39
|
+
getAllEmployeeName: '/af-system/getAllEmployeeName'
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { TicketDetailsViewApi }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const CommonTempTable = {
|
|
2
|
+
// 初始化子表
|
|
3
|
+
initApplySubTable: '/af-system/initApplySubTable',
|
|
4
|
+
// 创建临时表,根据配置文件动态生成
|
|
5
|
+
createTempTable: '/af-system/createTempTable',
|
|
6
|
+
// 向临时表中插入数据
|
|
7
|
+
insertDataToTempTable: '/af-system/insertDataToTempTable'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { CommonTempTable }
|
|
@@ -1,39 +1,17 @@
|
|
|
1
1
|
import { commonApi, getColumnsJson, query, addOrModify, remove } from '@vue2-client/services/api/common'
|
|
2
|
-
import {
|
|
3
|
-
import { DeviceBrandDetailsViewApi } from '@vue2-client/services/api/DeviceBrandDetailsViewApi'
|
|
4
|
-
import { DeviceDetailsViewApi } from '@vue2-client/services/api/DeviceDetailsViewApi'
|
|
5
|
-
import { DeviceTypeDetailsViewApi } from '@vue2-client/services/api/DeviceTypeDetailsViewApi'
|
|
2
|
+
import { QueryParamsDetailsViewApi } from '@vue2-client/services/api/QueryParamsDetailsViewApi'
|
|
6
3
|
import { DictionaryDetailsViewApi } from '@vue2-client/services/api/DictionaryDetailsViewApi'
|
|
7
|
-
import { EmployeeDetailsViewApi } from '@vue2-client/services/api/EmployeeDetailsViewApi'
|
|
8
|
-
import { FormGroupEditApi } from '@vue2-client/services/api/FormGroupEditApi'
|
|
9
|
-
import { InstructDetailsViewApi } from '@vue2-client/services/api/InstructDetailsViewApi'
|
|
10
|
-
import { iotApi } from '@vue2-client/services/api/iot'
|
|
11
4
|
import { LogDetailsViewApi } from '@vue2-client/services/api/LogDetailsViewApi'
|
|
12
5
|
import { manageApi } from '@vue2-client/services/api/manage'
|
|
13
|
-
import { MeterDetailsViewApi } from '@vue2-client/services/api/MeterDetailsViewApi'
|
|
14
|
-
import { QueryParamsDetailsViewApi } from '@vue2-client/services/api/QueryParamsDetailsViewApi'
|
|
15
6
|
import { get, post } from '@vue2-client/services/api/restTools'
|
|
16
|
-
import { serviceApi } from '@vue2-client/services/api/service'
|
|
17
7
|
import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
|
|
18
|
-
import { WebmeterAnalysisViewApi } from '@vue2-client/services/api/WebmeterAnalysisViewApi'
|
|
19
8
|
|
|
20
9
|
export {
|
|
21
10
|
commonApi, getColumnsJson, query, addOrModify, remove,
|
|
22
|
-
CustomerDetailsViewApi,
|
|
23
|
-
DeviceBrandDetailsViewApi,
|
|
24
|
-
DeviceDetailsViewApi,
|
|
25
|
-
DeviceTypeDetailsViewApi,
|
|
26
11
|
DictionaryDetailsViewApi,
|
|
27
|
-
EmployeeDetailsViewApi,
|
|
28
|
-
FormGroupEditApi,
|
|
29
|
-
InstructDetailsViewApi,
|
|
30
|
-
iotApi,
|
|
31
12
|
LogDetailsViewApi,
|
|
32
13
|
manageApi,
|
|
33
|
-
MeterDetailsViewApi,
|
|
34
14
|
QueryParamsDetailsViewApi,
|
|
35
15
|
get, post,
|
|
36
|
-
|
|
37
|
-
TicketDetailsViewApi,
|
|
38
|
-
WebmeterAnalysisViewApi
|
|
16
|
+
TicketDetailsViewApi
|
|
39
17
|
}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
const manageApi = {
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
doCustomerInfo: '/webmeterapi/foreignaidDoCustomerInfo',
|
|
10
|
-
// 查询:获取字典键列表
|
|
11
|
-
getDictionaryValue: '/webmeterapi/getDictionaryValue',
|
|
12
|
-
// 查询:获取省市区街道三级分类
|
|
13
|
-
getDivisionsOhChina: '/webmeterapi/getDivisionsOhChina'
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { manageApi }
|
|
1
|
+
const manageApi = {
|
|
2
|
+
// 查询:获取字典键列表
|
|
3
|
+
getDictionaryValue: '/af-system/getDictionaryValue',
|
|
4
|
+
// 查询:获取省市区街道三级分类
|
|
5
|
+
getDivisionsOhChina: '/af-system/getDivisionsOhChina'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { manageApi }
|
package/src/utils/excel/Blob.js
CHANGED
|
@@ -1,181 +1,181 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* Blob.js
|
|
3
|
-
* A Blob implementation.
|
|
4
|
-
* 2014-05-27
|
|
5
|
-
*
|
|
6
|
-
* By Eli Grey, http://eligrey.com
|
|
7
|
-
* By Devin Samarin, https://github.com/eboyjr
|
|
8
|
-
* License: X11/MIT
|
|
9
|
-
* See LICENSE.md
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/*global self, unescape */
|
|
13
|
-
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
|
|
14
|
-
plusplus: true */
|
|
15
|
-
|
|
16
|
-
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
|
|
17
|
-
|
|
18
|
-
(function (view) {
|
|
19
|
-
"use strict";
|
|
20
|
-
|
|
21
|
-
view.URL = view.URL || view.webkitURL;
|
|
22
|
-
|
|
23
|
-
if (view.Blob && view.URL) {
|
|
24
|
-
try {
|
|
25
|
-
new Blob;
|
|
26
|
-
return;
|
|
27
|
-
} catch (e) {
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Internally we use a BlobBuilder implementation to base Blob off of
|
|
32
|
-
// in order to support older browsers that only have BlobBuilder
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
get_class = function (object) {
|
|
36
|
-
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
|
|
37
|
-
}
|
|
38
|
-
, FakeBlobBuilder = function BlobBuilder() {
|
|
39
|
-
this.data = [];
|
|
40
|
-
}
|
|
41
|
-
, FakeBlob = function Blob(data, type, encoding) {
|
|
42
|
-
this.data = data;
|
|
43
|
-
this.size = data.length;
|
|
44
|
-
this.type = type;
|
|
45
|
-
this.encoding = encoding;
|
|
46
|
-
}
|
|
47
|
-
, FBB_proto = FakeBlobBuilder.prototype
|
|
48
|
-
, FB_proto = FakeBlob.prototype
|
|
49
|
-
, FileReaderSync = view.FileReaderSync
|
|
50
|
-
, FileException = function (type) {
|
|
51
|
-
this.code = this[this.name = type];
|
|
52
|
-
}
|
|
53
|
-
, file_ex_codes = (
|
|
54
|
-
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
|
|
55
|
-
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
|
|
56
|
-
).split(" ")
|
|
57
|
-
, file_ex_code = file_ex_codes.length
|
|
58
|
-
, real_URL = view.URL || view.webkitURL || view
|
|
59
|
-
, real_create_object_URL = real_URL.createObjectURL
|
|
60
|
-
, real_revoke_object_URL = real_URL.revokeObjectURL
|
|
61
|
-
, URL = real_URL
|
|
62
|
-
, btoa = view.btoa
|
|
63
|
-
, atob = view.atob
|
|
64
|
-
|
|
65
|
-
, ArrayBuffer = view.ArrayBuffer
|
|
66
|
-
, Uint8Array = view.Uint8Array
|
|
67
|
-
;
|
|
68
|
-
FakeBlob.fake = FB_proto.fake = true;
|
|
69
|
-
while (file_ex_code--) {
|
|
70
|
-
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
|
|
71
|
-
}
|
|
72
|
-
if (!real_URL.createObjectURL) {
|
|
73
|
-
URL = view.URL = {};
|
|
74
|
-
}
|
|
75
|
-
URL.createObjectURL = function (blob) {
|
|
76
|
-
var
|
|
77
|
-
type = blob.type
|
|
78
|
-
, data_URI_header
|
|
79
|
-
;
|
|
80
|
-
if (type === null) {
|
|
81
|
-
type = "application/octet-stream";
|
|
82
|
-
}
|
|
83
|
-
if (blob instanceof FakeBlob) {
|
|
84
|
-
data_URI_header = "data:" + type;
|
|
85
|
-
if (blob.encoding === "base64") {
|
|
86
|
-
return data_URI_header + ";base64," + blob.data;
|
|
87
|
-
} else if (blob.encoding === "URI") {
|
|
88
|
-
return data_URI_header + "," + decodeURIComponent(blob.data);
|
|
89
|
-
}
|
|
90
|
-
if (btoa) {
|
|
91
|
-
return data_URI_header + ";base64," + btoa(blob.data);
|
|
92
|
-
} else {
|
|
93
|
-
return data_URI_header + "," + encodeURIComponent(blob.data);
|
|
94
|
-
}
|
|
95
|
-
} else if (real_create_object_URL) {
|
|
96
|
-
return real_create_object_URL.call(real_URL, blob);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
URL.revokeObjectURL = function (object_URL) {
|
|
100
|
-
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
|
|
101
|
-
real_revoke_object_URL.call(real_URL, object_URL);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
FBB_proto.append = function (data/*, endings*/) {
|
|
105
|
-
var bb = this.data;
|
|
106
|
-
// decode data to a binary string
|
|
107
|
-
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
|
|
108
|
-
var
|
|
109
|
-
str = ""
|
|
110
|
-
, buf = new Uint8Array(data)
|
|
111
|
-
, i = 0
|
|
112
|
-
, buf_len = buf.length
|
|
113
|
-
;
|
|
114
|
-
for (; i < buf_len; i++) {
|
|
115
|
-
str += String.fromCharCode(buf[i]);
|
|
116
|
-
}
|
|
117
|
-
bb.push(str);
|
|
118
|
-
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
|
|
119
|
-
if (FileReaderSync) {
|
|
120
|
-
|
|
121
|
-
bb.push(fr.readAsBinaryString(data));
|
|
122
|
-
} else {
|
|
123
|
-
// async FileReader won't work as BlobBuilder is sync
|
|
124
|
-
throw new FileException("NOT_READABLE_ERR");
|
|
125
|
-
}
|
|
126
|
-
} else if (data instanceof FakeBlob) {
|
|
127
|
-
if (data.encoding === "base64" && atob) {
|
|
128
|
-
bb.push(atob(data.data));
|
|
129
|
-
} else if (data.encoding === "URI") {
|
|
130
|
-
bb.push(decodeURIComponent(data.data));
|
|
131
|
-
} else if (data.encoding === "raw") {
|
|
132
|
-
bb.push(data.data);
|
|
133
|
-
}
|
|
134
|
-
} else {
|
|
135
|
-
if (typeof data !== "string") {
|
|
136
|
-
data += ""; // convert unsupported types to strings
|
|
137
|
-
}
|
|
138
|
-
// decode UTF-16 to binary string
|
|
139
|
-
bb.push(unescape(encodeURIComponent(data)));
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
FBB_proto.getBlob = function (type) {
|
|
143
|
-
if (!arguments.length) {
|
|
144
|
-
type = null;
|
|
145
|
-
}
|
|
146
|
-
return new FakeBlob(this.data.join(""), type, "raw");
|
|
147
|
-
};
|
|
148
|
-
FBB_proto.toString = function () {
|
|
149
|
-
return "[object BlobBuilder]";
|
|
150
|
-
};
|
|
151
|
-
FB_proto.slice = function (start, end, type) {
|
|
152
|
-
var args = arguments.length;
|
|
153
|
-
if (args < 3) {
|
|
154
|
-
type = null;
|
|
155
|
-
}
|
|
156
|
-
return new FakeBlob(
|
|
157
|
-
this.data.slice(start, args > 1 ? end : this.data.length)
|
|
158
|
-
, type
|
|
159
|
-
, this.encoding
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
FB_proto.toString = function () {
|
|
163
|
-
return "[object Blob]";
|
|
164
|
-
};
|
|
165
|
-
FB_proto.close = function () {
|
|
166
|
-
this.size = this.data.length = 0;
|
|
167
|
-
};
|
|
168
|
-
return FakeBlobBuilder;
|
|
169
|
-
}(view));
|
|
170
|
-
|
|
171
|
-
view.Blob = function Blob(blobParts, options) {
|
|
172
|
-
var type = options ? (options.type || "") : "";
|
|
173
|
-
var builder = new BlobBuilder();
|
|
174
|
-
if (blobParts) {
|
|
175
|
-
for (var i = 0, len = blobParts.length; i < len; i++) {
|
|
176
|
-
builder.append(blobParts[i]);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return builder.getBlob(type);
|
|
180
|
-
};
|
|
181
|
-
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* Blob.js
|
|
3
|
+
* A Blob implementation.
|
|
4
|
+
* 2014-05-27
|
|
5
|
+
*
|
|
6
|
+
* By Eli Grey, http://eligrey.com
|
|
7
|
+
* By Devin Samarin, https://github.com/eboyjr
|
|
8
|
+
* License: X11/MIT
|
|
9
|
+
* See LICENSE.md
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/*global self, unescape */
|
|
13
|
+
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
|
|
14
|
+
plusplus: true */
|
|
15
|
+
|
|
16
|
+
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
|
|
17
|
+
|
|
18
|
+
(function (view) {
|
|
19
|
+
"use strict";
|
|
20
|
+
|
|
21
|
+
view.URL = view.URL || view.webkitURL;
|
|
22
|
+
|
|
23
|
+
if (view.Blob && view.URL) {
|
|
24
|
+
try {
|
|
25
|
+
new Blob;
|
|
26
|
+
return;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Internally we use a BlobBuilder implementation to base Blob off of
|
|
32
|
+
// in order to support older browsers that only have BlobBuilder
|
|
33
|
+
const BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function (view) {
|
|
34
|
+
var
|
|
35
|
+
get_class = function (object) {
|
|
36
|
+
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
|
|
37
|
+
}
|
|
38
|
+
, FakeBlobBuilder = function BlobBuilder() {
|
|
39
|
+
this.data = [];
|
|
40
|
+
}
|
|
41
|
+
, FakeBlob = function Blob(data, type, encoding) {
|
|
42
|
+
this.data = data;
|
|
43
|
+
this.size = data.length;
|
|
44
|
+
this.type = type;
|
|
45
|
+
this.encoding = encoding;
|
|
46
|
+
}
|
|
47
|
+
, FBB_proto = FakeBlobBuilder.prototype
|
|
48
|
+
, FB_proto = FakeBlob.prototype
|
|
49
|
+
, FileReaderSync = view.FileReaderSync
|
|
50
|
+
, FileException = function (type) {
|
|
51
|
+
this.code = this[this.name = type];
|
|
52
|
+
}
|
|
53
|
+
, file_ex_codes = (
|
|
54
|
+
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
|
|
55
|
+
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
|
|
56
|
+
).split(" ")
|
|
57
|
+
, file_ex_code = file_ex_codes.length
|
|
58
|
+
, real_URL = view.URL || view.webkitURL || view
|
|
59
|
+
, real_create_object_URL = real_URL.createObjectURL
|
|
60
|
+
, real_revoke_object_URL = real_URL.revokeObjectURL
|
|
61
|
+
, URL = real_URL
|
|
62
|
+
, btoa = view.btoa
|
|
63
|
+
, atob = view.atob
|
|
64
|
+
|
|
65
|
+
, ArrayBuffer = view.ArrayBuffer
|
|
66
|
+
, Uint8Array = view.Uint8Array
|
|
67
|
+
;
|
|
68
|
+
FakeBlob.fake = FB_proto.fake = true;
|
|
69
|
+
while (file_ex_code--) {
|
|
70
|
+
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
|
|
71
|
+
}
|
|
72
|
+
if (!real_URL.createObjectURL) {
|
|
73
|
+
URL = view.URL = {};
|
|
74
|
+
}
|
|
75
|
+
URL.createObjectURL = function (blob) {
|
|
76
|
+
var
|
|
77
|
+
type = blob.type
|
|
78
|
+
, data_URI_header
|
|
79
|
+
;
|
|
80
|
+
if (type === null) {
|
|
81
|
+
type = "application/octet-stream";
|
|
82
|
+
}
|
|
83
|
+
if (blob instanceof FakeBlob) {
|
|
84
|
+
data_URI_header = "data:" + type;
|
|
85
|
+
if (blob.encoding === "base64") {
|
|
86
|
+
return data_URI_header + ";base64," + blob.data;
|
|
87
|
+
} else if (blob.encoding === "URI") {
|
|
88
|
+
return data_URI_header + "," + decodeURIComponent(blob.data);
|
|
89
|
+
}
|
|
90
|
+
if (btoa) {
|
|
91
|
+
return data_URI_header + ";base64," + btoa(blob.data);
|
|
92
|
+
} else {
|
|
93
|
+
return data_URI_header + "," + encodeURIComponent(blob.data);
|
|
94
|
+
}
|
|
95
|
+
} else if (real_create_object_URL) {
|
|
96
|
+
return real_create_object_URL.call(real_URL, blob);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
URL.revokeObjectURL = function (object_URL) {
|
|
100
|
+
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
|
|
101
|
+
real_revoke_object_URL.call(real_URL, object_URL);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
FBB_proto.append = function (data/*, endings*/) {
|
|
105
|
+
var bb = this.data;
|
|
106
|
+
// decode data to a binary string
|
|
107
|
+
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
|
|
108
|
+
var
|
|
109
|
+
str = ""
|
|
110
|
+
, buf = new Uint8Array(data)
|
|
111
|
+
, i = 0
|
|
112
|
+
, buf_len = buf.length
|
|
113
|
+
;
|
|
114
|
+
for (; i < buf_len; i++) {
|
|
115
|
+
str += String.fromCharCode(buf[i]);
|
|
116
|
+
}
|
|
117
|
+
bb.push(str);
|
|
118
|
+
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
|
|
119
|
+
if (FileReaderSync) {
|
|
120
|
+
const fr = new FileReaderSync;
|
|
121
|
+
bb.push(fr.readAsBinaryString(data));
|
|
122
|
+
} else {
|
|
123
|
+
// async FileReader won't work as BlobBuilder is sync
|
|
124
|
+
throw new FileException("NOT_READABLE_ERR");
|
|
125
|
+
}
|
|
126
|
+
} else if (data instanceof FakeBlob) {
|
|
127
|
+
if (data.encoding === "base64" && atob) {
|
|
128
|
+
bb.push(atob(data.data));
|
|
129
|
+
} else if (data.encoding === "URI") {
|
|
130
|
+
bb.push(decodeURIComponent(data.data));
|
|
131
|
+
} else if (data.encoding === "raw") {
|
|
132
|
+
bb.push(data.data);
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
if (typeof data !== "string") {
|
|
136
|
+
data += ""; // convert unsupported types to strings
|
|
137
|
+
}
|
|
138
|
+
// decode UTF-16 to binary string
|
|
139
|
+
bb.push(unescape(encodeURIComponent(data)));
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
FBB_proto.getBlob = function (type) {
|
|
143
|
+
if (!arguments.length) {
|
|
144
|
+
type = null;
|
|
145
|
+
}
|
|
146
|
+
return new FakeBlob(this.data.join(""), type, "raw");
|
|
147
|
+
};
|
|
148
|
+
FBB_proto.toString = function () {
|
|
149
|
+
return "[object BlobBuilder]";
|
|
150
|
+
};
|
|
151
|
+
FB_proto.slice = function (start, end, type) {
|
|
152
|
+
var args = arguments.length;
|
|
153
|
+
if (args < 3) {
|
|
154
|
+
type = null;
|
|
155
|
+
}
|
|
156
|
+
return new FakeBlob(
|
|
157
|
+
this.data.slice(start, args > 1 ? end : this.data.length)
|
|
158
|
+
, type
|
|
159
|
+
, this.encoding
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
FB_proto.toString = function () {
|
|
163
|
+
return "[object Blob]";
|
|
164
|
+
};
|
|
165
|
+
FB_proto.close = function () {
|
|
166
|
+
this.size = this.data.length = 0;
|
|
167
|
+
};
|
|
168
|
+
return FakeBlobBuilder;
|
|
169
|
+
}(view));
|
|
170
|
+
|
|
171
|
+
view.Blob = function Blob(blobParts, options) {
|
|
172
|
+
var type = options ? (options.type || "") : "";
|
|
173
|
+
var builder = new BlobBuilder();
|
|
174
|
+
if (blobParts) {
|
|
175
|
+
for (var i = 0, len = blobParts.length; i < len; i++) {
|
|
176
|
+
builder.append(blobParts[i]);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return builder.getBlob(type);
|
|
180
|
+
};
|
|
181
|
+
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
|