Files
laws_weilai/jero-web/src/views/processCenter/components/projectInformation.vue
T

141 lines
3.1 KiB
Java

<template>
<div class="box">
<div class="box-text">
<div class="header-text">
{{$t('essentialInformation')}}
</div>
</div>
<div class="content-text">
<div class="text-field" v-for="(item,index) in projectInformationList" :key="index">
<span class="text-field-left" :title="item.title">{{item.title}}</span>
<span class="text-field-right text-field-right-url"
:title="queryForm[item.value]"
@click="urlClick(queryForm[item.value])"
v-if="item.type == 1"
>{{queryForm[item.value]}}</span>
<span class="text-field-right" v-else :title="queryForm[item.value]"
>{{queryForm[item.value]}}</span>
</div>
</div>
</div>
</template>
<!--
type:
1打开新页面
2显示文件
3点击事件处理\需要传点击事件
-->
<script>
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
export default {
name: 'projectInformation',
props: {
// {title:'',value:'v-model的绑定值'}
projectInformationList: {
type: Array,
default: []
},
// 需要参数urlFrom,获取数据去显示内容
url: {
type: Object,
default: {}
},
projectInformationId: {
type: String,
default: ''
},
queryProject: {
type: Object,
default: {}
}
},
data() {
return {
queryForm: {}
}
},
mounted() {
this.getQueryForm()
},
methods: {
getQueryForm() {
getAction(this.url.urlFrom, { id: this.projectInformationId }).then((res) => {
if (res.success) {
this.queryForm = res.result[0] || {}
if (this.queryProject) {
this.queryForm = { ...this.queryForm, ...this.queryProject }
}
} else {
this.queryForm = {}
}
})
},
urlClick(val) {
if (val) {
window.open(val)
}
}
}
}
</script>
<style scoped lang="less">
.box {
padding: 0 24px 24px 24px;
box-sizing: border-box;
}
.box-text {
display: flex;
justify-content: space-between;
height: 80px;
line-height: 80px;
.header-text {
font-size: 16px;
font-weight: 400;
color: #000F16;
}
}
.content-text {
width: 100%;
display: flex;
flex-wrap: wrap;
.text-field {
width: 33%;
margin-bottom: 8px;
.text-field-left {
width: 124px;
display: inline-block;
font-size: 14px;
font-weight: 400;
color: #6F7385;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
margin-right: 24px;
}
.text-field-right {
width: calc(100% - 200px);
display: inline-block;
font-size: 16px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: #040B29;
font-weight: 400;
}
.text-field-right-url {
color: #00B3BE !important;
cursor: pointer;
}
}
}
</style>