ruoyi-ui/src/views/secret/secretInfo.vue
@@ -1,20 +1,28 @@
<template>
    <div class="app-container">
      <div class="form-header mt">
        <h4 class="dt h4">隐私详细信息 </h4>
        <h1 style="font-size:21px;padding-top:30px;display: flex;justify-content: space-between;align-items: center;">
          <span>隐私详情</span>
          <div   style="display: flex; align-items: center;">
            <el-button size="mini" type="text"  @click="checkNote()" v-hasPermi="['person:information:memo']">
              <div class="form" ><el-icon  style="padding-right:110px;"></el-icon>
                <span class="text" style="width: 69px;height: 26px;font-size: 16px;
            font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">备忘本</span></div>
            </el-button>
          </div>
        </h1>
      </div>
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px">
        <el-form-item label="发生时间" prop="happenTime">
          <el-input v-model="formData.happenTime" placeholder="请选择时间" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
          <el-input v-model="formData.happenTime" placeholder="请选择时间" type="date" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
        </el-form-item>
        <el-form-item label="类型" prop="type">
          <el-select v-model="formData.type" placeholder="请选择基金/台账" clearable :style="{width: '100%'}" :disabled="dsb" >
          </el-select>
        </el-form-item>
        <el-form-item label="有效期" prop="validityDate">
          <el-input v-model="formData.validityDate" placeholder="请选择时间" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
          <el-input v-model="formData.validityDate" placeholder="请选择时间" type="date" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
        </el-form-item>
        <el-form-item label="账号" prop="accNo">
          <el-input v-model="formData.accNo" placeholder="请输入用途" clearable :style="{width: '100%'}" :disabled="dsb">
@@ -38,8 +46,8 @@
        <el-form-item label="备注" prop="remark">
          <el-input v-model="formData.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
        </el-form-item>
        <h4 class="form-header">相关图片 </h4>
        <el-upload
          action="#"
@@ -48,7 +56,8 @@
          :http-request="requestUpload"
          :file-list="fileList"
        >
          <i slot="default" class="el-icon-plus"></i>
          <div v-if="uploading" class="upload-status">正在上传...</div>
          <i v-if="!uploading" slot="default" class="el-icon-plus"></i>
          <div slot="file" slot-scope="{file}">
            <img
              class="el-upload-list__item-thumbnail"
@@ -60,14 +69,14 @@
            >
            <span class="el-upload-list__item-actions">
          <span
            v-if="isShow"
            class="el-upload-list__item-preview"
            @click="handlePictureCardPreview(file)"
          >
            <i class="el-icon-zoom-in"></i>
          </span>
          <span
            v-if="isShow"
            class="el-upload-list__item-delete"
            @click="handleDownload(file.url)"
          >
@@ -81,11 +90,11 @@
            <i class="el-icon-delete"></i>
          </span>
        </span>
          </div>
        </el-upload>
        <h4 class="form-header">其他附件 </h4>
      <el-upload
              action=""
@@ -94,13 +103,13 @@
              multiple
              list-type="picture-card"
              :on-preview="handleFileCardPreview"
              :on-remove="handleRemove"
              :on-remove="handleRemoveFile"
              :http-request="requestUpload"
              :show-file-list="true"
            >
                <i slot="default" class="el-icon-plus"></i>
                <div slot="file" slot-scope="{file}">
        <div v-if="uploading" class="upload-status">正在上传...</div>
        <i v-if="!uploading" slot="default" class="el-icon-plus"></i>
        <div slot="file" slot-scope="{file}">
                  <img
                    class="el-upload-list__item-thumbnail"
                    src="../../assets/401_images/401.gif"
@@ -110,17 +119,17 @@
                  >
                  <span class="el-upload-list__item-actions">
                  <span
                    v-if="isShow"
                    class="el-upload-list__item-preview"
                    @click="handleFileCardPreview(file)"
                  >
                    <i class="el-icon-zoom-in"></i>
                  </span>
                  <span
                    v-if="isShow"
                    @click="handleRemove(file)"
                    class="el-upload-list__item-delete"
                  >
                    <i class="el-icon-download"></i>
                  </span>
