af-mobile-client-vue3 1.0.70 → 1.0.71

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.
@@ -1,55 +1,170 @@
1
- <script setup lang="ts">
2
- import { onBeforeMount, ref } from 'vue'
3
- import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
4
- import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
5
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
6
- import { runLogic } from '@af-mobile-client-vue3/services/api/common'
7
- import {useRoute, useRouter} from 'vue-router'
8
- import { formatDate } from '@af-mobile-client-vue3/hooks/useCommon'
9
- import {showSuccessToast} from "vant";
10
-
11
- const route = useRoute()
12
- const router = useRouter()
13
- const formData = ref({})
14
- function initComponents () {
15
- console.log('router.params=', route.params)
16
- runLogic('getLngPurchaseOrderAuditGroupData', {id: route.params?.id}, 'af-gaslink').then((res) => {
17
- console.log('调用logic完成==',res)
18
- formData.value = {...res}
19
- console.log('赋值完成===', formData.value)
20
- })
21
- }
22
- onBeforeMount(()=>{
23
- initComponents()
24
- })
25
- const submit = (formData) => {
26
- console.log('提交表单===', formData)
27
- const param = {
28
- type: formData.value.auditInfo.f_approval_status === '审核未通过' ? 0 : 1,
29
- model: {
30
- approval_date: formatDate(new Date()),
31
- approval_remark:formData.value.auditInfo.f_approval_status,
32
- approval_operator:useUserStore.getUserInfo?.name,
33
- approval_operatorid: useUserStore.getUserInfo?.id
34
- },
35
- record: {od_id:1}
36
- }
37
- console.log('param===', param)
38
- runLogic('lngPurchaseOrderAuditSubmit', param, 'af-gaslink').then((res) => {
39
- console.log('res===', res)
40
- showSuccessToast('审核成功!')
41
- router.go(-1)
42
- })
43
- }
44
- </script>
45
-
46
- <template>
47
- <NormalDataLayout id="XCellListView" title="采购审核">
48
- <template #layout_content>
49
- <XFormGroup :config-name="'lngPurchaseOrderFormGroup'" @submit="submit" :group-form-data="formData" service-name="af-gaslink"/>
50
- </template>
51
- </NormalDataLayout>
52
- </template>
53
- <style scoped lang="less">
54
-
55
- </style>
1
+ <script setup lang="ts">
2
+ import {
3
+ NavBar as VanNavBar,
4
+ Space as VanSpace,
5
+ showDialog,
6
+ } from 'vant'
7
+ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
8
+ import { useRoute } from 'vue-router'
9
+ import { defineEmits, getCurrentInstance, onBeforeMount, ref } from 'vue'
10
+ import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
11
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
12
+ import { post } from '@af-mobile-client-vue3/services/restTools'
13
+
14
+ const emit = defineEmits(['onSumbit'])
15
+ const xForm = ref(null)
16
+ const loading = ref(true)
17
+ const id = ref(-1)
18
+ const openid = ref('')
19
+ const instance = getCurrentInstance()
20
+ const xFormInit = ref(false)
21
+ const route = useRoute()
22
+ const configName = route.query.configName as string
23
+ const serviceName = route.query.serviceName as string
24
+ const mode = route.query.mode as string
25
+ const updateData = ref({})
26
+ const title = ref('')
27
+ const groupFormItems = ref({})
28
+ const api = ref('/af-system/logic/commonQuery')
29
+ const updateId = {
30
+ queryParamsName: 'crud_oper_log_manage',
31
+ pageNo: 1,
32
+ pageSize: 20,
33
+ conditionParams: { o_id: route.params.id as string },
34
+ }
35
+ const loadUpdate = ref(false)
36
+ // const serviceName = ref('af-revenue')
37
+ const _currentEvaluate = {
38
+ id: null,
39
+ f_business_name: '',
40
+ f_evaluate_state: '',
41
+ }
42
+
43
+ // 组件挂载前获取数据
44
+ onBeforeMount(() => {
45
+ if (mode === '修改')
46
+ getUpdateData()
47
+
48
+ if (instance) {
49
+ id.value = route.params.id as unknown as number
50
+ openid.value = route.params.openid as string
51
+ formInit()
52
+ }
53
+ })
54
+
55
+ // 组件初始化前的判断
56
+ async function formInit() {
57
+ if (id.value > 0) {
58
+ // 先获取 myForm
59
+ queryData()
60
+ }
61
+ else {
62
+ // 没有id 直接提示用户不存在,返回上一级
63
+ await showDialog({ message: '评价信息缺少参数,找不到对应评价信息' })
64
+ history.back()
65
+ }
66
+ }
67
+
68
+ // 获取配置信息
69
+ function queryData() {
70
+ getConfigByName(configName, (result) => {
71
+ groupFormItems.value = result
72
+ title.value = result.title
73
+ if (xForm.value) {
74
+ xForm.value.init({
75
+ formItems: result,
76
+ serviceName,
77
+ getDataParams: {},
78
+ formData: updateData.value ? updateData.value : null,
79
+ })
80
+ loading.value = false
81
+ }
82
+ xFormInit.value = true
83
+ }, serviceName)
84
+ }
85
+
86
+ // 提交操作
87
+ function onSubmit(params) {
88
+ // const data = {
89
+ // id: currentEvaluate.id,
90
+ // f_json: params,
91
+ // f_evaluate_date: formatDate(new Date()),
92
+ // f_evaluate_state: '已评价',
93
+ // f_evaluate_type: '用户评价',
94
+ // f_evaluate_userid: openid.value,
95
+ // }
96
+ // openApiLogic(data, 'saveEvaluate', formServiveName).then((_res: any) => {
97
+ // showDialog({ message: '评价成功了' }).then(() => {history.back()})
98
+ // }).catch(() => {
99
+ // showDialog({ message: '评价失败了' })
100
+ // })
101
+ if (params) {
102
+ emit('onSumbit', params)
103
+ showDialog({ message: '评价成功了' }).then(() => {
104
+ history.back()
105
+ })
106
+ }
107
+ else {
108
+ showDialog({ message: '评价失败了' }).then(() => {
109
+ history.back()
110
+ })
111
+ }
112
+ }
113
+
114
+ // 查询需要修改的数据
115
+ function getUpdateData() {
116
+ if (api.value && updateId) {
117
+ post(api.value, updateId).then((res) => {
118
+ loadUpdate.value = true
119
+ updateData.value = res.data[0]
120
+ }, (_) => {
121
+ }).finally(() => {
122
+ loadUpdate.value = false
123
+ })
124
+ }
125
+ }
126
+
127
+ function _onClickLeft(): void {
128
+ history.back()
129
+ }
130
+ </script>
131
+
132
+ <template>
133
+ <!-- <VanNavBar -->
134
+ <!-- title="XForm表单" -->
135
+ <!-- left-text="返回" -->
136
+ <!-- left-arrow -->
137
+ <!-- @click-left="onClickLeft" -->
138
+ <!-- /> -->
139
+ <NormalDataLayout id="XFormView" title="XForm表单">
140
+ <template #layout_content>
141
+ <!-- <VanRow v-show="loading" justify="center"> -->
142
+ <!-- <VanLoading type="spinner" color="#1989fa" /> -->
143
+ <!-- </VanRow> -->
144
+ <VanSpace direction="vertical" fill>
145
+ <VanNavBar :title="title ? mode.concat(title) : null" />
146
+ <XForm
147
+ v-if="xFormInit"
148
+ ref="xForm"
149
+ :group-form-items="JSON.parse(JSON.stringify(groupFormItems))"
150
+ :service-name="serviceName"
151
+ :form-data="updateData ? updateData : null"
152
+ :mode="mode"
153
+ style="margin-bottom: 14px;"
154
+ @on-submit="onSubmit"
155
+ />
156
+ </VanSpace>
157
+ </template>
158
+ </NormalDataLayout>
159
+ </template>
160
+
161
+ <style scoped>
162
+ .van-doc-demo-block__title {
163
+ margin: 0;
164
+ padding: 32px 16px 16px;
165
+ color: black;
166
+ font-weight: 400;
167
+ font-size: 14px;
168
+ line-height: 16px;
169
+ }
170
+ </style>
@@ -2,293 +2,11 @@
2
2
  import { ref } from 'vue'
