perf: 资产详情-授权用户没有数据时显示暂无数据

This commit is contained in:
“huailei000”
2022-09-15 17:32:59 +08:00
committed by Jiangjie.Bai
parent 3536a94976
commit 82faf0f99e

View File

@@ -1,18 +1,40 @@
<template> <template>
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs"> <IBox
<table style="width: 100%;table-layout:fixed;" class="CardTable"> :fa="icon"
<tr v-for="obj of iObjects" :key="obj.value" class="item"> :type="type"
<td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"> :title="title"
<el-tooltip style="margin: 4px;" effect="dark" :content="obj.label" placement="left"> v-bind="$attrs"
<el-link class="detail" @click="goDetail(obj)">{{ obj.label }}</el-link> >
</el-tooltip> <table class="card-table">
</td> <div v-if="iObjects.length > 0" v-cloak>
<td> <tr v-for="obj of iObjects" :key="obj.value" class="item">
<el-button size="mini" type="primary" style="float: right" @click="buttonClickCallback(obj)"> <td>
{{ buttonTitle }} <el-tooltip
</el-button> style="margin: 4px;"
</td> effect="dark"
</tr> :content="obj.label"
placement="left"
>
<el-link class="detail" @click="goDetail(obj)">
{{ obj.label }}
</el-link>
</el-tooltip>
</td>
<td>
<el-button
size="mini"
type="primary"
style="float: right"
@click="buttonClickCallback(obj)"
>
{{ buttonTitle }}
</el-button>
</td>
</tr>
</div>
<div v-else v-cloak style="text-align: center;">
{{ $t('common.NoData') }}
</div>
</table> </table>
</IBox> </IBox>
</template> </template>
@@ -71,9 +93,9 @@ export default {
methods: { methods: {
async loadObjects() { async loadObjects() {
const data = await this.$axios.get(this.url) const data = await this.$axios.get(this.url)
data.forEach((v) => { for (const v of data) {
v['label'] = v['name'] v['label'] = v['name']
}) }
this.objects = data this.objects = data
}, },
goDetail(obj) { goDetail(obj) {
@@ -84,18 +106,26 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card-table {
width: 100%;
table-layout:fixed;
}
[v-cloak]{
display: none!important;
}
b, strong { b, strong {
font-weight: 700; font-weight: 700;
font-size: 13px; font-size: 13px;
} }
tr td { tr td {
line-height: 1.42857; line-height: 1.42857;
padding: 8px; padding: 8px;
vertical-align: top; vertical-align: top;
display: inline; display: inline;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
tr.item { tr.item {
border-bottom: 1px solid #e7eaec; border-bottom: 1px solid #e7eaec;
padding: 8px; padding: 8px;