fix:解决冲突

This commit is contained in:
zyh
2023-06-06 11:47:54 +08:00

View File

@@ -1,131 +1,144 @@
<template> <template>
<el-table <div style="">
id="userTable" <el-table
ref="dataTable" id="userTable"
:data="tableData" ref="dataTable"
:height="height" :data="tableData"
border :height="height"
@cell-mouse-enter="cellMouseEnter" border
:default-sort="orderBy" @cell-mouse-enter="cellMouseEnter"
@header-dragend="dragend" :default-sort="orderBy"
@sort-change="tableDataSort" @header-dragend="dragend"
@selection-change="selectionChange" @sort-change="tableDataSort"
@row-dblclick="(row)=>{showBottomBox('endpoint', row)}" @selection-change="selectionChange"
> @row-dblclick="(row)=>{showBottomBox('endpoint', row)}"
<el-table-column
:resizable="false"
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
v-for="(item, index) in customTableTitle"
v-if="item.show"
:key="`col-${index}-${item.prop}`"
:fixed="item.fixed"
:label="item.label"
:min-width="`${item.minWidth}`"
:prop="item.prop"
:resizable="true"
:sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`"
class="data-column"
> >
<template slot="header"> <el-table-column
<span class="data-column__span data-column__span--modify">{{item.label}}</span> :resizable="false"
<div class="col-resize-area"></div> align="center"
</template> type="selection"
<template slot-scope="scope" :column="item"> width="55">
<template v-if="item.prop === 'name'"> </el-table-column>
<copy :copyData='scope.row[item.prop]' :showInfo='scope.row[item.prop]'> <el-table-column
<template slot="copy-text"> v-for="(item, index) in customTableTitle"
{{scope.row[item.prop]?scope.row[item.prop]:'-'}} v-if="item.show"
</template> :key="`col-${index}-${item.prop}`"
</copy> :fixed="item.fixed"
:label="item.label"
:min-width="`${item.minWidth}`"
:prop="item.prop"
:resizable="true"
:sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`"
class="data-column"
>
<template slot="header">
<span class="data-column__span data-column__span--modify">{{item.label}}</span>
<div class="col-resize-area"></div>
</template> </template>
<template v-else-if="item.prop === 'type'"> <template slot-scope="scope" :column="item">
{{scope.row[item.prop]}} <template v-if="item.prop === 'name'">
</template> <copy :copyData='scope.row[item.prop]' :showInfo='scope.row[item.prop]'>
<template v-else-if="item.prop === 'project'"> <template slot="copy-text">
<copy :copyData='scope.row[item.prop].name' :showInfo='scope.row[item.prop].name'> {{scope.row[item.prop]?scope.row[item.prop]:'-'}}
<template slot="copy-text"> </template>
{{scope.row[item.prop].name}} </copy>
</template> </template>
</copy> <template v-else-if="item.prop === 'type'">
</template> {{scope.row[item.prop]}}
<template v-else-if="item.prop === 'endpointNum'"> </template>
<span class="endpoint-num" @click.stop="showBottomBox('endpoint', scope.row)" @dblclick.stop=""> <template v-else-if="item.prop === 'project'">
<i class="nz-icon nz-icon-overview-endpoint monitorColor"/> <div class="document-copy-block">
{{scope.row[item.prop]}} <span class="pointer document-copy-text"
</span> @mouseenter="labelHover(scope.row, item.prop, true,true, $event)"
</template> @mouseleave="labelHover(scope.row, item.prop, false,true)">
<template v-else-if="item.prop === 'alertNum'"> {{scope.row[item.prop].name}}
<span style="cursor: pointer" @click.stop="showBottomBox('moduleAlertMessage', scope.row)" @dblclick.stop=""> </span>
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i> <i v-if="scope.row[item.prop].name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row[item.prop].name)" :title="$t('overall.copyText')"></i>
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
<div class="tooltip-title">{{$t('project.topology.alert')}}({{$t('overall.active')}})</div>
<div class="severity-info" style='justify-content: space-between'>
<div class="severity-name">{{$t('overall.result.total')}}</div>
<div class="severity-value">{{scope.row.alertNum}}</div>
</div>
</div> </div>
<alertDaysInfo </template>
v-show="!scope.row.trendLoading" <template v-else-if="item.prop === 'endpointNum'">
:alertDaysData="scope.row.alertDaysData" <span class="endpoint-num" @click.stop="showBottomBox('endpoint', scope.row)" @dblclick.stop="">
/> <i class="nz-icon nz-icon-overview-endpoint monitorColor"/>
</span> {{scope.row[item.prop]}}
</span>
</template>
<template v-else-if="item.prop === 'alertNum'">
<span style="cursor: pointer" @click.stop="showBottomBox('moduleAlertMessage', scope.row)" @dblclick.stop="">
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i>
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
<div class="tooltip-title">{{$t('project.topology.alert')}}({{$t('overall.active')}})</div>
<div class="severity-info" style='justify-content: space-between'>
<div class="severity-name">{{$t('overall.result.total')}}</div>
<div class="severity-value">{{scope.row.alertNum}}</div>
</div>
</div>
<alertDaysInfo
v-show="!scope.row.trendLoading"
:alertDaysData="scope.row.alertDaysData"
/>
</span>
</template>
<template v-else-if="item.prop === 'dashboard'">
{{scope.row.dashboard ? scope.row.dashboard.name : '-'}}
</template>
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
<span v-else-if="scope.row[item.prop]" :class="item.prop === 'remark'? 'el-table-remark':''">{{scope.row[item.prop]}}</span>
<span v-else>-</span>
</template> </template>
<template v-else-if="item.prop === 'dashboard'"> </el-table-column>
{{scope.row.dashboard ? scope.row.dashboard.name : '-'}} <el-table-column
</template> :resizable="false"
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span> :width="operationWidth"
<span v-else-if="scope.row[item.prop]" :class="item.prop === 'remark'? 'el-table-remark':''">{{scope.row[item.prop]}}</span> fixed="right">
<span v-else>-</span> <div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items">
<button class="table-operation-item" @click="showBottomBox('endpoint', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" v-has="['monitor_module_edit','monitor_module_delete','alertSilence_add','main_edit']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i>
</div>
<el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
<el-dropdown-item v-has="'monitor_module_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'monitor_module_delete'" :command="['delete-rel', scope.row, {forceDeleteShow:true, single:true}]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'monitor_module_edit'" :command="['copy', scope.row, 'module']"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'main_edit'" :command="['sync', scope.row]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.syncChart')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'module']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'asset_add'" :command="['topology', scope.row, 'module']"><i class="nz-icon nz-icon-Topology"></i><span class="operation-dropdown-text">{{$t('overall.topology')}}</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-table-column>
<template slot="empty">
<div v-if="!loading" class="table-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div class="table-no-data__title">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template> </template>
</el-table-column> </el-table>
<el-table-column <alertLabel
:resizable="false" v-if="alertLabelShow"
:width="operationWidth" :id="alertLabelId"
fixed="right"> :that="alertLabelObj"
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div> :type="alertLabelType"
<div slot-scope="scope" class="table-operation-items"> ></alertLabel>
<button class="table-operation-item" @click="showBottomBox('endpoint', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button> </div>
<el-dropdown size="medium" v-has="['monitor_module_edit','monitor_module_delete','alertSilence_add','main_edit']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i>
</div>
<el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
<el-dropdown-item v-has="'monitor_module_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'monitor_module_delete'" :command="['delete-rel', scope.row, {forceDeleteShow:true, single:true}]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'monitor_module_edit'" :command="['copy', scope.row, 'module']"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'main_edit'" :command="['sync', scope.row]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.syncChart')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'module']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'asset_add'" :command="['topology', scope.row, 'module']"><i class="nz-icon nz-icon-Topology"></i><span class="operation-dropdown-text">{{$t('overall.topology')}}</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-table-column>
<template slot="empty">
<div v-if="!loading" class="table-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div class="table-no-data__title">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template> </template>
<script> <script>
import table from '@/components/common/mixin/table' import table from '@/components/common/mixin/table'
import deleteButton from '@/components/common/deleteButton' import deleteButton from '@/components/common/deleteButton'
import copy from '@/components/common/copy' import copy from '@/components/common/copy'
import alertLabel from '../../alert/alertLabel'
import alertLabelMixin from '@/components/common/mixin/alertLabelMixin'
export default { export default {
name: 'moduleTable', name: 'moduleTable',
mixins: [table], mixins: [table, alertLabelMixin],
components: { deleteButton, copy }, components: { deleteButton, copy, alertLabel },
props: { props: {
loading: Boolean loading: Boolean
}, },