af-mobile-client-vue3 1.0.90 → 1.0.92-appraise

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.
@@ -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,169 @@
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
+ NavBar as VanNavBar,
7
+ Space as VanSpace,
8
+ Row as VanRow,
9
+ Loading as VanLoading,
10
+ CellGroup as VanCellGroup,
11
+ Cell as VanCell,
12
+ Swipe as VanSwipe,
13
+ SwipeItem as VanSwipeItem
14
+ } from 'vant'
15
+ import { useRoute } from "vue-router";
16
+ import {onMounted,ref,getCurrentInstance} from 'vue'
17
+ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
18
+ import {openApiLogic} from "@af-mobile-client-vue3/services/api/common"
19
+ import {showDialog} from "vant/lib";
20
+ import {formatDate} from '@af-mobile-client-vue3/hooks/useCommon'
21
+ let xForm = ref()
22
+ const xFormInit = ref(false)
23
+ const mode = ref('')
24
+ let loading = ref(true)
25
+ const groupFormItems = ref({})
26
+ const formData = ref({})
27
+ let id = ref(-1)
28
+ let openid = ref('')
29
+ const instance = getCurrentInstance();
30
+ let route = useRoute()
31
+ let serviceName = ref('af-revenue')
32
+ let images = ref([banner1, banner2])
33
+ let currentEvaluate = {
34
+ id: null,
35
+ f_business_name: '',
36
+ f_evaluate_state: ''
37
+ }
38
+ onMounted(()=>{
39
+ if (instance) {
40
+ id.value = route.params.id as unknown as number
41
+ openid.value = <string>route.params.openid
42
+ formInit()
43
+ }})
44
+
45
+ async function formInit() {
46
+ if (id.value > 0) {
47
+ queryData()
48
+ } else {
49
+ // 没有id 直接提示用户不存在,返回上一级
50
+ await showDialog({message: '评价信息缺少参数,找不到对应评价信息'})
51
+ closeWindows()
52
+ }
53
+ }
54
+ function queryData () {
55
+ openApiLogic({
56
+ id: id.value
57
+ }, 'getEvalConfigById',serviceName.value).then(async (res: any) => {
58
+ console.log('打印res', res)
59
+ if (res.row && res.config) {
60
+ Object.assign(currentEvaluate, res.row)
61
+ if (currentEvaluate.f_evaluate_state === '已评价') {
62
+ // await showDialog({message: '该纪录已经被评价过了'})
63
+ // closeWindows()
64
+ mode.value = '预览'
65
+ formData.value = res.row.f_json ? JSON.parse(res.row.f_json) : {}
66
+ }
67
+ groupFormItems.value = res.config
68
+ xFormInit.value = true
69
+ loading.value = false
70
+ } else {
71
+ await showDialog({message: res.msg})
72
+ closeWindows()
73
+ }
74
+ }).catch(() => {
75
+ showDialog({message: '查询评价信息失败了'})
76
+ })
77
+ }
78
+ function onSubmit(params) {
79
+ let data = {
80
+ id: currentEvaluate.id,
81
+ f_json: params,
82
+ f_evaluate_date: formatDate(new Date),
83
+ f_evaluate_state: '已评价',
84
+ f_evaluate_type: '用户评价',
85
+ f_evaluate_userid: openid.value
86
+ }
87
+ openApiLogic(data, 'saveEvaluate', serviceName.value).then(async (res: any) => {
88
+ if (res.id) {
89
+ await showDialog({message: '评价成功了'})
90
+ closeWindows()
91
+ } else {
92
+ await showDialog({message: '评价失败了'})
93
+ }
94
+ }).catch(() => {
95
+ showDialog({ message: '评价失败了' })
96
+ })
97
+ }
98
+ function closeWindows() {
99
+ let ua = window.navigator.userAgent.toLowerCase();
100
+ if (ua.indexOf('micromessenger') !== -1) {
101
+ WeixinJSBridge.call('closeWindow')
102
+ } else {
103
+ //关闭页面
104
+ if (navigator.userAgent.indexOf('Firefox') != -1 || navigator.userAgent.indexOf('Chrome')!= -1) {
105
+ window.open('about:blank', '_self')
106
+ window.close()
107
+ } else {
108
+ window.opener = null
109
+ window.open('', '_self')
110
+ window.close()
111
+ }
112
+ }
113
+ }
114
+ </script>
115
+
116
+ <template>
117
+ <van-nav-bar
118
+ :title="mode === '预览' ? '服务评价纪录' : '服务评价'"
119
+ />
120
+ <van-swipe class="my-swipe" height="150" :autoplay="3000" lazy-render indicator-color="#7b7c7c">
121
+ <van-swipe-item v-for="image in images" :key="image">
122
+ <img :src="image" />
123
+ </van-swipe-item>
124
+ </van-swipe>
125
+ <van-row justify="center" v-show="loading">
126
+ <van-loading type="spinner" color="#1989fa" />
127
+ </van-row>
128
+ <van-space direction="vertical" fill v-show="!loading">
129
+ <van-cell-group inset>
130
+ <van-cell title="业务办理人" :value="currentEvaluate.f_business_agent" />
131
+ <van-cell title="业务类型" :value="currentEvaluate.f_business_type" />
132
+ <van-cell title="业务名称" :value="currentEvaluate.f_business_name" />
133
+ </van-cell-group>
134
+ <x-form
135
+ v-if="xFormInit"
136
+ ref="xForm"
137
+ style="margin-bottom: 14px;"
138
+ :group-form-items="JSON.parse(JSON.stringify(groupFormItems))"
139
+ :service-name="serviceName"
140
+ :form-data="formData"
141
+ :mode="mode"
142
+ @onSubmit="onSubmit">
143
+ </x-form>
144
+ </van-space>
145
+ </template>
146
+
147
+ <style scoped>
148
+ .van-cell-group--inset .van-cell::after {
149
+ border-bottom: 1px dashed #c0c2c2 !important; /* 虚线 + 颜色 */
150
+ left: 16px; /* 保持 inset 分组缩进 */
151
+ right: 16px;
152
+ }
153
+ .my-swipe .van-swipe-item {
154
+ border-radius: 8px;
155
+ box-sizing: border-box;
156
+ padding: 8px; /* 让图片和边框有间距 */
157
+ }
158
+
159
+ .my-swipe .van-swipe-item img {
160
+ width: 100%;
161
+ height: 100%;
162
+ object-fit: contain; /* 保持图片比例 */
163
+ border-radius: 4px; /* 可选:图片圆角 */
164
+ }
165
+ img {
166
+ overflow-clip-margin: content-box;
167
+ overflow: clip;
168
+ }
169
+ </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() {