af-mobile-client-vue3 1.4.52 → 1.4.54
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 +2 -1
- package/src/App.vue +14 -2
- package/src/components/common/MateChat/MateChat.vue +248 -0
- package/src/components/common/MateChat/apiService.ts +254 -0
- package/src/components/common/MateChat/assets/035-avatar-13.svg +1 -0
- package/src/components/common/MateChat/components/MateChatHeader.vue +253 -0
- package/src/components/common/MateChat/components/PromptList/PromptList.vue +189 -0
- package/src/components/common/MateChat/components/PromptList/index.ts +1 -0
- package/src/components/common/MateChat/useMateChat.ts +212 -0
- package/src/components/common/otherCharge/ChargePrintSelectorAndRemarks.vue +137 -137
- package/src/components/common/otherCharge/CodePayment.vue +357 -357
- package/src/components/common/otherCharge/FileUploader.vue +602 -602
- package/src/components/common/otherCharge/GridFileUploader.vue +846 -846
- package/src/components/common/otherCharge/PaymentMethodSelector.vue +202 -202
- package/src/components/common/otherCharge/PaymentMethodSelectorCard.vue +45 -45
- package/src/components/common/otherCharge/ReceiptModal.vue +273 -273
- package/src/components/common/otherCharge/index.ts +43 -43
- package/src/components/data/OtherCharge/OtherChargeItemModal.vue +547 -547
- package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
- package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
- package/src/components/data/XFormItem/index.vue +2 -1
- package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
- package/src/components/data/XReportGrid/print.js +184 -184
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/utils/timeUtil.ts +27 -27
- package/src/utils/util.ts +5 -0
- package/src/views/component/MateChat/MateChatView.vue +30 -233
- package/src/views/component/XCellListView/index.vue +107 -138
- package/src/views/component/XFormGroupView/index.vue +78 -82
- package/src/views/component/XFormView/index.vue +41 -46
- package/src/views/component/MateChat/apiService.ts +0 -104
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
// MateChat ai 对话相关
|
|
4
|
-
import { showToast, Button as VanButton } from 'vant'
|
|
5
|
-
import { ref } from 'vue'
|
|
6
|
-
import { chatCompletions } from './apiService'
|
|
7
|
-
import 'vant/es/image-preview/style'
|
|
2
|
+
import MateChat from '@af-mobile-client-vue3/components/common/MateChat/MateChat.vue'
|
|
8
3
|
|
|
9
4
|
const description = [
|
|
10
5
|
'我是【奥枫天然气公司】官方公众号专属 AI 客服小璃,可以为您提供专业、高效、易懂的天然气相关咨询服务。',
|
|
11
6
|
]
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
7
|
+
|
|
8
|
+
const introPrompt = [
|
|
9
|
+
{
|
|
10
|
+
value: 'howToPay',
|
|
11
|
+
label: '如何缴纳燃气费?',
|
|
12
|
+
iconConfig: { name: 'icon-info-o', color: '#5e7ce0' },
|
|
13
|
+
desc: '了解线上缴费方式和操作步骤',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
value: 'howToRepair',
|
|
17
|
+
label: '燃气故障如何报修?',
|
|
18
|
+
iconConfig: { name: 'icon-star', color: 'rgb(255, 215, 0)' },
|
|
19
|
+
desc: '遇到燃气问题时的处理流程',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 'safetyTips',
|
|
23
|
+
label: '安全使用注意事项',
|
|
24
|
+
iconConfig: { name: 'icon-priority', color: '#3ac295' },
|
|
25
|
+
desc: '了解燃气安全使用常识',
|
|
26
|
+
},
|
|
27
|
+
]
|
|
28
|
+
|
|
35
29
|
const simplePrompt = [
|
|
36
30
|
{
|
|
37
31
|
value: 'howToPay',
|
|
@@ -44,211 +38,14 @@ const simplePrompt = [
|
|
|
44
38
|
label: '如何报修',
|
|
45
39
|
},
|
|
46
40
|
]
|
|
47
|
-
const startPage = ref(true)
|
|
48
|
-
const inputValue = ref('')
|
|
49
|
-
|
|
50
|
-
const messages = ref<any[]>([])
|
|
51
|
-
|
|
52
|
-
function newConversation() {
|
|
53
|
-
startPage.value = true
|
|
54
|
-
messages.value = []
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function onSubmit(evt: string) {
|
|
58
|
-
if (!evt.trim()) {
|
|
59
|
-
return
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
inputValue.value = ''
|
|
63
|
-
startPage.value = false
|
|
64
|
-
|
|
65
|
-
// 用户发送消息
|
|
66
|
-
messages.value.push({
|
|
67
|
-
from: 'user',
|
|
68
|
-
content: evt,
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
// 添加 loading 状态的 model 消息
|
|
72
|
-
const loadingMessageIndex = messages.value.length
|
|
73
|
-
messages.value.push({
|
|
74
|
-
from: 'model',
|
|
75
|
-
content: '',
|
|
76
|
-
loading: true,
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
try {
|
|
80
|
-
// 调用 API
|
|
81
|
-
const response = await chatCompletions(evt)
|
|
82
|
-
|
|
83
|
-
// 更新 model 消息内容
|
|
84
|
-
if (response.choices && response.choices.length > 0) {
|
|
85
|
-
const content = response.choices[0].message.content
|
|
86
|
-
|
|
87
|
-
// 检测是否为转人工标识
|
|
88
|
-
try {
|
|
89
|
-
const parsedContent = JSON.parse(content)
|
|
90
|
-
if (parsedContent.msgType === 'transfer') {
|
|
91
|
-
// 移除 loading 消息
|
|
92
|
-
messages.value.splice(loadingMessageIndex, 1)
|
|
93
|
-
// 添加人工客服消息
|
|
94
|
-
messages.value.push({
|
|
95
|
-
from: 'service',
|
|
96
|
-
content: '您好,客服xxx工号xxx为你服务',
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
// 正常消息
|
|
101
|
-
messages.value[loadingMessageIndex] = {
|
|
102
|
-
from: 'model',
|
|
103
|
-
content,
|
|
104
|
-
loading: false,
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch {
|
|
109
|
-
// 如果不是 JSON,按正常消息处理
|
|
110
|
-
messages.value[loadingMessageIndex] = {
|
|
111
|
-
from: 'model',
|
|
112
|
-
content,
|
|
113
|
-
loading: false,
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
throw new Error('响应数据格式错误')
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
catch (error: any) {
|
|
122
|
-
// 处理错误
|
|
123
|
-
console.error('聊天请求失败:', error)
|
|
124
|
-
messages.value[loadingMessageIndex] = {
|
|
125
|
-
from: 'model',
|
|
126
|
-
content: '抱歉,服务暂时不可用,请稍后再试。',
|
|
127
|
-
loading: false,
|
|
128
|
-
}
|
|
129
|
-
showToast(error?.message || '请求失败,请稍后再试')
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
41
|
</script>
|
|
133
42
|
|
|
134
43
|
<template>
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
title="小璃"
|
|
143
|
-
sub-title="Hi,我是小璃"
|
|
144
|
-
:description="description"
|
|
145
|
-
/>
|
|
146
|
-
<McPrompt
|
|
147
|
-
:list="introPrompt.list"
|
|
148
|
-
:direction="introPrompt.direction"
|
|
149
|
-
@item-click="onSubmit($event.label)"
|
|
150
|
-
/>
|
|
151
|
-
</McLayoutContent>
|
|
152
|
-
<McLayoutContent v-else class="content-container">
|
|
153
|
-
<template v-for="(msg, idx) in messages" :key="idx">
|
|
154
|
-
<McBubble
|
|
155
|
-
v-if="msg.from === 'user'"
|
|
156
|
-
:content="msg.content"
|
|
157
|
-
align="right"
|
|
158
|
-
:avatar-config="{ imgSrc: 'https://matechat.gitcode.com/png/demo/userAvatar.svg' }"
|
|
159
|
-
/>
|
|
160
|
-
<McBubble
|
|
161
|
-
v-else-if="msg.from === 'service'"
|
|
162
|
-
:content="msg.content"
|
|
163
|
-
:avatar-config="{ imgSrc: 'https://matechat.gitcode.com/png/demo/userAvatar.svg' }"
|
|
164
|
-
/>
|
|
165
|
-
<McBubble v-else :content="msg.content" :avatar-config="{ imgSrc: liuliLogo }" :loading="msg.loading">
|
|
166
|
-
<McMarkdownCard
|
|
167
|
-
:content="msg.content" :typing="true"
|
|
168
|
-
/>
|
|
169
|
-
</McBubble>
|
|
170
|
-
</template>
|
|
171
|
-
</McLayoutContent>
|
|
172
|
-
<div class="shortcut" style="display: flex; align-items: center; gap: 8px">
|
|
173
|
-
<McPrompt
|
|
174
|
-
v-if="!startPage"
|
|
175
|
-
:list="simplePrompt"
|
|
176
|
-
direction="horizontal"
|
|
177
|
-
class="shortcut-prompt"
|
|
178
|
-
style="flex: 1"
|
|
179
|
-
@item-click="onSubmit($event.label)"
|
|
180
|
-
/>
|
|
181
|
-
<VanButton
|
|
182
|
-
style="margin-left: auto"
|
|
183
|
-
icon="add"
|
|
184
|
-
title="新建对话"
|
|
185
|
-
size="small"
|
|
186
|
-
round
|
|
187
|
-
@click="newConversation"
|
|
188
|
-
/>
|
|
189
|
-
</div>
|
|
190
|
-
<McLayoutSender>
|
|
191
|
-
<McInput :value="inputValue" :autofocus="true" :max-length="2000" @change="(e) => (inputValue = e)" @submit="onSubmit" />
|
|
192
|
-
</McLayoutSender>
|
|
193
|
-
</McLayout>
|
|
44
|
+
<MateChat
|
|
45
|
+
service-name="小璃"
|
|
46
|
+
:use-stream="true"
|
|
47
|
+
:description="description"
|
|
48
|
+
:intro-prompt="introPrompt"
|
|
49
|
+
:simple-prompt="simplePrompt"
|
|
50
|
+
/>
|
|
194
51
|
</template>
|
|
195
|
-
|
|
196
|
-
<style>
|
|
197
|
-
.container {
|
|
198
|
-
width: 100%;
|
|
199
|
-
height: 100vh;
|
|
200
|
-
padding: 20px;
|
|
201
|
-
gap: 8px;
|
|
202
|
-
background: #fff;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.content-container {
|
|
206
|
-
display: flex;
|
|
207
|
-
flex-direction: column;
|
|
208
|
-
gap: 8px;
|
|
209
|
-
overflow: auto;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.input-foot-wrapper {
|
|
213
|
-
display: flex;
|
|
214
|
-
justify-content: space-between;
|
|
215
|
-
align-items: center;
|
|
216
|
-
width: 100%;
|
|
217
|
-
height: 100%;
|
|
218
|
-
margin-right: 8px;
|
|
219
|
-
|
|
220
|
-
.input-foot-left {
|
|
221
|
-
display: flex;
|
|
222
|
-
align-items: center;
|
|
223
|
-
gap: 8px;
|
|
224
|
-
|
|
225
|
-
span {
|
|
226
|
-
font-size: 14px;
|
|
227
|
-
line-height: 18px;
|
|
228
|
-
color: #252b3a;
|
|
229
|
-
cursor: pointer;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.input-foot-dividing-line {
|
|
233
|
-
width: 1px;
|
|
234
|
-
height: 14px;
|
|
235
|
-
background-color: #d7d8da;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.input-foot-maxlength {
|
|
239
|
-
font-size: 14px;
|
|
240
|
-
color: #71757f;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.input-foot-right {
|
|
245
|
-
.demo-button-content {
|
|
246
|
-
font-size: 14px;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
& > *:not(:first-child) {
|
|
250
|
-
margin-left: 8px;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
</style>
|
|
@@ -1,138 +1,107 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
const configName = ref('lngChargeAuditMobileCRUD')
|
|
24
|
-
const serviceName = ref('af-gaslink')
|
|
25
|
-
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
// },
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
// }
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// 数据加载完成后处理 @after-load
|
|
111
|
-
function afterLoad(result) {
|
|
112
|
-
console.log('afterLoad:', result)
|
|
113
|
-
}
|
|
114
|
-
function emitFunc(func, data) {
|
|
115
|
-
console.log('emitFunc:', func, data)
|
|
116
|
-
}
|
|
117
|
-
</script>
|
|
118
|
-
|
|
119
|
-
<template>
|
|
120
|
-
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
121
|
-
<template #layout_content>
|
|
122
|
-
<XCellList
|
|
123
|
-
config-name="scanCodeAndNFCRUD"
|
|
124
|
-
service-name="af-safecheck"
|
|
125
|
-
:enable-multi-select="true"
|
|
126
|
-
id-key="t_id"
|
|
127
|
-
:multi-select-actions="multiSelectActions"
|
|
128
|
-
@to-detail="toDetail"
|
|
129
|
-
@multi-select-action="handleMultiSelectAction"
|
|
130
|
-
@selection-change="handleSelectionChange"
|
|
131
|
-
@x-form-item-emit-func="emitFunc"
|
|
132
|
-
/>
|
|
133
|
-
</template>
|
|
134
|
-
</NormalDataLayout>
|
|
135
|
-
</template>
|
|
136
|
-
|
|
137
|
-
<style scoped lang="less">
|
|
138
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { defineEmits, ref } from 'vue'
|
|
5
|
+
import { useRouter } from 'vue-router'
|
|
6
|
+
|
|
7
|
+
// 定义事件
|
|
8
|
+
const emit = defineEmits(['deleteRow'])
|
|
9
|
+
// 访问路由
|
|
10
|
+
const router = useRouter()
|
|
11
|
+
// 获取默认值
|
|
12
|
+
// const idKey = ref('o_id')
|
|
13
|
+
|
|
14
|
+
// 简易crud表单测试
|
|
15
|
+
const configName = ref('ceshiCRUD')
|
|
16
|
+
const serviceName = ref('af-safecheck')
|
|
17
|
+
|
|
18
|
+
// 资源权限测试
|
|
19
|
+
// const configName = ref('crud_sources_test')
|
|
20
|
+
// const serviceName = ref('af-system')
|
|
21
|
+
|
|
22
|
+
// 实际业务测试
|
|
23
|
+
// const configName = ref('lngChargeAuditMobileCRUD')
|
|
24
|
+
// const serviceName = ref('af-gaslink')
|
|
25
|
+
|
|
26
|
+
// 跳转到详情页面
|
|
27
|
+
// function toDetail(item) {
|
|
28
|
+
// router.push({
|
|
29
|
+
// name: 'XCellDetailView',
|
|
30
|
+
// params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
|
|
31
|
+
// query: {
|
|
32
|
+
// operName: item[operNameKey.value],
|
|
33
|
+
// method:item[methodKey.value],
|
|
34
|
+
// requestMethod:item[requestMethodKey.value],
|
|
35
|
+
// operatorType:item[operatorTypeKey.value],
|
|
36
|
+
// operUrl:item[operUrlKey.value],
|
|
37
|
+
// operIp:item[operIpKey.value],
|
|
38
|
+
// costTime:item[costTimeKey.value],
|
|
39
|
+
// operTime:item[operTimeKey.value],
|
|
40
|
+
//
|
|
41
|
+
// title: item[titleKey.value],
|
|
42
|
+
// businessType: item[businessTypeKey.value],
|
|
43
|
+
// status:item[statusKey.value]
|
|
44
|
+
// }
|
|
45
|
+
// })
|
|
46
|
+
// }
|
|
47
|
+
|
|
48
|
+
// 跳转到表单——以表单组来渲染纯表单
|
|
49
|
+
// function toDetail(item) {
|
|
50
|
+
// router.push({
|
|
51
|
+
// name: 'XFormGroupView',
|
|
52
|
+
// query: {
|
|
53
|
+
// id: item[idKey.value],
|
|
54
|
+
// // id: item.rr_id,
|
|
55
|
+
// // o_id: item.o_id,
|
|
56
|
+
// },
|
|
57
|
+
// })
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
// 新增功能
|
|
61
|
+
// function addOption(totalCount) {
|
|
62
|
+
// router.push({
|
|
63
|
+
// name: 'XFormView',
|
|
64
|
+
// params: { id: totalCount, openid: totalCount },
|
|
65
|
+
// query: {
|
|
66
|
+
// configName: configName.value,
|
|
67
|
+
// serviceName: serviceName.value,
|
|
68
|
+
// mode: '新增',
|
|
69
|
+
// },
|
|
70
|
+
// })
|
|
71
|
+
// }
|
|
72
|
+
|
|
73
|
+
// 修改功能
|
|
74
|
+
// function updateRow(result) {
|
|
75
|
+
// router.push({
|
|
76
|
+
// name: 'XFormView',
|
|
77
|
+
// params: { id: result.o_id, openid: result.o_id },
|
|
78
|
+
// query: {
|
|
79
|
+
// configName: configName.value,
|
|
80
|
+
// serviceName: serviceName.value,
|
|
81
|
+
// mode: '修改',
|
|
82
|
+
// },
|
|
83
|
+
// })
|
|
84
|
+
// }
|
|
85
|
+
|
|
86
|
+
// 删除功能
|
|
87
|
+
// function deleteRow(result) {
|
|
88
|
+
// emit('deleteRow', result.o_id)
|
|
89
|
+
// }
|
|
90
|
+
// const fixQueryForm = ref({
|
|
91
|
+
// f_operator_id: '487184754014158848',
|
|
92
|
+
// })
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<template>
|
|
96
|
+
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
97
|
+
<template #layout_content>
|
|
98
|
+
<XCellList
|
|
99
|
+
:config-name="configName"
|
|
100
|
+
:service-name="serviceName"
|
|
101
|
+
/>
|
|
102
|
+
</template>
|
|
103
|
+
</NormalDataLayout>
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<style scoped lang="less">
|
|
107
|
+
</style>
|