NEZ-1965 feat :增加列表页面内容复制功能

This commit is contained in:
likexuan
2022-07-06 11:11:40 +08:00
parent 82d7386dec
commit 873afdc67e
6 changed files with 55 additions and 8 deletions

View File

@@ -35,17 +35,20 @@
> >
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
<template v-if="item.prop === 'alertRule'"> <template v-if="item.prop === 'alertRule'">
<div v-if="scope.row.alertRule&&scope.row.alertRule.name" > <div v-if="scope.row.alertRule&&scope.row.alertRule.name" class="document-copy-block">
<span <span class="document-copy-text"
@mouseenter="alertMessageHover(scope.row, true, $event)" @mouseenter="alertMessageHover(scope.row, true, $event)"
@mouseleave="alertMessageHover(scope.row, false)" @mouseleave="alertMessageHover(scope.row, false)"
>{{scope.row.alertRule?scope.row.alertRule.name : '--'}}</span> >{{scope.row.alertRule?scope.row.alertRule.name : '--'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.alertRule.name)" :title="$t('overall.copyText')"></i>
</div> </div>
<template v-else>-</template> <template v-else>-</template>
</template> </template>
<template v-else-if="item.prop === 'summary'"> <template v-else-if="item.prop === 'summary'">
<template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template> <div class="document-copy-block">
<template v-else>-</template> <span class="document-copy-text">{{scope.row[item.prop] ? scope.row[item.prop] : '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row[item.prop])" :title="$t('overall.copyText')"></i>
</div>
</template> </template>
<template v-else-if="item.prop === 'description'"> <template v-else-if="item.prop === 'description'">
<template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template> <template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>

View File

@@ -36,7 +36,22 @@
</template> </template>
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
<div v-if="item.prop === 'group'"> <div v-if="item.prop === 'group'">
{{scope.row[item.prop] ? scope.row[item.prop].name : '-'}} <div class="document-copy-block">
<span class="document-copy-text"> {{scope.row[item.prop] ? scope.row[item.prop].name : '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row[item.prop].name)" :title="$t('overall.copyText')"></i>
</div>
</div>
<div v-else-if="item.prop === 'name'">
<div class="document-copy-block">
<span class="document-copy-text">{{scope.row.name ? scope.row.name : '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.name)" :title="$t('overall.copyText')"></i>
</div>
</div>
<div v-else-if="item.prop === 'metaKey'">
<div class="document-copy-block">
<span class="document-copy-text">{{scope.row[item.prop] || '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row[item.prop])" :title="$t('overall.copyText')"></i>
</div>
</div> </div>
<div v-else-if=" item.prop === 'display' "> <div v-else-if=" item.prop === 'display' ">
<div v-if="scope.row[item.prop] === 1">Enabled</div> <div v-if="scope.row[item.prop] === 1">Enabled</div>

View File

@@ -88,6 +88,12 @@
{{scope.row[item.prop]}} {{scope.row[item.prop]}}
</span> </span>
</template> </template>
<template v-else-if="item.prop === 'name'">
<div class="document-copy-block">
<span class="document-copy-text">{{scope.row.name ? scope.row.name : '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.name)" :title="$t('overall.copyText')"></i>
</div>
</template>
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span> <span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
<template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template> <template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
<template v-else>-</template> <template v-else>-</template>

View File

@@ -42,11 +42,23 @@
<span>-</span> <span>-</span>
</template> </template>
</template> </template>
<template v-else-if="item.prop === 'name'">
<div class="document-copy-block">
<span class="document-copy-text">{{scope.row.name ? scope.row.name : '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.name)" :title="$t('overall.copyText')"></i>
</div>
</template>
<template v-else-if="item.prop === 'brand'"> <template v-else-if="item.prop === 'brand'">
{{scope.row.brand.name}} <div class="document-copy-block">
<span class="document-copy-text">{{scope.row.brand.name}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.brand.name)" :title="$t('overall.copyText')"></i>
</div>
</template> </template>
<template v-else-if="item.prop === 'type'"> <template v-else-if="item.prop === 'type'">
{{scope.row.type ? scope.row.type.name : '-'}} <div class="document-copy-block">
<span class="document-copy-text">{{scope.row.type ? scope.row.type.name : '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.type.name)" :title="$t('overall.copyText')"></i>
</div>
</template> </template>
<span v-else-if="item.prop === 'createTime'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span> <span v-else-if="item.prop === 'createTime'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
<template v-else-if="item.prop === 'assetNum'"> <template v-else-if="item.prop === 'assetNum'">

View File

@@ -132,7 +132,12 @@
<pl-table v-if="showTable" ref="resultTable" v-my-loading="loading" :datas="resultData" :empty-text="$t('overall.noData')" :pagination-show="false" :row-height="28" <pl-table v-if="showTable" ref="resultTable" v-my-loading="loading" :datas="resultData" :empty-text="$t('overall.noData')" :pagination-show="false" :row-height="28"
border class="mib-browser-table" size="small" style="width: 100%; height: 100%" use-virtual> border class="mib-browser-table" size="small" style="width: 100%; height: 100%" use-virtual>
<pl-table-column v-slot="{row}" label="Name/OID"> <pl-table-column v-slot="{row}" label="Name/OID">
<div class="document-copy-block">
<div class="document-copy-text">
<div class="too-long-split" @click="searchParam.oid = row.oid">{{row.name ? row.name : row.oid}}</div> <div class="too-long-split" @click="searchParam.oid = row.oid">{{row.name ? row.name : row.oid}}</div>
</div>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(row.name ? row.name : row.oid)" :title="$t('overall.copyText')"></i>
</div>
</pl-table-column> </pl-table-column>
<pl-table-column v-slot="{row}" label="Value"> <pl-table-column v-slot="{row}" label="Value">
<template><div @click="searchParam.oid = row.oid">{{row.value}}</div></template> <template><div @click="searchParam.oid = row.oid">{{row.value}}</div></template>

View File

@@ -83,6 +83,12 @@
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row[item.prop])" :title="$t('overall.copyText')"></i> <i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row[item.prop])" :title="$t('overall.copyText')"></i>
</div> </div>
</template> </template>
<template v-else-if="item.prop === 'name'">
<div class="document-copy-block">
<span class="document-copy-text">{{scope.row.name ? scope.row.name : '-'}}</span>
<i class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row.name)" :title="$t('overall.copyText')"></i>
</div>
</template>
<template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template> <template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
<template v-else>-</template> <template v-else>-</template>
</template> </template>