af-mobile-client-vue3 1.3.86 → 1.3.87

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,27 +1,19 @@
1
1
  <script setup lang="ts">
2
2
  import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
3
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
4
  import { defineEmits, ref } from 'vue'
6
5
  import { useRouter } from 'vue-router'
7
6
 
8
7
  // 定义事件
9
8
  const emit = defineEmits(['deleteRow'])
10
-
11
- // 多选操作配置
12
- const multiSelectActions = ref([
13
- { name: '批量审核', key: 'batchAudit', color: '#000000', icon: 'passed' },
14
- ])
15
-
16
- const userInfo = useUserStore().getUserInfo()
17
9
  // 访问路由
18
10
  const router = useRouter()
19
11
  // 获取默认值
20
- const idKey = ref('o_id')
12
+ // const idKey = ref('o_id')
21
13
 
22
14
  // 简易crud表单测试
23
- const configName = ref('lngChargeAuditMobileCRUD')
24
- const serviceName = ref('af-gaslink')
15
+ const configName = ref('ceshiCRUD')
16
+ const serviceName = ref('af-safecheck')
25
17
 
26
18
  // 资源权限测试
27
19
  // const configName = ref('crud_sources_test')
@@ -54,16 +46,16 @@ const serviceName = ref('af-gaslink')
54
46
  // }
55
47
 
56
48
  // 跳转到表单——以表单组来渲染纯表单
57
- function toDetail(item) {
58
- router.push({
59
- name: 'XFormView',
60
- query: {
61
- id: item[idKey.value],
62
- // id: item.rr_id,
63
- // o_id: item.o_id,
64
- },
65
- })
66
- }
49
+ // function toDetail(item) {
50
+ // router.push({
51
+ // name: 'XFormGroupView',
52
+ // query: {
53
+ // id: item[idKey.value],
54
+ // // id: item.rr_id,
55
+ // // o_id: item.o_id,
56
+ // },
57
+ // })
58
+ // }
67
59
 
68
60
  // 新增功能
69
61
  // function addOption(totalCount) {
