|
@@ -5,17 +5,14 @@
|
|
|
<div class="query-input">
|
|
|
<el-input v-model="form.id" placeholder="请输入栏目ID" style="margin-right: 10px;width: 20%;"></el-input>
|
|
|
<el-input v-model="form.name" placeholder="请输入栏目名称" style="margin-right: 10px;width: 20%;"></el-input>
|
|
|
- <el-input v-model="form.title" placeholder="请输入文章标题" style="margin-right: 10px;width: 30%;"></el-input>
|
|
|
+ <el-input v-model="form.title" placeholder="请输入文章标题" style="margin-right: 10px;width: 22%;"></el-input>
|
|
|
<!-- <el-input v-model="form.updatatime" placeholder="请输入发布时间" style="margin-right: 10px"></el-input> -->
|
|
|
- <el-date-picker
|
|
|
- v-model="form.updatatime"
|
|
|
- type="date"
|
|
|
- :clearable="false"
|
|
|
- placeholder="请输入发布时间"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- style="margin-right: 10px;width: 48%;">
|
|
|
+ <el-date-picker v-model="form.updatatime" type="date" :clearable="false" placeholder="请输入发布时间"
|
|
|
+ value-format="yyyy-MM-dd" style="margin-right: 10px;width: 26%;">
|
|
|
</el-date-picker>
|
|
|
- <el-input v-model="form.url" placeholder="请输入文章链接" style="margin-right: 10px;width: 50%;"></el-input>
|
|
|
+ <el-input v-model="form.url" placeholder="请输入文章链接" style="margin-right: 10px;width: 23%;"></el-input>
|
|
|
+ <el-input v-model="form.deptname" @focus="deptInfo" placeholder="请输入部门"
|
|
|
+ style="margin-right: 10px;width: 18%;"></el-input>
|
|
|
</div>
|
|
|
<div class="query-button">
|
|
|
<el-button type="primary" @click="serachWork">搜索</el-button>
|
|
@@ -24,16 +21,18 @@
|
|
|
</div>
|
|
|
<!-- 表格-->
|
|
|
<div>
|
|
|
- <el-table :data="hualongData" ref='multipleTable' style="width: 100%" :height="tabH" border stripe
|
|
|
- :header-cell-style="tableHeadStyle" :cell-style="cellStyle">
|
|
|
+ <el-table :data="hualongData" ref='multipleTable' style="width: 100%" :height="tabH" border stripe
|
|
|
+ :header-cell-style="tableHeadStyle" :cell-style="cellStyle">
|
|
|
<el-table-column width="60" label="序号">
|
|
|
<template slot-scope="scope">
|
|
|
{{(currentPage - 1) * pageSize + scope.$index + 1}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="栏目ID" width="80" prop="chnlid" :show-overflow-tooltip="true"></el-table-column>
|
|
|
- <el-table-column label="栏目名称" width="140" prop="channelname" :show-overflow-tooltip="true"></el-table-column>
|
|
|
- <el-table-column label="视图名" width="110" prop="viewname" :show-overflow-tooltip="true"></el-table-column>
|
|
|
+ <el-table-column label="栏目名称" width="140" prop="channelname" :show-overflow-tooltip="true">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="视图名" width="110" prop="viewname" :show-overflow-tooltip="true">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="文章标题" prop="doctitle" :show-overflow-tooltip="true"></el-table-column>
|
|
|
<el-table-column label="文章链接" prop="docpuburl" :show-overflow-tooltip="true" slot="default">
|
|
|
<template slot-scope="scope">
|
|
@@ -53,10 +52,51 @@
|
|
|
<!-- 分页-->
|
|
|
<div>
|
|
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize"
|
|
|
- layout="prev, pager,next,jumper,total,sizes" :total="total">
|
|
|
+ :current-page="currentPage" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize"
|
|
|
+ layout="prev, pager,next,jumper,total,sizes" :total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
+ <!--部门信息-->
|
|
|
+ <el-dialog :visible.sync="deptVisible" :show-close="false" :append-to-body="true"
|
|
|
+ style="margin: 10px auto!important" width="80%" top="10px">
|
|
|
+ <div slot="title">
|
|
|
+ <div class="addTitle">部门信息</div>
|
|
|
+ </div>
|
|
|
+ <el-button style="float: left" type="primary" @click="deptVisible = false">返回</el-button>
|
|
|
+ <div style="float: right;margin-bottom: 10px;margin-right: 10px">
|
|
|
+ <el-input v-model.trim="deptSorts.deptName" clearable placeholder="请输入部门名称"
|
|
|
+ style="margin: 0 10px;width: 200px" />
|
|
|
+ <el-button type="primary" class="search" @click="searchDept">搜索</el-button>
|
|
|
+ <el-button type="primary" class="search" @click="resetDept" style="margin-left: 5px">重置</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="deptData" border ref='deptTable' stripe height="475px"
|
|
|
+ :header-cell-style="{ background: '#e5e8ed', color: '#666', textAlign: 'center' }"
|
|
|
+ :cell-style="tableStyle" style="cursor: default">
|
|
|
+ <el-table-column width="50" label="序号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ (deptSorts.page - 1) * deptSorts.limit + scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="deptname" label="部门名称" />
|
|
|
+ <el-table-column prop="deptUrl" label="部门网址" />
|
|
|
+ <el-table-column prop="sortid" label="部门分类" width="110">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.sortid ? '部门' : '街镇'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="100px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button class="but" type="primary" @click="chooseDept(scope.row)">选择</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div>
|
|
|
+ <el-pagination @size-change="deptSizeChange" @current-change="deptCurrentChange"
|
|
|
+ :current-page="deptSorts.page" :page-sizes="[10, 20, 30, 40, 50]" :page-size="deptSorts.limit"
|
|
|
+ layout="prev, pager,next,jumper,total,sizes" :total="deptTotal">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -67,6 +107,9 @@
|
|
|
name: "HuaLongData",
|
|
|
data() {
|
|
|
return {
|
|
|
+ tableStyle: {
|
|
|
+ textAlign: 'center',
|
|
|
+ },
|
|
|
label: "华龙网数据",
|
|
|
tabH: 'calc(100vh - 210px)',
|
|
|
hualongData: [],
|
|
@@ -80,16 +123,30 @@
|
|
|
cellStyle: {
|
|
|
textAlign: 'center',
|
|
|
},
|
|
|
- form:{
|
|
|
+ form: {
|
|
|
id: '',
|
|
|
name: '',
|
|
|
title: '',
|
|
|
updatatime: '',
|
|
|
- url: ''
|
|
|
+ url: '',
|
|
|
+ deptid: '',
|
|
|
+ deptname: ''
|
|
|
},
|
|
|
- title:null,
|
|
|
- time:null,
|
|
|
- name:null,
|
|
|
+ title: null,
|
|
|
+ time: null,
|
|
|
+ name: null,
|
|
|
+ // 部门信息界面
|
|
|
+ deptVisible: false,
|
|
|
+ // 部门总数
|
|
|
+ deptTotal: 0,
|
|
|
+ // 部门信息数据
|
|
|
+ deptData: [],
|
|
|
+ // 部门信息分页
|
|
|
+ deptSorts: {
|
|
|
+ page: 1,
|
|
|
+ limit: 10,
|
|
|
+ deptName: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -101,18 +158,23 @@
|
|
|
page: this.currentPage,
|
|
|
limit: this.pageSize
|
|
|
}
|
|
|
- api.getHualongData({params}).then(r => {
|
|
|
+ api.getHualongData({
|
|
|
+ params
|
|
|
+ }).then(r => {
|
|
|
this.hualongData = r.data.data
|
|
|
this.total = r.data.count
|
|
|
})
|
|
|
},
|
|
|
hualongDetail(data) {
|
|
|
- this.hualongDetailData = {...data}
|
|
|
+ this.hualongDetailData = {
|
|
|
+ ...data
|
|
|
+ }
|
|
|
},
|
|
|
//显示每条数据
|
|
|
handleSizeChange(val) {
|
|
|
this.pageSize = val
|
|
|
- if ((this.form.id == '' && this.form.name == '') && (this.form.title == '' && this.form.updatatime == '') && this.form.url == '') {
|
|
|
+ if ((this.form.id == '' && this.form.name == '') && (this.form.title == '' && this.form.updatatime ==
|
|
|
+ '') && this.form.url == '') {
|
|
|
this.getHLData();
|
|
|
} else {
|
|
|
this.$refs.multipleTable.clearSort()
|
|
@@ -123,9 +185,12 @@
|
|
|
channelName: this.form.name,
|
|
|
docTitle: this.form.title,
|
|
|
docrelTime: this.form.updatatime,
|
|
|
- docpubUrl: this.form.url
|
|
|
+ docpubUrl: this.form.url,
|
|
|
+ deptid: this.form.deptid
|
|
|
};
|
|
|
- api.queryHualongNetwork({params}).then(res => {
|
|
|
+ api.queryHualongNetwork({
|
|
|
+ params
|
|
|
+ }).then(res => {
|
|
|
this.total = res.data.count
|
|
|
this.hualongData = res.data.data
|
|
|
});
|
|
@@ -135,7 +200,8 @@
|
|
|
handleCurrentChange(val) {
|
|
|
this.$refs.multipleTable.bodyWrapper.scrollTop = 0;
|
|
|
this.currentPage = val;
|
|
|
- if ((this.form.id == '' && this.form.name == '') && (this.form.title == '' && this.form.updatatime == '') && this.form.url == '') {
|
|
|
+ if ((this.form.id == '' && this.form.name == '') && (this.form.title == '' && this.form.updatatime ==
|
|
|
+ '') && this.form.url == '') {
|
|
|
this.getHLData();
|
|
|
} else {
|
|
|
this.$refs.multipleTable.clearSort()
|
|
@@ -146,9 +212,12 @@
|
|
|
channelName: this.form.name,
|
|
|
docTitle: this.form.title,
|
|
|
docrelTime: this.form.updatatime,
|
|
|
- docpubUrl: this.form.url
|
|
|
+ docpubUrl: this.form.url,
|
|
|
+ deptid: this.form.deptid
|
|
|
};
|
|
|
- api.queryHualongNetwork({params}).then(res => {
|
|
|
+ api.queryHualongNetwork({
|
|
|
+ params
|
|
|
+ }).then(res => {
|
|
|
this.total = res.data.count
|
|
|
this.hualongData = res.data.data
|
|
|
});
|
|
@@ -164,9 +233,12 @@
|
|
|
channelName: this.form.name,
|
|
|
docTitle: this.form.title,
|
|
|
docrelTime: this.form.updatatime,
|
|
|
- docpubUrl: this.form.url
|
|
|
+ docpubUrl: this.form.url,
|
|
|
+ deptid: this.form.deptid
|
|
|
}
|
|
|
- api.queryHualongNetwork({params}).then(res => {
|
|
|
+ api.queryHualongNetwork({
|
|
|
+ params
|
|
|
+ }).then(res => {
|
|
|
this.total = res.data.count
|
|
|
this.hualongData = res.data.data
|
|
|
})
|
|
@@ -178,13 +250,67 @@
|
|
|
this.form.title = ''
|
|
|
this.form.updatatime = ''
|
|
|
this.form.url = ''
|
|
|
+ this.form.deptid = ''
|
|
|
+ this.form.deptname = ''
|
|
|
this.getHLData()
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 查看部门信息
|
|
|
+ deptInfo() {
|
|
|
+ this.deptVisible = true;
|
|
|
+ this.deptSorts.page = 1;
|
|
|
+ this.deptSorts.limit = 10;
|
|
|
+ this.deptSorts.deptName = '';
|
|
|
+ this.getDeptData();
|
|
|
+ },
|
|
|
+ // 获取部门信息数据
|
|
|
+ getDeptData() {
|
|
|
+ let params = {
|
|
|
+ page: this.deptSorts.page,
|
|
|
+ limit: this.deptSorts.limit,
|
|
|
+ deptName: this.deptSorts.deptName
|
|
|
+ }
|
|
|
+ api.getDeptPage({
|
|
|
+ params
|
|
|
+ }).then(r => {
|
|
|
+ this.deptTotal = r.data.data.count;
|
|
|
+ this.deptData = r.data.data.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //切换部门条数
|
|
|
+ deptSizeChange(pageSize) {
|
|
|
+ this.deptSorts.limit = pageSize
|
|
|
+ this.deptSorts.page = 1;
|
|
|
+ this.getDeptData();
|
|
|
+ },
|
|
|
+ //切换部门页码
|
|
|
+ deptCurrentChange(currentPage) {
|
|
|
+ this.$refs.deptTable.bodyWrapper.scrollTop = 0;
|
|
|
+ this.deptSorts.page = currentPage;
|
|
|
+ this.getDeptData();
|
|
|
+ },
|
|
|
+ // 选择部门
|
|
|
+ chooseDept(data) {
|
|
|
+ this.form.deptid = data.deptid;
|
|
|
+ this.form.deptname = data.deptname;
|
|
|
+ this.deptVisible = false;
|
|
|
+ },
|
|
|
+ // 搜索部门信息
|
|
|
+ searchDept() {
|
|
|
+ this.deptSorts.page = 1;
|
|
|
+ this.getDeptData();
|
|
|
+ },
|
|
|
+ // 清空部门输入框
|
|
|
+ resetDept() {
|
|
|
+ this.deptSorts.deptName = '';
|
|
|
+ this.deptSorts.page = 1;
|
|
|
+ this.getDeptData()
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
+<style scoped lang="less">
|
|
|
.hualong-content {
|
|
|
padding: 10px;
|
|
|
}
|
|
@@ -203,4 +329,32 @@
|
|
|
.query-button {
|
|
|
display: flex;
|
|
|
}
|
|
|
+
|
|
|
+ /deep/ .el-dialog__title {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-dialog__body {
|
|
|
+ padding: 0 0 30px 20px;
|
|
|
+ color: #606266;
|
|
|
+ font-size: 14px;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-dialog {
|
|
|
+ margin: 0 auto 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .addTitle {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .but {
|
|
|
+ width: 36px;
|
|
|
+ height: 22px;
|
|
|
+ padding: 0;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
</style>
|