|
@@ -141,6 +141,12 @@ a {
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="search">搜索</el-button>
|
|
<el-button type="primary" @click="search">搜索</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item style="float:right" >
|
|
|
|
|
+ <el-button @click="dialogVisible1=true" plain icon="el-icon-upload" type="primary">导入</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item style="float:right" >
|
|
|
|
|
+ <el-button @click="download" plain icon="el-icon-download" type="primary">导出</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item style="float: right">
|
|
<el-form-item style="float: right">
|
|
|
<el-button @click="add" type="primary">添加主办单位</el-button>
|
|
<el-button @click="add" type="primary">添加主办单位</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -219,6 +225,26 @@ a {
|
|
|
<el-button size="small" type="primary" @click="save">确 定</el-button>
|
|
<el-button size="small" type="primary" @click="save">确 定</el-button>
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ class="fu-dialog"
|
|
|
|
|
+ title="导入" width="400px"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ :visible.sync="dialogVisible1"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ class="upload-demo"
|
|
|
|
|
+ action="/api/admin/uploadfile"
|
|
|
|
|
+ :show-file-list="false"
|
|
|
|
|
+ :on-success="handleAvatarSuccess1">
|
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传.xls/.xlsx文件,且不超过500M</div>
|
|
|
|
|
+ <div>{{file}}</div>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button size="small" type="normal" @click="dialogVisible1=false">取消</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="upload">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
</section>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -237,19 +263,53 @@ export default {
|
|
|
loading: false,
|
|
loading: false,
|
|
|
dialogTitle:"",
|
|
dialogTitle:"",
|
|
|
dialogVisible:false,
|
|
dialogVisible:false,
|
|
|
|
|
+ dialogVisible1:false,
|
|
|
rules: {
|
|
rules: {
|
|
|
name: [{ required: true, message: "请输入单位名称", trigger: "blur" }],
|
|
name: [{ required: true, message: "请输入单位名称", trigger: "blur" }],
|
|
|
desc: [{ required: true, message: "请输入单位简介", trigger: "blur" }],
|
|
desc: [{ required: true, message: "请输入单位简介", trigger: "blur" }],
|
|
|
img: [{ required: true, message: "请上传单位封面", trigger: "blur" }],
|
|
img: [{ required: true, message: "请上传单位封面", trigger: "blur" }],
|
|
|
},
|
|
},
|
|
|
form1:{},
|
|
form1:{},
|
|
|
|
|
+ file:''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ upload(){
|
|
|
|
|
+ this.$api.upOrganizerData({file:this.file}).then(res=>{
|
|
|
|
|
+ this.dialogVisible1=false;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "上传成功",
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ download(){
|
|
|
|
|
+ this.$api.getOrganizerData().then(res=>{
|
|
|
|
|
+ var elink = document.createElement("a");
|
|
|
|
|
+ let blob = new Blob([res.data], {
|
|
|
|
|
+ type: "application/vnd.ms-excel,charset=UTF-8",
|
|
|
|
|
+ });
|
|
|
|
|
+ let objUrl = URL.createObjectURL(blob);
|
|
|
|
|
+ let file_name = decodeURIComponent(
|
|
|
|
|
+ res.headers["content-disposition"].split("=")[1]
|
|
|
|
|
+ );
|
|
|
|
|
+ console.log(file_name);
|
|
|
|
|
+ elink.download = file_name;
|
|
|
|
|
+ elink.style.display = "none";
|
|
|
|
|
+ elink.href = objUrl;
|
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
|
+ elink.click();
|
|
|
|
|
+ document.body.removeChild(elink);
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
//封面
|
|
//封面
|
|
|
handleAvatarSuccess(res, file) {
|
|
handleAvatarSuccess(res, file) {
|
|
|
this.$set(this.form1,'img',file.response.data)
|
|
this.$set(this.form1,'img',file.response.data)
|
|
|
},
|
|
},
|
|
|
|
|
+ handleAvatarSuccess1(res, file) {
|
|
|
|
|
+ this.file=file.response.data;
|
|
|
|
|
+ },
|
|
|
search() {
|
|
search() {
|
|
|
let parm = this.form;
|
|
let parm = this.form;
|
|
|
this.getData();
|
|
this.getData();
|