vue2-client 1.12.2 → 1.12.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/package.json +1 -1
- package/src/base-client/components/common/XCardSet/XCardSet.vue +198 -0
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +3 -2
- package/src/base-client/components/common/XTable/XTableWrapper.vue +1 -1
- package/src/logic/plugins/common/DateTools.js +3 -0
- package/src/logic/plugins/common/VueTools.js +30 -0
- package/src/logic/plugins/index.js +3 -1
- package/src/pages/LogicCallExample/index.vue +10 -0
- package/src/pages/userInfoDetailManage/index.vue +82 -82
- package/src/plugins/HiPrintPlugin.js +23 -15
- package/src/utils/request.js +3 -8
- package/src/utils/routerUtil.js +17 -0
package/package.json
CHANGED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="card-box">
|
|
3
|
+
<div
|
|
4
|
+
class="section-tab"
|
|
5
|
+
v-bind:innerText="configurationParameters"
|
|
6
|
+
contenteditable="true"
|
|
7
|
+
:style="{ backgroundColor: configurationParameters.tabBackgroundColor }">
|
|
8
|
+
<a-icon :type="configurationParameters.icon" style="margin-left: 2%;font-size: medium;"/>
|
|
9
|
+
{{ configurationParameters.tab }}
|
|
10
|
+
</div>
|
|
11
|
+
<div class="patient-overview">
|
|
12
|
+
<div
|
|
13
|
+
class="overview-section"
|
|
14
|
+
v-for="(item,index) in data"
|
|
15
|
+
:key="index"
|
|
16
|
+
:style="{borderBottom: index === data.length - 1 ? 'none' : '1px solid #ddd'}">
|
|
17
|
+
<div class="section-header" :style="{ backgroundColor: item.backgroundColor, color: item.fontColor }">
|
|
18
|
+
{{ item.titleName }}({{ item.messageNumber }})
|
|
19
|
+
</div>
|
|
20
|
+
<div class="patient-list-container">
|
|
21
|
+
<div class="patient-list">
|
|
22
|
+
<div
|
|
23
|
+
v-for="(patient, i) in item.showData"
|
|
24
|
+
:key="i"
|
|
25
|
+
class="patient-item"
|
|
26
|
+
:title="`${patient.room_number} - ${patient.patient_name}`">
|
|
27
|
+
<span class="card_data" :style="{ color: item.fontColor }">{{ patient.room_number }}</span>
|
|
28
|
+
<span class="card_data" >{{ patient.patient_name }}</span>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
|
|
39
|
+
import { getConfigByName, runLogic } from '@/services/api/common'
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
name: 'XCardSet',
|
|
43
|
+
data () {
|
|
44
|
+
return {
|
|
45
|
+
tab: 'container',
|
|
46
|
+
data: [
|
|
47
|
+
{ room_number: '', patient_name: '' }
|
|
48
|
+
],
|
|
49
|
+
/* 配置参数(titleName:行标题名,dataSource:数据源,parameter:参数,fontColor:文字颜色,backgroundColor:背景颜色,
|
|
50
|
+
pageSize:分页数量,tabBackgroundColor:标签背景颜色,isPrimarySource:是否取mainDataSource中的元素) */
|
|
51
|
+
configurationParameters: {
|
|
52
|
+
tab: '',
|
|
53
|
+
icon: '',
|
|
54
|
+
tabBackgroundColor: '',
|
|
55
|
+
mainDataSource: '',
|
|
56
|
+
serverName: '',
|
|
57
|
+
parameter: { pageSize: 8 },
|
|
58
|
+
configurationData: [
|
|
59
|
+
{
|
|
60
|
+
titleName: '',
|
|
61
|
+
isPrimarySource: true,
|
|
62
|
+
dataSource: '',
|
|
63
|
+
fontColor: '',
|
|
64
|
+
backgroundColor: ''
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
props: {
|
|
71
|
+
queryParamsName: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: 'nurseStationHomeConfig'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
created () {
|
|
77
|
+
this.getData(this.queryParamsName)
|
|
78
|
+
},
|
|
79
|
+
methods: {
|
|
80
|
+
async getData (data) {
|
|
81
|
+
this.data = []
|
|
82
|
+
getConfigByName(data, 'af-his', res => {
|
|
83
|
+
this.configurationParameters = res
|
|
84
|
+
console.log(this.configurationParameters)
|
|
85
|
+
runLogic(res.mainDataSource, res.parameter, 'af-his').then(result => {
|
|
86
|
+
for (let i = 0; i < res.configurationData.length; i++) {
|
|
87
|
+
const ConfigureDisplayData = {
|
|
88
|
+
titleName: res.configurationData[i].titleName,
|
|
89
|
+
fontColor: res.configurationData[i].fontColor,
|
|
90
|
+
backgroundColor: res.configurationData[i].backgroundColor,
|
|
91
|
+
messageNumber: result[res.configurationData[i].dataSource + 'Total'][0].total,
|
|
92
|
+
showData: []
|
|
93
|
+
}
|
|
94
|
+
this.data.push(ConfigureDisplayData)
|
|
95
|
+
this.data[i].showData = result[res.configurationData[i].dataSource]
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
watch: {
|
|
102
|
+
queryParamsName: {
|
|
103
|
+
handler (newValue) {
|
|
104
|
+
console.log(newValue)
|
|
105
|
+
this.getData(newValue)
|
|
106
|
+
},
|
|
107
|
+
deep: true
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style scoped>
|
|
114
|
+
.patient-overview {
|
|
115
|
+
width: 100%;
|
|
116
|
+
padding: 0.5%;
|
|
117
|
+
border: 1px solid #ddd;
|
|
118
|
+
border-radius: 0 5px 5px 5px;
|
|
119
|
+
height: 100%;
|
|
120
|
+
background-color: white;
|
|
121
|
+
overflow: scroll;
|
|
122
|
+
}
|
|
123
|
+
.section-header {
|
|
124
|
+
font-weight: bold;
|
|
125
|
+
display: flex;
|
|
126
|
+
width: 10%;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
min-height: 45px;
|
|
130
|
+
border-radius: 5px;
|
|
131
|
+
min-width: 90px;
|
|
132
|
+
}
|
|
133
|
+
.patient-list-container {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
width: 100%;
|
|
137
|
+
padding-left: 1%;
|
|
138
|
+
}
|
|
139
|
+
.overview-section {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-wrap: nowrap;
|
|
142
|
+
align-items: center;
|
|
143
|
+
margin-top: 1%;
|
|
144
|
+
border-bottom: 1px solid #ddd;
|
|
145
|
+
padding-bottom: 0.7%;
|
|
146
|
+
}
|
|
147
|
+
.patient-list {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-wrap: wrap;
|
|
150
|
+
gap: 10px;
|
|
151
|
+
width: 100%;
|
|
152
|
+
}
|
|
153
|
+
.patient-item {
|
|
154
|
+
background-color: #fff;
|
|
155
|
+
padding: 0.3%;
|
|
156
|
+
border: 1px solid #ddd;
|
|
157
|
+
width: 4%;
|
|
158
|
+
height: 21%;
|
|
159
|
+
text-align: center;
|
|
160
|
+
font-size: x-small;
|
|
161
|
+
border-radius: 5px;
|
|
162
|
+
min-width: 45px;
|
|
163
|
+
min-height: 45px;
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
}
|
|
166
|
+
.patient-item:hover {
|
|
167
|
+
background-color: #f0f0f0;
|
|
168
|
+
}
|
|
169
|
+
.patient-item span {
|
|
170
|
+
display: block;
|
|
171
|
+
}
|
|
172
|
+
.section-tab {
|
|
173
|
+
width: 2vw;
|
|
174
|
+
height: 22vh;
|
|
175
|
+
display: flex;
|
|
176
|
+
writing-mode: vertical-rl;
|
|
177
|
+
align-items: center;
|
|
178
|
+
justify-content: space-evenly;
|
|
179
|
+
border-radius: 5px 0 0 5px;
|
|
180
|
+
color: white;
|
|
181
|
+
min-width: 27px;
|
|
182
|
+
min-height: 80px;
|
|
183
|
+
max-height: 95px;
|
|
184
|
+
max-width: 30px;
|
|
185
|
+
}
|
|
186
|
+
.card-box {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: row;
|
|
189
|
+
height: 100%;
|
|
190
|
+
}
|
|
191
|
+
.card_data {
|
|
192
|
+
display: inline-block;
|
|
193
|
+
max-width: 5ch; /* 最多显示 3 个字符 */
|
|
194
|
+
white-space: nowrap;
|
|
195
|
+
overflow: hidden;
|
|
196
|
+
text-overflow: ellipsis;
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
<template v-else-if="cell.type === 'slot'">
|
|
35
35
|
<template
|
|
36
|
-
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list'].includes(cell.slotType)">
|
|
36
|
+
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet'].includes(cell.slotType)">
|
|
37
37
|
<component
|
|
38
38
|
:is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
|
|
39
39
|
:key="cellIndex"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
</template>
|
|
74
74
|
<template v-else-if="cell.type === 'slot'">
|
|
75
75
|
<template
|
|
76
|
-
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list'].includes(cell.slotType)">
|
|
76
|
+
v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet'].includes(cell.slotType)">
|
|
77
77
|
<component
|
|
78
78
|
:is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
|
|
79
79
|
:key="cellIndex"
|
|
@@ -478,6 +478,7 @@ export default {
|
|
|
478
478
|
XLabelSelect: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelect.vue'),
|
|
479
479
|
XConversation: () => import('@vue2-client/base-client/components/common/XConversation/XConversation.vue'),
|
|
480
480
|
XCheckList: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
|
|
481
|
+
XCardSet: () => import('@vue2-client/base-client/components/common/XCardSet/XCardSet.vue'),
|
|
481
482
|
},
|
|
482
483
|
props: {
|
|
483
484
|
// 每一行的配置
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
</span>
|
|
82
82
|
<span v-else-if="item.slotType === 'action'" :key="'action-' + c_index">
|
|
83
83
|
<template v-if="item.actionArr && item.actionArr.length > 0">
|
|
84
|
-
<a-dropdown>
|
|
84
|
+
<a-dropdown :getPopupContainer=" triggerNode => { return triggerNode.parentNode } ">
|
|
85
85
|
<a class="ant-dropdown-link" @click="e => e.preventDefault()">
|
|
86
86
|
{{ item.scopedSlots?.customRender || item.slotValue }} <a-icon type="down"/>
|
|
87
87
|
</a>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue工具类
|
|
3
|
+
*/
|
|
4
|
+
export default class VueTools {
|
|
5
|
+
static instance = new VueTools()
|
|
6
|
+
|
|
7
|
+
constructor () {
|
|
8
|
+
if (VueTools.instance) {
|
|
9
|
+
return VueTools.instance
|
|
10
|
+
}
|
|
11
|
+
VueTools.instance = this
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static getInstance () {
|
|
15
|
+
if (!VueTools.instance) {
|
|
16
|
+
VueTools.instance = new VueTools()
|
|
17
|
+
}
|
|
18
|
+
return VueTools.instance
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 获取组件实例
|
|
23
|
+
* @param vueRef vue实例
|
|
24
|
+
* @param componentName 组件实例名(refName)
|
|
25
|
+
* @returns {VueComponent}
|
|
26
|
+
*/
|
|
27
|
+
getComponent (vueRef, componentName) {
|
|
28
|
+
return vueRef.$refs[componentName]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import DateTools from '@vue2-client/logic/plugins/common/DateTools'
|
|
2
|
+
import VueTools from '@vue2-client/logic/plugins/common/VueTools'
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
|
-
dateTools: DateTools.getInstance()
|
|
5
|
+
dateTools: DateTools.getInstance(),
|
|
6
|
+
vueTools: VueTools.getInstance()
|
|
5
7
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import LogicRunner from '@vue2-client/logic/LogicRunner'
|
|
4
4
|
import { getCurrentInstance, ref } from 'vue'
|
|
5
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
5
6
|
|
|
6
7
|
const { proxy } = getCurrentInstance()
|
|
7
8
|
|
|
@@ -28,6 +29,15 @@ async function testLogic () {
|
|
|
28
29
|
显示值:<span ref="displaySpan">{{ metaData.displayValue }}</span>
|
|
29
30
|
<br/>
|
|
30
31
|
<a-button @click="testLogic">修改</a-button>
|
|
32
|
+
<br/>
|
|
33
|
+
<p>调用组件方法</p>
|
|
34
|
+
<br/>
|
|
35
|
+
<x-form-table
|
|
36
|
+
ref="testFormTable"
|
|
37
|
+
serviceName="af-system"
|
|
38
|
+
:queryParamsName="'crud_dictionary_manage'"
|
|
39
|
+
title="字典">
|
|
40
|
+
</x-form-table>
|
|
31
41
|
</div>
|
|
32
42
|
</template>
|
|
33
43
|
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-drawer
|
|
3
|
-
id="agencyManageDetail"
|
|
4
|
-
title="用户详情信息"
|
|
5
|
-
placement="right"
|
|
6
|
-
:body-style="{padding:0}"
|
|
7
|
-
:destroy-on-close="true"
|
|
8
|
-
:z-index="200"
|
|
9
|
-
width="85vw"
|
|
10
|
-
:closable="false"
|
|
11
|
-
:visible="userInfoDetailVisible"
|
|
12
|
-
@close="onClose">
|
|
13
|
-
<a-page-header v-if="userInfoDetailVisible && userInfo" :title="`用户编号:${ userInfo ? userInfo.f_userinfo_code : '' }`">
|
|
14
|
-
<x-descriptions
|
|
15
|
-
:title="null"
|
|
16
|
-
:content="userInfo"
|
|
17
|
-
serviceName="af-revenue"
|
|
18
|
-
:getRealData="true"
|
|
19
|
-
:column="4"
|
|
20
|
-
config-name="User_Info_Desc_Config">
|
|
21
|
-
<template #addonAfter>
|
|
22
|
-
<div style="text-align: right">
|
|
23
|
-
<a-statistic title="用户状态" :value="userInfo.f_user_state || 0"/>
|
|
24
|
-
<a-statistic title="表具状态" :precision="0" :value="userInfo.f_table_state || 0"/>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
</x-descriptions>
|
|
28
|
-
<user-info-detail-query-tabs :userInfo="userInfo"/>
|
|
29
|
-
<template #extra>
|
|
30
|
-
<a-button type="dashed" @click="refresh">刷新</a-button>
|
|
31
|
-
</template>
|
|
32
|
-
</a-page-header>
|
|
33
|
-
</a-drawer>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import XDescriptions from '@vue2-client/base-client/components/common/XDescriptions/XDescriptions.vue'
|
|
38
|
-
import { mapState } from 'vuex'
|
|
39
|
-
import { runLogic } from '@vue2-client/services/api/common'
|
|
40
|
-
import userInfoDetailQueryTabs from '@vue2-client/pages/userInfoDetailManage/userInfoDetailQueryTabs'
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
name: 'UserInfoDetailManage',
|
|
44
|
-
components: {
|
|
45
|
-
XDescriptions,
|
|
46
|
-
userInfoDetailQueryTabs
|
|
47
|
-
},
|
|
48
|
-
data () {
|
|
49
|
-
return {
|
|
50
|
-
userInfo: undefined,
|
|
51
|
-
userInfoDetailVisible: false
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
methods: {
|
|
55
|
-
refresh () {
|
|
56
|
-
return runLogic('getUserInfoDetailV4', this.userInfo, 'af-revenue').then(res => {
|
|
57
|
-
this.userInfo = res
|
|
58
|
-
})
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
this.userInfo = user
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
},
|
|
65
|
-
onClose () {
|
|
66
|
-
this.userInfoDetailVisible = false
|
|
67
|
-
this.$emit('close')
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
created () {
|
|
71
|
-
},
|
|
72
|
-
mounted () {},
|
|
73
|
-
computed: {
|
|
74
|
-
...mapState('account', { currUser: 'user' }),
|
|
75
|
-
...mapState('setting', { isMobile: 'isMobile' })
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
</script>
|
|
79
|
-
|
|
80
|
-
<style scoped>
|
|
81
|
-
|
|
82
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer
|
|
3
|
+
id="agencyManageDetail"
|
|
4
|
+
title="用户详情信息"
|
|
5
|
+
placement="right"
|
|
6
|
+
:body-style="{padding:0}"
|
|
7
|
+
:destroy-on-close="true"
|
|
8
|
+
:z-index="200"
|
|
9
|
+
width="85vw"
|
|
10
|
+
:closable="false"
|
|
11
|
+
:visible="userInfoDetailVisible"
|
|
12
|
+
@close="onClose">
|
|
13
|
+
<a-page-header v-if="userInfoDetailVisible && userInfo" :title="`用户编号:${ userInfo ? userInfo.f_userinfo_code : '' }`">
|
|
14
|
+
<x-descriptions
|
|
15
|
+
:title="null"
|
|
16
|
+
:content="userInfo"
|
|
17
|
+
serviceName="af-revenue"
|
|
18
|
+
:getRealData="true"
|
|
19
|
+
:column="4"
|
|
20
|
+
config-name="User_Info_Desc_Config">
|
|
21
|
+
<template #addonAfter>
|
|
22
|
+
<div style="text-align: right">
|
|
23
|
+
<a-statistic title="用户状态" :value="userInfo.f_user_state || 0"/>
|
|
24
|
+
<a-statistic title="表具状态" :precision="0" :value="userInfo.f_table_state || 0"/>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
</x-descriptions>
|
|
28
|
+
<user-info-detail-query-tabs :userInfo="userInfo"/>
|
|
29
|
+
<template #extra>
|
|
30
|
+
<a-button type="dashed" @click="refresh">刷新</a-button>
|
|
31
|
+
</template>
|
|
32
|
+
</a-page-header>
|
|
33
|
+
</a-drawer>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import XDescriptions from '@vue2-client/base-client/components/common/XDescriptions/XDescriptions.vue'
|
|
38
|
+
import { mapState } from 'vuex'
|
|
39
|
+
import { runLogic } from '@vue2-client/services/api/common'
|
|
40
|
+
import userInfoDetailQueryTabs from '@vue2-client/pages/userInfoDetailManage/userInfoDetailQueryTabs'
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'UserInfoDetailManage',
|
|
44
|
+
components: {
|
|
45
|
+
XDescriptions,
|
|
46
|
+
userInfoDetailQueryTabs
|
|
47
|
+
},
|
|
48
|
+
data () {
|
|
49
|
+
return {
|
|
50
|
+
userInfo: undefined,
|
|
51
|
+
userInfoDetailVisible: false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
refresh () {
|
|
56
|
+
return runLogic('getUserInfoDetailV4', this.userInfo, 'af-revenue').then(res => {
|
|
57
|
+
this.userInfo = res
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
async init (user) {
|
|
61
|
+
this.userInfo = user
|
|
62
|
+
await this.refresh()
|
|
63
|
+
this.userInfoDetailVisible = true
|
|
64
|
+
},
|
|
65
|
+
onClose () {
|
|
66
|
+
this.userInfoDetailVisible = false
|
|
67
|
+
this.$emit('close')
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
created () {
|
|
71
|
+
},
|
|
72
|
+
mounted () {},
|
|
73
|
+
computed: {
|
|
74
|
+
...mapState('account', { currUser: 'user' }),
|
|
75
|
+
...mapState('setting', { isMobile: 'isMobile' })
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<style scoped>
|
|
81
|
+
|
|
82
|
+
</style>
|
|
@@ -53,9 +53,9 @@ const hiPrintPlugin = {
|
|
|
53
53
|
* 通用打印方法
|
|
54
54
|
* @param {string} templateName 模板名称
|
|
55
55
|
* @param {object} printData 打印数据
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {string} type 打印类型
|
|
57
57
|
*/
|
|
58
|
-
const _commonPrint = async function (templateName, printData,
|
|
58
|
+
const _commonPrint = async function (templateName, printData, type = 'B') {
|
|
59
59
|
return new Promise((resolve, reject) => {
|
|
60
60
|
try {
|
|
61
61
|
getConfigByNameAsync(templateName).then((template) => {
|
|
@@ -71,18 +71,19 @@ const hiPrintPlugin = {
|
|
|
71
71
|
const hiprintTemplate = new hiprint.PrintTemplate({
|
|
72
72
|
template: template,
|
|
73
73
|
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
if (type === 'H') {
|
|
75
|
+
resolve(hiprintTemplate.getHtml(printData))
|
|
76
|
+
} else {
|
|
77
|
+
const printMethod = type === 'C' ? 'print2' : 'print'
|
|
78
|
+
hiprintTemplate[printMethod](printData, {}, {
|
|
79
|
+
callback: () => {
|
|
80
|
+
resolve(hiprintTemplate)
|
|
81
|
+
},
|
|
82
|
+
styleHandler: () => {
|
|
83
|
+
return hiPrintCss()
|
|
84
|
+
}
|
|
85
|
+
})
|
|
77
86
|
}
|
|
78
|
-
hiprintTemplate[printMethod](printData, {}, {
|
|
79
|
-
callback: () => {
|
|
80
|
-
resolve(hiprintTemplate)
|
|
81
|
-
},
|
|
82
|
-
styleHandler: () => {
|
|
83
|
-
return hiPrintCss()
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
87
|
}).catch((error) => {
|
|
87
88
|
reject(error)
|
|
88
89
|
})
|
|
@@ -96,7 +97,7 @@ const hiPrintPlugin = {
|
|
|
96
97
|
* 浏览器打印
|
|
97
98
|
*/
|
|
98
99
|
globalVue.$printB = async function (templateName, printData) {
|
|
99
|
-
return _commonPrint(templateName, printData,
|
|
100
|
+
return _commonPrint(templateName, printData, 'B')
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
/**
|
|
@@ -104,12 +105,19 @@ const hiPrintPlugin = {
|
|
|
104
105
|
*/
|
|
105
106
|
globalVue.$printC = async function (templateName, printData) {
|
|
106
107
|
if (window.hiwebSocket.opened) {
|
|
107
|
-
return _commonPrint(templateName, printData,
|
|
108
|
+
return _commonPrint(templateName, printData, 'C')
|
|
108
109
|
} else {
|
|
109
110
|
this.$message.error('请确保打印服务已经启动')
|
|
110
111
|
return Promise.reject(new Error('客户端打印失败,未连接打印服务'))
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 输出html
|
|
117
|
+
*/
|
|
118
|
+
globalVue.$printH = async function (templateName, printData) {
|
|
119
|
+
return _commonPrint(templateName, printData, 'H')
|
|
120
|
+
}
|
|
113
121
|
}
|
|
114
122
|
}
|
|
115
123
|
|
package/src/utils/request.js
CHANGED
|
@@ -150,14 +150,9 @@ function loadInterceptors () {
|
|
|
150
150
|
// 让每个请求携带自定义 token 请根据实际情况自行修改
|
|
151
151
|
if (token) {
|
|
152
152
|
if (config.url !== V4_LOGIN) {
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
// V4 环境则添加 V4请求头
|
|
157
|
-
config.headers[V4_ACCESS_TOKEN] = token
|
|
158
|
-
} else {
|
|
159
|
-
config.headers[ACCESS_TOKEN] = token
|
|
160
|
-
}
|
|
153
|
+
// V4 环境则添加 V4请求头
|
|
154
|
+
config.headers[V4_ACCESS_TOKEN] = token
|
|
155
|
+
config.headers[ACCESS_TOKEN] = token
|
|
161
156
|
}
|
|
162
157
|
}
|
|
163
158
|
|
package/src/utils/routerUtil.js
CHANGED
|
@@ -515,6 +515,23 @@ function parsefuncOA (func) {
|
|
|
515
515
|
icon: row.icon,
|
|
516
516
|
name: row.name
|
|
517
517
|
}
|
|
518
|
+
if (row.link) {
|
|
519
|
+
if (route.router.includes('?')) {
|
|
520
|
+
// 把问号后面的都删了
|
|
521
|
+
const [url, queryString] = route.router.split('?')
|
|
522
|
+
route.router = url
|
|
523
|
+
try {
|
|
524
|
+
const params = new URLSearchParams(queryString)
|
|
525
|
+
for (const [key, value] of params.entries()) {
|
|
526
|
+
route.meta[key] = value
|
|
527
|
+
}
|
|
528
|
+
if (route.meta.path) {
|
|
529
|
+
route.path = route.meta.path
|
|
530
|
+
delete route.meta.path
|
|
531
|
+
}
|
|
532
|
+
} catch (e) {}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
518
535
|
if (row.children && row.children.length > 0) {
|
|
519
536
|
route.children = parsefunc(row.children)
|
|
520
537
|
}
|