af-mobile-client-vue3 1.4.5 → 1.4.6

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.
@@ -89,6 +89,8 @@ html:not(.dark) {
89
89
  }
90
90
  .login_form {
91
91
  margin-top: 65px;
92
+ background-color: white !important;
93
+ z-index: 10;
92
94
  }
93
95
  .forget_password_form {
94
96
  margin-top: 15px;
@@ -1,57 +1,57 @@
1
- /**
2
- * 根据类型获取日期区间字符串
3
- * @param type '当年' | 'curMonth' | '当日'
4
- * @param show 区分实际值还是显示值, true为实际值, false为显示值
5
- * @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
6
- */
7
- export function getRangeByType(type: string, show: boolean): [string, string] {
8
- const now = new Date()
9
- const year = now.getFullYear()
10
- const month = (now.getMonth() + 1).toString().padStart(2, '0')
11
- const day = now.getDate().toString().padStart(2, '0')
12
-
13
- if (!show) {
14
- if (type === 'curYear') {
15
- return [
16
- `${year}-01-01 00:00:00`,
17
- `${year}-12-31 23:59:59`,
18
- ]
19
- }
20
- if (type === 'curMonth') {
21
- const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
22
- return [
23
- `${year}-${month}-01 00:00:00`,
24
- `${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
25
- ]
26
- }
27
- if (type === 'curDay') {
28
- return [
29
- `${year}-${month}-${day} 00:00:00`,
30
- `${year}-${month}-${day} 23:59:59`,
31
- ]
32
- }
33
- }
34
- if (show) {
35
- if (type === 'curYear') {
36
- return [
37
- `${year}-01-01`,
38
- `${year}-12-31`,
39
- ]
40
- }
41
- if (type === 'curMonth') {
42
- const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
43
- return [
44
- `${year}-${month}-01`,
45
- `${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
46
- ]
47
- }
48
- if (type === 'curDay') {
49
- return [
50
- `${year}-${month}-${day}`,
51
- `${year}-${month}-${day}`,
52
- ]
53
- }
54
- }
55
- // 兜底返回空字符串数组
56
- return ['', '']
57
- }
1
+ /**
2
+ * 根据类型获取日期区间字符串
3
+ * @param type '当年' | 'curMonth' | '当日'
4
+ * @param show 区分实际值还是显示值, true为实际值, false为显示值
5
+ * @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
6
+ */
7
+ export function getRangeByType(type: string, show: boolean): [string, string] {
8
+ const now = new Date()
9
+ const year = now.getFullYear()
10
+ const month = (now.getMonth() + 1).toString().padStart(2, '0')
11
+ const day = now.getDate().toString().padStart(2, '0')
12
+
13
+ if (!show) {
14
+ if (type === 'curYear') {
15
+ return [
16
+ `${year}-01-01 00:00:00`,
17
+ `${year}-12-31 23:59:59`,
18
+ ]
19
+ }
20
+ if (type === 'curMonth') {
21
+ const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
22
+ return [
23
+ `${year}-${month}-01 00:00:00`,
24
+ `${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
25
+ ]
26
+ }
27
+ if (type === 'curDay') {
28
+ return [
29
+ `${year}-${month}-${day} 00:00:00`,
30
+ `${year}-${month}-${day} 23:59:59`,
31
+ ]
32
+ }
33
+ }
34
+ if (show) {
35
+ if (type === 'curYear') {
36
+ return [
37
+ `${year}-01-01`,
38
+ `${year}-12-31`,
39
+ ]
40
+ }
41
+ if (type === 'curMonth') {
42
+ const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
43
+ return [
44
+ `${year}-${month}-01`,
45
+ `${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
46
+ ]
47
+ }
48
+ if (type === 'curDay') {
49
+ return [
50
+ `${year}-${month}-${day}`,
51
+ `${year}-${month}-${day}`,
52
+ ]
53
+ }
54
+ }
55
+ // 兜底返回空字符串数组
56
+ return ['', '']
57
+ }
@@ -1,107 +1,138 @@
1
- <script setup lang="ts">
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 { defineEmits, ref } from 'vue'
5
- import { useRouter } from 'vue-router'
6
-
7
- // 定义事件
8
- const emit = defineEmits(['deleteRow'])
9
- // 访问路由
10
- const router = useRouter()
11
- // 获取默认值
12
- // const idKey = ref('o_id')
13
-
14
- // 简易crud表单测试
15
- const configName = ref('ceshiCRUD')
16
- const serviceName = ref('af-safecheck')
17
-
18
- // 资源权限测试
19
- // const configName = ref('crud_sources_test')
20
- // const serviceName = ref('af-system')
21
-
22
- // 实际业务测试
23
- // const configName = ref('lngChargeAuditMobileCRUD')
24
- // const serviceName = ref('af-gaslink')
25
-
26
- // 跳转到详情页面
27
- // function toDetail(item) {
28
- // router.push({
29
- // name: 'XCellDetailView',
30
- // params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
31
- // query: {
32
- // operName: item[operNameKey.value],
33
- // method:item[methodKey.value],
34
- // requestMethod:item[requestMethodKey.value],
35
- // operatorType:item[operatorTypeKey.value],
36
- // operUrl:item[operUrlKey.value],
37
- // operIp:item[operIpKey.value],
38
- // costTime:item[costTimeKey.value],
39
- // operTime:item[operTimeKey.value],
40
- //
41
- // title: item[titleKey.value],
42
- // businessType: item[businessTypeKey.value],
43
- // status:item[statusKey.value]
44
- // }
45
- // })
46
- // }
47
-
48
- // 跳转到表单——以表单组来渲染纯表单
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
- // }
59
-
60
- // 新增功能
61
- // function addOption(totalCount) {
62
- // router.push({
63
- // name: 'XFormView',
64
- // params: { id: totalCount, openid: totalCount },
65
- // query: {
66
- // configName: configName.value,
67
- // serviceName: serviceName.value,
68
- // mode: '新增',
69
- // },
70
- // })
71
- // }
72
-
73
- // 修改功能
74
- // function updateRow(result) {
75
- // router.push({
76
- // name: 'XFormView',
77
- // params: { id: result.o_id, openid: result.o_id },
78
- // query: {
79
- // configName: configName.value,
80
- // serviceName: serviceName.value,
81
- // mode: '修改',
82
- // },
83
- // })
84
- // }
85
-
86
- // 删除功能
87
- // function deleteRow(result) {
88
- // emit('deleteRow', result.o_id)
89
- // }
90
- // const fixQueryForm = ref({
91
- // f_operator_id: '487184754014158848',
92
- // })
93
- </script>
94
-
95
- <template>
96
- <NormalDataLayout id="XCellListView" title="工作计划">
97
- <template #layout_content>
98
- <XCellList
99
- :config-name="configName"
100
- :service-name="serviceName"
101
- />
102
- </template>
103
- </NormalDataLayout>
104
- </template>
105
-
106
- <style scoped lang="less">
107
- </style>
1
+ <script setup lang="ts">
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
+ import { defineEmits, ref } from 'vue'
6
+ import { useRouter } from 'vue-router'
7
+
8
+ // 定义事件
9
+ 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
+ // 访问路由
18
+ const router = useRouter()
19
+ // 获取默认值
20
+ const idKey = ref('o_id')
21
+
22
+ // 简易crud表单测试
23
+ const configName = ref('lngChargeAuditMobileCRUD')
24
+ const serviceName = ref('af-gaslink')
25
+
26
+ // 资源权限测试
27
+ // const configName = ref('crud_sources_test')
28
+ // const serviceName = ref('af-system')
29
+
30
+ // 实际业务测试
31
+ // const configName = ref('lngChargeAuditMobileCRUD')
32
+ // const serviceName = ref('af-gaslink')
33
+
34
+ // 跳转到详情页面
35
+ // function toDetail(item) {
36
+ // router.push({
37
+ // name: 'XCellDetailView',
38
+ // params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
39
+ // query: {
40
+ // operName: item[operNameKey.value],
41
+ // method:item[methodKey.value],
42
+ // requestMethod:item[requestMethodKey.value],
43
+ // operatorType:item[operatorTypeKey.value],
44
+ // operUrl:item[operUrlKey.value],
45
+ // operIp:item[operIpKey.value],
46
+ // costTime:item[costTimeKey.value],
47
+ // operTime:item[operTimeKey.value],
48
+ //
49
+ // title: item[titleKey.value],
50
+ // businessType: item[businessTypeKey.value],
51
+ // status:item[statusKey.value]
52
+ // }
53
+ // })
54
+ // }
55
+
56
+ // 跳转到表单——以表单组来渲染纯表单
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
+ }
67
+
68
+ // 新增功能
69
+ // function addOption(totalCount) {
70
+ // router.push({
71
+ // name: 'XFormView',
72
+ // params: { id: totalCount, openid: totalCount },
73
+ // query: {
74
+ // configName: configName.value,
75
+ // serviceName: serviceName.value,
76
+ // mode: '新增',
77
+ // },
78
+ // })
79
+ // }
80
+
81
+ // 修改功能
82
+ // function updateRow(result) {
83
+ // router.push({
84
+ // name: 'XFormView',
85
+ // params: { id: result.o_id, openid: result.o_id },
86
+ // query: {
87
+ // configName: configName.value,
88
+ // serviceName: serviceName.value,
89
+ // mode: '修改',
90
+ // },
91
+ // })
92
+ // }
93
+
94
+ // 删除功能
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
+ }
114
+ function emitFunc(func, data) {
115
+ console.log('emitFunc:', func, data)
116
+ }
117
+ </script>
118
+
119
+ <template>
120
+ <NormalDataLayout id="XCellListView" title="工作计划">
121
+ <template #layout_content>
122
+ <XCellList
123
+ config-name="scanCodeAndNFCRUD"
124
+ service-name="af-safecheck"
125
+ :enable-multi-select="true"
126
+ id-key="t_id"
127
+ :multi-select-actions="multiSelectActions"
128
+ @to-detail="toDetail"
129
+ @multi-select-action="handleMultiSelectAction"
130
+ @selection-change="handleSelectionChange"
131
+ @x-form-item-emit-func="emitFunc"
132
+ />
133
+ </template>
134
+ </NormalDataLayout>
135
+ </template>
136
+
137
+ <style scoped lang="less">
138
+ </style>
@@ -1,78 +1,82 @@
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
+ <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,41 +1,46 @@
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
+ <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
+ function emitFunc(func, data) {
22
+ console.log('emitFunc:', func, data)
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
28
+ <template #layout_content>
29
+ <XForm
30
+ ref="formGroupAddConstruction"
31
+ mode="新增"
32
+ :config-name="configName"
33
+ :show-tab-header="false"
34
+ service-name="af-safecheck"
35
+ :is-group-form="true"
36
+ @on-submit="onSubmit"
37
+ @x-form-item-emit-func="emitFunc"
38
+ />
39
+ </template>
40
+ </NormalDataLayout>
41
+ <van-button type="primary" @click="onAsyncSubmit">提交</van-button>
42
+ </template>
43
+
44
+ <style scoped lang="less">
45
+
46
+ </style>
package/.npmignore DELETED
@@ -1,26 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
7
- pnpm-debug.log*
8
- lerna-debug.log*
9
-
10
- node_modules
11
- dist
12
- dist-ssr
13
- *.local
14
- stats.html
15
-
16
- # Editor directories and files
17
- .idea
18
- *.suo
19
- *.ntvs*
20
- *.njsproj
21
- *.sln
22
- *.sw?
23
-
24
- # Misc
25
- .DS_Store
26
- .history