今天在做一个大型网站表格导入的时候,我踩了一个坑,让宝宝我好忧伤,感觉智商的倒退
看到这个数据重复的问题,还以为我没错,结果狠狠打脸啊,伤心的不要不要的
话不多说,上代码,看看我的问题,以后要少犯类似的问题
<html>
<head>
<meta charset="utf-8">
<title>活动管理</title>
<link rel="stylesheet" type="text/css" href="{ {PATH_TML}}activity/css/iview.css">
<script type="text/javascript" src="{ {PATH_TML}}activity/js/vue.min.js"></script>
<script type="text/javascript" src="{ {PATH_TML}}activity/js/iview.min.js"></script>
<link rel="stylesheet" type="text/css" href="{ {PATH_TML}}activity/css/public.css">
<script src="{ {PATH_TML}}activity/js/jquery-1.8.3.min.js"></script>
<script src="{ {PATH_TML}}activity/js/activity-public.js"></script>
<script src="{ {PATH_TML}}activity/js/jquery-3.2.1.min.js"></script>
<!-- 导入excel -->
<script src="{ {PATH_TML}}activity/js/xlsx.core.min.js"></script>
<script src="/common/layui/layui.js"></script>
<!-- <script src="{ {PATH_TML}}activity/js/Blob.js"></script>
<script src="{ {PATH_TML}}activity/js/Export2Excel.js"></script> -->
<!-- 引入页面 -->
<!--<script src='js/public.js'></script>-->
<style>
[v-cloak] {
display: none !important;
}
.ivu-select {
margin: 0 auto;
}
</style>
</head>
<body>
<!-- 主题内容 -->
<div id="app" v-cloak>
<!-- 左边导航 -->
<#include#>activity/left_nav.html</#include#>
<!-- 右边内容 -->
<div class='right-content' style="flex:1">
<!-- 头部导航栏 -->
<#include#>activity/header.html</#include#>
<!-- content -->
<div class='content main'>
<!-- 打开页面选择器 -->
<div class="tag-nav-wrapper m-activity-detail">
<#include#>activity/activity_right.html</#include#>
<!-- 主题内容 -->
<div class="content-wrapper ivu-layout-content">
<div class="ivu-card ivu-card-bordered">
<div class="ivu-card-body">
<span id='mainContent' class="ivu-card">
<!--筛选按钮-->
<i-form ref="formValidate" class="shaixuan-form" inline>
<form-item>
<i-input
v-model='search_status=="is_audit"?(search_context==1?"审核通过":search_context==2?"待审核":"审核拒绝"):search_context'
:disabled='search_disabled'>
<i-select slot="prepend" style="width: 80px" @on-change='searchChange'>
<i-option value="name" key='name'>姓名</i-option>
<i-option value="telphone" key='telphone'>手机号</i-option>
<i-option value="success" key='success'>通过</i-option>
<i-option value="fail" key='success'>拒绝</i-option>
<i-option value="await" key='await'>待审核</i-option>
</i-select>
<i-button slot="append" icon="ios-search" @click='searchHandler'></i-button>
</i-input>
</form-item>
<form-item>
<i-button type="primary" @click='exportExcel("current")'>导出当前页</Button>
</form-item>
<form-item>
<i-button type="primary" @click='exportExcel("all")'>导出全部</Button>
</form-item>
<form-item v-if='activity_info.model_type=="qinshang"'>
<a href="javascript:;" class="file">导入表格
<input type="file" οnchange="importXlsx(this)" id="rcDialogTitle0">
</a>
</form-item>
<form-item v-if='activity_info.model_type=="qinshang"'>
<i-button type="primary" @click='other_enroll=true'>替他人报名</Button>
</form-item>
<form-item v-if='activity_info.model_type=="qinshang"'>
<a href="javascript:;" class="file">表格报名
<input type="file" οnchange="importEnroll(this)" id="rcDialogTitle0">
</a>
</form-item>
<form-item>
<i-button type="primary" @click='showGroup'>创建分组</Button>
</form-item>
</i-form>
<!-- -->
<!--表格-->
<i-table ref="tables" editable searchable search-place="top" v-model="tableData" :columns="columns"
:data="tableData" :loading="loading" id='active-detail'>
</i-table>
<!-- 替他人报名 模态框 -->
<Modal v-model="other_enroll">
<p slot="header" class="import-tables">
替他人报名
</p>
<div>
<i-form :model="enroll" :label-width="80">
<form-item label="姓名" prop="name">
<i-input v-model="enroll.name" placeholder=""></i-input>
</form-item>
<form-item label="手机号" prop="telphone">
<i-input v-model="enroll.telphone" placeholder=""></i-input>
</form-item>
<form-item label="单位及职务" prop="position_info">
<i-input v-model="enroll.extends.position_info" placeholder=""></i-input>
</form-item>
<form-item label="性别" prop="sex">
<Radio-group v-model="enroll.extends.sex">
<Radio label="男"></Radio>
<Radio label="女"></Radio>
</Radio-group>
</form-item>
<form-item label="证件类型" prop="credentials_type">
<Radio-group v-model="enroll.extends.credentials_type">
<Radio label="身份证"></Radio>
<Radio label="护照"></Radio>
</Radio-group>
</form-item>
<form-item :label="enroll.extends.credentials_type" prop="card_type">
<i-input v-model="enroll.extends.credentials_number" placeholder=""></i-input>
</form-item>
<form-item label="参加考察活动" prop="enroll">
<i-switch v-model="enroll.extends.has_project" />
</form-item>
<form-item label="在陕有投资" prop="is_part_in_third_silk_conference">
<i-switch v-model="enroll.extends.is_part_in_third_silk_conference" />
</form-item>
<form-item label="大会接机" prop="card_type">
<i-switch v-model="enroll.extends.is_meet_plane" />
</form-item>
<form-item label="接机信息" prop="card_type" v-if='enroll.extends.is_meet_plane'>
<i-input v-model="enroll.extends.flight_info" placeholder="" type='textarea'></i-input>
</form-item>
</i-form>
</div>
<div slot="footer">
<i-button type="warning" @click='other_enroll=false'>取消</i-button>
<i-button type="primary" @click='otherEnroll'>添加</i-button>
</div>
</Modal>
<!-- 模态框 -->
<Modal v-model="is_apply" width="520">
<p slot="header">
<span class="ant-modal-title" id="rcDialogTitle0">报名人信息审核</span>
</p>
<div style="text-align:center" v-if='activity_info.model_type=="qinshang"'>
<div class="ant-modal-body">
<div class="ant-row" style="margin-bottom: 10px; font-size: 16px;">
<div class="ant-col-10"
style="text-align: right; padding-right: 10px; color: rgba(138, 137, 137, 0.65);">姓名:
</div>
<div class="ant-col-14">{ {model_show.name}}</div>
</div>
<div class="ant-row" style="margin-bottom: 10px; font-size: 16px;">
<div class="ant-col-10"
style="text-align: right; padding-right: 10px; color: rgba(138, 137, 137, 0.65);">联系方式:
</div>
<div class="ant-col-14">{ {model_show.telphone}}</div>
</div>
<div class="ant-row" style="margin-bottom: 10px; font-size: 16px;"
v-if='model_show.extends!=null'>
<div class="ant-col-10"
style="text-align: right; padding-right: 10px; color: rgba(138, 137, 137, 0.65);">性别:
</div>
<div class="ant-col-14">{ {model_show.extends.sex==3?'男':model_show.extends.sex==2?'女':'未知'}}
</div>
</div>
<div class="ant-row" style="margin-bottom: 10px; font-size: 16px;"
v-if='model_show.model_type=="qinshang"'>
<div class="ant-col-10"
style="text-align: right; padding-right: 10px; color: rgba(138, 137, 137, 0.65);">所属公司及职务:
</div>
<div class="ant-col-14">{ {model_show.extends.position_info}}</div>
</div>
<div class="ant-row" style="margin-bottom: 10px; font-size: 16px;"
v-if='model_show.model_type!="qinshang"'>
<div class="ant-col-10"
style="text-align: right; padding-right: 10px; color: rgba(138, 137, 137, 0.65);">所属公司:
</div>
<div class="ant-col-14">{ {model_show.company}}</div>
</div>
<div class="ant-row" style="margin-bottom: 10px; font-si