LawPopup.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <div class="law-related" v-if="lawPopupShow" v-drag>
  3. <LawDetailsPopup
  4. ref="lawDetailsRef"
  5. class="law-details-popup"
  6. @lawDetailsClose="lawDetailsClose"
  7. >
  8. <FilePreView style="width: 100%; height: 100%" ref="lawFileRef" />
  9. </LawDetailsPopup>
  10. <div class="title">
  11. <div class="title-text">XXXX疑点相关的法律法规</div>
  12. <div class="title-close-btn" @click="closeEvent"></div>
  13. </div>
  14. <div class="option">
  15. <div class="option-left">
  16. <el-input
  17. class="search-input"
  18. placeholder="请输入关键字"
  19. v-model="searchInput"
  20. clearable
  21. >
  22. <div class="search-icon" @click="getTableData(1)" slot="append">
  23. <i class="el-icon-search"></i>
  24. </div>
  25. </el-input>
  26. </div>
  27. <div class="option-right">
  28. <NewSelect class="option-right-item" :placeholder="'排序方式'" />
  29. <NewSelect class="option-right-item" :placeholder="'搜索范围'" />
  30. <NewSelect class="option-right-item" :placeholder="'时间范围'" />
  31. </div>
  32. </div>
  33. <div class="table">
  34. <el-table
  35. ref="singleTable"
  36. highlight-current-row
  37. style="width: 100%"
  38. max-height="300"
  39. :data="tableData"
  40. @current-change="handleRowChange"
  41. >
  42. <el-table-column prop="title" label="名称" align="center">
  43. </el-table-column>
  44. <el-table-column prop="date" label="日期" align="center">
  45. </el-table-column>
  46. </el-table>
  47. </div>
  48. <div class="footer">
  49. <Pagination :paginationData="paginationData" />
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import NewSelect from "@/components/common/NewSelect.vue";
  55. import Pagination from "@/components/common/Pagination.vue";
  56. // 法律法规细节文档弹窗
  57. import LawDetailsPopup from "@/components/popup/LawDetailsPopup.vue";
  58. import FilePreView from "@/components/common/FilePreView.vue";
  59. /**
  60. * XXXX 疑点相关的法律法规
  61. * @author: Gao Lu
  62. * @Date: 2022.11.25
  63. */
  64. export default {
  65. name: "LawPopup",
  66. components: { NewSelect, Pagination, LawDetailsPopup, FilePreView },
  67. data() {
  68. return {
  69. lawBaseUrl: "/dms",
  70. searchInput: "",
  71. // lawDetailsPopupShow: false,
  72. sortSelectVal: "土地资源",
  73. sortOptions: [
  74. {
  75. value: "土地资源",
  76. label: "土地资源",
  77. },
  78. ],
  79. scopeSelectVal: "浦东新区",
  80. scopeOptions: [
  81. {
  82. value: "浦东新区",
  83. label: "浦东新区",
  84. },
  85. ],
  86. timeSelectVal: "",
  87. timeOptions: [],
  88. tableData: [],
  89. paginationData: {
  90. pageSize: 10,
  91. pagerCount: 5,
  92. currentPage: 1,
  93. pageSizes: [5, 10, 20, 50],
  94. total: 200,
  95. currentChange: (val) => {
  96. this.getTableData(val);
  97. },
  98. handleSizeChange: (val) => {
  99. this.handleSizeChange(val);
  100. },
  101. },
  102. currentRow: null,
  103. };
  104. },
  105. computed: {
  106. lawPopupShow() {
  107. return this.$store.state.lawPopupShow;
  108. },
  109. },
  110. created() {
  111. this.timeOptions = [];
  112. // 时间选择
  113. for (let i = 1980; i < 2023; i++) {
  114. this.timeOptions.unshift({
  115. value: i,
  116. label: i,
  117. });
  118. }
  119. this.getTableData(1);
  120. },
  121. methods: {
  122. queryEvent() {
  123. console.log("查询");
  124. },
  125. resetEvent() {
  126. console.log("重置");
  127. },
  128. // 切换页
  129. getTableData(val) {
  130. // console.log(`当前页: ${val}`);
  131. this.tableData = [];
  132. let searchParam = [];
  133. if (this.searchInput) {
  134. let paramSearch = {
  135. field: "c_name",
  136. // 模糊查询
  137. searchType: "2",
  138. content: {
  139. value: this.searchInput,
  140. },
  141. };
  142. searchParam.push(paramSearch);
  143. }
  144. let params = new FormData();
  145. params = {
  146. columnId: 23,
  147. states: 3,
  148. pageSize: this.currentPageSize,
  149. page: val - 1,
  150. search: JSON.stringify(searchParam),
  151. };
  152. this.$Post(this.urlsCollection.selectContentList, params).then(
  153. (res) => {
  154. // console.log(res, "当前的法律法规");
  155. if (res.code === 200 && res.content.data.length > 0) {
  156. // console.log(res.content, "查询到的法律法规相关的数据");
  157. this.paginationData.currentPage = val;
  158. this.paginationData.total = res.content.count;
  159. this.tableData = res.content.data.map((v) => {
  160. return {
  161. id: v.id || "",
  162. title: v.c_name || "--",
  163. date: v.c_new_date || "--",
  164. // date: v.c_date || "--",
  165. address: v.c_pdf || "",
  166. };
  167. });
  168. }
  169. },
  170. (error) => {
  171. console.log(error);
  172. }
  173. );
  174. },
  175. // 切换条数
  176. handleSizeChange(val) {
  177. console.log(`每页 ${val} 条`);
  178. },
  179. closeEvent() {
  180. this.$store.state.lawPopupShow = false;
  181. },
  182. lawDetailsClose() {
  183. if (this.$refs.lawFileRef) {
  184. this.$refs.lawFileRef.cancel();
  185. }
  186. },
  187. // 选中当前行
  188. handleRowChange(val) {
  189. console.log(val, "currentRow");
  190. this.currentRow = val;
  191. this.$refs.lawDetailsRef.title = val.title;
  192. this.$refs.lawDetailsRef.time = val.date;
  193. this.$refs.lawDetailsRef.lawDetailsPopupShow = true;
  194. this.$nextTick(() => {
  195. if (this.$refs.lawFileRef) {
  196. this.$refs.lawFileRef.showView(this.lawBaseUrl + val.address);
  197. }
  198. });
  199. },
  200. },
  201. };
  202. </script>
  203. <style lang="less" scoped>
  204. .law-related {
  205. width: 700px;
  206. height: 500px;
  207. background: rgba(0, 39, 77, 0.95);
  208. border: 1px solid #2fb8ff;
  209. pointer-events: auto;
  210. // 单击每一行后弹出法律相关的详细内容
  211. .law-details-popup {
  212. position: absolute;
  213. width: 100%;
  214. height: 100%;
  215. z-index: 99;
  216. }
  217. .title {
  218. margin: 0 auto;
  219. width: 99%;
  220. height: 8%;
  221. position: relative;
  222. border-bottom: 1px solid;
  223. border-image: -webkit-linear-gradient(
  224. -90deg,
  225. rgba(255, 255, 255, 0) 0%,
  226. rgba(47, 184, 255, 1) 50%,
  227. rgba(255, 255, 255, 0) 99%
  228. )
  229. 2 2 2 2;
  230. border-image: -moz-linear-gradient(
  231. 90deg,
  232. rgba(255, 255, 255, 0) 0%,
  233. rgba(47, 184, 255, 1) 50%,
  234. rgba(255, 255, 255, 0) 99%
  235. )
  236. 2 2 2 2;
  237. border-image: linear-gradient(
  238. 90deg,
  239. rgba(255, 255, 255, 0) 0%,
  240. rgba(47, 184, 255, 1) 50%,
  241. rgba(255, 255, 255, 0) 99%
  242. )
  243. 2 2 2 2;
  244. &-text {
  245. position: absolute;
  246. left: 10px;
  247. top: 7px;
  248. color: #fff;
  249. word-spacing: 2px;
  250. letter-spacing: 2px;
  251. font-size: 18px;
  252. font-family: PingFang SC;
  253. font-weight: 300;
  254. }
  255. &-close-btn {
  256. width: 30px;
  257. height: 30px;
  258. position: absolute;
  259. top: 1px;
  260. right: 1px;
  261. background: url("../../assets/image/close.png") no-repeat center;
  262. cursor: pointer;
  263. }
  264. }
  265. .option {
  266. width: 100%;
  267. height: 11%;
  268. position: relative;
  269. &-left {
  270. position: absolute;
  271. left: 0;
  272. width: 35%;
  273. .search-input {
  274. position: absolute;
  275. top: 7px;
  276. left: 5px;
  277. width: 225px;
  278. }
  279. /deep/.el-input-group__append,
  280. .el-input-group__prepend {
  281. background: transparent;
  282. // background-color: #00aaff54;
  283. color: #fff;
  284. border-left: none;
  285. // border: none;
  286. // border-radius: 1px;
  287. }
  288. /deep/.el-input-group--append .el-input__inner,
  289. .el-input-group__prepend {
  290. border-right: none;
  291. }
  292. /deep/.el-input__inner {
  293. height: 35px;
  294. border-right: none;
  295. }
  296. /deep/ .el-input__inner {
  297. border-color: #fff !important;
  298. color: #fff;
  299. }
  300. .search-icon {
  301. position: absolute;
  302. top: 10px;
  303. right: 16px;
  304. cursor: pointer;
  305. display: flex;
  306. align-items: center;
  307. justify-content: center;
  308. }
  309. }
  310. &-right {
  311. display: flex;
  312. align-items: center;
  313. justify-content: space-around;
  314. position: absolute;
  315. right: 0;
  316. width: 65%;
  317. &-item {
  318. width: 120px;
  319. height: 40px;
  320. line-height: 50px;
  321. }
  322. }
  323. }
  324. .table {
  325. width: 100%;
  326. height: 70%;
  327. /deep/.el-table {
  328. background: rgba(0, 39, 77, 0.6);
  329. // font-size: 0.95rem;
  330. font-family: PingFang SC;
  331. font-weight: 500;
  332. thead {
  333. color: #4dc3ff;
  334. font-size: 15px;
  335. }
  336. td {
  337. cursor: pointer;
  338. }
  339. }
  340. }
  341. .footer {
  342. margin: 0 auto;
  343. width: 100%;
  344. height: 10%;
  345. display: flex;
  346. align-items: center;
  347. justify-content: center;
  348. }
  349. }
  350. </style>