af-mobile-client-vue3 1.4.54 → 1.4.56

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.
Files changed (47) hide show
  1. package/build/vite/optimize.ts +36 -36
  2. package/package.json +1 -1
  3. package/public/favicon.svg +4 -4
  4. package/scripts/verifyCommit.js +19 -19
  5. package/src/components/common/MateChat/apiService.ts +134 -103
  6. package/src/components/common/MateChat/components/MateChatContent.vue +281 -0
  7. package/src/components/common/MateChat/components/MateChatHeader.vue +298 -253
  8. package/src/components/common/MateChat/components/PasswordDialog.vue +97 -0
  9. package/src/components/common/MateChat/composables/useChatHistoryCache.ts +117 -0
  10. package/src/components/common/MateChat/composables/useChatMessagesCache.ts +72 -0
  11. package/src/components/common/MateChat/composables/useMateChat.ts +372 -0
  12. package/src/components/common/MateChat/composables/usePasswordManager.ts +38 -0
  13. package/src/components/common/MateChat/index.vue +443 -0
  14. package/src/components/common/MateChat/types.ts +241 -0
  15. package/src/components/data/UserDetail/types.ts +1 -1
  16. package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
  17. package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
  18. package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
  19. package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
  20. package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
  21. package/src/components/data/XReportGrid/print.js +184 -184
  22. package/src/components/data/XTag/index.vue +10 -10
  23. package/src/components/layout/TabBarLayout/index.vue +40 -40
  24. package/src/hooks/useCommon.ts +9 -9
  25. package/src/plugins/AppData.ts +38 -38
  26. package/src/router/invoiceRoutes.ts +33 -33
  27. package/src/services/api/common.ts +109 -109
  28. package/src/services/api/manage.ts +8 -8
  29. package/src/services/api/search.ts +16 -16
  30. package/src/services/restTools.ts +56 -56
  31. package/src/utils/authority-utils.ts +84 -84
  32. package/src/utils/crypto.ts +39 -39
  33. package/src/utils/runEvalFunction.ts +13 -13
  34. package/src/utils/timeUtil.ts +27 -27
  35. package/src/views/component/EvaluateRecordView/index.vue +40 -40
  36. package/src/views/component/MateChat/MateChatView.vue +10 -51
  37. package/src/views/component/XCellDetailView/index.vue +217 -217
  38. package/src/views/component/XReportFormIframeView/index.vue +47 -47
  39. package/src/views/component/XReportFormView/index.vue +13 -13
  40. package/src/views/component/XSignatureView/index.vue +50 -50
  41. package/src/views/component/notice.vue +46 -46
  42. package/src/views/component/topNav.vue +36 -36
  43. package/src/views/invoiceShow/index.vue +61 -61
  44. package/src/views/user/login/index.vue +22 -22
  45. package/vite.config.ts +2 -1
  46. package/src/components/common/MateChat/MateChat.vue +0 -248
  47. package/src/components/common/MateChat/useMateChat.ts +0 -212
