ruoyi-ui/src/views/collection/index.vue
@@ -74,6 +74,23 @@
        </el-input>
      </el-form-item>
<!--      <el-form-item label="类别" prop="type">-->
<!--        <el-select-->
<!--          v-model="queryParams.type"-->
<!--          placeholder="所有类别"-->
<!--          clearable-->
<!--          style="width: 240px"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        >-->
<!--          <el-option-->
<!--            v-for="dict in typeOptions"-->
<!--            :key="dict.value"-->
<!--            :label="dict.label"-->
<!--            :value="dict.value"-->
<!--          />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
      <el-cntainer>
        <el-col :span="9" >
          <el-form-item>
@@ -85,10 +102,10 @@
          </el-form-item>
        </el-col>
      </el-cntainer>
      <el-form-item label="拥有者" prop="owner" >
      <el-form-item label="持有者" prop="owner" >
        <el-input
          v-model="queryParams.owner"
          placeholder="请输入拥有者"
          placeholder="请输入持有者"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery">
@@ -157,7 +174,7 @@
            plain
            icon="el-icon-download"
            size="mini"
            @click="handleExport"
            @click="handleExportModel"
            v-hasPermi="['family:note:export']"
          >导入模板下载</el-button>
        </el-col>
@@ -179,22 +196,25 @@
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
    </div>
    <el-table v-loading="loading" :data="collectionList" @selection-change="handleSelectionChange" @row-click="handleCheck" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
    <el-table v-loading="loading" :data="collectionList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
      <el-table-column type="selection" width="25"  align="center" />
      <el-table-column  label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
      <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="type" sortable :show-overflow-tooltip="true" width="90" align="center">
        <template slot-scope="scope">{{scope.row.type? scope.row.type: '————'}}</template>
      </el-table-column>
      <el-form-item label="类别" prop="type">
        <el-select v-model="formDat.type" placeholder="请选择类别" clearable :style="{width: '100%'}"  >
          <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-table-column label="名称" prop="name" sortable :show-overflow-tooltip="true" width="90" align="center" >
        <template slot-scope="scope">{{scope.row.name? scope.row.name: '————'}}</template>
      </el-table-column>
      <el-table-column label="来源" prop="source" sortable width="90" align="center" >
        <template slot-scope="scope">{{scope.row.source? scope.row.source: '————'}}</template>
      </el-table-column>
      <el-table-column label="拥有者" prop="owner" sortable width="110" align="center">
      <el-table-column label="持有者" prop="owner" sortable width="110" align="center">
        <template slot-scope="scope">{{scope.row.owner? scope.row.owner: '————'}}</template>
      </el-table-column>
      <el-table-column label="价值" prop="price" sortable width="90" align="center">
@@ -211,7 +231,7 @@
            alt=""
            style="width: 35px; height: 35px;"
            fit="cover"
            v-if="scope.row.url !== ','"
            v-if="scope.row.url !== ',' "
          >
          <img
            class="el-upload-list__item-thumbnail"
@@ -287,8 +307,8 @@
          <el-input v-model="formDat.source" placeholder="请输入来源" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="拥有者" prop="owner">
          <el-input v-model="formDat.owner" placeholder="请输入拥有者" clearable :style="{width: '100%'}" >
        <el-form-item label="持有者" prop="owner">
          <el-input v-model="formDat.owner" placeholder="请输入持有者" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="价格" prop="price">
@@ -384,7 +404,7 @@
//导入接口函数
import {listCollection, getCollection, addCollection,updateCollection, delCollection,uploadPic} from "@/api/collection/index";
import {listCollection, getCollection, addCollection,updateCollection, delCollection,uploadPic,downloadModel} from "@/api/collection/index";
import {enload} from "@/api/doctor";
import {Message} from "element-ui";
@@ -494,7 +514,7 @@
        }],
        owner: [{
          required: true,
          message: '请输入拥有者',
          message: '请输入持有者',
          trigger: 'blur'
        }],
        price: [{
@@ -514,12 +534,29 @@
          trigger: 'blur'
        }],
      },
      typeOptions: [],
      typeOptions: [
        {
          value: '选项1',
          label: '邮票'
        }, {
          value: '选项2',
          label: '日本军刀'
        }, {
          value: '选项3',
          label: '茅台酒'
        }, {
          value: '选项4',
          label: '红木'
        }, {
          value: '选项5',
          label: '纪念品'
        }
      ],
    };
  },
  created() {
    this.getList();
    // this.getCateInfor()
    this.getCateInfor()
    // for (let i = 0; i < this.contactList.length; i++) {
    //   this.formDat[i] = this.contactList[i];
    // }
@@ -555,16 +592,16 @@
      );
    },
    /** 查询类别信息 */
    // 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]})
    //     })
    //   })
    // },
    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]})
        })
      })
    },
    handleRemove(file) {
      alert(323)
@@ -706,7 +743,7 @@
    /** 删除按钮操作 */
    handleDelete(row) {
      const Ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除编号为"' + Ids + '"的数据项?').then(function() {
      this.$modal.confirm('是否确认删除数据项?').then(function() {
        return delCollection(Ids);
      }).then(() => {
        this.getList();
@@ -719,6 +756,14 @@
        ...this.queryParams
      }, `zfCollection_${new Date().getTime()}.xlsx`)
    },
    /** 导入模板下载按钮操作 */
    handleExportModel() {
      this.downloadModel('zfCollection/model', {
        ...this.queryParams
      }, `zfCollection_model_${new Date().getTime()}.xlsx`)
    },
    /** 导入操作*/
    handleEnport(params){
      var file = params.file;