unify-external-plugin-platform 0.0.1 → 0.0.2
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 +49 -1
- package/docs/.vuepress/config.js +46 -0
- package/docs/.vuepress/public/logo.png +0 -0
- package/docs/README.md +15 -0
- package/docs/guide/changelog.md +1 -0
- package/docs/guide/installation.md +10 -0
- package/docs/guide/quickstart.md +26 -0
- package/docs/plugin/README.md +1 -0
- package/docs/plugin/empty.md +1 -0
- package/package.json +6 -3
- package/packages/id-card-reader-demo/index.ts +9 -0
- package/packages/id-card-reader-demo/src/id-card-reader-demo.vue +142 -0
- package/packages/index.js +29 -25
- package/packages/{ZSEmpty/src/assets → scanner-high-camera-jieyu}/images/img_blank_empty.png +0 -0
- package/packages/scanner-high-camera-jieyu/index.ts +14 -0
- package/packages/scanner-high-camera-jieyu/src/component/scanner-high-camera-component.vue +292 -0
- package/packages/scanner-high-camera-jieyu/src/scanner-high-camera-jieyu.vue +174 -0
- package/packages/{ZSEmpty → zs-empty}/index.ts +9 -9
- package/packages/zs-empty/src/assets/images/img_blank_empty.png +0 -0
- package/packages/{ZSEmpty/src/index.vue → zs-empty/src/zs-empty.vue} +42 -42
- package/public/index.html +6 -0
- package/src/App.vue +6 -23
- package/src/assets/images/reg-developing.png +0 -0
- package/src/components/404.vue +17 -0
- package/src/main.ts +22 -22
- package/src/router/id-card-reader/id-card-reader.ts +19 -0
- package/src/router/index.ts +21 -2
- package/src/router/scan/scan.ts +19 -0
- package/src/views/HomeView.vue +94 -2
- package/src/views/id-card-reader/id-card-reader-page.vue +139 -0
- package/src/views/id-card-reader/model/conatant/id-card-form-attr.ts +31 -0
- package/src/views/id-card-reader/model/vo/id-card.ts +44 -0
- package/src/views/layout/home-layout.vue +72 -0
- package/src/views/layout/model/menu-data.ts +29 -0
- package/src/views/scan/scan-page.vue +56 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: lvcy
|
|
3
|
+
* @date: 2022-12-30
|
|
4
|
+
* @description:id-card-reader
|
|
5
|
+
*/
|
|
6
|
+
import {RouteConfig} from "vue-router";
|
|
7
|
+
|
|
8
|
+
const IdCardReaderRouterList: RouteConfig[] = [
|
|
9
|
+
{
|
|
10
|
+
path: 'id-card-reader',
|
|
11
|
+
name: 'id-card-reader-page',
|
|
12
|
+
meta: {
|
|
13
|
+
title: '身份证读卡器',
|
|
14
|
+
},
|
|
15
|
+
component: () => import('@/views/id-card-reader/id-card-reader-page.vue')
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
export default IdCardReaderRouterList;
|
package/src/router/index.ts
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import Vue from 'vue'
|
|
2
2
|
import VueRouter, { RouteConfig } from 'vue-router'
|
|
3
3
|
import HomeView from '../views/HomeView.vue'
|
|
4
|
+
import IdCardReaderRouterList from "@/router/id-card-reader/id-card-reader";
|
|
5
|
+
import ScanRouterList from "@/router/scan/scan";
|
|
4
6
|
|
|
5
7
|
Vue.use(VueRouter)
|
|
6
8
|
|
|
7
9
|
const routes: Array<RouteConfig> = [
|
|
8
10
|
{
|
|
9
11
|
path: '/',
|
|
10
|
-
|
|
11
|
-
component: HomeView
|
|
12
|
+
redirect: '/home',
|
|
12
13
|
},
|
|
14
|
+
{
|
|
15
|
+
path: '/home',
|
|
16
|
+
name: 'home-layout',
|
|
17
|
+
component: () => import(/* webpackChunkName: "about" */ '../views/layout/home-layout.vue'),
|
|
18
|
+
children: [
|
|
19
|
+
...IdCardReaderRouterList,
|
|
20
|
+
...ScanRouterList,
|
|
21
|
+
{ path: '404', meta: { title: '统一对外插件平台', errorPage: true }, component: () => import('@/components/404.vue') },
|
|
22
|
+
{ path: '**', redirect: '404' },
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
...[
|
|
26
|
+
...IdCardReaderRouterList,
|
|
27
|
+
...ScanRouterList
|
|
28
|
+
].map(item => ({
|
|
29
|
+
...item,
|
|
30
|
+
path: `/${item.path}`
|
|
31
|
+
})),
|
|
13
32
|
{
|
|
14
33
|
path: '/about',
|
|
15
34
|
name: 'about',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: lvcy
|
|
3
|
+
* @date: 2023-02-07
|
|
4
|
+
* @description:scan
|
|
5
|
+
*/
|
|
6
|
+
import {RouteConfig} from "vue-router";
|
|
7
|
+
|
|
8
|
+
const ScanRouterList: RouteConfig[] = [
|
|
9
|
+
{
|
|
10
|
+
path: 'scan',
|
|
11
|
+
name: 'scan-page',
|
|
12
|
+
meta: {
|
|
13
|
+
title: '扫描设备',
|
|
14
|
+
},
|
|
15
|
+
component: () => import('@/views/scan/scan-page.vue')
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
export default ScanRouterList;
|
package/src/views/HomeView.vue
CHANGED
|
@@ -1,17 +1,109 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="home">
|
|
3
|
-
<z-s-empty empty-tip="没有数据组件"></z-s-empty
|
|
3
|
+
<!-- <z-s-empty empty-tip="没有数据组件"></z-s-empty>-->
|
|
4
|
+
<id-card-reader-demo
|
|
5
|
+
type="text"
|
|
6
|
+
tip="身份证读卡器"
|
|
7
|
+
@click="handleAction"
|
|
8
|
+
></id-card-reader-demo>
|
|
9
|
+
<id-card-reader-demo
|
|
10
|
+
type="primary"
|
|
11
|
+
@click="handleAction"
|
|
12
|
+
>身份证读卡器</id-card-reader-demo>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<el-input
|
|
16
|
+
style="width: 160px;"
|
|
17
|
+
placeholder="请输入内容"
|
|
18
|
+
v-model="idCardData.info.name">
|
|
19
|
+
<template slot="suffix">
|
|
20
|
+
<id-card-reader-demo
|
|
21
|
+
type="text"
|
|
22
|
+
tip="身份证读卡器"
|
|
23
|
+
@click="handleAction"
|
|
24
|
+
></id-card-reader-demo>
|
|
25
|
+
</template>
|
|
26
|
+
</el-input>
|
|
27
|
+
|
|
28
|
+
<el-button type="default" @click="resetData">重置</el-button>
|
|
29
|
+
|
|
30
|
+
<div class="" v-if="idCardData.headImage">
|
|
31
|
+
<p>姓名: {{ idCardData.info.name }}</p>
|
|
32
|
+
<p>性别: {{ idCardData.info.sex }}</p>
|
|
33
|
+
<p>民族: {{ idCardData.info.nation }}</p>
|
|
34
|
+
<p>出生日期: {{ idCardData.info.birthday }}</p>
|
|
35
|
+
<p>地址: {{ idCardData.info.address }}</p>
|
|
36
|
+
<p>证件号码: {{ idCardData.info.cardId }}</p>
|
|
37
|
+
<p>签发机关: {{ idCardData.info.police }}</p>
|
|
38
|
+
<p>有效期开始: {{ idCardData.info.validStart }}</p>
|
|
39
|
+
<p>有效期结束: {{ idCardData.info.validEnd }}</p>
|
|
40
|
+
<img :src="idCardData.headImage" style="width: 120px;border: 1px solid #cccccc">
|
|
41
|
+
</div>
|
|
4
42
|
</div>
|
|
5
43
|
</template>
|
|
6
44
|
|
|
7
45
|
<script lang="ts">
|
|
8
46
|
import { Component, Vue } from 'vue-property-decorator';
|
|
9
47
|
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /examples
|
|
48
|
+
/**
|
|
49
|
+
* 身份证信息
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
export interface IDCard {
|
|
53
|
+
/** 身份证信息 */
|
|
54
|
+
info: IDCardInfo;
|
|
55
|
+
/** 身份证照片 */
|
|
56
|
+
headImage?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 身份证详细信息
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
export interface IDCardInfo {
|
|
64
|
+
/** 姓名 */
|
|
65
|
+
name: string;
|
|
66
|
+
/** 性别 */
|
|
67
|
+
sex: string;
|
|
68
|
+
/** 民族 */
|
|
69
|
+
nation: string;
|
|
70
|
+
/** 出生日期 */
|
|
71
|
+
birthday: string;
|
|
72
|
+
/** 地址 */
|
|
73
|
+
address: string;
|
|
74
|
+
/** 证件号码 */
|
|
75
|
+
cardId: string;
|
|
76
|
+
/** 签发机关 */
|
|
77
|
+
police?: string;
|
|
78
|
+
/** 有效期开始 */
|
|
79
|
+
validStart?: any;
|
|
80
|
+
/** 有效期结束 */
|
|
81
|
+
validEnd?: any;
|
|
82
|
+
/** 性别编码 */
|
|
83
|
+
sexCode?: string;
|
|
84
|
+
/** 民族编码 */
|
|
85
|
+
nationCode?: string;
|
|
86
|
+
}
|
|
10
87
|
|
|
11
88
|
@Component({
|
|
12
89
|
components: {
|
|
13
90
|
HelloWorld,
|
|
14
91
|
},
|
|
15
92
|
})
|
|
16
|
-
export default class HomeView extends Vue {
|
|
93
|
+
export default class HomeView extends Vue {
|
|
94
|
+
|
|
95
|
+
idCardData: IDCard = {info: {}} as IDCard;
|
|
96
|
+
|
|
97
|
+
handleAction(data: IDCard) {
|
|
98
|
+
this.idCardData = data;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
resetData() {
|
|
102
|
+
this.idCardData = {info: {}} as IDCard;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
17
105
|
</script>
|
|
106
|
+
|
|
107
|
+
<style lang="scss">
|
|
108
|
+
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- @author: lvcy
|
|
3
|
+
- @date: 2022-12-30
|
|
4
|
+
- @description:id-card-reader-page
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<div class="id-card-reader-page">
|
|
8
|
+
<h2>身份证读卡器</h2>
|
|
9
|
+
<div class="id-card-reader-content">
|
|
10
|
+
<div class="form-content">
|
|
11
|
+
<el-form ref="form" :model="idCardData" label-width="100px">
|
|
12
|
+
<el-form-item label="机器型号">
|
|
13
|
+
<el-select v-model="readerType" placeholder="请选择机器型号" style="width: 100%">
|
|
14
|
+
<el-option
|
|
15
|
+
v-for="item in selectOptions"
|
|
16
|
+
:key="item.value"
|
|
17
|
+
:label="item.label"
|
|
18
|
+
:value="item.value">
|
|
19
|
+
</el-option>
|
|
20
|
+
</el-select>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
<template
|
|
23
|
+
v-for="item in formItemList"
|
|
24
|
+
>
|
|
25
|
+
<el-col :span="item.span || 12" :key="item.name">
|
|
26
|
+
<el-form-item
|
|
27
|
+
v-if="item.type === 'other'"
|
|
28
|
+
:label="item.label"
|
|
29
|
+
:placeholder="'请输入'+item.label"
|
|
30
|
+
>
|
|
31
|
+
<el-input v-model="idCardData.info[item.name]">
|
|
32
|
+
<template slot="suffix">
|
|
33
|
+
<id-card-reader-demo
|
|
34
|
+
v-if="readerType === idCardReaderType.Demo"
|
|
35
|
+
type="text"
|
|
36
|
+
tip="身份证读卡器"
|
|
37
|
+
@click="handleAction"
|
|
38
|
+
></id-card-reader-demo>
|
|
39
|
+
</template>
|
|
40
|
+
</el-input>
|
|
41
|
+
</el-form-item>
|
|
42
|
+
<el-form-item
|
|
43
|
+
v-else
|
|
44
|
+
:key="item.name"
|
|
45
|
+
:label="item.label"
|
|
46
|
+
:placeholder="'请输入'+item.label"
|
|
47
|
+
>
|
|
48
|
+
<el-input v-model="idCardData.info[item.name]"></el-input>
|
|
49
|
+
</el-form-item>
|
|
50
|
+
</el-col>
|
|
51
|
+
</template>
|
|
52
|
+
</el-form>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="image-content">
|
|
55
|
+
<img :src="idCardData.headImage" v-if="idCardData.headImage">
|
|
56
|
+
<span v-else>
|
|
57
|
+
<i class="el-icon-user-solid"></i>
|
|
58
|
+
</span>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="action-content" style="text-align: right">
|
|
63
|
+
<!-- 测试 -->
|
|
64
|
+
<id-card-reader-demo
|
|
65
|
+
v-if="readerType === idCardReaderType.Demo"
|
|
66
|
+
type="primary"
|
|
67
|
+
@click="handleAction"
|
|
68
|
+
>身份证读卡器</id-card-reader-demo>
|
|
69
|
+
<!-- 普天 -->
|
|
70
|
+
<!-- 精伦 -->
|
|
71
|
+
<el-button type="default" @click="resetData">重置</el-button>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script lang="ts">
|
|
78
|
+
|
|
79
|
+
import {Component, Vue} from "vue-property-decorator";
|
|
80
|
+
import {IDCard} from "@/views/id-card-reader/model/vo/id-card";
|
|
81
|
+
import {
|
|
82
|
+
IdCardFormItemList,
|
|
83
|
+
IdCardReaderType,
|
|
84
|
+
IdCardReaderTypeOptions
|
|
85
|
+
} from "@/views/id-card-reader/model/conatant/id-card-form-attr";
|
|
86
|
+
|
|
87
|
+
@Component({
|
|
88
|
+
name: "id-card-reader-page"
|
|
89
|
+
})
|
|
90
|
+
export default class IdCardReaderPage extends Vue {
|
|
91
|
+
idCardData: IDCard = {info: {}} as IDCard;
|
|
92
|
+
|
|
93
|
+
formItemList = IdCardFormItemList;
|
|
94
|
+
|
|
95
|
+
readerType = '';
|
|
96
|
+
|
|
97
|
+
selectOptions = IdCardReaderTypeOptions;
|
|
98
|
+
|
|
99
|
+
idCardReaderType = IdCardReaderType;
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
handleAction(data: IDCard) {
|
|
103
|
+
this.idCardData = data;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
resetData() {
|
|
107
|
+
this.idCardData = {info: {}} as IDCard;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<style scoped lang="scss">
|
|
113
|
+
.id-card-reader-page {
|
|
114
|
+
.id-card-reader-content {
|
|
115
|
+
display: flex;
|
|
116
|
+
margin-top: 20px;
|
|
117
|
+
.form-content {
|
|
118
|
+
width: 800px;
|
|
119
|
+
}
|
|
120
|
+
.image-content {
|
|
121
|
+
margin-left: 15px;
|
|
122
|
+
img,
|
|
123
|
+
span {
|
|
124
|
+
display: inline-block;
|
|
125
|
+
width: 120px;
|
|
126
|
+
border: 1px solid #cccccc;
|
|
127
|
+
text-align: center;
|
|
128
|
+
}
|
|
129
|
+
i {
|
|
130
|
+
font-size: 100px;
|
|
131
|
+
margin: 20px 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
.action-content {
|
|
136
|
+
width: 800px;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: lvcy
|
|
3
|
+
* @date: 2022-12-30
|
|
4
|
+
* @description:id-card-form-attr
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export enum IdCardReaderType {
|
|
8
|
+
Demo = 'demo',
|
|
9
|
+
PuTian = 'putian',
|
|
10
|
+
JingLun = 'jinglun'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const IdCardReaderTypeOptions = [
|
|
14
|
+
{ label: '测试', value: IdCardReaderType.Demo },
|
|
15
|
+
{ label: '普天', value: IdCardReaderType.PuTian },
|
|
16
|
+
{ label: '精伦', value: IdCardReaderType.JingLun},
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
export const IdCardFormItemList = [
|
|
20
|
+
{ name: 'name', label: '姓名', type: 'other' },
|
|
21
|
+
{ name: 'cardId', label: '证件号码', },
|
|
22
|
+
{ name: 'sex', label: '性别', },
|
|
23
|
+
{ name: 'nation', label: '民族', },
|
|
24
|
+
{ name: 'birthday', label: '出生日期', },
|
|
25
|
+
{ name: 'police', label: '签发机关', },
|
|
26
|
+
{ name: 'validStart', label: '有效期开始', },
|
|
27
|
+
{ name: 'validEnd', label: '有效期结束', },
|
|
28
|
+
{ name: 'sexCode', label: '性别编码', },
|
|
29
|
+
{ name: 'nationCode', label: '民族编码', },
|
|
30
|
+
{ name: 'address', label: '地址', span: 24},
|
|
31
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: lvcy
|
|
3
|
+
* @date: 2022-12-30
|
|
4
|
+
* @description:id-card
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 身份证信息
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export interface IDCard {
|
|
11
|
+
/** 身份证信息 */
|
|
12
|
+
info: IDCardInfo;
|
|
13
|
+
/** 身份证照片 */
|
|
14
|
+
headImage?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 身份证详细信息
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export interface IDCardInfo {
|
|
22
|
+
/** 姓名 */
|
|
23
|
+
name: string;
|
|
24
|
+
/** 性别 */
|
|
25
|
+
sex: string;
|
|
26
|
+
/** 民族 */
|
|
27
|
+
nation: string;
|
|
28
|
+
/** 出生日期 */
|
|
29
|
+
birthday: string;
|
|
30
|
+
/** 地址 */
|
|
31
|
+
address: string;
|
|
32
|
+
/** 证件号码 */
|
|
33
|
+
cardId: string;
|
|
34
|
+
/** 签发机关 */
|
|
35
|
+
police?: string;
|
|
36
|
+
/** 有效期开始 */
|
|
37
|
+
validStart?: any;
|
|
38
|
+
/** 有效期结束 */
|
|
39
|
+
validEnd?: any;
|
|
40
|
+
/** 性别编码 */
|
|
41
|
+
sexCode?: string;
|
|
42
|
+
/** 民族编码 */
|
|
43
|
+
nationCode?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- @author: lvcy
|
|
3
|
+
- @date: 2022-12-30
|
|
4
|
+
- @description:home-layout
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<el-container
|
|
8
|
+
class="home-layout"
|
|
9
|
+
>
|
|
10
|
+
<el-header>
|
|
11
|
+
<h2>统一对外插件平台Demo</h2>
|
|
12
|
+
</el-header>
|
|
13
|
+
<el-container>
|
|
14
|
+
<el-aside width="200px">
|
|
15
|
+
|
|
16
|
+
<el-menu
|
|
17
|
+
:default-active="activeIndex"
|
|
18
|
+
:default-openeds="openedMenuList"
|
|
19
|
+
class="el-menu-vertical-demo"
|
|
20
|
+
@select="handleSelectMenu"
|
|
21
|
+
>
|
|
22
|
+
<template v-for="menu in menuList">
|
|
23
|
+
<el-menu-item
|
|
24
|
+
:key="menu.index"
|
|
25
|
+
:index="menu.index">
|
|
26
|
+
<template slot="title">
|
|
27
|
+
<i :class="menu.icon"></i>
|
|
28
|
+
<span>{{ menu.title }}</span>
|
|
29
|
+
</template>
|
|
30
|
+
</el-menu-item>
|
|
31
|
+
</template>
|
|
32
|
+
</el-menu>
|
|
33
|
+
</el-aside>
|
|
34
|
+
<el-main>
|
|
35
|
+
<router-view/>
|
|
36
|
+
</el-main>
|
|
37
|
+
</el-container>
|
|
38
|
+
</el-container>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script lang="ts">
|
|
42
|
+
import {Component, Vue} from "vue-property-decorator";
|
|
43
|
+
import {MenuDataList} from "@/views/layout/model/menu-data";
|
|
44
|
+
|
|
45
|
+
@Component({
|
|
46
|
+
name: "home-layout"
|
|
47
|
+
})
|
|
48
|
+
export default class HomeLayout extends Vue {
|
|
49
|
+
|
|
50
|
+
openedMenuList = [MenuDataList?.[0]?.index ?? '']
|
|
51
|
+
|
|
52
|
+
activeIndex = 'id-card-reader'
|
|
53
|
+
menuList = MenuDataList
|
|
54
|
+
|
|
55
|
+
created() {
|
|
56
|
+
this.$router.push(`/home/id-card-reader`)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
handleSelectMenu(path: string) {
|
|
60
|
+
this.$router.push(`/home/${path}`)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style lang="scss">
|
|
66
|
+
.home-layout {
|
|
67
|
+
height: 100%;
|
|
68
|
+
.el-main {
|
|
69
|
+
padding: 0 8px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: lvcy
|
|
3
|
+
* @date: 2022-12-30
|
|
4
|
+
* @description:menu-data
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface MenuItemBase {
|
|
8
|
+
index: string,
|
|
9
|
+
title: string,
|
|
10
|
+
icon: string,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MenuItem<T = any> extends MenuItemBase {
|
|
14
|
+
children?: MenuItem<T>[];
|
|
15
|
+
data?: T
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const MenuDataList: MenuItem[] = [
|
|
19
|
+
{
|
|
20
|
+
index: 'id-card-reader',
|
|
21
|
+
title: '身份证读卡器',
|
|
22
|
+
icon: 'el-icon-postcard',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
index: 'scan',
|
|
26
|
+
title: '扫描设备',
|
|
27
|
+
icon: 'el-icon-picture-outline',
|
|
28
|
+
}
|
|
29
|
+
]
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- @author: lvcy
|
|
3
|
+
- @date: 2023-01-09
|
|
4
|
+
- @description:scan-page
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<div class="scan-page">
|
|
8
|
+
<div class="" style="margin-bottom: 30px">
|
|
9
|
+
<h3>按钮弹框模式:</h3>
|
|
10
|
+
<scanner-high-camera-jieyu
|
|
11
|
+
open-mode="dialog"
|
|
12
|
+
icon="el-icon-picture-outline"
|
|
13
|
+
label="影像扫描"
|
|
14
|
+
type="primary"
|
|
15
|
+
size="mini"
|
|
16
|
+
@send-scanner-result="getScannerResult"
|
|
17
|
+
></scanner-high-camera-jieyu>
|
|
18
|
+
</div>
|
|
19
|
+
<!-- <scanner-high-camera-jieyu-->
|
|
20
|
+
<!-- @send-scanner-result="getScannerResultByIframeMode"-->
|
|
21
|
+
<!-- ></scanner-high-camera-jieyu>-->
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import {Component, Vue} from "vue-property-decorator";
|
|
27
|
+
|
|
28
|
+
@Component({
|
|
29
|
+
name: 'scan-page',
|
|
30
|
+
})
|
|
31
|
+
export default class ScanPage extends Vue {
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
getScannerResult(src: string) {
|
|
35
|
+
console.log('dialog=>', src)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getScannerResultByIframeMode(src: string) {
|
|
39
|
+
// console.log('iframe=>', src);
|
|
40
|
+
window.parent.postMessage({
|
|
41
|
+
type: 'scanner',
|
|
42
|
+
data: {
|
|
43
|
+
src: src
|
|
44
|
+
},
|
|
45
|
+
}, '*')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style scoped lang="scss">
|
|
53
|
+
.scan-page {
|
|
54
|
+
height: 100%;
|
|
55
|
+
}
|
|
56
|
+
</style>
|