cloud-web-corejs 1.0.54-dev.555 → 1.0.54-dev.557
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/package.json +1 -3
- package/src/components/baseAlert/mixins.js +1 -61
- package/src/components/baseInputExport/mixins.js +1 -391
- package/src/components/errorMsg/mixins.js +1 -96
- package/src/components/excelImport/mixins.js +1 -774
- package/src/components/fileLibrary/index.vue +15 -17
- package/src/components/hiprint/view/design/index.vue +139 -47
- package/src/components/hiprint/view/design/preview.vue +75 -52
- package/src/components/hiprint/view/json-view.vue +31 -31
- package/src/components/luckysheet/dialog.vue +1 -12
- package/src/components/luckysheet/export.js +1 -591
- package/src/components/luckysheet/fileUtils.js +1 -147
- package/src/components/luckysheet/index.js +1 -72
- package/src/components/luckysheet/view.vue +0 -92
- package/src/components/oplogTable/mixins.js +1 -80
- package/src/components/table/index.js +1 -1044
- package/src/components/wf/wf.js +1 -2156
- package/src/components/wf/wfUtil.js +1 -279
- package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1 -1752
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1 -1630
- package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +1 -1
- package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -3043
- package/src/components/xform/form-render/container-item/table2-item.vue +12 -4
- package/src/components/xform/form-render/indexMixin.js +1 -3677
- package/src/mixins/tableTree/index.js +1 -196
- package/src/router/modules/customer.js +7 -7
- package/src/store/modules/permission.js +2 -2
- package/src/views/bd/setting/bd_attach_setting/mixins/list.js +1 -239
- package/src/views/bd/setting/form_script/mixins/dialog.js +1 -130
- package/src/views/bd/setting/form_script/mixins/edit.js +2 -199
- package/src/views/bd/setting/form_script/mixins/edit1.js +2 -193
- package/src/views/bd/setting/form_script/mixins/list.js +1 -236
- package/src/views/bd/setting/form_script/mixins/list1.js +1 -410
- package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +1 -278
- package/src/views/bd/setting/form_template/mixins/edit.js +1 -225
- package/src/views/bd/setting/form_template/mixins/list.js +1 -665
- package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +1 -187
- package/src/views/bd/setting/menu_kind/mixins/authDialog.js +1 -294
- package/src/views/bd/setting/menu_kind/mixins/list.js +1 -201
- package/src/views/bd/setting/table_model/mixins/edit.js +1 -1189
- package/src/views/bd/setting/table_model/mixins/list.js +1 -427
- package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +1 -195
- package/src/views/user/ledger_library/list.vue +12 -10
- package/src/views/user/position/list.vue +68 -124
- package/src/components/luckysheet/README.md +0 -329
- package/src/components/luckysheet/colorTest.js +0 -54
- package/src/components/luckysheet/exportExample.js +0 -182
- package/src/components/luckysheet/fileConversionExample.js +0 -127
- package/src/components/luckysheet/testExport.js +0 -57
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +0 -1639
- package/src/components/xform/utils/formula-util copy 2.js +0 -945
- package/src/components/xform/utils/formula-util copy.js +0 -856
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Excel导出示例文件
|
|
3
|
-
* 展示如何使用改进后的luckysheet导出功能
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { exportExcel, generateExcelBlob, generateExcelFile } from './export'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 基础导出示例
|
|
10
|
-
* @param {Object} luckysheetData - luckysheet数据对象
|
|
11
|
-
* @param {string} fileName - 导出文件名
|
|
12
|
-
*/
|
|
13
|
-
export function basicExportExample(luckysheetData, fileName) {
|
|
14
|
-
// 直接导出Excel文件
|
|
15
|
-
exportExcel(luckysheetData, fileName)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 获取Blob对象示例
|
|
20
|
-
* @param {Object} luckysheetData - luckysheet数据对象
|
|
21
|
-
* @param {string} fileName - 文件名
|
|
22
|
-
* @returns {Promise<Blob>} 返回Blob对象
|
|
23
|
-
*/
|
|
24
|
-
export async function getBlobExample(luckysheetData, fileName) {
|
|
25
|
-
try {
|
|
26
|
-
const blob = await generateExcelBlob(luckysheetData, fileName)
|
|
27
|
-
return blob
|
|
28
|
-
} catch (error) {
|
|
29
|
-
console.error('生成Blob失败:', error)
|
|
30
|
-
throw error
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 获取File对象示例
|
|
36
|
-
* @param {Object} luckysheetData - luckysheet数据对象
|
|
37
|
-
* @param {string} fileName - 文件名
|
|
38
|
-
* @returns {Promise<File>} 返回File对象
|
|
39
|
-
*/
|
|
40
|
-
export async function getFileExample(luckysheetData, fileName) {
|
|
41
|
-
try {
|
|
42
|
-
const file = await generateExcelFile(luckysheetData, fileName)
|
|
43
|
-
return file
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.error('生成File失败:', error)
|
|
46
|
-
throw error
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* 自定义导出示例 - 带进度提示
|
|
52
|
-
* @param {Object} luckysheetData - luckysheet数据对象
|
|
53
|
-
* @param {string} fileName - 文件名
|
|
54
|
-
* @param {Function} onProgress - 进度回调函数
|
|
55
|
-
*/
|
|
56
|
-
export async function customExportExample(luckysheetData, fileName, onProgress) {
|
|
57
|
-
try {
|
|
58
|
-
// 开始导出
|
|
59
|
-
if (onProgress) onProgress(0, '开始准备导出数据...')
|
|
60
|
-
|
|
61
|
-
// 生成Blob
|
|
62
|
-
if (onProgress) onProgress(30, '正在生成Excel数据...')
|
|
63
|
-
const blob = await generateExcelBlob(luckysheetData, fileName)
|
|
64
|
-
|
|
65
|
-
if (onProgress) onProgress(70, '数据生成完成,准备下载...')
|
|
66
|
-
|
|
67
|
-
// 触发下载
|
|
68
|
-
const link = document.createElement('a')
|
|
69
|
-
link.href = URL.createObjectURL(blob)
|
|
70
|
-
link.download = `${fileName}.xlsx`
|
|
71
|
-
link.click()
|
|
72
|
-
|
|
73
|
-
if (onProgress) onProgress(100, '导出完成!')
|
|
74
|
-
|
|
75
|
-
// 清理URL对象
|
|
76
|
-
setTimeout(() => {
|
|
77
|
-
URL.revokeObjectURL(link.href)
|
|
78
|
-
}, 100)
|
|
79
|
-
|
|
80
|
-
} catch (error) {
|
|
81
|
-
console.error('导出失败:', error)
|
|
82
|
-
if (onProgress) onProgress(-1, '导出失败: ' + error.message)
|
|
83
|
-
throw error
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 批量导出示例
|
|
89
|
-
* @param {Array} sheetList - 包含多个sheet数据的数组
|
|
90
|
-
* @param {string} fileName - 基础文件名
|
|
91
|
-
*/
|
|
92
|
-
export async function batchExportExample(sheetList, fileName) {
|
|
93
|
-
// 将多个sheet合并为一个导出
|
|
94
|
-
const combinedData = sheetList.map((sheet, index) => ({
|
|
95
|
-
name: sheet.name || `Sheet${index + 1}`,
|
|
96
|
-
data: sheet.data,
|
|
97
|
-
config: sheet.config || {}
|
|
98
|
-
}))
|
|
99
|
-
|
|
100
|
-
return exportExcel(combinedData, fileName)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* 示例数据结构
|
|
105
|
-
*/
|
|
106
|
-
export const exampleDataStructure = {
|
|
107
|
-
// 单个sheet数据示例
|
|
108
|
-
singleSheet: {
|
|
109
|
-
name: '示例工作表',
|
|
110
|
-
data: [
|
|
111
|
-
// 第一行
|
|
112
|
-
[
|
|
113
|
-
{ v: '姓名', ff: 1, fc: '#000000', bl: 1, fs: 12 },
|
|
114
|
-
{ v: '年龄', ff: 1, fc: '#000000', bl: 1, fs: 12 },
|
|
115
|
-
{ v: '部门', ff: 1, fc: '#000000', bl: 1, fs: 12 }
|
|
116
|
-
],
|
|
117
|
-
// 数据行
|
|
118
|
-
[
|
|
119
|
-
{ v: '张三', ff: 0, fc: '#333333', fs: 10 },
|
|
120
|
-
{ v: 25, ff: 0, fc: '#333333', fs: 10 },
|
|
121
|
-
{ v: '技术部', ff: 0, fc: '#333333', fs: 10 }
|
|
122
|
-
],
|
|
123
|
-
[
|
|
124
|
-
{ v: '李四', ff: 0, fc: '#333333', fs: 10 },
|
|
125
|
-
{ v: 30, ff: 0, fc: '#333333', fs: 10 },
|
|
126
|
-
{ v: '销售部', ff: 0, fc: '#333333', fs: 10 }
|
|
127
|
-
]
|
|
128
|
-
],
|
|
129
|
-
config: {
|
|
130
|
-
merge: {}, // 合并单元格配置
|
|
131
|
-
borderInfo: [], // 边框信息
|
|
132
|
-
columnlen: { 0: 100, 1: 80, 2: 120 }, // 列宽配置
|
|
133
|
-
rowlen: { 0: 25, 1: 20, 2: 20 } // 行高配置
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
// 多个sheet数据示例
|
|
138
|
-
multipleSheets: [
|
|
139
|
-
{
|
|
140
|
-
name: '员工信息',
|
|
141
|
-
data: [
|
|
142
|
-
[{ v: '员工ID' }, { v: '姓名' }, { v: '职位' }],
|
|
143
|
-
[{ v: '001' }, { v: '张三' }, { v: '工程师' }],
|
|
144
|
-
[{ v: '002' }, { v: '李四' }, { v: '设计师' }]
|
|
145
|
-
]
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
name: '部门信息',
|
|
149
|
-
data: [
|
|
150
|
-
[{ v: '部门ID' }, { v: '部门名称' }, { v: '负责人' }],
|
|
151
|
-
[{ v: 'D001' }, { v: '技术部' }, { v: '王五' }],
|
|
152
|
-
[{ v: 'D002' }, { v: '销售部' }, { v: '赵六' }]
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* 使用示例
|
|
160
|
-
*/
|
|
161
|
-
export function usageExample() {
|
|
162
|
-
// 1. 基础使用
|
|
163
|
-
// basicExportExample(exampleDataStructure.singleSheet, '员工信息表')
|
|
164
|
-
|
|
165
|
-
// 2. 获取Blob对象进行自定义处理
|
|
166
|
-
// getBlobExample(exampleDataStructure.singleSheet, '员工信息表').then(blob => {
|
|
167
|
-
// // 可以在这里对blob进行额外处理
|
|
168
|
-
// console.log('获取到Blob对象:', blob)
|
|
169
|
-
// })
|
|
170
|
-
|
|
171
|
-
// 3. 带进度的导出
|
|
172
|
-
// customExportExample(
|
|
173
|
-
// exampleDataStructure.singleSheet,
|
|
174
|
-
// '员工信息表',
|
|
175
|
-
// (progress, message) => {
|
|
176
|
-
// console.log(`进度: ${progress}%, 消息: ${message}`)
|
|
177
|
-
// }
|
|
178
|
-
// )
|
|
179
|
-
|
|
180
|
-
// 4. 批量导出多个sheet
|
|
181
|
-
// batchExportExample(exampleDataStructure.multipleSheets, '公司信息汇总')
|
|
182
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base64和File转换功能使用示例
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
fileToBase64,
|
|
7
|
-
base64ToFile,
|
|
8
|
-
base64ToBlob,
|
|
9
|
-
downloadBase64File,
|
|
10
|
-
MIME_TYPES
|
|
11
|
-
} from './fileUtils.js';
|
|
12
|
-
|
|
13
|
-
// 示例1: File转Base64
|
|
14
|
-
async function exampleFileToBase64() {
|
|
15
|
-
try {
|
|
16
|
-
// 假设有一个File对象
|
|
17
|
-
const fileInput = document.querySelector('input[type="file"]');
|
|
18
|
-
const file = fileInput.files[0];
|
|
19
|
-
|
|
20
|
-
if (file) {
|
|
21
|
-
const base64 = await fileToBase64(file);
|
|
22
|
-
console.log('转换后的Base64:', base64);
|
|
23
|
-
return base64;
|
|
24
|
-
}
|
|
25
|
-
} catch (error) {
|
|
26
|
-
console.error('File转Base64失败:', error);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// 示例2: Base64转File
|
|
31
|
-
function exampleBase64ToFile(base64String) {
|
|
32
|
-
try {
|
|
33
|
-
// 将Base64转换回File对象
|
|
34
|
-
const file = base64ToFile(
|
|
35
|
-
base64String,
|
|
36
|
-
'example.xlsx',
|
|
37
|
-
MIME_TYPES.EXCEL
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
if (file) {
|
|
41
|
-
console.log('转换后的File对象:', file);
|
|
42
|
-
console.log('文件名:', file.name);
|
|
43
|
-
console.log('文件大小:', file.size);
|
|
44
|
-
console.log('文件类型:', file.type);
|
|
45
|
-
return file;
|
|
46
|
-
}
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.error('Base64转File失败:', error);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// 示例3: Base64转Blob
|
|
53
|
-
function exampleBase64ToBlob(base64String) {
|
|
54
|
-
try {
|
|
55
|
-
const blob = base64ToBlob(base64String, MIME_TYPES.EXCEL);
|
|
56
|
-
if (blob) {
|
|
57
|
-
console.log('转换后的Blob对象:', blob);
|
|
58
|
-
return blob;
|
|
59
|
-
}
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.error('Base64转Blob失败:', error);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 示例4: 直接下载Base64文件
|
|
66
|
-
function exampleDownloadBase64File(base64String) {
|
|
67
|
-
try {
|
|
68
|
-
downloadBase64File(
|
|
69
|
-
base64String,
|
|
70
|
-
'downloaded-file.xlsx',
|
|
71
|
-
MIME_TYPES.EXCEL
|
|
72
|
-
);
|
|
73
|
-
console.log('文件开始下载...');
|
|
74
|
-
} catch (error) {
|
|
75
|
-
console.error('下载失败:', error);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// 示例5: 在Luckysheet对话框中的实际应用
|
|
80
|
-
function exampleInDialogUsage() {
|
|
81
|
-
// 模拟对话框提交时的数据处理
|
|
82
|
-
const mockResponse = {
|
|
83
|
-
data: '{"sheet1":[[{"v":"测试数据"}]]}',
|
|
84
|
-
json: [{ sheet1: [[{ v: "测试数据" }]] }],
|
|
85
|
-
file: new File([], 'test.xlsx'), // 模拟的原始File对象
|
|
86
|
-
base64: 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,UEsDBAoAAAAAALJ...' // 模拟的Base64数据
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// 进行双向转换验证
|
|
90
|
-
const convertedFile = base64ToFile(mockResponse.base64, 'converted.xlsx');
|
|
91
|
-
const reConvertedBase64 = fileToBase64(convertedFile);
|
|
92
|
-
|
|
93
|
-
console.log('原始File:', mockResponse.file);
|
|
94
|
-
console.log('转换后的File:', convertedFile);
|
|
95
|
-
console.log('重新转换的Base64:', reConvertedBase64);
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
original: mockResponse,
|
|
99
|
-
converted: convertedFile,
|
|
100
|
-
reconverted: reConvertedBase64
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// 导出所有示例函数
|
|
105
|
-
export {
|
|
106
|
-
exampleFileToBase64,
|
|
107
|
-
exampleBase64ToFile,
|
|
108
|
-
exampleBase64ToBlob,
|
|
109
|
-
exampleDownloadBase64File,
|
|
110
|
-
exampleInDialogUsage
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// 默认导出
|
|
114
|
-
export default {
|
|
115
|
-
fileToBase64,
|
|
116
|
-
base64ToFile,
|
|
117
|
-
base64ToBlob,
|
|
118
|
-
downloadBase64File,
|
|
119
|
-
MIME_TYPES,
|
|
120
|
-
examples: {
|
|
121
|
-
fileToBase64: exampleFileToBase64,
|
|
122
|
-
base64ToFile: exampleBase64ToFile,
|
|
123
|
-
base64ToBlob: exampleBase64ToBlob,
|
|
124
|
-
downloadBase64File: exampleDownloadBase64File,
|
|
125
|
-
inDialogUsage: exampleInDialogUsage
|
|
126
|
-
}
|
|
127
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// 测试边框处理功能的修复
|
|
2
|
-
import { generateExcelBlob } from './export.js'
|
|
3
|
-
|
|
4
|
-
// 模拟测试数据
|
|
5
|
-
const testData = [{
|
|
6
|
-
name: '测试工作表',
|
|
7
|
-
data: [
|
|
8
|
-
[{ v: 'A1', bl: 1 }, { v: 'B1' }],
|
|
9
|
-
[{ v: 'A2' }, { v: 'B2' }]
|
|
10
|
-
],
|
|
11
|
-
config: {
|
|
12
|
-
borderInfo: [
|
|
13
|
-
{
|
|
14
|
-
rangeType: 'cell',
|
|
15
|
-
value: {
|
|
16
|
-
col_index: 0,
|
|
17
|
-
row_index: 0,
|
|
18
|
-
t: { color: '#ff0000', style: 1 }
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
// 测试无效边框数据
|
|
22
|
-
{
|
|
23
|
-
rangeType: 'cell',
|
|
24
|
-
value: {
|
|
25
|
-
col_index: 1,
|
|
26
|
-
row_index: 0
|
|
27
|
-
// 缺少边框定义
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
// 测试undefined边框数据
|
|
31
|
-
{
|
|
32
|
-
rangeType: 'cell',
|
|
33
|
-
value: {
|
|
34
|
-
col_index: 0,
|
|
35
|
-
row_index: 1,
|
|
36
|
-
t: undefined
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
}]
|
|
42
|
-
|
|
43
|
-
// 测试函数
|
|
44
|
-
export async function testBorderHandling() {
|
|
45
|
-
try {
|
|
46
|
-
console.log('开始测试边框处理...')
|
|
47
|
-
const blob = await generateExcelBlob(testData, 'border-test')
|
|
48
|
-
console.log('测试成功!生成的Blob大小:', blob.size)
|
|
49
|
-
return true
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.error('测试失败:', error)
|
|
52
|
-
return false
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 导出测试函数
|
|
57
|
-
export default { testBorderHandling }
|