parent
ab152ab5d1
commit
f854236359
@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div>
|
||||
<Modal v-model="dialogVisible" title="详情" width='70%'>
|
||||
<div class="itemWrap">
|
||||
<template v-for="(item,index) in formInfo">
|
||||
<template v-if='item.form_show==1'>
|
||||
<template v-if="item.field!='uploads'">
|
||||
<div class="itemField">
|
||||
<span>{{item.name}}:</span>
|
||||
<span>{{form[item.field]}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="itemField">
|
||||
<span>{{item.name}}:</span>
|
||||
<span v-if="typeof form['uploads_uploads_id_relation']==='object'">
|
||||
<a style='color:red' target="_blank" :href="form['uploads_uploads_id_relation']['url']">{{form['uploads_uploads_id_relation']['original_name']}}</a>
|
||||
</span>
|
||||
<span v-if="typeof form['uploads_uploads_id_relation']==='array'">
|
||||
<template v-for="(upload,index) in form['uploads_uploads_id_relation']">
|
||||
<a style='color:red;width:100%' target="_blank" :href="upload.url">{{upload.original_name}}</a>
|
||||
</template>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
<template slot='footer'>
|
||||
<Button size="large" @click="closeDia">关闭</Button>
|
||||
</template>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
show
|
||||
} from "@/api/system/baseForm";
|
||||
export default {
|
||||
props: {
|
||||
formInfo: {
|
||||
type: Array,
|
||||
default: ()=>[],
|
||||
},
|
||||
tableName: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
dialogVisible: false,
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogVisible(newval) {
|
||||
if (newval) {
|
||||
this.getDetail()
|
||||
} else {
|
||||
this.id = ''
|
||||
this.form = {}
|
||||
// this.formInfo = []
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
show() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
closeDia(){
|
||||
this.dialogVisible = false
|
||||
},
|
||||
setId(id) {
|
||||
if (typeof id == "number") {
|
||||
this.id = id;
|
||||
} else {
|
||||
console.error("error typeof id: " + typeof id);
|
||||
}
|
||||
},
|
||||
async getDetail() {
|
||||
const res = await show({
|
||||
id: this.id,
|
||||
table_name: this.tableName
|
||||
});
|
||||
this.form = res;
|
||||
// uploads_uploads_id_relation
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.itemWrap {
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
}
|
||||
|
||||
.itemWrap>div {
|
||||
width: 50%;
|
||||
padding: 5px 10px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.itemField span:first-child {
|
||||
text-align: right;
|
||||
margin-right: 10px;
|
||||
width: 30%;
|
||||
display: inline-block;
|
||||
}
|
||||
.itemField span:last-child{
|
||||
width:60%;
|
||||
display:inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue