LawView.vue 12 KB

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