This commit is contained in:
clay
2022-01-22 20:44:57 +08:00
parent fcd39985dc
commit c8059388c7
2 changed files with 41 additions and 11 deletions

View File

@@ -81,6 +81,7 @@
</template>
</el-table-column>
<el-table-column label="标题" align="left" prop="title" />
<el-table-column label="英文标题" align="left" prop="enTitle" />
<el-table-column label="站点类型" align="center" prop="sitetype" :formatter="sitetypeFormat"/>
<el-table-column label="轮播类型" align="center" prop="type":formatter="bannerStyleFormat" />
<el-table-column label="图表路径" align="center">
@@ -142,6 +143,9 @@
<el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="英文标题" prop="enTitle">
<el-input v-model="form.enTitle" placeholder="请输入英文标题" />
</el-form-item>
<el-form-item prop="imgurl">
<UploadFile v-model="form.imgurl"
file-type="image"
@@ -149,9 +153,12 @@
:v-data="false"
/>
</el-form-item>
<el-form-item label="跳转链接">
<el-form-item label="中文跳转链接">
<el-input v-model="form.link" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="英文跳转链接">
<el-input v-model="form.enLink" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@@ -217,6 +224,9 @@ export default {
title: [
{ required: true, message: "标题不能为空", trigger: "blur" },
],
enTitle: [
{ required: true, message: "英文标题不能为空", trigger: "blur" },
],
createBy: [
{ required: true, message: "创建者不能为空", trigger: "blur" },
],
@@ -261,8 +271,10 @@ export default {
sitetype: null,
type: null,
title: null,
enTitle: null,
imgurl: null,
link: null,
enLink: null,
sort: null,
};
this.resetForm("form");

View File

@@ -55,7 +55,7 @@
<img style="width: 300px;" :src="scope.row.link" alt="">
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="350" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-show="scope.row.type == '0'"
type="text"
@@ -69,8 +69,15 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdateDetails(scope.row)"
>修改详情
@click="handleUpdateDetails(scope.row.refId)"
>修改中文详情
</el-button>
<el-button v-show="scope.row.type == '1'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdateDetails(scope.row.enRefId)"
>修改英文详情
</el-button>
<el-button v-show="scope.row.pid != 0"
size="mini"
@@ -136,6 +143,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="层次数据" prop="enRefId" v-show="empleeSelShow">
<el-select v-model="form.enRefId" placeholder="请选择层次数据" clearable :style="{width: '100%'}">
<el-option
v-for="dict in direTypeOptions"
:key="dict.dictCode"
:label="dict.dictLabel"
:value="dict.dictCode"
/>
</el-select>
</el-form-item>
<el-form-item v-show="imageShow" label="" prop="link">
<UploadFile v-model="form.link"
file-type="image"
@@ -336,6 +353,7 @@ export default {
link: null,
sort: null,
refId: null,
enRefId: null,
};
this.anvTypeEdit = true
this.resetForm("form");
@@ -360,14 +378,14 @@ export default {
this.form.type = '0'
this.title = "添加下级导航";
},
handleUpdateDetails(row) {
handleUpdateDetails(id) {
this.detailsShow = true
this.formData = {
id: row.refId,
id: id,
title: "",
content: "",
}
getDetails(row.refId).then(res => {
getDetails(id).then(res => {
this.formData = res.data
})
},
@@ -442,10 +460,10 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.imageShow&&this.form.link){
this.msgError("图片不能为空,若您已上传请稍等一下!");
return
}
//if (this.imageShow&&this.form.link){
// this.msgError("图片不能为空,若您已上传请稍等一下!");
// return
//}
if (this.form.id != null) {
updateNavigation(this.form).then(response => {
this.msgSuccess("修改成功");