3
3
  import XReportForm from '@af-mobile-client-vue3/components/data/XReportForm/index.vue'
4
4
 
5
- // test_table_config_forEditor
6
- // test_tableConfig
7
- // test_table_config_json
8
- const configName = ref('report_yangchun_gasEqiupmentWidePic')
9
- // const slotName = ref('test_tableConfig_slot')
10
-
11
- const temp_config = {
12
- slotsDefine: {},
13
- subTitle: [],
14
- slotsDeclare: [],
15
- data: {
16
- images: {
17
- serviceall: {
18
- imgs: [],
19
- },
20
- },
21
- },
22
- columns: [
23
- [
24
- {
25
- rowSpan: 1,
26
- colSpan: 12,
27
- text: '燃气设施全景',
28
- originalRowIndex: 0,
29
- type: 'column',
30
- originalCellIndex: 0,
31
- },
32
- ],
33
- [
34
- {
35
- rowSpan: 1,
36
- colSpan: 12,
37
- dataIndex: 'serviceall@@@imgs',
38
- originalRowIndex: 1,
39
- type: 'images',
40
- originalCellIndex: 0,
41
- },
42
- ],
43
- ],
44
- width: 'auto',
45
- style: {},
46
- title: '',
47
- table: [
48
- [
49
- {
50
- rowSpan: 1,
51
- def: {
52
- text: '燃气设施全景',
53
- type: 'column',
54
- },
55
- colSpan: 12,
56
- originalRowIndex: 0,
57
- originalCellIndex: 0,
58
- },
59
- ],
60
- [
61
- {
62
- rowSpan: 1,
63
- def: {
64
- dataIndex: 'serviceall@@@imgs',
65
- type: 'images',
66
- },
67
- colSpan: 12,
68
- originalRowIndex: 1,
69
- originalCellIndex: 0,
70
- },
71
- ],
72
- ],
73
- designMode: 'VisualTable',
74
- }
75
- // const test_json_data = { usermeter: { f_collection_type: '按金额', f_total_gas: '总气量', f_total_fee: '总金额' } }
76
- //
77
- // const report_yangchun_serviceRepair = {
78
- // title: {
79
- // type: 'titleKey',
80
- // value: 'f_type',
81
- // },
82
- // content: [
83
- // {
84
- // customFunctionForLabel: 'function (config) {\n\treturn { type: \'key\', content: \'f_project\' }\n}',
85
- // customFunctionForValue: 'function (config, item) {\n if (!item.f_content || item.f_content === null) {\n return { type: \'value\', content: \'无\' }\n }else {\n return { type: \'key\', content: \'f_content\'}\n }\n}',
86
- // jsonArrayDataIndex: 'details',
87
- // type: 'jsonArray',
88
- // },
89
- // ],
90
- // designMode: 'json',
91
- // testJsonData: {
92
- // imgs: [],
93
- // details: [
94
- // {
95
- // f_project: '旧表表号',
96
- // f_service_id: 35917,
97
- // f_is_must: 'false',
98
- // id: 224392,
99
- // type: 'string',
100
- // },
101
- // {
102
- // f_project: '新表表号',
103
- // f_service_id: 35917,
104
- // f_is_must: 'false',
105
- // id: 224393,
106
- // type: 'string',
107
- // },
108
- // {
109
- // f_project: '引入方式',
110
- // f_service_id: 35917,
111
- // f_is_must: 'false',
112
- // id: 224394,
113
- // type: 'selector',
114
- // },
115
- // {
116
- // f_project: '是否高空作业',
117
- // f_service_id: 35917,
118
- // f_is_must: 'false',
119
- // id: 224395,
120
- // type: 'selector',
121
- // },
122
- // {
123
- // f_project: '处理结果',
124
- // f_service_id: 35917,
125
- // f_is_must: 'false',
126
- // id: 224396,
127
- // type: 'selector',
128
- // },
129
- // {
130
- // f_project: '位置',
131
- // f_service_id: 35917,
132
- // f_is_must: 'false',
133
- // id: 224397,
134
- // type: 'selector',
135
- // },
136
- // {
137
- // f_project: '补装管卡',
138
- // f_service_id: 35917,
139
- // f_is_must: 'false',
140
- // id: 224398,
141
- // type: 'selector',
142
- // },
143
- // {
144
- // f_project: '备注',
145
- // f_service_id: 35917,
146
- // f_is_must: 'false',
147
- // id: 224399,
148
- // type: 'string',
149
- // },
150
- // ],
151
- // id: 35917,
152
- // f_type: '改管维修',
153
- // },
154
- // }
155
- // const report_yangchun_serviceRepair_data = {
156
- // usermeter: {
157
- // f_collection_type: '按金额',
158
- // f_total_gas: '总气量',
159
- // f_total_fee: '总金额',
160
- // },
161
- // }
162
- //
163
- // const deepKeyConfig = {
164
- // slotsDefine: {},
165
- // subTitle: [],
166
- // slotsDeclare: [],
167
- // data: {
168
- // 'images': {},
169
- // 'a1a2@@@a3': '',
170
- // },
171
- // columns: [
172
- // [
173
- // {
174
- // rowSpan: 1,
175
- // colSpan: 3,
176
- // text: 'deepKey测试',
177
- // originalRowIndex: 0,
178
- // type: 'column',
179
- // originalCellIndex: 0,
180
- // },
181
- // {
182
- // rowSpan: 1,
183
- // dataIndexType: 'String',
184
- // colSpan: 3,
185
- // dataIndex: 'a1@@@a2@@@a3',
186
- // originalRowIndex: 0,
187
- // type: 'input',
188
- // originalCellIndex: 3,
189
- // },
190
- // {
191
- // rowSpan: 1,
192
- // colSpan: 3,
193
- // text: '动态表头测试',
194
- // originalRowIndex: 0,
195
- // type: 'column',
196
- // originalCellIndex: 6,
197
- // },
198
- // {
199
- // rowSpan: 1,
200
- // customFunction: 'function (val, config) {\n if (config.data.f_label === \'123\') {\n return \'A\'\n } else {\n return \'B\'\n }\n}',
201
- // colSpan: 3,
202
- // text: '1',
203
- // originalRowIndex: 0,
204
- // type: 'column',
205
- // originalCellIndex: 9,
206
- // },
207
- // ],
208
- // ],
209
- // width: 'auto',
210
- // style: {},
211
- // title: '测试deepKey',
212
- // designMode: 'VisualTable',
213
- // }
214
- // const deepKeyConfigData = {
215
- // a1: {
216
- // a2: {
217
- // a3: '我是a3',
218
- // },
219
- // },
220
- // f_label: '123',
221
- // }
222
- //
223
- // const yangchun_ticket = {
224
- // slotsDefine: {},
225
- // subTitle: [],
226
- // slotsDeclare: [],
227
- // data: {
228
- // images: {
229
- // 'serviceall@@@imgs': [],
230
- // },
231
- // },
232
- // columns: [
233
- // [
234
- // {
235
- // rowSpan: 1,
236
- // colSpan: 12,
237
- // text: '燃气设施全景',
238
- // originalRowIndex: 0,
239
- // type: 'column',
240
- // originalCellIndex: 0,
241
- // },
242
- // ],
243
- // [
244
- // {
245
- // rowSpan: 1,
246
- // colSpan: 12,
247
- // dataIndex: 'serviceall@@@imgs',
248
- // originalRowIndex: 1,
249
- // type: 'images',
250
- // originalCellIndex: 0,
251
- // },
252
- // ],
253
- // ],
254
- // width: 'auto',
255
- // style: {},
256
- // title: '',
257
- // table: [
258
- // [
259
- // {
260
- // rowSpan: 1,
261
- // def: {
262
- // text: '燃气设施全景',
263
- // type: 'column',
264
- // },
265
- // colSpan: 12,
266
- // originalRowIndex: 0,
267
- // originalCellIndex: 0,
268
- // },
269
- // ],
270
- // [
271
- // {
272
- // rowSpan: 1,
273
- // def: {
274
- // dataIndex: 'serviceall@@@imgs',
275
- // type: 'images',
276
- // },
277
- // colSpan: 12,
278
- // originalRowIndex: 1,
279
- // originalCellIndex: 0,
280
- // },
281
- // ],
282
- // ],
283
- // designMode: 'VisualTable',
284
- // }
5
+ const configName = ref('ceshi1')
285
6
  </script>
