|
|
|
|
@ -34,20 +34,21 @@
|
|
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="介绍页" name="middlePage">
|
|
|
|
|
<div style="height: 500px;">
|
|
|
|
|
<div style="height: 600px;" v-for="(item,index) of imagesInfo">
|
|
|
|
|
<div class="block" style="float: left;margin-left: 3%;margin-top: 3%" >
|
|
|
|
|
<el-image :src="loginForm.filePath" style="width: 330px;height: 461px;">
|
|
|
|
|
<el-image :src="item.filePath" style="width: 330px;height: 461px;">
|
|
|
|
|
<div slot="placeholder" class="image-slot"><span class="dot"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-image>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="float: left;margin-left: 10%;margin-top: 10%;">
|
|
|
|
|
<div style="float: left;margin-left: 5%;margin-top: 10%;">
|
|
|
|
|
<el-upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
:limit="1"
|
|
|
|
|
accept=".jpg, .png, .jpeg"
|
|
|
|
|
:data="{index:index}"
|
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
:action="upload.url"
|
|
|
|
|
:action="upload.url+'/else'"
|
|
|
|
|
:disabled="upload.isUploading"
|
|
|
|
|
:on-progress="handleFileUploadProgress"
|
|
|
|
|
:on-success="handleFileSuccess"
|
|
|
|
|
@ -58,6 +59,25 @@
|
|
|
|
|
<div class="el-upload__tip" slot="tip">请上传登录页背景图片,建议尺寸为375px*471p</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="float: left;margin-left: 5%;margin-top: 10%;">
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="标题" prop="title">
|
|
|
|
|
<el-input v-model="item.title" placeholder="请输入标题" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="介绍文字" prop="content">
|
|
|
|
|
<el-input v-model="item.content" placeholder="请输入介绍文字" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer" style="margin-left: 10%;margin-top: 5%">
|
|
|
|
|
<el-button type="primary" @click="submitForm(item)">提 交</el-button>
|
|
|
|
|
<el-button @click="handleDelete(item)">删 除</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleAddInfo">新 增</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="登录页" name="logoPage">
|
|
|
|
|
@ -113,6 +133,8 @@ export default {
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 除了video后image类型的数据
|
|
|
|
|
imagesInfo: [],
|
|
|
|
|
// 登录信息表格数据
|
|
|
|
|
infoList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
@ -153,6 +175,7 @@ export default {
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
@ -163,22 +186,29 @@ export default {
|
|
|
|
|
/** 查询登录信息列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.imagesInfo = [];
|
|
|
|
|
listInfo(this.queryParams).then(response => {
|
|
|
|
|
this.infoList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
// 处理逻辑
|
|
|
|
|
this.infoList.forEach((item)=>{
|
|
|
|
|
if (item.type == 1) {
|
|
|
|
|
if (item.type == 1 && item.fileSuffix == 'video') {
|
|
|
|
|
// 启动页
|
|
|
|
|
this.videoForm = item;
|
|
|
|
|
this.$refs["video"].load();
|
|
|
|
|
this.$refs["video"].play();
|
|
|
|
|
} else {
|
|
|
|
|
} else if(item.type == 1 && item.fileSuffix == 'images') {
|
|
|
|
|
// 介绍页
|
|
|
|
|
this.imagesInfo.push(item);
|
|
|
|
|
}else {
|
|
|
|
|
// 登录页
|
|
|
|
|
this.loginForm = item;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (this.imagesInfo.length == 0) {
|
|
|
|
|
this.imagesInfo.push({"filePath":""});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleClick(tab, event) {
|
|
|
|
|
@ -206,9 +236,10 @@ export default {
|
|
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
// this.upload.isUploading = true;
|
|
|
|
|
console.log('上传处理中==>',JSON.stringify(event))
|
|
|
|
|
console.log('上传处理中==>file',JSON.stringify(file))
|
|
|
|
|
},
|
|
|
|
|
// 文件上传成功处理
|
|
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
|
|
|
handleFileSuccess(response, file, fileList, item) {
|
|
|
|
|
if(response.code == '200') {
|
|
|
|
|
if (this.activeName == 'startPage') {
|
|
|
|
|
// 启动页处理
|
|
|
|
|
@ -231,6 +262,9 @@ export default {
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else if(this.activeName == 'middlePage'){
|
|
|
|
|
this.imagesInfo[response.data.index].filePath = response.data.url;
|
|
|
|
|
console.log('结果',JSON.stringify(this.imagesInfo))
|
|
|
|
|
} else {
|
|
|
|
|
// 登录页处理
|
|
|
|
|
this.loginForm.filePath = response.data.url;
|
|
|
|
|
@ -257,6 +291,9 @@ export default {
|
|
|
|
|
|
|
|
|
|
console.log('上传后的结果==>',JSON.stringify(response))
|
|
|
|
|
},
|
|
|
|
|
handleAddInfo(){
|
|
|
|
|
this.imagesInfo.push({"filePath":""});
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
@ -290,29 +327,32 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateInfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addInfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
submitForm(item) {
|
|
|
|
|
this.form = item;
|
|
|
|
|
this.form.fileSuffix = 'images';
|
|
|
|
|
this.form.type = 1;
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateInfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addInfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
if (!row.id) {
|
|
|
|
|
this.$modal.msgError('目前数据状态不允许删除');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除登录信息编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
|
this.$modal.confirm('是否确认删除登录页信息编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
|
return delInfo(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
|