af-mobile-client-vue3 1.0.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/.editorconfig +38 -0
- package/.env +7 -0
- package/.env.development +4 -0
- package/.env.envoiceShow +7 -0
- package/.env.production +7 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.vscode/extensions.json +7 -0
- package/.vscode/settings.json +61 -0
- package/LICENSE +21 -0
- package/README.md +181 -0
- package/af-example-mobile-vue-web.iml +9 -0
- package/build/vite/index.ts +91 -0
- package/build/vite/vconsole.ts +44 -0
- package/eslint.config.js +7 -0
- package/index.html +17 -0
- package/mock/data.ts +20 -0
- package/mock/index.ts +5 -0
- package/mock/modules/prose.mock.ts +16 -0
- package/mock/modules/user.mock.ts +152 -0
- package/netlify.toml +12 -0
- package/package.json +107 -0
- package/public/favicon-dark.svg +4 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +4 -0
- package/public/pwa-192x192.png +0 -0
- package/public/pwa-512x512.png +0 -0
- package/public/safari-pinned-tab.svg +32 -0
- package/scripts/verifyCommit.js +19 -0
- package/src/App.vue +43 -0
- package/src/api/mock/index.ts +30 -0
- package/src/api/user/index.ts +40 -0
- package/src/assets/common/default-user-profile.png +0 -0
- package/src/assets/img/apps/apply-web.png +0 -0
- package/src/assets/img/apps/example-web.png +0 -0
- package/src/assets/img/apps/iot-web.png +0 -0
- package/src/assets/img/apps/linepatrol-web.png +0 -0
- package/src/assets/img/apps/monitor-web.png +0 -0
- package/src/assets/img/apps/oa-web.png +0 -0
- package/src/assets/img/apps/revenue-web.png +0 -0
- package/src/assets/img/apps/safe-check-web.png +0 -0
- package/src/assets/img/component/logo.png +0 -0
- package/src/assets/img/home/banner1.png +0 -0
- package/src/assets/img/home/banner2.png +0 -0
- package/src/assets/img/home/banner3.png +0 -0
- package/src/assets/img/home/banner4.png +0 -0
- package/src/assets/img/home/notice/icon.png +0 -0
- package/src/assets/img/user/login/background-shadow-1.svg +20 -0
- package/src/assets/img/user/login/logo-background.svg +20 -0
- package/src/assets/img/user/login/logo.png +0 -0
- package/src/assets/img/user/my/exit-login.png +0 -0
- package/src/assets/img/user/my/setting-arrow.png +0 -0
- package/src/assets/img/user/my/setting.png +0 -0
- package/src/bootstrap.ts +32 -0
- package/src/components/core/App/MicroAppView.vue +59 -0
- package/src/components/core/BeautifulLoading/index.vue +47 -0
- package/src/components/core/NavBar/index.vue +12 -0
- package/src/components/core/SvgIcon/index.vue +61 -0
- package/src/components/core/Tabbar/index.vue +38 -0
- package/src/components/core/Uploader/index.vue +104 -0
- package/src/components/core/XMultiSelect/index.vue +196 -0
- package/src/components/core/XSelect/index.vue +130 -0
- package/src/components/data/XBadge/index.vue +85 -0
- package/src/components/data/XCellDetail/index.vue +106 -0
- package/src/components/data/XCellList/index.vue +358 -0
- package/src/components/data/XCellListFilter/index.vue +392 -0
- package/src/components/data/XForm/index.vue +127 -0
- package/src/components/data/XFormItem/index.vue +472 -0
- package/src/components/data/XReportForm/XReportFormJsonRender.vue +220 -0
- package/src/components/data/XReportForm/index.vue +1058 -0
- package/src/components/layout/NormalDataLayout/index.vue +70 -0
- package/src/components/layout/TabBarLayout/index.vue +40 -0
- package/src/components.d.ts +53 -0
- package/src/enums/requestEnum.ts +25 -0
- package/src/env.d.ts +16 -0
- package/src/font-style/PingFangSC-Regular.woff2 +0 -0
- package/src/font-style/font.css +4 -0
- package/src/hooks/useCommon.ts +9 -0
- package/src/hooks/useLogin.ts +97 -0
- package/src/icons/svg/bird.svg +1 -0
- package/src/icons/svg/check-in.svg +33 -0
- package/src/icons/svg/dark.svg +5 -0
- package/src/icons/svg/github.svg +5 -0
- package/src/icons/svg/light.svg +5 -0
- package/src/icons/svg/link.svg +5 -0
- package/src/icons/svg/loadError.svg +1 -0
- package/src/icons/svg/notFound.svg +1 -0
- package/src/icons/svgo.yml +22 -0
- package/src/layout/PageLayout.vue +51 -0
- package/src/layout/SingleLayout.vue +35 -0
- package/src/locales/en-US.json +25 -0
- package/src/locales/zh-CN.json +25 -0
- package/src/main.ts +48 -0
- package/src/plugins/AppData.ts +38 -0
- package/src/plugins/GetLoginInfoService.ts +10 -0
- package/src/plugins/index.ts +11 -0
- package/src/router/README.md +8 -0
- package/src/router/guards.ts +60 -0
- package/src/router/index.ts +60 -0
- package/src/router/invoiceRoutes.ts +33 -0
- package/src/router/routes.ts +84 -0
- package/src/services/api/Login.ts +6 -0
- package/src/services/api/common.ts +98 -0
- package/src/services/api/index.ts +7 -0
- package/src/services/api/manage.ts +8 -0
- package/src/services/restTools.ts +37 -0
- package/src/settings.ts +1 -0
- package/src/stores/index.ts +7 -0
- package/src/stores/modules/cachedView.ts +31 -0
- package/src/stores/modules/counter.ts +19 -0
- package/src/stores/modules/routeTransitionName.ts +26 -0
- package/src/stores/modules/setting.ts +28 -0
- package/src/stores/modules/user.ts +180 -0
- package/src/stores/mutation-type.ts +7 -0
- package/src/styles/app.less +67 -0
- package/src/styles/login.less +81 -0
- package/src/typing.ts +3 -0
- package/src/utils/Storage.ts +124 -0
- package/src/utils/authority-utils.ts +87 -0
- package/src/utils/common.ts +41 -0
- package/src/utils/crypto.ts +39 -0
- package/src/utils/dataUtil.ts +42 -0
- package/src/utils/dictUtil.ts +51 -0
- package/src/utils/http/index.ts +158 -0
- package/src/utils/i18n.ts +41 -0
- package/src/utils/indexedDB.ts +180 -0
- package/src/utils/local-storage.ts +9 -0
- package/src/utils/mobileUtil.ts +26 -0
- package/src/utils/progress.ts +19 -0
- package/src/utils/routerUtil.ts +271 -0
- package/src/utils/set-page-title.ts +7 -0
- package/src/utils/validate.ts +6 -0
- package/src/views/chat/index.vue +153 -0
- package/src/views/common/LoadError.vue +64 -0
- package/src/views/common/NotFound.vue +68 -0
- package/src/views/component/EvaluateRecordView/index.vue +40 -0
- package/src/views/component/XCellDetailView/index.vue +216 -0
- package/src/views/component/XCellListView/index.vue +36 -0
- package/src/views/component/XFormView/index.vue +478 -0
- package/src/views/component/XReportFormIframeView/index.vue +45 -0
- package/src/views/component/XReportFormView/index.vue +295 -0
- package/src/views/component/index.vue +111 -0
- package/src/views/component/menu.vue +117 -0
- package/src/views/component/notice.vue +46 -0
- package/src/views/component/topNav.vue +36 -0
- package/src/views/invoiceShow/index.vue +62 -0
- package/src/views/user/login/ForgetPasswordForm.vue +93 -0
- package/src/views/user/login/LoginForm.vue +145 -0
- package/src/views/user/login/LoginTitle.vue +68 -0
- package/src/views/user/login/LoginWave.vue +109 -0
- package/src/views/user/login/index.vue +22 -0
- package/src/views/user/my/index.vue +230 -0
- package/src/vue-router.d.ts +9 -0
- package/tsconfig.json +43 -0
- package/uno.config.ts +32 -0
- package/vite.config.ts +110 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
NavBar as VanNavBar,
|
|
4
|
+
Row as VanRow,
|
|
5
|
+
Space as VanSpace,
|
|
6
|
+
Cell as VanCell,
|
|
7
|
+
CellGroup as VanCellGroup
|
|
8
|
+
} from 'vant'
|
|
9
|
+
import { useRoute } from "vue-router";
|
|
10
|
+
import {onMounted,ref,getCurrentInstance} from 'vue'
|
|
11
|
+
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
12
|
+
import {openApiLogic} from "@af-mobile-client-vue3/services/api/common";
|
|
13
|
+
import {showDialog} from "vant/lib";
|
|
14
|
+
import {formatDate} from '@af-mobile-client-vue3/hooks/useCommon'
|
|
15
|
+
let xForm = ref(null)
|
|
16
|
+
let loading = ref(true)
|
|
17
|
+
let id = ref(-1)
|
|
18
|
+
let openid = ref('')
|
|
19
|
+
const instance = getCurrentInstance();
|
|
20
|
+
let route = useRoute()
|
|
21
|
+
let serviceName = ref('af-revenue')
|
|
22
|
+
let currentEvaluate = {
|
|
23
|
+
id: null,
|
|
24
|
+
f_business_name: '',
|
|
25
|
+
f_evaluate_state: ''
|
|
26
|
+
}
|
|
27
|
+
const pageNo = 1
|
|
28
|
+
const pageSize = 20
|
|
29
|
+
onMounted(()=>{
|
|
30
|
+
if (instance){
|
|
31
|
+
id.value = route.params.id as unknown as number
|
|
32
|
+
openid.value = <string>route.params.openid
|
|
33
|
+
formInit()
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
async function formInit() {
|
|
38
|
+
let formJson = {
|
|
39
|
+
"apiSlot": {},
|
|
40
|
+
"column": [{
|
|
41
|
+
"addOrEdit": "all",
|
|
42
|
+
"name": "问题描述",
|
|
43
|
+
"rule": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"required": "false"
|
|
46
|
+
},
|
|
47
|
+
"isOnlyAddOrEdit": true,
|
|
48
|
+
"model": "problem",
|
|
49
|
+
"type": "textarea"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"addOrEdit": "all",
|
|
53
|
+
"name": "工作说明",
|
|
54
|
+
"rule": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"required": "true"
|
|
57
|
+
},
|
|
58
|
+
"isOnlyAddOrEdit": true,
|
|
59
|
+
"model": "f_workprocess",
|
|
60
|
+
"type": "textarea"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"addOrEdit": "all",
|
|
64
|
+
"resUploadStock": 1,
|
|
65
|
+
"rule": {
|
|
66
|
+
"type": "Array",
|
|
67
|
+
"required": "false"
|
|
68
|
+
},
|
|
69
|
+
"isOnlyAddOrEdit": true,
|
|
70
|
+
"acceptCount": 3,
|
|
71
|
+
"type": "uploader",
|
|
72
|
+
"accept": [
|
|
73
|
+
"*"
|
|
74
|
+
],
|
|
75
|
+
"name": "附件上传",
|
|
76
|
+
"resUploadMode": "server",
|
|
77
|
+
"model": "fileList"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"addOrEdit": "all",
|
|
81
|
+
"name": "工时",
|
|
82
|
+
"rule": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"required": "true"
|
|
85
|
+
},
|
|
86
|
+
"isOnlyAddOrEdit": true,
|
|
87
|
+
"model": "gs",
|
|
88
|
+
"placeholder": "此项工作时长",
|
|
89
|
+
"type": "input"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"addOrEdit": "all",
|
|
93
|
+
"name": "评分",
|
|
94
|
+
"rule": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"required": "true"
|
|
97
|
+
},
|
|
98
|
+
"isOnlyAddOrEdit": true,
|
|
99
|
+
"model": "rate",
|
|
100
|
+
"placeholder": "评分",
|
|
101
|
+
"type": "rate"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"addOrEdit": "all",
|
|
105
|
+
"name": "开关",
|
|
106
|
+
"rule": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"required": "true"
|
|
109
|
+
},
|
|
110
|
+
"isOnlyAddOrEdit": true,
|
|
111
|
+
"model": "switch",
|
|
112
|
+
"placeholder": "开关",
|
|
113
|
+
"type": "switch"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"addOrEdit": "all",
|
|
117
|
+
"name": "复选框组",
|
|
118
|
+
"rule": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"required": "true",
|
|
121
|
+
"shape": ""
|
|
122
|
+
},
|
|
123
|
+
"selectKey": [
|
|
124
|
+
{
|
|
125
|
+
"label": "气量卡表",
|
|
126
|
+
"value": "气量卡表"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"label": "金额卡表",
|
|
130
|
+
"value": "金额卡表"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"isOnlyAddOrEdit": true,
|
|
134
|
+
"model": "checkboxArray",
|
|
135
|
+
"placeholder": "复选框组",
|
|
136
|
+
"type": "checkboxGroup"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"addOrEdit": "all",
|
|
140
|
+
"name": "复选框",
|
|
141
|
+
"rule": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"required": "true",
|
|
144
|
+
"shape": ""
|
|
145
|
+
},
|
|
146
|
+
"isOnlyAddOrEdit": true,
|
|
147
|
+
"model": "checkbox",
|
|
148
|
+
"placeholder": "复选框",
|
|
149
|
+
"type": "checkbox"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"addOrEdit": "all",
|
|
153
|
+
"name": "单选框",
|
|
154
|
+
"rule": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"required": "true",
|
|
157
|
+
"shape": ""
|
|
158
|
+
},
|
|
159
|
+
"selectKey": [
|
|
160
|
+
{
|
|
161
|
+
"label": "物联网表",
|
|
162
|
+
"value": "物联网表"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"label": "机表",
|
|
166
|
+
"value": "机表"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"label": "气量卡表",
|
|
170
|
+
"value": "气量卡表"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"label": "金额卡表",
|
|
174
|
+
"value": "金额卡表"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"isOnlyAddOrEdit": true,
|
|
178
|
+
"model": "radioMeter",
|
|
179
|
+
"placeholder": "单选框",
|
|
180
|
+
"type": "radio"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"addOrEdit": "all",
|
|
184
|
+
"name": "步进器",
|
|
185
|
+
"rule": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"required": "true",
|
|
188
|
+
"shape": ""
|
|
189
|
+
},
|
|
190
|
+
"isOnlyAddOrEdit": true,
|
|
191
|
+
"model": "stepper",
|
|
192
|
+
"placeholder": "步进器",
|
|
193
|
+
"type": "stepper"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"addOrEdit": "all",
|
|
197
|
+
"name": "滑块",
|
|
198
|
+
"rule": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"required": "true",
|
|
201
|
+
"shape": ""
|
|
202
|
+
},
|
|
203
|
+
"isOnlyAddOrEdit": true,
|
|
204
|
+
"model": "slider",
|
|
205
|
+
"placeholder": "滑块",
|
|
206
|
+
"type": "slider"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"addOrEdit": "all",
|
|
210
|
+
"name": "选择器",
|
|
211
|
+
"rule": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"required": "true",
|
|
214
|
+
"shape": ""
|
|
215
|
+
},
|
|
216
|
+
"selectKey": [
|
|
217
|
+
{text: '杭州', value: 'Hangzhou'},
|
|
218
|
+
{text: '宁波', value: 'Ningbo'},
|
|
219
|
+
{text: '温州', value: 'Wenzhou'},
|
|
220
|
+
{text: '绍兴', value: 'Shaoxing'},
|
|
221
|
+
{text: '湖州', value: 'Huzhou'},
|
|
222
|
+
],
|
|
223
|
+
"isOnlyAddOrEdit": true,
|
|
224
|
+
"model": "picker",
|
|
225
|
+
"placeholder": "选择器",
|
|
226
|
+
"type": "picker"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"addOrEdit": "all",
|
|
230
|
+
"name": "日期选择器",
|
|
231
|
+
"rule": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"required": "true"
|
|
234
|
+
},
|
|
235
|
+
"isOnlyAddOrEdit": true,
|
|
236
|
+
"model": "datePicker",
|
|
237
|
+
"placeholder": "日期选择器",
|
|
238
|
+
"type": "datePicker"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"addOrEdit": "all",
|
|
242
|
+
"name": "时间选择器",
|
|
243
|
+
"rule": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"required": "true"
|
|
246
|
+
},
|
|
247
|
+
"isOnlyAddOrEdit": true,
|
|
248
|
+
"model": "timePicker",
|
|
249
|
+
"placeholder": "时间选择器",
|
|
250
|
+
"type": "timePicker"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"addOrEdit": "all",
|
|
254
|
+
"name": "省市区",
|
|
255
|
+
"rule": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"required": "true"
|
|
258
|
+
},
|
|
259
|
+
"isOnlyAddOrEdit": true,
|
|
260
|
+
"model": "area",
|
|
261
|
+
"placeholder": "省市区",
|
|
262
|
+
"type": "area"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"addOrEdit": "all",
|
|
266
|
+
"name": "日历",
|
|
267
|
+
"rule": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"required": "true"
|
|
270
|
+
},
|
|
271
|
+
"isOnlyAddOrEdit": true,
|
|
272
|
+
"model": "calendar",
|
|
273
|
+
"placeholder": "日历",
|
|
274
|
+
"type": "calendar"
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
let myForm = {
|
|
279
|
+
"groups": [
|
|
280
|
+
{
|
|
281
|
+
"apiSlot": {},
|
|
282
|
+
"column": [
|
|
283
|
+
{
|
|
284
|
+
"formType": "input",
|
|
285
|
+
"rule": {
|
|
286
|
+
"required": "false"
|
|
287
|
+
},
|
|
288
|
+
"acceptCount": 3,
|
|
289
|
+
"title": "服务人员态度",
|
|
290
|
+
"lazyLoad": "false",
|
|
291
|
+
"key": "isOK"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"formType": "input",
|
|
295
|
+
"rule": {
|
|
296
|
+
"required": "false"
|
|
297
|
+
},
|
|
298
|
+
"acceptCount": 3,
|
|
299
|
+
"title": "666",
|
|
300
|
+
"key": "777"
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
"group": "营业厅缴费"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"apiSlot": {},
|
|
307
|
+
"column": [
|
|
308
|
+
{
|
|
309
|
+
"formType": "input",
|
|
310
|
+
"rule": {
|
|
311
|
+
"required": "false"
|
|
312
|
+
},
|
|
313
|
+
"slot": {
|
|
314
|
+
"type": "default"
|
|
315
|
+
},
|
|
316
|
+
"acceptCount": 3,
|
|
317
|
+
"type": "string",
|
|
318
|
+
"title": "人员服务满意度",
|
|
319
|
+
"lazyLoad": "false",
|
|
320
|
+
"key": "personnel_satisfaction"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"formType": "input",
|
|
324
|
+
"rule": {
|
|
325
|
+
"required": "false"
|
|
326
|
+
},
|
|
327
|
+
"acceptCount": 3,
|
|
328
|
+
"title": "业务办理满意度",
|
|
329
|
+
"lazyLoad": "false",
|
|
330
|
+
"key": "business_satisfaction"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"formType": "input",
|
|
334
|
+
"rule": {
|
|
335
|
+
"required": "false"
|
|
336
|
+
},
|
|
337
|
+
"acceptCount": 3,
|
|
338
|
+
"title": "整体满意度",
|
|
339
|
+
"lazyLoad": "false",
|
|
340
|
+
"key": "overall_satisfaction"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"formType": "input",
|
|
344
|
+
"rule": {
|
|
345
|
+
"required": "false"
|
|
346
|
+
},
|
|
347
|
+
"acceptCount": 3,
|
|
348
|
+
"title": "入户是否出示证件",
|
|
349
|
+
"key": "show_identification"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"formType": "input",
|
|
353
|
+
"rule": {
|
|
354
|
+
"required": "false"
|
|
355
|
+
},
|
|
356
|
+
"acceptCount": 3,
|
|
357
|
+
"title": "意见或建议",
|
|
358
|
+
"lazyLoad": "false",
|
|
359
|
+
"key": "suggestion"
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
"group": "入户安全检查"
|
|
363
|
+
}
|
|
364
|
+
],
|
|
365
|
+
"default": {
|
|
366
|
+
"入户安全检查": {
|
|
367
|
+
"identification": "6666",
|
|
368
|
+
"suggestion": "6",
|
|
369
|
+
"satisfaction": "666"
|
|
370
|
+
},
|
|
371
|
+
"ggg": {
|
|
372
|
+
"766": "666"
|
|
373
|
+
},
|
|
374
|
+
"营业厅缴费": {
|
|
375
|
+
"777": "6",
|
|
376
|
+
"isOK": "6"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (id.value > 0) {
|
|
381
|
+
// 先获取 myForm
|
|
382
|
+
queryData()
|
|
383
|
+
} else {
|
|
384
|
+
// 没有id 直接提示用户不存在,返回上一级
|
|
385
|
+
await showDialog({message: '评价信息缺少参数,找不到对应评价信息'})
|
|
386
|
+
history.back()
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function queryData () {
|
|
390
|
+
openApiLogic({
|
|
391
|
+
id: id.value
|
|
392
|
+
}, 'getEvalConfigById',serviceName.value).then(async (res: any) => {
|
|
393
|
+
console.log(res)
|
|
394
|
+
Object.assign(currentEvaluate, res.row)
|
|
395
|
+
if (currentEvaluate.f_evaluate_state === '已评价') {
|
|
396
|
+
await showDialog({message: '该纪录已经被评价过了'})
|
|
397
|
+
window.close()
|
|
398
|
+
} else {
|
|
399
|
+
let param = JSON.parse(JSON.stringify(res.config))
|
|
400
|
+
if (xForm.value) {
|
|
401
|
+
xForm.value.init({
|
|
402
|
+
formItems: param,
|
|
403
|
+
serviceName: serviceName.value,
|
|
404
|
+
getDataParams: {condition: '1=1'}
|
|
405
|
+
})
|
|
406
|
+
loading.value = false
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}).catch(() => {
|
|
410
|
+
showDialog({message: '查询评价信息失败了'})
|
|
411
|
+
})
|
|
412
|
+
}
|
|
413
|
+
// 要搞一个json解析的
|
|
414
|
+
function parseGroupJson(config, configName) {
|
|
415
|
+
let configBase = JSON.parse(JSON.stringify(config))
|
|
416
|
+
return configBase.groups.filter(item=>{
|
|
417
|
+
return item.group === configName
|
|
418
|
+
})[0]
|
|
419
|
+
}
|
|
420
|
+
function onSubmit(params) {
|
|
421
|
+
let data = {
|
|
422
|
+
id: currentEvaluate.id,
|
|
423
|
+
f_json: params,
|
|
424
|
+
f_evaluate_date: formatDate(new Date),
|
|
425
|
+
f_evaluate_state: '已评价',
|
|
426
|
+
f_evaluate_type: '用户评价',
|
|
427
|
+
f_evaluate_userid: openid.value
|
|
428
|
+
}
|
|
429
|
+
openApiLogic(data, 'saveEvaluate', serviceName.value).then((res: any) => {
|
|
430
|
+
console.log('res.data', res)
|
|
431
|
+
showDialog({ message: '评价成功了' })
|
|
432
|
+
history.back()
|
|
433
|
+
}).catch(() => {
|
|
434
|
+
showDialog({ message: '评价失败了' })
|
|
435
|
+
})
|
|
436
|
+
}
|
|
437
|
+
function onClickLeft(): void {
|
|
438
|
+
history.back()
|
|
439
|
+
}
|
|
440
|
+
</script>
|
|
441
|
+
|
|
442
|
+
<template>
|
|
443
|
+
<van-nav-bar
|
|
444
|
+
title="XForm表单"
|
|
445
|
+
left-text="返回"
|
|
446
|
+
left-arrow
|
|
447
|
+
@click-left="onClickLeft"
|
|
448
|
+
/>
|
|
449
|
+
<van-row justify="center" v-show="loading">
|
|
450
|
+
<van-loading type="spinner" color="#1989fa" />
|
|
451
|
+
</van-row>
|
|
452
|
+
<van-space direction="vertical" fill v-show="!loading">
|
|
453
|
+
<h2 class="van-doc-demo-block__title">
|
|
454
|
+
卡片风格
|
|
455
|
+
</h2>
|
|
456
|
+
<van-cell-group inset>
|
|
457
|
+
<van-cell title="单元格" value="内容" />
|
|
458
|
+
<van-cell title="单元格" value="内容" label="描述信息" />
|
|
459
|
+
</van-cell-group>
|
|
460
|
+
<x-form
|
|
461
|
+
ref="xForm"
|
|
462
|
+
style="margin-bottom: 14px;"
|
|
463
|
+
@onSubmit="onSubmit">
|
|
464
|
+
</x-form>
|
|
465
|
+
</van-space>
|
|
466
|
+
</template>
|
|
467
|
+
|
|
468
|
+
<style scoped>
|
|
469
|
+
.van-doc-demo-block__title{
|
|
470
|
+
margin: 0;
|
|
471
|
+
padding: 32px 16px 16px;
|
|
472
|
+
color: black;
|
|
473
|
+
font-weight: 400;
|
|
474
|
+
font-size: 14px;
|
|
475
|
+
line-height: 16px;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, onUnmounted, ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
import XReportForm from '@af-mobile-client-vue3/components/data/XReportForm/index.vue'
|
|
5
|
+
|
|
6
|
+
const localConfig = ref(undefined)
|
|
7
|
+
const configName = ref(undefined)
|
|
8
|
+
|
|
9
|
+
function receiveMessage(event) {
|
|
10
|
+
try {
|
|
11
|
+
if (event.data && typeof event.data === 'object' && event.data.type === 'setConfig') {
|
|
12
|
+
localConfig.value = event.data.localConfig
|
|
13
|
+
configName.value = event.data.configName
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
console.error(e)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
window.addEventListener('message', receiveMessage, false)
|
|
23
|
+
window.parent.postMessage('calParentSend', '*')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
onUnmounted(() => {
|
|
27
|
+
window.removeEventListener('message', receiveMessage, false)
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
function saveConfig(_config) {
|
|
31
|
+
const config = JSON.parse(JSON.stringify(_config))
|
|
32
|
+
window.parent.postMessage({
|
|
33
|
+
type: 'saveConfig',
|
|
34
|
+
config,
|
|
35
|
+
}, '*')
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<!-- <XReportForm :config-name="configName" :show-input-columns-label-on-title="true"/> -->
|
|
41
|
+
<XReportForm :config-name="configName" :show-nav="false" @save-config="saveConfig" :local-config="localConfig" />
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<style scoped lang="less">
|
|
45
|
+
</style>
|