doway-coms 2.11.11 → 2.11.13
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/.browserslistrc +2 -2
- package/README.md +28 -28
- package/dist/css/chunk-vendors.7f83d8f9.css +8 -0
- package/dist/css/index.7946d50b.css +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/js/chunk-vendors.28fda91d.js +340 -0
- package/dist/js/index.49bc6add.js +2 -0
- package/lib/doway-coms.common.js +120397 -0
- package/lib/doway-coms.css +1 -0
- package/lib/doway-coms.umd.js +120407 -0
- package/lib/doway-coms.umd.min.js +328 -0
- package/package.json +62 -62
- package/packages/AuditsList/index.js +7 -7
- package/packages/AuditsList/src/index.vue +314 -314
- package/packages/BaseButton/index.js +7 -7
- package/packages/BaseButton/src/index.vue +242 -242
- package/packages/BaseCheckbox/index.js +7 -7
- package/packages/BaseCheckbox/src/index.vue +134 -134
- package/packages/BaseDate/index.js +7 -7
- package/packages/BaseDate/src/index.vue +197 -197
- package/packages/BaseDateWeek/index.js +7 -7
- package/packages/BaseDateWeek/src/index.vue +163 -163
- package/packages/BaseDatetime/index.js +7 -7
- package/packages/BaseDatetime/src/index.vue +196 -196
- package/packages/BaseFileGroup/index.js +7 -7
- package/packages/BaseFileGroup/src/index.vue +724 -724
- package/packages/BaseForm/index.js +7 -7
- package/packages/BaseForm/src/index.vue +895 -895
- package/packages/BaseGantt/index.js +9 -9
- package/packages/BaseGantt/src/index.vue +617 -617
- package/packages/BaseGrid/index.js +9 -9
- package/packages/BaseGrid/src/exportCmp.vue +105 -105
- package/packages/BaseGrid/src/gridApi.js +32 -32
- package/packages/BaseGrid/src/index.vue +4242 -4230
- package/packages/BaseGridAdjust/index.js +9 -9
- package/packages/BaseGridAdjust/src/index.vue +482 -482
- package/packages/BaseInput/index.js +7 -7
- package/packages/BaseInput/src/index.vue +195 -195
- package/packages/BaseIntervalInput/index.js +7 -7
- package/packages/BaseIntervalInput/src/index.vue +310 -310
- package/packages/BaseKanbanEmpty/index.js +7 -7
- package/packages/BaseKanbanEmpty/src/index.vue +176 -176
- package/packages/BaseNumberInput/index.js +7 -7
- package/packages/BaseNumberInput/src/index.vue +291 -291
- package/packages/BasePagination/index.js +7 -7
- package/packages/BasePagination/src/index.vue +91 -91
- package/packages/BasePictureCard/index.js +7 -7
- package/packages/BasePictureCard/src/index.vue +671 -671
- package/packages/BasePrintPreview/index.js +7 -7
- package/packages/BasePrintPreview/src/index.vue +150 -150
- package/packages/BasePulldown/index.js +7 -7
- package/packages/BasePulldown/src/index.vue +1395 -1395
- package/packages/BaseSearch/index.js +7 -7
- package/packages/BaseSearch/src/index.vue +935 -935
- package/packages/BaseSelect/index.js +7 -7
- package/packages/BaseSelect/src/index.vue +155 -155
- package/packages/BaseSelectMulti/index.js +7 -7
- package/packages/BaseSelectMulti/src/index.vue +148 -148
- package/packages/BaseTextArea/index.js +7 -7
- package/packages/BaseTextArea/src/index.vue +187 -187
- package/packages/BaseTime/index.js +7 -7
- package/packages/BaseTime/src/index.vue +166 -166
- package/packages/BaseTool/index.js +7 -7
- package/packages/BaseTool/src/index.vue +353 -353
- package/packages/BaseToolStatus/index.js +7 -7
- package/packages/BaseToolStatus/src/ApprovalPersonsGroup.vue +41 -41
- package/packages/BaseToolStatus/src/index.vue +439 -439
- package/packages/BaseTreeSelect/index.js +8 -8
- package/packages/BaseTreeSelect/src/index.vue +437 -437
- package/packages/HistoryModal/index.js +8 -8
- package/packages/HistoryModal/src/index.vue +144 -144
- package/packages/LeaveAMessage/index.js +7 -7
- package/packages/LeaveAMessage/src/index.vue +601 -601
- package/packages/directive/clickoutside.js +44 -44
- package/packages/index.js +197 -197
- package/packages/styles/default.css +78 -78
- package/packages/styles/default.less +91 -91
- package/packages/utils/api.js +122 -122
- package/packages/utils/auth.js +38 -38
- package/packages/utils/common.js +703 -703
- package/packages/utils/dom.js +181 -181
- package/packages/utils/enum.js +86 -86
- package/packages/utils/filters.js +495 -485
- package/packages/utils/gridFormat.js +66 -66
- package/packages/utils/msg.js +103 -103
- package/packages/utils/patchFiles.js +44 -44
- package/packages/utils/request.js +181 -181
- package/packages/utils/store.js +372 -372
- package/packages/utils/tscPrinter.js +101 -101
- package/sync.bash +6 -6
- package/vue.config.js +59 -59
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { encode } from 'gbk.js' // 修正包名
|
|
2
|
-
import XEUtils from 'xe-utils'
|
|
3
|
-
export function getPrinterPath() {
|
|
4
|
-
return new Promise((resolve, reject) => {
|
|
5
|
-
const websocket = new WebSocket(process.env.VUE_APP_PRINT_USB_URL)
|
|
6
|
-
|
|
7
|
-
websocket.onopen = function() {
|
|
8
|
-
websocket.send(JSON.stringify({ usb_list: [] }))
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
websocket.onmessage = function(event) {
|
|
12
|
-
try {
|
|
13
|
-
const data = JSON.parse(event.data)
|
|
14
|
-
if ('usb_list' in data) {
|
|
15
|
-
if (data.usb_list.length === 0) {
|
|
16
|
-
reject(new Error('未找到USB打印机'))
|
|
17
|
-
} else {
|
|
18
|
-
resolve(data.usb_list[0].USBPath)
|
|
19
|
-
}
|
|
20
|
-
websocket.close()
|
|
21
|
-
}
|
|
22
|
-
} catch (e) {
|
|
23
|
-
reject(new Error('获取打印机信息失败: ' + e))
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
websocket.onerror = function(error) {
|
|
28
|
-
reject(new Error('WebSocket连接失败: ' + error))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// 设置超时
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
websocket.close()
|
|
34
|
-
reject(new Error('获取打印机超时'))
|
|
35
|
-
}, 5000)
|
|
36
|
-
})
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function printLabel(printerPath, command) {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
const websocket = new WebSocket(process.env.VUE_APP_PRINT_USB_URL)
|
|
42
|
-
|
|
43
|
-
websocket.onopen = function() {
|
|
44
|
-
const encodedCommand = btoa(
|
|
45
|
-
Array.from(encode(command))
|
|
46
|
-
.map(val => String.fromCharCode(val))
|
|
47
|
-
.join('')
|
|
48
|
-
)
|
|
49
|
-
const printObj = {
|
|
50
|
-
functions_inorder: [
|
|
51
|
-
{ openport_usb: printerPath },
|
|
52
|
-
{ sendUint8Array: encodedCommand },
|
|
53
|
-
{ closeport: '' }
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
websocket.send(JSON.stringify(printObj))
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
websocket.onmessage = function(event) {
|
|
60
|
-
if (event.data === 'Finished') {
|
|
61
|
-
websocket.close()
|
|
62
|
-
resolve()
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
websocket.onerror = function(error) {
|
|
67
|
-
reject(new Error('打印失败: ' + error))
|
|
68
|
-
}
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export async function printLabelByte(printerPath, encodedCommands) {
|
|
73
|
-
return new Promise((resolve, reject) => {
|
|
74
|
-
const websocket = new WebSocket(process.env.VUE_APP_PRINT_USB_URL)
|
|
75
|
-
websocket.onopen = function() {
|
|
76
|
-
const printObj = {
|
|
77
|
-
functions_inorder: [
|
|
78
|
-
{ openport_usb: printerPath }
|
|
79
|
-
// {"sendUint8Array": encodedCommand},
|
|
80
|
-
// {"sendUint8Array": encodedCommand},
|
|
81
|
-
// {"closeport": ""}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
XEUtils.arrayEach(encodedCommands, encodedCommand => {
|
|
85
|
-
printObj.functions_inorder.push({ sendUint8Array: encodedCommand })
|
|
86
|
-
})
|
|
87
|
-
printObj.functions_inorder.push({ closeport: '' })
|
|
88
|
-
websocket.send(JSON.stringify(printObj))
|
|
89
|
-
}
|
|
90
|
-
websocket.onmessage = function(event) {
|
|
91
|
-
if (event.data === 'Finished') {
|
|
92
|
-
websocket.close()
|
|
93
|
-
resolve()
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
websocket.onerror = function(error) {
|
|
98
|
-
reject(new Error('打印失败: ' + error))
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
}
|
|
1
|
+
import { encode } from 'gbk.js' // 修正包名
|
|
2
|
+
import XEUtils from 'xe-utils'
|
|
3
|
+
export function getPrinterPath() {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const websocket = new WebSocket(process.env.VUE_APP_PRINT_USB_URL)
|
|
6
|
+
|
|
7
|
+
websocket.onopen = function() {
|
|
8
|
+
websocket.send(JSON.stringify({ usb_list: [] }))
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
websocket.onmessage = function(event) {
|
|
12
|
+
try {
|
|
13
|
+
const data = JSON.parse(event.data)
|
|
14
|
+
if ('usb_list' in data) {
|
|
15
|
+
if (data.usb_list.length === 0) {
|
|
16
|
+
reject(new Error('未找到USB打印机'))
|
|
17
|
+
} else {
|
|
18
|
+
resolve(data.usb_list[0].USBPath)
|
|
19
|
+
}
|
|
20
|
+
websocket.close()
|
|
21
|
+
}
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(new Error('获取打印机信息失败: ' + e))
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
websocket.onerror = function(error) {
|
|
28
|
+
reject(new Error('WebSocket连接失败: ' + error))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 设置超时
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
websocket.close()
|
|
34
|
+
reject(new Error('获取打印机超时'))
|
|
35
|
+
}, 5000)
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function printLabel(printerPath, command) {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
const websocket = new WebSocket(process.env.VUE_APP_PRINT_USB_URL)
|
|
42
|
+
|
|
43
|
+
websocket.onopen = function() {
|
|
44
|
+
const encodedCommand = btoa(
|
|
45
|
+
Array.from(encode(command))
|
|
46
|
+
.map(val => String.fromCharCode(val))
|
|
47
|
+
.join('')
|
|
48
|
+
)
|
|
49
|
+
const printObj = {
|
|
50
|
+
functions_inorder: [
|
|
51
|
+
{ openport_usb: printerPath },
|
|
52
|
+
{ sendUint8Array: encodedCommand },
|
|
53
|
+
{ closeport: '' }
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
websocket.send(JSON.stringify(printObj))
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
websocket.onmessage = function(event) {
|
|
60
|
+
if (event.data === 'Finished') {
|
|
61
|
+
websocket.close()
|
|
62
|
+
resolve()
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
websocket.onerror = function(error) {
|
|
67
|
+
reject(new Error('打印失败: ' + error))
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export async function printLabelByte(printerPath, encodedCommands) {
|
|
73
|
+
return new Promise((resolve, reject) => {
|
|
74
|
+
const websocket = new WebSocket(process.env.VUE_APP_PRINT_USB_URL)
|
|
75
|
+
websocket.onopen = function() {
|
|
76
|
+
const printObj = {
|
|
77
|
+
functions_inorder: [
|
|
78
|
+
{ openport_usb: printerPath }
|
|
79
|
+
// {"sendUint8Array": encodedCommand},
|
|
80
|
+
// {"sendUint8Array": encodedCommand},
|
|
81
|
+
// {"closeport": ""}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
XEUtils.arrayEach(encodedCommands, encodedCommand => {
|
|
85
|
+
printObj.functions_inorder.push({ sendUint8Array: encodedCommand })
|
|
86
|
+
})
|
|
87
|
+
printObj.functions_inorder.push({ closeport: '' })
|
|
88
|
+
websocket.send(JSON.stringify(printObj))
|
|
89
|
+
}
|
|
90
|
+
websocket.onmessage = function(event) {
|
|
91
|
+
if (event.data === 'Finished') {
|
|
92
|
+
websocket.close()
|
|
93
|
+
resolve()
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
websocket.onerror = function(error) {
|
|
98
|
+
reject(new Error('打印失败: ' + error))
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
}
|
package/sync.bash
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#open https://npmmirror.com/sync/doway-coms
|
|
2
|
-
nrm use alinpm
|
|
3
|
-
npm publish
|
|
4
|
-
nrm use npm
|
|
5
|
-
npm publish
|
|
6
|
-
|
|
1
|
+
#open https://npmmirror.com/sync/doway-coms
|
|
2
|
+
nrm use alinpm
|
|
3
|
+
npm publish
|
|
4
|
+
nrm use npm
|
|
5
|
+
npm publish
|
|
6
|
+
|
package/vue.config.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
// vue.config.js 文件
|
|
2
|
-
// const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
|
3
|
-
const path = require('path')
|
|
4
|
-
function resolve(dir) {
|
|
5
|
-
return path.join(__dirname, dir)
|
|
6
|
-
}
|
|
7
|
-
module.exports = {
|
|
8
|
-
pages: {
|
|
9
|
-
index: {
|
|
10
|
-
entry: "examples/main.js",
|
|
11
|
-
template: "public/index.html",
|
|
12
|
-
filename: "index.html"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
// configureWebpack: () => {
|
|
16
|
-
// new ExtractTextPlugin('libs/test.css')
|
|
17
|
-
// },
|
|
18
|
-
// css: {
|
|
19
|
-
// extract: true, // 是否使用css分离插件 ExtractTextPlugin
|
|
20
|
-
// sourceMap: false, // 开启 CSS source maps?
|
|
21
|
-
// // loaderOptions: {
|
|
22
|
-
// // less: {
|
|
23
|
-
// // javascriptEnabled: true //less 配置
|
|
24
|
-
// // }
|
|
25
|
-
// // }, // css预设器配置项
|
|
26
|
-
// modules: false // 启用 CSS modules for all css / pre-processor files.
|
|
27
|
-
// },
|
|
28
|
-
// 扩展 webpack 配置,使 packages 加入编译
|
|
29
|
-
/* chainWebpack 是一个函数,会接收一个基于 webpack-chain 的 ChainableConfig 实例。容许对内部的 webpack 配置进行更细粒度的修改。 */
|
|
30
|
-
chainWebpack: config => {
|
|
31
|
-
config.plugins.delete('preload') // TODO: need test
|
|
32
|
-
config.plugins.delete('prefetch') // TODO: need test
|
|
33
|
-
config.resolve.alias.set('../../tools/dom', resolve('packages/utils/dom.js'))
|
|
34
|
-
// config.module.rule('/\.less$/').use(ExtractTextPlugin.extract({
|
|
35
|
-
// fallback:'vue-style-loader',
|
|
36
|
-
// use:['css-loader',
|
|
37
|
-
// 'less-loader']
|
|
38
|
-
// })).loader('less-loader','css-loader')
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
config.module
|
|
43
|
-
.rule('js')
|
|
44
|
-
.include
|
|
45
|
-
.add(__dirname + 'packages') // 注意这里须要绝对路径,全部要拼接__dirname
|
|
46
|
-
.end()
|
|
47
|
-
.use('babel')
|
|
48
|
-
.loader('babel-loader')
|
|
49
|
-
.tap(options => {
|
|
50
|
-
// 修改它的选项...
|
|
51
|
-
return options
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
// vue.config.js 文件
|
|
2
|
+
// const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
|
3
|
+
const path = require('path')
|
|
4
|
+
function resolve(dir) {
|
|
5
|
+
return path.join(__dirname, dir)
|
|
6
|
+
}
|
|
7
|
+
module.exports = {
|
|
8
|
+
pages: {
|
|
9
|
+
index: {
|
|
10
|
+
entry: "examples/main.js",
|
|
11
|
+
template: "public/index.html",
|
|
12
|
+
filename: "index.html"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
// configureWebpack: () => {
|
|
16
|
+
// new ExtractTextPlugin('libs/test.css')
|
|
17
|
+
// },
|
|
18
|
+
// css: {
|
|
19
|
+
// extract: true, // 是否使用css分离插件 ExtractTextPlugin
|
|
20
|
+
// sourceMap: false, // 开启 CSS source maps?
|
|
21
|
+
// // loaderOptions: {
|
|
22
|
+
// // less: {
|
|
23
|
+
// // javascriptEnabled: true //less 配置
|
|
24
|
+
// // }
|
|
25
|
+
// // }, // css预设器配置项
|
|
26
|
+
// modules: false // 启用 CSS modules for all css / pre-processor files.
|
|
27
|
+
// },
|
|
28
|
+
// 扩展 webpack 配置,使 packages 加入编译
|
|
29
|
+
/* chainWebpack 是一个函数,会接收一个基于 webpack-chain 的 ChainableConfig 实例。容许对内部的 webpack 配置进行更细粒度的修改。 */
|
|
30
|
+
chainWebpack: config => {
|
|
31
|
+
config.plugins.delete('preload') // TODO: need test
|
|
32
|
+
config.plugins.delete('prefetch') // TODO: need test
|
|
33
|
+
config.resolve.alias.set('../../tools/dom', resolve('packages/utils/dom.js'))
|
|
34
|
+
// config.module.rule('/\.less$/').use(ExtractTextPlugin.extract({
|
|
35
|
+
// fallback:'vue-style-loader',
|
|
36
|
+
// use:['css-loader',
|
|
37
|
+
// 'less-loader']
|
|
38
|
+
// })).loader('less-loader','css-loader')
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
config.module
|
|
43
|
+
.rule('js')
|
|
44
|
+
.include
|
|
45
|
+
.add(__dirname + 'packages') // 注意这里须要绝对路径,全部要拼接__dirname
|
|
46
|
+
.end()
|
|
47
|
+
.use('babel')
|
|
48
|
+
.loader('babel-loader')
|
|
49
|
+
.tap(options => {
|
|
50
|
+
// 修改它的选项...
|
|
51
|
+
return options
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
60
|
|