af-mobile-client-vue3 1.2.6 → 1.2.7
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/package.json +1 -1
- package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
- package/src/components/data/XReportGrid/print.js +184 -184
- package/src/layout/SingleLayout.vue +1 -26
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/utils/secureStorage.ts +71 -0
- package/src/views/component/XCellListView/index.vue +57 -180
- package/src/views/component/XFormGroupView/index.vue +7 -4
- package/vite.config.ts +2 -2
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted, ref } from 'vue'
|
|
3
|
-
import XReport from './XReport.vue'
|
|
4
|
-
|
|
5
|
-
const mainRef = ref()
|
|
6
|
-
|
|
7
|
-
onMounted(() => {
|
|
8
|
-
// 初始化逻辑
|
|
9
|
-
})
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div id="test">
|
|
14
|
-
<van-card :bordered="false">
|
|
15
|
-
<XReport
|
|
16
|
-
ref="mainRef"
|
|
17
|
-
:use-oss-for-img="false"
|
|
18
|
-
config-name="nurseWorkstationCover"
|
|
19
|
-
server-name="af-his"
|
|
20
|
-
:show-img-in-cell="true"
|
|
21
|
-
:display-only="true"
|
|
22
|
-
:edit-mode="false"
|
|
23
|
-
:show-save-button="false"
|
|
24
|
-
:no-padding="true"
|
|
25
|
-
:dont-format="true"
|
|
26
|
-
/>
|
|
27
|
-
</van-card>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<style scoped>
|
|
32
|
-
|
|
33
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
|
+
import XReport from './XReport.vue'
|
|
4
|
+
|
|
5
|
+
const mainRef = ref()
|
|
6
|
+
|
|
7
|
+
onMounted(() => {
|
|
8
|
+
// 初始化逻辑
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div id="test">
|
|
14
|
+
<van-card :bordered="false">
|
|
15
|
+
<XReport
|
|
16
|
+
ref="mainRef"
|
|
17
|
+
:use-oss-for-img="false"
|
|
18
|
+
config-name="nurseWorkstationCover"
|
|
19
|
+
server-name="af-his"
|
|
20
|
+
:show-img-in-cell="true"
|
|
21
|
+
:display-only="true"
|
|
22
|
+
:edit-mode="false"
|
|
23
|
+
:show-save-button="false"
|
|
24
|
+
:no-padding="true"
|
|
25
|
+
:dont-format="true"
|
|
26
|
+
/>
|
|
27
|
+
</van-card>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
|
|
33
|
+
</style>
|
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
// print.js
|
|
2
|
-
|
|
3
|
-
export function printElement(elementToPrint) {
|
|
4
|
-
// 创建一个新的浏览器窗口
|
|
5
|
-
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
|
6
|
-
// 设置新窗口的文档内容
|
|
7
|
-
printWindow.document.write(`
|
|
8
|
-
<html>
|
|
9
|
-
<head>
|
|
10
|
-
<title>Print</title>
|
|
11
|
-
<style>
|
|
12
|
-
@page {
|
|
13
|
-
size: auto;
|
|
14
|
-
margin: 0mm;
|
|
15
|
-
}
|
|
16
|
-
html, body {
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
}
|
|
22
|
-
#print-container {
|
|
23
|
-
display: none
|
|
24
|
-
}
|
|
25
|
-
.img{
|
|
26
|
-
width: 95%;
|
|
27
|
-
height: 180px;
|
|
28
|
-
object-fit: cover;
|
|
29
|
-
}
|
|
30
|
-
.reportMain {
|
|
31
|
-
text-align: center;
|
|
32
|
-
margin: 0 auto;
|
|
33
|
-
font-size: 16px;
|
|
34
|
-
color: #000;
|
|
35
|
-
background-color: #fff;
|
|
36
|
-
border-radius: 8px;
|
|
37
|
-
|
|
38
|
-
.reportTitle {
|
|
39
|
-
font-weight: bold;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.subTitle {
|
|
43
|
-
display: flex;
|
|
44
|
-
justify-content: space-between;
|
|
45
|
-
margin-bottom: 1%;
|
|
46
|
-
|
|
47
|
-
.subTitleItems {
|
|
48
|
-
max-width: 30%;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.inputsDiv {
|
|
53
|
-
display: flex;
|
|
54
|
-
justify-content: space-between;
|
|
55
|
-
.inputsDivItem {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
padding: 0 4px;
|
|
59
|
-
white-space: nowrap;
|
|
60
|
-
.inputsDivItemLabel {
|
|
61
|
-
padding: 0 4px;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.reportTable {
|
|
67
|
-
width: 100%;
|
|
68
|
-
border-collapse: collapse;
|
|
69
|
-
table-layout:fixed;
|
|
70
|
-
word-break:break-all;
|
|
71
|
-
text-align: center;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
.reportMainForDisplay {
|
|
75
|
-
text-align: center;
|
|
76
|
-
margin: 10% auto;
|
|
77
|
-
font-size: 16px;
|
|
78
|
-
color: #000;
|
|
79
|
-
background-color: #fff;
|
|
80
|
-
border-radius: 8px;
|
|
81
|
-
|
|
82
|
-
.reportTitle {
|
|
83
|
-
font-weight: bold;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.subTitle {
|
|
87
|
-
display: flex;
|
|
88
|
-
justify-content: space-between;
|
|
89
|
-
|
|
90
|
-
.subTitleItems {
|
|
91
|
-
max-width: 30%;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.inputsDiv {
|
|
96
|
-
display: flex;
|
|
97
|
-
justify-content: space-around;
|
|
98
|
-
.inputsDivItem {
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
101
|
-
padding: 0 4px;
|
|
102
|
-
white-space: nowrap;
|
|
103
|
-
.inputsDivItemLabel {
|
|
104
|
-
padding: 0 4px;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.reportTable {
|
|
110
|
-
width: 100%;
|
|
111
|
-
border-collapse: collapse;
|
|
112
|
-
table-layout:fixed;
|
|
113
|
-
word-break:break-all;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
.reportMainNoPadding {
|
|
117
|
-
text-align: center;
|
|
118
|
-
margin: 0 auto;
|
|
119
|
-
font-size: 16px;
|
|
120
|
-
color: #000;
|
|
121
|
-
background-color: #fff;
|
|
122
|
-
border-radius: 8px;
|
|
123
|
-
|
|
124
|
-
.reportTitle {
|
|
125
|
-
font-weight: bold;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.subTitle {
|
|
129
|
-
display: flex;
|
|
130
|
-
justify-content: space-between;
|
|
131
|
-
|
|
132
|
-
.subTitleItems {
|
|
133
|
-
max-width: 30%;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.inputsDiv {
|
|
138
|
-
display: flex;
|
|
139
|
-
justify-content: space-between;
|
|
140
|
-
.inputsDivItem {
|
|
141
|
-
display: flex;
|
|
142
|
-
align-items: center;
|
|
143
|
-
padding: 0 4px;
|
|
144
|
-
white-space: nowrap;
|
|
145
|
-
.inputsDivItemLabel {
|
|
146
|
-
padding: 0 4px;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.reportTable {
|
|
152
|
-
width: 100%;
|
|
153
|
-
border-collapse: collapse;
|
|
154
|
-
table-layout:fixed;
|
|
155
|
-
word-break:break-all;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
.tools{
|
|
159
|
-
position: fixed;
|
|
160
|
-
right: 2%;
|
|
161
|
-
text-align: right;
|
|
162
|
-
width: 60%;
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
.toolsItem{
|
|
165
|
-
width: 15%;
|
|
166
|
-
margin-right: 3%;
|
|
167
|
-
display: inline-block;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
</style>
|
|
171
|
-
</head>
|
|
172
|
-
<body>
|
|
173
|
-
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
174
|
-
${elementToPrint.innerHTML}
|
|
175
|
-
</body>
|
|
176
|
-
</html>
|
|
177
|
-
`)
|
|
178
|
-
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
179
|
-
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
180
|
-
setTimeout(() => {
|
|
181
|
-
printWindow.print() // 调用打印方法
|
|
182
|
-
printWindow.close()
|
|
183
|
-
}, 500) // 延迟500毫秒后执行打印
|
|
184
|
-
}
|
|
1
|
+
// print.js
|
|
2
|
+
|
|
3
|
+
export function printElement(elementToPrint) {
|
|
4
|
+
// 创建一个新的浏览器窗口
|
|
5
|
+
const printWindow = window.open('', '_blank', 'height=1024,width=768')
|
|
6
|
+
// 设置新窗口的文档内容
|
|
7
|
+
printWindow.document.write(`
|
|
8
|
+
<html>
|
|
9
|
+
<head>
|
|
10
|
+
<title>Print</title>
|
|
11
|
+
<style>
|
|
12
|
+
@page {
|
|
13
|
+
size: auto;
|
|
14
|
+
margin: 0mm;
|
|
15
|
+
}
|
|
16
|
+
html, body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
}
|
|
22
|
+
#print-container {
|
|
23
|
+
display: none
|
|
24
|
+
}
|
|
25
|
+
.img{
|
|
26
|
+
width: 95%;
|
|
27
|
+
height: 180px;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
}
|
|
30
|
+
.reportMain {
|
|
31
|
+
text-align: center;
|
|
32
|
+
margin: 0 auto;
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
color: #000;
|
|
35
|
+
background-color: #fff;
|
|
36
|
+
border-radius: 8px;
|
|
37
|
+
|
|
38
|
+
.reportTitle {
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.subTitle {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
margin-bottom: 1%;
|
|
46
|
+
|
|
47
|
+
.subTitleItems {
|
|
48
|
+
max-width: 30%;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.inputsDiv {
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
.inputsDivItem {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
padding: 0 4px;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
.inputsDivItemLabel {
|
|
61
|
+
padding: 0 4px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.reportTable {
|
|
67
|
+
width: 100%;
|
|
68
|
+
border-collapse: collapse;
|
|
69
|
+
table-layout:fixed;
|
|
70
|
+
word-break:break-all;
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.reportMainForDisplay {
|
|
75
|
+
text-align: center;
|
|
76
|
+
margin: 10% auto;
|
|
77
|
+
font-size: 16px;
|
|
78
|
+
color: #000;
|
|
79
|
+
background-color: #fff;
|
|
80
|
+
border-radius: 8px;
|
|
81
|
+
|
|
82
|
+
.reportTitle {
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.subTitle {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
|
|
90
|
+
.subTitleItems {
|
|
91
|
+
max-width: 30%;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.inputsDiv {
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-content: space-around;
|
|
98
|
+
.inputsDivItem {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
padding: 0 4px;
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
.inputsDivItemLabel {
|
|
104
|
+
padding: 0 4px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.reportTable {
|
|
110
|
+
width: 100%;
|
|
111
|
+
border-collapse: collapse;
|
|
112
|
+
table-layout:fixed;
|
|
113
|
+
word-break:break-all;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.reportMainNoPadding {
|
|
117
|
+
text-align: center;
|
|
118
|
+
margin: 0 auto;
|
|
119
|
+
font-size: 16px;
|
|
120
|
+
color: #000;
|
|
121
|
+
background-color: #fff;
|
|
122
|
+
border-radius: 8px;
|
|
123
|
+
|
|
124
|
+
.reportTitle {
|
|
125
|
+
font-weight: bold;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.subTitle {
|
|
129
|
+
display: flex;
|
|
130
|
+
justify-content: space-between;
|
|
131
|
+
|
|
132
|
+
.subTitleItems {
|
|
133
|
+
max-width: 30%;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.inputsDiv {
|
|
138
|
+
display: flex;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
.inputsDivItem {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
padding: 0 4px;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
.inputsDivItemLabel {
|
|
146
|
+
padding: 0 4px;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.reportTable {
|
|
152
|
+
width: 100%;
|
|
153
|
+
border-collapse: collapse;
|
|
154
|
+
table-layout:fixed;
|
|
155
|
+
word-break:break-all;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
.tools{
|
|
159
|
+
position: fixed;
|
|
160
|
+
right: 2%;
|
|
161
|
+
text-align: right;
|
|
162
|
+
width: 60%;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
.toolsItem{
|
|
165
|
+
width: 15%;
|
|
166
|
+
margin-right: 3%;
|
|
167
|
+
display: inline-block;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
171
|
+
</head>
|
|
172
|
+
<body>
|
|
173
|
+
<!-- 将需要打印的元素内容复制到新窗口中 -->
|
|
174
|
+
${elementToPrint.innerHTML}
|
|
175
|
+
</body>
|
|
176
|
+
</html>
|
|
177
|
+
`)
|
|
178
|
+
// 延迟执行打印,以确保新窗口的内容已加载完成
|
|
179
|
+
printWindow.document.close() // 关闭文档流,确保内容完全加载
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
printWindow.print() // 调用打印方法
|
|
182
|
+
printWindow.close()
|
|
183
|
+
}, 500) // 延迟500毫秒后执行打印
|
|
184
|
+
}
|
|
@@ -1,34 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import useRouteCache from '@af-mobile-client-vue3/stores/modules/routeCache'
|
|
3
|
-
import useRouteTransitionNameStore from '@af-mobile-client-vue3/stores/modules/routeTransitionName'
|
|
4
|
-
import { storeToRefs } from 'pinia'
|
|
5
|
-
import { computed } from 'vue'
|
|
6
|
-
|
|
7
|
-
const keepAliveRouteNames = computed(() => {
|
|
8
|
-
return useRouteCache().routeCaches as string[]
|
|
9
|
-
})
|
|
10
|
-
const routeTransitionNameStore = useRouteTransitionNameStore()
|
|
11
|
-
const { routeTransitionName } = storeToRefs(routeTransitionNameStore)
|
|
12
2
|
</script>
|
|
13
3
|
|
|
14
4
|
<template>
|
|
15
|
-
<div class="pageLayout"
|
|
16
|
-
<router-view v-slot="{ Component, route }">
|
|
17
|
-
<transition :name="routeTransitionName">
|
|
18
|
-
<keep-alive :include="keepAliveRouteNames">
|
|
19
|
-
<div :key="route.name" class="app-wrapper">
|
|
20
|
-
<component :is="Component" />
|
|
21
|
-
</div>
|
|
22
|
-
</keep-alive>
|
|
23
|
-
</transition>
|
|
24
|
-
</router-view>
|
|
25
|
-
</div>
|
|
5
|
+
<div class="pageLayout" />
|
|
26
6
|
</template>
|
|
27
7
|
|
|
28
8
|
<style lang="less" scoped>
|
|
29
|
-
.app-wrapper {
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
overflow-y: auto;
|
|
33
|
-
}
|
|
34
9
|
</style>
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { mobileUtil } from './mobileUtil'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 批量安全存储数据到本地
|
|
5
|
+
* @param storageItems 要存储的数据项数组,每项格式为 {key: string, value: object}
|
|
6
|
+
*/
|
|
7
|
+
export function secureStorageBatchWrite(storageItems: Array<{ key: string, value: any }>) {
|
|
8
|
+
console.log('storageItems===', storageItems)
|
|
9
|
+
if (!Array.isArray(storageItems) || storageItems.length === 0)
|
|
10
|
+
return
|
|
11
|
+
|
|
12
|
+
for (const item of storageItems) {
|
|
13
|
+
try {
|
|
14
|
+
mobileUtil.execute({
|
|
15
|
+
funcName: 'secureStorageWrite',
|
|
16
|
+
param: {
|
|
17
|
+
key: item.key,
|
|
18
|
+
value: typeof item.value === 'string' ? item.value : JSON.stringify(item.value),
|
|
19
|
+
},
|
|
20
|
+
callbackFunc: () => {},
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
console.error(`写入本地缓存失败 [${item.key}]`, e)
|
|
25
|
+
// 单条失败跳过继续处理下一条
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 安全存储单个数据到本地
|
|
32
|
+
* @param key 存储键名
|
|
33
|
+
* @param value 存储值
|
|
34
|
+
* @param callback 可选回调函数
|
|
35
|
+
*/
|
|
36
|
+
export function secureStorageWrite(key: string, value: any, callback?: () => void) {
|
|
37
|
+
try {
|
|
38
|
+
mobileUtil.execute({
|
|
39
|
+
funcName: 'secureStorageWrite',
|
|
40
|
+
param: {
|
|
41
|
+
key,
|
|
42
|
+
value: typeof value === 'string' ? value : JSON.stringify(value),
|
|
43
|
+
},
|
|
44
|
+
callbackFunc: callback || (() => {}),
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
console.error(`写入本地缓存失败 [${key}]`, e)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 从安全存储读取数据
|
|
54
|
+
* @param key 存储键名
|
|
55
|
+
* @param callback 读取结果回调函数
|
|
56
|
+
*/
|
|
57
|
+
export function secureStorageRead(key: string, callback: (result: any) => void) {
|
|
58
|
+
try {
|
|
59
|
+
mobileUtil.execute({
|
|
60
|
+
funcName: 'secureStorageRead',
|
|
61
|
+
param: { key },
|
|
62
|
+
callbackFunc: (result: any) => {
|
|
63
|
+
callback(result)
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.error(`读取本地缓存失败 [${key}]`, e)
|
|
69
|
+
callback({ status: 'error', message: e })
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,24 +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 {
|
|
5
|
-
Col as VanCol,
|
|
6
|
-
Icon as VanIcon,
|
|
7
|
-
Row as VanRow,
|
|
8
|
-
} from 'vant'
|
|
4
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
9
5
|
import { defineEmits, ref } from 'vue'
|
|
10
6
|
import { useRouter } from 'vue-router'
|
|
11
7
|
|
|
12
8
|
// 定义事件
|
|
13
9
|
const emit = defineEmits(['deleteRow'])
|
|
10
|
+
const userInfo = useUserStore().getUserInfo()
|
|
14
11
|
// 访问路由
|
|
15
12
|
const router = useRouter()
|
|
16
13
|
// 获取默认值
|
|
17
14
|
const idKey = ref('o_id')
|
|
18
15
|
|
|
19
16
|
// 简易crud表单测试
|
|
20
|
-
const configName = ref('
|
|
21
|
-
const serviceName = ref('af-
|
|
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')
|
|
22
24
|
|
|
23
25
|
// 资源权限测试
|
|
24
26
|
// const configName = ref('crud_sources_test')
|
|
@@ -54,11 +56,11 @@ const serviceName = ref('af-apply')
|
|
|
54
56
|
function toDetail(item) {
|
|
55
57
|
router.push({
|
|
56
58
|
name: 'XFormGroupView',
|
|
57
|
-
query: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
59
|
+
// query: {
|
|
60
|
+
// id: item[idKey.value],
|
|
61
|
+
// id: item.rr_id,
|
|
62
|
+
// o_id: item.o_id,
|
|
63
|
+
// },
|
|
62
64
|
})
|
|
63
65
|
}
|
|
64
66
|
|
|
@@ -74,23 +76,36 @@ function toDetail(item) {
|
|
|
74
76
|
// },
|
|
75
77
|
// })
|
|
76
78
|
// }
|
|
79
|
+
function addOption() {
|
|
80
|
+
router.push({
|
|
81
|
+
name: 'XFormGroupView',
|
|
82
|
+
// params: { id: totalCount.value },
|
|
83
|
+
// query: {
|
|
84
|
+
// configName: configName.value,
|
|
85
|
+
// serviceName: serviceName.value,
|
|
86
|
+
// mode: '新增',
|
|
87
|
+
// },
|
|
88
|
+
})
|
|
89
|
+
// 如果存在回调函数,调用它并传递true表示已处理
|
|
90
|
+
// if (typeof callback === 'function') {
|
|
91
|
+
// callback(true)
|
|
92
|
+
// }
|
|
93
|
+
}
|
|
77
94
|
|
|
78
95
|
// 修改功能
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
// 删除功能
|
|
91
|
-
function phone(result) {
|
|
92
|
-
console.log('phone==', result)
|
|
96
|
+
function updateRow(result) {
|
|
97
|
+
console.log('用户----', userInfo)
|
|
98
|
+
router.push({
|
|
99
|
+
name: 'XFormGroupView',
|
|
100
|
+
// params: { id: result.o_id, openid: result.o_id },
|
|
101
|
+
// query: {
|
|
102
|
+
// configName: configName.value,
|
|
103
|
+
// serviceName: serviceName.value,
|
|
104
|
+
// mode: '修改',
|
|
105
|
+
// },
|
|
106
|
+
})
|
|
93
107
|
}
|
|
108
|
+
|
|
94
109
|
// 删除功能
|
|
95
110
|
function deleteRow(result) {
|
|
96
111
|
emit('deleteRow', result.o_id)
|
|
@@ -103,166 +118,28 @@ function deleteRow(result) {
|
|
|
103
118
|
<XCellList
|
|
104
119
|
:config-name="configName"
|
|
105
120
|
:service-name="serviceName"
|
|
121
|
+
:custom-add="true"
|
|
122
|
+
:custom-edit="true"
|
|
106
123
|
:id-key="idKey"
|
|
107
124
|
@to-detail="toDetail"
|
|
108
125
|
@delete-row="deleteRow"
|
|
109
|
-
@
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<VanCol span="8">
|
|
124
|
-
<div class="stat-card stat-total">
|
|
125
|
-
<div class="stat-num">
|
|
126
|
-
3
|
|
127
|
-
</div>
|
|
128
|
-
<div class="stat-label">
|
|
129
|
-
总流程数
|
|
130
|
-
</div>
|
|
131
|
-
<VanIcon name="notes-o" class="stat-icon" />
|
|
132
|
-
</div>
|
|
133
|
-
</VanCol>
|
|
134
|
-
<VanCol span="8">
|
|
135
|
-
<div class="stat-card stat-done">
|
|
136
|
-
<div class="stat-num">
|
|
137
|
-
2
|
|
138
|
-
</div>
|
|
139
|
-
<div class="stat-label">
|
|
140
|
-
已完成
|
|
141
|
-
</div>
|
|
142
|
-
<VanIcon name="passed" class="stat-icon" />
|
|
143
|
-
</div>
|
|
144
|
-
</VanCol>
|
|
145
|
-
<VanCol span="8">
|
|
146
|
-
<div class="stat-card stat-processing">
|
|
147
|
-
<div class="stat-num">
|
|
148
|
-
1
|
|
149
|
-
</div>
|
|
150
|
-
<div class="stat-label">
|
|
151
|
-
处理中
|
|
152
|
-
</div>
|
|
153
|
-
<VanIcon name="todo-list-o" class="stat-icon" />
|
|
154
|
-
</div>
|
|
155
|
-
</VanCol>
|
|
156
|
-
</VanRow>
|
|
157
|
-
</div>
|
|
158
|
-
</template>
|
|
159
|
-
</XCellList>
|
|
126
|
+
@update="updateRow"
|
|
127
|
+
@add="addOption"
|
|
128
|
+
/>
|
|
129
|
+
|
|
130
|
+
<!-- :fix-query-form="{ u_f_price_state: ['生效', '待生效'] }" -->
|
|
131
|
+
|
|
132
|
+
<!-- <XCellList -->
|
|
133
|
+
<!-- :config-name="configName" -->
|
|
134
|
+
<!-- :service-name="serviceName" -->
|
|
135
|
+
<!-- :fix-query-form="{ o_f_oper_name: 'edu_test' }" -->
|
|
136
|
+
<!-- :id-key="idKey" -->
|
|
137
|
+
<!-- @to-detail="toDetail" -->
|
|
138
|
+
<!-- @delete-row="deleteRow" -->
|
|
139
|
+
<!-- /> -->
|
|
160
140
|
</template>
|
|
161
141
|
</NormalDataLayout>
|
|
162
142
|
</template>
|
|
163
143
|
|
|
164
144
|
<style scoped lang="less">
|
|
165
|
-
.cell-search-after {
|
|
166
|
-
padding: 8px 12px;
|
|
167
|
-
background-color: #fff;
|
|
168
|
-
.van-row:first-child {
|
|
169
|
-
align-items: center;
|
|
170
|
-
margin-bottom: 8px;
|
|
171
|
-
padding: 0 2px;
|
|
172
|
-
h4 {
|
|
173
|
-
font-size: 1.08rem;
|
|
174
|
-
font-weight: 600;
|
|
175
|
-
margin: 0;
|
|
176
|
-
color: #222;
|
|
177
|
-
letter-spacing: 1px;
|
|
178
|
-
}
|
|
179
|
-
.stat-date-range {
|
|
180
|
-
display: flex;
|
|
181
|
-
align-items: center;
|
|
182
|
-
justify-content: flex-end;
|
|
183
|
-
font-size: 0.92rem;
|
|
184
|
-
color: #b0b3b8;
|
|
185
|
-
font-weight: 400;
|
|
186
|
-
span {
|
|
187
|
-
margin-left: 4px;
|
|
188
|
-
font-size: 0.92rem;
|
|
189
|
-
color: #b0b3b8;
|
|
190
|
-
}
|
|
191
|
-
.van-icon {
|
|
192
|
-
font-size: 1rem;
|
|
193
|
-
color: #b0b3b8;
|
|
194
|
-
margin-right: 2px;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
.van-row:nth-child(2) {
|
|
199
|
-
margin-top: 8px;
|
|
200
|
-
// 统计卡片间距由gutter控制
|
|
201
|
-
.van-col {
|
|
202
|
-
// 让卡片宽度自适应
|
|
203
|
-
.stat-card {
|
|
204
|
-
width: 100%;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
.stat-card {
|
|
209
|
-
display: flex;
|
|
210
|
-
flex-direction: column;
|
|
211
|
-
align-items: center;
|
|
212
|
-
justify-content: center;
|
|
213
|
-
border-radius: 12px;
|
|
214
|
-
padding: 12px 0 8px 0;
|
|
215
|
-
min-height: 64px;
|
|
216
|
-
position: relative;
|
|
217
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
|
|
218
|
-
background: #f7f8fa;
|
|
219
|
-
.stat-num {
|
|
220
|
-
font-size: 1.5rem;
|
|
221
|
-
font-weight: 600;
|
|
222
|
-
margin-bottom: 2px;
|
|
223
|
-
}
|
|
224
|
-
.stat-label {
|
|
225
|
-
font-size: 0.95rem;
|
|
226
|
-
color: #888;
|
|
227
|
-
margin-bottom: 2px;
|
|
228
|
-
}
|
|
229
|
-
.stat-icon {
|
|
230
|
-
position: absolute;
|
|
231
|
-
top: 8px;
|
|
232
|
-
right: 10px;
|
|
233
|
-
font-size: 1.1rem;
|
|
234
|
-
opacity: 0.4;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
.stat-total {
|
|
238
|
-
background: #f0f5ff;
|
|
239
|
-
color: #2f54eb;
|
|
240
|
-
.stat-num {
|
|
241
|
-
color: #2f54eb;
|
|
242
|
-
}
|
|
243
|
-
.stat-icon {
|
|
244
|
-
color: #2f54eb;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
.stat-done {
|
|
248
|
-
background: #e6fffb;
|
|
249
|
-
color: #13c2c2;
|
|
250
|
-
.stat-num {
|
|
251
|
-
color: #13c2c2;
|
|
252
|
-
}
|
|
253
|
-
.stat-icon {
|
|
254
|
-
color: #13c2c2;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
.stat-processing {
|
|
258
|
-
background: #f9f0ff;
|
|
259
|
-
color: #b37feb;
|
|
260
|
-
.stat-num {
|
|
261
|
-
color: #b37feb;
|
|
262
|
-
}
|
|
263
|
-
.stat-icon {
|
|
264
|
-
color: #b37feb;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
145
|
</style>
|
|
@@ -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)
|
package/vite.config.ts
CHANGED
|
@@ -11,8 +11,8 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|
|
11
11
|
|
|
12
12
|
const appProxys = {}
|
|
13
13
|
|
|
14
|
-
const v4Server = 'http://
|
|
15
|
-
const v3Server = '
|
|
14
|
+
const v4Server = 'http://aote-office.8866.org:31567'
|
|
15
|
+
const v3Server = 'http://aote-office.8866.org:31567'
|
|
16
16
|
const OSSServerDev = 'http://192.168.50.67:30351'
|
|
17
17
|
const geoserver = 'http://39.104.49.8:30372'
|
|
18
18
|
// const OSSServerProd = 'http://192.168.50.67:31351'
|