286
7
 
287
8
  <template>
288
- <!-- <XReportForm :config-name="configName" :show-input-columns-label-on-title="true"/> -->
289
- <!-- <XReportForm :config-name="configName" :config-data="test_json_data" :local-config="temp_config" /> -->
290
- <!-- <XReportForm :config-name="configName" :local-config="temp_config" /> -->
291
- <XReportForm :config-name="configName" :local-config="temp_config" />
9
+ <XReportForm :config-name="configName" />
292
10
  </template>
293
11
 
294
12
  <style scoped lang="less">
@@ -0,0 +1,50 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import { Image as VanImage, showToast } from 'vant'
4
+ import XSignature from '@af-mobile-client-vue3/components/data/XSignature/index.vue'
5
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
6
+
7
+ const signatureImage = ref('')
8
+
9
+ function handleSave() {
10
+ showToast('签名已保存')
11
+ }
12
+
13
+ function handleClear() {
14
+ showToast('签名已清除')
15
+ }
16
+ </script>
17
+
18
+ <template>
19
+ <NormalDataLayout title="签名组件">
20
+ <template #layout_content>
21
+ 基础使用
22
+ <div class="signature-demo">
23
+ <XSignature v-model="signatureImage" @save="handleSave" @clear="handleClear" />
24
+ <div v-if="signatureImage" class="preview">
25
+ <h3>预览签名</h3>
26
+ <VanImage v-if="signatureImage" :src="signatureImage" />
27
+ </div>
28
+ </div>
29
+ </template>
30
+ </NormalDataLayout>
31
+ </template>
32
+
33
+ <style scoped lang="less">
34
+ .signature-demo {
35
+ padding: 16px;
36
+ .preview {
37
+ margin-top: 20px;
38
+ h3 {
39
+ margin: 0 0 10px;
40
+ font-size: 16px;
41
+ color: #323233;
42
+ }
43
+ img {
44
+ max-width: 100%;
45
+ border: 1px solid #ebedf0;
46
+ border-radius: 8px;
47
+ }
48
+ }
49
+ }
50
+ </style>
@@ -26,10 +26,18 @@ const list = ref([
26
26
  name: 'XForm 表单',
27
27
  to: '/Component/XFormView/1/debug',
28
28
  },
29
+ {
30
+ name: '操作卡手机端',
31
+ to: '/Component/XReportFormView',
32
+ },
29
33
  {
30
34
  name: '评论记录列表',
31
35
  to: '/Component/EvaluateRecordView',
32
36
  },
37
+ {
38
+ name: 'XSignature 签名组件',
39
+ to: '/Component/XSignatureView',
40
+ },
33
41
  ])
34
42
 
35
43
  function cleanConfigCache() {
@@ -69,7 +77,7 @@ async function logout() {
69
77
  <style scoped lang="less">
70
78
  .home_main {
71
79
  width: 100vw;
72
- height: 100vh;
80
+ height: 100%;
73
81
  padding: var(--base-interval-2);
74
82
  background-color: #eff2f5;
75
83
  .home_title {
package/vite.config.ts CHANGED
@@ -92,7 +92,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
92
92
  viewport({
93
93
  appSelector: '#system-app',
94
94
  viewportWidth: 375,
95
- maxDisplayWidth: 600,
95
+ maxDisplayWidth: 800,
96
96
  appContainingBlock: 'auto',
97
97
  necessarySelectorWhenAuto: '.app-wrapper',
98
98
  rootContainingBlockSelectorList: ['van-tabbar', 'van-popup'],