Commit 73357f4d by Cat
parents 6e06f6d1 00875952
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-carousel :interval="4000" height="100px"> <el-carousel :interval="4000" height="100px">
<el-carousel-item v-for="(item, index) in scope.row.schoolAccessoryList" :key="index"> <el-carousel-item v-for="(item, index) in scope.row.schoolAccessoryList" :key="index">
<el-image style="width: 100px; height: 100px" :src="item.accessoryUrl" <el-image style="width: 100px; height: 100px" :src="pev + item.accessoryUrl"
:preview-src-list="[item.accessoryUrl]"></el-image> :preview-src-list="[item.accessoryUrl]"></el-image>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
</div> </div>
<div v-else> <div v-else>
<div v-for="(item, index) in form.schoolAccessoryList" :key="index"> <div v-for="(item, index) in form.schoolAccessoryList" :key="index">
<img :src="item.accessoryUrl" class="avatar" /> <img :src="pev + item.accessoryUrl" class="avatar" />
</div> </div>
</div> </div>
</el-upload> </el-upload>
...@@ -269,10 +269,7 @@ export default { ...@@ -269,10 +269,7 @@ export default {
this.getTeacher(); this.getTeacher();
}, },
methods: { methods: {
handlePreview(url) {
this.previewImageUrl = url;
this.$refs.previewDialog.open();
},
//获取列表数据 //获取列表数据
getList() { getList() {
getCompetition(this.queryForm).then(response => { getCompetition(this.queryForm).then(response => {
...@@ -280,17 +277,6 @@ export default { ...@@ -280,17 +277,6 @@ export default {
console.log('response', response); console.log('response', response);
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
// this.competitionData.forEach(item => {
// if (item.schoolAccessoryList) {
// item.previewUrls = [item.schoolAccessoryList.map(accessory => accessory.accessoryUrl)];
// item.pictureUrl = item.schoolAccessoryList.map(accessory => accessory.accessoryUrl);
// } else {
// item.previewUrls = [];
// item.pictureUrl = [];
// }
// });
}); });
}, },
...@@ -307,10 +293,11 @@ export default { ...@@ -307,10 +293,11 @@ export default {
console.log('response', response); console.log('response', response);
console.log('file', file); console.log('file', file);
// 处理上传成功的逻辑 // 处理上传成功的逻辑
const accessoryUrl = this.pev + response.fileName; // 假设响应中包含了图片的访问URL const picUrl = response.fileName; // 假设响应中包含了图片的访问URL
const accessoryName = response.originalFilename; // 获取上传文件的名称 const accessoryName = response.originalFilename; // 获取上传文件的名称
this.form.schoolAccessoryList.push({ this.form.schoolAccessoryList.push({
accessoryUrl: accessoryUrl, // url: this.pev + picUrl,
accessoryUrl: picUrl,
accessoryName: accessoryName accessoryName: accessoryName
}); });
console.log('this.form.schoolAccessoryList', this.form.schoolAccessoryList); console.log('this.form.schoolAccessoryList', this.form.schoolAccessoryList);
...@@ -379,26 +366,25 @@ export default { ...@@ -379,26 +366,25 @@ export default {
schoolAccessoryList: [], schoolAccessoryList: [],
}; };
this.nowType = type; this.nowType = type;
if (type != 0) { if (type !== 0) {
const id = row.id; const id = row.id;
getCompetitionxq(id).then(response => { getCompetitionxq(id).then(response => {
console.log(response.data, 'chakan'); console.log(response.data, 'chakan');
if (response.code == 200) { if (response.code === 200) {
Object.keys(this.form).forEach(key => { Object.keys(this.form).forEach(key => {
if (response.data[key]) { if (response.data[key]) {
this.accessoryUrl = this.pev + this.picUrl
console.log(this.accessoryUrl, 'chakan ');
this.$set(this.form, key, response.data[key]); this.$set(this.form, key, response.data[key]);
const teacherId = this.form.teacherId const teacherId = this.form.teacherId
this.form.teacherName = teacherId == '' ? '' : this.teacherList.find(item => item.userId == teacherId).userName this.form.teacherName = teacherId == '' ? '' : this.teacherList.find(item => item.userId == teacherId).userName
console.log(this.form.teacherName, 'this.form.teacherName'); console.log(this.form.teacherName, 'this.form.teacherName');
} }
if (response.data.schoolAccessoryList && response.data.schoolAccessoryList.length > 0) {
this.imageUrls = response.data.schoolAccessoryList.map(item => item.accessoryUrl);
}
}); });
} }
}); });
} }
......
...@@ -297,7 +297,6 @@ export default { ...@@ -297,7 +297,6 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()
const ids = row.id || this.ids const ids = row.id || this.ids
getPic(ids).then(response => { getPic(ids).then(response => {
this.form = response.data this.form = response.data
this.imageUrl = this.pev + this.form.picUrl this.imageUrl = this.pev + this.form.picUrl
......
...@@ -700,10 +700,10 @@ export default { ...@@ -700,10 +700,10 @@ export default {
studentTurnover: [], studentTurnover: [],
// 表单校验 // 表单校验
rules: { rules: {
idCard: [ // idCard: [
{ required: true, message: "身份证号不能为空", trigger: 'blur' }, // { required: true, message: "身份证号不能为空", trigger: 'blur' },
{ validator: this.validID, trigger: 'blur' } // { validator: this.validID, trigger: 'blur' }
], // ],
// nation: [{ required: true, message: '民族不能为空', trigger: 'blur' }], // nation: [{ required: true, message: '民族不能为空', trigger: 'blur' }],
studentName: [{ required: true, message: '学生姓名不能为空', trigger: 'blur' }], studentName: [{ required: true, message: '学生姓名不能为空', trigger: 'blur' }],
// birthday: [{ required: true, message: '出生日期不能为空', trigger: 'blur' }], // birthday: [{ required: true, message: '出生日期不能为空', trigger: 'blur' }],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment