af-mobile-client-vue3 1.2.19 → 1.2.21

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.
@@ -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,142 +1,30 @@
1
1
  <script setup lang="ts">
2
2
  import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
3
- import { onMounted, ref } from 'vue'
3
+ import { ref } from 'vue'
4
4
  import { useRouter } from 'vue-router'
5
5
 
6
- const configName = ref('ApplyMobileProcessCRUD')
7
- const serviceName = ref('af-apply')
8
6
  const router = useRouter()
9
-
10
- // 删除功能
11
- function phone(result) {
12
- // todo 调用真机进行通话
13
- }
14
- // 跳转流程处理
15
- function action(row) {
16
- router.push({ name: 'stepDetail', query: { workflowId: row.ab_f_workflow_id, stepId: row.ws_f_step_id } })
7
+ const configName = ref('ApplyContractPhoneCRUD')
8
+ const xCellListSupplementalAgreement = ref()
9
+ // 详情
10
+ function add(row) {
11
+ console.log('>>>> 新增')
17
12
  }
18
- // 工作日志
19
- function worklog(row) {
20
- router.push({ name: 'worklog', query: { workflowid: row.ab_f_workflow_id, defname: row.ws_f_name } })
13
+ function cancellation(row) {
14
+ console.log('>>>> 作废')
21
15
  }
22
- onMounted(() => {
23
- })
24
16
  </script>
25
17
 
26
18
  <template>
27
19
  <XCellList
20
+ ref="xCellListSupplementalAgreement"
21
+ service-name="af-apply"
28
22
  :config-name="configName"
29
- :service-name="serviceName"
30
- @phone="phone"
31
- @action="action"
32
- @worklog="worklog"
23
+ :custom-add="true"
24
+ @add="add"
25
+ @cancellation="cancellation"
33
26
  />
34
27
  </template>
35
28
 
36
29
  <style scoped lang="less">
37
- .cell-search-after {
38
- padding: 0 12px 12px 12px;
39
- background-color: #fff;
40
- .van-row:first-child {
41
- align-items: center;
42
- margin-bottom: 8px;
43
- padding: 0 2px;
44
- h4 {
45
- font-size: 1.08rem;
46
- font-weight: 600;
47
- margin: 0;
48
- color: #222;
49
- letter-spacing: 1px;
50
- }
51
- .stat-date-range {
52
- display: flex;
53
- align-items: center;
54
- justify-content: flex-end;
55
- font-size: 0.92rem;
56
- color: #b0b3b8;
57
- font-weight: 400;
58
- span {
59
- margin-left: 4px;
60
- font-size: 0.92rem;
61
- color: #b0b3b8;
62
- }
63
- .van-icon {
64
- font-size: 1rem;
65
- color: #b0b3b8;
66
- margin-right: 2px;
67
- }
68
- }
69
- }
70
- .van-row:nth-child(2) {
71
- margin-top: 8px;
72
- // 统计卡片间距由gutter控制
73
- .van-col {
74
- // 让卡片宽度自适应
75
- .stat-card {
76
- width: 100%;
77
- }
78
- }
79
- }
80
- .stat-card {
81
- display: flex;
82
- flex-direction: column;
83
- align-items: center;
84
- justify-content: center;
85
- border-radius: 12px;
86
- padding: 6px 0 4px 0; // 压缩高度
87
- min-height: 44px; // 压缩高度
88
- position: relative;
89
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
90
- background: #f7f8fa;
91
- .stat-num {
92
- font-size: 1.08rem; // 缩小字体
93
- font-weight: 600;
94
- margin-bottom: 2px;
95
- }
96
- .stat-label {
97
- font-size: 0.82rem; // 缩小字体
98
- margin-bottom: 2px;
99
- }
100
- .stat-icon {
101
- position: absolute;
102
- top: 6px;
103
- right: 8px;
104
- font-size: 1rem;
105
- opacity: 0.4;
106
- }
107
- }
108
- .stat-total {
109
- background: #f0f5ff;
110
- color: #2f54eb;
111
- .stat-num,
112
- .stat-label {
113
- color: #2f54eb;
114
- }
115
- .stat-icon {
116
- color: #2f54eb;
117
- }
118
- }
119
- .stat-done {
120
- background: #e6fffb;
121
- color: #13c2c2;
122
- .stat-num,
123
- .stat-label {
124
- color: #13c2c2;
125
- }
126
- .stat-icon {
127
- color: #13c2c2;
128
- }
129
- }
130
- .stat-processing {
131
- background: #f9f0ff;
132
- color: #b37feb;
133
- .stat-num,
134
- .stat-label {
135
- color: #b37feb;
136
- }
137
- .stat-icon {
138
- color: #b37feb;
139
- }
140
- }
141
- }
142
30
  </style>
@@ -6,15 +6,8 @@ import { ref } from 'vue'
6
6
  import { useRoute } from 'vue-router'
7
7
 
8
8
  // 纯表单
9
- const configName = ref('form_check_test')
10
- const serviceName = ref('af-system')
11
-
12
- // const configName = ref("计划下发Form")
13
- // const serviceName = ref("af-linepatrol")
14
-
15
- // 表单组
16
- // const configName = ref('lngChargeAuditMobileFormGroup')
17
- // const serviceName = ref('af-gaslink')
9
+ const configName = ref('AddConstructionForm')
10
+ const serviceName = ref('af-linepatrol')
18
11
 
19
12
  const formData = ref({})
20
13
  const formGroup = ref(null)
@@ -25,36 +18,6 @@ function submit(_result) {
25
18
  history.back()
26
19
  })
27
20
  }
