浏览代码

feat:待阅公文完成

DESKTOP-07F1812\coder 2 年之前
父节点
当前提交
64e6145531

二进制
src/assets/todoReadDoucument/haveRead.png


二进制
src/assets/todoReadDoucument/waitForRead.png


+ 64 - 0
src/pages/officialDocumentManager/todoReadDoucument/bureauDocument/index.vue

@@ -0,0 +1,64 @@
+<script setup>
+import { getAssetsImages } from '/src/utils/getAssets'
+
+const list = ref([])
+const loading = ref(false)
+const finished = ref(false)
+let page = 1
+function onLoad() {
+  loading.value = true
+  request({
+    url: '/jdbg/gwgl_gw/index',
+    data: {
+      page,
+      limit: 20,
+      my_read: 1,
+      gw_fb_depart: '2',
+    },
+  }).then((res) => {
+    const data = res.data
+    list.value = [...list.value, ...data.page_data]
+    finished.value = data.total_page === page
+    page++
+    loading.value = false
+  })
+}
+const router = useRouter()
+function cellClick(gw_id, is_read) {
+  router.push({ path: '/officialDocumentManager/todoReadDoucument/detail', query: { gw_id, is_read } })
+}
+</script>
+
+<template>
+  <div>
+    <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
+      <van-cell
+        v-for="(item, index) in list" :key="item" :title="`${index + 1}. ${item.gw_title}`"
+        @click="cellClick(item.gw_id, item.is_read)"
+      >
+        <template #value>
+          <img
+            :src="item.is_read == 1 ? getAssetsImages('todoReadDoucument/haveRead.png') : getAssetsImages('todoReadDoucument/waitForRead.png')"
+          >
+        </template>
+      </van-cell>
+    </van-list>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.van-cell__title) {
+  width: 90% !important;
+  flex: auto
+}
+
+:deep(.van-cell__value) {
+  width: 10% !important;
+  flex: auto
+}
+
+img {
+  width: 33px;
+  height: 33px;
+}
+</style>

+ 88 - 0
src/pages/officialDocumentManager/todoReadDoucument/detail/index.vue

@@ -0,0 +1,88 @@
+<script setup>
+import { closeToast, showLoadingToast } from 'vant'
+import Pdfh5 from 'pdfh5'
+
+const { currentRoute } = useRouter()
+const route = currentRoute.value
+const gw_id = route.query.gw_id
+const is_read = route.query.is_read
+const detailData = ref({})
+showLoadingToast({
+  message: '加载中...',
+  forbidClick: true,
+})
+request({
+  url: '/jdbg/gwgl_gw/detail',
+  data: {
+    gw_id,
+  },
+}).then((res) => {
+  closeToast()
+  detailData.value = res.data.one_info
+  const appendUrl = res.data.one_info.gw_content.split('|')[0]
+  const curFileShowUrl = appendUrl.replace(/\.\w+$/, '.pdf')
+  const pdfh5 = new Pdfh5('#pdfContent', {
+    pdfurl: curFileShowUrl,
+    scrollEnable: false,
+    zoomEnable: false,
+  })
+})
+</script>
+
+<template>
+  <div>
+    <div class="tableContainer">
+      <div class="topPart">
+        <table class="Tb" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="titleOpt">
+              类型:
+            </td>
+            <td>{{ detailData.lb_name }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              标题:
+            </td>
+            <td>{{ detailData.gw_title }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              发文字号:
+            </td>
+            <td>{{ detailData.gw_zh }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              发起人:
+            </td>
+            <td>{{ detailData.gw_fqr_name }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              发起科室:
+            </td>
+            <td>{{ detailData.gw_fqks_name }}</td>
+          </tr>
+          <tr>
+            <td class="titleOpt">
+              发起时间:
+            </td>
+            <td>{{ detailData.create_dateline }}</td>
+          </tr>
+
+          <tr>
+            <td class="titleOpt">
+              状态:
+            </td>
+            <td>{{ is_read == '1' ? '已阅' : '待阅' }}</td>
+          </tr>
+        </table>
+      </div>
+    </div>
+
+    <div id="pdfContent" />
+  </div>
+</template>
+
+<style lang="scss" scoped></style>

+ 17 - 0
src/pages/officialDocumentManager/todoReadDoucument/index.vue

@@ -0,0 +1,17 @@
+<script setup>
+import bureauDocument from './bureauDocument/index.vue'
+import schoolDoucment from './schoolDoucment/index.vue'
+</script>
+
+<template>
+  <div>
+    <van-tabs :sticky="true">
+      <van-tab title="教育局发文">
+        <bureauDocument />
+      </van-tab>
+      <van-tab title="学校发文">
+        <schoolDoucment />
+      </van-tab>
+    </van-tabs>
+  </div>
+</template>

+ 64 - 0
src/pages/officialDocumentManager/todoReadDoucument/schoolDoucment/index.vue

@@ -0,0 +1,64 @@
+<script setup>
+import { getAssetsImages } from '/src/utils/getAssets'
+
+const list = ref([])
+const loading = ref(false)
+const finished = ref(false)
+let page = 1
+function onLoad() {
+  loading.value = true
+  request({
+    url: '/jdbg/gwgl_gw/index',
+    data: {
+      page,
+      limit: 20,
+      my_read: 1,
+      gw_fb_depart: '1',
+    },
+  }).then((res) => {
+    const data = res.data
+    list.value = [...list.value, ...data.page_data]
+    finished.value = data.total_page === page
+    page++
+    loading.value = false
+  })
+}
+const router = useRouter()
+function cellClick(gw_id, is_read) {
+  router.push({ path: '/officialDocumentManager/todoReadDoucument/detail', query: { gw_id, is_read } })
+}
+</script>
+
+<template>
+  <div>
+    <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
+      <van-cell
+        v-for="(item, index) in list" :key="item" :title="`${index + 1}. ${item.gw_title}`"
+        @click="cellClick(item.gw_id, item.is_read)"
+      >
+        <template #value>
+          <img
+            :src="item.is_read == 1 ? getAssetsImages('todoReadDoucument/haveRead.png') : getAssetsImages('todoReadDoucument/waitForRead.png')"
+          >
+        </template>
+      </van-cell>
+    </van-list>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.van-cell__title) {
+  width: 90% !important;
+  flex: auto
+}
+
+:deep(.van-cell__value) {
+  width: 10% !important;
+  flex: auto
+}
+
+img {
+  width: 33px;
+  height: 33px;
+}
+</style>