Bladeren bron

Merge remote-tracking branch 'origin/develop' into develop

scorpioyq 2 jaren geleden
bovenliggende
commit
eb78c7854a

+ 4 - 1
src/api/resource/index.js

@@ -126,9 +126,12 @@ export default {
    * @param id
    * @returns {Promise<unknown>}
    */
-  fileDetail(id) {
+  fileDetailByFile(id) {
     return fetch('/wutong-library/library/detail/file/' + id)
   },
+  fileDetail(id) {
+    return fetch('/wutong-library/library/detail/' + id)
+  },
   /**
    * 删除文件
    * @param params

+ 1 - 1
src/page/login.vue

@@ -49,7 +49,7 @@
                 <vue-qr
                   :currentLevel="3"
                   :logoCornerRadius="4"
-                  :logoScale="0.25"
+                  :logoScale="0.2"
                   :logoSrc="logoSrc"
                   :text="qrCodeText"
                   size="260"

+ 10 - 10
src/views/dash/compoents/notice.vue

@@ -5,13 +5,16 @@
     </el-icon>
     <div class="roll full-width">
       <ul :class="{ marquee_top: animate }">
-        <li
-          v-for="(item, index) in data"
-          :key="index"
-          class="pointer"
-          @click="checkNotice(item)"
-        >
-          <span class="main-color bold">{{ item.title }}</span>
+        <li v-for="(item, index) in data" :key="index" class="pointer">
+          <div class="flex flex-center flex-justify-between">
+            <preview :id="item.fileId">
+              <template #title>
+                <div class="main-color">
+                  {{ item.title }}
+                </div>
+              </template>
+            </preview>
+          </div>
         </li>
       </ul>
     </div>
@@ -50,9 +53,6 @@ export default {
         this.data.shift()
         this.animate = false
       }, 500)
-    },
-    checkNotice(item) {
-      console.log(item)
     }
   }
 }

+ 1 - 1
src/views/dash/compoents/read.vue

@@ -45,7 +45,7 @@ export default {
     getList() {
       this.$api.dash.mpList().then(res => {
         if (res.code === 200) {
-          this.data = res.data[0].content
+          // this.data = res.data[0].content
         } else {
           console.log(res)
         }

+ 129 - 0
src/views/home/component/task.vue

@@ -0,0 +1,129 @@
+<template>
+  <div>
+    <el-form :rules="rules" :model="form">
+      <el-form-item label="任务名称" prop="title">
+        <el-input v-model="form.title" placeholder="请填写任务名称"></el-input>
+      </el-form-item>
+      <el-form-item label="任务说明" prop="remark">
+        <el-input
+          v-model="form.remark"
+          type="textarea"
+          :rows="6"
+          placeholder="请填写任务说明"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="任务期限">
+        <el-date-picker
+          v-model="form.date"
+          type="daterange"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="截止日期"
+          format="YYYY-MM-DD"
+          value-format="YYYY-MM-DD"
+        />
+      </el-form-item>
+      <div class="full-width flex flex-align-center mt-10">
+        <span class="font-14 bold">生成二维码</span>
+        <el-button
+          circle
+          class="ml-20"
+          icon="Picture"
+          type="danger"
+          @click="initCode()"
+        />
+      </div>
+      <div
+        class="full-width mt-20 border-top padding-top flex flex-justify-end"
+      >
+        <el-button @click="close">取消</el-button>
+        <el-button type="primary" @click="close">关闭</el-button>
+      </div>
+    </el-form>
+    <el-dialog v-model="qrCodeShow" width="400px">
+      <div
+        class="flex flex-col flex-center"
+        style="height: 400rpx; width: 400rpx"
+      >
+        <vue-qr
+          :currentLevel="3"
+          :logoCornerRadius="4"
+          :logoScale="0.25"
+          :text="qrCodeText"
+          size="340"
+        />
+        <span>右键复制二维码,通过微信进行分享</span>
+        <span>{{ qrCodeText }}</span>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import VueQr from 'vue-qr/src/packages/vue-qr.vue'
+import { objectToParams } from '@/utils/tools.js'
+export default {
+  name: 'task',
+  components: { VueQr },
+  props: {
+    projectId: {
+      type: String,
+      default: ''
+    },
+    folders: {
+      type: Array,
+      default: []
+    }
+  },
+  data() {
+    return {
+      qrCodeText: '',
+      qrCodeShow: false,
+      rules: {
+        title: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
+        remark: [{ required: true, message: '请输入任务说明', trigger: 'blur' }]
+      },
+      form: {
+        title: '',
+        remark: '',
+        date: '',
+        taskStartTime: '',
+        taskEndTime: ''
+      }
+    }
+  },
+  methods: {
+    initCode() {
+      // this.qrCodeShow = true
+      if (this.form.date.length !== 2) {
+        this.$message.error('请按要求选择时间段')
+        return
+      }
+      this.form.folderIds = this.folders.map(sub => sub.id)
+      this.form.taskStartTime = this.form.date[0]
+      this.form.taskEndTime = this.form.date[1]
+      this.form.projectId = this.projectId
+      this.$api.task.add(this.form).then(res => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+          this.qrCodeShow = true
+          const data = res.data
+          this.qrCodeText =
+            'https://prod.wutongshucloud.com/apply?id=' +
+            data.qrcodeId +
+            '&' +
+            objectToParams(res.data)
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
+    close() {
+      this.$emit('close')
+    }
+  }
+}
+</script>
+
+<style scoped></style>

+ 3 - 0
src/views/resource/component/floder.vue

@@ -49,6 +49,9 @@ export default {
 
   methods: {
     folderAdd() {
+      if (this.title.length === 0) {
+        return
+      }
       const data = {
         projectId: this.info.projectId,
         stageId: this.info.stageId,

+ 46 - 28
src/views/resource/component/preview.vue

@@ -1,6 +1,11 @@
 <template>
   <div>
-    <el-button type="primary" text @click="openFile">查看</el-button>
+    <el-button v-if="title.length === 0" type="primary" text @click="detail"
+      >查看</el-button
+    >
+    <div v-else @click="detail">
+      <slot name="title"></slot>
+    </div>
     <el-image-viewer
       v-if="showImage"
       :url-list="preList"
@@ -16,24 +21,21 @@
       </template>
       <div>
         <div v-if="data">
-          <el-empty
-            v-if="data.imgs.length === 0"
-            style="height: 90vh"
-            description="暂时无法预览,您可以点击 下载 按钮,下载原文件 "
-            class="full-height flex flex-center"
-          />
+          <div v-if="data.imgs.length === 0" class="flex flex-center">
+            <div v-html="data.content" class="preview"></div>
+          </div>
           <div v-else v-for="item in data.imgs" :key="item.id">
             <img :src="item.filePath" style="width: 1100px" />
           </div>
         </div>
         <div
           class="bottom flex flex-center flex-justify-center"
-          v-if="info.isAccess === 2 || showAction"
+          v-if="isAccess === 2 || showAction"
         >
           <el-button type="primary" icon="Download" @click="downloadClick"
             >下 载</el-button
           >
-          <share class="ml-20" :row="info" v-if="info.isAccess === 2" />
+          <share class="ml-20" :row="data" v-if="isAccess === 2" />
         </div>
       </div>
     </el-drawer>
@@ -49,25 +51,25 @@ export default {
     share
   },
   props: {
+    title: {
+      type: String,
+      default: () => {
+        return ''
+      }
+    },
+    isAccess: {
+      type: Number,
+      default: 3
+    },
     showAction: {
       type: Boolean,
       default: false
     },
-    info: {
-      type: Object,
+    id: {
+      type: String,
       default: null
     }
   },
-  watch: {
-    show: {
-      handler(val) {
-        if (val) {
-          this.detail()
-        }
-      },
-      immediate: true
-    }
-  },
   data() {
     return {
       show: false,
@@ -78,27 +80,39 @@ export default {
   },
   methods: {
     openFile() {
-      if (api.offices.includes(this.info.suffix)) {
+      if (
+        this.data.fileAttach.id === -1 ||
+        api.offices.includes(this.data.fileAttach.suffix)
+      ) {
         this.show = true
       } else {
         this.preList.length = 0
-        this.preList.push(this.info.url)
+        this.preList.push(this.data.url)
         this.showImage = true
       }
     },
     detail() {
-      this.$api.resource
-        .fileDetail(this.info.fileId ? this.info.fileId : this.info.id)
-        .then(res => {
+      console.log(Number(this.id, 10))
+      if (Number(this.id, 10) === 'NaN') {
+        this.$api.resource.fileDetail(this.id).then(res => {
           if (res.code === 200) {
             this.data = res.data
+            this.openFile()
           }
         })
+      } else {
+        this.$api.resource.fileDetailByFile(this.id).then(res => {
+          if (res.code === 200) {
+            this.data = res.data
+            this.openFile()
+          }
+        })
+      }
     },
     async downloadClick() {
       const link = document.createElement('a')
-      link.href = this.info.url
-      link.download = this.info.title
+      link.href = this.data.url
+      link.download = this.data.title
       link.click()
     }
   }
@@ -106,6 +120,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.preview {
+  width: 960px;
+  padding: 20px;
+}
 .bottom {
   position: fixed;
   bottom: 0;

+ 0 - 8
src/views/resource/component/row1.vue

@@ -4,14 +4,6 @@
       v-if="index === 0"
       class="flex flex-align-center full-height cell full-width"
     >
-      <!--      <el-checkbox-->
-      <!--        v-if="showCheckBox"-->
-      <!--        v-model="info.checked"-->
-      <!--        :disabled="folderChecked === false && row.type === 2"-->
-      <!--        class="padding-right"-->
-      <!--        @change="rowChecked(row)"-->
-      <!--      />-->
-
       <div v-if="showCheckBox" class="margin">
         <el-icon
           v-if="folderChecked === false && row.type === 2"

+ 6 - 1
src/views/resource/component/xtable.vue

@@ -56,7 +56,12 @@
                 class="flex flex-center"
               >
                 <div>
-                  <preview :info="row" v-if="row.type === 1" ref="preview" />
+                  <preview
+                    :id="row.fileId"
+                    :is-access="row.isAccess"
+                    v-if="row.type === 1"
+                    ref="preview"
+                  />
                 </div>
                 <div v-if="row.isAccess === 2" class="flex flex-center">
                   <div v-if="row.type === 2 && row.parentId === '0'">

+ 9 - 9
src/views/task/component/task-table.vue

@@ -172,31 +172,31 @@ export default {
       status: [
         {
           title: '待确认',
-          value: 0,
+          value: 1,
           color: '#D7D7D7',
           checked: true
         },
         {
           title: '进行中',
-          value: 1,
+          value: 2,
           color: '#47A6EA',
           checked: false
         },
         {
           title: '已提交',
-          value: 2,
+          value: 3,
           color: '#ECAB56',
           checked: false
         },
         {
           title: '已完成',
-          value: 3,
+          value: 4,
           color: '#80B336',
           checked: false
         },
         {
           title: '已取消',
-          value: 4,
+          value: 5,
           color: '#C72A29',
           checked: false
         }
@@ -204,25 +204,25 @@ export default {
       level: [
         {
           title: 'P1',
-          value: 0,
+          value: 1,
           color: '#C72A29',
           checked: true
         },
         {
           title: 'P2',
-          value: 1,
+          value: 2,
           color: '#E89D42',
           checked: false
         },
         {
           title: 'P3',
-          value: 2,
+          value: 3,
           color: '#47A6EA',
           checked: false
         },
         {
           title: 'P4',
-          value: 3,
+          value: 4,
           color: '#A0A0A0',
           checked: false
         }

+ 17 - 19
src/views/task/component/task.vue

@@ -118,7 +118,7 @@
               <div v-for="item in fileList" :key="item.id">
                 <div class="flex flex-center">
                   {{ item.title }}
-                  <preview :info="item" :show-action="true" />
+                  <preview :id="item.fileId" :show-action="true" />
                 </div>
               </div>
             </div>
@@ -149,7 +149,7 @@
               <div class="flex flex-justify-start flex-center">
                 {{ item.fileVO.originalFileName }}
                 ({{ item.createUserName }})
-                <preview :info="item.fileVO" :show-action="true"></preview>
+                <preview :id="item.fileVO.id" :show-action="true"></preview>
               </div>
             </div>
           </div>
@@ -241,31 +241,31 @@ export default {
       status: [
         {
           title: '待确认',
-          value: 0,
+          value: 1,
           color: '#D7D7D7',
           checked: true
         },
         {
           title: '进行中',
-          value: 1,
+          value: 2,
           color: '#47A6EA',
           checked: false
         },
         {
           title: '已提交',
-          value: 2,
+          value: 3,
           color: '#ECAB56',
           checked: false
         },
         {
           title: '已完成',
-          value: 3,
+          value: 4,
           color: '#80B336',
           checked: false
         },
         {
           title: '已取消',
-          value: 4,
+          value: 5,
           color: '#C72A29',
           checked: false
         }
@@ -273,25 +273,25 @@ export default {
       level: [
         {
           title: 'P1',
-          value: 0,
+          value: 1,
           color: '#C72A29',
           checked: true
         },
         {
           title: 'P2',
-          value: 1,
+          value: 2,
           color: '#E89D42',
           checked: false
         },
         {
           title: 'P3',
-          value: 2,
+          value: 3,
           color: '#47A6EA',
           checked: false
         },
         {
           title: 'P4',
-          value: 3,
+          value: 4,
           color: '#A0A0A0',
           checked: false
         }
@@ -301,17 +301,15 @@ export default {
   methods: {
     init() {
       this.form = this.task
-      console.log(this.task)
       if (this.task.users !== undefined) {
         this.executeUser = [...this.task.users]
       }
       this.canEdit = this.form.createUser === this.user.info.userId
-      if (this.task.taskStatus > 1) {
+      if (this.task.taskStatus > 2) {
         this.canEdit = false
       }
       if (this.task.files !== undefined && this.task.files.length > 0) {
         this.fileList = this.task.files
-        console.log(this.fileList)
       }
       this.resultFileInfo()
     },
@@ -333,13 +331,13 @@ export default {
     show(type) {
       if (type !== 1) {
         this.form = this.task
-        if (this.task.taskStatus === 3 || this.task.taskStatus === 4) {
+        if (this.task.taskStatus === 4 || this.task.taskStatus === 5) {
           this.isFinish = true
         }
         this.init(this.task)
       } else {
-        this.form.taskStatus = 0
-        this.form.level = 0
+        this.form.taskStatus = 1
+        this.form.level = 1
         this.canEdit = true
       }
       this.showDialog = true
@@ -364,7 +362,7 @@ export default {
       }
     },
     submit() {
-      if (this.form.taskStatus === 2 && this.resultFiles.length === 0) {
+      if (this.form.taskStatus === 3 && this.resultFiles.length === 0) {
         this.$message.error('请上传成果文件')
         return
       } else {
@@ -372,7 +370,7 @@ export default {
       }
 
       if (
-        this.form.taskStatus === 3 &&
+        this.form.taskStatus === 4 &&
         this.isMove === false &&
         this.isFinish === false
       ) {

+ 4 - 3
src/views/user/manage.vue

@@ -200,7 +200,6 @@
             size="220"
           />
           <span>- 复制二维码图片,通过微信发送邀请 -</span>
-          {{ qrCodeText }}
         </div>
         <el-empty v-else description="暂无数据" />
       </div>
@@ -337,6 +336,7 @@ export default {
       this.page.current = this.page.currentPage
       this.page.size = this.page.pageSize
       const data = { deptId: this.user.info.deptId }
+      console.log(this.page)
       this.$api.role
         .roleList(Object.assign(this.page, data))
         .then(res => {
@@ -551,10 +551,11 @@ export default {
       this.$api.role.invitation({ deptId, type: 4 }).then(res => {
         if (res.code === 200) {
           this.qrCodeText =
-            'https://prod.wutongshucloud.com/invite?id=' +
+            'https://prod.wutongshucloud.com/apply?id=' +
             res.data.id +
             '&deptId=' +
-            deptId
+            deptId +
+            '&roleName=股室'
         }
       })
     },