主数据管理:高级查询,状态查询,快速查询,当查询出多页时,点击分页的页码能够保留上一次的查询条件进行分页,点击分类树节点时则置空查询条件。
| | |
| | | fileOptions: {}, |
| | | result: '', |
| | | elapsedTime: '', |
| | | conditionMap: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | |
| | | if (_index == 0) { |
| | | this.keyWordFind = record.queryField; |
| | | console.log(record) |
| | | //console.log(record) |
| | | } |
| | | }) |
| | | this.tableHeadFindDatas = newval; |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 置空查询条件 |
| | | resetConditionMap() { |
| | | this.conditionMap = {}; |
| | | }, |
| | | |
| | | CodeLinkHandler(row) { |
| | | this.LinkObject = row; |
| | | this.LinkVisible = true; |
| | | this.LinkList = Object.keys(row).map(property => property) |
| | | |
| | | }, |
| | | //状态搜索 |
| | | cellSelectHandler(row) { |
| | |
| | | }, |
| | | cellStatusFind(lcstatus) { |
| | | this.isLoading = true; |
| | | this.conditionMap["conditionMap[lcstatus]"] = lcstatus; |
| | | TableData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | ...this.conditionMap, /**带上分页查询条件 */ |
| | | }); |
| | | const endTime = performance.now(); |
| | | this.elapsedTime = Math.floor(endTime - startTime) * 1; |
| | |
| | | sort: val.prop, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | ...this.conditionMap |
| | | }); |
| | | this.data = data.data; |
| | | } finally { |
| | |
| | | //分页刷新 |
| | | async onLoad(val) { |
| | | this.isLoading = true; |
| | | |
| | | try { |
| | | let conditionMap = {}; |
| | | if (this.statusSelect !== 'all') { |
| | |
| | | }, |
| | | // 高级查询 |
| | | async echoContion(val) { |
| | | this.conditionMap = val; |
| | | try { |
| | | const res = await FindData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | ...val, |
| | | page: this.page.currentPage = 1,/** 每次点击高级查询都应该从第一页开始*/ |
| | | limit: this.page.pageSize |
| | | }); |
| | | this.tableData = res.data.data; |
| | | this.page.total = res.data.total |
| | |
| | | tableFindInp() { |
| | | this.isLoading = true; |
| | | try { |
| | | // 存储查询条件,主要是为了点击页码时带上这个条件 |
| | | this.conditionMap["conditionMap[" + this.keyWordFind + "]"] = '*' + this.WupinFindValue + '*'; |
| | | TableData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | |
| | | |
| | | <script> |
| | | import { getDictionary } from "@/api/omd/enum"; |
| | | import moment from 'moment'; |
| | | import vciWebRefer from '../refer/vciWebRefer.vue'; |
| | | export default { |
| | | components: { vciWebRefer }, |
| | |
| | | //console.log(item.referConfigData.options); |
| | | //console.log(item); |
| | | } |
| | | // TODO: 这儿修改一下参照的查询条件 |
| | | let conditions = []; |
| | | if(item.fieldType==='text'){ |
| | | conditions = this.searchConditions; |
| | | }else if (item.fieldType==='combox'|| item.fieldType==='truefalse'){ |
| | | conditions = this.switchSearchConditions; |
| | | }else if (item.fieldType==='datetime') { |
| | | }else if (item.fieldType==='datetime' || item.fieldType==='date') { |
| | | conditions = this.dateConditions; |
| | | }else { |
| | | conditions = this.referSearchConditions; |
| | |
| | | //console.log(this.initOptions); |
| | | //console.log(this.searchFormArrays); |
| | | }, |
| | | |
| | | /** 为参照类型时值选择之后的处理 */ |
| | | setReferValue(data,index){ |
| | | if(data.field) { |
| | |
| | | // 存在相同的查询条件 |
| | | if(condtionParam['conditionMap['+searchConditions[index].queryField+']']+'' != 'undefined' ) { |
| | | this.$message.warning("存在重复查询条件,请仔细核对!"); |
| | | console.log(condtionParam['conditionMap['+searchConditions[index].queryField+']']); |
| | | //console.log(condtionParam['conditionMap['+searchConditions[index].queryField+']']); |
| | | return false; |
| | | } |
| | | let fieldType = this.initOptions[index].fieldType; |
| | | // 当出现查询日期的格式时,需要对日期格式进行处理 |
| | | if(fieldType==='datetime' || fieldType==='date'){ |
| | | // 将时间转换为本地时间 |
| | | let localTime = moment.utc(searchConditions[index].fieldValue).local(); |
| | | // 格式化时间为您想要的格式 |
| | | let formattedTime = localTime.format('YYYY-MM-DD HH:mm:ss'); |
| | | condtionParam['conditionMap['+searchConditions[index].queryField+searchConditions[index].condition+']'] = formattedTime; |
| | | //console.log(formattedTime); |
| | | }else{ |
| | | //拼接成map对象,将查询对象和condition拼接在一起,组成高级查询map的key |
| | | condtionParam['conditionMap['+searchConditions[index].queryField+searchConditions[index].condition+']'] = searchConditions[index].fieldValue; |
| | | } |
| | | } |
| | | |
| | | } |
| | | // 查询条件没有出现重复属性,并且过滤掉了空值,就传递给父组件 |
| | | console.log(condtionParam); |
| | | //console.log(condtionParam); |
| | | this.$emit('echoContion',condtionParam) |
| | | this.isShowDialog = false; |
| | | }, |
| | |
| | | :nodeClickList="this.nodeClickList" |
| | | @currentPage="currentPages" |
| | | @pageSize="pageSizes" |
| | | ref="vciMasterCrud" |
| | | > |
| | | </VciMasterCrud> |
| | | </el-main> |
| | |
| | | page: { |
| | | total: 0, |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | pageSize: 100, |
| | | pageSizes: [10, 30, 50, 100, 200], |
| | | }, |
| | | pageSize: "100", |
| | |
| | | methods: { |
| | | nodeClickLists(val){ |
| | | this.nodeClickList=val; |
| | | // 点击树节点时重置当前页和页数 |
| | | this.page.pageSize = 100; |
| | | this.page.currentPage = 1; |
| | | // 重置保存的高级查询查询条件和快速查询条件 |
| | | const childComponent = this.$refs.vciMasterCrud; |
| | | childComponent.conditionMap = {}; // 修改子组件的data中的属性 |
| | | }, |
| | | TreeValueEmit(val) { |
| | | this.TreeValue = val; |
| | |
| | | }, |
| | | nodeClickTem(val) { |
| | | this.templateOid = val; |
| | | |
| | | }, |
| | | tableHeadBttoms(val) { |
| | | this.masterVrBtnList = val; |