2024-12-11 21:05:49 +08:00
|
|
|
<template>
|
|
|
|
|
<div v-if="data.isImage()" class="property-image">
|
2025-01-08 11:55:27 +08:00
|
|
|
<div class="box" v-if="data.data">
|
2025-01-07 17:52:21 +08:00
|
|
|
<img :src="data.data" alt="图片" @click="onClickImg" class="img" />
|
2024-12-11 21:05:49 +08:00
|
|
|
</div>
|
2025-01-08 11:55:27 +08:00
|
|
|
<div class="url" :title="data.desc">{{ data.desc }}</div>
|
2024-12-11 21:05:49 +08:00
|
|
|
<i class="print iconfont icon_print" @click="onShowValueInConsole"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2025-01-07 17:52:21 +08:00
|
|
|
import { defineComponent, PropType, toRaw } from "vue";
|
2024-12-11 21:05:49 +08:00
|
|
|
import { ImageData } from "../data";
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: "property-image",
|
|
|
|
|
props: {
|
|
|
|
|
data: {
|
|
|
|
|
type: Object as PropType<ImageData>,
|
|
|
|
|
default: () => new ImageData().test(),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
setup(props) {
|
|
|
|
|
return {
|
2025-01-07 17:52:21 +08:00
|
|
|
onClickImg() {
|
|
|
|
|
const url = toRaw(props.data.data);
|
|
|
|
|
if (url && url.startsWith("http")) {
|
|
|
|
|
window.open(url);
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-11 21:05:49 +08:00
|
|
|
onShowValueInConsole() {
|
|
|
|
|
if (Array.isArray(props.data.path)) {
|
|
|
|
|
let uuid = props.data.path[0];
|
|
|
|
|
let key = props.data.path[1]; // todo 暂时只支持一级key
|
|
|
|
|
if (uuid && key) {
|
|
|
|
|
chrome.devtools.inspectedWindow.eval(`window.CCInspector.logValue('${uuid}','${key}')`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
.property-image {
|
|
|
|
|
display: flex;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
flex: 1;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
height: 30px;
|
2025-01-07 17:52:21 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
|
border: 1px solid #409eff;
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
margin-right: 2px;
|
2024-12-11 21:05:49 +08:00
|
|
|
.box {
|
2025-01-07 17:52:21 +08:00
|
|
|
overflow: hidden;
|
|
|
|
|
box-sizing: border-box;
|
2024-12-11 21:05:49 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
min-width: 80px;
|
|
|
|
|
width: 80px;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
.img {
|
2025-01-07 17:52:21 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
padding: 2px 0;
|
2024-12-11 21:05:49 +08:00
|
|
|
height: 30px;
|
|
|
|
|
width: 30px;
|
2025-01-07 17:52:21 +08:00
|
|
|
box-sizing: border-box;
|
2024-12-11 21:05:49 +08:00
|
|
|
object-fit: contain;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.url {
|
2025-01-08 11:55:27 +08:00
|
|
|
flex: 1;
|
2024-12-11 21:05:49 +08:00
|
|
|
color: white;
|
|
|
|
|
font-weight: normal;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
|
|
|
|
.print {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
color: #d2d2d2;
|
|
|
|
|
&:hover {
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
}
|
|
|
|
|
&:active {
|
|
|
|
|
color: #ffaa00;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|