LawView.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <div class="law-container">
  3. <div class="law-container-inner">
  4. <LawDetailsPopup
  5. ref="lawRef"
  6. class="law-container-inner-details"
  7. @lawDetailsClose="lawDetailsClose"
  8. ><FilePreview ref="lawFilePreview"
  9. /></LawDetailsPopup>
  10. <div class="header">
  11. <div class="header-title">法律法规</div>
  12. <div class="header-select">
  13. <div>
  14. <div class="text">类型 :</div>
  15. <NewSelect
  16. :placeholder="'请选择审计法律类别'"
  17. class="select-input"
  18. v-model="typeSelectVal"
  19. :options="typeOptions"
  20. :value="typeSelectVal"
  21. />
  22. </div>
  23. <div>
  24. <div class="text">年份 :</div>
  25. <NewSelect
  26. :placeholder="'请选择年份'"
  27. class="select-input"
  28. v-model="timeSelectVal"
  29. :options="timeOptions"
  30. :value="timeSelectVal"
  31. />
  32. </div>
  33. <div style="position: relative">
  34. <el-button
  35. size="big"
  36. type="text"
  37. icon="el-icon-search"
  38. style="
  39. position: absolute;
  40. bottom: 4px;
  41. right: 10px;
  42. z-index: 99;
  43. color: #fff;
  44. "
  45. ></el-button>
  46. <el-input class="search-input" v-model="searchInput"> </el-input>
  47. </div>
  48. </div>
  49. <div class="reset-btn" @click="resetEvent">重置</div>
  50. <div class="query-btn" @click="queryEvent">查询</div>
  51. </div>
  52. <div class="center">
  53. <el-table
  54. :data="tableData"
  55. style="width: 100%"
  56. max-height="600"
  57. @current-change="handleClick"
  58. >
  59. <el-table-column type="index" width="150" label="序号" align="center">
  60. </el-table-column>
  61. <el-table-column prop="type" label="类别" align="center">
  62. </el-table-column>
  63. <el-table-column
  64. prop="title"
  65. label="文件名称"
  66. align="center"
  67. width="250"
  68. >
  69. </el-table-column>
  70. <el-table-column prop="class" label="等级" align="center">
  71. </el-table-column>
  72. <el-table-column prop="date" label="日期" align="center">
  73. </el-table-column>
  74. </el-table>
  75. </div>
  76. <div class="footer">
  77. <Pagination class="pagination-style" :paginationData="paginationData" />
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import NewSelect from "@/components/common/NewSelect.vue";
  84. import Pagination from "@/components/common/Pagination.vue";
  85. // 法律法规细节文档弹窗
  86. import LawDetailsPopup from "@/components/popup/LawDetailsPopup.vue";
  87. import FilePreview from "@/components/common/FilePreView.vue";
  88. import { lawType } from "@/config/common";
  89. /**
  90. * 法律法规 页面 -- 智能辅助,疑点相关的法律法规
  91. * @author: Gao Lu
  92. * @Date: 2022.11.24
  93. */
  94. export default {
  95. name: "LawView",
  96. components: { NewSelect, Pagination, LawDetailsPopup, FilePreview },
  97. data() {
  98. return {
  99. searchInput: "",
  100. sortSelectVal: "",
  101. sortOptions: [],
  102. typeSelectVal: "",
  103. typeOptions: [],
  104. timeSelectVal: "",
  105. timeOptions: [],
  106. tableData: [],
  107. currentPageSize: 5,
  108. currentPage: 1,
  109. lawBaseUrl: "/dms",
  110. paginationData: {
  111. pageSize: 0,
  112. pagerCount: 5,
  113. currentPage: 1,
  114. pageSizes: [5, 10, 20, 30],
  115. total: 30,
  116. currentChange: (val) => {
  117. this.getTableData(val);
  118. },
  119. handleSizeChange: (val) => {
  120. this.handleSizeChange(val);
  121. },
  122. },
  123. };
  124. },
  125. created() {
  126. this.timeOptions = [];
  127. this.typeOptions = [];
  128. // 时间选择
  129. for (let i = 1980; i < 2023; i++) {
  130. this.timeOptions.unshift({
  131. value: i,
  132. label: i,
  133. });
  134. }
  135. for (let key in lawType) {
  136. this.typeOptions.unshift({
  137. value: key,
  138. label: key,
  139. });
  140. }
  141. this.getTableData(1);
  142. },
  143. methods: {
  144. queryEvent() {
  145. console.log("查询");
  146. },
  147. resetEvent() {
  148. console.log("重置");
  149. },
  150. // 切换页
  151. getTableData(val) {
  152. console.log(`当前页: ${val}`);
  153. this.tableData = [];
  154. let params = new FormData();
  155. params = {
  156. columnId: 58,
  157. states: 1,
  158. pageSize: this.currentPageSize,
  159. page: val - 1,
  160. };
  161. this.$Post(this.urlsCollection.selectContentListInfo, params).then(
  162. (res) => {
  163. console.log(res, "当前的法律法规");
  164. if (res.code === 200 && res.content.length > 0) {
  165. console.log(res.content, "查询到的法律法规相关的数据");
  166. this.paginationData.currentPage = val;
  167. this.tableData = res.content.map((v) => {
  168. return {
  169. id: v.id || "",
  170. title: v.c_name || "--",
  171. type: v.type || "--",
  172. class: v.class || "--",
  173. date: v.c_date || "--",
  174. address: v.c_pdf || "",
  175. };
  176. });
  177. }
  178. },
  179. (error) => {
  180. console.log(error);
  181. }
  182. );
  183. },
  184. // 切换条数
  185. handleSizeChange(val) {
  186. console.log(`每页 ${val} 条`);
  187. this.currentPageSize = val;
  188. this.getTableData(this.currentPage);
  189. },
  190. // 开启弹窗
  191. handleClick(row) {
  192. console.log(row.address, "--address");
  193. this.$refs.lawRef.title = row.title;
  194. this.$refs.lawRef.time = row.date;
  195. this.$refs.lawRef.lawDetailsPopupShow = true;
  196. this.$nextTick(() => {
  197. if (this.$refs.lawFilePreview) {
  198. this.$refs.lawFilePreview.showView(this.lawBaseUrl + row.address);
  199. }
  200. });
  201. },
  202. // 关闭弹窗
  203. lawDetailsClose() {
  204. if (this.$refs.lawFilePreview) {
  205. this.$refs.lawFilePreview.cancel();
  206. }
  207. },
  208. },
  209. };
  210. </script>
  211. <style lang="less" scoped>
  212. .law-container {
  213. display: flex;
  214. align-items: center;
  215. justify-content: center;
  216. &-inner {
  217. width: 98%;
  218. height: 97%;
  219. background: rgba(0, 39, 77, 0.5);
  220. position: relative;
  221. &-details {
  222. width: 100%;
  223. height: 100%;
  224. position: absolute;
  225. z-index: 9999;
  226. }
  227. .header {
  228. height: 120px;
  229. width: 100%;
  230. position: absolute;
  231. &-title {
  232. width: 84px;
  233. height: 20px;
  234. font-size: 20px;
  235. font-family: PingFang SC;
  236. font-weight: 400;
  237. color: #4dc3ff;
  238. line-height: 30px;
  239. position: absolute;
  240. top: 1px;
  241. left: 10px;
  242. }
  243. &-select {
  244. position: absolute;
  245. left: 10px;
  246. bottom: 5px;
  247. width: 950px;
  248. height: 40px;
  249. color: #e6e6e6;
  250. display: flex;
  251. justify-content: space-between;
  252. & > div {
  253. // position: absolute;
  254. display: flex;
  255. justify-content: flex-start;
  256. width: 280px;
  257. .text {
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. width: 80px;
  262. height: 28px;
  263. }
  264. .select-input {
  265. width: 190px;
  266. }
  267. .search-input {
  268. position: absolute;
  269. // right: -50px;
  270. bottom: 5px;
  271. width: 280px;
  272. }
  273. }
  274. }
  275. .reset-btn,
  276. .query-btn {
  277. width: 60px;
  278. height: 30px;
  279. border-radius: 3px;
  280. border: none;
  281. color: #fff;
  282. cursor: pointer;
  283. display: flex;
  284. align-items: center;
  285. justify-content: center;
  286. position: absolute;
  287. top: 15px;
  288. }
  289. .reset-btn {
  290. right: 110px;
  291. background: rgba(129, 140, 164, 1);
  292. }
  293. .query-btn {
  294. right: 30px;
  295. background-image: linear-gradient(
  296. to top,
  297. rgba(79, 172, 254, 1),
  298. rgba(0, 242, 254, 1)
  299. );
  300. }
  301. }
  302. .center {
  303. height: calc(90% - 120px);
  304. width: 100%;
  305. position: absolute;
  306. overflow: auto;
  307. top: 130px;
  308. // background: red;
  309. /deep/.el-table {
  310. background: rgba(0, 39, 77, 0.6);
  311. // font-size: 0.95rem;
  312. font-family: PingFang SC;
  313. font-weight: 500;
  314. thead {
  315. color: #4dc3ff;
  316. font-size: 15px;
  317. }
  318. }
  319. }
  320. .footer {
  321. position: absolute;
  322. right: 50px;
  323. bottom: 30px;
  324. }
  325. }
  326. }
  327. </style>