af-mobile-client-vue3 1.1.31 → 1.1.32

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 CHANGED
@@ -1,111 +1,100 @@
1
- {
2
- "name": "af-mobile-client-vue3",
3
- "type": "module",
4
- "version": "1.1.31",
5
- "description": "Vue + Vite component lib",
6
- "license": "MIT",
7
- "engines": {
8
- "node": ">=18.12.0",
9
- "pnpm": ">=8.15.0"
10
- },
11
- "scripts": {
12
- "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
13
- "build": "vue-tsc --noEmit && vite build",
14
- "build:dev": "vue-tsc --noEmit && vite build --mode=development",
15
- "preview": "vite preview",
16
- "lint": "eslint . && vue-tsc --noEmit",
17
- "lint:fix": "eslint . --fix",
18
- "test": "vitest",
19
- "release": "bumpp --commit --push --tag"
20
- },
21
- "dependencies": {
22
- "@micro-zoe/micro-app": "1.0.0-rc.24",
23
- "@vant/area-data": "^2.0.0",
24
- "@unhead/vue": "^2.0.5",
25
- "@vant/touch-emulator": "^1.4.0",
26
- "@vant/use": "^1.6.0",
27
- "@vueuse/core": "^13.1.0",
28
- "@iconify/vue": "4.3.0",
29
- "animate.css": "^4.1.1",
30
- "axios": "^1.8.4",
31
- "crypto-js": "^4.2.0",
32
- "echarts": "^5.6.0",
33
- "lodash-es": "^4.17.21",
34
- "nprogress": "^0.2.0",
35
- "ol": "^10.5.0",
36
- "pinia": "^3.0.2",
37
- "pinia-plugin-persistedstate": "^4.2.0",
38
- "qs": "^6.14.0",
39
- "resize-detector": "^0.3.0",
40
- "store": "^2.0.12",
41
- "vant": "^4.9.18",
42
- "vconsole": "^3.15.1",
43
- "vue": "^3.5.13",
44
- "vue-router": "^4.5.0"
45
- },
46
- "devDependencies": {
47
- "@antfu/eslint-config": "^4.12.0",
48
- "@iconify/json": "2.2.318",
49
- "@types/crypto-js": "^4.2.2",
50
- "@types/lodash-es": "^4.17.12",
51
- "@types/node": "^22.14.1",
52
- "@types/nprogress": "^0.2.3",
53
- "@types/store": "^2.0.5",
54
- "@unocss/eslint-plugin": "^66.1.0-beta.11",
55
- "@unocss/preset-rem-to-px": "66.1.0-beta.11",
56
- "@vitejs/plugin-legacy": "^6.0.2",
57
- "@vitejs/plugin-vue": "^5.2.3",
58
- "autoprefixer": "^10.4.21",
59
- "bumpp": "^10.1.0",
60
- "commitizen": "^4.3.1",
61
- "consola": "^3.4.2",
62
- "cross-env": "^7.0.3",
63
- "cz-emoji-chinese": "^0.3.1",
64
- "eslint": "^9.24.0",
65
- "eslint-ts-patch": "^8.57.0-0",
66
- "husky": "^9.1.7",
67
- "less": "^4.3.0",
68
- "mockjs": "^1.1.0",
69
- "postcss-mobile-forever": "^5.0.0",
70
- "rollup": "^4.40.0",
71
- "terser": "^5.39.0",
72
- "typescript": "^5.8.3",
73
- "unocss": "^66.1.0-beta.11",
74
- "unplugin-auto-import": "^19.1.2",
75
- "unplugin-vue-components": "^28.4.1",
76
- "unplugin-vue-router": "^0.12.0",
77
- "vite": "^6.2.6",
78
- "vite-plugin-compression": "^0.5.1",
79
- "vite-plugin-mock-dev-server": "^1.8.5",
80
- "vite-plugin-pwa": "^1.0.0",
81
- "vite-plugin-sitemap": "^0.7.1",
82
- "vite-plugin-svg-icons": "^2.0.1",
83
- "vite-plugin-vconsole": "^2.1.1",
84
- "vite-plugin-vue-devtools": "^7.7.2",
85
- "vite-plugin-vue-layouts": "^0.11.0",
86
- "vitest": "^3.1.1",
87
- "vue-tsc": "^2.2.8"
88
- },
89
- "pnpm": {
90
- "peerDependencyRules": {
91
- "ignoreMissing": [
92
- "postcss",
93
- "esbuild"
94
- ],
95
- "allowedVersions": {
96
- "rollup": "^4.x"
97
- }
98
- }
99
- },
100
- "config": {
101
- "commitizen": {
102
- "path": "./node_modules/cz-emoji-chinese"
103
- },
104
- "cz-emoji-chinese": {
105
- "skipQuestions": [
106
- "body",
107
- "scope"
108
- ]
109
- }
110
- }
111
- }
1
+ {
2
+ "name": "af-mobile-client-vue3",
3
+ "type": "module",
4
+ "version": "1.1.32",
5
+ "description": "Vue + Vite component lib",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=18.12.0",
9
+ "pnpm": ">=8.15.0"
10
+ },
11
+ "dependencies": {
12
+ "@micro-zoe/micro-app": "1.0.0-rc.24",
13
+ "@vant/area-data": "^2.0.0",
14
+ "@unhead/vue": "^2.0.5",
15
+ "@vant/touch-emulator": "^1.4.0",
16
+ "@vant/use": "^1.6.0",
17
+ "@vueuse/core": "^13.1.0",
18
+ "@iconify/vue": "4.3.0",
19
+ "animate.css": "^4.1.1",
20
+ "axios": "^1.8.4",
21
+ "crypto-js": "^4.2.0",
22
+ "echarts": "^5.6.0",
23
+ "lodash-es": "^4.17.21",
24
+ "nprogress": "^0.2.0",
25
+ "ol": "^10.5.0",
26
+ "pinia": "^3.0.2",
27
+ "pinia-plugin-persistedstate": "^4.2.0",
28
+ "qs": "^6.14.0",
29
+ "resize-detector": "^0.3.0",
30
+ "store": "^2.0.12",
31
+ "vant": "^4.9.18",
32
+ "vconsole": "^3.15.1",
33
+ "vue": "^3.5.13",
34
+ "vue-router": "^4.5.0"
35
+ },
36
+ "devDependencies": {
37
+ "@antfu/eslint-config": "^4.12.0",
38
+ "@iconify/json": "2.2.318",
39
+ "@types/crypto-js": "^4.2.2",
40
+ "@types/lodash-es": "^4.17.12",
41
+ "@types/node": "^22.14.1",
42
+ "@types/nprogress": "^0.2.3",
43
+ "@types/store": "^2.0.5",
44
+ "@unocss/eslint-plugin": "^66.1.0-beta.11",
45
+ "@unocss/preset-rem-to-px": "66.1.0-beta.11",
46
+ "@vitejs/plugin-legacy": "^6.0.2",
47
+ "@vitejs/plugin-vue": "^5.2.3",
48
+ "autoprefixer": "^10.4.21",
49
+ "bumpp": "^10.1.0",
50
+ "commitizen": "^4.3.1",
51
+ "consola": "^3.4.2",
52
+ "cross-env": "^7.0.3",
53
+ "cz-emoji-chinese": "^0.3.1",
54
+ "eslint": "^9.24.0",
55
+ "eslint-ts-patch": "^8.57.0-0",
56
+ "husky": "^9.1.7",
57
+ "less": "^4.3.0",
58
+ "mockjs": "^1.1.0",
59
+ "postcss-mobile-forever": "^5.0.0",
60
+ "rollup": "^4.40.0",
61
+ "terser": "^5.39.0",
62
+ "typescript": "^5.8.3",
63
+ "unocss": "^66.1.0-beta.11",
64
+ "unplugin-auto-import": "^19.1.2",
65
+ "unplugin-vue-components": "^28.4.1",
66
+ "unplugin-vue-router": "^0.12.0",
67
+ "vite": "^6.2.6",
68
+ "vite-plugin-compression": "^0.5.1",
69
+ "vite-plugin-mock-dev-server": "^1.8.5",
70
+ "vite-plugin-pwa": "^1.0.0",
71
+ "vite-plugin-sitemap": "^0.7.1",
72
+ "vite-plugin-svg-icons": "^2.0.1",
73
+ "vite-plugin-vconsole": "^2.1.1",
74
+ "vite-plugin-vue-devtools": "^7.7.2",
75
+ "vite-plugin-vue-layouts": "^0.11.0",
76
+ "vitest": "^3.1.1",
77
+ "vue-tsc": "^2.2.8"
78
+ },
79
+ "config": {
80
+ "commitizen": {
81
+ "path": "./node_modules/cz-emoji-chinese"
82
+ },
83
+ "cz-emoji-chinese": {
84
+ "skipQuestions": [
85
+ "body",
86
+ "scope"
87
+ ]
88
+ }
89
+ },
90
+ "scripts": {
91
+ "dev": "cross-env MOCK_SERVER_PORT=8086 vite",
92
+ "build": "vue-tsc --noEmit && vite build",
93
+ "build:dev": "vue-tsc --noEmit && vite build --mode=development",
94
+ "preview": "vite preview",
95
+ "lint": "eslint . && vue-tsc --noEmit",
96
+ "lint:fix": "eslint . --fix",
97
+ "test": "vitest",
98
+ "release": "bumpp --commit --push --tag"
99
+ }
100
+ }
@@ -512,6 +512,14 @@ defineExpose({
512
512
  <template>
513
513
  <div id="XCellList">
514
514
  <VanRow class="filter-condition">
515
+ <!-- 左侧动态插槽区域 -->
516
+ <template v-for="(_, name) in slots" :key="name">
517
+ <template v-if="typeof name === 'string' && name.startsWith('search-left-')">
518
+ <div class="filter-icon-box">
519
+ <slot :name="name" />
520
+ </div>
521
+ </template>
522
+ </template>
515
523
  <VanCol class="search-col">
516
524
  <VanSearch
517
525
  v-model="searchValue"
@@ -522,7 +530,7 @@ defineExpose({
522
530
  @search="onRefresh"
523
531
  />
524
532
  </VanCol>
525
- <!-- 动态插槽区域 -->
533
+ <!-- 右侧动态插槽区域 -->
526
534
  <template v-for="(_, name) in slots" :key="name">
527
535
  <template v-if="typeof name === 'string' && name.startsWith('search-right-')">
528
536
  <div class="filter-icon-box">
@@ -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,6 +1,7 @@
1
1
  import type { RouteRecordRaw } from 'vue-router'
2
2
  import { doLogout, login, OALogin } from '@af-mobile-client-vue3/api/user'
3
3
  import router from '@af-mobile-client-vue3/router/index'
4
+ import { useSettingStore } from '@af-mobile-client-vue3/stores/modules/setting'
4
5
  import {
5
6
  ACCESS_TOKEN,
6
7
  APP_LOGIN_KEY,
@@ -10,6 +11,7 @@ import {
10
11
  CURRENT_USER,
11
12
  } from '@af-mobile-client-vue3/stores/mutation-type'
12
13
  import crypto from '@af-mobile-client-vue3/utils/crypto'
14
+ import { indexedDB } from '@af-mobile-client-vue3/utils/indexedDB'
13
15
  import { createStorage } from '@af-mobile-client-vue3/utils/Storage'
14
16
  import { defineStore } from 'pinia'
15
17
  import { ref } from 'vue'
@@ -181,14 +183,24 @@ export const useUserStore = defineStore('app-user', () => {
181
183
  }
182
184
  setToken(undefined)
183
185
  setUserInfo(null)
184
- Storage.remove(ACCESS_TOKEN)
185
- Storage.remove(CURRENT_USER)
186
- Storage.remove(APP_LOGIN_KEY)
187
- Storage.remove(APP_PERMISSIONS_KEY)
188
- Storage.remove(APP_ROLES_KEY)
189
- Storage.remove(APP_ROUTES_KEY)
190
- Storage.remove('LoginTicket')
191
- router.push('/login')
186
+ // Storage.remove(ACCESS_TOKEN)
187
+ // Storage.remove(CURRENT_USER)
188
+ // Storage.remove(APP_LOGIN_KEY)
189
+ // Storage.remove(APP_PERMISSIONS_KEY)
190
+ // Storage.remove(APP_ROLES_KEY)
191
+ // Storage.remove(APP_ROUTES_KEY)
192
+ // 开始清空缓存
193
+ try {
194
+ Storage.clear()
195
+ await indexedDB.clearDB()
196
+ await useSettingStore().init()
197
+ // 添加页面刷新
198
+ await router.replace('/login')
199
+ window.location.reload()
200
+ }
201
+ catch (e) {
202
+ console.error(e)
203
+ }
192
204
  }
193
205
 
194
206
  return {
@@ -172,6 +172,21 @@ export const indexedDB = {
172
172
  }
173
173
  })
174
174
  },
175
+ clearDB() {
176
+ return new Promise<void>((resolve, reject) => {
177
+ this.openDB((res: IDBDatabase) => {
178
+ // 删除存储空间全部记录
179
+ const request = res.transaction('metaCache', 'readwrite').objectStore('metaCache').clear()
180
+
181
+ request.onerror = () => {
182
+ reject(new Error('数据删除失败'))
183
+ }
184
+ request.onsuccess = () => {
185
+ resolve()
186
+ }
187
+ })
188
+ })
189
+ },
175
190
  clearCache() {
176
191
  indexedDB.clear(() => {
177
192
  location.reload()
@@ -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,24 +1,19 @@
1
1
  <script setup lang="ts">
2
2
  import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
3
3
  import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
- import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
5
4
  import { defineEmits, ref } from 'vue'
6
5
  import { useRouter } from 'vue-router'
7
6
 
8
7
  // 定义事件
9
8
  const emit = defineEmits(['deleteRow'])
10
- const userInfo = useUserStore().getUserInfo()
11
9
  // 访问路由
12
10
  const router = useRouter()
13
11
  // 获取默认值
14
12
  const idKey = ref('o_id')
15
13
 
16
14
  // 简易crud表单测试
17
- // const configName = ref('orderCarInMobileCRUD')
18
- // const serviceName = ref('af-gaslink')
19
- // const configName = ref('lngPriceManageMobileCRUD')
20
- const configName = ref('测试')
21
- const serviceName = ref('af-gaslink')
15
+ const configName = ref('crud_oper_log_manage')
16
+ const serviceName = ref('af-system')
22
17
 
23
18
  // 资源权限测试
24
19
  // const configName = ref('crud_sources_test')
@@ -54,11 +49,11 @@ const serviceName = ref('af-gaslink')
54
49
  function toDetail(item) {
55
50
  router.push({
56
51
  name: 'XFormGroupView',
57
- // query: {
58
- // id: item[idKey.value],
59
- // id: item.rr_id,
60
- // o_id: item.o_id,
61
- // },
52
+ query: {
53
+ id: item[idKey.value],
54
+ // id: item.rr_id,
55
+ // o_id: item.o_id,
56
+ },
62
57
  })
63
58
  }
64
59
 
@@ -74,40 +69,19 @@ function toDetail(item) {
74
69
  // },
75
70
  // })
76
71
  // }
77
- function addOption(callback) {
78
- router.push({
79
- name: 'XFormGroupView',
80
- // params: { id: totalCount.value },
81
- // query: {
82
- // configName: configName.value,
83
- // serviceName: serviceName.value,
84
- // mode: '新增',
85
- // },
86
- })
87
- // 如果存在回调函数,调用它并传递true表示已处理
88
- if (typeof callback === 'function') {
89
- callback(true)
90
- }
91
- }
92
72
 
93
73
  // 修改功能
94
- function updateRow(result, callback) {
95
- console.log('用户----', userInfo)
96
- router.push({
97
- name: 'XFormGroupView',
98
- // params: { id: result.o_id, openid: result.o_id },
99
- // query: {
100
- // configName: configName.value,
101
- // serviceName: serviceName.value,
102
- // mode: '修改',
103
- // },
104
- })
105
-
106
- // 如果存在回调函数,调用它并传递true表示已处理
107
- if (typeof callback === 'function') {
108
- callback(true)
109
- }
110
- }
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
+ // }
111
85
 
112
86
  // 删除功能
113
87
  function deleteRow(result) {
@@ -121,23 +95,11 @@ function deleteRow(result) {
121
95
  <XCellList
122
96
  :config-name="configName"
123
97
  :service-name="serviceName"
98
+ :fix-query-form="{ o_f_oper_name: 'edu_test' }"
124
99
  :id-key="idKey"
125
100
  @to-detail="toDetail"
126
101
  @delete-row="deleteRow"
127
- @update="updateRow"
128
- @add="addOption"
129
102
  />
130
-
131
- <!-- :fix-query-form="{ u_f_price_state: ['生效', '待生效'] }" -->
132
-
133
- <!-- <XCellList -->
134
- <!-- :config-name="configName" -->
135
- <!-- :service-name="serviceName" -->
136
- <!-- :fix-query-form="{ o_f_oper_name: 'edu_test' }" -->
137
- <!-- :id-key="idKey" -->
138
- <!-- @to-detail="toDetail" -->
139
- <!-- @delete-row="deleteRow" -->
140
- <!-- /> -->
141
103
  </template>
142
104
  </NormalDataLayout>
143
105
  </template>
@@ -5,19 +5,16 @@ 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
-
11
8
  // 纯表单
12
- // const configName = ref('form_check_test')
13
- // const serviceName = ref('af-system')
9
+ const configName = ref('form_check_test')
10
+ const serviceName = ref('af-system')
14
11
 
15
12
  // const configName = ref("计划下发Form")
16
13
  // const serviceName = ref("af-linepatrol")
17
14
 
18
15
  // 表单组
19
- const configName = ref('lngChargeAuditMobileFormGroup')
20
- const serviceName = ref('af-gaslink')
16
+ // const configName = ref('lngChargeAuditMobileFormGroup')
17
+ // const serviceName = ref('af-gaslink')
21
18
 
22
19
  const formData = ref({})
23
20
  const formGroup = ref(null)
package/tsconfig.json CHANGED
@@ -1,43 +1,43 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "jsx": "preserve",
5
- "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
6
- "experimentalDecorators": true,
7
- "baseUrl": ".",
8
- "module": "esnext",
9
- "moduleResolution": "Bundler",
10
- "paths": {
11
- "@af-mobile-client-vue3/*": ["src/*"]
12
- },
13
- "types": [
14
- "node",
15
- "unplugin-vue-router/client",
16
- "vite-plugin-vue-layouts/client",
17
- "vite-plugin-pwa/client"
18
- ],
19
- "allowJs": true,
20
- "strictNullChecks": false,
21
- "noImplicitAny": false,
22
- "noUnusedLocals": false,
23
- "noUnusedParameters": false,
24
- "importHelpers": true,
25
- "sourceMap": true,
26
- "allowSyntheticDefaultImports": true,
27
- "esModuleInterop": true,
28
- "verbatimModuleSyntax": true,
29
- "skipLibCheck": true
30
- },
31
- "include": [
32
- "src/App.vue",
33
- "src/**/*.ts",
34
- "src/**/*.tsx",
35
- "src/**/*.vue",
36
- "tests/**/*.ts",
37
- "tests/**/*.tsx",
38
- "src/components.d.ts",
39
- "src/auto-imports.d.ts",
40
- "src/typed-router.d.ts",
41
- "tests/*.ts"
42
- ]
43
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "jsx": "preserve",
5
+ "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
6
+ "experimentalDecorators": true,
7
+ "baseUrl": ".",
8
+ "module": "esnext",
9
+ "moduleResolution": "Bundler",
10
+ "paths": {
11
+ "@af-mobile-client-vue3/*": ["src/*"]
12
+ },
13
+ "types": [
14
+ "node",
15
+ "unplugin-vue-router/client",
16
+ "vite-plugin-vue-layouts/client",
17
+ "vite-plugin-pwa/client"
18
+ ],
19
+ "allowJs": true,
20
+ "strictNullChecks": false,
21
+ "noImplicitAny": false,
22
+ "noUnusedLocals": false,
23
+ "noUnusedParameters": false,
24
+ "importHelpers": true,
25
+ "sourceMap": true,
26
+ "allowSyntheticDefaultImports": true,
27
+ "esModuleInterop": true,
28
+ "verbatimModuleSyntax": true,
29
+ "skipLibCheck": true
30
+ },
31
+ "include": [
32
+ "src/App.vue",
33
+ "src/**/*.ts",
34
+ "src/**/*.tsx",
35
+ "src/**/*.vue",
36
+ "tests/**/*.ts",
37
+ "tests/**/*.tsx",
38
+ "src/components.d.ts",
39
+ "src/auto-imports.d.ts",
40
+ "src/typed-router.d.ts",
41
+ "tests/*.ts"
42
+ ]
43
+ }