Commit 2e95b6bd authored by 郭铭瑶's avatar 郭铭瑶 🤘

A013加装电梯筛选数据及emit出弹窗

parent 7f6ca88b
......@@ -32,6 +32,13 @@ function copyName(name) {
document.execCommand('Copy')
document.body.removeChild(input)
}
document.addEventListener('dblclick', (e) => {
console.log(e)
console.log(e.target?._uid)
e.target?.classList?.add('need-update')
// e.target.innerText = 'test'
})
</script>
<style lang="stylus" scoped>
......@@ -94,7 +101,7 @@ html, body
width 100%
height 100%
user-select none
font-size 16vh
font-size 15vh
line-height 1.5
p
margin 0
......
......@@ -29,7 +29,7 @@
</div>
<div class="content">
<template v-if="list.length > 0">
<div v-for="(item, i) in list" :key="i">
<div v-for="(item, i) in list" :key="i" @click.stop="onClick(item)">
<span>{{ i + 1 }}</span>
<span :title="item.name">{{ item.name }}</span>
<span :title="item.address">{{ item.address }}</span>
......@@ -54,9 +54,11 @@ const _config = {
export default _config
</script>
<script lang="ts" setup>
import { ref } from 'vue'
import { ref, watch } from 'vue'
import { NSpace, NSelect } from 'naive-ui'
import { ajax } from '@/ajax'
import bus from '@/util/event-bus'
const tabs = [
{ name: '开工项目', key: '6' },
{ name: '竣工项目', key: '7' },
......@@ -75,6 +77,7 @@ function selectTab(key) {
const areaOptions = ref([{ label: '全区', value: 'all' }])
// const year = ref('2021')
const area = ref('all')
watch(() => area.value, fetchList)
ajax
.get({
url: _config.apis.streets,
......@@ -125,6 +128,7 @@ function fetchList() {
}
}
list.value = (res?.data?.content || []).map((item) => ({
...item,
name: item.stNameFrst,
address: item.unitAddr,
status: switchType(item.evaluateType),
......@@ -132,6 +136,10 @@ function fetchList() {
})
}
fetchList()
function onClick(data) {
bus.emit('elevatorInfo', data)
}
</script>
<style lang="stylus" scoped>
......@@ -164,6 +172,9 @@ fetchList()
justify-content space-between
align-items center
padding .04rem .06rem
cursor pointer
&:hover
box-shadow none
&+div
margin-top .05rem
>span
......
......@@ -127,15 +127,16 @@ const list = ref<any[]>([
{ name: '小梁薄板', value: 0 },
])
async function onClick({ query, icon }) {
const data =
(
await ajax.get({
url: _config.apis.list,
params: { pageSize: 9000, createTime_desc: 'desc', ...query },
})
)?.data?.content || []
bus.emit('addPoints', { data, icon, size: 12 })
function onClick({ query, icon }) {
ajax
.get({
url: _config.apis.list,
params: { pageSize: 9000, createTime_desc: 'desc', ...query },
})
.then((res) => {
const data = res?.data?.content || []
bus.emit('addPoints', { data, icon, size: 12 })
})
}
</script>
......
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