emacroh5lib 1.0.1 → 1.0.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/README.md +3 -2
- package/package.json +13 -5
- package/src/components/HelloWorld.vue +3 -3
- package/src/components/MessageBox.jsx +1 -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 +8 -3
- package/src/shims-vue.d.ts +2 -2
- package/src/utilities/File.ts +6 -2
- 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/{File → ExcelExporter}/index.less +1 -0
- package/src/views/{File → ExcelExporter}/index.vue +24 -24
- 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 +3 -2
- package/typings.d.ts +1 -1
- package/webpack.config.js +28 -2
package/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
## 安装
|
2
|
+
npm i emacroh5lib --registry https://registry.npmjs.org/
|
2
3
|
|
3
4
|
## 读取excel表格数据
|
4
5
|
|
@@ -6,6 +7,6 @@
|
|
6
7
|
EMacro.File.readLocalExcel((file, workbook) => {
|
7
8
|
console.log("file", file);
|
8
9
|
console.log("workbook", workbook);
|
9
|
-
console.log("数据", workbook.Sheets["工作表1"]["G32"]
|
10
|
+
console.log("数据", workbook.Sheets["工作表1"]["G32"]);
|
10
11
|
});
|
11
12
|
```
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "emacroh5lib",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.4",
|
4
4
|
"description": "EMacro前端组件库",
|
5
5
|
"main": "./dist/emacroh5lib.min.js",
|
6
6
|
"types": "./dist/types/index.d.ts",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"e2e": "vue-cli-service test:e2e",
|
14
14
|
"watch": "webpack --watch",
|
15
15
|
"serve": "webpack serve",
|
16
|
-
"dev": "
|
16
|
+
"dev": "vue-cli-service test:e2e",
|
17
17
|
"commit": "cz",
|
18
18
|
"test": "echo \"Error: no test specified\" && exit 1"
|
19
19
|
},
|
@@ -66,6 +66,8 @@
|
|
66
66
|
"ts-jest": "^27.1.4",
|
67
67
|
"ts-loader": "^9.2.8",
|
68
68
|
"typescript": "^4.6.3",
|
69
|
+
"vue-loader": "^15.7.0",
|
70
|
+
"vue-router": "^3.1.3",
|
69
71
|
"vue-template-compiler": "^2.6.14",
|
70
72
|
"webpack": "^5.72.0",
|
71
73
|
"webpack-cli": "^4.9.2",
|
@@ -73,15 +75,22 @@
|
|
73
75
|
},
|
74
76
|
"dependencies": {
|
75
77
|
"@tweenjs/tween.js": "^18.6.4",
|
78
|
+
"@types/file-saver": "^2.0.5",
|
76
79
|
"@types/js-cookie": "^3.0.1",
|
77
80
|
"@vue/cli-plugin-typescript": "^5.0.4",
|
78
81
|
"axios": "^0.26.1",
|
79
82
|
"core-js": "^3.22.2",
|
83
|
+
"deep-eql": "^4.0.0",
|
80
84
|
"echarts": "^5.3.2",
|
81
85
|
"echarts-gl": "^2.0.9",
|
82
86
|
"element-ui": "^2.15.8",
|
87
|
+
"file-saver": "^2.0.5",
|
88
|
+
"hammerjs": "^2.0.8",
|
83
89
|
"jquery": "^3.6.0",
|
84
90
|
"js-cookie": "^3.0.1",
|
91
|
+
"js-xlsx": "^0.8.22",
|
92
|
+
"lay-excel": "^1.7.6",
|
93
|
+
"query-string": "^7.0.1",
|
85
94
|
"register-service-worker": "^1.7.2",
|
86
95
|
"three": "^0.139.2",
|
87
96
|
"typings": "^2.1.1",
|
@@ -89,10 +98,9 @@
|
|
89
98
|
"vue-class-component": "^7.2.3",
|
90
99
|
"vue-echarts": "^6.0.2",
|
91
100
|
"vue-property-decorator": "^9.1.2",
|
92
|
-
"vue-
|
101
|
+
"vue-tsx-support": "^3.2.0",
|
93
102
|
"vuex": "^3.6.2",
|
94
103
|
"xlsx": "^0.18.5",
|
95
|
-
"
|
96
|
-
"deep-eql": "^4.0.0"
|
104
|
+
"xlsx-style": "^0.8.13"
|
97
105
|
}
|
98
106
|
}
|
@@ -83,11 +83,11 @@
|
|
83
83
|
<script lang="ts">
|
84
84
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
85
85
|
|
86
|
-
@Component
|
86
|
+
@Component({ name: "HelloWorld" })
|
87
87
|
export default class HelloWorld extends Vue {
|
88
|
-
@Prop() private msg!: string;
|
88
|
+
@Prop() private msg!: string;
|
89
89
|
|
90
|
-
public test():void{
|
90
|
+
public test(): void {
|
91
91
|
|
92
92
|
console.log(this.msg);
|
93
93
|
|
@@ -102,6 +102,7 @@ export default {
|
|
102
102
|
render() {
|
103
103
|
return (
|
104
104
|
<div>
|
105
|
+
<div>你好撒发射点 </div>
|
105
106
|
<a-select show-search placeholder={this.placeholder} option-filter-prop="children" style={this.css}
|
106
107
|
onfocus={this.focus} onblur={this.blur} onchange={this.change} oninputKeydown={this.inputKeydown} defaultValue={this.defaultValue}>
|
107
108
|
{
|
package/src/index.ts
CHANGED
@@ -1,21 +1,43 @@
|
|
1
1
|
|
2
|
+
import { EMacro } from "./utilities/File";
|
3
|
+
|
4
|
+
|
5
|
+
import FileViewer from './views/FileViewer/index.vue'
|
6
|
+
import ImageViewer from './views/ImageViewer/index.vue'
|
7
|
+
import DragResizeView from './views/DragResizeView/index.vue'
|
8
|
+
import MessageBoxTest from "@/components/MessageBoxTest";
|
9
|
+
|
10
|
+
const components = [FileViewer, ImageViewer, DragResizeView];
|
11
|
+
|
12
|
+
const install = (Vue: any) => {
|
13
|
+
if ((install as any).installed) return;
|
14
|
+
(install as any).installed = true;
|
15
|
+
components.map((component) => {
|
16
|
+
Vue.component(component.name, component);
|
17
|
+
});
|
18
|
+
};
|
19
|
+
// 这一步判断window.Vue是否存在,因为直接引用vue.min.js, 它会把Vue绑到Window上,我们直接引用打包好的js才能正常跑起来。
|
20
|
+
if (typeof window !== 'undefined' && (window as any).Vue) {
|
21
|
+
// window.Vue.use(install)
|
22
|
+
install((window as any).Vue);
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
// import HelloWorld from "@/components/HelloWorld.vue";
|
30
|
+
// import HelloWorld from "@/components/index";
|
31
|
+
|
32
|
+
|
33
|
+
|
2
34
|
|
3
|
-
class Test {
|
4
35
|
|
5
|
-
public static print(info: string): void {
|
6
|
-
console.log(info);
|
7
36
|
|
8
|
-
console.log('测试npm');
|
9
37
|
|
10
|
-
const arr = [1, 2]
|
11
|
-
console.log(arr[5]);
|
12
38
|
|
13
|
-
console.log('测试npm22');
|
14
|
-
console.log('测试npm33333');
|
15
39
|
|
16
|
-
}
|
17
40
|
|
18
|
-
}
|
19
41
|
|
20
|
-
export default
|
21
|
-
export { }
|
42
|
+
export default {}
|
43
|
+
export { EMacro, FileViewer, DragResizeView }
|
package/src/main.ts
CHANGED
package/src/router/index.ts
CHANGED
@@ -19,9 +19,14 @@ const routes: Array<RouteConfig> = [
|
|
19
19
|
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
20
20
|
},
|
21
21
|
{
|
22
|
-
path: '/
|
23
|
-
name: '
|
24
|
-
component: () => import('../views/
|
22
|
+
path: '/FileViewer',
|
23
|
+
name: 'FileViewer',
|
24
|
+
component: () => import('../views/FileViewer/index.vue')
|
25
|
+
},
|
26
|
+
{
|
27
|
+
path: '/TestView',
|
28
|
+
name: 'TestView',
|
29
|
+
component: () => import('../views/TestView/index.vue')
|
25
30
|
},
|
26
31
|
]
|
27
32
|
|
package/src/shims-vue.d.ts
CHANGED
package/src/utilities/File.ts
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
.vdr {
|
2
|
+
position: absolute;
|
3
|
+
box-sizing: border-box;
|
4
|
+
}
|
5
|
+
.vdr.active:before{
|
6
|
+
content: '';
|
7
|
+
width: 100%;
|
8
|
+
height: 100%;
|
9
|
+
position: absolute;
|
10
|
+
top: 0;
|
11
|
+
left: 0;
|
12
|
+
box-sizing: border-box;
|
13
|
+
outline: 1px dashed #d6d6d6;
|
14
|
+
}
|
15
|
+
.vdr-stick {
|
16
|
+
box-sizing: border-box;
|
17
|
+
position: absolute;
|
18
|
+
font-size: 1px;
|
19
|
+
background: #ffffff;
|
20
|
+
border: 1px solid #6c6c6c;
|
21
|
+
box-shadow: 0 0 2px #bbb;
|
22
|
+
}
|
23
|
+
.inactive .vdr-stick {
|
24
|
+
display: none;
|
25
|
+
}
|
26
|
+
.vdr-stick-tl, .vdr-stick-br {
|
27
|
+
cursor: nwse-resize;
|
28
|
+
}
|
29
|
+
.vdr-stick-tm, .vdr-stick-bm {
|
30
|
+
left: 50%;
|
31
|
+
cursor: ns-resize;
|
32
|
+
}
|
33
|
+
.vdr-stick-tr, .vdr-stick-bl {
|
34
|
+
cursor: nesw-resize;
|
35
|
+
}
|
36
|
+
.vdr-stick-ml, .vdr-stick-mr {
|
37
|
+
top: 50%;
|
38
|
+
cursor: ew-resize;
|
39
|
+
}
|
40
|
+
.vdr-stick.not-resizable{
|
41
|
+
display: none;
|
42
|
+
}
|
43
|
+
.content-container{
|
44
|
+
display: block;
|
45
|
+
position: relative;
|
46
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="vdr" :style="positionStyle"
|
2
|
+
:class="`${(active || isActive) ? 'active' : 'inactive'} ${contentClass ? contentClass: ''}`"
|
3
|
+
@mousedown="bodyDown($event)"
|
4
|
+
@touchstart="bodyDown($event)"
|
5
|
+
@touchend="up($event)">
|
6
|
+
<div :style="sizeStyle" class="content-container" ref="container">
|
7
|
+
<slot></slot>
|
8
|
+
</div>
|
9
|
+
<div
|
10
|
+
v-for="stick in sticks"
|
11
|
+
class="vdr-stick"
|
12
|
+
:class="['vdr-stick-' + stick, isResizable ? '' : 'not-resizable']"
|
13
|
+
@mousedown.stop.prevent="stickDown(stick, $event)"
|
14
|
+
@touchstart.stop.prevent="stickDown(stick, $event)"
|
15
|
+
:style="vdrStick(stick)">
|
16
|
+
</div>
|
17
|
+
</div>
|