|
|
@ -1,11 +1,18 @@ |
|
|
|
<template> |
|
|
|
<BorderRadiusImage class='RoadStateCard' borderRadius="2px" |
|
|
|
borderColor="linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0))" borderWidth="2px"> |
|
|
|
<BorderRadiusImage |
|
|
|
class="RoadStateCard" |
|
|
|
borderRadius="2px" |
|
|
|
borderColor="linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0))" |
|
|
|
borderWidth="2px" |
|
|
|
> |
|
|
|
<div class="left"> |
|
|
|
<!-- <img :src="(cardData.pictures ? cardData.pictures[0] : null) || require(`./test.png`)"> --> |
|
|
|
<!-- <img :src="require(`./test.png`)"> --> |
|
|
|
<ElImage style="width: 212px; height: 159px;" :src="cardData.pictures ? cardData.pictures[0] : null" |
|
|
|
:preview-src-list="cardData.pictures || []"> |
|
|
|
<ElImage |
|
|
|
style="width: 212px; height: 159px" |
|
|
|
:src="cardData.pictures ? cardData.pictures[0] : null" |
|
|
|
:preview-src-list="cardData.pictures || []" |
|
|
|
> |
|
|
|
<div slot="error"> |
|
|
|
<i class="el-icon-picture-outline icon"></i> |
|
|
|
</div> |
|
|
@ -19,27 +26,35 @@ |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<div class="controls"> |
|
|
|
<Button :style="{ background: firstBtnColor, width: '50%' }" |
|
|
|
@click.native="$emit('firstBtnClick', cardData.id)">{{ |
|
|
|
getFirstBtnText(cardData.state) |
|
|
|
}}</Button> |
|
|
|
<Button v-if="cardData.state == 4" :style="{ background: lastBtnColor, width: '50%' }" |
|
|
|
@click.native="$emit('lastBtnClick', cardData.id)">{{ getLastBtnText(cardData.state) |
|
|
|
}}</Button> |
|
|
|
<Button |
|
|
|
:style="{ background: firstBtnColor, width: '50%' }" |
|
|
|
@click.native="$emit('firstBtnClick', cardData.id)" |
|
|
|
>{{ getFirstBtnText(cardData.state) }}</Button |
|
|
|
> |
|
|
|
<Button |
|
|
|
v-if="cardData.state == 4" |
|
|
|
:style="{ background: lastBtnColor, width: '50%' }" |
|
|
|
@click.native="$emit('lastBtnClick', cardData.id)" |
|
|
|
>{{ getLastBtnText(cardData.state) }}</Button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<img v-if="cardData.state" class="status" :src="require(`./images/${statusMap[cardData.state]}.svg`) " /> |
|
|
|
<img |
|
|
|
v-if="cardData.state" |
|
|
|
class="status" |
|
|
|
:src="require(`./images/${statusMap[cardData.state]}.svg`)" |
|
|
|
/> |
|
|
|
</BorderRadiusImage> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import Button from "@screen/components/Buttons/Button.vue"; |
|
|
|
import BorderRadiusImage from "@screen/components/BorderRadiusImage.vue"; |
|
|
|
import { statusMap } from "./data.js" |
|
|
|
import { statusMap } from "./data.js"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'RoadStateCard', |
|
|
|
name: "RoadStateCard", |
|
|
|
props: { |
|
|
|
cardData: { |
|
|
|
type: Object, |
|
|
@ -48,80 +63,80 @@ export default { |
|
|
|
source: "视频智能识别", |
|
|
|
location: "k100+000", |
|
|
|
direction: "济南方向", |
|
|
|
}) |
|
|
|
}), |
|
|
|
}, |
|
|
|
firstBtnText: { |
|
|
|
type: String, |
|
|
|
default: "详情" |
|
|
|
default: "详情", |
|
|
|
}, |
|
|
|
lastBtnText: { |
|
|
|
type: String, |
|
|
|
default: "调度记录" |
|
|
|
default: "调度记录", |
|
|
|
}, |
|
|
|
firstBtnColor: { |
|
|
|
type: String, |
|
|
|
default: "#00B3CC" |
|
|
|
default: "#00B3CC", |
|
|
|
}, |
|
|
|
lastBtnColor: { |
|
|
|
type: String, |
|
|
|
default: "#CB7A00" |
|
|
|
default: "#CB7A00", |
|
|
|
}, |
|
|
|
keyMap: { |
|
|
|
type: Array, |
|
|
|
default: () => ([ |
|
|
|
default: () => [ |
|
|
|
{ |
|
|
|
key: "stringEventType", |
|
|
|
label: "事件" |
|
|
|
label: "事件", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "stringEventSource", |
|
|
|
label: "来源" |
|
|
|
label: "来源", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "stakeMark", |
|
|
|
label: "位置" |
|
|
|
label: "位置", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "stringDirection", |
|
|
|
label: "方向" |
|
|
|
label: "方向", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "startTime", |
|
|
|
label: "时间" |
|
|
|
label: "时间", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
]) |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
picUrl: './test.png' |
|
|
|
} |
|
|
|
picUrl: "./test.png", |
|
|
|
}; |
|
|
|
}, |
|
|
|
emit: ['firstBtnClick', "lastBtnClick"], |
|
|
|
emit: ["firstBtnClick", "lastBtnClick"], |
|
|
|
components: { |
|
|
|
Button, |
|
|
|
BorderRadiusImage |
|
|
|
BorderRadiusImage, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.statusMap = statusMap; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getFirstBtnText(state) { |
|
|
|
let text = '详情'; |
|
|
|
if (state == 5) text = '去确认' |
|
|
|
if (state == 4) text = '详情' |
|
|
|
if (state == 3) text = '处置记录' |
|
|
|
let text = "详情"; |
|
|
|
if (state == 5) text = "去确认"; |
|
|
|
if (state == 4) text = "详情"; |
|
|
|
if (state == 3) text = "处置记录"; |
|
|
|
return text; |
|
|
|
}, |
|
|
|
getLastBtnText(state) { |
|
|
|
let text = '去处置'; |
|
|
|
let text = "去处置"; |
|
|
|
return text; |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.RoadStateCard { |
|
|
|
color: #fff; |
|
|
|
display: flex; |
|
|
@ -143,7 +158,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.icon { |
|
|
|
display:inline-block; |
|
|
|
display: inline-block; |
|
|
|
width: 212px; |
|
|
|
height: 159px; |
|
|
|
line-height: 157px; |
|
|
@ -165,13 +180,13 @@ export default { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
>p { |
|
|
|
> p { |
|
|
|
font-size: 12px; |
|
|
|
color: #f4f4f4; |
|
|
|
line-height: 24px; |
|
|
|
|
|
|
|
&:nth-child(-n+2) { |
|
|
|
color: #37E7FF; |
|
|
|
&:nth-child(-n + 2) { |
|
|
|
color: #37e7ff; |
|
|
|
font-size: 16px; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
@ -179,7 +194,6 @@ export default { |
|
|
|
&:nth-child(2) { |
|
|
|
margin-bottom: 3px; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.linText { |
|
|
@ -198,7 +212,7 @@ export default { |
|
|
|
display: flex; |
|
|
|
gap: 9px; |
|
|
|
|
|
|
|
>div { |
|
|
|
> div { |
|
|
|
// flex: 1; |
|
|
|
} |
|
|
|
} |
|
|
|