01
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleUpdateDetails(scope.row)"
|
||||
>修改详情
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -140,6 +140,32 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="编辑详情" :visible="detailsShow" width="1100px" :close-on-click-modal="false" @close="detailsClose()" append-to-body>
|
||||
<el-form :model="formData" :rules="detailsRules" size="medium" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<!-- <el-form-item label="详情标题" prop="title">-->
|
||||
<el-form-item label="详情标题">
|
||||
<el-input v-model="formData.title" placeholder="请输入详情标题" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1" :span="22">
|
||||
<Editor v-model="formData.content" :height="500"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24" class="save">
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -150,19 +176,27 @@ import {
|
||||
delNavigation,
|
||||
addNavigation,
|
||||
updateNavigation,
|
||||
updateDetails,
|
||||
getDetails,
|
||||
exportNavigation
|
||||
} from "@/api/sist/navigation";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {getArticleType} from "@/api/sist/article";
|
||||
import Editor from "@/components/Editor"
|
||||
|
||||
export default {
|
||||
name: "Navigation",
|
||||
components: {
|
||||
Treeselect
|
||||
Treeselect,
|
||||
Editor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData:{
|
||||
title:null,
|
||||
content:null,
|
||||
},
|
||||
detailsShow:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
@@ -201,6 +235,11 @@ export default {
|
||||
englishTitle: [
|
||||
{required: true, message: "英语名称不能为空", trigger: "blur"}
|
||||
],
|
||||
},
|
||||
detailsRules:{
|
||||
// title: [
|
||||
// {required: true, message: "导航名称不能为空", trigger: "blur"}
|
||||
// ],
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -268,6 +307,9 @@ export default {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
detailsClose(){
|
||||
this.detailsShow = false
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.articleSelShow = false
|
||||
@@ -302,6 +344,23 @@ export default {
|
||||
this.form.type= '0'
|
||||
this.title = "添加下级导航";
|
||||
},
|
||||
handleUpdateDetails(row){
|
||||
this.detailsShow = true
|
||||
this.formData={
|
||||
id:row.refId,
|
||||
title:"",
|
||||
content:"",
|
||||
}
|
||||
getDetails(row.refId).then(res=>{
|
||||
this.formData = res.data
|
||||
})
|
||||
},
|
||||
save(){
|
||||
updateDetails(this.formData).then(res=>{
|
||||
this.msgSuccess("修改成功");
|
||||
this.detailsShow = false
|
||||
})
|
||||
},
|
||||
//导航类型变化
|
||||
navigationTypeChang(type) {
|
||||
this.articleTypeOptions = []
|
||||
@@ -389,3 +448,9 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.save{
|
||||
//text-align: center;
|
||||
margin-top: 50px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user