linwenling
2023-05-16 10026b9e467afa79b746a307d581173da54ebf26
修改家大事记bug
2个文件已修改
316 ■■■■ 已修改文件
ruoyi-ui/src/views/bignote/familyeventInfo.vue 215 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/bignote/index.vue 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/bignote/familyeventInfo.vue
@@ -1,28 +1,16 @@
<template>
  <div class="app-container">
    <div class="form-header mt">
      <h4 class="dt h4">家庭大事记详情 </h4>
      <el-button type="primary" class="pt"  icon="el-icon-edit" @click="handleEdit()" :disabled="btn">编辑</el-button>
      <h4 class="dt h4">家大事记详细信息 </h4>
    </div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" >
      <!-- <el-form-item label="id" prop="id">
        <el-input v-model="formData.id" placeholder="请输入id" :maxlength="11" show-word-limit :disabled="true"
                  clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></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-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
                     :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item> -->
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item label="标题" prop="title">
        <el-input v-model="formData.title" placeholder="请输入标题" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
      </el-form-item>
      <!-- <el-form-item label="存储地址" prop="location">
        <el-input v-model="formData.location" placeholder="请输入存储地址" clearable :style="{width: '100%'}" :disabled="dsb">
        </el-input>
      </el-form-item> -->
      <el-form-item label="人物" prop="people">
        <el-input v-model="formData.people" placeholder="请输入人物" clearable :style="{width: '100%'}" :disabled="dsb">
        </el-input>
@@ -31,16 +19,16 @@
        <el-input v-model="formData.address" placeholder="请输入地点" clearable :style="{width: '100%'}" :disabled="dsb">
        </el-input>
      </el-form-item>
      <el-form-item label="家庭号" prop="familyId">
        <el-input v-model="formData.familyId" placeholder="请输入家庭号" :maxlength="11" show-word-limit :disabled="true"
                  clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
      <el-form-item label="发生时间" prop="happenTime">
        <el-input v-model="formData.happenTime" placeholder="请输入发生时间" clearable :style="{width: '100%'}" :disabled="dsb">
        </el-input>
      </el-form-item>
      <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>
      <h4 class="form-header">电子文件 </h4>
      <el-upload
        action="#"
        list-type="picture-card"
@@ -59,27 +47,28 @@
            :preview-src-list="[file.url]"
          >
          <span class="el-upload-list__item-actions">
          <span
            class="el-upload-list__item-preview"
            @click="handlePictureCardPreview(file)"
          >
            <i class="el-icon-zoom-in"></i>
          </span>
          <span
            v-if="!disabled"
            class="el-upload-list__item-delete"
            @click="handleDownload(file.url)"
          >
            <i class="el-icon-download"></i>
          </span>
          <span
            v-if="!disabled"
            class="el-upload-list__item-delete"
            @click="handleRemove(file)"
          >
            <i class="el-icon-delete"></i>
          </span>
        <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)"
        >
          <i class="el-icon-download"></i>
        </span>
        <span
          v-if="isShow"
          class="el-upload-list__item-delete"
          @click="handleRemove(file)"
        >
          <i class="el-icon-delete"></i>
        </span>
      </span>
        </div>
@@ -98,67 +87,63 @@
        :show-file-list="true"
      >
          <i 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"
              alt=""
              style="width: 147px; height: 147px"
              fit="cover"
            >
            <span class="el-upload-list__item-actions">
            <span
              class="el-upload-list__item-preview"
              @click="handleFileCardPreview(file)"
            >
              <i class="el-icon-zoom-in"></i>
            </span>
            <span
v-if="!disabled"
              @click="handleRemove(file)"
              class="el-upload-list__item-delete"
        <i 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"
            alt=""
            style="width: 147px; height: 147px"
            fit="cover"
          >
          <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>
            <span
              v-if="!disabled"
              class="el-upload-list__item-delete"
              @click="handleRemove(file)"
            >
              <i class="el-icon-delete"></i>
            </span>
          </span>
                >
                  <i class="el-icon-download"></i>
                </span>
                <span
                  v-if="isShow"
                  class="el-upload-list__item-delete"
                  @click="handleRemoveFile(file)"
                >
                  <i class="el-icon-delete"></i>
                </span>
              </span>
          </div>
        </div>
      </el-upload>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm" :disabled="dsb">修改</el-button>
        <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>
    <el-dialog  :visible.sync="dialogFileVisible">
      <a :href="desurl">显示</a>
      <iframe :src="desurl"</iframe>
    </el-dialog>
  </div>
