LawView.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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" style="width: 100%; height: 100%"
  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. ref="lawTypeRef"
  17. :placeholder="typePlaceholder"
  18. class="select-input"
  19. v-model="typeSelectVal"
  20. :options="typeOptions"
  21. :value="typeSelectVal"
  22. :isClear="true"
  23. />
  24. </div>
  25. <div>
  26. <div class="text">年份 :</div>
  27. <NewSelect
  28. ref="lawYearRef"
  29. :placeholder="timePlaceholder"
  30. class="select-input"
  31. v-model="timeSelectVal"
  32. :options="timeOptions"
  33. :value="timeSelectVal"
  34. :isClear="true"
  35. />
  36. </div>
  37. <div style="position: relative">
  38. <el-input class="search-input" v-model="searchInput" clearable>
  39. <i class="el-icon-search" slot="append"></i>
  40. </el-input>
  41. </div>
  42. </div>
  43. <div class="query-btn" @click="getTableData(1)">查询</div>
  44. <div class="reset-btn" @click="resetEvent">重置</div>
  45. </div>
  46. <div class="center">
  47. <el-table
  48. :data="tableData"
  49. style="width: 100%"
  50. max-height="600"
  51. :default-sort="{ prop: 'date', order: 'descending' }"
  52. @current-change="handleClick"
  53. >
  54. <el-table-column type="index" width="150" label="序号" align="center">
  55. </el-table-column>
  56. <!-- <el-table-column prop="type" label="类别" align="center">
  57. </el-table-column> -->
  58. <el-table-column
  59. prop="title"
  60. label="标题"
  61. align="center"
  62. width="250"
  63. sortable
  64. >
  65. </el-table-column>
  66. <el-table-column
  67. prop="code"
  68. label="文号"
  69. align="center"
  70. sortable
  71. ></el-table-column>
  72. <el-table-column
  73. prop="firstClass"
  74. label="一级分类"
  75. align="center"
  76. sortable
  77. >
  78. </el-table-column>
  79. <el-table-column
  80. prop="secondClass"
  81. label="二级分类"
  82. align="center"
  83. sortable
  84. >
  85. </el-table-column>
  86. <el-table-column
  87. prop="thirdClass"
  88. label="三级分类"
  89. align="center"
  90. sortable
  91. >
  92. </el-table-column>
  93. <el-table-column
  94. prop="fourthClass"
  95. label="四级分类"
  96. align="center"
  97. sortable
  98. >
  99. </el-table-column>
  100. <el-table-column prop="date" label="日期" align="center" sortable>
  101. </el-table-column>
  102. </el-table>
  103. </div>
  104. <div class="footer">
  105. <Pagination class="pagination-style" :paginationData="paginationData" />
  106. </div>
  107. </div>
  108. </div>
  109. </template>
  110. <script>
  111. import NewSelect from "@/components/common/NewSelect.vue";
  112. import Pagination from "@/components/common/Pagination.vue";
  113. // 法律法规细节文档弹窗
  114. import LawDetailsPopup from "@/components/popup/LawDetailsPopup.vue";
  115. import FilePreview from "@/components/common/FilePreView.vue";
  116. /**
  117. * 法律法规 页面 -- 智能辅助,疑点相关的法律法规 --test
  118. * @author: Gao Lu
  119. * @Date: 2022.11.24
  120. */
  121. export default {
  122. name: "LawView",
  123. components: { NewSelect, Pagination, LawDetailsPopup, FilePreview },
  124. data() {
  125. return {
  126. // 数据字典暂存对象
  127. classDictMap: {},
  128. searchInput: "",
  129. typePlaceholder: "请选择审计法律类别",
  130. typeSelectVal: "",
  131. typeOptions: [],
  132. timePlaceholder: "请选择年份",
  133. timeSelectVal: "不限",
  134. timeOptions: [],
  135. tableData: [],
  136. currentPageSize: 10,
  137. currentPage: 1,
  138. lawBaseUrl: "/dms",
  139. paginationData: {
  140. pageSize: 10,
  141. pagerCount: 5,
  142. currentPage: 1,
  143. pageSizes: [5, 10, 20, 30],
  144. total: 30,
  145. currentChange: (val) => {
  146. this.getTableData(val);
  147. },
  148. handleSizeChange: (val) => {
  149. this.handleSizeChange(val);
  150. },
  151. },
  152. };
  153. },
  154. created() {
  155. this.timeOptions = [];
  156. this.typeOptions = [];
  157. // 时间选择
  158. for (let i = 1980; i <= 2020; i++) {
  159. this.timeOptions.unshift({
  160. value: i,
  161. label: i,
  162. });
  163. }
  164. this.timeOptions.unshift({
  165. value: "不限",
  166. label: "不限",
  167. });
  168. // 审计等级
  169. this.classDictQuery("0", "sj_class", "审计等级");
  170. // 审计类别
  171. this.classDictQuery("0", "sh_law_type", "审计法律类别");
  172. this.getTableData(1);
  173. },
  174. methods: {
  175. // 数据字典查询 -- 获取所需类别
  176. classDictQuery(type, cName, keyName) {
  177. let params = new FormData();
  178. params = {
  179. type: type,
  180. cName: cName,
  181. };
  182. this.$Post(this.urlsCollection.selectByCNameAType, params).then(
  183. (res) => {
  184. if (res.code === 200 && res.content.length > 0) {
  185. this.classDictMap[keyName] = new Map();
  186. res.content.forEach((v) => {
  187. this.classDictMap[keyName].set(v.index + "", v.name);
  188. });
  189. if (keyName === "审计法律类别") {
  190. this.classDictMap[keyName].forEach((v, i) => {
  191. this.typeOptions.unshift({
  192. value: i,
  193. label: v,
  194. });
  195. });
  196. }
  197. }
  198. },
  199. (error) => {
  200. this.$message.error();
  201. console.log(error);
  202. }
  203. );
  204. },
  205. resetEvent() {
  206. console.log("重置");
  207. this.typeSelectVal = "";
  208. this.timeSelectVal = "不限";
  209. this.searchInput = "";
  210. this.$refs.lawTypeRef.imgValue = "";
  211. this.$refs.lawYearRef.imgValue = "";
  212. this.getTableData(this.currentPage);
  213. },
  214. // 切换页 -- 新法律法规
  215. getTableData(val) {
  216. this.tableData = [];
  217. let searchParam = [];
  218. // 三级分类 -- 资源分类
  219. if (this.typeSelectVal) {
  220. console.log(this.classDictMap["审计法律类别"].get(this.typeSelectVal));
  221. let paramType = {
  222. field: "c_c_third_level",
  223. // 等值查询
  224. searchType: "2",
  225. content: {
  226. value:
  227. this.classDictMap["审计法律类别"].get(this.typeSelectVal) || "--",
  228. },
  229. };
  230. searchParam.push(paramType);
  231. }
  232. // 年份查询
  233. if (this.timeSelectVal && this.timeSelectVal != "不限") {
  234. let paramTime = {
  235. field: "c_c_execute_date",
  236. // 模糊查询
  237. searchType: "2",
  238. content: {
  239. value: this.timeSelectVal + "",
  240. },
  241. };
  242. searchParam.push(paramTime);
  243. }
  244. // 标题查询
  245. if (this.searchInput) {
  246. let paramSearch = {
  247. field: "c_c_name",
  248. // 模糊查询
  249. searchType: "2",
  250. content: {
  251. value: this.searchInput,
  252. },
  253. };
  254. searchParam.push(paramSearch);
  255. }
  256. let params = new FormData();
  257. params.append("columnId", 1396);
  258. params.append("states", "0,1,2,3");
  259. params.append("pageSize", this.currentPageSize);
  260. params.append("page", val - 1);
  261. params.append("search", JSON.stringify(searchParam));
  262. this.$Post(this.urlsCollection.selectContentList, params).then((res) => {
  263. if (res.code === 200 && res.content.data.length > 0) {
  264. this.paginationData.currentPage = val;
  265. this.paginationData.total = res.content.count;
  266. this.tableData = res.content.data.map((v) => {
  267. return {
  268. id: v.id || "--",
  269. title: v.c_c_name || "--",
  270. // 文件
  271. address: v.c_c_pdf || "--",
  272. // 实施日期
  273. date: v.c_c_execute_date || "--",
  274. // 文号
  275. code: v.c_c_code || "--",
  276. // 一级分类
  277. firstClass: v.c_c_first_level || "--",
  278. // 二级分类
  279. secondClass: v.c_c_second_level || "--",
  280. // 三级分类
  281. thirdClass: v.c_c_third_level || "--",
  282. // 四级分类
  283. fourthClass: v.c_c_fourth_level || "--",
  284. // 五级分类
  285. fifthClass: v.c_c_fifth_level,
  286. };
  287. });
  288. }
  289. });
  290. },
  291. // 切换条数
  292. handleSizeChange(val) {
  293. console.log(`每页 ${val} 条`);
  294. this.currentPageSize = val;
  295. this.getTableData(this.currentPage);
  296. },
  297. // 开启弹窗
  298. handleClick(row) {
  299. if (row.title) {
  300. this.$refs.lawRef.title = row.title;
  301. }
  302. if (row.date) {
  303. this.$refs.lawRef.time = row.date;
  304. }
  305. if (!row.address) {
  306. this.$$message.info("暂无文件");
  307. } else {
  308. this.$refs.lawRef.lawDetailsPopupShow = true;
  309. this.$nextTick(() => {
  310. if (this.$refs.lawFilePreview) {
  311. this.$refs.lawFilePreview.showView(this.lawBaseUrl + row.address);
  312. }
  313. });
  314. }
  315. },
  316. // 关闭弹窗
  317. lawDetailsClose() {
  318. if (this.$refs.lawFilePreview) {
  319. this.$refs.lawFilePreview.cancel();
  320. }
  321. },
  322. },
  323. };
  324. </script>
  325. <style lang="less" scoped>
  326. .law-container {
  327. display: flex;
  328. align-items: center;
  329. justify-content: center;
  330. &-inner {
  331. width: 98%;
  332. height: 97%;
  333. background: rgba(0, 39, 77, 0.5);
  334. position: relative;
  335. &-details {
  336. width: 100%;
  337. height: 100%;
  338. position: absolute;
  339. z-index: 9999;
  340. }
  341. .header {
  342. height: 120px;
  343. width: 100%;
  344. position: absolute;
  345. &-title {
  346. width: 84px;
  347. height: 20px;
  348. font-size: 20px;
  349. font-family: PingFang SC;
  350. font-weight: bold;
  351. color: #4dc3ff;
  352. line-height: 30px;
  353. position: absolute;
  354. top: 8px;
  355. left: 15px;
  356. }
  357. &-select {
  358. position: absolute;
  359. left: 10px;
  360. bottom: 5px;
  361. width: 950px;
  362. height: 40px;
  363. color: #e6e6e6;
  364. display: flex;
  365. justify-content: space-between;
  366. & > div {
  367. // position: absolute;
  368. display: flex;
  369. justify-content: flex-start;
  370. width: 280px;
  371. .text {
  372. display: flex;
  373. align-items: center;
  374. justify-content: center;
  375. width: 80px;
  376. height: 28px;
  377. }
  378. .select-input {
  379. width: 190px;
  380. }
  381. .search-input {
  382. position: absolute;
  383. // right: -50px;
  384. bottom: 5px;
  385. width: 280px;
  386. /deep/.el-input-group__append,
  387. .el-input-group__prepend {
  388. background: transparent;
  389. // background-color: #00aaff54;
  390. color: #fff;
  391. border-left: none;
  392. // border: none;
  393. // border-radius: 1px;
  394. }
  395. /deep/.el-input-group--append .el-input__inner,
  396. .el-input-group__prepend {
  397. border-right: none;
  398. }
  399. /deep/ .el-input__inner {
  400. border-color: #fff !important;
  401. color: #fff;
  402. border-right: none;
  403. }
  404. }
  405. }
  406. }
  407. .reset-btn,
  408. .query-btn {
  409. width: 60px;
  410. height: 30px;
  411. border-radius: 3px;
  412. border: none;
  413. color: #fff;
  414. cursor: pointer;
  415. display: flex;
  416. align-items: center;
  417. justify-content: center;
  418. position: absolute;
  419. top: 20px;
  420. }
  421. .reset-btn {
  422. right: 30px;
  423. background: rgba(129, 140, 164, 1);
  424. }
  425. .query-btn {
  426. right: 110px;
  427. background-image: linear-gradient(
  428. to top,
  429. rgba(79, 172, 254, 1),
  430. rgba(0, 242, 254, 1)
  431. );
  432. }
  433. }
  434. .center {
  435. height: calc(90% - 120px);
  436. width: 100%;
  437. position: absolute;
  438. overflow: auto;
  439. top: 130px;
  440. // background: red;
  441. /deep/.el-table {
  442. background: rgba(0, 39, 77, 0.6);
  443. // font-size: 0.95rem;
  444. font-family: PingFang SC;
  445. font-weight: 500;
  446. thead {
  447. color: #4dc3ff;
  448. font-size: 15px;
  449. }
  450. }
  451. }
  452. .footer {
  453. position: absolute;
  454. right: 50px;
  455. bottom: 30px;
  456. }
  457. }
  458. }
  459. </style>