123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- <template>
- <div class="law-container">
- <div class="law-container-inner">
- <LawDetailsPopup
- ref="lawRef"
- class="law-container-inner-details"
- @lawDetailsClose="lawDetailsClose"
- ><FilePreview ref="lawFilePreview" style="width: 100%; height: 100%;"/></LawDetailsPopup>
- <div class="header">
- <div class="header-title">法律法规</div>
- <div class="header-select">
- <div>
- <div class="text">类型 :</div>
- <NewSelect
- ref="lawTypeRef"
- :placeholder="typePlaceholder"
- class="select-input"
- v-model="typeSelectVal"
- :options="typeOptions"
- :value="typeSelectVal"
- />
- </div>
- <div>
- <div class="text">年份 :</div>
- <NewSelect
- ref="lawYearRef"
- :placeholder="timePlaceholder"
- class="select-input"
- v-model="timeSelectVal"
- :options="timeOptions"
- :value="timeSelectVal"
- />
- </div>
- <div style="position: relative">
- <el-input class="search-input" v-model="searchInput" clearable>
- <i class="el-icon-search" slot="append"></i>
- </el-input>
- </div>
- <!-- <div style="position: relative">
- <el-button
- size="big"
- type="text"
- icon="el-icon-search"
- style="
- position: absolute;
- bottom: 4px;
- right: 10px;
- z-index: 99;
- color: #fff;
- "
- ></el-button>
- <el-input class="search-input" v-model="searchInput" clearable> </el-input>
- </div> -->
- </div>
- <div class="query-btn" @click="getTableData(1)">查询</div>
- <div class="reset-btn" @click="resetEvent">重置</div>
- </div>
- <div class="center">
- <el-table
- :data="tableData"
- style="width: 100%"
- max-height="600"
- @current-change="handleClick"
- >
- <el-table-column type="index" width="150" label="序号" align="center">
- </el-table-column>
- <el-table-column prop="type" label="类别" align="center">
- </el-table-column>
- <el-table-column
- prop="title"
- label="文件名称"
- align="center"
- width="250"
- >
- </el-table-column>
- <el-table-column prop="class" label="等级" align="center">
- </el-table-column>
- <el-table-column prop="date" label="日期" align="center">
- </el-table-column>
- </el-table>
- </div>
- <div class="footer">
- <Pagination class="pagination-style" :paginationData="paginationData" />
- </div>
- </div>
- </div>
- </template>
- <script>
- import NewSelect from "@/components/common/NewSelect.vue";
- import Pagination from "@/components/common/Pagination.vue";
- // 法律法规细节文档弹窗
- import LawDetailsPopup from "@/components/popup/LawDetailsPopup.vue";
- import FilePreview from "@/components/common/FilePreView.vue";
- /**
- * 法律法规 页面 -- 智能辅助,疑点相关的法律法规
- * @author: Gao Lu
- * @Date: 2022.11.24
- */
- export default {
- name: "LawView",
- components: { NewSelect, Pagination, LawDetailsPopup, FilePreview },
- data() {
- return {
- // 数据字典暂存对象
- classDictMap: {},
- searchInput: "",
- typePlaceholder: "请选择审计法律类别",
- typeSelectVal: "",
- typeOptions: [],
- timePlaceholder: "请选择年份",
- timeSelectVal: "",
- timeOptions: [],
- tableData: [],
- currentPageSize: 10,
- currentPage: 1,
- lawBaseUrl: "/dms",
- paginationData: {
- pageSize: 10,
- pagerCount: 5,
- currentPage: 1,
- pageSizes: [5, 10, 20, 30],
- total: 30,
- currentChange: (val) => {
- this.getTableData(val);
- },
- handleSizeChange: (val) => {
- this.handleSizeChange(val);
- },
- },
- };
- },
- created() {
- this.timeOptions = [];
- this.typeOptions = [];
- // 时间选择
- for (let i = 1980; i < 2023; i++) {
- this.timeOptions.unshift({
- value: i,
- label: i,
- });
- }
- // 审计等级
- this.classDictQuery("0", "sj_class", "审计等级");
- // 审计类别
- this.classDictQuery("0", "sh_law_type", "审计法律类别");
- this.getTableData(1);
- },
- methods: {
- // 数据字典查询 -- 获取所需类别
- classDictQuery(type, cName, keyName) {
- let params = new FormData();
- params = {
- type: type,
- cName: cName,
- };
- this.$Post(this.urlsCollection.selectByCNameAType, params).then(
- (res) => {
- if (res.code === 200 && res.content.length > 0) {
- this.classDictMap[keyName] = new Map();
- res.content.forEach((v) => {
- this.classDictMap[keyName].set(v.index + "", v.name);
- });
- if (keyName === "审计法律类别") {
- this.classDictMap[keyName].forEach((v, i) => {
- this.typeOptions.unshift({
- value: i,
- label: v,
- });
- });
- }
- }
- },
- (error) => {
- this.$message.error();
- console.log(error);
- }
- );
- },
- resetEvent() {
- console.log("重置");
- this.typeSelectVal = "";
- this.timeSelectVal = "";
- this.searchInput = "";
- this.$refs.lawTypeRef.imgValue = "";
- this.$refs.lawYearRef.imgValue = "";
- this.getTableData(this.currentPage);
- },
- // 切换页
- getTableData(val) {
- // console.log(`当前页: ${val}`);
- this.tableData = [];
- let searchParam = [];
- // 类别
- if (this.typeSelectVal) {
- let paramType = {
- field: "type",
- // 等值查询
- searchType: "1",
- content: {
- value: this.typeSelectVal,
- },
- };
- searchParam.push(paramType);
- }
- // 年份查询
- if (this.timeSelectVal) {
- let paramTime = {
- field: "c_new_date",
- // field: "c_date_time",
- // 模糊查询
- searchType: "2",
- content: {
- value: this.timeSelectVal + "",
- },
- };
- searchParam.push(paramTime);
- }
- if (this.searchInput) {
- let paramSearch = {
- field: "c_name",
- // 模糊查询
- searchType: "2",
- content: {
- value: this.searchInput,
- },
- };
- searchParam.push(paramSearch);
- }
- let params = new FormData();
- params = {
- columnId: 23,
- states: 3,
- pageSize: this.currentPageSize,
- page: val - 1,
- search: JSON.stringify(searchParam),
- };
- this.$Post(this.urlsCollection.selectContentList, params).then(
- (res) => {
- if (res.code === 200 && res.content.data.length > 0) {
- // console.log(res.content, "查询到的法律法规相关的数据");
- this.paginationData.currentPage = val;
- this.paginationData.total = res.content.count;
- this.tableData = res.content.data.map((v) => {
- return {
- id: v.id || "",
- title: v.c_name || "--",
- type: this.classDictMap["审计法律类别"].get(v.sh_law_type) || "--",
- class: this.classDictMap["审计等级"].get(v.sj_class) || "--",
- date: v.c_new_date || "--",
- // date: this.$dayjs(v.c_date_time).format("YYYY-MM-DD") || "--",
- address: v.c_pdf || "",
- };
- });
- }
- },
- (error) => {
- console.log(error);
- }
- );
- },
- // 切换条数
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`);
- this.currentPageSize = val;
- this.getTableData(this.currentPage);
- },
- // 开启弹窗
- handleClick(row) {
- console.log(row.address, "--address");
- this.$refs.lawRef.title = row.title;
- this.$refs.lawRef.time = row.date;
- this.$refs.lawRef.lawDetailsPopupShow = true;
- this.$nextTick(() => {
- if (this.$refs.lawFilePreview) {
- this.$refs.lawFilePreview.showView(this.lawBaseUrl + row.address);
- }
- });
- },
- // 关闭弹窗
- lawDetailsClose() {
- if (this.$refs.lawFilePreview) {
- this.$refs.lawFilePreview.cancel();
- }
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .law-container {
- display: flex;
- align-items: center;
- justify-content: center;
- &-inner {
- width: 98%;
- height: 97%;
- background: rgba(0, 39, 77, 0.5);
- position: relative;
- &-details {
- width: 100%;
- height: 100%;
- position: absolute;
- z-index: 9999;
- }
- .header {
- height: 120px;
- width: 100%;
- position: absolute;
- &-title {
- width: 84px;
- height: 20px;
- font-size: 20px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #4dc3ff;
- line-height: 30px;
- position: absolute;
- top: 1px;
- left: 10px;
- }
- &-select {
- position: absolute;
- left: 10px;
- bottom: 5px;
- width: 950px;
- height: 40px;
- color: #e6e6e6;
- display: flex;
- justify-content: space-between;
- & > div {
- // position: absolute;
- display: flex;
- justify-content: flex-start;
- width: 280px;
- .text {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 80px;
- height: 28px;
- }
- .select-input {
- width: 190px;
- }
- .search-input {
- position: absolute;
- // right: -50px;
- bottom: 5px;
- width: 280px;
- /deep/.el-input-group__append,
- .el-input-group__prepend {
- background: transparent;
- // background-color: #00aaff54;
- color: #fff;
- border-left: none;
- // border: none;
- // border-radius: 1px;
- }
- /deep/.el-input-group--append .el-input__inner,
- .el-input-group__prepend {
- border-right: none;
- }
- /deep/ .el-input__inner {
- border-color: #fff !important;
- color: #fff;
- border-right:none ;
- }
- }
- }
- }
- .reset-btn,
- .query-btn {
- width: 60px;
- height: 30px;
- border-radius: 3px;
- border: none;
- color: #fff;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- position: absolute;
- top: 15px;
- }
- .reset-btn {
- right: 30px;
- background: rgba(129, 140, 164, 1);
- }
- .query-btn {
- right: 110px;
- background-image: linear-gradient(
- to top,
- rgba(79, 172, 254, 1),
- rgba(0, 242, 254, 1)
- );
- }
- }
- .center {
- height: calc(90% - 120px);
- width: 100%;
- position: absolute;
- overflow: auto;
- top: 130px;
- // background: red;
- /deep/.el-table {
- background: rgba(0, 39, 77, 0.6);
- // font-size: 0.95rem;
- font-family: PingFang SC;
- font-weight: 500;
- thead {
- color: #4dc3ff;
- font-size: 15px;
- }
- }
- }
- .footer {
- position: absolute;
- right: 50px;
- bottom: 30px;
- }
- }
- }
- </style>
|