|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="mainBox">
|
|
|
<!--搜索功能 start------------------------------------------------------------>
|
|
|
- <div class="layerBox_search">
|
|
|
+ <!-- <div class="layerBox_search">
|
|
|
<div class="layerBoxLine">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
@@ -16,15 +16,15 @@
|
|
|
<el-input placeholder="请输入栏目名称" autocomplete="off" v-model="getApiData.name"/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="8">
|
|
|
+ <el-col :span="8">
|
|
|
<div class="searchBox">
|
|
|
<div class="searchTitle">行政职能部门:</div>
|
|
|
<el-cascader :key="searchDepartmentKey" v-model="getApiData.department_id" placeholder="请选择行政职能部门" :props="searchDepartmentData" filterable clearable></el-cascader>
|
|
|
</div>
|
|
|
- </el-col> -->
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
- </div>
|
|
|
- <!-- <div class="layerBoxLineTwo">
|
|
|
+ </div>
|
|
|
+ <div class="layerBoxLineTwo">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<div class="searchBox">
|
|
@@ -33,15 +33,15 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- <div class="layerBoxNoBg">
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
+ <!-- <div class="layerBoxNoBg">
|
|
|
<div></div>
|
|
|
<div>
|
|
|
- <el-button @click="clearSearchList">重置</el-button>
|
|
|
- <el-button type="primary" style="margin-right:20px" @click="getData()">搜索</el-button>
|
|
|
+ <el-button @click="clearSearchList">重置</el-button>
|
|
|
+ <el-button type="primary" style="margin-right:20px" @click="getData()">搜索</el-button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<!--搜索功能 end------------------------------------------------------------>
|
|
|
|
|
|
<!--表格内容 start------------------------------------------------------------>
|
|
@@ -49,10 +49,11 @@
|
|
|
<tableTitle :name="tableDivTitle"/>
|
|
|
<el-row>
|
|
|
<template>
|
|
|
- <el-table :data="tableData" style="width: 100%">
|
|
|
- <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
|
|
|
+ <el-table :data="tableData" style="width: 100%" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
|
|
+ <el-table-column fixed prop="id" label="编号" width="180"></el-table-column>
|
|
|
<el-table-column prop="name" label="栏目名称"></el-table-column>
|
|
|
<el-table-column prop="alias" label="展示名称"></el-table-column>
|
|
|
+ <el-table-column prop="sort" label="排序"></el-table-column>
|
|
|
<el-table-column prop="created_at" label="创建时间"></el-table-column>
|
|
|
<el-table-column prop="updated_at" label="修改时间"></el-table-column>
|
|
|
<el-table-column fixed="right" label="操作" width="120" header-align="center">
|
|
@@ -68,13 +69,13 @@
|
|
|
</div>
|
|
|
|
|
|
<!--分页 start------------------------------------------------------------>
|
|
|
- <div class="alignBox">
|
|
|
+ <!-- <div class="alignBox">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-pagination :current-page="getApiData.page" @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper" :total="allCount"></el-pagination>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<!--分页 end------------------------------------------------------------>
|
|
|
<!--表格内容 end------------------------------------------------------------>
|
|
|
|
|
@@ -91,11 +92,19 @@
|
|
|
<el-input v-model="form.seo_title" autocomplete="off"></el-input>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="排序:" :label-width="formLabelWidth" prop="sort" class="custom-align-right">
|
|
|
+ <div class="formLabelFloatBox">
|
|
|
+ <el-input v-model="form.sort" autocomplete="off" ></el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="栏目关键词:" :label-width="formLabelWidth" prop="seo_keywords" class="custom-align-right">
|
|
|
<div class="formLabelFloatBox">
|
|
|
- <el-input v-model="form.seo_keywords" autocomplete="off"></el-input>
|
|
|
+ <inputTag :initialTags="tags" @tags-updated="updateTags"/>
|
|
|
+ <!-- <inputTag :initialTags="form.seo_keywords" @tags-updated="updateTags"/> -->
|
|
|
+ <!-- <el-input v-model="form.seo_keywords" autocomplete="off"></el-input> -->
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item label="栏目描述:" :label-width="formLabelWidth" prop="seo_description" class="custom-align-right">
|
|
|
<el-input type="textarea" v-model="form.seo_description" class="custom-textarea"></el-input>
|
|
|
</el-form-item>
|
|
@@ -120,9 +129,11 @@ import '@/styles/global.less';
|
|
|
//表格标题
|
|
|
import tableTitle from './components/tableTitle';
|
|
|
|
|
|
+import InputTag from '@/components/InputTag'
|
|
|
export default {
|
|
|
components: {
|
|
|
tableTitle,//表格标题
|
|
|
+ InputTag
|
|
|
},
|
|
|
data() {
|
|
|
//0.全局操作 start ------------------------------------------------------------>
|
|
@@ -138,6 +149,7 @@ export default {
|
|
|
//0.全局操作 end ------------------------------------------------------------>
|
|
|
|
|
|
return {
|
|
|
+ tags: ['初始标签1', '初始标签2'],
|
|
|
//1.列表和分页相关 start ------------------------------------------------------------>
|
|
|
tableDivTitle:"栏目详情",
|
|
|
tableData: [],//列表
|
|
@@ -228,12 +240,14 @@ export default {
|
|
|
alias:"",//导航名称
|
|
|
seo_title:"",//导航seo名称
|
|
|
seo_keywords:"",//导航关键词
|
|
|
- seo_description:""//导航描述
|
|
|
+ seo_description:"",//导航描述
|
|
|
+ sort:0//排序
|
|
|
},
|
|
|
//3.2表单验证规则
|
|
|
formRules: {
|
|
|
//网站名称不能为空
|
|
|
alias:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
+ sort:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
//网站标题,关键词,描述不能为空
|
|
|
seo_title:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
|
seo_keywords:[{required:true,trigger:'blur',validator:validateEmpty}],
|
|
@@ -255,22 +269,22 @@ export default {
|
|
|
this.getApiData.city_id = this.getApiData.city_id[this.getApiData.city_id.length - 1];
|
|
|
}
|
|
|
this.$store.dispatch('pool/getWebsiteAllCategory',this.getApiData).then(res=> {
|
|
|
- let data = res.data.rows;
|
|
|
+ let data = res.data;
|
|
|
this.tableData = data;//放入数据
|
|
|
- this.allCount = res.data.count;//放入总条数
|
|
|
+ // this.allCount = res.data.count;//放入总条数
|
|
|
})
|
|
|
},
|
|
|
//1.2 列表内容分页
|
|
|
//直接跳转
|
|
|
- handleSizeChange(val) {
|
|
|
- this.getApiData.page = val;
|
|
|
- this.getData();
|
|
|
- },
|
|
|
- //1.3 点击分页
|
|
|
- handleCurrentChange(val) {
|
|
|
- this.getApiData.page = val;
|
|
|
- this.getData();
|
|
|
- },
|
|
|
+ // handleSizeChange(val) {
|
|
|
+ // this.getApiData.page = val;
|
|
|
+ // this.getData();
|
|
|
+ // },
|
|
|
+ // //1.3 点击分页
|
|
|
+ // handleCurrentChange(val) {
|
|
|
+ // this.getApiData.page = val;
|
|
|
+ // this.getData();
|
|
|
+ // },
|
|
|
//1.4 重置按钮
|
|
|
clearSearchList(){
|
|
|
this.tableData = [];
|
|
@@ -318,13 +332,15 @@ export default {
|
|
|
category_id:id
|
|
|
}
|
|
|
this.$store.dispatch('pool/getWebsiteCategoryOnes',data).then(res=> {
|
|
|
- console.log(res.data)
|
|
|
+ // console.log(res.data)
|
|
|
this.form.website_id = this.$route.query.website_id;
|
|
|
this.form.category_id = id;
|
|
|
this.form.alias = res.data.alias;
|
|
|
this.form.seo_title = res.data.seo_title;
|
|
|
this.form.seo_keywords = res.data.seo_keywords;
|
|
|
+ this.tags = res.data.seo_keywords?res.data.seo_keywords.split(','):[];
|
|
|
this.form.seo_description = res.data.seo_description;
|
|
|
+ this.form.sort = res.data.sort;
|
|
|
})
|
|
|
},
|
|
|
//提交编辑的数据
|
|
@@ -350,9 +366,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.getData();
|
|
|
- }
|
|
|
+ },
|
|
|
//编辑导航 end ------------------------------------------------------------>
|
|
|
-
|
|
|
+ updateTags(newTags) {
|
|
|
+ // this.foem.seo_keywords = newTags;
|
|
|
+ this.tags = newTags;
|
|
|
+ this.form.seo_keywords = newTags.join(',');
|
|
|
+ },
|
|
|
},
|
|
|
mounted(){
|
|
|
//console.log(this.$route.query);
|