|
@@ -16,13 +16,13 @@
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<div class="searchBox">
|
|
<div class="searchBox">
|
|
<div class="searchTitle">名称:</div>
|
|
<div class="searchTitle">名称:</div>
|
|
- <el-input placeholder="请输入名称" autocomplete="off" v-model="getApiData.name"/>
|
|
|
|
|
|
+ <el-input placeholder="请输入名称" autocomplete="off" v-model="getApiData.name" />
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<div class="searchBox">
|
|
<div class="searchBox">
|
|
<div class="searchTitle">网站名称:</div>
|
|
<div class="searchTitle">网站名称:</div>
|
|
- <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.website_name"/>
|
|
|
|
|
|
+ <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.website_name" />
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -32,7 +32,7 @@
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<div class="searchBox">
|
|
<div class="searchBox">
|
|
<div class="searchTitle">导航名称:</div>
|
|
<div class="searchTitle">导航名称:</div>
|
|
- <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.category_name"/>
|
|
|
|
|
|
+ <el-input placeholder="请输入网站名称" autocomplete="off" v-model="getApiData.category_name" />
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
@@ -53,7 +53,7 @@
|
|
|
|
|
|
<!--表格内容 start------------------------------------------------------------>
|
|
<!--表格内容 start------------------------------------------------------------>
|
|
<div class="layerBox">
|
|
<div class="layerBox">
|
|
- <tableTitle :name="tableDivTitle"/>
|
|
|
|
|
|
+ <tableTitle :name="tableDivTitle" />
|
|
<el-row>
|
|
<el-row>
|
|
<template>
|
|
<template>
|
|
<el-table :data="tableData" style="width: 100%">
|
|
<el-table :data="tableData" style="width: 100%">
|
|
@@ -61,11 +61,11 @@
|
|
<el-table-column prop="type_id" label="发布类型" width="">
|
|
<el-table-column prop="type_id" label="发布类型" width="">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span v-if="scope.row.type_id==1">
|
|
|
|
|
|
+ <span v-if="scope.row.type_id == 1">
|
|
供应商品
|
|
供应商品
|
|
</span>
|
|
</span>
|
|
- <span v-if="scope.row.type_id==2">
|
|
|
|
- 求购商品
|
|
|
|
|
|
+ <span v-if="scope.row.type_id == 2">
|
|
|
|
+ 求购商品
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -81,8 +81,10 @@
|
|
<el-table-column fixed="right" label="操作" width="200" header-align="center">
|
|
<el-table-column fixed="right" label="操作" width="200" header-align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div class="listBtnBox">
|
|
<div class="listBtnBox">
|
|
- <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i class="el-icon-delete"></i>移除</div>
|
|
|
|
- <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i class="el-icon-edit-outline"></i>编辑</div>
|
|
|
|
|
|
+ <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
|
|
|
|
+ class="el-icon-delete"></i>移除</div>
|
|
|
|
+ <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
|
|
|
|
+ class="el-icon-edit-outline"></i>编辑</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -94,7 +96,9 @@
|
|
<div class="alignBox">
|
|
<div class="alignBox">
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page" @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper" :total="allCount"></el-pagination>
|
|
|
|
|
|
+ <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page"
|
|
|
|
+ @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper"
|
|
|
|
+ :total="allCount"></el-pagination>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
@@ -116,19 +120,19 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
//1.列表和分页相关 start ------------------------------------------------------------>
|
|
//1.列表和分页相关 start ------------------------------------------------------------>
|
|
- tableDivTitle:"商品列表",
|
|
|
|
- tableData:[],//内容
|
|
|
|
- editId:0,//要修改的网站id
|
|
|
|
- getApiData:{
|
|
|
|
- title:"",//标题
|
|
|
|
- category_name:"",//导航池id
|
|
|
|
- author:"",//作者
|
|
|
|
- islink:"",//是否使用外链
|
|
|
|
- status:"",//商品状态
|
|
|
|
- page:1,//当前是第几页
|
|
|
|
- page_size:10,//一共多少条
|
|
|
|
|
|
+ tableDivTitle: "商品列表",
|
|
|
|
+ tableData: [],//内容
|
|
|
|
+ editId: 0,//要修改的网站id
|
|
|
|
+ getApiData: {
|
|
|
|
+ name: "",//标题
|
|
|
|
+ category_name: "",//导航池id
|
|
|
|
+ website_name: "",//网站名称
|
|
|
|
+ type_id: "",//发布类型
|
|
|
|
+
|
|
|
|
+ page: 1,//当前是第几页
|
|
|
|
+ page_size: 10,//一共多少条
|
|
},
|
|
},
|
|
- allCount:0,//总条数
|
|
|
|
|
|
+ allCount: 0,//总条数
|
|
//分页相关 end ------------------------------------------------------------>
|
|
//分页相关 end ------------------------------------------------------------>
|
|
|
|
|
|
}
|
|
}
|
|
@@ -136,20 +140,20 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
//1.列表和分页相关 start ------------------------------------------------------------>
|
|
//1.列表和分页相关 start ------------------------------------------------------------>
|
|
//1.1 开始请求列表信息方法
|
|
//1.1 开始请求列表信息方法
|
|
- getData(type){
|
|
|
|
- if(type=="search"){
|
|
|
|
|
|
+ getData(type) {
|
|
|
|
+ if (type == "search") {
|
|
this.getApiData.page = 1;
|
|
this.getApiData.page = 1;
|
|
}
|
|
}
|
|
- this.$store.dispatch('news/getGoodList',this.getApiData).then(res=> {
|
|
|
|
|
|
+ this.$store.dispatch('news/getGoodList', this.getApiData).then(res => {
|
|
//格式化:islink=0为不使用外面 islink=1为使用外链
|
|
//格式化:islink=0为不使用外面 islink=1为使用外链
|
|
//status=1为显示 status=2为不显示
|
|
//status=1为显示 status=2为不显示
|
|
let data = [];
|
|
let data = [];
|
|
- for(let item of res.data.rows){
|
|
|
|
|
|
+ for (let item of res.data.rows) {
|
|
// if(item.status==0){item.status="隐藏"}
|
|
// if(item.status==0){item.status="隐藏"}
|
|
// if(item.status==1){item.status="显示"}
|
|
// if(item.status==1){item.status="显示"}
|
|
// if(item.status==404){item.status="已删除"}
|
|
// if(item.status==404){item.status="已删除"}
|
|
- if(item.islink==0){item.islink="否"}
|
|
|
|
- if(item.islink==1){item.islink="是"}
|
|
|
|
|
|
+ if (item.islink == 0) { item.islink = "否" }
|
|
|
|
+ if (item.islink == 1) { item.islink = "是" }
|
|
data.push(item)
|
|
data.push(item)
|
|
}
|
|
}
|
|
this.tableData = res.data.rows; //给与内容
|
|
this.tableData = res.data.rows; //给与内容
|
|
@@ -162,14 +166,14 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//1.2 删除内容
|
|
//1.2 删除内容
|
|
- deleteRow(id){
|
|
|
|
|
|
+ deleteRow(id) {
|
|
this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
|
|
this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
console.log("当前删除:" + id)
|
|
console.log("当前删除:" + id)
|
|
- this.$store.dispatch('news/delGood',{id:id}).then(res=> {
|
|
|
|
|
|
+ this.$store.dispatch('news/delGood', { id: id }).then(res => {
|
|
this.getData();
|
|
this.getData();
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
@@ -189,13 +193,13 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//1.3 修改网站状态
|
|
//1.3 修改网站状态
|
|
- upRow(id,status){
|
|
|
|
|
|
+ upRow(id, status) {
|
|
let data = {
|
|
let data = {
|
|
- id:id,
|
|
|
|
- status:status
|
|
|
|
|
|
+ id: id,
|
|
|
|
+ status: status
|
|
}
|
|
}
|
|
- this.$store.dispatch('news/upArticleStatus',data).then(res=> {
|
|
|
|
- if(res.code==200){
|
|
|
|
|
|
+ this.$store.dispatch('news/upArticleStatus', data).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
message: '商品状态已修改!'
|
|
message: '商品状态已修改!'
|
|
@@ -220,13 +224,13 @@ export default {
|
|
this.getData();
|
|
this.getData();
|
|
},
|
|
},
|
|
//1.6 重置按钮
|
|
//1.6 重置按钮
|
|
- clearSearchList(){
|
|
|
|
|
|
+ clearSearchList() {
|
|
this.tableData = [];
|
|
this.tableData = [];
|
|
- this.getApiData.title = "";
|
|
|
|
|
|
+ this.getApiData.name = "";
|
|
this.getApiData.category_name = "";
|
|
this.getApiData.category_name = "";
|
|
- this.getApiData.author = "";
|
|
|
|
- this.getApiData.islink = "";
|
|
|
|
- this.getApiData.status = "";
|
|
|
|
|
|
+ this.getApiData.type_id = "";
|
|
|
|
+ this.getApiData.website_name = "";
|
|
|
|
+
|
|
this.getApiData.page = 1;
|
|
this.getApiData.page = 1;
|
|
this.getApiData.pageSize = 10;
|
|
this.getApiData.pageSize = 10;
|
|
this.getData();
|
|
this.getData();
|
|
@@ -235,14 +239,14 @@ export default {
|
|
|
|
|
|
//2.添加新闻 start ------------------------------------------------------------>
|
|
//2.添加新闻 start ------------------------------------------------------------>
|
|
//跳转到商品发布页面
|
|
//跳转到商品发布页面
|
|
- goCreat(){
|
|
|
|
|
|
+ goCreat() {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: '/addGood',
|
|
path: '/addGood',
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- goEdit(id){
|
|
|
|
|
|
+ goEdit(id) {
|
|
let data = {
|
|
let data = {
|
|
- id:id
|
|
|
|
|
|
+ id: id
|
|
}
|
|
}
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: '/addGood',
|
|
path: '/addGood',
|
|
@@ -251,13 +255,11 @@ export default {
|
|
}
|
|
}
|
|
//添加新闻 end ------------------------------------------------------------>
|
|
//添加新闻 end ------------------------------------------------------------>
|
|
},
|
|
},
|
|
- mounted(){
|
|
|
|
|
|
+ mounted() {
|
|
//1.获得初始数据
|
|
//1.获得初始数据
|
|
this.getData();
|
|
this.getData();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style scoped lang="less">
|
|
|
|
-
|
|
|
|
-</style>
|
|
|
|
|
|
+<style scoped lang="less"></style>
|