Преглед изворни кода

适配新的法律法规和管理制度

wangqi пре 2 недеља
родитељ
комит
5bb84271c8
3 измењених фајлова са 150 додато и 90 уклоњено
  1. 4
    1
      src/view/Home2.vue
  2. 49
    16
      src/view/institution/institutionRegime.vue
  3. 97
    73
      src/view/institution/law.vue

+ 4
- 1
src/view/Home2.vue Прегледај датотеку

239
 const getRecentlyUsed = (jumpPath) => {
239
 const getRecentlyUsed = (jumpPath) => {
240
   const url = '/sgsafe/MenuRecentlyUsed/updateMenuRecentlyUsedStatus'
240
   const url = '/sgsafe/MenuRecentlyUsed/updateMenuRecentlyUsedStatus'
241
   const param = {
241
   const param = {
242
-    jumpPath
242
+    json: JSON.stringify({
243
+      jumpPath,
244
+      applicationId: 'c77da6a732d34400b24374e2cea811ee',
245
+    })
243
   }
246
   }
244
   proxy.$axios.post(url,param).then(res => {
247
   proxy.$axios.post(url,param).then(res => {
245
     if (res.data.code !== 0) {
248
     if (res.data.code !== 0) {

+ 49
- 16
src/view/institution/institutionRegime.vue Прегледај датотеку

1
 <script setup>
1
 <script setup>
2
-import { getCurrentInstance, onMounted, ref } from 'vue';
3
-import { useRouter } from 'vue-router';
4
-
5
-const {
6
-  proxy
7
-} = getCurrentInstance()
2
+import { getCurrentInstance, ref } from 'vue';
3
+const { proxy } = getCurrentInstance()
8
 
4
 
9
 /* 通用方法: 重置list数据 */
5
 /* 通用方法: 重置list数据 */
10
 const basicReset = () => {
6
 const basicReset = () => {
14
   list.value = []
10
   list.value = []
15
 }
11
 }
16
 
12
 
17
-/* 返回上一级页面 */
18
-const router = useRouter()
19
-
20
 /* 在线预览实现 */
13
 /* 在线预览实现 */
21
 import {Base64} from "js-base64";
14
 import {Base64} from "js-base64";
15
+import { showFailToast } from 'vant';
22
 const linShiFid=ref({
16
 const linShiFid=ref({
23
   fileId:''
17
   fileId:''
24
 })
18
 })
68
 const resultData = ref([])
62
 const resultData = ref([])
69
 const fetchData = ref({
63
 const fetchData = ref({
70
   regimeName:'',
64
   regimeName:'',
71
-  regimeScope: ''
65
+  regimeScope: '',
66
+  regimeType: 'safe'
72
 })
67
 })
73
 
68
 
74
 const onSearch = async () => {
69
 const onSearch = async () => {
78
 
73
 
79
 const resetCondition = async () => {
74
 const resetCondition = async () => {
80
   basicReset()
75
   basicReset()
81
-  fetchData.value = {
82
-    regimeName:'',
83
-    regimeScope: ''
84
-  }
76
+  fetchData.value.regimeName = ''
77
+  fetchData.value.regimeScope = ''
85
   await onLoad()
78
   await onLoad()
86
 }
79
 }
87
 
80
 
81
+const currentTab = ref('safe');
82
+const handleClick = (tab) => {
83
+  currentTab.value = tab;
84
+  fetchData.value.regimeType = tab;
85
+  onRefresh();
86
+};
87
+
88
 /* 查询请求 */
88
 /* 查询请求 */
89
 const queryFetch = async () => {
89
 const queryFetch = async () => {
90
   fetchData.value.regimeScope = postBackRegimeScope.value
90
   fetchData.value.regimeScope = postBackRegimeScope.value
157
 const postBackRegimeScope = ref()
157
 const postBackRegimeScope = ref()
158
 const currentDeptName = ref('')
158
 const currentDeptName = ref('')
159
 import OrganizationalWithLeaf from '@/components/OrganizationalWithLeaf.vue';
159
 import OrganizationalWithLeaf from '@/components/OrganizationalWithLeaf.vue';
160
-import { showFailToast } from 'vant';
161
 const showPickerHandle = () => {
160
 const showPickerHandle = () => {
162
   showBottom.value = true
161
   showBottom.value = true
163
 }
162
 }
184
 <template>
183
 <template>
185
   <div class="page-container">
184
   <div class="page-container">
186
     <van-sticky>
185
     <van-sticky>
187
-      <van-nav-bar title="安全制度管理" />
186
+      <van-nav-bar
187
+        title="安全制度管理"
188
+        @click-left="handleClick('safe')"
189
+        @click-right="handleClick('env')"
190
+      >
191
+        <template #left>
192
+          <div class="custom-tab" :class="{ 'custom-tab--active': currentTab === 'safe' }">安全</div>
193
+        </template>
194
+        <template #right>
195
+          <div class="custom-tab" :class="{ 'custom-tab--active': currentTab === 'env' }">环保</div>
196
+        </template>
197
+      </van-nav-bar>
188
 
198
 
189
       <van-search
199
       <van-search
190
         v-model="fetchData.regimeName"
200
         v-model="fetchData.regimeName"
280
   color: #333;
290
   color: #333;
281
 }
291
 }
282
 
292
 
293
+.custom-tab {
294
+  padding: 8px 0;
295
+  font-size: 14px;
296
+  color: var(--van-gray-7, #646566);
297
+  position: relative;
298
+  cursor: pointer;
299
+}
300
+
301
+.custom-tab--active {
302
+  color: var(--van-primary-color, #1989fa);
303
+}
304
+
305
+.custom-tab--active::after {
306
+  content: '';
307
+  position: absolute;
308
+  bottom: 0;
309
+  left: 0;
310
+  width: 100%;
311
+  height: 3px;
312
+  background-color: var(--van-primary-color, #1989fa);
313
+  border-radius: 2px;
314
+}
315
+
283
 </style>
316
 </style>

+ 97
- 73
src/view/institution/law.vue Прегледај датотеку

1
 <script setup>
1
 <script setup>
2
-import { getCurrentInstance, onActivated, onMounted, ref } from 'vue';
3
-import { onBeforeRouteUpdate, useRouter } from 'vue-router';
4
-import { useEmergencyStore } from '@/stores/emergencyManager.js';
5
-
6
-const emergencyInfo =  useEmergencyStore()
7
-const {
8
-  proxy
9
-} = getCurrentInstance()
2
+import { getCurrentInstance, ref } from 'vue';
3
+const { proxy } = getCurrentInstance();
10
 
4
 
11
 /* 通用方法: 重置list数据 */
5
 /* 通用方法: 重置list数据 */
12
 const basicReset = () => {
6
 const basicReset = () => {
13
   finished.value = false;
7
   finished.value = false;
14
   loading.value = true;
8
   loading.value = true;
15
-  pageNum.value = 1
16
-  list.value = []
17
-}
18
-
19
-/* 返回上一级页面 */
20
-const router = useRouter()
9
+  pageNum.value = 1;
10
+  list.value = [];
11
+};
21
 
12
 
22
 /* 查询数据 */
13
 /* 查询数据 */
23
-const pageNum = ref(1)
24
-const pageSize = ref(10)
25
-const total = ref(0)
26
-const resultData = ref([])
14
+const pageNum = ref(1);
15
+const pageSize = ref(10);
16
+const total = ref(0);
17
+const resultData = ref([]);
27
 const fetchData = ref({
18
 const fetchData = ref({
28
-  lawName:''
29
-})
19
+  lawName: '',
20
+  lawType: 'safe'
21
+});
30
 
22
 
31
 const onSearch = () => {
23
 const onSearch = () => {
32
-  basicReset()
33
-  onLoad()
34
-}
24
+  basicReset();
25
+  onLoad();
26
+};
35
 
27
 
36
 const resetCondition = () => {
28
 const resetCondition = () => {
37
-  basicReset()
38
-  fetchData.value = {
39
-    lawName:''
40
-  }
41
-  onLoad()
42
-}
29
+  basicReset();
30
+  fetchData.value.lawName = '';
31
+  onLoad();
32
+};
33
+
34
+const currentTab = ref('safe');
35
+const handleClick = (tab) => {
36
+  currentTab.value = tab;
37
+  fetchData.value.lawType = tab;
38
+  onRefresh();
39
+};
43
 
40
 
44
 /* 查询请求 */
41
 /* 查询请求 */
45
 const queryFetch = async () => {
42
 const queryFetch = async () => {
46
-  if (sessionStorage.getItem("lawName")) {
47
-    fetchData.value.lawName = sessionStorage.getItem("lawName")
48
-    sessionStorage.removeItem("lawName")
43
+  if (sessionStorage.getItem('lawName')) {
44
+    fetchData.value.lawName = sessionStorage.getItem('lawName');
45
+    sessionStorage.removeItem('lawName');
49
   }
46
   }
50
-  const url = '/sgsafe/InstitutionLaw/query'
47
+  const url = '/sgsafe/InstitutionLaw/query';
51
   const param = {
48
   const param = {
52
     page: pageNum.value,
49
     page: pageNum.value,
53
     rows: pageSize.value,
50
     rows: pageSize.value,
54
     params: JSON.stringify(fetchData.value)
51
     params: JSON.stringify(fetchData.value)
55
-  }
52
+  };
56
   try {
53
   try {
57
-    const res = await proxy.$axios.post(url,param);
54
+    const res = await proxy.$axios.post(url, param);
58
     if (res.data.code === 0) {
55
     if (res.data.code === 0) {
59
-      total.value = res.data.data.total
60
-      resultData.value = res.data.data.records
56
+      total.value = res.data.data.total;
57
+      resultData.value = res.data.data.records;
61
     } else {
58
     } else {
62
-      console.log('操作失败!' + res.data.msg)
59
+      console.log('操作失败!' + res.data.msg);
63
     }
60
     }
64
   } catch (error) {
61
   } catch (error) {
65
     console.error('请求出错:', error);
62
     console.error('请求出错:', error);
68
 
65
 
69
 /* 列表加载与下拉刷新 */
66
 /* 列表加载与下拉刷新 */
70
 const list = ref([]);
67
 const list = ref([]);
71
-const refreshing = ref(false)
72
-const loading = ref(false)
73
-const finished = ref(false)
68
+const refreshing = ref(false);
69
+const loading = ref(false);
70
+const finished = ref(false);
74
 
71
 
75
 const onRefresh = () => {
72
 const onRefresh = () => {
76
-  basicReset()
73
+  basicReset();
77
   onLoad();
74
   onLoad();
78
 };
75
 };
79
 
76
 
86
   try {
83
   try {
87
     await queryFetch();
84
     await queryFetch();
88
     if (pageSize.value * pageNum.value < total.value) {
85
     if (pageSize.value * pageNum.value < total.value) {
89
-      list.value = [...list.value,...resultData.value ]
86
+      list.value = [...list.value, ...resultData.value];
90
       pageNum.value++;
87
       pageNum.value++;
91
     } else {
88
     } else {
92
-      list.value = [...list.value,...resultData.value ]
89
+      list.value = [...list.value, ...resultData.value];
93
       finished.value = true;
90
       finished.value = true;
94
     }
91
     }
95
   } catch (error) {
92
   } catch (error) {
101
 };
98
 };
102
 
99
 
103
 /* 在线预览实现 */
100
 /* 在线预览实现 */
104
-import {Base64} from "js-base64";
101
+import { Base64 } from 'js-base64';
105
 import { showFailToast } from 'vant';
102
 import { showFailToast } from 'vant';
106
-const linShiFid=ref({
107
-  fileId:''
108
-})
103
+const linShiFid = ref({ fileId: '' });
109
 const handlePreview = (fileId) => {
104
 const handlePreview = (fileId) => {
110
   if (fetchData.value.lawName) {
105
   if (fetchData.value.lawName) {
111
-    sessionStorage.setItem("lawName", fetchData.value.lawName)
106
+    sessionStorage.setItem('lawName', fetchData.value.lawName);
112
   }
107
   }
113
-  linShiFid.value.fileId= fileId
114
-  getTableDataQueryFile()
115
-}
116
-const bucket = ref(import.meta.env.VITE_BUCKET)
108
+  linShiFid.value.fileId = fileId;
109
+  getTableDataQueryFile();
110
+};
111
+const bucket = ref(import.meta.env.VITE_BUCKET);
117
 const getTableDataQueryFile = () => {
112
 const getTableDataQueryFile = () => {
118
-  var url = 'framework/Common/queryFileWithValues'
119
-  var param = {
120
-    fId: linShiFid.value.fileId,
121
-  }
113
+  const url = 'framework/Common/queryFileWithValues';
114
+  let param = {
115
+    fId: linShiFid.value.fileId
116
+  };
122
   proxy.$axios.get(url, param).then(response => {
117
   proxy.$axios.get(url, param).then(response => {
123
-    if (response.data.code == 0) {
124
-      const downloadPath = import.meta.env.VITE_BASE_API + '/framework/Common/downloadFileS3?bucket='+ bucket.value + '&id='
118
+    if (response.data.code === 0) {
119
+      const downloadPath = import.meta.env.VITE_BASE_API + '/framework/Common/downloadFileS3?bucket=' + bucket.value + '&id=';
125
       const fileListWithUrls = response.data.data.map(file => ({
120
       const fileListWithUrls = response.data.data.map(file => ({
126
         ...file,
121
         ...file,
127
         url: `${downloadPath}${file.id}`, // 添加完整的下载路径
122
         url: `${downloadPath}${file.id}`, // 添加完整的下载路径
131
         id: file.id
126
         id: file.id
132
       }));
127
       }));
133
 
128
 
134
-      var originUrl = import.meta.env.VITE_PREVIEW_BASE_API + 'framework/Common/downloadFileS3?bucket=' + bucket.value +'&id=' + fileListWithUrls[0].id
135
-      var previewUrl = originUrl + '&fullfilename=' + Date.now() + fileListWithUrls[0].name
136
-      var url = import.meta.env.VITE_PREVIEW_API + 'onlinePreview?url=' + encodeURIComponent(Base64.encode(
137
-        previewUrl)) + '&officePreviewType=pdf'
129
+      let originUrl = import.meta.env.VITE_PREVIEW_BASE_API + 'framework/Common/downloadFileS3?bucket=' + bucket.value + '&id=' + fileListWithUrls[0].id;
130
+      let previewUrl = originUrl + '&fullfilename=' + Date.now() + fileListWithUrls[0].name;
131
+      let url = import.meta.env.VITE_PREVIEW_API + 'onlinePreview?url=' + encodeURIComponent(Base64.encode(
132
+        previewUrl)) + '&officePreviewType=pdf';
138
       window.open(url);
133
       window.open(url);
139
     } else {
134
     } else {
140
-      showFailToast('失败!' + response.data.msg)
135
+      showFailToast('失败!' + response.data.msg);
141
     }
136
     }
142
-  })
143
-}
137
+  });
138
+};
144
 
139
 
145
 </script>
140
 </script>
146
 
141
 
147
 <template>
142
 <template>
148
   <div class="page-container">
143
   <div class="page-container">
149
     <van-sticky>
144
     <van-sticky>
150
-      <van-nav-bar title="法律法规" />
145
+      <van-nav-bar
146
+        title="法律法规"
147
+        @click-left="handleClick('safe')"
148
+        @click-right="handleClick('env')"
149
+      >
150
+        <template #left>
151
+          <div class="custom-tab" :class="{ 'custom-tab--active': currentTab === 'safe' }">安全</div>
152
+        </template>
153
+        <template #right>
154
+          <div class="custom-tab" :class="{ 'custom-tab--active': currentTab === 'env' }">环保</div>
155
+        </template>
156
+      </van-nav-bar>
157
+
151
       <van-search
158
       <van-search
152
         v-model="fetchData.lawName"
159
         v-model="fetchData.lawName"
153
         @search="onSearch"
160
         @search="onSearch"
208
   background-color: #fff;
215
   background-color: #fff;
209
 }
216
 }
210
 
217
 
211
-.label-content {
212
-  display: flex;
213
-  flex-direction: column;
214
-  gap: 4px;
215
-}
216
-
217
 .bold-title {
218
 .bold-title {
218
   font-weight: bold;
219
   font-weight: bold;
219
   color: #333;
220
   color: #333;
220
 }
221
 }
221
 
222
 
223
+.custom-tab {
224
+  padding: 8px 0;
225
+  font-size: 14px;
226
+  color: var(--van-gray-7, #646566);
227
+  position: relative;
228
+  cursor: pointer;
229
+}
230
+
231
+.custom-tab--active {
232
+  color: var(--van-primary-color, #1989fa);
233
+}
234
+
235
+.custom-tab--active::after {
236
+  content: '';
237
+  position: absolute;
238
+  bottom: 0;
239
+  left: 0;
240
+  width: 100%;
241
+  height: 3px;
242
+  background-color: var(--van-primary-color, #1989fa);
243
+  border-radius: 2px;
244
+}
245
+
222
 </style>
246
 </style>

Loading…
Откажи
Сачувај