28
-
29
- // 表单组——数据
30
- // function initComponents () {
31
- // runLogic('getlngChargeAuditMobileFormGroupData', {id: 29}, 'af-gaslink').then((res) => {
32
- // formData.value = {...res}
33
- // })
34
- // }
35
-
36
- // 纯表单——数据
37
- // function initComponents() {
38
- // formData.value = { plan_name: 'af-llllll', plan_point: '1号点位', plan_single: '1号点位', plan_range: '2024-12-12' }
39
- // }
40
-
41
- // function initComponents() {
42
- // runLogic('getlngChargeAuditMobileFormGroupData', { id: route.query?.id, o_id: route.query?.o_id }, 'af-gaslink').then((res) => {
43
- // console.log('res------', res)
44
- // formData.value = { ...res }
45
- // formGroup.value.init({
46
- // configName: configName.value,
47
- // serviceName: serviceName.value,
48
- // groupFormData: { ...res },
49
- // mode: "新增"
50
- // })
51
- // isInit.value = true
52
- // })
53
- // }
54
-
55
- // onBeforeMount(() => {
56
- // initComponents()
57
- // })
58
21
  </script>
59
22
 
60
23
  <template>
@@ -7,6 +7,18 @@ const configName = ref('AddConstructionForm')
7
7
  const serviceName = ref('af-linepatrol')
8
8
 
9
9
  const formGroupAddConstruction = ref(null)
10
+ function emitFunc(func, data) {
11
+ console.log('>>>> func: ', func)
12
+ console.log('>>>> data: ', data)
13
+ if (func === 'selectAddress') {
14
+ const add = 'ccss'
15
+ // 设置单个字段
16
+ formGroupAddConstruction.value?.setForm({ address: '你的字符串' })
17
+ }
18
+ }
19
+ function submit(data) {
20
+ console.log('>>>> data: ', JSON.stringify(data))
21
+ }
10
22
  </script>
11
23
 
12
24
  <template>
@@ -17,6 +29,8 @@ const formGroupAddConstruction = ref(null)
17
29
  mode="新增"
18
30
  :config-name="configName"
19
31
  :service-name="serviceName"
32
+ @x-form-item-emit-func="emitFunc"
33
+ @on-submit="submit"
20
34
  />
21
35
  </template>
22
36
  </NormalDataLayout>
@@ -0,0 +1,70 @@
1
+ <script setup lang="ts">
2
+ 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 { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
5
+ import { onBeforeMount, ref, toRaw } from 'vue'
6
+
7
+ const configName = ref('AddConstructionForm')
8
+ const serviceName = ref('af-linepatrol')
9
+ const formGroup = ref(null)
10
+ const formConfig = ref(null)
11
+ const submitSimple = ref(null)
12
+ const isLoading = ref(true)
13
+
14
+ function safeStringify(obj) {
15
+ const seen = new WeakSet()
16
+ return JSON.stringify(toRaw(obj), (key, val) => {
17
+ if (typeof val === 'object' && val !== null) {
18
+ if (seen.has(val))
19
+ return
20
+ seen.add(val)
21
+ }
22
+ return val
23
+ }, 2)
24
+ }
25
+
26
+ function submit(result) {
27
+ console.log('>>>> result: ', safeStringify(result))
28
+ }
29
+
30
+ function loadConfig() {
31
+ return new Promise((resolve) => {
32
+ getConfigByName(configName.value, (result) => {
33
+ submitSimple.value = result.showSubmitBtn
34
+ formConfig.value = result
35
+ resolve(result)
36
+ }, serviceName.value)
37
+ })
38
+ }
39
+
40
+ onBeforeMount(async () => {
41
+ try {
42
+ await loadConfig()
43
+ }
44
+ finally {
45
+ isLoading.value = false
46
+ }
47
+ })
48
+ </script>
49
+
50
+ <template>
51
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
52
+ <template #layout_content>
53
+ <van-loading v-if="isLoading" />
54
+ <XForm
55
+ v-else
56
+ ref="formGroup"
57
+ mode="查询"
58
+ :service-name="serviceName"
59
+ :group-form-items="formConfig"
60
+ :form-data="{}"
61
+ :form-name="formConfig?.groupName || '11111'"
62
+ :submit-button="submitSimple"
63
+ @on-submit="submit"
64
+ />
65
+ </template>
66
+ </NormalDataLayout>
67
+ </template>
68
+
69
+ <style scoped lang="less">
70
+ </style>