PublicSentiment.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <!-- -->
  2. <template>
  3. <div>
  4. <div class="simple_header">
  5. <div class="simple_header_icon"></div>
  6. <div class="simple_header_text">舆情</div>
  7. <!-- <div class="simple_header_text" style="float:right;margin-right:.5vw;">-->
  8. <!-- <el-button type="text" icon="el-icon-d-arrow-right" @click="showMore()">更多</el-button>-->
  9. <!-- </div>-->
  10. </div>
  11. <div class="left_PublicSentiment_content" id="left_PublicSentiment_content">
  12. <!-- <el-radio-group class="myRadio" v-model="activeName2" size="mini" style="margin: 0px;width: 96%;overflow-x: auto;display: flex;padding: .5vh .4vw;text-align: center;">-->
  13. <!-- <el-radio-button label="0" style=" background-color: rgba(0,0,0,0) !important;font-size:x-large !important;">新闻</el-radio-button>-->
  14. <!-- <el-radio-button label="1" style=" background-color: rgba(0,0,0,0) !important;font-size:x-large !important;">论坛</el-radio-button>-->
  15. <!-- <el-radio-button label="2" style=" background-color: rgba(0,0,0,0) !important;font-size:x-large !important;">博客</el-radio-button>-->
  16. <!-- <el-radio-button label="3" style=" background-color: rgba(0,0,0,0) !important;font-size:x-large !important;">微博</el-radio-button>-->
  17. <!-- <el-radio-button v-if="radioForPad" label="4" style=" background-color: rgba(0,0,0,0) !important;font-size:x-large !important;">app</el-radio-button>-->
  18. <!-- <el-radio-button label="5" style=" background-color: rgba(0,0,0,0) !important;font-size:x-large !important;">微信</el-radio-button>-->
  19. <!-- <el-radio-button v-if="radioForPad" label="6" style=" background-color: rgba(0,0,0,0) !important;font-size:x-large !important;">电子报</el-radio-button>-->
  20. <!-- </el-radio-group>-->
  21. <div style="width: 100%;height: 77%;" id="building">
  22. <el-table :show-header="false" style="padding: 0 .4vw;border: none;cursor: pointer;" class="myTable" :data="tableList" :height="pubListHeight" @row-click="openTrsDetails" >
  23. <el-table-column prop="IR_URLTITLE" label="标题" min-width="120" show-overflow-tooltip></el-table-column>
  24. <!-- <el-table-column v-if="tableMiddle" prop="IR_SITENAME" label="来源" width="70" show-overflow-tooltip></el-table-column>-->
  25. <el-table-column prop="IR_URLTIME1" label="发布时间" width="100" show-overflow-tooltip></el-table-column>
  26. </el-table>
  27. <el-pagination
  28. @current-change="handleCurrentChange"
  29. :current-page="page"
  30. background
  31. style="padding: 10px 20px"
  32. :page-size="limit"
  33. layout="total, prev, pager, next"
  34. :total="total">
  35. </el-pagination>
  36. <!-- <div class="block" style="display:flex;flex-direction:row;justify-content:center;align-items:center;padding-top: 5px;">
  37. <el-pagination class="myPagination"
  38. small
  39. @current-change="handleCurrentChange"
  40. :pager-count="5"
  41. :current-page.sync="pageIndex"
  42. :page-size="pageSize"
  43. layout="prev, pager, next"
  44. :total="allcount">
  45. </el-pagination>
  46. </div> -->
  47. </div>
  48. </div>
  49. <el-dialog title="舆情" v-model:visible="publicDialog" :close-on-click-modal="false" width="60%">
  50. <PublicMore v-if="publicDialog"></PublicMore>
  51. </el-dialog>
  52. </div>
  53. </template>
  54. <script>
  55. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  56. //例如:import 《组件名称》 from '《组件路径》';
  57. import { dateFormat } from '@/utils/gw_date'
  58. import PublicMore from './PublicMore'
  59. import axios from 'axios'
  60. // import theme from '../../store/theme'
  61. export default {
  62. //import引入的组件需要注入到对象中才能使用
  63. components: {
  64. PublicMore
  65. },
  66. data() {
  67. //这里存放数据
  68. return {
  69. radioForPad:true,
  70. activeName2:'0',
  71. tableResultData:[
  72. {
  73. IR_URLTITLE:'水利部来我省开展质量监督履职情况巡查及水利监督体系建设工作调研',
  74. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/9/28/art_27165_4160249.html',
  75. IR_URLTIME1:'2022-09-28'
  76. },
  77. {
  78. IR_URLTITLE:'江西省顺利完成水利部水资源管理和节约用水监督检查',
  79. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/9/14/art_27165_4141098.html',
  80. IR_URLTIME1:'2022-09-14'
  81. },
  82. {
  83. IR_URLTITLE:'胡春华在江西督导农业抗旱保丰收工作',
  84. IR_URLNAME:'http://www.pearlwater.gov.cn/xwzxcs/szywcs/202208/t20220830_116292.html',
  85. IR_URLTIME1:'2022-08-30'
  86. },
  87. {
  88. IR_URLTITLE:'水利部水库移民司来我省复核有关整改落实情况',
  89. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/8/23/art_27165_4118253.html',
  90. IR_URLTIME1:'2022-08-23'
  91. },
  92. {
  93. IR_URLTITLE:'长江委来赣调研指导长江经济带涉及水域岸线生态环境突出问题整改工作',
  94. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/7/25/art_27165_4078725.html',
  95. IR_URLTIME1:'2022-07-25'
  96. },
  97. {
  98. IR_URLTITLE:'水利部调研指导我省水库移民监督管理工作',
  99. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/7/4/art_27165_4017040.html',
  100. IR_URLTIME1:'2022-07-04'
  101. },
  102. {
  103. IR_URLTITLE:'省长叶建春一眼就看出水利工程存在安全隐患,现场要求整改',
  104. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/6/11/art_27165_3991100.html',
  105. IR_URLTIME1:'2022-06-11'
  106. },
  107. {
  108. IR_URLTITLE:'江西省水利厅举办水利监督技术视频培训班',
  109. IR_URLNAME:'http://www.mwr.gov.cn/xw/dfss/202206/t20220610_1578269.html',
  110. IR_URLTIME1:'2022-06-10'
  111. },
  112. {
  113. IR_URLTITLE:'省水利厅举办水利监督技术视频培训班',
  114. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/6/9/art_27165_3989125.html',
  115. IR_URLTIME1:'2022-06-09'
  116. },
  117. {
  118. IR_URLTITLE:'省委书记易炼红深入九江督导调研防汛工作',
  119. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/6/9/art_27165_3989049.html',
  120. IR_URLTIME1:'2022-06-09'
  121. },
  122. {
  123. IR_URLTITLE:'江西在水利部水利监督工作会上作交流发言',
  124. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2022/1/19/art_27165_3839008.html',
  125. IR_URLTIME1:'2022-01-19'
  126. },
  127. {
  128. IR_URLTITLE:'省水利厅召开中央环保督察水电站问题整改工作视频调度会',
  129. IR_URLNAME:'http://slt.jiangxi.gov.cn/art/2021/12/14/art_27165_3785354.html',
  130. IR_URLTIME1:'2021-12-14'
  131. }
  132. ],
  133. page:1,
  134. limit:10,
  135. total:12,
  136. tableList:[],
  137. loading:true,
  138. pageIndex:1,
  139. // pageSize:12,
  140. allcount:0,
  141. // pubListHeight:window.innerHeight * 0.38,
  142. pubListWidth:0,
  143. tableClass:'myTable',
  144. publicDialog:false
  145. };
  146. },
  147. //监听属性 类似于data概念
  148. computed: {
  149. pubListHeight(){
  150. if(window.innerWidth >= 1920){
  151. return window.innerHeight * 0.4;
  152. }else{
  153. return window.innerHeight * 0.35;
  154. }
  155. },
  156. pageSize(){
  157. if(window.innerWidth >= 1920){
  158. return 12;
  159. }else{
  160. return 7;
  161. }
  162. },
  163. tableMiddle(){
  164. if(window.innerWidth >= 1920){
  165. return true;
  166. }else{
  167. return false;
  168. }
  169. },
  170. msg(){
  171. return this.$store?.state?.theme?.testMsg || 'light';
  172. },
  173. },
  174. //监控data中的数据变化
  175. watch: {
  176. activeName2:function(n,o){
  177. this.loading = true;
  178. this.getTrsDataList();
  179. },
  180. msg(n,o){
  181. if( n == 'dark' ){
  182. this.tableClass = 'myTable_dark';
  183. }else{
  184. this.tableClass = 'myTable';
  185. }
  186. },
  187. },
  188. //生命周期 - 创建完成(可以访问当前this实例)
  189. created() {},
  190. //生命周期 - 挂载完成(可以访问DOM元素)
  191. mounted() {
  192. this.page = 1;
  193. this.pageList();
  194. // let h = document.getElementById('left_PublicSentiment_content').offsetHeight;
  195. // this.pubListHeight = h - 85;
  196. // console.log('pubListHeight'+this.pubListHeight);
  197. // this.getTrsDataList();
  198. if(window.innerWidth <= 1024){
  199. this.radioForPad = false;
  200. }else{
  201. this.radioForPad = true;
  202. }
  203. },
  204. beforeCreate() {}, //生命周期 - 创建之前
  205. beforeMount() {}, //生命周期 - 挂载之前
  206. beforeUpdate() {}, //生命周期 - 更新之前
  207. updated() {}, //生命周期 - 更新之后
  208. beforeDestroy() {}, //生命周期 - 销毁之前
  209. destroyed() {}, //生命周期 - 销毁完成
  210. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  211. //方法集合
  212. methods: {
  213. //处理切换页码
  214. // handleSizeChange(val) {
  215. // console.log(`每页 ${val} 条`);
  216. // this.limit = val;
  217. // this.pageList();
  218. // },
  219. handleCurrentChange(val) {
  220. console.log(`当前页: ${val}`);
  221. this.page = val;
  222. this.pageList();
  223. },
  224. pageList() {
  225. this.tableList = this.tableResultData.filter(
  226. (item, index) =>
  227. index < this.page * this.limit &&
  228. index >= this.limit * (this.page - 1)
  229. );
  230. this.total = this.tableResultData.length;
  231. },
  232. showMore(){
  233. this.publicDialog = true;
  234. },
  235. getTrsDataList(){
  236. const self = this;
  237. let endTime = dateFormat(new Date(),'yyyy-MM-dd hh:mm:ss');
  238. let startTime = dateFormat(new Date().getTime() - 7*24*60*60*1000,'yyyy-MM-dd hh:mm:ss');
  239. axios.get("/trs/om/cus",{params:{
  240. 'id':'9069e11e',
  241. 'key':'2515505d',
  242. 'sid':'63',
  243. 'pageNo':self.pageIndex,
  244. 'pageSize':self.pageSize,
  245. 'tid':self.activeName2,
  246. 'startDate':startTime,
  247. 'endDate':endTime,
  248. }}).then((res)=>{
  249. self.loading = false;
  250. res.data.resultData.dataList.forEach((item)=>{
  251. item['IR_URLTIME1'] = item.IR_URLTIME.substring(0,10);
  252. })
  253. self.tableResultData = res.data.resultData.dataList;
  254. self.allcount = res.data.resultData.databasic.allcount;
  255. })
  256. // request({
  257. // url:"/trs/om/cus?id=9069e11e&key=2515505d&sid=57&pageNo="+_self.pageIndex+"&pageSize="+_self.pageSize+
  258. // "&tid="+_self.activeName2+"&startDate="+startTime+"&endDate="+endTime,
  259. // method:'get',
  260. // responseType:'json',
  261. // params:''
  262. // }).then((res)=>{
  263. // var results = res.data;
  264. // _self.loading = false;
  265. // res.data.resultData.dataList.forEach((item)=>{
  266. // item['IR_URLTIME1'] = item.IR_URLTIME.substring(0,10);
  267. // })
  268. // _self.tableResultData = res.data.resultData.dataList;
  269. // _self.allcount = res.data.resultData.databasic.allcount;
  270. // });
  271. },
  272. // handleCurrentChange(val) {
  273. // console.log(`当前页: ${val}`);
  274. // this.loading = true;
  275. // this.getTrsDataList();
  276. // },
  277. openTrsDetails(row, event, column) {
  278. if(row.IR_URLNAME){
  279. window.open(row.IR_URLNAME);
  280. }
  281. },
  282. },
  283. };
  284. </script>
  285. <style scoped>
  286. /* 透明表格样式 */
  287. #building .el-table::before { background: none !important; }
  288. .myTable ::-webkit-scrollbar-thumb { background-color: #cdcdcd; border-radius: 10px; }
  289. .myTable ::-webkit-scrollbar-corner { background-color: transparent !important; }
  290. .myTable ::-webkit-scrollbar-track { background-color: transparent !important; }
  291. .myTable ::-webkit-scrollbar-track-piece { background-color: transparent !important; }
  292. .myTable::before { background-color: none !important; }
  293. .myTable .el-table--border td { padding: 0; }
  294. .myTable tr.el-table__row { background-color: transparent !important; }
  295. .myTable td { border-bottom: 1px solid rgba(109, 118, 236, 0.2); padding: 4px 0; }
  296. .myTable, .el-table__expanded-cell { background-color: transparent; }
  297. .myTable .el-table__header th, .el-table__header tr {
  298. padding: 2px 0;
  299. background: rgba(176, 230, 255, 1) !important;
  300. color: rgba(49, 63, 102, 1);
  301. }
  302. #building .el-table--enable-row-hover .el-table__body tr:hover > td { background-color: #e4e4e4; }
  303. /* Radio 样式 */
  304. .myRadio .el-radio-button__orig-radio:checked + .el-radio-button__inner { padding: .8vh .5vw; background-color: #409EFF; }
  305. .myRadio .el-radio-button--mini .el-radio-button__inner { padding: .8vh .38vw; font-size: 12px; }
  306. .myRadio .el-radio-button__inner { border: 1px solid #409EFF; border-left: none; color: #409EFF; }
  307. .myRadio .el-radio { margin-right: 1vw; }
  308. .myRadio .el-radio__label { font-size: 12px; }
  309. .myRadio .el-radio__inner { width: 12px; height: 12px; }
  310. .myRadio .el-radio-button--mini .el-radio-button__inner { background-color: transparent; }
  311. /* 暗色主题 */
  312. [data-theme="dark"] .myTable tr.el-table__row { color: rgba(177, 210, 254, 1); }
  313. [data-theme="dark"] .myTable .el-table__header th, [data-theme="dark"] .el-table__header tr {
  314. background: rgba(37, 68, 159, 1) !important; color: rgba(255, 255, 255, 1) !important; border-bottom: none;
  315. }
  316. [data-theme="dark"] .myTable ::-webkit-scrollbar-thumb { background-color: rgba(70, 74, 115, 1); }
  317. [data-theme="dark"] #building .el-table--enable-row-hover .el-table__body tr:hover > td { background-color: #25449f; }
  318. [data-theme="dark"] .myTable tr.el-table__row { background-color: rgba(38, 44, 97, 1) !important; }
  319. [data-theme="dark"] .myPagination .el-pager li { color: rgba(177, 210, 254, 1); }
  320. [data-theme="dark"] .myPagination .btn-next, [data-theme="dark"] .myPagination .btn-prev { color: rgba(177, 210, 254, 1); }
  321. [data-theme="dark"] .myPagination button:disabled { color: rgba(177, 210, 254, 1); }
  322. </style>