Commit 0719dcab authored by danfuman's avatar danfuman

修改

parent 38fcfe24
...@@ -935,9 +935,9 @@ export default { ...@@ -935,9 +935,9 @@ export default {
}, },
itemStyle: { itemStyle: {
normal:{ normal:{
color: '#67B3FD', color: '#14C9C9',
lineStyle: { lineStyle: {
width:3 width:2
}, },
} }
}, },
...@@ -961,7 +961,7 @@ export default { ...@@ -961,7 +961,7 @@ export default {
offset: 1, offset: 1,
color: '#1B8EFF' color: '#1B8EFF'
}]), }]),
barBorderRadius:[20,20, 0, 0] // barBorderRadius:[20,20, 0, 0]
} }
}, },
data:data.map(item => item.count), data:data.map(item => item.count),
...@@ -1258,9 +1258,9 @@ export default { ...@@ -1258,9 +1258,9 @@ export default {
}, },
itemStyle: { itemStyle: {
normal:{ normal:{
color: '#67B3FD', color: '#14C9C9',
lineStyle: { lineStyle: {
width:3 width:2
}, },
} }
}, },
...@@ -1284,7 +1284,7 @@ export default { ...@@ -1284,7 +1284,7 @@ export default {
offset: 1, offset: 1,
color: '#1B8EFF' color: '#1B8EFF'
}]), }]),
barBorderRadius:[20,20, 0, 0] // barBorderRadius:[20,20, 0, 0]
} }
}, },
data:data.map(item => item.count), data:data.map(item => item.count),
......
<template>
<div :ref="refStr" class="custom-time-select screen-popper" id="custom-time-select">
<div :class="['input-block', isSelectOption?'rote':'']">
<div class="block" @click="isSelectOption=!isSelectOption" @mouseenter="handleMouseenter" @mouseleave="handleMouseleave">
<el-input class="custom-time-input" v-model="value" :placeholder="placeholder" readonly>
<template slot="suffix">
<span @click.stop="handleClear" :class="[isClear&&isHover?'el-icon-circle-close':'el-icon-arrow-down']"></span>
</template>
</el-input>
</div>
<div class="options-block" v-if="isSelectOption">
<div class="arrow"></div>
<div @click="handleClick(option)" :class="['option', value==option?'active':'']" :key="i" v-for="(option, i) in options">
<template v-if="option == '自定义'">
<div style="position: relative">
自定义
<el-date-picker
ref="picker"
:default-value="defaultValue"
style="position: absolute;opacity: 0;"
v-model="pickerValue"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
@change="changePicker">
</el-date-picker>
</div>
</template>
<template v-else>
<span>{{option}}</span> <span v-if="value==option" class="el-icon-check"></span>
</template>
</div>
</div>
</div>
<div v-if="isSelectOption" class="picker-block" ref="picker-block"></div>
</div>
</template>
<script>
export default {
props: {
'placeholder': {
type: String,
default: '请选择',
},
'ref-str': {
type: String,
default: `timeselect${String(Math.random(0, 100)).slice(2)}`,
},
dateFrom: {
type: String,
default: ''
},
dateTo: {
type: String,
default: ''
},
timeList: {
type: Array,
default: () => [],
}
},
computed: {
isClear() {
if(!this.isSelectOption && this.value) {
return true
}else {
return false
}
},
pickerOptions() {
// 用计算属性
let _this = this
// 此时 this指向的就是vue实例
return {
disabledDate(time) {
if(_this.dateFrom){
return time.getTime() < new Date(_this.dateFrom.replace(/-/g, '/')).getTime() - 8.64e6;//如果没有后面的-8.64e6就是不可以选择今天的
}
if(_this.dateTo){
return time.getTime() > new Date(_this.dateTo.replace(/-/g, '/')).getTime();//如果没有后面的-8.64e7就是不可以选择今天的
}
}
}
},
},
watch: {
refStr(refStr) {
return refStr
}
},
data() {
return {
value: '',
options: ['近1年', '近2年', '近3年', '近5年', '自定义',],
isSelectOption: false,
isHover: false,
pickerValue: [],
defaultValue:new Date()
}
},
mounted() {
if(this.dateTo){
this.defaultValue = new Date(this.dateTo)
}
this.handleAppClick()
if(this.timeList&&this.timeList.length>0){
this.options = this.timeList
}
},
methods: {
// 时间格式化
formatDate(timeStr) {
let date = new Date(Number(timeStr))
let year = date.getFullYear()
let month = String(date.getMonth() + 1).padStart(2, 0)
let day = String(date.getDate()).padStart(2, 0)
return `${year}-${month}-${day}`
},
// 判断是否点击的为组件内部
handleAppClick() {
const app = document.getElementById('app')
app.addEventListener('click', (e) => {
const dom = this.$refs[this.refStr]
const flag = dom && dom.contains(e.target)
// const flag = document.getElementById('custom-time-select').contains(e.target)
!flag ? this.isSelectOption = false : ''
if(this.value == '自定义' && (!this.pickerValue || !this.pickerValue.length)) {
this.value = ''
this.$emit('input', '')
this.$emit('handle-search')
}
}, true)
},
handleMouseenter() {
this.isHover = true
},
handleMouseleave() {
this.isHover = false
},
handleClear() {
if(this.isClear && this.isHover) {
this.value = ''
this.pickerValue = []
this.$emit('input', '')
this.$emit('handle-search')
}else {
this.isSelectOption = true
}
},
handleClick(value) {
this.value = value
if(value == '自定义') {
this.value = '自定义'
this.$refs.picker && this.$refs.picker.length && this.$refs.picker[0].focus()
this.$nextTick(() => {
this.$refs['picker-block'].appendChild(this.$refs.picker[0].popperElm)
})
}else {
this.pickerValue = []
this.isSelectOption = false
let timeStr = []
let startTime = ''
let endTime = new Date()
switch (value) {
case '近三天':
startTime = new Date(endTime.getTime() - 3600 * 1000 * 24 * 3)
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
case '近七天':
startTime = new Date(endTime.getTime() - 3600 * 1000 * 24 * 7)
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
case '近半月':
startTime = new Date(endTime.getTime() - 3600 * 1000 * 24 * 15)
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
case '近1年':
startTime = new Date().setFullYear(new Date().getFullYear() - 1)
if(this.dateTo){
startTime = new Date(this.dateTo).setFullYear(new Date(this.dateTo).getFullYear() - 1)
}
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
case '近2年':
startTime = new Date().setFullYear(new Date().getFullYear() - 2)
if(this.dateTo){
startTime = new Date(this.dateTo).setFullYear(new Date(this.dateTo).getFullYear() - 2)
}
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
case '近3年':
startTime = new Date().setFullYear(new Date().getFullYear() - 3)
if(this.dateTo){
startTime = new Date(this.dateTo).setFullYear(new Date(this.dateTo).getFullYear() - 3)
}
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
case '近5年':
startTime = new Date().setFullYear(new Date().getFullYear() - 5)
if(this.dateTo){
startTime = new Date(this.dateTo).setFullYear(new Date(this.dateTo).getFullYear() - 5)
}
timeStr = [this.formatDate(startTime), this.formatDate(endTime)]
break;
default:
if(this.pickerValue && this.pickerValue.length) {
timeStr = this.pickerValue
}else {
timeStr = []
this.value = ''
}
break;
}
this.$emit('input', timeStr)
this.$emit('handle-search')
}
},
// 时间选择改变后的回调
changePicker(value) {
this.isSelectOption = false
if(value && value.length) {
// this.value = '自定义'
this.value = String(this.pickerValue)
this.$emit('input', this.pickerValue)
}else {
this.value = ''
this.$emit('input', '')
}
this.$emit('handle-search')
}
}
}
</script>
<style lang="scss">
.custom-time-select {
width: 120px;
height: 34px;
.input-block {
width: 100%;
height: 100%;
margin: 0;
cursor: pointer;
.block {
width: 100%;
height: 100%;
>.custom-time-input.el-input {
width: 100%;
height: 100%;
>input {
width: 100%;
height: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
border-radius: 2px;
}
}
}
.el-input__suffix {
transform: rotateZ(0);
width: 25px;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
&.rote {
.el-input__suffix {
transform: rotateZ(180deg);
}
}
}
.options-block {
position: absolute;
margin-top: 12px;
min-width: 120px;
font-size: 14px;
color: #666666;
background-color: #fff;
border: 1px solid #E4E7ED;
padding: 6px 0;
border-radius: 4px;
z-index: 10;
.option {
padding: 0 24px 0 16px;
box-sizing: border-box;
height: 36px;
display: flex;
justify-content: space-between;
align-items: center;
>span {
display: inline-block;
}
&.active {
background-color: #F2F7FF;
color: #0381FA;
}
&:hover {
background-color: #F5F7FA;
}
}
}
.picker-block {
position: relative;
&::after {
content:"";
display:block;
visibility:hidden;
clear:both;
}
.el-picker-panel.el-date-range-picker.el-popper {
left: 0 !important;
/*top: 205px !important;*/
}
.popper__arrow {
/*left: 30px !important;*/
}
}
}
</style>
...@@ -406,7 +406,10 @@ export default { ...@@ -406,7 +406,10 @@ export default {
}, },
label: { label: {
show: this.valData[1] ? true : false, show: this.valData[1] ? true : false,
position: 'top' position: 'top',
textStyle: {
padding: [0, 0, 0, -12]
}
}, },
//设置折线颜色和粗细 //设置折线颜色和粗细
lineStyle: { lineStyle: {
...@@ -470,7 +473,10 @@ export default { ...@@ -470,7 +473,10 @@ export default {
}, },
label: { label: {
show: this.valData1[1] ? true : false, show: this.valData1[1] ? true : false,
position: 'top' position: 'top',
textStyle: {
padding: [0, 0, 0, -35]
}
}, },
itemStyle:{ itemStyle:{
color: "#718AFF", color: "#718AFF",
...@@ -534,7 +540,10 @@ export default { ...@@ -534,7 +540,10 @@ export default {
}, },
label: { label: {
show: this.valData2[1] ? true : false, show: this.valData2[1] ? true : false,
position: 'top' position: 'top',
textStyle: {
padding: [0, 0, 0, -16]
}
}, },
//设置折线颜色和粗细 //设置折线颜色和粗细
lineStyle: { lineStyle: {
...@@ -598,7 +607,10 @@ export default { ...@@ -598,7 +607,10 @@ export default {
}, },
label: { label: {
show: this.valData3[1] ? true : false, show: this.valData3[1] ? true : false,
position: 'top' position: 'top',
textStyle: {
padding: [0, 0, 0, -16]
}
}, },
//设置折线颜色和粗细 //设置折线颜色和粗细
lineStyle: { lineStyle: {
...@@ -664,6 +676,9 @@ export default { ...@@ -664,6 +676,9 @@ export default {
label: { label: {
show: this.valData4[1] ? true : false, show: this.valData4[1] ? true : false,
position: 'top', position: 'top',
textStyle: {
padding: [0, 0, 0, -14]
}
}, },
//设置折线颜色和粗细 //设置折线颜色和粗细
lineStyle: { lineStyle: {
......
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
placeholder="资质资格" placeholder="资质资格"
collapse-tags collapse-tags
clearable></el-cascader> clearable></el-cascader>
<custom-time-select
style="display: inline-block"
:timeList="timeList"
v-model="queryParams.time"
:placeholder="timePlaceholder"
@handle-search="changeSelect" />
<el-input placeholder="输入关键词查询" v-model="queryParams.ename" clearable @clear="handleSearch()"> <el-input placeholder="输入关键词查询" v-model="queryParams.ename" clearable @clear="handleSearch()">
<i slot="prefix" class="el-icon-search"></i> <i slot="prefix" class="el-icon-search"></i>
<el-button slot="append" @click="handleSearch()">搜索</el-button> <el-button slot="append" @click="handleSearch()">搜索</el-button>
...@@ -92,12 +98,13 @@ ...@@ -92,12 +98,13 @@
// import Offsite from './component/offsite' // import Offsite from './component/offsite'
import {encodeStr} from "@/assets/js/common.js" import {encodeStr} from "@/assets/js/common.js"
import aptitudeCode from '@/assets/json/aptitudeCode' import aptitudeCode from '@/assets/json/aptitudeCode'
import CustomTimeSelect from '../component/CustomTimeSelect'
import { enterprise,location,getUipIdByCid } from '@/api/macro/macro' import { enterprise,location,getUipIdByCid } from '@/api/macro/macro'
import Region from '../component/region' import Region from '../component/region'
import skeleton from '../component/skeleton' import skeleton from '../component/skeleton'
export default { export default {
name: 'Enterprises', name: 'Enterprises',
components: {Region,skeleton}, components: {Region,skeleton,CustomTimeSelect},
data() { data() {
return { return {
encodeStr, encodeStr,
...@@ -106,6 +113,7 @@ export default { ...@@ -106,6 +113,7 @@ export default {
queryParams:{ queryParams:{
ename:'', ename:'',
codeStr:'', codeStr:'',
time:'',
}, },
props: { props: {
value: 'id', value: 'id',
...@@ -126,7 +134,9 @@ export default { ...@@ -126,7 +134,9 @@ export default {
provinceId:'', provinceId:'',
show_page:true, show_page:true,
MaxPage:500, MaxPage:500,
isSkeleton:true isSkeleton:true,
timeList: ['近三天', '近七天', '近半月', '自定义'],
timePlaceholder:'中标时间',
} }
}, },
created() { created() {
...@@ -171,7 +181,11 @@ export default { ...@@ -171,7 +181,11 @@ export default {
async querySubmit(){ async querySubmit(){
// this.isSkeleton = true; // this.isSkeleton = true;
this.tableLoading = true; this.tableLoading = true;
const params = { pageNum: this.pageIndex, pageSize: this.pageSize} const params = {}
params.page={
limit:this.pageSize,
page:this.pageIndex,
}
if(this.queryParams.field){ if(this.queryParams.field){
params.field=this.queryParams.field params.field=this.queryParams.field
} }
...@@ -187,6 +201,14 @@ export default { ...@@ -187,6 +201,14 @@ export default {
if(this.queryParams.ename){ if(this.queryParams.ename){
params.aptitudeQueryDto.ename=this.queryParams.ename params.aptitudeQueryDto.ename=this.queryParams.ename
} }
if(this.queryParams.time.length > 1){
params.recentlyBidQueryDto=[
{
startTenderTime:this.queryParams.time[0],
endTenderTime:this.queryParams.time[1]
}
]
}
if(this.aptitudeType){ if(this.aptitudeType){
let aptitudeType=[]; let aptitudeType=[];
aptitudeType.push({ aptitudeType.push({
...@@ -243,6 +265,7 @@ export default { ...@@ -243,6 +265,7 @@ export default {
this.queryParams={ this.queryParams={
ename:'', ename:'',
codeStr:'', codeStr:'',
time:'',
} }
this.pageIndex=1; this.pageIndex=1;
this.querySubmit() this.querySubmit()
...@@ -298,7 +321,11 @@ export default { ...@@ -298,7 +321,11 @@ export default {
location(params).then(res => { location(params).then(res => {
console.log(res.data) console.log(res.data)
}) })
} },
changeSelect(){
this.pageIndex=1;
this.querySubmit()
},
} }
} }
</script> </script>
...@@ -353,14 +380,14 @@ export default { ...@@ -353,14 +380,14 @@ export default {
::v-deep .el-cascader{ ::v-deep .el-cascader{
width: 180px; width: 180px;
margin-right: 12px; margin-right: 12px;
height: 32px; height: 34px;
line-height: 32px !important; line-height: 34px !important;
.el-input{ .el-input{
width: 100%; width: 100%;
height: 32px; height: 100%;
.el-input__inner{ .el-input__inner{
height: 32px !important; width: 100%;
line-height: 32px !important; height: 100%;
} }
} }
.el-cascader__tags{ .el-cascader__tags{
...@@ -376,11 +403,13 @@ export default { ...@@ -376,11 +403,13 @@ export default {
} }
::v-deep .el-input.el-input-group{ ::v-deep .el-input.el-input-group{
width: 240px; width: 240px;
height: 30px; height: 34px;
border-radius:2px; border-radius:2px;
margin-left: 12px;
border: 1px solid #e0e0e0; border: 1px solid #e0e0e0;
.el-input__inner{ .el-input__inner{
height: 30px; width: 100%;
height: 100%;
border: 0; border: 0;
} }
.el-input__suffix{ .el-input__suffix{
......
...@@ -279,6 +279,7 @@ export default { ...@@ -279,6 +279,7 @@ export default {
countLandMarketByProvince(params).then(res => { countLandMarketByProvince(params).then(res => {
this.topState = false this.topState = false
this.topList=res.data.provinceDate; this.topList=res.data.provinceDate;
console.log(res.data.provinceList,"||||||||")
var list=[]; var list=[];
if(res.data.provinceDate){ if(res.data.provinceDate){
for(var i=0;i<res.data.provinceDate.length;i++){ for(var i=0;i<res.data.provinceDate.length;i++){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment