af-mobile-client-vue3 1.3.6 → 1.3.8
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/compress.js +36 -36
- package/package.json +1 -1
- package/src/components/data/XFormItem/index.vue +2 -2
- package/src/router/routes.ts +6 -0
- package/src/services/api/user.ts +17 -0
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/views/component/XCellListView/index.vue +72 -23
- package/src/views/component/XFormGroupView/index.vue +11 -7
- package/src/views/component/XFormGroupView/xformgroup222.vue +97 -0
- package/src/views/component/XFormView/index.vue +2 -2
- package/src/views/user/my/comm/ModifyPassword.vue +346 -0
- package/src/views/user/my/index.vue +1 -0
package/compress.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
|
-
import * as tar from 'tar'
|
|
5
|
-
|
|
6
|
-
// 当前文件所在目录
|
|
7
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
8
|
-
const __dirname = path.dirname(__filename)
|
|
9
|
-
|
|
10
|
-
// 压缩源目录名(即 build 后生成的目录名)
|
|
11
|
-
const outputName = `dist_af-library-mobile-web`
|
|
12
|
-
|
|
13
|
-
// 源目录路径
|
|
14
|
-
const cwd = path.join(__dirname, 'dist', outputName)
|
|
15
|
-
|
|
16
|
-
// 输出 tar.gz 文件路径
|
|
17
|
-
const outputPath = path.join(__dirname, 'dist', `${outputName}.tar.gz`)
|
|
18
|
-
|
|
19
|
-
if (!fs.existsSync(cwd)) {
|
|
20
|
-
console.error('❌ 目录不存在:', cwd)
|
|
21
|
-
// eslint-disable-next-line node/prefer-global/process
|
|
22
|
-
process.exit(1)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
tar.c(
|
|
26
|
-
{
|
|
27
|
-
gzip: true,
|
|
28
|
-
file: outputPath,
|
|
29
|
-
cwd,
|
|
30
|
-
},
|
|
31
|
-
['.'],
|
|
32
|
-
).then(() => {
|
|
33
|
-
console.log(`✅ 压缩完成: ${outputPath}`)
|
|
34
|
-
}).catch((err) => {
|
|
35
|
-
console.error('❌ 压缩失败:', err)
|
|
36
|
-
})
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import * as tar from 'tar'
|
|
5
|
+
|
|
6
|
+
// 当前文件所在目录
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
8
|
+
const __dirname = path.dirname(__filename)
|
|
9
|
+
|
|
10
|
+
// 压缩源目录名(即 build 后生成的目录名)
|
|
11
|
+
const outputName = `dist_af-library-mobile-web`
|
|
12
|
+
|
|
13
|
+
// 源目录路径
|
|
14
|
+
const cwd = path.join(__dirname, 'dist', outputName)
|
|
15
|
+
|
|
16
|
+
// 输出 tar.gz 文件路径
|
|
17
|
+
const outputPath = path.join(__dirname, 'dist', `${outputName}.tar.gz`)
|
|
18
|
+
|
|
19
|
+
if (!fs.existsSync(cwd)) {
|
|
20
|
+
console.error('❌ 目录不存在:', cwd)
|
|
21
|
+
// eslint-disable-next-line node/prefer-global/process
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
tar.c(
|
|
26
|
+
{
|
|
27
|
+
gzip: true,
|
|
28
|
+
file: outputPath,
|
|
29
|
+
cwd,
|
|
30
|
+
},
|
|
31
|
+
['.'],
|
|
32
|
+
).then(() => {
|
|
33
|
+
console.log(`✅ 压缩完成: ${outputPath}`)
|
|
34
|
+
}).catch((err) => {
|
|
35
|
+
console.error('❌ 压缩失败:', err)
|
|
36
|
+
})
|
package/package.json
CHANGED
|
@@ -1203,7 +1203,7 @@ function findOptionInTree(options, value) {
|
|
|
1203
1203
|
:label-align="labelAlign"
|
|
1204
1204
|
:input-align="attr.inputAlign ? attr.inputAlign : 'left'"
|
|
1205
1205
|
:type="attr.type as FieldType"
|
|
1206
|
-
:readonly="readonly
|
|
1206
|
+
:readonly="readonly"
|
|
1207
1207
|
:disabled="attr.disabled"
|
|
1208
1208
|
:placeholder="placeholder"
|
|
1209
1209
|
:error-message="errorMessage"
|
|
@@ -1215,7 +1215,7 @@ function findOptionInTree(options, value) {
|
|
|
1215
1215
|
<template #input>
|
|
1216
1216
|
<input
|
|
1217
1217
|
:value="modelData"
|
|
1218
|
-
:readonly="readonly
|
|
1218
|
+
:readonly="readonly"
|
|
1219
1219
|
class="van-field__control"
|
|
1220
1220
|
:placeholder="placeholder"
|
|
1221
1221
|
style="flex: 1; min-width: 0;"
|
package/src/router/routes.ts
CHANGED
|
@@ -10,6 +10,7 @@ import XCellDetailView from '@af-mobile-client-vue3/views/component/XCellDetailV
|
|
|
10
10
|
import XCellListView from '@af-mobile-client-vue3/views/component/XCellListView/index.vue'
|
|
11
11
|
import XFormAppraiseView from '@af-mobile-client-vue3/views/component/XFormAppraiseView/index.vue'
|
|
12
12
|
import XFormGroupView from '@af-mobile-client-vue3/views/component/XFormGroupView/index.vue'
|
|
13
|
+
import xformgroup222 from '@af-mobile-client-vue3/views/component/XFormGroupView/xformgroup222.vue'
|
|
13
14
|
import XFormView from '@af-mobile-client-vue3/views/component/XFormView/index.vue'
|
|
14
15
|
import XOlMapView from '@af-mobile-client-vue3/views/component/XOlMapView/index.vue'
|
|
15
16
|
import XLocationPicker from '@af-mobile-client-vue3/views/component/XOlMapView/XLocationPicker/index.vue'
|
|
@@ -66,6 +67,11 @@ const routes: Array<RouteRecordRaw> = [
|
|
|
66
67
|
name: 'XCellDetailView',
|
|
67
68
|
component: XCellDetailView,
|
|
68
69
|
},
|
|
70
|
+
{
|
|
71
|
+
path: '/xformgroup222',
|
|
72
|
+
name: 'xformgroup222',
|
|
73
|
+
component: xformgroup222,
|
|
74
|
+
},
|
|
69
75
|
{
|
|
70
76
|
path: '/Component/XFormGroupView',
|
|
71
77
|
name: 'XFormGroupView',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { post } from '@af-mobile-client-vue3/services/restTools'
|
|
2
|
+
|
|
3
|
+
const userApi = {
|
|
4
|
+
// 修改密码
|
|
5
|
+
modifyPassword: '/af-system/user/modifypwd',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 修改密码
|
|
10
|
+
* @param data 修改密码参数
|
|
11
|
+
* @returns Promise
|
|
12
|
+
*/
|
|
13
|
+
export function modifyPassword(data: any) {
|
|
14
|
+
return post(userApi.modifyPassword, JSON.stringify(data))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { userApi }
|
|
@@ -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,19 +1,26 @@
|
|
|
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'
|
|
4
5
|
import { defineEmits, ref } from 'vue'
|
|
5
6
|
import { useRouter } from 'vue-router'
|
|
6
7
|
|
|
7
8
|
// 定义事件
|
|
8
9
|
const emit = defineEmits(['deleteRow'])
|
|
10
|
+
const userInfo = useUserStore().getUserInfo()
|
|
9
11
|
// 访问路由
|
|
10
12
|
const router = useRouter()
|
|
11
13
|
// 获取默认值
|
|
12
14
|
const idKey = ref('o_id')
|
|
13
15
|
|
|
14
16
|
// 简易crud表单测试
|
|
15
|
-
const configName = ref('
|
|
17
|
+
// const configName = ref('orderCarInMobileCRUD')
|
|
18
|
+
// const serviceName = ref('af-gaslink')
|
|
19
|
+
// const configName = ref('lngPriceManageMobileCRUD')
|
|
20
|
+
const configName = ref('测试2')
|
|
16
21
|
const serviceName = ref('af-gaslink')
|
|
22
|
+
// const configName = ref('mobile_liushuiQueryCRUD')
|
|
23
|
+
// const serviceName = ref('af-revenue')
|
|
17
24
|
|
|
18
25
|
// 资源权限测试
|
|
19
26
|
// const configName = ref('crud_sources_test')
|
|
@@ -48,12 +55,12 @@ const serviceName = ref('af-gaslink')
|
|
|
48
55
|
// 跳转到表单——以表单组来渲染纯表单
|
|
49
56
|
function toDetail(item) {
|
|
50
57
|
router.push({
|
|
51
|
-
name: '
|
|
52
|
-
query: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
58
|
+
name: 'xformgroup222',
|
|
59
|
+
// query: {
|
|
60
|
+
// id: item[idKey.value],
|
|
61
|
+
// id: item.rr_id,
|
|
62
|
+
// o_id: item.o_id,
|
|
63
|
+
// },
|
|
57
64
|
})
|
|
58
65
|
}
|
|
59
66
|
|
|
@@ -69,19 +76,36 @@ function toDetail(item) {
|
|
|
69
76
|
// },
|
|
70
77
|
// })
|
|
71
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
|
+
// },
|
|
89
|
+
})
|
|
90
|
+
// 如果存在回调函数,调用它并传递true表示已处理
|
|
91
|
+
// if (typeof callback === 'function') {
|
|
92
|
+
// callback(true)
|
|
93
|
+
// }
|
|
94
|
+
}
|
|
72
95
|
|
|
73
96
|
// 修改功能
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
+
}
|
|
85
109
|
|
|
86
110
|
// 删除功能
|
|
87
111
|
function deleteRow(result) {
|
|
@@ -92,13 +116,38 @@ function deleteRow(result) {
|
|
|
92
116
|
<template>
|
|
93
117
|
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
94
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
|
+
<!-- /> -->
|
|
95
145
|
<XCellList
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
:
|
|
99
|
-
:id-key="idKey"
|
|
146
|
+
service-name="af-apply"
|
|
147
|
+
config-name="ApplyMobileProcessCRUD"
|
|
148
|
+
:custom-add="true"
|
|
100
149
|
@to-detail="toDetail"
|
|
101
|
-
@
|
|
150
|
+
@add="addOption"
|
|
102
151
|
/>
|
|
103
152
|
</template>
|
|
104
153
|
</NormalDataLayout>
|
|
@@ -5,16 +5,19 @@ 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
|
+
|
|
8
11
|
// 纯表单
|
|
9
|
-
const configName = ref('form_check_test')
|
|
10
|
-
const serviceName = ref('af-system')
|
|
12
|
+
// const configName = ref('form_check_test')
|
|
13
|
+
// const serviceName = ref('af-system')
|
|
11
14
|
|
|
12
15
|
// const configName = ref("计划下发Form")
|
|
13
16
|
// const serviceName = ref("af-linepatrol")
|
|
14
17
|
|
|
15
18
|
// 表单组
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const configName = ref('lngChargeAuditMobileFormGroup')
|
|
20
|
+
const serviceName = ref('af-gaslink')
|
|
18
21
|
|
|
19
22
|
const formData = ref({})
|
|
20
23
|
const formGroup = ref(null)
|
|
@@ -22,7 +25,8 @@ const route = useRoute()
|
|
|
22
25
|
const isInit = ref(false)
|
|
23
26
|
function submit(_result) {
|
|
24
27
|
showDialog({ message: '提交成功' }).then(() => {
|
|
25
|
-
|
|
28
|
+
console.log('12121')
|
|
29
|
+
// history.back()
|
|
26
30
|
})
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -63,8 +67,8 @@ function submit(_result) {
|
|
|
63
67
|
<!-- v-if="isInit" -->
|
|
64
68
|
<XFormGroup
|
|
65
69
|
ref="formGroup"
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
config-name="ApplyAddContractFormGroup"
|
|
71
|
+
service-name="af-apply"
|
|
68
72
|
:group-form-data="formData"
|
|
69
73
|
mode="新增"
|
|
70
74
|
@submit="submit"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
|
|
3
|
+
import { runLogic } from '@af-mobile-client-vue3/services/api/common'
|
|
4
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
5
|
+
import dayjs from 'dayjs/esm/index'
|
|
6
|
+
import { showToast } from 'vant'
|
|
7
|
+
import { onMounted, ref } from 'vue'
|
|
8
|
+
import { useRoute } from 'vue-router'
|
|
9
|
+
|
|
10
|
+
const configName = ref('appapplyuserinfoFormGroup')
|
|
11
|
+
const serviceName = ref('af-apply')
|
|
12
|
+
const route = useRoute()
|
|
13
|
+
const userInfo = useUserStore().getUserInfo()
|
|
14
|
+
const workflowId = ref('3045')
|
|
15
|
+
const userinfoid = ref('93116')
|
|
16
|
+
const model = ref('编辑')
|
|
17
|
+
const groupFormData = ref({})
|
|
18
|
+
|
|
19
|
+
function submit(res) {
|
|
20
|
+
if (model.value === '新增') {
|
|
21
|
+
res.t_userinfo.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
22
|
+
res.t_userinfo.f_orgid = userInfo.f_orgid
|
|
23
|
+
res.t_userinfo.f_orgname = userInfo.f_orgname
|
|
24
|
+
res.t_userinfo.f_depid = userInfo.f_depid
|
|
25
|
+
res.t_userinfo.f_depname = userInfo.f_depname
|
|
26
|
+
res.t_userinfo.f_operatorid = userInfo.f_operatorid
|
|
27
|
+
res.t_userinfo.f_operator = userInfo.f_operator
|
|
28
|
+
res.t_userinfo.f_workflow_id = this.f_workflow_id
|
|
29
|
+
res.t_userinfo.f_user_state = '预备'
|
|
30
|
+
|
|
31
|
+
res.t_userfiles.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
32
|
+
res.t_userfiles.f_orgid = userInfo.f_orgid
|
|
33
|
+
res.t_userfiles.f_orgname = userInfo.f_orgname
|
|
34
|
+
res.t_userfiles.f_depid = userInfo.f_depid
|
|
35
|
+
res.t_userfiles.f_depname = userInfo.f_depname
|
|
36
|
+
res.t_userfiles.f_operatorid = userInfo.f_operatorid
|
|
37
|
+
res.t_userfiles.f_operator = userInfo.f_operator
|
|
38
|
+
res.t_userfiles.f_workflow_id = this.f_workflow_id
|
|
39
|
+
res.t_userfiles.f_table_state = '待开通'
|
|
40
|
+
}
|
|
41
|
+
let saveData = res
|
|
42
|
+
if (saveData.t_userfiles.f_gasbrand_id.length > 0) {
|
|
43
|
+
saveData.t_userfiles.f_gasbrand_id = saveData.t_userfiles.f_gasbrand_id[0]
|
|
44
|
+
}
|
|
45
|
+
if (saveData.t_userfiles.f_price_id.length > 0) {
|
|
46
|
+
saveData.t_userfiles.f_price_id = saveData.t_userfiles.f_price_id[0]
|
|
47
|
+
}
|
|
48
|
+
if (model.value === '编辑') {
|
|
49
|
+
saveData = Object.assign(saveData, {
|
|
50
|
+
f_operator_record: userInfo.f_operator,
|
|
51
|
+
f_operatorid_record: userInfo.f_operatorid,
|
|
52
|
+
f_orgid_record: userInfo.f_orgid,
|
|
53
|
+
f_orgname_record: userInfo.f_orgname,
|
|
54
|
+
f_depid_record: userInfo.f_depid,
|
|
55
|
+
f_depname_record: userInfo.f_depname,
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
runLogic('userFIleSaveLogic', saveData, 'af-revenue').then((res) => {
|
|
59
|
+
showToast('操作成功!')
|
|
60
|
+
history.back()
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
const isInit = ref(false)
|
|
64
|
+
function init() {
|
|
65
|
+
if (model.value === '编辑') {
|
|
66
|
+
runLogic('getFileDetailForEdit', { f_userinfo_id: userinfoid.value }, 'af-revenue').then((res) => {
|
|
67
|
+
// if (res.t_userfiles.f_gasmodel_id) {
|
|
68
|
+
// res.t_userfiles.f_gasmodel_id = 76
|
|
69
|
+
// }
|
|
70
|
+
// if (res.t_userfiles.f_price_id) {
|
|
71
|
+
// res.t_userfiles.f_price_id = [res.t_userfiles.f_price_id]
|
|
72
|
+
// }
|
|
73
|
+
console.log('1111111----,', res)
|
|
74
|
+
groupFormData.value = res
|
|
75
|
+
isInit.value = true
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
init()
|
|
81
|
+
})
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<XFormGroup
|
|
86
|
+
v-if="isInit"
|
|
87
|
+
mode="修改"
|
|
88
|
+
:config-name="configName"
|
|
89
|
+
:service-name="serviceName"
|
|
90
|
+
:group-form-data="groupFormData"
|
|
91
|
+
@submit="submit"
|
|
92
|
+
/>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<style scoped lang="less">
|
|
96
|
+
|
|
97
|
+
</style>
|
|
@@ -3,8 +3,8 @@ import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
|
3
3
|
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
4
|
import { ref } from 'vue'
|
|
5
5
|
|
|
6
|
-
const configName = ref('
|
|
7
|
-
const serviceName = ref('af-
|
|
6
|
+
const configName = ref('addappapplychargeForm')
|
|
7
|
+
const serviceName = ref('af-apply')
|
|
8
8
|
|
|
9
9
|
const formGroupAddConstruction = ref(null)
|
|
10
10
|
</script>
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { modifyPassword } from '@af-mobile-client-vue3/services/api/user'
|
|
3
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
4
|
+
import { showDialog, showToast, Button as vanButton, Field as vanField, Form as vanForm, Icon as vanIcon, Popup as vanPopup } from 'vant'
|
|
5
|
+
import { reactive, ref, watch } from 'vue'
|
|
6
|
+
import { useRouter } from 'vue-router'
|
|
7
|
+
|
|
8
|
+
// 定义 props 和 emits
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
visible: boolean
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const emit = defineEmits<{
|
|
14
|
+
(event: 'update:visible', value: boolean): void
|
|
15
|
+
}>()
|
|
16
|
+
|
|
17
|
+
const router = useRouter()
|
|
18
|
+
const userStore = useUserStore()
|
|
19
|
+
|
|
20
|
+
// 表单引用
|
|
21
|
+
const formRef = ref()
|
|
22
|
+
|
|
23
|
+
// 表单数据
|
|
24
|
+
const formData = reactive({
|
|
25
|
+
oldPassword: '',
|
|
26
|
+
newPassword: '',
|
|
27
|
+
confirmPassword: '',
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
// 密码显示状态
|
|
31
|
+
const showOldPassword = ref(false)
|
|
32
|
+
const showNewPassword = ref(false)
|
|
33
|
+
const showConfirmPassword = ref(false)
|
|
34
|
+
|
|
35
|
+
// 加载状态
|
|
36
|
+
const loading = ref(false)
|
|
37
|
+
|
|
38
|
+
// 密码强度验证正则
|
|
39
|
+
const strongPasswordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/
|
|
40
|
+
|
|
41
|
+
// 验证密码强度
|
|
42
|
+
function validatePasswordStrength(password: string): boolean {
|
|
43
|
+
return strongPasswordRegex.test(password)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 验证确认密码
|
|
47
|
+
function validateConfirmPassword(value: string): boolean {
|
|
48
|
+
return value === formData.newPassword
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 表单验证规则
|
|
52
|
+
const rules = {
|
|
53
|
+
oldPassword: [
|
|
54
|
+
{ required: true, message: '请输入旧密码' },
|
|
55
|
+
],
|
|
56
|
+
newPassword: [
|
|
57
|
+
{ required: true, message: '请输入新密码' },
|
|
58
|
+
{
|
|
59
|
+
validator: (value: string) => {
|
|
60
|
+
if (value && !validatePasswordStrength(value)) {
|
|
61
|
+
return '新密码必须包含大小写字母、数字和特殊字符,且长度不少于8位'
|
|
62
|
+
}
|
|
63
|
+
return true
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
confirmPassword: [
|
|
68
|
+
{ required: true, message: '请再次输入新密码' },
|
|
69
|
+
{
|
|
70
|
+
validator: (value: string) => {
|
|
71
|
+
if (value && !validateConfirmPassword(value)) {
|
|
72
|
+
return '两次密码输入不一致'
|
|
73
|
+
}
|
|
74
|
+
return true
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// 提交表单
|
|
81
|
+
async function handleSubmit() {
|
|
82
|
+
try {
|
|
83
|
+
loading.value = true
|
|
84
|
+
|
|
85
|
+
// 验证表单
|
|
86
|
+
await formRef.value?.validate()
|
|
87
|
+
|
|
88
|
+
// 调用修改密码API
|
|
89
|
+
const result = await handleModifyPassword({ data: {
|
|
90
|
+
ename: userStore.getUserInfo().username,
|
|
91
|
+
password: formData.oldPassword,
|
|
92
|
+
newpassword: formData.newPassword,
|
|
93
|
+
affirmpassword: formData.confirmPassword,
|
|
94
|
+
} })
|
|
95
|
+
if (result.success) {
|
|
96
|
+
showDialog({
|
|
97
|
+
title: '成功',
|
|
98
|
+
message: '修改密码成功,请重新登录',
|
|
99
|
+
confirmButtonText: '立即重新登录',
|
|
100
|
+
}).then(() => {
|
|
101
|
+
// 退出登录
|
|
102
|
+
userStore.logout()
|
|
103
|
+
// 跳转到登录页
|
|
104
|
+
router.push('/login')
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
showToast(result.message || '修改密码失败')
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.error('修改密码失败:', error)
|
|
113
|
+
showToast('修改密码失败,请检查输入信息')
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
loading.value = false
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// 关闭弹窗
|
|
121
|
+
function closeModal() {
|
|
122
|
+
emit('update:visible', false)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// 修改密码API调用
|
|
126
|
+
async function handleModifyPassword(data: any) {
|
|
127
|
+
try {
|
|
128
|
+
const res = await modifyPassword(data)
|
|
129
|
+
if (res && res === 'true') {
|
|
130
|
+
return {
|
|
131
|
+
success: true,
|
|
132
|
+
message: '修改成功',
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return {
|
|
137
|
+
success: false,
|
|
138
|
+
message: '修改密码失败,请检查原始密码是否正确!',
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch (error: any) {
|
|
143
|
+
return {
|
|
144
|
+
success: false,
|
|
145
|
+
message: error?.message || '修改密码失败',
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// 监听visible变化,重置表单
|
|
151
|
+
watch(() => props.visible, (newVal) => {
|
|
152
|
+
if (!newVal) {
|
|
153
|
+
// 弹窗关闭时重置表单
|
|
154
|
+
formData.oldPassword = ''
|
|
155
|
+
formData.newPassword = ''
|
|
156
|
+
formData.confirmPassword = ''
|
|
157
|
+
showOldPassword.value = false
|
|
158
|
+
showNewPassword.value = false
|
|
159
|
+
showConfirmPassword.value = false
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
<template>
|
|
165
|
+
<van-popup
|
|
166
|
+
:show="props.visible"
|
|
167
|
+
position="center"
|
|
168
|
+
:close-on-click-overlay="false"
|
|
169
|
+
round
|
|
170
|
+
class="modify-password-popup"
|
|
171
|
+
@update:show="emit('update:visible', $event)"
|
|
172
|
+
>
|
|
173
|
+
<div class="popup-content">
|
|
174
|
+
<!-- 标题 -->
|
|
175
|
+
<div class="popup-header">
|
|
176
|
+
<h3 class="popup-title">
|
|
177
|
+
修改密码
|
|
178
|
+
</h3>
|
|
179
|
+
<van-icon name="cross" class="close-icon" @click="closeModal" />
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<!-- 表单 -->
|
|
183
|
+
<van-form ref="formRef" class="password-form" @submit="handleSubmit">
|
|
184
|
+
<!-- 旧密码 -->
|
|
185
|
+
<van-field
|
|
186
|
+
v-model="formData.oldPassword"
|
|
187
|
+
name="oldPassword"
|
|
188
|
+
label="旧密码"
|
|
189
|
+
placeholder="请输入旧密码"
|
|
190
|
+
:type="showOldPassword ? 'text' : 'password'"
|
|
191
|
+
:rules="rules.oldPassword"
|
|
192
|
+
@click-right-icon="showOldPassword = !showOldPassword"
|
|
193
|
+
>
|
|
194
|
+
<template #right-icon>
|
|
195
|
+
<van-icon
|
|
196
|
+
:name="showOldPassword ? 'eye-o' : 'closed-eye'"
|
|
197
|
+
color="#666"
|
|
198
|
+
/>
|
|
199
|
+
</template>
|
|
200
|
+
</van-field>
|
|
201
|
+
|
|
202
|
+
<!-- 新密码 -->
|
|
203
|
+
<van-field
|
|
204
|
+
v-model="formData.newPassword"
|
|
205
|
+
name="newPassword"
|
|
206
|
+
label="新密码"
|
|
207
|
+
placeholder="请输入新密码"
|
|
208
|
+
:type="showNewPassword ? 'text' : 'password'"
|
|
209
|
+
:rules="rules.newPassword"
|
|
210
|
+
@click-right-icon="showNewPassword = !showNewPassword"
|
|
211
|
+
>
|
|
212
|
+
<template #right-icon>
|
|
213
|
+
<van-icon
|
|
214
|
+
:name="showNewPassword ? 'eye-o' : 'closed-eye'"
|
|
215
|
+
color="#666"
|
|
216
|
+
/>
|
|
217
|
+
</template>
|
|
218
|
+
</van-field>
|
|
219
|
+
|
|
220
|
+
<!-- 确认新密码 -->
|
|
221
|
+
<van-field
|
|
222
|
+
v-model="formData.confirmPassword"
|
|
223
|
+
name="confirmPassword"
|
|
224
|
+
label="确认新密码"
|
|
225
|
+
placeholder="请再次输入新密码"
|
|
226
|
+
:type="showConfirmPassword ? 'text' : 'password'"
|
|
227
|
+
:rules="rules.confirmPassword"
|
|
228
|
+
@click-right-icon="showConfirmPassword = !showConfirmPassword"
|
|
229
|
+
>
|
|
230
|
+
<template #right-icon>
|
|
231
|
+
<van-icon
|
|
232
|
+
:name="showConfirmPassword ? 'eye-o' : 'closed-eye'"
|
|
233
|
+
color="#666"
|
|
234
|
+
/>
|
|
235
|
+
</template>
|
|
236
|
+
</van-field>
|
|
237
|
+
|
|
238
|
+
<!-- 按钮组 -->
|
|
239
|
+
<div class="form-buttons">
|
|
240
|
+
<van-button
|
|
241
|
+
plain
|
|
242
|
+
type="default"
|
|
243
|
+
size="large"
|
|
244
|
+
class="cancel-btn"
|
|
245
|
+
@click="closeModal"
|
|
246
|
+
>
|
|
247
|
+
取消
|
|
248
|
+
</van-button>
|
|
249
|
+
<van-button
|
|
250
|
+
type="primary"
|
|
251
|
+
size="large"
|
|
252
|
+
native-type="submit"
|
|
253
|
+
:loading="loading"
|
|
254
|
+
class="submit-btn"
|
|
255
|
+
>
|
|
256
|
+
确认修改
|
|
257
|
+
</van-button>
|
|
258
|
+
</div>
|
|
259
|
+
</van-form>
|
|
260
|
+
</div>
|
|
261
|
+
</van-popup>
|
|
262
|
+
</template>
|
|
263
|
+
|
|
264
|
+
<style scoped lang="less">
|
|
265
|
+
.modify-password-popup {
|
|
266
|
+
width: 90%;
|
|
267
|
+
max-width: 400px;
|
|
268
|
+
|
|
269
|
+
.popup-content {
|
|
270
|
+
padding: 20px;
|
|
271
|
+
|
|
272
|
+
.popup-header {
|
|
273
|
+
display: flex;
|
|
274
|
+
justify-content: space-between;
|
|
275
|
+
align-items: center;
|
|
276
|
+
margin-bottom: 20px;
|
|
277
|
+
|
|
278
|
+
.popup-title {
|
|
279
|
+
font-size: 18px;
|
|
280
|
+
font-weight: 600;
|
|
281
|
+
color: #333;
|
|
282
|
+
margin: 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.close-icon {
|
|
286
|
+
font-size: 20px;
|
|
287
|
+
color: #999;
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
padding: 4px;
|
|
290
|
+
|
|
291
|
+
&:hover {
|
|
292
|
+
color: #666;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.password-form {
|
|
298
|
+
.form-buttons {
|
|
299
|
+
display: flex;
|
|
300
|
+
gap: 12px;
|
|
301
|
+
margin-top: 24px;
|
|
302
|
+
|
|
303
|
+
.cancel-btn,
|
|
304
|
+
.submit-btn {
|
|
305
|
+
flex: 1;
|
|
306
|
+
height: 44px;
|
|
307
|
+
border-radius: 8px;
|
|
308
|
+
font-size: 16px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.cancel-btn {
|
|
312
|
+
border-color: #ddd;
|
|
313
|
+
color: #666;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.submit-btn {
|
|
317
|
+
background-color: #3b82f6;
|
|
318
|
+
border-color: #3b82f6;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// 覆盖vant默认样式
|
|
326
|
+
:deep(.van-field) {
|
|
327
|
+
padding: 12px 0;
|
|
328
|
+
|
|
329
|
+
.van-field__label {
|
|
330
|
+
color: #333;
|
|
331
|
+
font-weight: 500;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.van-field__control {
|
|
335
|
+
color: #333;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.van-field__right-icon {
|
|
339
|
+
padding: 4px;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
:deep(.van-popup) {
|
|
344
|
+
border-radius: 12px;
|
|
345
|
+
}
|
|
346
|
+
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import useSettingStore from '@af-mobile-client-vue3/stores/modules/setting'
|
|
3
3
|
import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
|
|
4
|
+
import { Dialog as vanDialog, Icon as vanIcon } from 'vant'
|
|
4
5
|
import { ref } from 'vue'
|
|
5
6
|
import { useRouter } from 'vue-router'
|
|
6
7
|
import ModifyPassword from './comm/ModifyPassword.vue'
|