af-mobile-client-vue3 1.2.57 → 1.3.1
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/.editorconfig +5 -34
- package/.env +1 -1
- package/.env.development +0 -3
- package/.env.production +1 -7
- package/build/vite/index.ts +2 -12
- package/build/vite/optimize.ts +2 -2
- package/compress.js +36 -0
- package/package.json +114 -114
- package/src/App.vue +3 -5
- package/src/assets/img/banner/appraise-banner-1.png +0 -0
- package/src/assets/img/banner/appraise-banner-2.png +0 -0
- package/src/components/core/BeautifulLoading/index.vue +1 -2
- package/src/components/core/ImageUploader/index.vue +3 -2
- package/src/components/core/NavBar/index.vue +23 -13
- package/src/components/core/Tabbar/index.vue +5 -3
- package/src/components/data/XBadge/index.vue +2 -2
- package/src/components/data/XCellList/index.vue +20 -66
- package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
- package/src/components/data/XFormGroup/doc/FormGroupDemo.vue +4 -4
- package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
- package/src/components/data/XFormGroup/index.vue +11 -1
- package/src/components/data/XFormItem/index.vue +2 -22
- package/src/components/data/XReportForm/XReportFormJsonRender.vue +22 -22
- package/src/components/data/XReportForm/index.vue +23 -14
- package/src/components/data/XReportGrid/XAddReport/XAddReport.vue +1 -2
- package/src/components/data/XReportGrid/XReport.vue +3 -3
- package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
- package/src/components/data/XReportGrid/XReportDesign.vue +13 -13
- package/src/components/data/XReportGrid/XReportDrawer/XReportDrawer.vue +1 -1
- package/src/components/data/XReportGrid/XReportJsonRender.vue +11 -11
- package/src/components/data/XReportGrid/XReportTrGroup.vue +3 -3
- package/src/components/data/XReportGrid/print.js +184 -184
- package/src/components/layout/NormalDataLayout/index.vue +2 -3
- package/src/config/routes.ts +6 -2
- package/src/constants/index.ts +2 -0
- package/src/locales/en-US.json +52 -28
- package/src/locales/zh-CN.json +57 -33
- package/src/main.ts +0 -2
- package/src/router/types.ts +0 -2
- package/src/types/vue-router.d.ts +0 -2
- package/src/utils/mobileUtil.ts +2 -2
- package/src/utils/set-page-title.ts +3 -5
- package/src/views/common/LoadError.vue +1 -2
- package/src/views/common/NotFound.vue +2 -3
- package/src/views/component/XCellListView/index.vue +94 -133
- package/src/views/component/XFormGroupView/index.vue +7 -16
- package/src/views/component/XFormView/index.vue +15 -95
- package/src/views/user/login/LoginForm.vue +3 -3
- package/tsconfig.json +5 -8
- package/uno.config.ts +32 -1
- package/vite.config.ts +3 -3
- package/.env.envoiceShow +0 -7
- package/src/components/core/App/MicroAppView.vue +0 -59
- package/src/components/core/SvgIcon/index.vue +0 -61
- package/src/utils/local-storage.ts +0 -9
package/src/locales/zh-CN.json
CHANGED
|
@@ -1,29 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
2
|
+
"navbar": {
|
|
3
|
+
"Home": "主页",
|
|
4
|
+
"Profile": "我的",
|
|
5
|
+
"Mock": "🗂️ Mock",
|
|
6
|
+
"Charts": "📊 图表",
|
|
7
|
+
"UnoCSS": "⚡ UnoCSS",
|
|
8
|
+
"Counter": "🍍 状态持久化",
|
|
9
|
+
"KeepAlive": "♻️ 页面缓存",
|
|
10
|
+
"ScrollCache": "📍 滚动缓存",
|
|
11
|
+
"Login": "🧑💻 登录",
|
|
12
|
+
"Register": "🧑💻 注册",
|
|
13
|
+
"ForgotPassword": "❓ 忘记密码",
|
|
14
|
+
"Settings": "⚙️ 设置",
|
|
15
|
+
"404": "⚠️ 404 页面",
|
|
16
|
+
"Undefined": "🤷 未定义标题"
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
"tabbar": {
|
|
20
|
+
"home": "首页",
|
|
21
|
+
"profile": "我的"
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
"home": {
|
|
25
|
+
"darkMode": "🌗 深色模式",
|
|
26
|
+
"language": "📚 多语言",
|
|
27
|
+
"settings": "设置",
|
|
28
|
+
"examples": "示例"
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
"profile": {
|
|
32
|
+
"login": "登录",
|
|
16
33
|
"settings": "设置",
|
|
17
|
-
"
|
|
18
|
-
"exampleComponents": "示例组件",
|
|
19
|
-
"forgot-password": "忘记密码"
|
|
34
|
+
"docs": "文档"
|
|
20
35
|
},
|
|
36
|
+
|
|
21
37
|
"mock": {
|
|
22
38
|
"fromAsyncData": "来自异步请求的数据",
|
|
39
|
+
"noData": "暂无数据",
|
|
23
40
|
"pull": "请求",
|
|
24
|
-
"reset": "清空"
|
|
25
|
-
"noData": "暂无数据"
|
|
41
|
+
"reset": "清空"
|
|
26
42
|
},
|
|
43
|
+
|
|
27
44
|
"charts": {
|
|
28
45
|
"January": "1月",
|
|
29
46
|
"February": "2月",
|
|
@@ -32,39 +49,44 @@
|
|
|
32
49
|
"May": "5月",
|
|
33
50
|
"June": "6月"
|
|
34
51
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
52
|
+
|
|
53
|
+
"counter": {
|
|
54
|
+
"description": "该计数器的状态通过 Pinia 持久化。刷新页面试试看!"
|
|
38
55
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
56
|
+
|
|
57
|
+
"unocss": {
|
|
58
|
+
"title": "你好, Unocss!",
|
|
59
|
+
"description": "这是一个简单的 Unocss 使用示例。",
|
|
60
|
+
"button": "按钮"
|
|
43
61
|
},
|
|
62
|
+
|
|
44
63
|
"keepAlive": {
|
|
45
64
|
"label": "当前组件将会被缓存"
|
|
46
65
|
},
|
|
66
|
+
|
|
47
67
|
"scrollCache": {
|
|
48
68
|
"sectionTitle": "段落标题",
|
|
49
69
|
"sectionText": "段落内容段落内容段落内容段落内容段落内容段落内容",
|
|
50
70
|
"finished": "已经到底啦 ~",
|
|
51
71
|
"loading": "加载中..."
|
|
52
72
|
},
|
|
73
|
+
|
|
53
74
|
"login": {
|
|
54
75
|
"login": "登录",
|
|
55
|
-
"logout": "
|
|
76
|
+
"logout": "退出登录",
|
|
56
77
|
"email": "邮箱",
|
|
57
78
|
"password": "密码",
|
|
58
79
|
"pleaseEnterEmail": "请输入邮箱",
|
|
59
80
|
"pleaseEnterPassword": "请输入密码",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
81
|
+
"signUp": "还没有账号?点击注册",
|
|
82
|
+
"forgotPassword": "忘记密码?"
|
|
62
83
|
},
|
|
63
|
-
|
|
84
|
+
|
|
85
|
+
"forgotPassword": {
|
|
64
86
|
"email": "邮箱",
|
|
65
87
|
"code": "验证码",
|
|
66
88
|
"password": "密码",
|
|
67
|
-
"
|
|
89
|
+
"confirmPassword": "再次输入密码",
|
|
68
90
|
"pleaseEnterEmail": "请输入邮箱",
|
|
69
91
|
"pleaseEnterCode": "请输入验证码",
|
|
70
92
|
"pleaseEnterPassword": "请输入密码",
|
|
@@ -77,12 +99,13 @@
|
|
|
77
99
|
"sendCodeSuccess": "已发送,验证码为",
|
|
78
100
|
"passwordResetSuccess": "密码重置成功"
|
|
79
101
|
},
|
|
102
|
+
|
|
80
103
|
"register": {
|
|
81
104
|
"email": "邮箱",
|
|
82
105
|
"code": "验证码",
|
|
83
106
|
"nickname": "昵称",
|
|
84
107
|
"password": "密码",
|
|
85
|
-
"
|
|
108
|
+
"confirmPassword": "再次输入密码",
|
|
86
109
|
"pleaseEnterEmail": "请输入邮箱",
|
|
87
110
|
"pleaseEnterCode": "请输入验证码",
|
|
88
111
|
"pleaseEnterNickname": "请输入昵称",
|
|
@@ -96,9 +119,10 @@
|
|
|
96
119
|
"sendCodeSuccess": "已发送,验证码为",
|
|
97
120
|
"registerSuccess": "注册成功"
|
|
98
121
|
},
|
|
122
|
+
|
|
99
123
|
"settings": {
|
|
100
124
|
"logout": "退出登录",
|
|
101
125
|
"currentVersion": "当前版本",
|
|
102
|
-
"
|
|
126
|
+
"confirmTitle": "确认退出?"
|
|
103
127
|
}
|
|
104
128
|
}
|
package/src/main.ts
CHANGED
package/src/router/types.ts
CHANGED
package/src/utils/mobileUtil.ts
CHANGED
|
@@ -21,9 +21,9 @@ export class mobileUtil {
|
|
|
21
21
|
static execute(locationParam: Param): any {
|
|
22
22
|
locationParam.callBackMethodName = `mobile_func_${Math.random().toString(36).substring(7)}`
|
|
23
23
|
if (window.__MICRO_APP_ENVIRONMENT__) {
|
|
24
|
-
console.warn('我在微前端环境中')
|
|
24
|
+
console.warn('我在微前端环境中');
|
|
25
25
|
// 微前端应用中需要绑定函数到真实的window中
|
|
26
|
-
window.rawWindow[locationParam.callBackMethodName] = locationParam.callbackFunc
|
|
26
|
+
(window as any).rawWindow[locationParam.callBackMethodName] = locationParam.callbackFunc
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
console.warn('我不在微前端环境中')
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { appName } from '../constants'
|
|
2
2
|
|
|
3
|
-
export default function setPageTitle(
|
|
4
|
-
window.document.title =
|
|
5
|
-
? `${routerTitle} | ${pageDefaultTitle}`
|
|
6
|
-
: `${pageDefaultTitle}`
|
|
3
|
+
export default function setPageTitle(title?: string): void {
|
|
4
|
+
window.document.title = title ? `${title} - ${appName}` : appName
|
|
7
5
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import SvgIcon from '@af-mobile-client-vue3/components/core/SvgIcon/index.vue'
|
|
3
2
|
</script>
|
|
4
3
|
|
|
5
4
|
<template>
|
|
6
5
|
<div class="load_error_main">
|
|
7
6
|
<div class="container">
|
|
8
|
-
<
|
|
7
|
+
<div class="loadError i-svg:loadError" />
|
|
9
8
|
</div>
|
|
10
9
|
<div class="text">
|
|
11
10
|
似乎出了点问题,下拉再试试
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import SvgIcon from '@af-mobile-client-vue3/components/core/SvgIcon/index.vue'
|
|
3
2
|
import { Button as VanButton } from 'vant'
|
|
4
3
|
</script>
|
|
5
4
|
|
|
6
5
|
<template>
|
|
7
6
|
<div class="not_found_main">
|
|
8
7
|
<div class="container">
|
|
9
|
-
<
|
|
8
|
+
<div class="notFound i-svg:notFound" />
|
|
10
9
|
</div>
|
|
11
10
|
<div class="text">
|
|
12
11
|
本来无一物,何处惹尘埃
|
|
13
12
|
</div>
|
|
14
13
|
<div class="button_group">
|
|
15
|
-
<VanButton type="primary" size="small" @click="$router.replace('/
|
|
14
|
+
<VanButton type="primary" size="small" @click="$router.replace('/')">
|
|
16
15
|
返回首页
|
|
17
16
|
</VanButton>
|
|
18
17
|
</div>
|
|
@@ -1,147 +1,108 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
|
-
import
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { defineEmits, ref } from 'vue'
|
|
4
5
|
import { useRouter } from 'vue-router'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
// 定义事件
|
|
8
|
+
const emit = defineEmits(['deleteRow'])
|
|
9
|
+
// 访问路由
|
|
9
10
|
const router = useRouter()
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
// 获取默认值
|
|
12
|
+
const idKey = ref('o_id')
|
|
13
|
+
|
|
14
|
+
// 简易crud表单测试
|
|
15
|
+
const configName = ref('lngChargeAuditMobileCRUD')
|
|
16
|
+
const serviceName = ref('af-gaslink')
|
|
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
|
+
})
|
|
17
58
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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)
|
|
21
89
|
}
|
|
22
|
-
onMounted(() => {
|
|
23
|
-
console.log('初始化页面===')
|
|
24
|
-
})
|
|
25
|
-
onActivated(() => {
|
|
26
|
-
// 每次回到页面都会触发
|
|
27
|
-
console.log('activated: 每次回到页面都会触发')
|
|
28
|
-
})
|
|
29
90
|
</script>
|
|
30
91
|
|
|
31
92
|
<template>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
93
|
+
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
94
|
+
<template #layout_content>
|
|
95
|
+
<XCellList
|
|
96
|
+
:config-name="configName"
|
|
97
|
+
:service-name="serviceName"
|
|
98
|
+
:fix-query-form="{ o_f_oper_name: 'edu_test' }"
|
|
99
|
+
:id-key="idKey"
|
|
100
|
+
@to-detail="toDetail"
|
|
101
|
+
@delete-row="deleteRow"
|
|
102
|
+
/>
|
|
103
|
+
</template>
|
|
104
|
+
</NormalDataLayout>
|
|
39
105
|
</template>
|
|
40
106
|
|
|
41
107
|
<style scoped lang="less">
|
|
42
|
-
.cell-search-after {
|
|
43
|
-
padding: 0 12px 12px 12px;
|
|
44
|
-
background-color: #fff;
|
|
45
|
-
.van-row:first-child {
|
|
46
|
-
align-items: center;
|
|
47
|
-
margin-bottom: 8px;
|
|
48
|
-
padding: 0 2px;
|
|
49
|
-
h4 {
|
|
50
|
-
font-size: 1.08rem;
|
|
51
|
-
font-weight: 600;
|
|
52
|
-
margin: 0;
|
|
53
|
-
color: #222;
|
|
54
|
-
letter-spacing: 1px;
|
|
55
|
-
}
|
|
56
|
-
.stat-date-range {
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: flex-end;
|
|
60
|
-
font-size: 0.92rem;
|
|
61
|
-
color: #b0b3b8;
|
|
62
|
-
font-weight: 400;
|
|
63
|
-
span {
|
|
64
|
-
margin-left: 4px;
|
|
65
|
-
font-size: 0.92rem;
|
|
66
|
-
color: #b0b3b8;
|
|
67
|
-
}
|
|
68
|
-
.van-icon {
|
|
69
|
-
font-size: 1rem;
|
|
70
|
-
color: #b0b3b8;
|
|
71
|
-
margin-right: 2px;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
.van-row:nth-child(2) {
|
|
76
|
-
margin-top: 8px;
|
|
77
|
-
// 统计卡片间距由gutter控制
|
|
78
|
-
.van-col {
|
|
79
|
-
// 让卡片宽度自适应
|
|
80
|
-
.stat-card {
|
|
81
|
-
width: 100%;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
.stat-card {
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
align-items: center;
|
|
89
|
-
justify-content: center;
|
|
90
|
-
border-radius: 12px;
|
|
91
|
-
padding: 6px 0 4px 0; // 压缩高度
|
|
92
|
-
min-height: 44px; // 压缩高度
|
|
93
|
-
position: relative;
|
|
94
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
|
|
95
|
-
background: #f7f8fa;
|
|
96
|
-
.stat-num {
|
|
97
|
-
font-size: 1.08rem; // 缩小字体
|
|
98
|
-
font-weight: 600;
|
|
99
|
-
margin-bottom: 2px;
|
|
100
|
-
}
|
|
101
|
-
.stat-label {
|
|
102
|
-
font-size: 0.82rem; // 缩小字体
|
|
103
|
-
margin-bottom: 2px;
|
|
104
|
-
}
|
|
105
|
-
.stat-icon {
|
|
106
|
-
position: absolute;
|
|
107
|
-
top: 6px;
|
|
108
|
-
right: 8px;
|
|
109
|
-
font-size: 1rem;
|
|
110
|
-
opacity: 0.4;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
.stat-total {
|
|
114
|
-
background: #f0f5ff;
|
|
115
|
-
color: #2f54eb;
|
|
116
|
-
.stat-num,
|
|
117
|
-
.stat-label {
|
|
118
|
-
color: #2f54eb;
|
|
119
|
-
}
|
|
120
|
-
.stat-icon {
|
|
121
|
-
color: #2f54eb;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
.stat-done {
|
|
125
|
-
background: #e6fffb;
|
|
126
|
-
color: #13c2c2;
|
|
127
|
-
.stat-num,
|
|
128
|
-
.stat-label {
|
|
129
|
-
color: #13c2c2;
|
|
130
|
-
}
|
|
131
|
-
.stat-icon {
|
|
132
|
-
color: #13c2c2;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
.stat-processing {
|
|
136
|
-
background: #f9f0ff;
|
|
137
|
-
color: #b37feb;
|
|
138
|
-
.stat-num,
|
|
139
|
-
.stat-label {
|
|
140
|
-
color: #b37feb;
|
|
141
|
-
}
|
|
142
|
-
.stat-icon {
|
|
143
|
-
color: #b37feb;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
108
|
</style>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
|
|
3
|
-
import XFormView from '@af-mobile-client-vue3/views/component/XFormView/index.vue'
|
|
4
3
|
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
5
4
|
import { showDialog } from 'vant'
|
|
6
5
|
import { ref } from 'vue'
|
|
7
6
|
import { useRoute } from 'vue-router'
|
|
8
7
|
|
|
9
8
|
// 纯表单
|
|
10
|
-
const configName = ref('
|
|
11
|
-
const serviceName = ref('af-
|
|
9
|
+
const configName = ref('form_check_test')
|
|
10
|
+
const serviceName = ref('af-system')
|
|
12
11
|
|
|
13
12
|
// const configName = ref("计划下发Form")
|
|
14
13
|
// const serviceName = ref("af-linepatrol")
|
|
@@ -22,15 +21,11 @@ const formGroup = ref(null)
|
|
|
22
21
|
const route = useRoute()
|
|
23
22
|
const isInit = ref(false)
|
|
24
23
|
function submit(_result) {
|
|
25
|
-
showDialog({ message: '提交成功' })
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
const myXForm = ref([])
|
|
29
|
-
function setRef(value: any) {
|
|
30
|
-
console.log('myXForm', myXForm)
|
|
31
|
-
formGroup.value.setRef(myXForm.value)
|
|
32
|
-
console.log(formGroup)
|
|
24
|
+
showDialog({ message: '提交成功' }).then(() => {
|
|
25
|
+
history.back()
|
|
26
|
+
})
|
|
33
27
|
}
|
|
28
|
+
|
|
34
29
|
// 表单组——数据
|
|
35
30
|
// function initComponents () {
|
|
36
31
|
// runLogic('getlngChargeAuditMobileFormGroupData', {id: 29}, 'af-gaslink').then((res) => {
|
|
@@ -73,11 +68,7 @@ function setRef(value: any) {
|
|
|
73
68
|
:group-form-data="formData"
|
|
74
69
|
mode="新增"
|
|
75
70
|
@submit="submit"
|
|
76
|
-
|
|
77
|
-
<!-- <template #device="{ setRef, removeRef, item, formData }">
|
|
78
|
-
<XFormView :setRef="setRef" :formGroupName="'myXForm'"/>
|
|
79
|
-
</template>-->
|
|
80
|
-
</XFormGroup>
|
|
71
|
+
/>
|
|
81
72
|
</template>
|
|
82
73
|
</NormalDataLayout>
|
|
83
74
|
</template>
|
|
@@ -1,105 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// 组件顶部功能说明:本组件为表单视图,支持通过 setRef 注册自身到父组件
|
|
3
2
|
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import dayjs from 'dayjs/esm/index'
|
|
7
|
-
import { showFailToast, showToast } from 'vant'
|
|
8
|
-
import {computed, defineExpose, defineProps, onMounted, onUnmounted, ref} from 'vue'
|
|
9
|
-
import { useRoute } from 'vue-router'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { ref } from 'vue'
|
|
10
5
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
removeRef?: (refValue: any) => void
|
|
14
|
-
formGroupName?: string
|
|
15
|
-
}>(), {
|
|
16
|
-
setRef: () => {},
|
|
17
|
-
removeRef: () => {},
|
|
18
|
-
formGroupName: '',
|
|
19
|
-
})
|
|
20
|
-
const configName = ref('mobile_OtherChargeCancelForm')
|
|
21
|
-
const serviceName = ref('af-apply')
|
|
22
|
-
const route = useRoute()
|
|
23
|
-
const userInfo = useUserStore().getUserInfo()
|
|
24
|
-
const workflowId = computed(() => route.query.workflowid)
|
|
25
|
-
const formData = ref({
|
|
26
|
-
f_cancel_reason: '1111',
|
|
27
|
-
})
|
|
6
|
+
const configName = ref('AddConstructionForm')
|
|
7
|
+
const serviceName = ref('af-linepatrol')
|
|
28
8
|
|
|
29
|
-
const
|
|
30
|
-
const aaa = ref({})
|
|
31
|
-
function submit(res: any) {
|
|
32
|
-
if (Number(res.charge_money) > Number(res.surplus_money)) {
|
|
33
|
-
showFailToast('收费金额不能大于未结金额!!')
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
const saveData = {
|
|
37
|
-
f_payment_type: res.payment_type,
|
|
38
|
-
f_charge_money: res.charge_money,
|
|
39
|
-
f_amount_words: res.amount_words,
|
|
40
|
-
f_payment_method: res.payment_method,
|
|
41
|
-
f_actual_date: res.actual_date,
|
|
42
|
-
f_charge_status: '有效',
|
|
43
|
-
f_workflow_id: workflowId.value,
|
|
44
|
-
f_charge_collectors: userInfo.f_operator,
|
|
45
|
-
f_charge_collectors_id: userInfo.f_operatorid,
|
|
46
|
-
f_charge_date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
|
47
|
-
f_filialeid: userInfo.f_orgid,
|
|
48
|
-
f_filiale: userInfo.f_orgname,
|
|
49
|
-
}
|
|
50
|
-
post('api/af-apply/entity/save/t_charge_record', saveData).then((_res) => {
|
|
51
|
-
showToast('提交成功!')
|
|
52
|
-
history.back()
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
function init() {
|
|
56
|
-
// runLogic('getApplyBusinessrecode', { f_workflow_id: 854 }, 'af-apply').then((res) => {
|
|
57
|
-
// // formData.value = res
|
|
58
|
-
// console.log('res==', res)
|
|
59
|
-
// }).catch((err) => {
|
|
60
|
-
//
|
|
61
|
-
// })
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
Object.assign(formData.value, { f_cancel_reason: '2222222' })
|
|
64
|
-
}, 5000)
|
|
65
|
-
}
|
|
66
|
-
function validate() {
|
|
67
|
-
// 调用 XForm 的 validate 方法
|
|
68
|
-
return xFormRef.value?.validate?.() ?? Promise.resolve()
|
|
69
|
-
}
|
|
70
|
-
function getFormData() {
|
|
71
|
-
console.log('自定义表单=====', xFormRef.value.getFormData())
|
|
72
|
-
// 获取 XForm 的表单数据
|
|
73
|
-
return xFormRef.value?.getFormData?.() ?? {}
|
|
74
|
-
}
|
|
75
|
-
onMounted(() => {
|
|
76
|
-
init()
|
|
77
|
-
})
|
|
78
|
-
const exposeObj = { validate, getFormData, init, formGroupName: props.formGroupName }
|
|
79
|
-
defineExpose(exposeObj)
|
|
80
|
-
onMounted(() => {
|
|
81
|
-
props.setRef && props.setRef(exposeObj)
|
|
82
|
-
})
|
|
83
|
-
onUnmounted(() => {
|
|
84
|
-
props.removeRef && props.removeRef(exposeObj)
|
|
85
|
-
})
|
|
86
|
-
// watch(() => props.formData, (newVal) => {
|
|
87
|
-
// console.log('变更了===', newVal)
|
|
88
|
-
// if (newVal) {
|
|
89
|
-
// Object.assign(form, newVal)
|
|
90
|
-
// }
|
|
91
|
-
// })
|
|
9
|
+
const formGroupAddConstruction = ref(null)
|
|
92
10
|
</script>
|
|
93
11
|
|
|
94
12
|
<template>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
13
|
+
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
14
|
+
<template #layout_content>
|
|
15
|
+
<XForm
|
|
16
|
+
ref="formGroupAddConstruction"
|
|
17
|
+
mode="新增"
|
|
18
|
+
:config-name="configName"
|
|
19
|
+
:service-name="serviceName"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
</NormalDataLayout>
|
|
103
23
|
</template>
|
|
104
24
|
|
|
105
25
|
<style scoped lang="less">
|
|
@@ -268,7 +268,7 @@ onMounted(() => {
|
|
|
268
268
|
})
|
|
269
269
|
}
|
|
270
270
|
catch (e) {
|
|
271
|
-
console.
|
|
271
|
+
console.warn('读取本地缓存失败', e)
|
|
272
272
|
// 未拿到跳过
|
|
273
273
|
}
|
|
274
274
|
})
|
|
@@ -317,9 +317,9 @@ onMounted(() => {
|
|
|
317
317
|
<span>记住密码</span>
|
|
318
318
|
</div>
|
|
319
319
|
</VanCol>
|
|
320
|
-
<VanCol>
|
|
320
|
+
<!-- <VanCol>
|
|
321
321
|
<a class="extra_setting_for_reset_password" @click="setLoginState(LoginStateEnum.RESET_PASSWORD)">忘记密码?</a>
|
|
322
|
-
</VanCol>
|
|
322
|
+
</VanCol> -->
|
|
323
323
|
</VanRow>
|
|
324
324
|
<VanButton class="login_btn btn" type="primary" block native-type="submit" :loading="loading">
|
|
325
325
|
登 录
|