@@ -1,39 +1,39 @@
1
- import AesEncryptJS from 'crypto-js'
2
-
3
- export default {
4
- /**
5
- * AES加密
6
- *
7
- * @param word
8
- * @param encryKey
9
- */
10
- AESEncrypt(word: string, encryKey: string): string {
11
- const key = AesEncryptJS.enc.Utf8.parse(encryKey)
12
- const srcs = AesEncryptJS.enc.Utf8.parse(word)
13
- const encrypted = AesEncryptJS.AES.encrypt(srcs, key, {
14
- mode: AesEncryptJS.mode.ECB,
15
- padding: AesEncryptJS.pad.Pkcs7,
16
- })
17
- return encrypted.toString()
18
- },
19
- /**
20
- * AES解密
21
- *
22
- * @param word
23
- * @param encryKey
24
- */
25
- AESDecrypt(word: string, encryKey: string): any {
26
- const key = AesEncryptJS.enc.Utf8.parse(encryKey)
27
- const decrypt = AesEncryptJS.AES.decrypt(word, key, {
28
- mode: AesEncryptJS.mode.ECB,
29
- padding: AesEncryptJS.pad.Pkcs7,
30
- })
31
- const ret = AesEncryptJS.enc.Utf8.stringify(decrypt).toString()
32
- try {
33
- return JSON.parse(ret)
34
- }
35
- catch {
36
- return ret
37
- }
38
- },
39
- }
1
+ import AesEncryptJS from 'crypto-js'
2
+
3
+ export default {
4
+ /**
5
+ * AES加密
6
+ *
7
+ * @param word
8
+ * @param encryKey
9
+ */
10
+ AESEncrypt(word: string, encryKey: string): string {
11
+ const key = AesEncryptJS.enc.Utf8.parse(encryKey)
12
+ const srcs = AesEncryptJS.enc.Utf8.parse(word)
13
+ const encrypted = AesEncryptJS.AES.encrypt(srcs, key, {
14
+ mode: AesEncryptJS.mode.ECB,
15
+ padding: AesEncryptJS.pad.Pkcs7,
16
+ })
17
+ return encrypted.toString()
18
+ },
19
+ /**
20
+ * AES解密
21
+ *
22
+ * @param word
23
+ * @param encryKey
24
+ */
25
+ AESDecrypt(word: string, encryKey: string): any {
26
+ const key = AesEncryptJS.enc.Utf8.parse(encryKey)
27
+ const decrypt = AesEncryptJS.AES.decrypt(word, key, {
28
+ mode: AesEncryptJS.mode.ECB,
29
+ padding: AesEncryptJS.pad.Pkcs7,
30
+ })
31
+ const ret = AesEncryptJS.enc.Utf8.stringify(decrypt).toString()
32
+ try {
33
+ return JSON.parse(ret)
34
+ }
35
+ catch {
36
+ return ret
37
+ }
38
+ },
39
+ }
@@ -1,13 +1,13 @@
1
- export function executeStrFunction(funcString, args) {
2
- // 使用 eval 执行传入的函数字符串
3
- // eslint-disable-next-line no-eval
4
- return eval(`(${funcString})`)(...args)
5
- }
6
-
7
- export function executeStrFunctionByContext(context, fnStr, args) {
8
- // 使用 new Function 创建函数,并绑定 context 作为 this
9
- // eslint-disable-next-line no-new-func
10
- const fn = new Function(`return (${fnStr});`)()
11
- // 使用 bind 绑定 context,并立即调用
12
- return fn.bind(context)(...args)
13
- }
1
+ export function executeStrFunction(funcString, args) {
2
+ // 使用 eval 执行传入的函数字符串
3
+ // eslint-disable-next-line no-eval
4
+ return eval(`(${funcString})`)(...args)
5
+ }
6
+
7
+ export function executeStrFunctionByContext(context, fnStr, args) {
8
+ // 使用 new Function 创建函数,并绑定 context 作为 this
9
+ // eslint-disable-next-line no-new-func
10
+ const fn = new Function(`return (${fnStr});`)()
11
+ // 使用 bind 绑定 context,并立即调用
12
+ return fn.bind(context)(...args)
13
+ }
@@ -1,27 +1,27 @@
1
- // 时间工具:提供简单的日期时间格式化
2
-
3
- export function pad2(num: number): string {
4
- return num < 10 ? `0${num}` : `${num}`
5
- }
6
-
7
- /**
8
- * 按照简单占位符格式化当前时间
9
- * 支持占位:YYYY MM DD HH mm ss
10
- * @param format 默认 'YYYY-MM-DD HH:mm:ss'
11
- */
12
- export function formatNow(format: string = 'YYYY-MM-DD HH:mm:ss'): string {
13
- const d = new Date()
14
- const map: Record<string, string> = {
15
- YYYY: `${d.getFullYear()}`,
16
- MM: pad2(d.getMonth() + 1),
17
- DD: pad2(d.getDate()),
18
- HH: pad2(d.getHours()),
19
- mm: pad2(d.getMinutes()),
20
- ss: pad2(d.getSeconds()),
21
- }
22
- let out = format
23
- Object.keys(map).forEach((k) => {
24
- out = out.replace(new RegExp(k, 'g'), map[k])
25
- })
26
- return out
27
- }
1
+ // 时间工具:提供简单的日期时间格式化
2
+
3
+ export function pad2(num: number): string {
4
+ return num < 10 ? `0${num}` : `${num}`
5
+ }
6
+
7
+ /**
8
+ * 按照简单占位符格式化当前时间
9
+ * 支持占位:YYYY MM DD HH mm ss
10
+ * @param format 默认 'YYYY-MM-DD HH:mm:ss'
11
+ */
12
+ export function formatNow(format: string = 'YYYY-MM-DD HH:mm:ss'): string {
13
+ const d = new Date()
14
+ const map: Record<string, string> = {
15
+ YYYY: `${d.getFullYear()}`,
16
+ MM: pad2(d.getMonth() + 1),
17
+ DD: pad2(d.getDate()),
18
+ HH: pad2(d.getHours()),
19
+ mm: pad2(d.getMinutes()),
20
+ ss: pad2(d.getSeconds()),
21
+ }
22
+ let out = format
23
+ Object.keys(map).forEach((k) => {
24
+ out = out.replace(new RegExp(k, 'g'), map[k])
25
+ })
26
+ return out
27
+ }
@@ -1,40 +1,40 @@
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
-
5
- import {
6
- Icon as VanIcon,
7
- } from 'vant'
8
- import { ref } from 'vue'
9
-
10
- const configName = ref('get_evaluate_by_id')
11
- </script>
12
-
13
- <template>
14
- <NormalDataLayout title="评价纪录">
15
- <template #layout_header_row_right_col>
16
- <VanIcon class="header_row_icon" name="filter-o" />
17
- </template>
18
- <template #layout_content>
19
- <XCellList :config-name="configName" id-key="t_id" service-name="af-revenue" />
20
- </template>
21
- </NormalDataLayout>
22
- </template>
23
-
24
- <style scoped lang="less">
25
- .header_row_icon {
26
- font-size: 18px;
27
- }
28
- //.van-tabs {
29
- // display: flex;
30
- // flex-flow: column;
31
- // height: 100%;
32
- //}
33
- //:deep(.van-tabs__content) {
34
- // flex: 1;
35
- //}
36
- //:deep(.van-tab__panel) {
37
- // height: 100%;
38
- // max-height: 100vh;
39
- //}
40
- </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
+
5
+ import {
6
+ Icon as VanIcon,
7
+ } from 'vant'
8
+ import { ref } from 'vue'
9
+
10
+ const configName = ref('get_evaluate_by_id')
11
+ </script>
12
+
13
+ <template>
14
+ <NormalDataLayout title="评价纪录">
15
+ <template #layout_header_row_right_col>
16
+ <VanIcon class="header_row_icon" name="filter-o" />
17
+ </template>
18
+ <template #layout_content>
19
+ <XCellList :config-name="configName" id-key="t_id" service-name="af-revenue" />
20
+ </template>
21
+ </NormalDataLayout>
22
+ </template>
23
+
24
+ <style scoped lang="less">
25
+ .header_row_icon {
26
+ font-size: 18px;
27
+ }
28
+ //.van-tabs {
29
+ // display: flex;
30
+ // flex-flow: column;
31
+ // height: 100%;
32
+ //}
33
+ //:deep(.van-tabs__content) {
34
+ // flex: 1;
35
+ //}
36
+ //:deep(.van-tab__panel) {
37
+ // height: 100%;
38
+ // max-height: 100vh;
39
+ //}
40
+ </style>
@@ -1,51 +1,10 @@
1
- <script setup lang="ts">
2
- import MateChat from '@af-mobile-client-vue3/components/common/MateChat/MateChat.vue'
3
-
4
- const description = [
5
- '我是【奥枫天然气公司】官方公众号专属 AI 客服小璃,可以为您提供专业、高效、易懂的天然气相关咨询服务。',
6
- ]
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
-
29
- const simplePrompt = [
30
- {
31
- value: 'howToPay',
32
- iconConfig: { name: 'icon-info-o', color: '#5e7ce0' },
33
- label: '如何缴费',
34
- },
35
- {
36
- value: 'howToRepair',
37
- iconConfig: { name: 'icon-star', color: 'rgb(255, 215, 0)' },
38
- label: '如何报修',
39
- },
40
- ]
41
- </script>
42
-
43
- <template>
44
- <MateChat
45
- service-name="小璃"
46
- :use-stream="true"
47
- :description="description"
48
- :intro-prompt="introPrompt"
49
- :simple-prompt="simplePrompt"
50
- />
51
- </template>
1
+ <script setup lang="ts">
2
+ import MateChat from '@af-mobile-client-vue3/components/common/MateChat/index.vue'
3
+
4
+ // 配置名称,从云端配置中心获取配置
5
+ const configName = '用户端AiChat配置'
6
+ </script>
7
+
8
+ <template>
9
+ <MateChat :config-name="configName" service-name="af-wechat" />
10
+ </template>