|
@@ -27,7 +27,7 @@
|
|
<!--表格内容 start------------------------------------------------------------>
|
|
<!--表格内容 start------------------------------------------------------------>
|
|
<div class="layerBox">
|
|
<div class="layerBox">
|
|
<tableTitle :name="tableDivTitle" />
|
|
<tableTitle :name="tableDivTitle" />
|
|
- <button class="btn" @click="addWebsite">添加详情</button>
|
|
|
|
|
|
+ <button class="btn" @click="goCreate()">添加详情</button>
|
|
<el-row>
|
|
<el-row>
|
|
<template>
|
|
<template>
|
|
<el-table class="my-table" :data="tableData" style="width: 100%">
|
|
<el-table class="my-table" :data="tableData" style="width: 100%">
|
|
@@ -74,7 +74,7 @@
|
|
<!--表格内容 end------------------------------------------------------------>
|
|
<!--表格内容 end------------------------------------------------------------>
|
|
|
|
|
|
<!-- 弹出框 编辑 start----------------------------------------------------------->
|
|
<!-- 弹出框 编辑 start----------------------------------------------------------->
|
|
- <el-dialog :title="dialogName" :visible.sync="dialogTableVisible" width="50%" top="8vh"
|
|
|
|
|
|
+ <!--el-dialog :title="dialogName" :visible.sync="dialogTableVisible" width="50%" top="8vh"
|
|
:close-on-click-modal="false">
|
|
:close-on-click-modal="false">
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
|
|
<div class="dialogText">
|
|
<div class="dialogText">
|
|
@@ -92,13 +92,13 @@
|
|
resize="none">
|
|
resize="none">
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item-->
|
|
</el-form-item-->
|
|
- </div>
|
|
|
|
|
|
+ <!--/div>
|
|
<div class="dialogBtn">
|
|
<div class="dialogBtn">
|
|
<el-button type="info" @click="cancelForm">取消</el-button>
|
|
<el-button type="info" @click="cancelForm">取消</el-button>
|
|
<el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
|
<el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
|
</div>
|
|
</div>
|
|
</el-form>
|
|
</el-form>
|
|
- </el-dialog>
|
|
|
|
|
|
+ </el-dialog-->
|
|
<!-- 弹出框 编辑 end----------------------------------------------------------->
|
|
<!-- 弹出框 编辑 end----------------------------------------------------------->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -128,7 +128,7 @@ export default {
|
|
return {
|
|
return {
|
|
tableDivTitle: "单页详情", //列表标题
|
|
tableDivTitle: "单页详情", //列表标题
|
|
dialogTableVisible: false, //编辑弹框
|
|
dialogTableVisible: false, //编辑弹框
|
|
- dialogName: '编辑', //编辑弹窗名称
|
|
|
|
|
|
+ // dialogName: '编辑', //编辑弹窗名称
|
|
|
|
|
|
tableData: [],//表格数据
|
|
tableData: [],//表格数据
|
|
tabbarId: '',//底部导航传递的id
|
|
tabbarId: '',//底部导航传递的id
|
|
@@ -169,7 +169,7 @@ export default {
|
|
page: this.page,
|
|
page: this.page,
|
|
pageSize: this.pageSize
|
|
pageSize: this.pageSize
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ // console.log(data);
|
|
this.tableData = data.data.rows
|
|
this.tableData = data.data.rows
|
|
this.total = data.data.count
|
|
this.total = data.data.count
|
|
})
|
|
})
|
|
@@ -177,19 +177,19 @@ export default {
|
|
|
|
|
|
//1.2 删除内容
|
|
//1.2 删除内容
|
|
deleteRow(id) {
|
|
deleteRow(id) {
|
|
- console.log(id);
|
|
|
|
|
|
+ // console.log(id);
|
|
let data = new FormData()
|
|
let data = new FormData()
|
|
data.append('id', id)
|
|
data.append('id', id)
|
|
this.$confirm('注意:删除后,该条信息及其绑定关系全部删除', '是否确认删除该条信息?', {
|
|
this.$confirm('注意:删除后,该条信息及其绑定关系全部删除', '是否确认删除该条信息?', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- console.log("当前删除:" + id)
|
|
|
|
|
|
+ // console.log("当前删除:" + id)
|
|
|
|
|
|
delFooterContent({
|
|
delFooterContent({
|
|
id: id
|
|
id: id
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ // console.log(data);
|
|
if (data.code = 200) {
|
|
if (data.code = 200) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '删除成功',
|
|
message: '删除成功',
|
|
@@ -232,7 +232,7 @@ export default {
|
|
list_title:this.listTitle,
|
|
list_title:this.listTitle,
|
|
con_title:this.contentTitle,
|
|
con_title:this.contentTitle,
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ // console.log(data);
|
|
this.tableData = data.data.rows
|
|
this.tableData = data.data.rows
|
|
this.total = data.data.count
|
|
this.total = data.data.count
|
|
})
|
|
})
|
|
@@ -245,42 +245,73 @@ export default {
|
|
},
|
|
},
|
|
//列表和分页相关 end ------------------------------------------------------------>
|
|
//列表和分页相关 end ------------------------------------------------------------>
|
|
|
|
|
|
- //1.7 编辑
|
|
|
|
- goEdit(id, val) {
|
|
|
|
- // console.log(id);
|
|
|
|
- this.dialogName = '编辑'
|
|
|
|
- this.activeid = id
|
|
|
|
- this.dialogTableVisible = true
|
|
|
|
- console.log(id, val);
|
|
|
|
-
|
|
|
|
- //数据回显
|
|
|
|
- this.ruleForm.listTitle = val.list_title //列表标题
|
|
|
|
- this.ruleForm.contentTitle = val.con_title //内容标题
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.ruleForm.contentDetail = val.content //内容详情
|
|
|
|
- });
|
|
|
|
|
|
+ // //1.7 编辑
|
|
|
|
+ // goEdit(id, val) {
|
|
|
|
+ // // console.log(id);
|
|
|
|
+ // this.dialogName = '编辑'
|
|
|
|
+ // this.activeid = id
|
|
|
|
+ // this.dialogTableVisible = true
|
|
|
|
+ // console.log(id, val);
|
|
|
|
+
|
|
|
|
+ // //数据回显
|
|
|
|
+ // this.ruleForm.listTitle = val.list_title //列表标题
|
|
|
|
+ // this.ruleForm.contentTitle = val.con_title //内容标题
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // this.ruleForm.contentDetail = val.content //内容详情
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // },
|
|
|
|
+
|
|
|
|
+ // //1.8 添加
|
|
|
|
+ // addWebsite() {
|
|
|
|
+ // this.dialogTableVisible = true
|
|
|
|
+ // this.dialogName = "添加"
|
|
|
|
+
|
|
|
|
+ // //添加时清空回显回来的数据
|
|
|
|
+ // this.ruleForm.contentTitle = '' //内容标题
|
|
|
|
+ // this.ruleForm.contentDetail = '' //内容详情
|
|
|
|
+ // },
|
|
|
|
+ // 1.7 添加
|
|
|
|
+ goCreate() {
|
|
|
|
+ if(this.tabbarType==0 && this.total==1){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '该底部导航下已有详情页,不可添加详情页!',
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ let data = {
|
|
|
|
+ tabbarType: this.tabbarType,
|
|
|
|
+ dialogName: '添加', //添加
|
|
|
|
+ 'fcat_id': this.tabbarId, //底部导航传递的id
|
|
|
|
+ }
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/creatTabbarDetail',
|
|
|
|
+ query: data
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
},
|
|
},
|
|
-
|
|
|
|
- //1.8 添加
|
|
|
|
- addWebsite() {
|
|
|
|
- this.dialogTableVisible = true
|
|
|
|
- this.dialogName = "添加"
|
|
|
|
-
|
|
|
|
- //添加时清空回显回来的数据
|
|
|
|
- this.ruleForm.contentTitle = '' //内容标题
|
|
|
|
- this.ruleForm.contentDetail = '' //内容详情
|
|
|
|
|
|
+ // 1.8 编辑
|
|
|
|
+ goEdit(id, val) {
|
|
|
|
+ let data = {
|
|
|
|
+ id: id, //内容id
|
|
|
|
+ tabbarType: this.tabbarType,
|
|
|
|
+ dialogName: '编辑', //编辑
|
|
|
|
+ }
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/creatTabbarDetail',
|
|
|
|
+ query: data
|
|
|
|
+ });
|
|
},
|
|
},
|
|
-
|
|
|
|
// 弹出层相关方法
|
|
// 弹出层相关方法
|
|
// 1.9 提交表单
|
|
// 1.9 提交表单
|
|
submitForm(formName) {
|
|
submitForm(formName) {
|
|
// 判断用户是否输入数据
|
|
// 判断用户是否输入数据
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- console.log('submit!');
|
|
|
|
|
|
+ // console.log('submit!');
|
|
} else {
|
|
} else {
|
|
- console.log('error submit!!');
|
|
|
|
|
|
+ // console.log('error submit!!');
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -292,7 +323,7 @@ export default {
|
|
con_title: this.ruleForm.contentTitle,
|
|
con_title: this.ruleForm.contentTitle,
|
|
content: this.ruleForm.contentDetail,
|
|
content: this.ruleForm.contentDetail,
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ // console.log(data);
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '添加成功',
|
|
message: '添加成功',
|
|
@@ -315,7 +346,7 @@ export default {
|
|
con_title: this.ruleForm.contentTitle,
|
|
con_title: this.ruleForm.contentTitle,
|
|
content: this.ruleForm.contentDetail,
|
|
content: this.ruleForm.contentDetail,
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ // console.log(data);
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '添加成功',
|
|
message: '添加成功',
|
|
@@ -340,7 +371,7 @@ export default {
|
|
con_title: this.ruleForm.contentTitle,
|
|
con_title: this.ruleForm.contentTitle,
|
|
content: this.ruleForm.contentDetail,
|
|
content: this.ruleForm.contentDetail,
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ // console.log(data);
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '修改成功!',
|
|
message: '修改成功!',
|
|
@@ -363,7 +394,7 @@ export default {
|
|
con_title: this.ruleForm.contentTitle,
|
|
con_title: this.ruleForm.contentTitle,
|
|
content: this.ruleForm.contentDetail,
|
|
content: this.ruleForm.contentDetail,
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ // console.log(data);
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '修改成功!',
|
|
message: '修改成功!',
|