af-mobile-client-vue3 1.0.90 → 1.0.93

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/src/main.ts CHANGED
@@ -1,13 +1,15 @@
1
- import { createApp } from 'vue'
2
- import { createHead } from '@unhead/vue'
3
- import bootstrap from '@af-mobile-client-vue3/bootstrap'
4
1
  import App from '@af-mobile-client-vue3/App.vue'
2
+ import bootstrap from '@af-mobile-client-vue3/bootstrap'
3
+ import Plugins from '@af-mobile-client-vue3/plugins'
5
4
  import router from '@af-mobile-client-vue3/router'
6
5
  import pinia from '@af-mobile-client-vue3/stores'
6
+ import { createHead } from '@unhead/vue/client'
7
+ import { createApp } from 'vue'
7
8
  import 'virtual:uno.css'
8
9
  import '@af-mobile-client-vue3/styles/app.less'
9
10
  import 'vant/lib/index.css'
10
11
  import 'vant/lib/tabbar/index.css'
12
+
11
13
  import 'vant/lib/tabbar-item/index.css'
12
14
 
13
15
  // svg icon
@@ -15,7 +17,6 @@ import 'virtual:svg-icons-register'
15
17
 
16
18
  // Vant 桌面端适配
17
19
  import '@vant/touch-emulator'