</template>
<script>
import {getFamilyeventInfo, updateFamilyevent, uploadPic, download} from "@/api/bignote/index";
import {addRole, updateRole} from "@/api/system/role";
import {blobValidate} from "@/utils/ruoyi";
import errorCode from "@/utils/errorCode";
import {Message} from "element-ui";
import { getFamilyeventInfo, updateFamilyevent, uploadPic, download} from "@/api/bignote/index";
export default {
  components: {},
@@ -167,7 +152,7 @@
    return {
      cdi:"家庭大事记信息",
      udi:"家庭大事记修改",
      fot:[".jpg",".jif",".png"],
      fot:[".jpg",".jif","png"],
      fileList:[
      ],
      fileListOther:[
@@ -175,33 +160,22 @@
      ],
      dsb:true,
      btn:false,
      isShow:true,
      doctorList: [],
      formData: {
        id: undefined,
        // type: undefined,
        title: undefined,
        // location: undefined,
        people: undefined,
        address: undefined,
        remark: undefined,
        url: undefined,
      },
      desurl:'',
      dialogImageUrl: '',
      dialogFileUrl: '',
      dialogFileVisible:false,
      dialogVisible: false,
      disabled: false,
      rules: {
        id: [{
          required: true,
          message: '请输入id',
          trigger: 'blur'
        }],
        // type: [{
        //   required: true,
        //   message: '请选择类别',
        //   trigger: 'change'
        // }],
        title: [{
          required: true,
          message: '请输入大事标题',
@@ -223,7 +197,7 @@
          trigger: 'blur'
        }],
        remark: [{
          required: true,
          // required: true,
          message: '请输入备注',
          trigger: 'blur'
        }],
@@ -232,7 +206,6 @@
      typeOptions: [],
    }
  },
  //在created()中调用接口,拿到数据
  computed: {},
  watch: {},
  created() {
@@ -243,21 +216,20 @@
      jd =  this.$route.query.detail
      this.btn= jd
      this.dsb = !jd
      document.title = "修改家大事记详细信息";
      this.$route.meta.title = "修改家大事记详细信息";//列表的名称
      this.isShow=true
      document.title = "修改大事记详细信息";
      this.$route.meta.title = "修改大事记详细信息";//列表的名称
    }
    else{
      document.title = "查看家大事记详细信息";
      this.$route.meta.title = "查看家大事记详细信息";//列表的名称
      document.title = "查看大事记详细信息";
      this.$route.meta.title = "查看大事记详细信息";//列表的名称
      this.isShow=false
    }
    let _this = this
    if (id) {
      this.loading = true;
      getFamilyeventInfo(id).then((response) => {
        this.formData = response.data;
        let paths = response.data.url.split(",");
        for(let i = 0; i < paths.length; i++)
@@ -278,23 +250,13 @@
        }
        this.loading = false;
      });
      // this.getCateInfor()
      this.getCateInfor()
    }
  },
  mounted() {},
  methods: {
    /** 查询类别信息 */
    // getCateInfor()
    // {
    //   let _this = this
    //   getCategory().then(response=>{
    //     response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
    //       _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
    //     })
    //   })
    // },
    submitForm() {
      let ul = this.fileList.map(function (elem){
        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
@@ -361,7 +323,6 @@
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    //点击下载函数
    handleDownload(url) {
      var formData = {'path':"/"+url.replace(process.env.VUE_APP_BASE_TRUE_API,"")};
@@ -378,7 +339,8 @@
    handleEdit()
    {
      this.dsb = false
      this.btn = true
      // this.btn = true
      this.isShow=false
    },
    requestUpload(params)
    {
@@ -402,13 +364,24 @@
        }
      })
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('/zfEvent/export', {
        ...this.queryParams
      }, `zfEvent_${new Date().getTime()}.xlsx`)
    }
  }
}
</script>
<style>
<style scoped>
.app-container{
  background-color: #FEF7FC;
}
.mt
{
  position: relative;
@@ -417,8 +390,6 @@
  display: block;
}
.pt{
  right: 10px;
  top:-3px;
ruoyi-ui/src/views/bignote/index.vue
@@ -57,7 +57,7 @@
border-radius: 14px 14px 14px 14px;
opacity: 0.5;
border: 1px solid rgba(0,0,0,0.25);"
          value-format="yyyy-MM-dd HH-MM"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
@@ -134,8 +134,8 @@
          :http-request="handleEnport"
        >
          <el-button size="mini"   type="primary"
          plain
          icon="el-icon-plus" >导入</el-button>
                     plain
                     icon="el-icon-plus" >导入</el-button>
        </el-upload>
      </el-col>
@@ -147,39 +147,39 @@
    <el-table v-loading="loading"  :data="familyList" @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName">
      <el-table-column type="selection" width="55"  align="center" />
  <el-table-column  label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/>
      <el-table-column label="发生时间" align="center" sortable prop="happenTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.happenTime) }}</span>
        </template>
      <el-table-column  label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/>
      <el-table-column label="发生时间" prop="happenTime" sortable width="100" align="center">
        <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '————'}}</template>
      </el-table-column>
      <el-table-column label="人物" prop="people" sortable width="100" />
      <el-table-column label="地点" prop="address" sortable width="100" />
      <el-table-column label="大事标题" prop="title" sortable :show-overflow-tooltip="true" width="150" />
      <el-table-column label="备注" prop="remark" sortable width="100" />
      <el-table-column label="备注" prop="remark" sortable width="100" >
        <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '————'}}</template>
      </el-table-column>
      <el-table-column label="家庭号" prop="familyId" sortable width="100" />
      <!-- <el-table-column label="家庭号" prop="familyId" sortable width="100" /> -->
      <el-table-column label="电子文件" prop="url" width="160" >
           <template slot-scope="scope" >
             <img
               class="el-upload-list__item-thumbnail"
               src="../../assets/images/deviceLis.png"
               alt=""
               style="width: 35px; height: 35px;"
               fit="cover"
                v-if="scope.row.url !== null"
             >
      <img
               class="el-upload-list__item-thumbnail"
               src="../../assets/images/deviceA.png"
               alt=""
               style="width: 35px; height: 35px;"
               fit="cover"
                v-if="scope.row.url === null"
             >
           </template>
        </el-table-column>
        <template slot-scope="scope" >
          <img
            class="el-upload-list__item-thumbnail"
            src="../../assets/images/deviceLis.png"
            alt=""
            style="width: 35px; height: 35px;"
            fit="cover"
            v-if="scope.row.url !== null"
          >
          <img
            class="el-upload-list__item-thumbnail"
            src="../../assets/images/deviceA.png"
            alt=""
            style="width: 35px; height: 35px;"
            fit="cover"
            v-if="scope.row.url === null"
          >
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope" v-if="scope.row.roleId !== 1">
          <el-button
