af-mobile-client-vue3 1.3.10 → 1.3.11

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,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.3.10",
4
+ "version": "1.3.11",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -119,4 +119,4 @@ onUnmounted(() => {
119
119
  color: #ff976a;
120
120
  }
121
121
  }
122
- </style>
122
+ </style>
@@ -99,4 +99,4 @@ onUnmounted(() => {
99
99
  .user-form {
100
100
  padding: 16px;
101
101
  }
102
- </style>
102
+ </style>
@@ -11,6 +11,7 @@ const props = withDefaults(defineProps<{
11
11
  mode?: string
12
12
  isScrollspy?: boolean
13
13
  formShow?: any
14
+ showTabHeader?: boolean
14
15
  }>(), {
15
16
  configName: '',
16
17
  serviceName: undefined,
@@ -18,25 +19,15 @@ const props = withDefaults(defineProps<{
18
19
  mode: '查询',
19
20
  isScrollspy: true,
20
21
  formShow: undefined,
22
+ showTabHeader: true,
21
23
  })
22
24
  const emit = defineEmits(['submit', 'xFormItemEmitFunc'])
23
25
 
24
- interface Form {
25
- configName?: string
26
- serviceName?: string
27
- groupFormData?: object
28
- mode?: string
29
- isScrollspy?: boolean
30
- formShow?: any
31
- }
32
-
33
26
  const groupItems = ref([])
34
27
  const formData = ref({})
35
28
  const submitGroup = ref(false)
36
29
  const submitSimple = ref(false)
37
30
  const isInit = ref(false)
38
- const initStatus = ref(false)
39
- const propsData = ref<Partial<Form>>({})
40
31
 
41
32
  const slots = useSlots()
42
33
  const renderableGroupItems = computed(() => {
@@ -55,18 +46,9 @@ const renderableGroupItems = computed(() => {
55
46
  })
56
47
 
57
48
  // 组件初始化函数
58
- function init(params: Form) {
59
- initStatus.value = true
60
- propsData.value = {
61
- configName: props.configName,
62
- serviceName: props.serviceName,
63
- groupFormData: props.groupFormData,
64
- mode: props.mode,
65
- formShow: props.formShow,
66
- ...params,
67
- }
68
- formData.value = propsData.value.groupFormData
69
- getConfigByName(propsData.value.configName, (result) => {
49
+ function init() {
50
+ formData.value = props.groupFormData
51
+ getConfigByName(props.configName, (result) => {
70
52
  if (result?.groups) {
71
53
  groupItems.value = result.groups
72
54
  result.groups.forEach((group) => {
@@ -81,14 +63,13 @@ function init(params: Form) {
81
63
  groupItems.value = [{ ...result }]
82
64
  }
83
65
  isInit.value = true
84
- }, propsData.value.serviceName)
66
+ }, props.serviceName)
85
67
  }
86
- watch(() => props.groupFormData, (_val) => {
87
- formData.value = { ...formData.value, ...props.groupFormData }
88
- })
68
+ // watch(() => props.groupFormData, (_val) => {
69
+ // formData.value = { ...formData.value, ...props.groupFormData }
70
+ // })
89
71
  onBeforeMount(() => {
90
- if (!initStatus.value)
91
- init(props)
72
+ init()
92
73
  })
93
74
  interface XFormLike {
94
75
  validate: () => Promise<void>
@@ -112,6 +93,7 @@ function removeRef(refValue: XFormLike) {
112
93
  }
113
94
 
114
95
  async function submit() {
96
+ console.log(props.groupFormData)
115
97
  for (const res of xFormListRef.value) {
116
98
  try {
117
99
  await res.validate()
@@ -143,7 +125,7 @@ defineExpose({ init, removeRef, xFormListRef })
143
125
 
144
126
  <template>
145
127
  <div v-if="isInit" id="x-form-group">
146
- <VanTabs :scrollspy="propsData.isScrollspy" sticky :offset-top="offsetTop">
128
+ <VanTabs :scrollspy="props.isScrollspy" sticky :offset-top="offsetTop" :show-header="props.showTabHeader">
147
129
  <VanTab
148
130
  v-for="(item, index) in renderableGroupItems"
149
131
  :key="item.groupName ? (item.groupName + index) : index"
@@ -153,7 +135,7 @@ defineExpose({ init, removeRef, xFormListRef })
153
135
  class="x-form-group-item"
154
136
  :class="{ 'is-last': index === renderableGroupItems.length - 1 }"
155
137
  >
156
- <div v-if="item.describe && propsData.isScrollspy && (item.groupName || item.slotName)" class="form-group-title">
138
+ <div v-if="item.describe && props.isScrollspy && (item.groupName || item.slotName)" class="form-group-title">
157
139
  <span class="form-group-bar" />
158
140
  <span class="form-group-text">{{ item.describe }}</span>
159
141
  </div>
@@ -193,7 +175,6 @@ defineExpose({ init, removeRef, xFormListRef })
193
175
 
194
176
  <style scoped lang="less">
195
177
  #x-form-group {
196
- padding: 12px;
197
178
  display: flex;
198
179
  flex-direction: column;
199
180
  background-color: rgb(247, 248, 250);
@@ -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
+ }
@@ -10,7 +10,6 @@ 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'
14
13
  import XFormView from '@af-mobile-client-vue3/views/component/XFormView/index.vue'
15
14
  import XOlMapView from '@af-mobile-client-vue3/views/component/XOlMapView/index.vue'
16
15
  import XLocationPicker from '@af-mobile-client-vue3/views/component/XOlMapView/XLocationPicker/index.vue'
@@ -67,11 +66,6 @@ const routes: Array<RouteRecordRaw> = [
67
66
  name: 'XCellDetailView',
68
67
  component: XCellDetailView,
69
68
  },
70
- {
71
- path: '/xformgroup222',
72
- name: 'xformgroup222',
73
- component: xformgroup222,
74
- },
75
69
  {
76
70
  path: '/Component/XFormGroupView',
77
71
  name: 'XFormGroupView',
@@ -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,157 +1,147 @@
1
1
  <script setup lang="ts">
2
2
  import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
3
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
- import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
5
- import { defineEmits, ref } from 'vue'
3
+ import { defineOptions, onActivated, onMounted, ref } from 'vue'
6
4
  import { useRouter } from 'vue-router'
7
5
 
8
- // 定义事件
9
- const emit = defineEmits(['deleteRow'])
10
- const userInfo = useUserStore().getUserInfo()
11
- // 访问路由
6
+ defineOptions({ name: 'XCellListView' })
7
+ const configName = ref('ApplyMobileProcessCRUD')
8
+ const serviceName = ref('af-apply')
12
9
  const router = useRouter()
13
- // 获取默认值
14
- const idKey = ref('o_id')
15
-
16
- // 简易crud表单测试
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')
24
-
25
- // 资源权限测试
26
- // const configName = ref('crud_sources_test')
27
- // const serviceName = ref('af-system')
28
-
29
- // 实际业务测试
30
- // const configName = ref('lngChargeAuditMobileCRUD')
31
- // const serviceName = ref('af-gaslink')
32
-
33
- // 跳转到详情页面
34
- // function toDetail(item) {
35
- // router.push({
36
- // name: 'XCellDetailView',
37
- // params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
38
- // query: {
39
- // operName: item[operNameKey.value],
40
- // method:item[methodKey.value],
41
- // requestMethod:item[requestMethodKey.value],
42
- // operatorType:item[operatorTypeKey.value],
43
- // operUrl:item[operUrlKey.value],
44
- // operIp:item[operIpKey.value],
45
- // costTime:item[costTimeKey.value],
46
- // operTime:item[operTimeKey.value],
47
- //
48
- // title: item[titleKey.value],
49
- // businessType: item[businessTypeKey.value],
50
- // status:item[statusKey.value]
51
- // }
52
- // })
53
- // }
54
-
55
- // 跳转到表单——以表单组来渲染纯表单
56
- function toDetail(item) {
57
- router.push({
58
- name: 'xformgroup222',
59
- // query: {
60
- // id: item[idKey.value],
61
- // id: item.rr_id,
62
- // o_id: item.o_id,
63
- // },
64
- })
10
+ // 删除功能
11
+ function phone(result) {
12
+ // todo 调用真机进行通话
65
13
  }
66
-
67
- // 新增功能
68
- // function addOption(totalCount) {
69
- // router.push({
70
- // name: 'XFormView',
71
- // params: { id: totalCount, openid: totalCount },
72
- // query: {
73
- // configName: configName.value,
74
- // serviceName: serviceName.value,
75
- // mode: '新增',
76
- // },
77
- // })
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
- // }
14
+ // 跳转流程处理
15
+ function action(row) {
16
+ router.push({ name: 'XFormGroupView', query: { workflowId: row.ab_f_workflow_id, stepId: row.ws_f_step_id } })
94
17
  }
95
-
96
- // 修改功能
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
- }
109
-
110
- // 删除功能
111
- function deleteRow(result) {
112
- emit('deleteRow', result.o_id)
18
+ // 工作日志
19
+ function worklog(row) {
20
+ router.push({ name: 'worklog', query: { workflowid: row.ab_f_workflow_id, defname: row.ws_f_name } })
113
21
  }
22
+ onMounted(() => {
23
+ console.log('初始化页面===')
24
+ })
25
+ onActivated(() => {
26
+ // 每次回到页面都会触发
27
+ console.log('activated: 每次回到页面都会触发')
28
+ })
114
29
  </script>
115
30
 
116
31
  <template>
117
- <NormalDataLayout id="XCellListView" title="工作计划">
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
- <!-- /> -->
145
- <XCellList
146
- service-name="af-safecheck"
147
- config-name="temporarySecurityCheckCRUD"
148
- :custom-add="true"
149
- @to-detail="toDetail"
150
- @add="addOption"
151
- />
152
- </template>
153
- </NormalDataLayout>
32
+ <XCellList
33
+ :config-name="configName"
34
+ :service-name="serviceName"
35
+ @phone="phone"
36
+ @action="action"
37
+ @worklog="worklog"
38
+ />
154
39
  </template>
155
40
 
156
41
  <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
+ }
157
147
  </style>
@@ -1,35 +1,36 @@
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'
3
4
  import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
5
  import { showDialog } from 'vant'
5
6
  import { ref } from 'vue'
6
7
  import { useRoute } from 'vue-router'
7
8
 
8
- // const configName = ref('reviewFormGroup')
9
- // const serviceName = ref('af-revenue')
10
-
11
9
  // 纯表单
12
- // const configName = ref('form_check_test')
13
- // const serviceName = ref('af-system')
10
+ const configName = ref('appapplyuserinfoFormGroup')
11
+ const serviceName = ref('af-apply')
14
12
 
15
13
  // const configName = ref("计划下发Form")
16
14
  // const serviceName = ref("af-linepatrol")
17
15
 
18
16
  // 表单组
19
- const configName = ref('lngChargeAuditMobileFormGroup')
20
- const serviceName = ref('af-gaslink')
17
+ // const configName = ref('lngChargeAuditMobileFormGroup')
18
+ // const serviceName = ref('af-gaslink')
21
19
 
22
- const formData = ref({})
20
+ const formData = ref({t_userinfo:{f_user_name:111}})
23
21
  const formGroup = ref(null)
24
22
  const route = useRoute()
25
23
  const isInit = ref(false)
26
24
  function submit(_result) {
27
- showDialog({ message: '提交成功' }).then(() => {
28
- console.log('12121')
29
- // history.back()
30
- })
25
+ showDialog({ message: '提交成功' })
26
+ history.back()
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)
31
33
  }
32
-
33
34
  // 表单组——数据
34
35
  // function initComponents () {
35
36
  // runLogic('getlngChargeAuditMobileFormGroupData', {id: 29}, 'af-gaslink').then((res) => {
@@ -59,20 +60,28 @@ function submit(_result) {
59
60
  // onBeforeMount(() => {
60
61
  // initComponents()
61
62
  // })
63
+ function a(){
64
+ formData.value.t_userinfo.f_user_name = '453333333'
65
+ }
62
66
  </script>
63
67
 
64
68
  <template>
65
69
  <NormalDataLayout id="XFormGroupView" title="纯表单">
66
70
  <template #layout_content>
71
+ <button @click="a">修改</button>
67
72
  <!-- v-if="isInit" -->
68
73
  <XFormGroup
69
74
  ref="formGroup"
70
- config-name="ApplyAddContractFormGroup"
71
- service-name="af-apply"
75
+ :config-name="configName"
76
+ :service-name="serviceName"
72
77
  :group-form-data="formData"
73
78
  mode="新增"
74
79
  @submit="submit"
75
- />
80
+ >
81
+ <!-- <template #device="{ setRef, removeRef, item, formData }">
82
+ <XFormView :setRef="setRef" :formGroupName="'myXForm'"/>
83
+ </template>-->
84
+ </XFormGroup>
76
85
  </template>
77
86
  </NormalDataLayout>
78
87
  </template>
@@ -1,25 +1,105 @@
1
1
  <script setup lang="ts">
2
+ // 组件顶部功能说明:本组件为表单视图,支持通过 setRef 注册自身到父组件
2
3
  import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
3
- import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
4
- import { ref } from 'vue'
4
+ import { post } from '@af-mobile-client-vue3/services/restTools'
5
+ import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
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'
5
10
 
6
- const configName = ref('addappapplychargeForm')
11
+ const props = withDefaults(defineProps<{
12
+ setRef?: (refValue: any) => void
13
+ removeRef?: (refValue: any) => void
14
+ formGroupName?: string
15
+ }>(), {
16
+ setRef: () => {},
17
+ removeRef: () => {},
18
+ formGroupName: '',
19
+ })
20
+ const configName = ref('mobile_OtherChargeCancelForm')
7
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 = {
26
+ f_cancel_reason: '1111',
27
+ }
8
28
 
9
- const formGroupAddConstruction = ref(null)
29
+ const xFormRef = ref()
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, { 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
+ // })
10
92
  </script>
11
93
 
12
94
  <template>
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>
95
+ <XForm
96
+ ref="xFormRef"
97
+ mode="新增"
98
+ :config-name="configName"
99
+ :service-name="serviceName"
100
+ :form-data="formData"
101
+ @on-submit="submit"
102
+ />
23
103
  </template>
24
104
 
25
105
  <style scoped lang="less">
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://aote-office.8866.org:31567'
15
- const v3Server = 'http://aote-office.8866.org:31567'
14
+ const v4Server = 'http://192.168.50.67:31577'
15
+ const v3Server = 'https://wkf.qhgas.com'
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'
@@ -1,97 +0,0 @@
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>