18
-
19
20
  /* --------------------------------
20
21
  Vant 中有个别组件是以函数的形式提供的,
21
22
  包括 Toast,Dialog,Notify 和 ImagePreview 组件。
@@ -26,7 +27,6 @@ import 'vant/es/toast/style'
26
27
  import 'vant/es/dialog/style'
27
28
  import 'vant/es/notify/style'
28
29
  import 'vant/es/image-preview/style'
29
- import Plugins from '@af-mobile-client-vue3/plugins'
30
30
 
31
31
  const app = createApp(App)
32
32
  const head = createHead()
@@ -4,6 +4,7 @@ import XCellListView from '@af-mobile-client-vue3/views/component/XCellListView/
4
4
  import XCellDetailView from '@af-mobile-client-vue3/views/component/XCellDetailView/index.vue'
5
5
  import XReportFormView from '@af-mobile-client-vue3/views/component/XReportFormView/index.vue'
6
6
  import XFormView from '@af-mobile-client-vue3/views/component/XFormView/index.vue'
7
+ import XFormAppraiseView from '@af-mobile-client-vue3/views/component/XFormAppraiseView/index.vue'
7
8
  import EvaluateRecordView from '@af-mobile-client-vue3/views/component/EvaluateRecordView/index.vue'
8
9
  import XReportFormIframeView from '@af-mobile-client-vue3/views/component/XReportFormIframeView/index.vue'
9
10
  import PageLayout from '@af-mobile-client-vue3/layout/PageLayout.vue'
@@ -86,6 +87,11 @@ const routes: Array<RouteRecordRaw> = [
86
87
  // }),
87
88
  // meta:{ title: '新增/修改表单' }
88
89
  // },
90
+ {
91
+ path: '/Component/XFormAppraiseView/:id/:openid',
92
+ name: 'XFormAppraiseView',
93
+ component: XFormAppraiseView
94
+ },
89
95
  {
90
96
  path: '/Component/XFormView/:id/:openid',
91
97
  name: 'XFormView',
@@ -12,8 +12,8 @@ const router = useRouter()
12
12
  const idKey = ref('o_id')
13
13
 
14
14
  // 简易crud表单测试
15
- const configName = ref('orderCarInMobileCRUD')
16
- const serviceName = ref('af-gaslink')
15
+ const configName = ref('crud_oper_log_manage')
16
+ const serviceName = ref('af-system')
17
17
 
18
18
  // 资源权限测试
19
19
  // const configName = ref('crud_sources_test')
@@ -0,0 +1,174 @@
1
+ <script setup lang="ts">
2
+ import banner1 from '@af-mobile-client-vue3/assets/img/banner/appraise-banner-1.png'
3
+ import banner2 from '@af-mobile-client-vue3/assets/img/banner/appraise-banner-2.png'
4
+
5
+ import {
6
+ Cell as VanCell,
7
+ CellGroup as VanCellGroup,
8
+ Loading as VanLoading,
9
+ NavBar as VanNavBar,
10
+ Row as VanRow,
11
+ Space as VanSpace,
12
+ Swipe as VanSwipe,
13
+ SwipeItem as VanSwipeItem,
14
+ showDialog,
15
+ } from 'vant'
16
+ import { useRoute } from 'vue-router'
17
+ import { getCurrentInstance, onMounted, ref } from 'vue'
18
+ import { openApiLogic } from '@af-mobile-client-vue3/services/api/common'
19
+ import { formatDate } from '@af-mobile-client-vue3/hooks/useCommon'
20
+
21
+ const xForm = ref()
22
+ const xFormInit = ref(false)
23
+ const mode = ref('')
24
+ const loading = ref(true)
25
+ const groupFormItems = ref({})
26
+ const formData = ref({})
27
+ const id = ref(-1)
28
+ const openid = ref('')
29
+ const instance = getCurrentInstance()
30
+ const route = useRoute()
31
+ const serviceName = ref('af-revenue')
32
+ const images = ref([banner1, banner2])
33
+ const currentEvaluate = {
34
+ id: null,
35
+ f_business_name: '',
36
+ f_evaluate_state: '',
37
+ f_business_agent: '',
38
+ f_business_type: '',
39
+ }
40
+ onMounted(() => {
41
+ if (instance) {
42
+ id.value = route.params.id as unknown as number
43
+ openid.value = route.params.openid as string
44
+ formInit()
45
+ }
46
+ })
47
+
48
+ async function formInit() {
49
+ if (id.value > 0) {
50
+ queryData()
51
+ }
52
+ else {
53
+ // 没有id 直接提示用户不存在,返回上一级
54
+ await showDialog({ message: '评价信息缺少参数,找不到对应评价信息' })
55
+ closeWindows()
56
+ }
57
+ }
58
+ function queryData() {
59
+ openApiLogic({
60
+ id: id.value,
61
+ }, 'getEvalConfigById', serviceName.value).then(async (res: any) => {
62
+ if (res.row && res.config) {
63
+ Object.assign(currentEvaluate, res.row)
64
+ if (currentEvaluate.f_evaluate_state === '已评价') {
65
+ mode.value = '预览'
66
+ formData.value = res.row.f_json ? JSON.parse(res.row.f_json) : {}
67
+ }
68
+ groupFormItems.value = res.config
69
+ xFormInit.value = true
70
+ loading.value = false
71
+ }
72
+ else {
73
+ await showDialog({ message: res.msg })
74
+ closeWindows()
75
+ }
76
+ }).catch(() => {
77
+ showDialog({ message: '查询评价信息失败了' })
78
+ })
79
+ }
80
+ function onSubmit(params) {
81
+ const data = {
82
+ id: currentEvaluate.id,
83
+ f_json: params,
84
+ f_evaluate_date: formatDate(new Date()),
85
+ f_evaluate_state: '已评价',
86
+ f_evaluate_type: '用户评价',
87
+ f_evaluate_userid: openid.value,
88
+ }
89
+ openApiLogic(data, 'saveEvaluate', serviceName.value).then(async (res: any) => {
90
+ if (res.id) {
91
+ await showDialog({ message: '评价成功了' })
92
+ closeWindows()
93
+ }
94
+ else {
95
+ await showDialog({ message: '评价失败了' })
96
+ }
97
+ }).catch(() => {
98
+ showDialog({ message: '评价失败了' })
99
+ })
100
+ }
101
+ function closeWindows() {
102
+ const ua = window.navigator.userAgent.toLowerCase()
103
+ if (ua.includes('micromessenger') && typeof WeixinJSBridge !== 'undefined') {
104
+ WeixinJSBridge.call('closeWindow')
105
+ }
106
+ else {
107
+ // 关闭页面
108
+ if (navigator.userAgent.includes('Firefox') || navigator.userAgent.includes('Chrome')) {
109
+ window.open('about:blank', '_self')
110
+ window.close()
111
+ }
112
+ else {
113
+ window.opener = null
114
+ window.open('', '_self')
115
+ window.close()
116
+ }
117
+ }
118
+ }
119
+ </script>
120
+
121
+ <template>
122
+ <VanNavBar
123
+ :title="mode === '预览' ? '服务评价纪录' : '服务评价'"
124
+ />
125
+ <VanSwipe class="my-swipe" height="150" :autoplay="3000" lazy-render indicator-color="#7b7c7c">
126
+ <VanSwipeItem v-for="image in images" :key="image">
127
+ <img :src="image">
128
+ </VanSwipeItem>
129
+ </VanSwipe>
130
+ <VanRow v-show="loading" justify="center">
131
+ <VanLoading type="spinner" color="#1989fa" />
132
+ </VanRow>
133
+ <VanSpace v-show="!loading" direction="vertical" fill>
134
+ <VanCellGroup inset>
135
+ <VanCell title="业务办理人" :value="currentEvaluate.f_business_agent" />
136
+ <VanCell title="业务类型" :value="currentEvaluate.f_business_type" />
137
+ <VanCell title="业务名称" :value="currentEvaluate.f_business_name" />
138
+ </VanCellGroup>
139
+ <x-form
140
+ v-if="xFormInit"
141
+ ref="xForm"
142
+ style="margin-bottom: 14px;"
143
+ :group-form-items="JSON.parse(JSON.stringify(groupFormItems))"
144
+ :service-name="serviceName"
145
+ :form-data="formData"
146
+ :mode="mode"
147
+ @on-submit="onSubmit"
148
+ />
149
+ </VanSpace>
150
+ </template>
151
+
152
+ <style scoped>
153
+ .van-cell-group--inset .van-cell::after {
154
+ border-bottom: 1px dashed #c0c2c2 !important; /* 虚线 + 颜色 */
155
+ left: 16px; /* 保持 inset 分组缩进 */
156
+ right: 16px;
157
+ }
158
+ .my-swipe .van-swipe-item {
159
+ border-radius: 8px;
160
+ box-sizing: border-box;
161
+ padding: 8px; /* 让图片和边框有间距 */
162
+ }
163
+
164
+ .my-swipe .van-swipe-item img {
165
+ width: 100%;
166
+ height: 100%;
167
+ object-fit: contain; /* 保持图片比例 */
168
+ border-radius: 4px; /* 可选:图片圆角 */
169
+ }
170
+ img {
171
+ overflow-clip-margin: content-box;
172
+ overflow: clip;
173
+ }
174
+ </style>
@@ -63,8 +63,8 @@ function submit(_result) {
63
63
  <!-- v-if="isInit" -->
64
64
  <XFormGroup
65
65
  ref="formGroup"
66
- config-name="lngOrderCarInFormGroup"
67
- service-name="af-gaslink"
66
+ :config-name="configName"
67
+ :service-name="serviceName"
68
68
  :group-form-data="formData"
69
69
  mode="新增"
70
70
  @submit="submit"
@@ -42,6 +42,10 @@ const list = ref([
42
42
  name: 'XReportGridView 栅格组件',
43
43
  to: '/Component/XReportGridView',
44
44
  },
45
+ {
46
+ name: 'XFormAppraise 表单',
47
+ to: '/Component/XFormAppraiseView/2/debug',
48
+ },
45
49
  ])
46
50
 
47
51
  function cleanConfigCache() {