code init
This commit is contained in:
@@ -0,0 +1,644 @@
|
||||
<!-- 标准法规库 - 动态&资料 -->
|
||||
<template>
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" class="el-tabs">
|
||||
<el-tab-pane label="资料中心" name="first">
|
||||
<div id="queryDynamicInformation" class="v-class">
|
||||
<div class="query-dynamic-information-left">
|
||||
<div class="dynamic-search">
|
||||
<div class="dynamic-search-header">
|
||||
<h5>资料中心搜索</h5>
|
||||
</div>
|
||||
<div class="dynamic-search-line"></div>
|
||||
<div class="dynamic-search-center search-area">
|
||||
<el-form
|
||||
ref="dynamic"
|
||||
:modal="dynamic"
|
||||
label-width="100px"
|
||||
inline
|
||||
@keyup.enter.native="getSearch">
|
||||
<el-form-item label="" prop="keyWord" class="search-item">
|
||||
<el-input
|
||||
class="winput"
|
||||
v-model="dynamic.keyWord"
|
||||
@keyup.enter="getSearch"
|
||||
clearable
|
||||
placeholder="请输入查找关键字"
|
||||
:maxlength="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="openData" class="search-item">
|
||||
<el-date-picker
|
||||
class="winput"
|
||||
v-model="dynamic.openData"
|
||||
type="date"
|
||||
:editable="false"
|
||||
placeholder="请选择开始时间"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="closeData" class="search-item">
|
||||
<el-date-picker
|
||||
class="winput"
|
||||
v-model="dynamic.closeData"
|
||||
type="date"
|
||||
:editable="false"
|
||||
placeholder="请选择结束时间"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item class="wbtn">
|
||||
<el-button
|
||||
type="primary"
|
||||
round
|
||||
size="small"
|
||||
@click="getSearch"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button round size="small" @click="empty">清空</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="query-dynamic-information-right">
|
||||
<span class="result">{{ result }}</span>
|
||||
<!-- <span style="float: right;margin-right: 20px;margin-top: 5px" class="more" @click="moreClick">更多</span>-->
|
||||
<div class="more">
|
||||
<el-button
|
||||
v-btn-permission="'QYH42UV442H8WJSX9EZH'"
|
||||
type="primary"
|
||||
class="common-button-primary"
|
||||
round
|
||||
@click="moreClick">
|
||||
更多
|
||||
</el-button>
|
||||
</div>
|
||||
<has-no-data
|
||||
pClass="substance"
|
||||
:tips="substanceTips"
|
||||
v-if="substance.length === 0"
|
||||
>
|
||||
</has-no-data>
|
||||
<!-- 相关动态 -->
|
||||
<div class="substance" v-else>
|
||||
<div
|
||||
v-for="(sub, index) in substance"
|
||||
:key="index"
|
||||
@click="informationDetails(sub)"
|
||||
>
|
||||
<div class="substance-title">
|
||||
<i v-show="isNew(sub.pubTime)" class="newI">new</i>
|
||||
<i class="el-icon-document-copy" />
|
||||
<span :title="sub.title">{{ sub.title }}</span>
|
||||
</div>
|
||||
<div class="substance-date">
|
||||
<!-- <p>{{ sub.contentTxt }}</p>
|
||||
<span v-if="sub.pubTime != null && sub.pubTime !== ''">{{
|
||||
$dateFormat(new Date(sub.pubTime), "yyyy-MM-dd")
|
||||
}}</span> -->
|
||||
<span class="time">{{ getDate(sub.pubTime) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<loading :loading="loading">正在查找相关资料...</loading>
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page="page"
|
||||
@pageChange="pageChange"
|
||||
@pageSizeChange="pageSizeChange"
|
||||
></pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="动态信息" name="second">
|
||||
<div class="information">
|
||||
<div class="headBtn search-area">
|
||||
<div class="left">
|
||||
<el-form :model="search" inline class="label-input-form" @submit.native.prevent>
|
||||
<el-form-item label="标题" prop="msgTitle" class="search-item search-item-last">
|
||||
<el-input
|
||||
v-model="search.msgTitle"
|
||||
clearable
|
||||
@keyup.enter.native="tableData"
|
||||
placeholder="根据标题查找"/>
|
||||
</el-form-item>
|
||||
<el-form-item class="search-item btn-box">
|
||||
<el-button
|
||||
icon="el-icon-search"
|
||||
type="primary"
|
||||
class="common-button-primary"
|
||||
round
|
||||
@click="tableData"></el-button>
|
||||
</el-form-item>
|
||||
<el-form-item class="search-item btn-box">
|
||||
<el-button
|
||||
class="common-button-default"
|
||||
icon="el-icon-refresh-left"
|
||||
round
|
||||
@click="resetSearch"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <span class="more" @click="moreClick">更多</span>-->
|
||||
<div class="more">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="common-button-primary"
|
||||
round
|
||||
v-btn-permission="'ZV75SCBJEVET3DC9782Z'"
|
||||
@click="moreClickInfo">
|
||||
更多
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<loading :loading="loadingInfo">数据获取中</loading>
|
||||
<el-table
|
||||
:data="msgList"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
border
|
||||
height="100%"
|
||||
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
|
||||
fontWeight: 'bold', height: '48px'}"
|
||||
ref="selection"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
label="标题"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.title }}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="content"
|
||||
label="内容"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="state"
|
||||
label="状态"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="totalInfo" @pageChange="pageChangeInfo" @pageSizeChange="pageSizeChangeInfo"></pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'DynamicInformation',
|
||||
data () {
|
||||
return {
|
||||
totalInfo: 0,
|
||||
pageInfo: 1,
|
||||
pageSize: this.$store.getters.userInfo.configContent,
|
||||
msgList: [],
|
||||
loadingInfo: false,
|
||||
search: {
|
||||
msgTitle: ''
|
||||
},
|
||||
//
|
||||
activeName: 'first',
|
||||
// 头部搜索框
|
||||
dynamic: {
|
||||
keyWord: '',
|
||||
openData: '',
|
||||
closeData: ''
|
||||
},
|
||||
result: '最近资料',
|
||||
value11: '',
|
||||
substance: [],
|
||||
page: 1, // 当前页数
|
||||
total: 0, // 总条数
|
||||
loading: false,
|
||||
queryFlag: false, // 是否查找
|
||||
searchFlag: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick (){
|
||||
|
||||
},
|
||||
pageChangeInfo (page) {
|
||||
this.pageInfo = page
|
||||
this.tableData()
|
||||
},
|
||||
// 分页每页显示数改变后方法
|
||||
pageSizeChangeInfo (pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.tableData()
|
||||
},
|
||||
// 详情页
|
||||
handlePreview (item) {
|
||||
this.$store.commit('setDetailMap', this.$route.path)
|
||||
this.$router.push({
|
||||
name: 'informationIndex2',
|
||||
query: {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置
|
||||
resetSearch () {
|
||||
this.search.msgTitle = ''
|
||||
this.tableData()
|
||||
},
|
||||
tableData () {
|
||||
this.loadingInfo = true
|
||||
let itemsPage = {}
|
||||
itemsPage.page = this.pageInfo
|
||||
itemsPage.pageSize = this.pageSize
|
||||
itemsPage.title = this.search.msgTitle
|
||||
this.$http.get('lawss/sarNotice/getTenList', itemsPage, {
|
||||
_this: this
|
||||
}, res => {
|
||||
this.loadingInfo = false
|
||||
if (res.ok) {
|
||||
// this.msgList = res.data.list
|
||||
let list = res.data.list
|
||||
list.sort(function (a, b) {
|
||||
return b.createTime - a.createTime
|
||||
})
|
||||
this.msgList = list
|
||||
this.totalInfo = res.data.count
|
||||
}
|
||||
}, e => {
|
||||
})
|
||||
},
|
||||
backInfo () {
|
||||
// alert(0)
|
||||
// this.$router.push('/dynamics')
|
||||
if (this.$store.state.detailMap !== '') {
|
||||
this.$router.push(this.$store.state.detailMap)
|
||||
this.$store.commit('setDetailMap', '')
|
||||
} else {
|
||||
let lastPathList = this.$store.getters.getLastDetailMap
|
||||
let lastPath = lastPathList[lastPathList.length - 1]
|
||||
this.$router.push(lastPath)
|
||||
lastPathList.pop(1)
|
||||
this.$store.commit('setLastDetailMap', JSON.stringify(lastPathList))
|
||||
}
|
||||
},
|
||||
moreClickInfo () {
|
||||
this.$store.commit('setDetailMap', this.$route.path)
|
||||
this.$router.push('/informationMore')
|
||||
},
|
||||
testa () {
|
||||
var arr = [
|
||||
{
|
||||
name: '1'
|
||||
},
|
||||
{
|
||||
name: '2'
|
||||
}
|
||||
]
|
||||
var newArr = []
|
||||
// defaultData
|
||||
for (var a = 0; a < arr.length; a++) {
|
||||
var json = {}
|
||||
json.text = arr[a].name
|
||||
newArr.push(json)
|
||||
}
|
||||
console.log(newArr);
|
||||
},
|
||||
// 资料中心
|
||||
moreClick () {
|
||||
this.$store.commit('setDetailMap', this.$route.path)
|
||||
this.$router.push({
|
||||
name: 'DynamicInformationMore'
|
||||
})
|
||||
},
|
||||
// new
|
||||
isNew (pubTime) {
|
||||
if (pubTime != null && pubTime !== '' && pubTime !== undefined) {
|
||||
pubTime = pubTime.replace(new RegExp(/-/gm), '/')
|
||||
return (
|
||||
new Date().getTime() - new Date(pubTime).getTime() <
|
||||
7 * 24 * 3600 * 1000
|
||||
)
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @description: 日期转换
|
||||
* @author: chenxiaoxi
|
||||
* @date: 2018/11/01 10:20:12
|
||||
*/
|
||||
dateFormat (date) {
|
||||
let year = new Date(date).getFullYear()
|
||||
let month = new Date(date).getMonth() + 1
|
||||
let day = new Date(date).getDate()
|
||||
return (
|
||||
year +
|
||||
'-' +
|
||||
(month < 10 ? '0' + month : month) +
|
||||
'-' +
|
||||
(day < 10 ? '0' + day : day)
|
||||
)
|
||||
},
|
||||
getDate (date) {
|
||||
return date !== undefined && date != null ? date.split(' ')[0] : ''
|
||||
},
|
||||
queryKeyWords () {
|
||||
// let search = JSON.stringify(this.dynamic)
|
||||
let obj = {}
|
||||
obj.keyWord = this.dynamic.keyWord
|
||||
obj.openData = this.dynamic.openData
|
||||
? this.dateFormat(this.dynamic.openData, 'yyyy-MM-dd')
|
||||
: ''
|
||||
obj.closeData = this.dynamic.closeData
|
||||
? this.dateFormat(this.dynamic.closeData, 'yyyy-MM-dd')
|
||||
: ''
|
||||
let search = JSON.stringify(obj)
|
||||
this.$store.commit('setDynamicSearchHistory', search)
|
||||
this.queryFlag = true
|
||||
this.$http.get(
|
||||
'lawss/msgDynamicInfo/pageForSevenDay',
|
||||
{
|
||||
pubTime1: this.dynamic.openData
|
||||
? this.dateFormat(this.dynamic.openData, 'yyyy-MM-dd')
|
||||
: '',
|
||||
pubTime2: this.dynamic.closeData
|
||||
? this.dateFormat(this.dynamic.closeData, 'yyyy-MM-dd')
|
||||
: '',
|
||||
title: this.dynamic.keyWord,
|
||||
page: this.page,
|
||||
pageSize: this.$store.getters.userInfo.configContent
|
||||
},
|
||||
{
|
||||
_this: this,
|
||||
loading: 'loading'
|
||||
},
|
||||
(res) => {
|
||||
this.substance = res.data.list
|
||||
this.total = res.data.count
|
||||
},
|
||||
(e) => {}
|
||||
)
|
||||
},
|
||||
// 点击左侧查询按钮
|
||||
getSearch () {
|
||||
this.page = 1
|
||||
this.querySearchWords()
|
||||
},
|
||||
// 查询
|
||||
querySearchWords () {
|
||||
this.result = '搜索结果 '
|
||||
this.queryKeyWords()
|
||||
},
|
||||
// 清空
|
||||
empty () {
|
||||
this.page = 1
|
||||
this.dynamic.keyWord = ''
|
||||
this.dynamic.openData = ''
|
||||
this.dynamic.closeData = ''
|
||||
this.result = '最近资料'
|
||||
this.queryKeyWords()
|
||||
},
|
||||
/**
|
||||
* @description:条件查找动态
|
||||
* @author: zhaochunfeng
|
||||
* @date: 2018/10/29 11:09:25
|
||||
*/
|
||||
// 页码改变的回调
|
||||
pageChange (page) {
|
||||
this.page = page
|
||||
this.querySearchWords()
|
||||
},
|
||||
// 每页跳数改变回调
|
||||
pageSizeChange () {
|
||||
this.querySearchWords()
|
||||
},
|
||||
// 查看详情
|
||||
informationDetails (information) {
|
||||
this.$store.commit('setDetailMap', this.$route.path)
|
||||
const route = this.$router.resolve({
|
||||
name: 'DynamicInfomationDetails2',
|
||||
query: {
|
||||
id: information.id,
|
||||
pageType: information.msgType + '_MSG'
|
||||
}
|
||||
})
|
||||
window.open(route.href, '_blank')
|
||||
},
|
||||
// 返回
|
||||
back () {
|
||||
this.$router.push('/dynamicInformation')
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
props: {},
|
||||
computed: {
|
||||
...mapGetters(['getRoleModule']),
|
||||
// 查找提示
|
||||
substanceTips () {
|
||||
return this.queryFlag === true ? '未找到相关资料' : '请输入您的查找条件'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
deep: true,
|
||||
handler (val) {
|
||||
this.queryFlag = false
|
||||
}
|
||||
},
|
||||
loading (val) {
|
||||
if (val) {
|
||||
$('.substance').css('overflow-y', 'hidden')
|
||||
} else {
|
||||
$('.substance').css('overflow-y', 'auto')
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.dynamic.keyWord = this.$route.query.keywords
|
||||
this.dynamic.openData = this.$route.query.startTime
|
||||
this.dynamic.closeData = this.$route.query.endTime
|
||||
// 如果有一个条件不为空,则进行查找
|
||||
this.queryKeyWords()
|
||||
this.testa()
|
||||
this.tableData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@import "~@/assets/styles/style";
|
||||
@import "~@/assets/styles/mixins";
|
||||
.el-tabs{
|
||||
height: 100%;
|
||||
/deep/.el-tabs__content{
|
||||
height: calc(~'100% - 38px');
|
||||
.el-tab-pane{
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
#queryDynamicInformation {
|
||||
.flex();
|
||||
padding: 15px;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
overflow-y: auto;
|
||||
.query-dynamic-information-left {
|
||||
.flex();
|
||||
justify-content: center;
|
||||
margin-right: 10px;
|
||||
width: 280px;
|
||||
.dynamic-search {
|
||||
width: 280px;
|
||||
.dynamic-search-header {
|
||||
.flex();
|
||||
padding-bottom: 5px;
|
||||
h5 {
|
||||
flex: 1;
|
||||
padding-left: 5px;
|
||||
}
|
||||
}
|
||||
.dynamic-search-line {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background: @boxBgColor;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.dynamic-search-center {
|
||||
.search-btn {
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.winput {
|
||||
/deep/.el-input__inner {
|
||||
width: 250px;
|
||||
}
|
||||
}
|
||||
.wbtn {
|
||||
/deep/.el-button--small {
|
||||
width: 122px;
|
||||
}
|
||||
}
|
||||
/deep/.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
h5 {
|
||||
font-size: 18px;
|
||||
line-height: 30px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.query-dynamic-information-right {
|
||||
padding: 10px 0 0;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
overflow-x: auto;
|
||||
.substance {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: calc(~"100% - 70px");
|
||||
padding: 20px 10px 10px;
|
||||
font-size: 16px;
|
||||
overflow-y: auto;
|
||||
& > div {
|
||||
.flex();
|
||||
justify-content: space-between;
|
||||
.substance-title {
|
||||
display: flex;
|
||||
padding: 10px 5px;
|
||||
max-width: 80%;
|
||||
& > span {
|
||||
display: inline-block;
|
||||
margin-left: 3px;
|
||||
width: 100%;
|
||||
.ellipsis();
|
||||
}
|
||||
}
|
||||
.substance-title:hover {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
color: @baseColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.result {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
margin-left: 15px;
|
||||
margin-top: 10px;
|
||||
color: #3d3d3d;
|
||||
}
|
||||
.newI {
|
||||
font-style: italic;
|
||||
color: #e4393c;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
/deep/.more {
|
||||
cursor: pointer;
|
||||
color: #12508e;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<!-- 动态信息 -->
|
||||
<style lang="less">
|
||||
@import '~@/assets/styles/mixins';
|
||||
@import '~@/assets/styles/style';
|
||||
.information{
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.headBtn{
|
||||
height: 50px;
|
||||
background-color: #FFFFFF;
|
||||
/deep/.more {
|
||||
cursor: pointer;
|
||||
color: #12508e;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
.container{
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
flex: auto;
|
||||
.pagination {
|
||||
position: static;
|
||||
/deep/ .pagination-slot {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user