Browse Source

no message

linwenxin 5 months ago
parent
commit
2a8027aef4
3 changed files with 67 additions and 3 deletions
  1. 8 0
      src/api/common.js
  2. 57 3
      src/layout/index.vue
  3. 2 0
      src/views/login/index.vue

+ 8 - 0
src/api/common.js

@@ -1,5 +1,13 @@
 import request, { postBlob, getBlob, handleImport } from '@/utils/request'
 
+export function comListDownloadGet(params) {
+  return request({
+    url: '/com/list/download/get',
+    method: 'get',
+    params
+  })
+}
+
 export function adminWebsitPayConfigList(params) {
   return request({
     url: '/admin/websit/pay/config/list',

+ 57 - 3
src/layout/index.vue

@@ -9,6 +9,17 @@
       </div>
       <app-main />
     </div>
+    <el-dialog title="文件下发通知" width="700px" :visible.sync="dialogTableVisible">
+      <el-table :data="ListDownload" size="mini">
+        <el-table-column property="title" label="标题"></el-table-column>
+        <el-table-column property="createTime" label="下发时间" width="120"></el-table-column>
+        <el-table-column label="操作" width="120">
+          <template slot-scope="scope">
+            <el-button @click="handleClick(scope.row)" type="text" size="small">确认接受并且下载</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 
@@ -16,14 +27,16 @@
 import { Navbar, Sidebar, AppMain } from './components'
 import TagsView from './components/TagsView/index'
 import ResizeMixin from './mixin/ResizeHandler'
-
+import { comListDownloadGet } from '@/api/common'
+import { exportFile } from '@/api/universal/universal_list'
+import { downloadFiles } from '@/utils/util'
 export default {
   name: 'Layout',
   components: {
     Navbar,
     Sidebar,
     AppMain,
-    TagsView,
+    TagsView
   },
   mixins: [ResizeMixin],
   computed: {
@@ -48,8 +61,49 @@ export default {
       }
     }
   },
-
+  data() {
+    return {
+      dialogTableVisible: true,
+      ListDownload: []
+    }
+  },
+  mounted() {
+    if (window.localStorage.getItem('dakaitishichuangkou')) {
+      window.localStorage.removeItem('dakaitishichuangkou')
+      // 打开提示窗口
+      comListDownloadGet({ pageNo: 1, pageSize: -1 }).then(res => {
+        this.ListDownload = res.data.records
+        if (this.ListDownload.length) {
+          this.dialogTableVisible = true
+        }
+      })
+    }
+  },
   methods: {
+    handleClick(item) {
+      if (item.isPwd) {
+        this.$prompt('请输入下载密码', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          inputValidator: value => {
+            if (!value) {
+              return '密码不能为空!'
+            }
+          }
+        })
+          .then(({ value }) => {
+            downloadFiles('com/list/download', {
+              id: item.id,
+              downloadPwd: value
+            })
+          })
+          .catch(() => {})
+      } else {
+        downloadFiles('com/list/download', {
+          id: item.id
+        })
+      }
+    },
     handleClickOutside() {
       this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
     }

+ 2 - 0
src/views/login/index.vue

@@ -207,6 +207,7 @@ export default {
     }
   },
   created() {
+    window.localStorage.removeItem('dakaitishichuangkou')
     // 获取缓存信息
     if (localStorage.getItem('greemall_login')) {
       let storageData = JSON.parse(localStorage.getItem('greemall_login'))
@@ -269,6 +270,7 @@ export default {
           this.$store
             .dispatch('user/login', this.loginForm)
             .then(() => {
+              window.localStorage.setItem('dakaitishichuangkou', 'true')
               this.$router.push({ path: this.redirect || '/' })
               this.saveUnAndPw()
               this.loading = false