@@ -92,39 +84,20 @@ function toDetail(item) {
92
84
  // }
93
85
 
94
86
  // 删除功能
95
- function deleteRow(result) {
96
- emit('deleteRow', result.o_id)
97
- }
98
-
99
- // 多选操作处理
100
- function handleMultiSelectAction(action: string, selectedItems: any[], selectedItemsArray: any[]) {
101
- console.log('多选操作:', action, selectedItems, selectedItemsArray)
102
- }
103
-
104
- // 选择变化处理
105
- function handleSelectionChange(selectedItems: any[]) {
106
- console.log('选择变化,当前选中:', selectedItems.length, '个项目')
107
- // 可以在这里更新UI状态,比如显示选中数量等
108
- }
109
-
110
- // 数据加载完成后处理 @after-load
111
- function afterLoad(result) {
112
- console.log('afterLoad:', result)
113
- }
87
+ // function deleteRow(result) {
88
+ // emit('deleteRow', result.o_id)
89
+ // }
90
+ // const fixQueryForm = ref({
91
+ // f_operator_id: '487184754014158848',
92
+ // })
114
93
  </script>
115
94
 
116
95
  <template>
117
96
  <NormalDataLayout id="XCellListView" title="工作计划">
118
97
  <template #layout_content>
119
98
  <XCellList
120
- config-name="mobile_casualSecurityCheckCRUD"
121
- service-name="af-safecheck"
122
- :enable-multi-select="true"
123
- id-key="rr_id"
124
- :multi-select-actions="multiSelectActions"
125
- @to-detail="toDetail"
126
- @multi-select-action="handleMultiSelectAction"
127
- @selection-change="handleSelectionChange"
99
+ :config-name="configName"
100
+ :service-name="serviceName"
128
101
  />
129
102
  </template>
130
103
  </NormalDataLayout>
@@ -1,82 +1,78 @@
1
- <script setup lang="ts">
2
- import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
3
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
- import { showDialog } from 'vant'
5
- import { ref } from 'vue'
6
- import { useRoute } from 'vue-router'
7
-
8
- // const configName = ref('reviewFormGroup')
9
- // const serviceName = ref('af-revenue')
10
-
11
- // 纯表单
12
- // const configName = ref('form_check_test')
13
- // const serviceName = ref('af-system')
14
-
15
- // const configName = ref("计划下发Form")
16
- // const serviceName = ref("af-linepatrol")
17
-
18
- // 表单组
19
- const configName = ref('lngChargeAuditMobileFormGroup')
20
- const serviceName = ref('af-gaslink')
21
-
22
- const formData = ref({})
23
- const formGroup = ref(null)
24
- const route = useRoute()
25
- const isInit = ref(false)
26
- function submit(_result) {
27
- showDialog({ message: '提交成功' }).then(() => {
28
- console.log('12121')
29
- // history.back()
30
- })
31
- }
32
-
33
- // 表单组——数据
34
- // function initComponents () {
35
- // runLogic('getlngChargeAuditMobileFormGroupData', {id: 29}, 'af-gaslink').then((res) => {
36
- // formData.value = {...res}
37
- // })
38
- // }
39
-
40
- // 纯表单——数据
41
- // function initComponents() {
42
- // formData.value = { plan_name: 'af-llllll', plan_point: '1号点位', plan_single: '1号点位', plan_range: '2024-12-12' }
43
- // }
44
-
45
- // function initComponents() {
46
- // runLogic('getlngChargeAuditMobileFormGroupData', { id: route.query?.id, o_id: route.query?.o_id }, 'af-gaslink').then((res) => {
47
- // console.log('res------', res)
48
- // formData.value = { ...res }
49
- // formGroup.value.init({
50
- // configName: configName.value,
51
- // serviceName: serviceName.value,
52
- // groupFormData: { ...res },
53
- // mode: "新增"
54
- // })
55
- // isInit.value = true
56
- // })
57
- // }
58
-
59
- // onBeforeMount(() => {
60
- // initComponents()
61
- // })
62
- </script>
63
-
64
- <template>
65
- <NormalDataLayout id="XFormGroupView" title="纯表单">
66
- <template #layout_content>
67
- <!-- v-if="isInit" -->
68
- <XFormGroup
69
- ref="formGroup"
70
- config-name="ApplyAddContractFormGroup"
71
- service-name="af-apply"
72
- :group-form-data="formData"
73
- mode="新增"
74
- @submit="submit"
75
- />
76
- </template>
77
- </NormalDataLayout>
78
- </template>
79
-
80
- <style scoped lang="less">
81
-
82
- </style>
1
+ <script setup lang="ts">
2
+ import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
3
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
+ import { showDialog } from 'vant'
5
+ import { ref } from 'vue'
6
+ import { useRoute } from 'vue-router'
7
+
8
+ // 纯表单
9
+ const configName = ref('form_check_test')
10
+ const serviceName = ref('af-system')
11
+
12
+ // const configName = ref("计划下发Form")
13
+ // const serviceName = ref("af-linepatrol")
14
+
15
+ // 表单组
16
+ // const configName = ref('lngChargeAuditMobileFormGroup')
17
+ // const serviceName = ref('af-gaslink')
18
+
19
+ const formData = ref({})
20
+ const formGroup = ref(null)
21
+ const route = useRoute()
22
+ const isInit = ref(false)
23
+ function submit(_result) {
24
+ showDialog({ message: '提交成功' }).then(() => {
25
+ history.back()
26
+ })
27
+ }
28
+
29
+ // 表单组——数据
30
+ // function initComponents () {
31
+ // runLogic('getlngChargeAuditMobileFormGroupData', {id: 29}, 'af-gaslink').then((res) => {
32
+ // formData.value = {...res}
33
+ // })
34
+ // }
35
+
36
+ // 纯表单——数据
37
+ // function initComponents() {
38
+ // formData.value = { plan_name: 'af-llllll', plan_point: '1号点位', plan_single: '1号点位', plan_range: '2024-12-12' }
39
+ // }
40
+
41
+ // function initComponents() {
42
+ // runLogic('getlngChargeAuditMobileFormGroupData', { id: route.query?.id, o_id: route.query?.o_id }, 'af-gaslink').then((res) => {
43
+ // console.log('res------', res)
44
+ // formData.value = { ...res }
45
+ // formGroup.value.init({
46
+ // configName: configName.value,
47
+ // serviceName: serviceName.value,
48
+ // groupFormData: { ...res },
49
+ // mode: "新增"
50
+ // })
51
+ // isInit.value = true
52
+ // })
53
+ // }
54
+
55
+ // onBeforeMount(() => {
56
+ // initComponents()
57
+ // })
58
+ </script>
59
+
60
+ <template>
61
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
62
+ <template #layout_content>
63
+ <!-- v-if="isInit" -->
64
+ <XFormGroup
65
+ ref="formGroup"
66
+ :config-name="configName"
67
+ :service-name="serviceName"
68
+ :group-form-data="formData"
69
+ mode="新增"
70
+ @submit="submit"
71
+ />
72
+ </template>
73
+ </NormalDataLayout>
74
+ </template>
75
+
76
+ <style scoped lang="less">
77
+
78
+ </style>
@@ -1,42 +1,41 @@
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 { ref } from 'vue'
5
- import {
6
- Button as VanButton,
7
- } from 'vant'
8
-
9
- const configName = ref('测试Form')
10
- const serviceName = ref('af-safecheck')
11
- const formGroupAddConstruction = ref()
12
-
13
- // 提交测试
14
- function onSubmit(form) {
15
- console.log('事件触发提交表单----', form)
16
- }
17
- async function onAsyncSubmit() {
18
- const res = await formGroupAddConstruction.value.asyncSubmit()
19
- console.log('异步提交表单----', res)
20
- }
21
- </script>
22
-
23
- <template>
24
- <NormalDataLayout id="XFormGroupView" title="纯表单">
25
- <template #layout_content>
26
- <XForm
27
- ref="formGroupAddConstruction"
28
- mode="新增"
29
- :config-name="configName"
30
- :show-tab-header="false"
31
- service-name="af-safecheck"
32
- :is-group-form="true"
33
- @on-submit="onSubmit"
34
- />
35
- </template>
36
- </NormalDataLayout>
37
- <van-button type="primary" @click="onAsyncSubmit">提交</van-button>
38
- </template>
39
-
40
- <style scoped lang="less">
41
-
42
- </style>
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 { ref } from 'vue'
5
+
6
+ const configName = ref('ceshiForm')
7
+ const serviceName = ref('af-system')
8
+
9
+ const formGroupAddConstruction = ref(null)
10
+ const formData = ref({
11
+ 'YYYY': '2025-09-08 16:03:22',
12
+ 'YYYY-MM': '2025-09-08 16:03:22',
13
+ 'YYYY-MM-DD': '2025-09-08 16:03:22',
14
+ 'YYYY-MM-DDHH': '2025-09-08 16:03:22',
15
+ 'YYYY-MM-DDHHMM': '2025-09-08 16:03:22',
16
+ 'YYYY-MM-DDHHMMSS': '2025-09-08 16:03:22',
17
+ })
18
+
19
+ function onSubmit(data: any) {
20
+ console.warn('提交表单', data)
21
+ }
22
+ </script>
23
+
24
+ <template>
25
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
26
+ <template #layout_content>
27
+ <XForm
28
+ ref="formGroupAddConstruction"
29
+ mode="修改"
30
+ :config-name="configName"
31
+ :service-name="serviceName"
32
+ :form-data="formData"
33
+ @on-submit="onSubmit"
34
+ />
35
+ </template>
36
+ </NormalDataLayout>
37
+ </template>
38
+
39
+ <style scoped lang="less">
40
+
41
+ </style>
@@ -1,152 +1,158 @@
1
- <script setup lang="ts">
2
- import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
3
- import { getPlatformConfig, getPlatformRoutePrefix } from '@af-mobile-client-vue3/types/platform'
4
- import {
5
- Icon as VanIcon,
6
- } from 'vant'
7
- import { computed } from 'vue'
8
- import { useRouter } from 'vue-router'
9
-
10
- const router = useRouter()
11
- const userStore = useUserStore()
12
-
13
- const userInfo = computed(() => userStore.getUserInfo())
14
- const userName = computed(() => userInfo.value?.name || '外部用户')
15
- const platformType = computed(() => userStore.getPlatformType())
16
- const platformConfig = computed(() => getPlatformConfig(platformType.value))
17
- const userDescription = computed(() =>
18
- platformConfig.value?.description || '外部系统访问用户',
19
- )
20
-
21
- function goToProfile() {
22
- const routePrefix = getPlatformRoutePrefix(platformType.value)
23
- router.push(`${routePrefix}/my`)
24
- }
25
- </script>
26
-
27
- <template>
28
- <main class="external_main">
29
- <!-- 顶部导航栏 -->
30
- <nav class="header_nav">
31
- <div class="header_content">
32
- <h1 class="main_title">
33
- 智慧燃气外部系统
34
- </h1>
35
- <div class="user_section" @click="goToProfile">
36
- <VanIcon name="user-o" class="user-icon" />
37
- </div>
38
- </div>
39
- </nav>
40
-
41
- <!-- 主要内容区域 -->
42
- <div class="content">
43
- <!-- 用户信息卡片 -->
44
- <div class="user-card">
45
- <div class="user-content">
46
- <div class="user-info">
47
- <VanIcon name="user-circle-o" size="64" color="#3b82f6" />
48
- <h2 class="user-name">
49
- {{ userName }}
50
- </h2>
51
- <p class="user-desc">
52
- {{ userDescription }}
53
- </p>
54
- <p v-if="platformConfig" class="platform-name">
55
- {{ platformConfig.name }}
56
- </p>
57
- </div>
58
- </div>
59
- </div>
60
- </div>
61
- </main>
62
- </template>
63
-
64
- <style scoped lang="less">
65
- .external_main {
66
- min-height: 100vh;
67
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
68
-
69
- .header_nav {
70
- background: rgba(255, 255, 255, 0.95);
71
- backdrop-filter: blur(10px);
72
- padding: 0 16px;
73
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
74
-
75
- .header_content {
76
- display: flex;
77
- justify-content: space-between;
78
- align-items: center;
79
- height: 56px;
80
-
81
- .main_title {
82
- font-size: 1.125rem;
83
- font-weight: 600;
84
- color: #333;
85
- margin: 0;
86
- }
87
-
88
- .user_section {
89
- padding: 8px;
90
- cursor: pointer;
91
- border-radius: 50%;
92
- background: rgba(59, 130, 246, 0.1);
93
- transition: all 0.3s ease;
94
-
95
- &:active {
96
- background: rgba(59, 130, 246, 0.2);
97
- }
98
-
99
- .user-icon {
100
- font-size: 20px;
101
- color: #3b82f6;
102
- }
103
- }
104
- }
105
- }
106
-
107
- .content {
108
- padding: 24px 16px;
109
- display: flex;
110
- justify-content: center;
111
-
112
- .user-card {
113
- width: 100%;
114
- max-width: 400px;
115
- border-radius: 12px;
116
- overflow: hidden;
117
- background: rgba(255, 255, 255, 0.95);
118
- backdrop-filter: blur(10px);
119
-
120
- :deep(.van-card__content) {
121
- padding: 32px 24px;
122
- }
123
-
124
- .user-content {
125
- .user-info {
126
- text-align: center;
127
-
128
- .user-name {
129
- font-size: 24px;
130
- font-weight: 600;
131
- color: #333;
132
- margin: 16px 0 8px 0;
133
- }
134
-
135
- .user-desc {
136
- font-size: 14px;
137
- color: #666;
138
- margin: 0;
139
- }
140
-
141
- .platform-name {
142
- font-size: 12px;
143
- color: #3b82f6;
144
- margin: 4px 0 0 0;
145
- font-weight: 500;
146
- }
147
- }
148
- }
149
- }
150
- }
151
- }
152
- </style>
1
+ <script setup lang="ts">
2
+ import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
3
+ import { getPlatformConfig, getPlatformRoutePrefix } from '@af-mobile-client-vue3/types/platform'
4
+ import {
5
+ Icon as VanIcon,
6
+ } from 'vant'
7
+ import { computed } from 'vue'
8
+ import { useRouter } from 'vue-router'
9
+
10
+ const router = useRouter()
11
+ const userStore = useUserStore()
12
+
13
+ const userInfo = computed(() => userStore.getUserInfo())
14
+ const userName = computed(() => userInfo.value?.name || '外部用户')
15
+ const platformType = computed(() => userStore.getPlatformType())
16
+ const platformConfig = computed(() => getPlatformConfig(platformType.value))
17
+ const userDescription = computed(() =>
18
+ platformConfig.value?.description || '外部系统访问用户',
19
+ )
20
+
21
+ function goToProfile() {
22
+ const routePrefix = getPlatformRoutePrefix(platformType.value)
23
+ router.push(`${routePrefix}/my`)
24
+ }
25
+ async function clean () {
26
+ await useUserStore().registerClean()
27
+ }
28
+ </script>
29
+
30
+ <template>
31
+ <main class="external_main">
32
+ <!-- 顶部导航栏 -->
33
+ <nav class="header_nav">
34
+ <div class="header_content">
35
+ <h1 class="main_title">
36
+ 智慧燃气外部系统
37
+ </h1>
38
+ <div class="user_section" @click="goToProfile">
39
+ <VanIcon name="user-o" class="user-icon" />
40
+ </div>
41
+ </div>
42
+ </nav>
43
+
44
+ <!-- 主要内容区域 -->
45
+ <div class="content">
46
+ <!-- 用户信息卡片 -->
47
+ <div class="user-card">
48
+ <div class="user-content">
49
+ <div class="user-info">
50
+ <VanIcon name="user-circle-o" size="64" color="#3b82f6" />
51
+ <h2 class="user-name">
52
+ {{ userName }}
53
+ </h2>
54
+ <p class="user-desc">
55
+ {{ userDescription }}
56
+ </p>
57
+ <p v-if="platformConfig" class="platform-name">
58
+ {{ platformConfig.name }}
59
+ </p>
60
+ <p class="platform-name" @click="clean">
61
+ 清理缓存
62
+ </p>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </main>
68
+ </template>
69
+
70
+ <style scoped lang="less">
71
+ .external_main {
72
+ min-height: 100vh;
73
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
74
+
75
+ .header_nav {
76
+ background: rgba(255, 255, 255, 0.95);
77
+ backdrop-filter: blur(10px);
78
+ padding: 0 16px;
79
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
80
+
81
+ .header_content {
82
+ display: flex;
83
+ justify-content: space-between;
84
+ align-items: center;
85
+ height: 56px;
86
+
87
+ .main_title {
88
+ font-size: 1.125rem;
89
+ font-weight: 600;
90
+ color: #333;
91
+ margin: 0;
92
+ }
93
+
94
+ .user_section {
95
+ padding: 8px;
96
+ cursor: pointer;
97
+ border-radius: 50%;
98
+ background: rgba(59, 130, 246, 0.1);
99
+ transition: all 0.3s ease;
100
+
101
+ &:active {
102
+ background: rgba(59, 130, 246, 0.2);
103
+ }
104
+
105
+ .user-icon {
106
+ font-size: 20px;
107
+ color: #3b82f6;
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
+ .content {
114
+ padding: 24px 16px;
115
+ display: flex;
116
+ justify-content: center;
117
+
118
+ .user-card {
119
+ width: 100%;
120
+ max-width: 400px;
121
+ border-radius: 12px;
122
+ overflow: hidden;
123
+ background: rgba(255, 255, 255, 0.95);
124
+ backdrop-filter: blur(10px);
125
+
126
+ :deep(.van-card__content) {
127
+ padding: 32px 24px;
128
+ }
129
+
130
+ .user-content {
131
+ .user-info {
132
+ text-align: center;
133
+
134
+ .user-name {
135
+ font-size: 24px;
136
+ font-weight: 600;
137
+ color: #333;
138
+ margin: 16px 0 8px 0;
139
+ }
140
+
141
+ .user-desc {
142
+ font-size: 14px;
143
+ color: #666;
144
+ margin: 0;
145
+ }
146
+
147
+ .platform-name {
148
+ font-size: 12px;
149
+ color: #3b82f6;
150
+ margin: 4px 0 0 0;
151
+ font-weight: 500;
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ </style>