74 lines
2.0 KiB
Vue
74 lines
2.0 KiB
Vue
<template>
|
|
<el-dialog
|
|
v-dialogDrag
|
|
:title="mapInfo.name + ' / ' + name + ' / ' + title"
|
|
:visible.sync="show"
|
|
width="30%"
|
|
:before-close="doClose"
|
|
center
|
|
append-to-body
|
|
>
|
|
<el-table :data="data" border style="width: 100%">
|
|
<template v-for="(item, index) in form">
|
|
<el-table-column :key="index" :label="item.label">
|
|
<template slot-scope="scope">
|
|
<template v-if="item.type === 'select'">
|
|
<el-tooltip effect="dark" :content="item.options[scope.row[item.prop]]" placement="top">
|
|
<span>{{ item.options[scope.row[item.prop]] }}</span>
|
|
</el-tooltip>
|
|
</template>
|
|
<template v-if="item.type === 'text'">
|
|
<el-tooltip effect="dark" :content="scope.row[item.prop]" placement="top">
|
|
<span>{{ scope.row[item.prop] }}</span>
|
|
</el-tooltip>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</template>
|
|
</el-table>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'DictionaryDetailEdit',
|
|
props: {
|
|
mapInfo: {
|
|
type: Object,
|
|
default() {
|
|
return null;
|
|
}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
show: false,
|
|
title: '',
|
|
name: '',
|
|
form: [],
|
|
data: []
|
|
};
|
|
},
|
|
methods: {
|
|
doShow(fieldList, dataList) {
|
|
if (fieldList.model) {
|
|
const items = fieldList.model.items;
|
|
if (fieldList.model.convert) {
|
|
// data = fieldList.model.convert(data);
|
|
}
|
|
if (items) {
|
|
this.form = items;
|
|
this.name = fieldList.name;
|
|
this.data = dataList;
|
|
this.title = fieldList.title;
|
|
}
|
|
this.show = true;
|
|
}
|
|
},
|
|
doClose(done) {
|
|
this.show = false;
|
|
}
|
|
}
|
|
};
|
|
</script>
|