Browse Source

联调接口

master
邓宏 2 years ago
parent
commit
9782794eec
  1. 2
      package.json
  2. 91
      pnpm-lock.yaml
  3. BIN
      src/assets/img/bg.png
  4. BIN
      src/assets/img/down_bg.png
  5. BIN
      src/assets/img/icon.png
  6. BIN
      src/assets/img/info_bg.png
  7. BIN
      src/assets/img/result.png
  8. BIN
      src/assets/img/up_bg.png
  9. 9
      src/assets/style/index.less
  10. 7
      src/config/request.js
  11. 368
      src/view/home.vue
  12. 194
      src/view/search.vue

2
package.json

@ -11,7 +11,7 @@
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"axios": "^1.3.5", "axios": "^1.3.5",
"echarts": "^5.4.2", "echarts": "^5.4.2",
"element-plus": "^2.3.2", "element-plus": "^2.3.7",
"gsap": "^3.11.5", "gsap": "^3.11.5",
"swiper": "^9.2.0", "swiper": "^9.2.0",
"three": "^0.151.3", "three": "^0.151.3",

91
pnpm-lock.yaml

@ -7,7 +7,7 @@ specifiers:
axios: ^1.3.5 axios: ^1.3.5
black-knight: 1.3.30 black-knight: 1.3.30
echarts: ^5.4.2 echarts: ^5.4.2
element-plus: ^2.3.2 element-plus: ^2.3.7
gsap: ^3.11.5 gsap: ^3.11.5
less: ^4.1.3 less: ^4.1.3
less-loader: ~7.3.0 less-loader: ~7.3.0
@ -26,7 +26,7 @@ dependencies:
'@amap/amap-jsapi-loader': 1.0.1 '@amap/amap-jsapi-loader': 1.0.1
axios: 1.3.5 axios: 1.3.5
echarts: 5.4.2 echarts: 5.4.2
element-plus: 2.3.2_vue@3.2.47 element-plus: registry.npmmirror.com/element-plus/2.3.7_vue@3.2.47
gsap: 3.11.5 gsap: 3.11.5
swiper: 9.2.0 swiper: 9.2.0
three: 0.151.3 three: 0.151.3
@ -760,31 +760,6 @@ packages:
resolution: {integrity: sha512-uxMa/Dt7PQsLBVXwH+t6JvpHJnrsYBaxWKi/J6HE+/nBtoHENhwBoNkgkm226/Kfxeg0z1eMQLBRPPKcDH8xWA==} resolution: {integrity: sha512-uxMa/Dt7PQsLBVXwH+t6JvpHJnrsYBaxWKi/J6HE+/nBtoHENhwBoNkgkm226/Kfxeg0z1eMQLBRPPKcDH8xWA==}
dev: true dev: true
/element-plus/2.3.2_vue@3.2.47:
resolution: {integrity: sha512-NIK0QckKKagdlMm3eLoVoD4Lkfj5ECzpZAxwrRLdm1Yi5qiTU9Guor33+IbIa52z4gHMuhMxgSVS2xAGmjLHsw==}
peerDependencies:
vue: ^3.2.0
dependencies:
'@ctrl/tinycolor': 3.4.1
'@element-plus/icons-vue': 2.0.6_vue@3.2.47
'@floating-ui/dom': 1.0.10
'@popperjs/core': registry.npmmirror.com/@sxzz/popperjs-es/2.11.7
'@types/lodash': 4.14.182
'@types/lodash-es': 4.17.6
'@vueuse/core': 9.6.0_vue@3.2.47
async-validator: 4.2.5
dayjs: 1.11.4
escape-html: 1.0.3
lodash: 4.17.21
lodash-es: 4.17.21
lodash-unified: 1.0.2_3ib2ivapxullxkx3xftsimdk7u
memoize-one: 6.0.0
normalize-wheel-es: 1.2.0
vue: 3.2.47
transitivePeerDependencies:
- '@vue/composition-api'
dev: false
/emojis-list/3.0.0: /emojis-list/3.0.0:
resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
engines: {node: '>= 4'} engines: {node: '>= 4'}
@ -998,11 +973,11 @@ packages:
tslib: 2.4.0 tslib: 2.4.0
optionalDependencies: optionalDependencies:
errno: registry.npmmirror.com/errno/0.1.8 errno: registry.npmmirror.com/errno/0.1.8
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.10 graceful-fs: registry.npmmirror.com/graceful-fs/4.2.11
image-size: registry.npmmirror.com/image-size/0.5.5 image-size: registry.npmmirror.com/image-size/0.5.5
make-dir: registry.npmmirror.com/make-dir/2.1.0 make-dir: registry.npmmirror.com/make-dir/2.1.0
mime: registry.npmmirror.com/mime/1.6.0 mime: registry.npmmirror.com/mime/1.6.0
needle: registry.npmmirror.com/needle/3.1.0 needle: registry.npmmirror.com/needle/3.2.0
source-map: registry.npmmirror.com/source-map/0.6.1 source-map: registry.npmmirror.com/source-map/0.6.1
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -1409,7 +1384,7 @@ packages:
dependencies: dependencies:
'@jridgewell/set-array': registry.npmmirror.com/@jridgewell/set-array/1.1.2 '@jridgewell/set-array': registry.npmmirror.com/@jridgewell/set-array/1.1.2
'@jridgewell/sourcemap-codec': registry.npmmirror.com/@jridgewell/sourcemap-codec/1.4.14 '@jridgewell/sourcemap-codec': registry.npmmirror.com/@jridgewell/sourcemap-codec/1.4.14
'@jridgewell/trace-mapping': registry.npmmirror.com/@jridgewell/trace-mapping/0.3.14 '@jridgewell/trace-mapping': registry.npmmirror.com/@jridgewell/trace-mapping/0.3.18
dev: true dev: true
registry.npmmirror.com/@jridgewell/resolve-uri/3.1.0: registry.npmmirror.com/@jridgewell/resolve-uri/3.1.0:
@ -1441,15 +1416,6 @@ packages:
version: 1.4.14 version: 1.4.14
dev: true dev: true
registry.npmmirror.com/@jridgewell/trace-mapping/0.3.14:
resolution: {integrity: sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz}
name: '@jridgewell/trace-mapping'
version: 0.3.14
dependencies:
'@jridgewell/resolve-uri': registry.npmmirror.com/@jridgewell/resolve-uri/3.1.0
'@jridgewell/sourcemap-codec': registry.npmmirror.com/@jridgewell/sourcemap-codec/1.4.14
dev: true
registry.npmmirror.com/@jridgewell/trace-mapping/0.3.18: registry.npmmirror.com/@jridgewell/trace-mapping/0.3.18:
resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz} resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz}
name: '@jridgewell/trace-mapping' name: '@jridgewell/trace-mapping'
@ -1740,13 +1706,41 @@ packages:
version: 1.4.196 version: 1.4.196
dev: true dev: true
registry.npmmirror.com/element-plus/2.3.7_vue@3.2.47:
resolution: {integrity: sha512-h6TxclbaLUJxg/Bv5j/ZKsK+K5yadQliw5+R30HWyE69pXlqXTX24oYx+yw3pA4Dy+lqEDi5501FQ0CORk3OSA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/element-plus/-/element-plus-2.3.7.tgz}
id: registry.npmmirror.com/element-plus/2.3.7
name: element-plus
version: 2.3.7
peerDependencies:
vue: ^3.2.0
dependencies:
'@ctrl/tinycolor': 3.4.1
'@element-plus/icons-vue': 2.0.6_vue@3.2.47
'@floating-ui/dom': 1.0.10
'@popperjs/core': registry.npmmirror.com/@sxzz/popperjs-es/2.11.7
'@types/lodash': 4.14.182
'@types/lodash-es': 4.17.6
'@vueuse/core': 9.6.0_vue@3.2.47
async-validator: 4.2.5
dayjs: 1.11.4
escape-html: 1.0.3
lodash: 4.17.21
lodash-es: 4.17.21
lodash-unified: 1.0.2_3ib2ivapxullxkx3xftsimdk7u
memoize-one: 6.0.0
normalize-wheel-es: 1.2.0
vue: 3.2.47
transitivePeerDependencies:
- '@vue/composition-api'
dev: false
registry.npmmirror.com/enhanced-resolve/5.15.0: registry.npmmirror.com/enhanced-resolve/5.15.0:
resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz} resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz}
name: enhanced-resolve name: enhanced-resolve
version: 5.15.0 version: 5.15.0
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}
dependencies: dependencies:
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.10 graceful-fs: registry.npmmirror.com/graceful-fs/4.2.11
tapable: registry.npmmirror.com/tapable/2.2.1 tapable: registry.npmmirror.com/tapable/2.2.1
dev: true dev: true
@ -2062,10 +2056,10 @@ packages:
version: 0.4.1 version: 0.4.1
dev: true dev: true
registry.npmmirror.com/graceful-fs/4.2.10: registry.npmmirror.com/graceful-fs/4.2.11:
resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz} resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz}
name: graceful-fs name: graceful-fs
version: 4.2.10 version: 4.2.11
requiresBuild: true requiresBuild: true
dev: true dev: true
@ -2160,10 +2154,10 @@ packages:
dev: true dev: true
optional: true optional: true
registry.npmmirror.com/needle/3.1.0: registry.npmmirror.com/needle/3.2.0:
resolution: {integrity: sha512-gCE9weDhjVGCRqS8dwDR/D3GTAeyXLXuqp7I8EzH6DllZGXSUyxuqqLh+YX9rMAWaaTFyVAg6rHGL25dqvczKw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/needle/-/needle-3.1.0.tgz} resolution: {integrity: sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/needle/-/needle-3.2.0.tgz}
name: needle name: needle
version: 3.1.0 version: 3.2.0
engines: {node: '>= 4.4.x'} engines: {node: '>= 4.4.x'}
hasBin: true hasBin: true
requiresBuild: true requiresBuild: true
@ -2248,6 +2242,7 @@ packages:
name: source-map name: source-map
version: 0.6.1 version: 0.6.1
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
requiresBuild: true
dev: true dev: true
registry.npmmirror.com/supports-color/8.1.1: registry.npmmirror.com/supports-color/8.1.1:
@ -2335,7 +2330,7 @@ packages:
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}
dependencies: dependencies:
glob-to-regexp: registry.npmmirror.com/glob-to-regexp/0.4.1 glob-to-regexp: registry.npmmirror.com/glob-to-regexp/0.4.1
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.10 graceful-fs: registry.npmmirror.com/graceful-fs/4.2.11
dev: true dev: true
registry.npmmirror.com/webpack-sources/3.2.3: registry.npmmirror.com/webpack-sources/3.2.3:
@ -2371,7 +2366,7 @@ packages:
eslint-scope: registry.npmmirror.com/eslint-scope/5.1.1 eslint-scope: registry.npmmirror.com/eslint-scope/5.1.1
events: registry.npmmirror.com/events/3.3.0 events: registry.npmmirror.com/events/3.3.0
glob-to-regexp: registry.npmmirror.com/glob-to-regexp/0.4.1 glob-to-regexp: registry.npmmirror.com/glob-to-regexp/0.4.1
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.10 graceful-fs: registry.npmmirror.com/graceful-fs/4.2.11
json-parse-even-better-errors: registry.npmmirror.com/json-parse-even-better-errors/2.3.1 json-parse-even-better-errors: registry.npmmirror.com/json-parse-even-better-errors/2.3.1
loader-runner: registry.npmmirror.com/loader-runner/4.3.0 loader-runner: registry.npmmirror.com/loader-runner/4.3.0
mime-types: registry.npmmirror.com/mime-types/2.1.35 mime-types: registry.npmmirror.com/mime-types/2.1.35

