af-mobile-client-vue3 1.0.84 → 1.0.85

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.
@@ -0,0 +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
+ }
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
4
+ import { useRoute } from 'vue-router'
5
+
6
+ const route = useRoute()
7
+ const serverName = ref(import.meta.env.VITE_APP_SYSTEM_NAME)
8
+ const configName = ref(route.query.configName ? route.query.configName as string : 'ReportGridTest')
9
+ </script>
10
+
11
+ <template>
12
+ <XReport :config-name="configName" :server-name="serverName" />
13
+ </template>
14
+
15
+ <style scoped lang="less">
16
+ </style>
@@ -29,15 +29,16 @@ const routeState = useRoute()
29
29
 
30
30
  <template>
31
31
  <div class="pageLayout">
32
- <router-view v-slot="{ Component, route }">
33
- <transition :name="routeTransitionName">
32
+ <!-- transition 包裹 router-view 控制台会有警告,router-view在外层会导致动画开始时会闪过一帧上一级页面。先忽略警告这样写 -->
33
+ <transition :name="routeTransitionName">
34
+ <router-view v-slot="{ Component, route }">
34
35
  <keep-alive :include="cachedViews">
35
36
  <div :key="route.name" class="app-wrapper">
36
37
  <component :is="Component" />
37
38
  </div>
38
39
  </keep-alive>
39
- </transition>
40
- </router-view>
40
+ </router-view>
41
+ </transition>
41
42
  <Tabbar v-show="routeState.meta.index !== undefined" :tabbar-data="tabbarData" />
42
43
  </div>
43
44
  </template>
@@ -12,7 +12,10 @@ import NotFound from '@af-mobile-client-vue3/views/common/NotFound.vue'
12
12
  import SingleLayout from '@af-mobile-client-vue3/layout/SingleLayout.vue'
13
13
  import XFormGroupView from '@af-mobile-client-vue3/views/component/XFormGroupView/index.vue'
14
14
  import XSignatureView from '@af-mobile-client-vue3/views/component/XSignatureView/index.vue'
15
+ import XReportGridView from '@af-mobile-client-vue3/views/component/XReportGridView/index.vue'
16
+ import GridView from '@af-mobile-client-vue3/layout/GridView/index.vue'
15
17
  import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
18
+ import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
16
19
 
17
20
  const routes: Array<RouteRecordRaw> = [
18
21
  {
@@ -98,6 +101,21 @@ const routes: Array<RouteRecordRaw> = [
98
101
  name: 'XSignatureView',
99
102
  component: XSignatureView,
100
103
  },
104
+ {
105
+ path: '/Component/XReportGridView',
106
+ name: 'XReportGridView',
107
+ component: XReportGridView,
108
+ },
109
+ {
110
+ path: '/Component/XReport',
111
+ name: 'XReport',
112
+ component: XReport,
113
+ },
114
+ {
115
+ path: '/GridView',
116
+ name: 'GridView',
117
+ component: GridView,
118
+ },
101
119
  ],
102
120
  },
103
121
  {
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import XReport from '@af-mobile-client-vue3/components/data/XReportGrid/XReport.vue'
4
+ import { useRoute } from 'vue-router'
5
+
6
+ const route = useRoute()
7
+ const serverName = ref('af-gaslink')
8
+ // const configName = ref('detailsaddChargesCover')
9
+ const configName = ref(route.query.configName ? route.query.configName : 'ReportGridTest')
10
+ console.log('route==configName', configName)
11
+ </script>
12
+
13
+ <template>
14
+ <XReport :config-name="configName" :server-name="serverName" />
15
+ </template>
16
+
17
+ <style scoped lang="less">
18
+ </style>
@@ -38,6 +38,10 @@ const list = ref([
38
38
  name: 'XSignature 签名组件',
39
39
  to: '/Component/XSignatureView',
40
40
  },
41
+ {
42
+ name: 'XReportGridView 栅格组件',
43
+ to: '/Component/XReportGridView',
44
+ },
41
45
  ])
42
46
 
43
47
  function cleanConfigCache() {
@@ -0,0 +1,52 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ Tabs as VanTabs,
4
+ Tab as VanTab,
5
+ Row as VanRow,
6
+ Button as VanButton
7
+ } from 'vant'
8
+ import { defineProps, watchEffect, onBeforeMount, ref, onMounted, watch, defineEmits } from 'vue'
9
+ import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
10
+ import XFormView from '@af-mobile-client-vue3/views/component/XFormView/index.vue'
11
+ import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
12
+ import { runLogic } from '@af-mobile-client-vue3/services/api/common'
13
+ import { useRoute } from 'vue-router'
14
+ import {getConfigByName, query} from '@af-mobile-client-vue3/services/api/common'
15
+
16
+ const router = useRoute()
17
+ const formData = ref({})
18
+ function initComponents () {
19
+ console.log('router.params=', router.params)
20
+ runLogic('getLngPurchaseOrderAuditGroupData', {id: router.params?.id}).then((res) => {
21
+ console.log('调用logic完成==',res)
22
+ formData.value = {...res}
23
+ console.log('赋值完成===', formData.value)
24
+ })
25
+ }
26
+ onBeforeMount(()=>{
27
+ initComponents()
28
+ })
29
+ const submit = (formData) => {
30
+ console.log('提交表单===', formData)
31
+ const param = {
32
+ type: formData.value.auditInfo.f_approval_status === '审核未通过' ? 0 : 1,
33
+ approval_date:'',
34
+ approval_remark:formData.value.auditInfo.f_approval_status,
35
+ approval_operator:useUserStore.getUserInfo?.name,
36
+ approval_operatorid: useUserStore.getUserInfo?.id,
37
+ record: {od_id:1}
38
+ }
39
+ }
40
+ </script>
41
+
42
+ <template>
43
+
44
+ <NormalDataLayout id="XCellListView" title="采购审核">
45
+ <template #layout_content>
46
+ <XFormView :config-name="'lngPurchaseOrderFormGroup'" @submit="submit" :group-form-data="formData"/>
47
+ </template>
48
+ </NormalDataLayout>
49
+ </template>
50
+ <style scoped lang="less">
51
+
52
+ </style>
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
+ }