@@ -230,9 +230,13 @@
          <el-input v-model="formDat.address" placeholder="请输入地点" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="家庭号" prop="familyId">
          <el-input v-model="formDat.familyId" placeholder="请输入家庭号" clearable :style="{width: '100%'}" >
          </el-input>
        <el-form-item label="发生时间" prop="happenTime">
          <el-date-picker
            v-model='formDat.happenTime'
            type='date'
            placeholder='选择日期'
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="formDat.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" ></el-input>
@@ -321,7 +325,7 @@
import { Notification, MessageBox, Message, Loading } from 'element-ui'
//在system/note/index.js中导入接口函数  --接好了
import {listFamilyevent,enload, getFamilyeventInfo , delFamilyevent  , addFamilyevent , uploadPic} from "@/api/bignote/index";
import {listFamilyevent,enload, delFamilyevent  , addFamilyevent , uploadPic} from "@/api/bignote/index";
export default {
  name: "Role",
  dicts: ['sys_normal_disable'],
@@ -373,6 +377,7 @@
        address: undefined,
        remark: undefined,
        familyId:undefined,
        happenTime:undefined,
        url: undefined,
      },
      // 菜单列表
@@ -418,7 +423,7 @@
          message: '请输入家庭号',
          trigger: 'blur'
        }],
        createTime: [{
        happenTime: [{
          required: true,
          message: '请选择日期选择',
          trigger: 'change'
@@ -457,12 +462,12 @@
      console.log(this.queryParams)
      this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0]
      this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1]
      //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
      listFamilyevent(this.queryParams).then(response => {
          //  alert(123)
          //   console.log(response.data.data)
         // alert(response.data.data[1].url)
          // alert(response.data.data[1].url)
          this.familyList = response.data.data;
          this.total = response.data.total;
@@ -601,7 +606,7 @@
    /** 删除按钮操作 */
    handleDelete(row) {
      const Ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除序号为"' + Ids + '"的数据项?').then(function() {
      this.$modal.confirm('是否确认删除所选中数据项?').then(function() {
        return delFamilyevent(Ids);
      }).then(() => {
        this.getList();
@@ -616,18 +621,18 @@
    },
    /** 导入操作*/
    handleEnport(params){
    var file = params.file;
    var formData = new FormData();
    formData.append('excelImport', file);
    let _this = this
    enload(formData).then(response => {
       _this.getList();
      Message({ message: "导入成功", type: 'warning' })
      var file = params.file;
      var formData = new FormData();
      formData.append('excelImport', file);
      let _this = this
      enload(formData).then(response => {
        _this.getList();
        Message({ message: "导入成功", type: 'warning' })
    }).catch(err)
    {
      Message({ message: "导入失败", type: 'error' })
    }
      }).catch(err)
      {
        Message({ message: "导入失败", type: 'error' })
      }
    }
  }