@@ -132,19 +141,19 @@
                    <i class="el-icon-delete"></i>
                  </span>
                </span>
                </div>
            </el-upload>
        <el-form-item size="large">
          <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">修改</el-button>
        </el-form-item>
      </el-form>
      <el-dialog  :visible.sync="dialogVisible">
        <img w-full :src="dialogImageUrl" alt="Preview Image" />
      </el-dialog>
@@ -156,7 +165,7 @@
  import {blobValidate} from "@/utils/ruoyi";
  import errorCode from "@/utils/errorCode";
  import {Message} from "element-ui";
  export default {
    components: {},
    props: [],
@@ -168,18 +177,18 @@
        fileList:[
        ],
        fileListOther:[
        ],
        dsb:true,
        btn:false,
        isShow:true,
        uploading: false,
        formData: {
          type: undefined,
          happenTime: undefined,
          accNo:undefined,
          validityDate:undefined,
          password:undefined,
          validityDate:undefined,
          isFinger:undefined,
          isFace:undefined,
          isPrivate:undefined,
@@ -231,7 +240,7 @@
            message: '请输入备注',
            trigger: 'blur'
          }],
        },
        typeOptions: [{
    value: '0',
@@ -262,19 +271,19 @@
        this.$route.meta.title = "查看隐私详细信息";//列表的名称
        this.isShow=false
      }
      let _this = this
      if (id) {
        this.loading = true;
        getSecretInfo(id).then((response) => {
        getSecretInfo({id}).then((response) => {
          this.formData = response.data;
          let paths = response.data.url.split(",");
          for(let i = 0; i < paths.length; i++)
          {
            if(paths[i]!="") {
              let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
              if (_this.fot.includes(pth) === true)
                _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
              else {
@@ -288,7 +297,7 @@
          this.loading = false;
        });
        this.getCateInfor()
      }
    },
    mounted() {},
@@ -300,7 +309,7 @@
        return '台账'
      }
    },
    getSrc2(kind) {
      if (kind == 0) {
        return '现金'
@@ -318,10 +327,10 @@
          return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
         }).join(",")
          this.formData.url = ul+","+uls
        this.$refs['elForm'].validate(valid => {
          if (valid) {
            if (this.formData.id != undefined) {
              updateSecret(this.formData).then(response => {
@@ -331,7 +340,7 @@
              });
            } else {
              this.$modal.msgSuccess("修改失败");
            }
          }
        })
@@ -378,7 +387,7 @@
      },
      handleDownload(url) {
        var formData = {'path':"/"+url.replace(process.env.VUE_APP_BASE_TRUE_API,"")};
        let lens = formData.path.split(".")
        let suffix = lens[lens.length-1]
        download(formData).then(async (response) => {
@@ -401,34 +410,42 @@
        var formData = new FormData();
        formData.append('uploadFile', file);
        let _this = this
        this.uploading = true;
        uploadPic(formData).then(response => {
          let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
          this.uploading = false;
          this.$modal.msgSuccess("上传成功");
          if(_this.fot.includes(pth) === true)
          {
            _this.fileList.push({name:response.data.fileName, "url":response.data.url})
          }
          else{
            _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
          }
        })
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('/zfEconomy/export', {
          ...this.queryParams
        }, `zfEconomy_${new Date().getTime()}.xlsx`)
      }
      },
      // 查看备忘本
      checkNote(row){
        // const id =row.id;
        const id = this.$route.params && this.$route.params.id;
        // const fid =2031
        this.$router.push("/self/secret/memo/" + id);
      },
    }
  }
  </script>
  <style scoped lang="scss">
  .mt
@@ -437,7 +454,7 @@
  }
  .dt{
    display: block;
  }
  .pt{
    right: 10px;
@@ -445,5 +462,8 @@
    display: block;
    position: absolute;
  }
  .form{
    background:center/11% no-repeat url('../../assets/icons/form.png') ;
  }
  </style>