BIN
src/assets/img/bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
src/assets/img/down_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
src/assets/img/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

BIN
src/assets/img/info_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
src/assets/img/result.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/img/up_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

9
src/assets/style/index.less

@ -67,7 +67,7 @@
input{ input{
font-size:18px; font-size:18px;
height:40px!important; height:40px!important;
width:60px; width:var(--w, 66px);
font-weight: bold!important; font-weight: bold!important;
&::-webkit-input-placeholder{ &::-webkit-input-placeholder{
color:#fff; color:#fff;
@ -127,6 +127,7 @@
--el-text-color-regular:#999; --el-text-color-regular:#999;
--el-color-primary:#179795; --el-color-primary:#179795;
.el-date-range-picker{ .el-date-range-picker{
--el-datepicker-icon-color:#03FAF6;
--el-datepicker-off-text-color:#999!important; --el-datepicker-off-text-color:#999!important;
--el-datepicker-inrange-bg-color:#19a7a4; --el-datepicker-inrange-bg-color:#19a7a4;
--el-datepicker-active-color:#03FAF6; --el-datepicker-active-color:#03FAF6;
@ -160,3 +161,9 @@
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.over{
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
}

7
src/config/request.js

@ -1,10 +1,11 @@
import axios from 'axios' import axios from 'axios'
import store from "@/store" import store from "@/store"
export const host=function(host="default", suffix='plant_manage'){ export const host=function(host="default", suffix='Time'){
var url=process.env.NODE_ENV === 'development'?{ var url=process.env.NODE_ENV === 'development'?{
// default:`http://i5skii.natappfree.cc` // default:`http://i5skii.natappfree.cc`
default:"http://127.0.0.1:7000" // default:"http://127.0.0.1:7000"
default:"http://218.206.53.232:10927"
}:{ }:{
default:`` default:``
} }
@ -27,7 +28,7 @@ service.interceptors.request.use( config => {
if(config.proxy){ if(config.proxy){
config.baseURL=`/${config.proxy}` config.baseURL=`/${config.proxy}`
}else{ }else{
config.baseURL=host(config.host) config.baseURL=host(config.host,config.suffix)
} }
if (typeof config.pathData === 'object') { if (typeof config.pathData === 'object') {

368
src/view/home.vue

@ -3,21 +3,12 @@
.content{ .content{
height:100%; height:100%;
position:relative; position:relative;
&>.search{
position:absolute;
top:100px;
left:40px;
display:flex;
align-items: center;
&>div{
margin-right:20px;
}
}
&>.time{ &>.time{
position:absolute; position:absolute;
display:flex; display:flex;
align-items: center; align-items: center;
top:50%; top:calc(50% + 24px);
left:40px; left:40px;
&:before{ &:before{
content:""; content:"";
@ -33,6 +24,88 @@
transform: translateX(-5px); transform: translateX(-5px);
} }
} }
&>.info{
position:absolute;
top:240px;
left:40px;
width:276px;
height:213px;
background-image:url(@/assets/img/info_bg.png);
background-size:100% 100%;
.title{
font-size:16px;
font-weight: bold;
color:#fff;
text-align: center;
padding-bottom:5px;
margin-top:20px;
background-image:linear-gradient(#067276,#067276);
background-repeat: no-repeat;
background-size:90px 12px;
background-position:center 10px;
}
&>.dv-scroll-board{
height: 97px;
margin-top: 10px;
&:deep .ceil:first-child{
color:#03FAF6;
}
}
}
&>.result{
height:244px;
width:383px;
position:absolute;
bottom: 122px;
right: 42px;
background-image:url(@/assets/img/result.png);
.title{
font-size:16px;
font-weight: bold;
color:#fff;
text-align: center;
padding-bottom:5px;
margin-top:40px;
background-image:linear-gradient(#067276,#067276);
background-repeat: no-repeat;
background-size:90px 12px;
background-position:center 10px;
}
span{
position:absolute;
width: 155px;
height: 92px;
display:flex;
flex-direction: column;
justify-content: space-between;
padding:20px;
color:#fff;
font-weight: bold;
text-shadow: 0 0 5px #fff;
&:before{
content:attr(data-title);
color:#03FAF6;
font-size:16px;
font-weight: normal;
text-shadow: none;
}
&.amount{
top:98px;
left:28px;
}
&.num{
top:98px;
left:203px;
}
}
}
&>.echarts{
position:absolute;
top: 216px;
left: 125px;
width: 1650px;
height: 757px;
}
} }
} }
</style> </style>
@ -40,19 +113,18 @@
<container :bg="require('@/assets/img/bg.png')"> <container :bg="require('@/assets/img/bg.png')">
<template #ready> <template #ready>
<div class="content"> <div class="content">
<div class="search"> <search v-model="roomId" v-model:date="date"/>
<el-select v-model="demo" popper-class="search-popper">
<el-option :value="1" label="1"/>
<el-option :value="2" label="2"/>
</el-select>
<el-date-picker
popper-class="date-popper"
type="daterange"
start-placeholder="开始时间"
end-placeholder="结束时间"
v-model="date"/>
</div>
<div class="time"/> <div class="time"/>
<div class="info">
<div class="title">房间人员信息</div>
<dvScrollBoard ref="scrollBoard" :config="config"/>
</div>
<div class="result">
<div class="title">本次查询结果</div>
<span class="amount" data-title="当前欠款()">{{data?.chargeAmount||0}}</span>
<span class="num" data-title="工单统计()">{{data?.workOrderCount||0}}</span>
</div>
<v-echarts :option="option" autoresize ref="echart" @click="down('click')" @mousedown="mouseDown=false" @mouseup="mouseDown=true"/>
</div> </div>
</template> </template>
</container> </container>
@ -60,15 +132,253 @@
<script setup> <script setup>
import request from '@/config/request' import request from '@/config/request'
import { computed, inject, onMounted, onUnmounted, reactive, ref, shallowRef, watch } from 'vue' import { computed, inject, onMounted, onUnmounted, reactive, ref, shallowRef, watch } from 'vue'
import search from './search.vue'
var event = inject("event") var msg=inject("msg")
var route=inject("route")
var {commit,getters}=inject('store')
var demo=ref("") var roomId=ref('1603212861432179257')
var date=ref([]) var date=ref(null)
onMounted(async ()=>{ var scrollBoard=ref()
var config=reactive({
data:[],
rowNum:5,
columnWidth:[139, 139],
align:['center','center'],
oddRowBGC:"transpatent",
evenRowBGC:"transpatent",
})
var data=shallowRef({})
var upData=computed(()=>data.value?.timeInfo?.slice(0,16)?.filter?.((v,k)=>k%2==1)||[])
var downData=computed(()=>data.value?.timeInfo?.slice(0,16)?.filter?.((v,k)=>k%2==0)||[])
function color(status){
if(/已收款/.test(status))return "#1CF162"
if(/已逾期|已退款|已收部分|已退部分/.test(status))return "#F11C35"
if(/待收款|待退款|待派单|待检测|检查中|待定价|待付款|待维修|维修中|待复检/.test(status))return "#FFFF00"
if(/已完成|已关闭/.test(status))return "#0784EF"
}
var option=computed(()=>({
dataZoom:{
type:"inside",
startValue:0,
endValue:5,
xAxisIndex: [0,1],
zoomOnMouseWheel:false,
moveOnMouseMove:true,
moveOnMouseWheel:true,
},
grid:[
{
top:0,
right:90,
bottom:0,
left:200,
containLabel:true,
},
{
top:0,
right:280,
bottom:0,
left:0,
containLabel:true,
},
],
xAxis: [
{
type: 'category',
gridIndex:0,
axisLine:{show:false},
axisTick:{show:false},
axisLabel:{show:false},
// max:4,
data: upData.value.map(v=>'')
},
{
type: 'category',
gridIndex:1,
axisLine:{show:false},
axisTick:{show:false},
axisLabel:{show:false},
// max:4,
data: downData.value.map(v=>'')
}
],
yAxis: [
{
type: 'value',
gridIndex:0,
min:-200,
max:200,
splitLine:{show:false},
axisLabel:{show:false},
},{
type: 'value',
gridIndex:1,
min:-200,
max:200,
splitLine:{show:false},
axisLabel:{show:false},
}
],
series: [
{
type: 'bar',
xAxisIndex: 0,
yAxisIndex: 0,
data: upData.value.map(v=>{
return{
value:0,
label:{
show:true,
offset:[0,-150],
borderColor:"#03FAF6",
backgroundColor:{
image:require("@/assets/img/up_bg.png"),
},
width:210,
height:310,
formatter(){
return `{title|${new Date(v.date).format('yyyy年MM月dd日')}}\n {icon|} {amount|${v.name}} {type|${v.status}} {date|}`
},
rich:{
title:{
color:"#03FAF6",
fontWeight:"bold",
align:"center",
width:200,
height:70,
fontSize:20,
padding:[0,0,0,0],
},
icon:{
backgroundColor:{
width:10,
height:10,
image:require("@/assets/img/icon.png"),
}
},
amount:{
color:"#fff",
fontSize:15,
height:10,
},
type:{
fontSize:15,
color: color(v.status),
},
date:{
fontSize:13,
color:"#63868B",
},
},
},
}
}),
},
{
type: 'bar',
xAxisIndex: 1,
yAxisIndex: 1,
data: downData.value.map(v=>{
return{
value:0,
label:{
show:true,
offset:[0,150],
borderColor:"#03FAF6",
backgroundColor:{
image:require("@/assets/img/down_bg.png"),
},
width:210,
height:310,
formatter(){
return `{up|}\n{title|${new Date(v.date).format('yyyy年MM月dd日')}}\n {icon|} {amount|${v.name}} {type|${v.status}} {date|}`
},
rich:{
up:{
padding:[195,0,0,0],
},
title:{
color:"#03FAF6",
fontWeight:"bold",
align:"center",
width:200,
height:70,
fontSize:20,
},
icon:{
backgroundColor:{
width:10,
height:10,
image:require("@/assets/img/icon.png"),
}
},
amount:{
color:"#fff",
fontSize:14,
height:10,
},
type:{
fontSize:15,
color: color(v.status),
},
date:{
fontSize:12,
color:"#63868B",
},
},
},
}
}),
}
]
}))
var mouseDown=ref(false)
//
watch(roomId, async n=>{
var res=await request("/roomRelationPerson",{
method:"post",
params:{roomId:n}
})
if(res.statu){
scrollBoard.value.updateRows(res.data.map(v=>[v.userName, v.userPhone.replace(/^(\d\d\d).+(\d\d\d\d)$/,'$1****$2')]))
}else{
msg.error(res.msg||"获取房间住户失败!")
}
})
watch(()=>({
roomId:roomId.value,
startDate:date.value?.[0]?.format?.('yyyy-MM-dd')||'',
endDate:date.value?.[1]?.format?.('yyyy-MM-dd')||''
}), async n=>{
if(n.roomId && n.startDate && n.endDate){
var res=await request("/timeInfo",{
method:"post",
params:n
})
if(res.statu){
data.value=res.data
}else{
msg.error(res.msg||"获取费用工单失败!")
}
}
})
var echart=ref()
onMounted(()=>{
setInterval(()=>{
if(downData.value.length>6 && !mouseDown.value){
var start=(echart.value?.getOption?.()?.dataZoom?.[0]?.startValue||0)+1
if(downData.value.length<start+6)start=0
echart.value.dispatchAction({
type:"dataZoom",
startValue: start,
endValue: start+5
})
}
},5000)
}) })
</script> </script>

194
src/view/search.vue

@ -0,0 +1,194 @@
<style lang="less" scoped>
.search{
position:absolute;
top:120px;
left:40px;
display:flex;
align-items: center;
&>div{
margin-right:20px;
}
}
</style>
<template>
<div class="search">
<el-select
filterable
remote
reserve-keyword
:remote-method="getVillage"
:loading="loading"
v-model="formData.villageId"
popper-class="search-popper"
placeholder="选择小区">
<el-option v-for="(v,k) in villageList" :key="k" :value="v.projectId" :label="v.name"/>
</el-select>
<el-select v-model="formData.buildId" popper-class="search-popper" placeholder="选择楼栋">
<el-option v-for="(v,k) in buildList" :key="k" :value="v.buildId" :label="v.buildName"/>
</el-select>
<el-select v-model="formData.unitId" popper-class="search-popper" placeholder="选择单元">
<el-option v-for="(v,k) in unitList" :key="k" :value="v.unitId" :label="v.unitName"/>
</el-select>
<el-select v-model="formData.floorId" popper-class="search-popper" placeholder="选择楼层">
<el-option v-for="(v,k) in floorList" :key="k" :value="v.floorId" :label="v.floorName"/>
</el-select>
<el-select
v-model="formData.roomId"
@change="emit('update:modelValue',$event);formData.userId=''"
popper-class="search-popper"
placeholder="选择房间">
<el-option v-for="(v,k) in roomList" :key="k" :value="v.roomId" :label="v.roomName"/>
</el-select>
<el-select
filterable
remote
reserve-keyword
:remote-method="person"
:loading="loading"
v-model="formData.userId"
popper-class="search-popper"
style="--w:80px;"
value-key="userName"
@change="emit('update:modelValue',$event.roomId);formData.roomId=''"
placeholder="请输入住户">
<el-option class="user" v-for="(v,k) in personList" :key="k" :value="v" :label="v.userName">
<span style="float:left;margin-right:20px;">{{v.userName}}</span>
<span class="over" style="float:right;max-width:210px;over">{{v.address}}</span>
</el-option>
</el-select>
<el-date-picker
popper-class="date-popper"
type="daterange"
:clearable="false"
start-placeholder="开始时间"
end-placeholder="结束时间"
v-model="date"
@change="emit('update:date',$event)"/>
</div>
</template>
<script setup>
import request from '@/config/request'
import { inject, onMounted, reactive, ref, shallowRef, watch } from "vue"
var emit=defineEmits()
var msg=inject("msg")
var demo=ref([])
var formData=reactive({
villageId:"",
buildId:"",
unitId:"",
floorId:"",
roomId:"",
userId:"",
})
var date=ref([])
var loading=ref(false)
var villageList=shallowRef([])
var buildList=shallowRef([])
var unitList=shallowRef([])
var floorList=shallowRef([])
var roomList=shallowRef([])
var personList=shallowRef([])
//
async function getVillage(e){
if(e){
loading.value=true
var res=await request("/project",{
method:"post",
params:{projectName:e}}
)
loading.value=false
if(res.statu){
villageList.value=res.data
}else{
msg.error(res.msg||"获取小区失败!")
}
}
}
//
watch(()=>formData.villageId, async n=>{
var res=await request("/build",{
method:"post",
params:{
projectId:n,
buildName:'',
}
})
if(res.statu){
buildList.value=res.data
}else{
msg.error(res.msg||"获取小区楼栋失败!")
}
})
//
watch(()=>formData.buildId, async n=>{
var res=await request("/unit",{
method:"post",
params:{
buildId:n,
unitName:"",
}
})
if(res.statu){
unitList.value=res.data
}else{
msg.error(res.msg||"获取单元失败!")
}
})
//
watch(()=>formData.unitId, async n=>{
var res=await request("/floor",{
method:"post",
params:{
unitId:n,
floorName:"",
}
})
if(res.statu){
floorList.value=res.data
}else{
msg.error(res.msg||"获取楼层失败!")
}
})
//
async function person(e){
if(e){
loading.value=true
var res=await request("/roomRelationPerson",{
method:"post",
params:{userName:e}
})
loading.value=false
if(res.statu){
personList.value=res.data.map(v=>({
...v,
id:`${v.userPhone}_${Math.random()}_${v.roomId}`
}))
}else{
msg.error(res.msg||"获取住户失败!")
}
}
}
//
watch(()=>formData.floorId, async n=>{
formData.roomId=''
var res=await request("/room",{
method:"post",
params:{
floorId:n,
roomName:"",
}
})
if(res.statu){
roomList.value=res.data
}else{
msg.error(res.msg||"获取房间失败!")
}
})
onMounted(async ()=>{
})
</script>
Loading…
Cancel
Save