af-mobile-client-vue3 1.3.18 → 1.3.20

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,156 +1,29 @@
1
1
  <script setup lang="ts">
2
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
- import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
5
3
  import { defineEmits, ref } from 'vue'
6
4
  import { useRouter } from 'vue-router'
7
5
 
8
- // 定义事件
9
- const emit = defineEmits(['deleteRow'])
10
- const userInfo = useUserStore().getUserInfo()
11
- // 访问路由
6
+ const emit = defineEmits(['addressSelected'])
12
7
  const router = useRouter()
13
- // 获取默认值
14
- const idKey = ref('o_id')
15
-
16
- // 简易crud表单测试
17
- // const configName = ref('orderCarInMobileCRUD')
18
- // const serviceName = ref('af-gaslink')
19
- // const configName = ref('lngPriceManageMobileCRUD')
20
- const configName = ref('测试2')
21
- const serviceName = ref('af-gaslink')
22
- // const configName = ref('mobile_liushuiQueryCRUD')
23
- // const serviceName = ref('af-revenue')
24
-
25
- // 资源权限测试
26
- // const configName = ref('crud_sources_test')
27
- // const serviceName = ref('af-system')
28
-
29
- // 实际业务测试
30
- // const configName = ref('lngChargeAuditMobileCRUD')
31
- // const serviceName = ref('af-gaslink')
32
-
33
- // 跳转到详情页面
34
- // function toDetail(item) {
35
- // router.push({
36
- // name: 'XCellDetailView',
37
- // params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
38
- // query: {
39
- // operName: item[operNameKey.value],
40
- // method:item[methodKey.value],
41
- // requestMethod:item[requestMethodKey.value],
42
- // operatorType:item[operatorTypeKey.value],
43
- // operUrl:item[operUrlKey.value],
44
- // operIp:item[operIpKey.value],
45
- // costTime:item[costTimeKey.value],
46
- // operTime:item[operTimeKey.value],
47
- //
48
- // title: item[titleKey.value],
49
- // businessType: item[businessTypeKey.value],
50
- // status:item[statusKey.value]
51
- // }
52
- // })
53
- // }
54
-
55
- // 跳转到表单——以表单组来渲染纯表单
56
- function toDetail(item) {
57
- router.push({
58
- name: 'xformgroup222',
59
- // query: {
60
- // id: item[idKey.value],
61
- // id: item.rr_id,
62
- // o_id: item.o_id,
63
- // },
64
- })
65
- }
66
-
67
- // 新增功能
68
- // function addOption(totalCount) {
69
- // router.push({
70
- // name: 'XFormView',
71
- // params: { id: totalCount, openid: totalCount },
72
- // query: {
73
- // configName: configName.value,
74
- // serviceName: serviceName.value,
75
- // mode: '新增',
76
- // },
77
- // })
78
- // }
79
- function addOption() {
80
- console.log('用户----', userInfo)
81
- router.push({
82
- name: 'XFormGroupView',
83
- // params: { id: totalCount.value },
84
- // query: {
85
- // configName: configName.value,
86
- // serviceName: serviceName.value,
87
- // mode: '新增',
88
- // },
8
+ const configName = ref('ApplyContractPhoneCRUD')
9
+ const xCellListRefPatrolPlan = ref()
10
+ // 详情
11
+ function toDetail(row) {
12
+ emit('addressSelected', {
13
+ f_address: row.tua_f_address,
14
+ f_address_id: row.tua_id,
89
15
  })
90
- // 如果存在回调函数,调用它并传递true表示已处理
91
- // if (typeof callback === 'function') {
92
- // callback(true)
93
- // }
94
- }
95
-
96
- // 修改功能
97
- function updateRow(result) {
98
- console.log('用户----', userInfo)
99
- router.push({
100
- name: 'XFormView',
101
- params: { id: 1, openid: 2 },
102
- query: {
103
- configName: configName.value,
104
- serviceName: serviceName.value,
105
- mode: '修改',
106
- },
107
- })
108
- }
109
-
110
- // 删除功能
111
- function deleteRow(result) {
112
- emit('deleteRow', result.o_id)
113
16
  }
114
17
  </script>
115
18
 
116
19
  <template>
117
- <NormalDataLayout id="XCellListView" title="工作计划">
118
- <template #layout_content>
119
- <!-- <XCellList -->
120
- <!-- :config-name="configName" -->
121
- <!-- :service-name="serviceName" -->
122
- <!-- :custom-add="true" -->
123
- <!-- :custom-edit="true" -->
124
- <!-- :id-key="idKey" -->
125
- <!-- @to-detail="toDetail" -->
126
- <!-- @delete-row="deleteRow" -->
127
- <!-- @update="updateRow" -->
128
- <!-- @add="addOption" -->
129
- <!-- /> -->
130
-
131
- <!-- :fix-query-form="{ u_f_price_state: ['生效', '待生效'] }" -->
132
-
133
- <!-- <XCellList -->
134
- <!-- config-name="ApplyMobileSuperviseCRUD" -->
135
- <!-- service-name="af-apply" -->
136
- <!-- @to-detail="toDetail" -->
137
- <!-- @delete-row="deleteRow" -->
138
- <!-- /> -->
139
-
140
- <!-- <XCellList -->
141
- <!-- service-name="af-revenue" -->
142
- <!-- config-name="userfiles_sel_address" -->
143
- <!-- @to-detail="toDetail" -->
144
- <!-- /> -->
145
- <XCellList
146
- service-name="af-safecheck"
147
- config-name="temporarySecurityCheckCRUD"
148
- :custom-add="true"
149
- @to-detail="toDetail"
150
- @add="addOption"
151
- />
152
- </template>
153
- </NormalDataLayout>
20
+ <XCellList
21
+ ref="xCellListRefPatrolPlan"
22
+ service-name="af-apply"
23
+ :config-name="configName"
24
+ :hide-all-actions="true"
25
+ @to-detail="toDetail"
26
+ />
154
27
  </template>
155
28
 
156
29
  <style scoped lang="less">
@@ -5,28 +5,30 @@ import { showDialog } from 'vant'
5
5
  import { ref } from 'vue'
6
6
  import { useRoute } from 'vue-router'
7
7
 
8
- // const configName = ref('reviewFormGroup')
9
- // const serviceName = ref('af-revenue')
10
-
11
8
  // 纯表单
12
- // const configName = ref('form_check_test')
13
- // const serviceName = ref('af-system')
9
+ const configName = ref('appapplyuserinfoFormGroup')
10
+ const serviceName = ref('af-apply')
14
11
 
15
12
  // const configName = ref("计划下发Form")
16
13
  // const serviceName = ref("af-linepatrol")
17
14
 
18
15
  // 表单组
19
- const configName = ref('lngChargeAuditMobileFormGroup')
20
- const serviceName = ref('af-gaslink')
16
+ // const configName = ref('lngChargeAuditMobileFormGroup')
17
+ // const serviceName = ref('af-gaslink')
21
18
 
22
19
  const formData = ref({})
23
20
  const formGroup = ref(null)
24
21
  const route = useRoute()
25
22
  const isInit = ref(false)
23
+
24
+ const formShow = {
25
+ showt_userinfo: true,
26
+ showdevices: true
27
+ }
28
+
26
29
  function submit(_result) {
27
30
  showDialog({ message: '提交成功' }).then(() => {
28
- console.log('12121')
29
- // history.back()
31
+ history.back()
30
32
  })
31
33
  }
32
34
 
@@ -67,10 +69,12 @@ function submit(_result) {
67
69
  <!-- v-if="isInit" -->
68
70
  <XFormGroup
69
71
  ref="formGroup"
70
- config-name="ApplyAddContractFormGroup"
71
- service-name="af-apply"
72
+ :config-name="configName"
73
+ :service-name="serviceName"
72
74
  :group-form-data="formData"
75
+ :form-show="formShow"
73
76
  mode="新增"
77
+ :is-scrollspy="true"
74
78
  @submit="submit"
75
79
  />
76
80
  </template>
@@ -7,8 +7,19 @@ const configName = ref('AddConstructionForm')
7
7
  const serviceName = ref('af-linepatrol')
8
8
 
9
9
  const formGroupAddConstruction = ref(null)
10
+ function emitFunc(func, data) {
11
+ if (func === 'selectAddress') {
12
+ const add = 'ccss'
13
+ // 设置单个字段
14
+ formGroupAddConstruction.value?.setForm({ address: '你的字符串' })
15
+ }
16
+ }
17
+ function submit(data) {
18
+ console.log('>>>> data: ', JSON.stringify(data))
19
+ }
10
20
  </script>
11
21
 
22
+ <!-- workflowId -->
12
23
  <template>
13
24
  <NormalDataLayout id="XFormGroupView" title="纯表单">
14
25
  <template #layout_content>
@@ -17,6 +28,10 @@ const formGroupAddConstruction = ref(null)
17
28
  mode="新增"
18
29
  :config-name="configName"
19
30
  :service-name="serviceName"
31
+ :param-logic-name-param="{ aa: 123 }"
32
+ :form-data="{ f_project_name: 333 }"
33
+ @x-form-item-emit-func="emitFunc"
34
+ @on-submit="submit"
20
35
  />
21
36
  </template>
22
37
  </NormalDataLayout>
@@ -0,0 +1,70 @@
1
+ <script setup lang="ts">
2
+ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
3
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
+ import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
5
+ import { onBeforeMount, ref, toRaw } from 'vue'
6
+
7
+ const configName = ref('AddConstructionForm')
8
+ const serviceName = ref('af-linepatrol')
9
+ const formGroup = ref(null)
10
+ const formConfig = ref(null)
11
+ const submitSimple = ref(null)
12
+ const isLoading = ref(true)
13
+
14
+ function safeStringify(obj) {
15
+ const seen = new WeakSet()
16
+ return JSON.stringify(toRaw(obj), (key, val) => {
17
+ if (typeof val === 'object' && val !== null) {
18
+ if (seen.has(val))
19
+ return
20
+ seen.add(val)
21
+ }
22
+ return val
23
+ }, 2)
24
+ }
25
+
26
+ function submit(result) {
27
+ console.log('>>>> result: ', safeStringify(result))
28
+ }
29
+
30
+ function loadConfig() {
31
+ return new Promise((resolve) => {
32
+ getConfigByName(configName.value, (result) => {
33
+ submitSimple.value = result.showSubmitBtn
34
+ formConfig.value = result
35
+ resolve(result)
36
+ }, serviceName.value)
37
+ })
38
+ }
39
+
40
+ onBeforeMount(async () => {
41
+ try {
42
+ await loadConfig()
43
+ }
44
+ finally {
45
+ isLoading.value = false
46
+ }
47
+ })
48
+ </script>
49
+
50
+ <template>
51
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
52
+ <template #layout_content>
53
+ <van-loading v-if="isLoading" />
54
+ <XForm
55
+ v-else
56
+ ref="formGroup"
57
+ mode="查询"
58
+ :service-name="serviceName"
59
+ :group-form-items="formConfig"
60
+ :form-data="{}"
61
+ :form-name="formConfig?.groupName || '11111'"
62
+ :submit-button="submitSimple"
63
+ @on-submit="submit"
64
+ />
65
+ </template>
66
+ </NormalDataLayout>
67
+ </template>
68
+
69
+ <style scoped lang="less">
70
+ </style>
@@ -1,118 +1,118 @@
1
- <script setup lang="ts">
2
- import type { LocationResult } from '@af-mobile-client-vue3/components/data/XOlMap/types'
3
- import LocationPicker from '@af-mobile-client-vue3/components/data/XOlMap/XLocationPicker/index.vue'
4
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
5
- import { showNotify } from 'vant'
6
- import { ref } from 'vue'
7
-
8
- const selectedLocation = ref<LocationResult>()
9
-
10
- // 处理位置选择
11
- function handleLocationConfirm(location: LocationResult) {
12
- // console.log('选择的位置:', location)
13
- // selectedLocation.value = location
14
- showNotify({ type: 'success', message: '位置已选择' })
15
- }
16
- </script>
17
-
18
- <template>
19
- <NormalDataLayout id="XLocationPicker" title="XOlMap地址选择器">
20
- <template #layout_content>
21
- <div class="location-picker-demo">
22
- <!-- 页面标题 -->
23
- <div class="page-header">
24
- <div class="title">
25
- 位置选择
26
- </div>
27
- </div>
28
-
29
- <!-- 选择结果展示 -->
30
- <div v-if="selectedLocation" class="location-result">
31
- <div class="label">
32
- 已选位置:
33
- </div>
34
- <div class="value">
35
- {{ selectedLocation.address }}
36
- </div>
37
- <div class="coordinates">
38
- 经度: {{ selectedLocation.longitude.toFixed(6) }},
39
- 纬度: {{ selectedLocation.latitude.toFixed(6) }}
40
- </div>
41
- </div>
42
-
43
- <!-- 地图组件 -->
44
- <div class="map-container">
45
- <LocationPicker
46
- v-model="selectedLocation"
47
- :default-center="[108.948024, 34.263161]"
48
- :default-zoom="12"
49
- @confirm="handleLocationConfirm"
50
- />
51
- </div>
52
- </div>
53
- </template>
54
- </NormalDataLayout>
55
- </template>
56
-
57
- <style scoped lang="less">
58
- .location-picker-demo {
59
- width: 100%;
60
- height: 100%;
61
- position: relative;
62
- display: flex;
63
- flex-direction: column;
64
- background-color: #f7f8fa;
65
- }
66
-
67
- .page-header {
68
- height: 44px;
69
- display: flex;
70
- align-items: center;
71
- justify-content: center;
72
- background: white;
73
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
74
- position: relative;
75
- z-index: 1;
76
-
77
- .title {
78
- font-size: 16px;
79
- color: #333;
80
- font-weight: 500;
81
- }
82
- }
83
-
84
- .location-result {
85
- background: white;
86
- padding: 12px 16px;
87
- margin: 10px;
88
- border-radius: 8px;
89
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
90
-
91
- .label {
92
- font-size: 14px;
93
- color: #666;
94
- margin-bottom: 4px;
95
- }
96
-
97
- .value {
98
- font-size: 16px;
99
- color: #333;
100
- margin-bottom: 8px;
101
- word-break: break-all;
102
- }
103
-
104
- .coordinates {
105
- font-size: 12px;
106
- color: #999;
107
- }
108
- }
109
-
110
- .map-container {
111
- flex: 1;
112
- position: relative;
113
- margin: 0 10px 10px 10px;
114
- border-radius: 8px;
115
- overflow: hidden;
116
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
117
- }
118
- </style>
1
+ <script setup lang="ts">
2
+ import type { LocationResult } from '@af-mobile-client-vue3/components/data/XOlMap/types'
3
+ import LocationPicker from '@af-mobile-client-vue3/components/data/XOlMap/XLocationPicker/index.vue'
4
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
5
+ import { showNotify } from 'vant'
6
+ import { ref } from 'vue'
7
+
8
+ const selectedLocation = ref<LocationResult>()
9
+
10
+ // 处理位置选择
11
+ function handleLocationConfirm(location: LocationResult) {
12
+ // console.log('选择的位置:', location)
13
+ // selectedLocation.value = location
14
+ showNotify({ type: 'success', message: '位置已选择' })
15
+ }
16
+ </script>
17
+
18
+ <template>
19
+ <NormalDataLayout id="XLocationPicker" title="XOlMap地址选择器">
20
+ <template #layout_content>
21
+ <div class="location-picker-demo">
22
+ <!-- 页面标题 -->
23
+ <div class="page-header">
24
+ <div class="title">
25
+ 位置选择
26
+ </div>
27
+ </div>
28
+
29
+ <!-- 选择结果展示 -->
30
+ <div v-if="selectedLocation" class="location-result">
31
+ <div class="label">
32
+ 已选位置:
33
+ </div>
34
+ <div class="value">
35
+ {{ selectedLocation.address }}
36
+ </div>
37
+ <div class="coordinates">
38
+ 经度: {{ selectedLocation.longitude.toFixed(6) }},
39
+ 纬度: {{ selectedLocation.latitude.toFixed(6) }}
40
+ </div>
41
+ </div>
42
+
43
+ <!-- 地图组件 -->
44
+ <div class="map-container">
45
+ <LocationPicker
46
+ v-model="selectedLocation"
47
+ :default-center="[108.948024, 34.263161]"
48
+ :default-zoom="12"
49
+ @confirm="handleLocationConfirm"
50
+ />
51
+ </div>
52
+ </div>
53
+ </template>
54
+ </NormalDataLayout>
55
+ </template>
56
+
57
+ <style scoped lang="less">
58
+ .location-picker-demo {
59
+ width: 100%;
60
+ height: 100%;
61
+ position: relative;
62
+ display: flex;
63
+ flex-direction: column;
64
+ background-color: #f7f8fa;
65
+ }
66
+
67
+ .page-header {
68
+ height: 44px;
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ background: white;
73
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
74
+ position: relative;
75
+ z-index: 1;
76
+
77
+ .title {
78
+ font-size: 16px;
79
+ color: #333;
80
+ font-weight: 500;
81
+ }
82
+ }
83
+
84
+ .location-result {
85
+ background: white;
86
+ padding: 12px 16px;
87
+ margin: 10px;
88
+ border-radius: 8px;
89
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
90
+
91
+ .label {
92
+ font-size: 14px;
93
+ color: #666;
94
+ margin-bottom: 4px;
95
+ }
96
+
97
+ .value {
98
+ font-size: 16px;
99
+ color: #333;
100
+ margin-bottom: 8px;
101
+ word-break: break-all;
102
+ }
103
+
104
+ .coordinates {
105
+ font-size: 12px;
106
+ color: #999;
107
+ }
108
+ }
109
+
110
+ .map-container {
111
+ flex: 1;
112
+ position: relative;
113
+ margin: 0 10px 10px 10px;
114
+ border-radius: 8px;
115
+ overflow: hidden;
116
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
117
+ }
118
+ </style>