emacroh5lib 1.0.0 → 1.0.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/README.md +10 -4
- package/package.json +16 -4
- package/src/components/HelloWorld.vue +3 -3
- package/src/components/MessageBox.jsx +117 -0
- package/src/components/MessageBoxTest.tsx +11 -0
- package/src/index.ts +34 -12
- package/src/main.ts +3 -1
- package/src/router/index.ts +11 -1
- package/src/shims-vue.d.ts +2 -2
- package/src/utilities/File.ts +51 -19
- package/src/views/DragResizeView/index.vue +3 -0
- package/src/views/DragResizeView/vue-drag-resize.css +46 -0
- package/src/views/DragResizeView/vue-drag-resize.html +17 -0
- package/src/views/DragResizeView/vue-drag-resize.js +868 -0
- package/src/views/ExcelExporter/index.less +16 -0
- package/src/views/ExcelExporter/index.vue +74 -0
- package/src/views/FileViewer/index.less +16 -0
- package/src/views/FileViewer/index.vue +78 -0
- package/src/views/HomeView.vue +2 -0
- package/src/views/ImageViewer/index.vue +505 -0
- package/src/views/ImageViewer/style/css/index.css +186 -0
- package/src/views/ImageViewer/style/css/index.less +212 -0
- package/src/views/ImageViewer/style/images/icons.png +0 -0
- package/src/views/TestView/Export2Excel.ts +496 -0
- package/src/views/TestView/index.less +25 -0
- package/src/views/TestView/index.vue +231 -0
- package/src/views/TestView/list.json +12007 -0
- package/src/vue-prototype.d.ts +7 -0
- package/tsconfig.json +4 -3
- package/typings.d.ts +1 -1
- package/webpack.config.js +52 -4
@@ -0,0 +1,74 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="app-container">
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
</div>
|
7
|
+
</template>
|
8
|
+
|
9
|
+
<script lang="ts">
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
import { Component, Prop, Vue } from "vue-property-decorator";
|
14
|
+
|
15
|
+
import $ from "jquery";
|
16
|
+
|
17
|
+
import { saveAs } from 'file-saver';
|
18
|
+
import XLSX from "xlsx-style";
|
19
|
+
|
20
|
+
import * as echarts from "echarts";
|
21
|
+
|
22
|
+
|
23
|
+
@Component({
|
24
|
+
components: {}
|
25
|
+
})
|
26
|
+
@Component({ name: 'FileViewer' })
|
27
|
+
export default class ExcelExporter extends Vue {
|
28
|
+
@Prop(Number) readonly msg!: number | undefined;
|
29
|
+
@Prop() private name!: string;
|
30
|
+
|
31
|
+
public static entryName = 'FileViewer';
|
32
|
+
private currentTime = "";
|
33
|
+
|
34
|
+
public data_0 = {
|
35
|
+
page_index: 0,
|
36
|
+
page_size: 3,
|
37
|
+
data: [
|
38
|
+
{ a: "面料类", b: "16500", c: "12063", d: "45.5%" },
|
39
|
+
{ a: "面料类", b: "26500", c: "12063", d: "45.5%" },
|
40
|
+
{ a: "面料类", b: "36500", c: "12063", d: "45.5%" },
|
41
|
+
{ a: "面料类", b: "46500", c: "12063", d: "45.5%" },
|
42
|
+
{ a: "面料类", b: "56500", c: "12063", d: "45.5%" },
|
43
|
+
],
|
44
|
+
};
|
45
|
+
|
46
|
+
// 计算属性
|
47
|
+
private get reversedMessage(): string {
|
48
|
+
return this.currentTime;
|
49
|
+
}
|
50
|
+
|
51
|
+
public test1(): void {
|
52
|
+
// EMacro.File.readLocalExcel((file, workbook) => {
|
53
|
+
// console.log("file", file);
|
54
|
+
// console.log("workbook", workbook);
|
55
|
+
// console.log("数据", workbook.Sheets["工作表1"]["G32"].h);
|
56
|
+
// });
|
57
|
+
}
|
58
|
+
|
59
|
+
// 生命周期
|
60
|
+
private created(): void { }
|
61
|
+
private mounted(): void {
|
62
|
+
this.$nextTick(() => {
|
63
|
+
// console.log("调用", EMacro);
|
64
|
+
});
|
65
|
+
}
|
66
|
+
private updated(): void { }
|
67
|
+
private destroyed(): void { }
|
68
|
+
|
69
|
+
}
|
70
|
+
</script>
|
71
|
+
|
72
|
+
<style lang="less" scoped>
|
73
|
+
@import "index.less";
|
74
|
+
</style>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="app-container">
|
3
|
+
|
4
|
+
<div style="background-color: #42b983; color: red;">
|
5
|
+
zxcxzcxzcz
|
6
|
+
<span>测试</span>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<button @click="test2($event)" class="click-button">点击事件</button>
|
10
|
+
|
11
|
+
</div>
|
12
|
+
</template>
|
13
|
+
|
14
|
+
<script lang="ts">
|
15
|
+
|
16
|
+
import { Component, Prop, Vue } from "vue-property-decorator";
|
17
|
+
|
18
|
+
import $ from "jquery";
|
19
|
+
|
20
|
+
import * as echarts from "echarts";
|
21
|
+
|
22
|
+
@Component({
|
23
|
+
components: {}
|
24
|
+
})
|
25
|
+
@Component({ name: 'FileViewer' })
|
26
|
+
export default class FileViewer extends Vue {
|
27
|
+
@Prop(Number) readonly msg!: number | undefined;
|
28
|
+
@Prop() private name!: string;
|
29
|
+
|
30
|
+
public static entryName = 'FileViewer';
|
31
|
+
private currentTime = "";
|
32
|
+
|
33
|
+
public data_0 = {
|
34
|
+
page_index: 0,
|
35
|
+
page_size: 3,
|
36
|
+
data: [
|
37
|
+
{ a: "面料类", b: "16500", c: "12063", d: "45.5%" },
|
38
|
+
{ a: "面料类", b: "26500", c: "12063", d: "45.5%" },
|
39
|
+
{ a: "面料类", b: "36500", c: "12063", d: "45.5%" },
|
40
|
+
{ a: "面料类", b: "46500", c: "12063", d: "45.5%" },
|
41
|
+
{ a: "面料类", b: "56500", c: "12063", d: "45.5%" },
|
42
|
+
],
|
43
|
+
};
|
44
|
+
|
45
|
+
// 计算属性
|
46
|
+
private get reversedMessage(): string {
|
47
|
+
return this.currentTime;
|
48
|
+
}
|
49
|
+
|
50
|
+
private test2(e): void {
|
51
|
+
alert("你好")
|
52
|
+
console.log('event', e);
|
53
|
+
}
|
54
|
+
|
55
|
+
public test1(): void {
|
56
|
+
// EMacro.File.readLocalExcel((file, workbook) => {
|
57
|
+
// console.log("file", file);
|
58
|
+
// console.log("workbook", workbook);
|
59
|
+
// console.log("数据", workbook.Sheets["工作表1"]["G32"].h);
|
60
|
+
// });
|
61
|
+
}
|
62
|
+
|
63
|
+
// 生命周期
|
64
|
+
private created(): void { }
|
65
|
+
private mounted(): void {
|
66
|
+
this.$nextTick(() => {
|
67
|
+
// console.log("调用", EMacro);
|
68
|
+
});
|
69
|
+
}
|
70
|
+
private updated(): void { }
|
71
|
+
private destroyed(): void { }
|
72
|
+
|
73
|
+
}
|
74
|
+
</script>
|
75
|
+
|
76
|
+
<style lang="less" scoped>
|
77
|
+
@import "index.less";
|
78
|
+
</style>
|
package/src/views/HomeView.vue
CHANGED
@@ -8,12 +8,14 @@
|
|
8
8
|
<script lang="ts">
|
9
9
|
import { Component, Vue } from "vue-property-decorator";
|
10
10
|
import HelloWorld from "@/components/HelloWorld.vue"; // @ is an alias to /src
|
11
|
+
import MessageBoxTest from "@/components/MessageBoxTest";
|
11
12
|
import axios from "axios";
|
12
13
|
import $ from 'jquery'
|
13
14
|
|
14
15
|
@Component({
|
15
16
|
components: {
|
16
17
|
HelloWorld,
|
18
|
+
MessageBoxTest
|
17
19
|
},
|
18
20
|
mounted() {
|
19
21
|
// console.log("测试", axios.post);
|