Authored by 王涛
This diff could not be displayed because it is too large.
@@ -77,3 +77,9 @@ @@ -77,3 +77,9 @@
77 .el-table td { 77 .el-table td {
78 padding: 6px 0; 78 padding: 6px 0;
79 } 79 }
  80 +.alarm-li{
  81 + .el-input .el-input__inner{
  82 + height: 50px;
  83 + }
  84 +}
  85 +
@@ -361,3 +361,17 @@ a:hover { @@ -361,3 +361,17 @@ a:hover {
361 border-color: rgba(249, 32, 32, 0.2); 361 border-color: rgba(249, 32, 32, 0.2);
362 color: rgb(249, 32, 32); 362 color: rgb(249, 32, 32);
363 } 363 }
  364 +/*列将内容转换成图标*/
  365 +.small-icon {
  366 + width: 22px;
  367 + height: 22px;
  368 + display: block;
  369 +}
  370 +.small-icon.small-icon-msg {
  371 + background: url('../images/monitor/icon-msg.png') no-repeat center;
  372 + background-size: contain;
  373 +}
  374 +.small-icon.small-icon-wechat {
  375 + background: url('../images/monitor/icon-wechat.png') no-repeat center;
  376 + background-size: contain;
  377 +}
  1 +<template>
  2 + <div>
  3 + <el-button
  4 + type="primary"
  5 + size="small"
  6 + plain
  7 + @click="handleAddClick"
  8 + >配置表头</el-button
  9 + >
  10 + <el-table :data="formData" style="width: 100%">
  11 + <el-table-column prop="name" label="名称" width="60" />
  12 + <el-table-column prop="key" label="key值" width="70" />
  13 + <el-table-column prop="width" label="宽度" width="50" />
  14 + <el-table-column label="操作" width="100">
  15 + <template slot-scope="scope">
  16 + <div class="button-group">
  17 + <el-button
  18 + @click="handleEditorClick(scope.$index, scope.row)"
  19 + type="text"
  20 + size="small"
  21 + >编辑</el-button
  22 + >
  23 +<!-- <el-button
  24 + type="text"
  25 + size="small"
  26 + @click="handleDeleteClick(scope.$index, scope.row)"
  27 + >删除</el-button
  28 + >-->
  29 + </div>
  30 + </template>
  31 + </el-table-column>
  32 + </el-table>
  33 + <el-dialog
  34 + title="编辑列"
  35 + :visible.sync="editDialogVisible"
  36 + width="30%"
  37 + :before-close="handleClose"
  38 + >
  39 + <el-form :model="rowFormData" label-width="70px">
  40 + <el-form-item label="名称:">
  41 + <el-input
  42 + v-model.trim="rowFormData['name']"
  43 + placeholder="请输入名称"
  44 + size="mini"
  45 + disabled
  46 + >
  47 + </el-input>
  48 + </el-form-item>
  49 + <el-form-item label="key值:">
  50 + <el-input
  51 + v-model.trim="rowFormData['key']"
  52 + placeholder="请输入key值"
  53 + size="mini"
  54 + disabled
  55 + >
  56 + </el-input>
  57 + </el-form-item>
  58 + <el-form-item label="宽度:">
  59 + <el-input
  60 + v-model.trim="rowFormData['width']"
  61 + placeholder="请输入宽度"
  62 + size="mini"
  63 + >
  64 + </el-input>
  65 + </el-form-item>
  66 + <el-form-item label="排序:">
  67 + <el-switch size="mini" v-model.trim="rowFormData['sort']" />
  68 + </el-form-item>
  69 +
  70 + <el-form-item label="列排序:">
  71 + <el-input-number
  72 + v-model.trim="rowFormData['columnSort']"
  73 + :min="0"
  74 + :max="50"
  75 + size="small"
  76 + controls-position="right"
  77 + />
  78 + </el-form-item>
  79 + <el-form-item label="关联组件:">
  80 + <el-select v-model.trim="rowFormData['componentName']" size="small">
  81 + <el-option
  82 + v-for="item in componentNameData"
  83 + :key="item.value"
  84 + :label="item.label"
  85 + :value="item.value"
  86 + >
  87 + </el-option>
  88 + </el-select>
  89 + </el-form-item>
  90 + </el-form>
  91 + <span slot="footer" class="dialog-footer">
  92 + <el-button size="mini" @click="editDialogVisible = false">取 消</el-button>
  93 + <el-button size="mini" type="primary" @click="handleSaveClick"
  94 + >确 定</el-button
  95 + >
  96 + </span>
  97 + </el-dialog>
  98 + <el-dialog
  99 + title="性能指标"
  100 + :visible.sync="dialogVisible"
  101 + width="60%"
  102 + :before-close="handleClose"
  103 + >
  104 + <div class="table-search">
  105 + <el-input v-model="keyword" placeholder="请输入指标名称" clearable />
  106 + <el-button @click="searchKpi" class="search-btn" type="primary">搜索</el-button>
  107 + </div>
  108 + <el-table :data="tableData" height="350" style="width: 100%" ref="multipleTableRef" @selection-change="handleSelectionChange"
  109 + :row-key="(row) => { return row.kpiId }"
  110 + >
  111 + <el-table-column type="selection" width="55" :reserve-selection="true" />
  112 + <el-table-column prop="kpiName" label="指标名称" width="180" />
  113 + <el-table-column prop="kpiId" label="指标ID" width="180" />
  114 + <el-table-column prop="kpiCategory" label="指标分类" >
  115 + <template #default="scope">{{ scope.row.kpiCategory==0?'基本指标':'性能指标' }}</template>
  116 + </el-table-column>
  117 + <el-table-column prop="kpiUnit" label="指标单位" width="180" />
  118 + <el-table-column prop="kpiPower" label="指标权限" width="180" >
  119 + <template #default="scope">{{ scope.row.kpiPower=='hard'?'硬件':scope.row.kpiPower=='soft'?'系统':'公共' }}</template>
  120 + </el-table-column>
  121 + <el-table-column prop="policyNum" label="告警策略" width="180" >
  122 + <template #default="scope">{{ scope.row.policyNum>0?'':'暂无' }}</template>
  123 + </el-table-column>
  124 + </el-table>
  125 + <!-- 分页 -->
  126 + <div style='text-align: left;background-color: white'>
  127 + <el-pagination
  128 + v-if="currentPage"
  129 + @size-change="handleSizeChange"
  130 + @prev-click="prePage"
  131 + @next-click="nextPage"
  132 + @current-change="handleCurrentChange"
  133 + :current-page="currentPage"
  134 + :page-sizes="pageSizes"
  135 + :page-size="pageSize"
  136 + :total="total">
  137 + </el-pagination>
  138 + </div>
  139 + <span slot="footer" class="dialog-footer">
  140 + <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
  141 + <el-button size="mini" type="primary" @click="handleSaveClick"
  142 + >确 定</el-button
  143 + >
  144 + </span>
  145 + </el-dialog>
  146 + </div>
  147 +</template>
  148 +<script>
  149 +import {getKpiPage} from "@/api/platform";
  150 +import {formatDate} from "../../../../../filter";
  151 +export default {
  152 + model: {
  153 + prop: "formData",
  154 + event: "input"
  155 + },
  156 + props: {
  157 + formData: Array
  158 + },
  159 + data() {
  160 + return {
  161 + keyword:'',
  162 + currentPage:1,
  163 + pageSize:10,
  164 + pageSizes:[10,50,100, 200, 300, 400],
  165 + total:0,
  166 + layout:false,
  167 + dialogVisible: false,
  168 + rowFormData: {
  169 + name: "",
  170 + key: "",
  171 + width: "",
  172 + sort:false,
  173 + columnSort:0,
  174 + componentName:1
  175 + },
  176 + flag: true, // true 新增, false 编辑
  177 + indexEditor: -1, // 编辑第几个数据
  178 + tableData: [],
  179 + multipleSelection:[],
  180 + editDialogVisible:false,//编辑列
  181 + componentNameData:[
  182 + {
  183 + label:'正常内容',
  184 + value:1
  185 + },
  186 + {
  187 + label:'微信图标',
  188 + value:'textToImage'
  189 + },
  190 + {
  191 + label: '级别背景',
  192 + value:'textToBg'
  193 + }
  194 + ],//关联组件
  195 + };
  196 + },
  197 + methods: {
  198 + //搜索指标
  199 + searchKpi(){
  200 + this.getKpi();
  201 + },
  202 + //获取性能指标列表
  203 + getKpi(){
  204 + let datas=getKpiPage();
  205 + if(datas.success){
  206 + this.tableData=datas.data;
  207 +
  208 + }
  209 + },
  210 + //回显数据
  211 + setCheckedData(){
  212 + if(this.multipleSelection && this.multipleSelection.length>0){
  213 + this.tableData.map(item=>{
  214 + this.multipleSelection.map(v=>{
  215 + if(item.kpiId==v.kpiId){
  216 + setTimeout(()=>{
  217 + this.$refs.multipleTableRef.toggleRowSelection(item)
  218 + },300)
  219 + }
  220 + })
  221 + })
  222 + }
  223 + },
  224 + //多选操作
  225 + handleSelectionChange(val) {
  226 + this.multipleSelection = val
  227 + },
  228 + // 每页展示多少条
  229 + handleSizeChange(val){
  230 + // 切换页码重置初始页
  231 + this.currentPage = 1
  232 + // console.log(`每页 ${val} 条`)
  233 + //props.pageSize = val;
  234 + this.pageSize = val;
  235 + this.getKpi();
  236 + },
  237 +
  238 + // 切换页码
  239 + handleCurrentChange(val){
  240 + // console.log(`当前页: ${val}`)
  241 + //props.currentPage = val;
  242 + this.currentPage = val;
  243 + this.getKpi();
  244 + },
  245 + // 切换页码
  246 + prePage(val) {
  247 + // console.log(`当前页: ${val}`)
  248 + // props.currentPage = val - 1;
  249 + this.currentPage = val-1;
  250 + this.getKpi();
  251 + },
  252 +
  253 + // 切换页码
  254 + nextPage(val){
  255 + // console.log(`当前页: ${val}`)
  256 + // props.currentPage = val + 1;
  257 + this.currentPage = val+1;
  258 + this.getKpi();
  259 + },
  260 + // 配置性能指标
  261 + handleAddClick() {
  262 + this.rowFormData = {};
  263 + this.flag = true;
  264 + this.dialogVisible = true;
  265 + this.getKpi();
  266 +
  267 + },
  268 + // 编辑
  269 + handleEditorClick(index, row) {
  270 + this.flag = false;
  271 + this.rowFormData = this.deepClone(row);
  272 + this.indexEditor = index;
  273 + this.editDialogVisible = true;
  274 + },
  275 + // 关闭
  276 + handleClose() {
  277 + this.dialogVisible = false;
  278 + },
  279 + // 保存
  280 + handleSaveClick() {
  281 + if (this.flag) {
  282 + // 新增
  283 + // this.formData.push(this.rowFormData);
  284 + let arr=[]
  285 + this.multipleSelection.map((item,index)=>{
  286 + arr.push({name:item.kpiName,key:item.kpiId,width:'50%',sort:false,columnSort:index,componentName:1})
  287 + })
  288 + this.formData=arr;
  289 + this.dialogVisible = false;
  290 + } else {
  291 + // 编辑
  292 + this.formData[this.indexEditor] = this.rowFormData;
  293 + this.$set(this.formData, this.indexEditor, this.rowFormData);
  294 + this.editDialogVisible = false;
  295 + }
  296 + this.$emit("input", this.formData);
  297 + this.$emit("change", this.formData);
  298 + },
  299 + // 删除
  300 + handleDeleteClick(index,row) {
  301 + this.formData.splice(index, 1);
  302 + this.setTableChecked(row.key);
  303 + this.$emit("input", this.formData);
  304 + this.$emit("change", this.formData);
  305 + },
  306 + //设置表格选中状态
  307 + setTableChecked(kpiId){
  308 + let indexId='';
  309 + this.multipleSelection.map((item,index)=>{
  310 + if(kpiId==item.kpiId){
  311 + indexId=index;
  312 + }
  313 + })
  314 + this.multipleSelection.splice(indexId, 1);
  315 +
  316 + this.tableData.map(item=>{
  317 + if(item.kpiId==kpiId){
  318 + setTimeout(()=>{
  319 + this.$refs.multipleTableRef.toggleRowSelection(item)
  320 + },300)
  321 + }
  322 + })
  323 + }
  324 + }
  325 +};
  326 +</script>
  327 +<style lang="scss" scoped>
  328 +/deep/::-webkit-scrollbar-track-piece {
  329 + background-color: transparent;
  330 +}
  331 +/deep/ .el-table__body-wrapper::-webkit-scrollbar {
  332 + width: 0; // 横向滚动条
  333 + height: 8px; // 纵向滚动条 必写
  334 +}
  335 +// 滚动条的滑块
  336 +/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
  337 + border-radius: 5px;
  338 + background-color: rgba(144, 146, 152, 0.3);
  339 +}
  340 +/deep/.el-table,
  341 +/deep/.el-table__expanded-cell,
  342 +/deep/.el-table th,
  343 +/deep/.el-table tr {
  344 + background-color: transparent !important;
  345 + color: #859094 !important;
  346 + font-size: 12px !important;
  347 +}
  348 +/deep/.el-table td,
  349 +/deep/.el-table th.is-leaf {
  350 + border-bottom: none;
  351 + line-height: 26px;
  352 +}
  353 +/deep/.el-table tbody tr:hover {
  354 + background-color: #263445 !important;
  355 +}
  356 +/deep/.el-table tbody tr:hover > td {
  357 + background-color: #263445 !important;
  358 +}
  359 +/deep/.el-table::before {
  360 + height: 0;
  361 +}
  362 +.button-group .el-button {
  363 + padding: 0;
  364 +}
  365 +.table-search{
  366 + display: flex;
  367 + align-items: center;
  368 + .search-btn{
  369 + margin-left: 10px;
  370 +
  371 + }
  372 +}
  373 +</style>
  1 +<template>
  2 + <div class="dialog-div" v-if="dialogVisible" :style="heightStyle">
  3 + <div class="dialog-div-content" :style="marginStyle+widthStyle" >
  4 + <div class="dialog-div-title title-flex-between"><span>{{titleName}}</span> <span class="dialog-close" @click="hideDialog">X</span></div>
  5 + <slot>弹框内容</slot>
  6 +
  7 + <div class="dialog-footer" v-if="showFooter">
  8 + <el-button v-if="showCancelBtn" @click="hideDialog">取消</el-button>
  9 + <el-button v-if="showOkBtn" type="primary" @click="okFunc"
  10 + >确定</el-button
  11 + >
  12 + </div>
  13 + </div>
  14 + </div>
  15 +</template>
  16 +
  17 +<script>
  18 +export default {
  19 + name: "customDialog",
  20 + props: {
  21 + dialogVisible: {
  22 + type: Boolean,
  23 + default: false
  24 + },
  25 + heightStyle: String,
  26 + marginStyle: String,
  27 + widthStyle: String,
  28 + dialogName: String,
  29 + titleName: {
  30 + type: String,
  31 + default: ''
  32 + },//弹框标题
  33 + showFooter: {
  34 + type: Boolean,
  35 + default: false
  36 + },//是否需要footer
  37 + showCancelBtn: {
  38 + type: Boolean,
  39 + default: false
  40 + },//是否需要取消按钮
  41 + showOkBtn: {
  42 + type: Boolean,
  43 + default: false
  44 + },//是否需要确定按钮
  45 + },
  46 + data() {
  47 + return {}
  48 + },
  49 + watch: {
  50 + dialogVisible: {
  51 + handler(val) {
  52 + console.log("dialogVisible",val)
  53 + },
  54 + deep: true
  55 + }
  56 + },
  57 + mounted() {
  58 +
  59 + },
  60 + methods: {
  61 + hideDialog(){
  62 + // this.dialogVisible = false;
  63 + this.$emit('hideDialog',false);
  64 + },
  65 + okFunc(){
  66 + // this.dialogVisible = false;
  67 + this.$emit('okfunc');
  68 + }
  69 + }
  70 +}
  71 +</script>
  72 +
  73 +<style lang="scss" scoped>
  74 +.title-flex-between{
  75 + display: flex;
  76 + justify-content: space-between;
  77 +
  78 +}
  79 +.dialog-div{
  80 + background: rgba(0, 0, 0, 0.35);
  81 + position: fixed;
  82 + top: 0;
  83 + left: 0;
  84 + right: 0;
  85 + bottom: 0;
  86 + z-index: 1;
  87 +}
  88 +.dialog-div-content{
  89 + /* display: flex;
  90 + align-items: center;
  91 + margin: 30px auto 0;
  92 + flex-flow: column;*/
  93 + width:80%;
  94 + min-height: 700px;
  95 + /*max-height: 800px;*/
  96 + overflow: auto;
  97 + background: #FFFFFF;
  98 + position: relative;
  99 + margin: 30px auto;
  100 + .dialog-div-width{
  101 + width: 100%;
  102 + }
  103 + .txtScroll-top{
  104 + width:100%;
  105 + padding: 10px;
  106 + margin-bottom:50px;
  107 + min-height: 600px;
  108 + max-height: 700px;
  109 + overflow: auto;
  110 + iframe{
  111 + border:none;
  112 + min-height: 600px;
  113 + html{
  114 + background: #FFFFFF;
  115 + }
  116 + }
  117 + }
  118 +.dialog-div-title{
  119 + width: 100%;
  120 + background: #f8f8f8;
  121 + padding:10px;
  122 + text-align: left;
  123 + line-height: 24px;
  124 +.dialog-close{
  125 + cursor: pointer;
  126 + color:#666666;
  127 +}
  128 +}
  129 +.dialog-footer{
  130 + width: 100%;
  131 + padding: 15px;
  132 + position: absolute;
  133 + bottom: 0;
  134 + text-align: right;
  135 +}
  136 +}
  137 +</style>
  1 +<template>
  2 + <div>
  3 + <div class="basic-img">
  4 + <el-popover ref="popoverMenu" placement="right" trigger="click" auto-close="200" >
  5 + <template #reference>
  6 + <img class="info-img" src="@/assets/images/healthStatus/icon_row_menu.png" alt="" @click.stop="pressingTimes()">
  7 + </template>
  8 + <div class="info-ul" style="width:140px;" >
  9 + <div class="basic-pressing-times" @click.stop="pressingDialog(itemMenu,tableDataValue,flg)" v-for="itemMenu in detailMenubox">
  10 + <i class="el-icon-link icon-div"></i>{{itemMenu.name}}
  11 + </div>
  12 + </div>
  13 + </el-popover>
  14 + </div>
  15 + <customDialog :dialogVisible="dialogVisible" :heightStyle="heightStyle" :marginStyle="marginStyle" :widthStyle="widthStyle" :title-name="tableName"
  16 + :showFooter="true" :showCancelBtn="true" :showOkBtn="true" @hideDialog="hideDialog" @okFunc="okFunc"
  17 + >
  18 + <template v-slot>
  19 + <div v-if="dialogName=='alarm_setting'" class="txtScroll-top">
  20 +<!-- 告警设置{{pressingValue}}-->
  21 + <div class="alarm-li flex-center">
  22 + <div class="alarm-li-label">告警策略</div>
  23 + <el-select v-model="strategyValue" filterable class="m-2 alarm-li-select" placeholder="选择告警策略">
  24 + <el-option
  25 + v-for="item in strategyData"
  26 + :key="item.value"
  27 + :label="item.label"
  28 + :value="item.value"
  29 + >
  30 + </el-option>
  31 + </el-select>
  32 + </div>
  33 + <div class="alarm-li flex-center">
  34 + <div class="alarm-li-label">告警列表</div>
  35 + <el-select v-model="alarmListValue" multiple filterable class="m-2 alarm-li-select" placeholder="选择告警列表" >
  36 + <el-option
  37 + v-for="item in alarmListData"
  38 + :key="item.value"
  39 + :label="item.label"
  40 + :value="item.value"
  41 + >
  42 + </el-option>
  43 + </el-select>
  44 + </div>
  45 +
  46 + </div>
  47 + <div v-if="dialogName=='filter_sheet_indicator'" class="txtScroll-top">
  48 + 过滤单指标{{pressingValue}}
  49 + </div>
  50 + <div v-if="dialogName=='filter_multiple_indicators'" class="txtScroll-top">
  51 + 过滤多指标{{pressingValue}}
  52 + </div>
  53 + <div v-if="dialogName=='performance_trends'" class="txtScroll-top">
  54 + <div>性能趋势{{pressingValue}}</div>
  55 + <iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/>
  56 + </div>
  57 + <div v-if="dialogName=='pressing_times'" class="txtScroll-top">
  58 + 压制次数{{pressingValue}}
  59 + </div>
  60 + <div v-if="dialogName=='include_capacity_forecast'" class="txtScroll-top">
  61 + 纳入容量预测{{pressingValue}}
  62 + </div>
  63 + </template>
  64 + </customDialog>
  65 + </div>
  66 +
  67 +</template>
  68 +
  69 +<script>
  70 +import customDialog from "./customDialog";
  71 +
  72 +export default {
  73 + name: "customMenuBox",
  74 + components:{
  75 + customDialog,
  76 + },
  77 + props: {
  78 + heightStyle: String,
  79 + marginStyle: String,
  80 + trendSrc:{
  81 + type:String,
  82 + default:'',
  83 + },
  84 + tableName:{
  85 + type:String,
  86 + default:'',
  87 + },//弹框名称
  88 + detailMenubox: {
  89 + type: Array,
  90 + default: [
  91 + {
  92 + name:'告警设置',
  93 + type:'alarm_setting',
  94 + isDisplay:true
  95 + },
  96 + {
  97 + name:'过滤单指标',
  98 + type:'filter_sheet_indicator',
  99 + isDisplay:true
  100 + },
  101 + {
  102 + name:'过滤多指标',
  103 + type:'filter_multiple_indicators',
  104 + isDisplay:true
  105 + },
  106 + {
  107 + name:'性能趋势',
  108 + type:'performance_trends',
  109 + isDisplay:true
  110 + },
  111 + {
  112 + name:'压制次数',
  113 + type:'pressing_times',
  114 + isDisplay:true
  115 + },
  116 + {
  117 + name:'纳入容量预测',
  118 + type:'include_capacity_forecast',
  119 + isDisplay:true
  120 + }
  121 + ]
  122 + },//表格下探数据
  123 + tableDataValue: {
  124 + type: String,
  125 + default: ''
  126 + },//单元格内容
  127 + flg: {
  128 + type: String,
  129 + default: ''
  130 + },//标志
  131 + },
  132 + data() {
  133 + return {
  134 + dialogVisible:false,//表格下探后的弹框
  135 + widthStyle:';',//弹框宽度样式
  136 + dialogName: '',
  137 + // trendSrc:'',//性能走势图地址
  138 + // pressingVisible:'',
  139 + pressingValue:'',
  140 + strategyData: [{
  141 + label:'策略一',
  142 + value:'001'
  143 + }],//告警策略数据
  144 + strategyValue:'',//告警策略值
  145 + alarmListData:[{
  146 + label:'告警列表一',
  147 + value:'001'
  148 + },{
  149 + label:'告警列表二',
  150 + value:'002'
  151 + },],//告警列表数据
  152 + alarmListValue:[],//告警列表值
  153 +
  154 + }
  155 + },
  156 + watch: {
  157 + trendSrc: {
  158 + handler(val) {
  159 + console.log("trendSrc",val)
  160 +
  161 + },
  162 + deep: true
  163 + },
  164 + tableName:{
  165 + handler(val){
  166 + console.log("titlename",val)
  167 + },
  168 + deep:true
  169 + }
  170 + },
  171 + mounted() {
  172 +
  173 + },
  174 + methods: {
  175 + //表格下探关闭
  176 + pressingTimes(index,idx){
  177 + // this.pressingVisible=index+'-'+idx;
  178 + },
  179 + //弹框关闭确定
  180 + hideDialog(){
  181 + this.dialogVisible=false;
  182 + },
  183 + okFunc(){
  184 + this.dialogVisible=false;
  185 + },
  186 + //表格下探
  187 + pressingDialog(itemMenu,value,flg){
  188 + this.pressingValue=value;
  189 + let styleStr='width: 300px;height: 200px;min-height: 200px;overflow: hidden;'
  190 + if(itemMenu.type=='alarm_setting'){
  191 + this.widthStyle='width:70%;';
  192 +
  193 + }else if(itemMenu.type=='filter_sheet_indicator'){
  194 + this.widthStyle=styleStr;
  195 +
  196 + }else if(itemMenu.type=='filter_multiple_indicators'){
  197 + this.widthStyle=styleStr;
  198 +
  199 + }else if(itemMenu.type=='performance_trends'){
  200 + this.widthStyle='';
  201 +
  202 + }else if(itemMenu.type=='pressing_times'){
  203 + this.widthStyle=styleStr;
  204 +
  205 + }else if(itemMenu.type=='include_capacity_forecast'){
  206 + this.widthStyle=styleStr;
  207 +
  208 + }
  209 +
  210 + this.setDialog(itemMenu.type,flg);
  211 +
  212 + this.closePopoverMenu();
  213 +
  214 + this.$emit("closeProbeDown",'')
  215 + // this.$refs.popoverMenu.showPopper = false;
  216 +
  217 + },
  218 + closePopoverMenu(){
  219 + let key=this.$refs.popoverMenu;
  220 + if(key && key.length>0){
  221 + key.map(item=>{
  222 + item.showPopper=false
  223 + })
  224 + }else{
  225 + key.showPopper=false
  226 +
  227 + }
  228 + },
  229 + //打开弹框
  230 + setDialog(name,flg){
  231 + this.dialogVisible=true;
  232 +
  233 + this.dialogName=name;
  234 + },
  235 + }
  236 +}
  237 +</script>
  238 +
  239 +<style lang="scss" scoped>
  240 +.basic-img{
  241 + display: flex;
  242 + cursor: pointer;
  243 + .info-img{
  244 + width: 16px;
  245 + height: 16px;
  246 +
  247 + img{
  248 + width:100%;
  249 + }
  250 + }
  251 +
  252 +}
  253 +.info-ul{
  254 + border:1px solid #d2d2d2;
  255 + padding-bottom: 5px;
  256 + z-index: 999999;
  257 + background: #ffffff;
  258 + color:#666666;
  259 + .basic-pressing-times{
  260 + line-height: 35px;
  261 + height: 35px;
  262 + cursor: pointer;
  263 + border-bottom: 1px solid #d2d2d2;
  264 + padding: 5px 16px;
  265 + text-align: center;
  266 + font-size: 14px;
  267 + font-weight: 500;
  268 + display: flex;
  269 + align-items: center;
  270 + justify-content: flex-start;
  271 + &:last-child{
  272 + border-bottom: none;
  273 + }
  274 + &:hover{
  275 + background: #0d82e9;
  276 + color:#f6f6f6;
  277 + }
  278 + .icon-div{
  279 + width: 14px;
  280 + }
  281 + }
  282 +
  283 +}
  284 +.alarm-li{
  285 + width:100%;
  286 + padding:0 10px;
  287 + margin-bottom: 30px;
  288 + .alarm-li-label{
  289 + height:50px;
  290 + line-height: 50px;
  291 + background: #fbfbfb;
  292 + padding:10px;
  293 + display: flex;
  294 + align-items: center;
  295 + border:1px solid #e6e6e6;
  296 + }
  297 + .alarm-li-select{
  298 + flex:1;
  299 +
  300 + }
  301 +}
  302 +.el-input .el-input__inner{
  303 + height: 40px;
  304 +}
  305 +.flex-center{
  306 + display: flex;
  307 + justify-content: center;
  308 +}
  309 +</style>
@@ -139,6 +139,12 @@ @@ -139,6 +139,12 @@
139 :dict-key="item.dictKey" 139 :dict-key="item.dictKey"
140 @change="changed($event, item.name)" 140 @change="changed($event, item.name)"
141 /> 141 />
  142 + <configureIndicators
  143 + v-if="item.type == 'dynamic-detail-table' && inputShow[item.name]"
  144 + v-model="formData[item.name]"
  145 + :chart-type="item.chartType"
  146 + @change="changed($event, item.name)"
  147 + />
142 <dynamic-add-table 148 <dynamic-add-table
143 v-if="item.type == 'dynamic-add-table' && inputShow[item.name]" 149 v-if="item.type == 'dynamic-add-table' && inputShow[item.name]"
144 v-model="formData[item.name]" 150 v-model="formData[item.name]"
@@ -276,6 +282,9 @@ import dynamicComponents from "./dynamicComponents.vue"; @@ -276,6 +282,9 @@ import dynamicComponents from "./dynamicComponents.vue";
276 import customColorComponents from "./customColorComponents"; 282 import customColorComponents from "./customColorComponents";
277 import dynamicAddTable from "./dynamicAddTable.vue"; 283 import dynamicAddTable from "./dynamicAddTable.vue";
278 import customUpload from "./customUpload.vue"; 284 import customUpload from "./customUpload.vue";
  285 +
  286 +import configureIndicators from "./configureIndicators.vue";
  287 +
279 export default { 288 export default {
280 name: "DynamicForm", 289 name: "DynamicForm",
281 components: { 290 components: {
@@ -284,7 +293,8 @@ export default { @@ -284,7 +293,8 @@ export default {
284 dynamicComponents, 293 dynamicComponents,
285 customColorComponents, 294 customColorComponents,
286 dynamicAddTable, 295 dynamicAddTable,
287 - customUpload 296 + customUpload,
  297 + configureIndicators
288 }, 298 },
289 model: { 299 model: {
290 prop: "value", 300 prop: "value",
  1 +<template>
  2 + <div class="text-bg-div">
  3 + <div :class="['table-level-normal',{'table-level-worse':alarmLevel=='2','table-level-worst':alarmLevel=='3'}]">
  4 + {{levelName}}
  5 + </div>
  6 +
  7 + </div>
  8 +</template>
  9 +
  10 +<script>
  11 +export default {
  12 + name: "textToBg",
  13 + data() {
  14 + return {
  15 + levelName:'一般'
  16 + }
  17 + },
  18 + components: {},
  19 + props: {
  20 + alarmLevel: String,
  21 + },
  22 + computed: {},
  23 + mounted() {
  24 + this.getLeveName();
  25 + },
  26 + methods: {
  27 + getLeveName(){
  28 + if(this.alarmLevel=='1'){
  29 + this.levelName='一般'
  30 + }else if(this.alarmLevel=='2'){
  31 + this.levelName='重要'
  32 + }else if(this.alarmLevel=='3'){
  33 + this.levelName='严重'
  34 + }else{
  35 + this.levelName='一般'
  36 + }
  37 + }
  38 + }
  39 +}
  40 +</script>
  41 +
  42 +<style lang="scss" scoped>
  43 +.text-bg-div{
  44 + width:80%;
  45 +}
  46 +.table-level-normal {
  47 + min-width: 28px;
  48 + line-height: 28px;
  49 + width:100%;
  50 + display: inline-block;
  51 + padding: 0 3px;
  52 + color: #fff;
  53 + background-color: #1e9fff
  54 +}
  55 +.table-level-worse {
  56 + background-color: #FF7E00;
  57 +}
  58 +.table-level-worst {
  59 + background-color: #D81E06;
  60 +}
  61 +</style>
  1 +<template>
  2 + <div>
  3 + <div :class="['small-icon',{'small-icon-wechat':way=='','small-icon-msg':way=='message'}]"></div>
  4 +
  5 + </div>
  6 +</template>
  7 +
  8 +<script>
  9 +export default {
  10 + name: "textToImage",
  11 + data() {
  12 + return {
  13 + }
  14 + },
  15 + components: {},
  16 + props: {
  17 + way: String,
  18 + },
  19 + computed: {},
  20 + mounted() {},
  21 + methods: {}
  22 +}
  23 +</script>
  24 +
  25 +<style lang="scss" scoped>
  26 +
  27 +</style>
@@ -134,6 +134,117 @@ export const monitorDetailTable = { @@ -134,6 +134,117 @@ export const monitorDetailTable = {
134 placeholder: '', 134 placeholder: '',
135 value: '#e6e6e6' 135 value: '#e6e6e6'
136 }, 136 },
  137 +
  138 + [
  139 + {
  140 + name:'下探列表设置',
  141 + list:[
  142 + {
  143 + type: 'el-switch',
  144 + label: '告警设置',
  145 + name: 'alarm_setting',
  146 + required: false,
  147 + placeholder: '',
  148 + value: true
  149 + },
  150 + {
  151 + type: 'el-switch',
  152 + label: '过滤单指标',
  153 + name: 'filter_sheet_indicator',
  154 + required: false,
  155 + placeholder: '',
  156 + value: true
  157 + },
  158 + {
  159 + type: 'el-switch',
  160 + label: '过滤多指标',
  161 + name: 'filter_multiple_indicators',
  162 + required: false,
  163 + placeholder: '',
  164 + value: true
  165 + },
  166 + {
  167 + type: 'el-switch',
  168 + label: '性能趋势',
  169 + name: 'performance_trends',
  170 + required: false,
  171 + placeholder: '',
  172 + value: true
  173 + },
  174 + {
  175 + type: 'el-switch',
  176 + label: '压制次数',
  177 + name: 'pressing_times',
  178 + required: false,
  179 + placeholder: '',
  180 + value: true
  181 + },
  182 + {
  183 + type: 'el-switch',
  184 + label: '纳入容量预测',
  185 + name: 'include_capacity_forecast',
  186 + required: false,
  187 + placeholder: '',
  188 + value: true
  189 + }
  190 + ]
  191 + }
  192 + ],
  193 + {
  194 + type: 'el-switch',
  195 + label: '弹框默认名称',
  196 + name: 'nameDefault',
  197 + required: false,
  198 + placeholder: '',
  199 + value: true
  200 + },
  201 + [
  202 + {
  203 + name: '弹框名称设置',
  204 + list: [
  205 + {
  206 + type: 'el-switch',
  207 + label: '资源类型',
  208 + name: 'nameResType',
  209 + required: false,
  210 + placeholder: '',
  211 + value: false
  212 + },
  213 + {
  214 + type: 'el-switch',
  215 + label: 'IP地址',
  216 + name: 'nameIPAddress',
  217 + required: false,
  218 + placeholder: '',
  219 + value: false
  220 + },
  221 + {
  222 + type: 'el-switch',
  223 + label: '资源名称',
  224 + name: 'nameResName',
  225 + required: false,
  226 + placeholder: '',
  227 + value: false
  228 + },
  229 + {
  230 + type: 'el-switch',
  231 + label: '指标名称',
  232 + name: 'nameKpiName',
  233 + required: false,
  234 + placeholder: '',
  235 + value: false
  236 + },
  237 + {
  238 + type: 'el-switch',
  239 + label: '指标标识',
  240 + name: 'nameKpiFlg',
  241 + required: false,
  242 + placeholder: '',
  243 + value: false
  244 + }
  245 + ],
  246 + }
  247 + ],
137 [ 248 [
138 { 249 {
139 name: '状态范围设置', 250 name: '状态范围设置',
@@ -217,6 +328,14 @@ export const monitorDetailTable = { @@ -217,6 +328,14 @@ export const monitorDetailTable = {
217 value: true, 328 value: true,
218 }, 329 },
219 { 330 {
  331 + type: 'el-switch',
  332 + label: '序号',
  333 + name: 'isSerialNumber',
  334 + required: false,
  335 + placeholder: '',
  336 + value: false,
  337 + },
  338 + {
220 type: 'vue-color', 339 type: 'vue-color',
221 label: '表头颜色', 340 label: '表头颜色',
222 name: 'headColor', 341 name: 'headColor',
@@ -273,17 +392,18 @@ export const monitorDetailTable = { @@ -273,17 +392,18 @@ export const monitorDetailTable = {
273 }, 392 },
274 ], 393 ],
275 { 394 {
276 - type: 'dynamic-add-table', 395 + type: 'dynamic-detail-table',
277 label: '', 396 label: '',
278 name: 'dynamicAddTable', 397 name: 'dynamicAddTable',
279 required: false, 398 required: false,
  399 + chartType:'detail-table',
280 placeholder: '', 400 placeholder: '',
281 value: [ 401 value: [
282 - {name: '文件系统挂载', key: 'fileAddress', width: '50%',kpiIdent:0,isWarning:0},  
283 - {name: '文件系统使用率', key: 'fileUseRate', width: '50%',isWarning:1,kpiIdent:0},  
284 - {name: '文件系统总大小', key: 'fileSize', width: '50%',kpiIdent:1,isWarning:0},  
285 - {name: '文件系统已使用大小', key: 'fileSizeUsed', width: '50%',kpiIdent:1,isWarning:0},  
286 - {name: '卷名称', key: 'fileAddressName', width: '50%',kpiIdent:0,isWarning:0}, 402 + {name: '文件系统挂载', key: 'KPI7AC1664E', width: '50%',isStatic:true,columnSort:0,componentName:1},
  403 + {name: '文件系统使用率', key: 'KPI449F5365', width: '50%',isStatic:true,columnSort:1,componentName:1},
  404 + {name: '文件系统总大小', key: 'KPIA91F44E7', width: '50%',isStatic:true,columnSort:2,componentName:1},
  405 + {name: '文件系统已使用大小', key: 'KPI98306224', width: '50%',isStatic:true,columnSort:3,componentName:1},
  406 + {name: '卷名称', key: 'KPI77C28BBA', width: '50%',isStatic:true,columnSort:4,componentName:1},
287 ] 407 ]
288 } 408 }
289 ], 409 ],
@@ -324,11 +444,102 @@ export const monitorDetailTable = { @@ -324,11 +444,102 @@ export const monitorDetailTable = {
324 relactiveDom: 'dataType', 444 relactiveDom: 'dataType',
325 relactiveDomValue: 'staticData', 445 relactiveDomValue: 'staticData',
326 value: [ 446 value: [
327 - {fileAddress: '/', fileUseRate: '99%', fileSize: '196.74',fileSizeUsed:'184',fileAddressName:'/dev/vda1'},  
328 - {fileAddress: '/dev', fileUseRate: '0%', fileSize: '15.74',fileSizeUsed:'0.00',fileAddressName:'devtmpfs'},  
329 - {fileAddress: '/run', fileUseRate: '1%', fileSize: '15.32',fileSizeUsed:'0.14',fileAddressName:'tmpfs'},  
330 - {fileAddress: '/run/user/0', fileUseRate: '0%', fileSize: '3.74',fileSizeUsed:'10',fileAddressName:'tmpfs'},  
331 - {fileAddress: '/run/user/0001', fileUseRate: '2', fileSize: '3.69',fileSizeUsed:'1.23',fileAddressName:'tmpfs'}, 447 + {
  448 + header: [
  449 + {
  450 + id: "KPI7AC1664E",
  451 + name: "文件系统挂载",
  452 + unit: ""
  453 + }, {
  454 + id: "KPI449F5365",
  455 + name: "文件系统使用率",
  456 + unit: "%"
  457 + }, {
  458 + id: "KPIA91F44E7",
  459 + name: "文件系统总大小",
  460 + unit: ""
  461 + }, {
  462 + id: "KPI98306224",
  463 + name: "文件系统已使用大小",
  464 + unit: ""
  465 + },{
  466 + id: "KPI77C28BBA",
  467 + name: "卷名称",
  468 + unit: ""
  469 + }, {
  470 + id: "KPIF74D9D2B",
  471 + name: "最近采集时间",
  472 + unit: ""
  473 + }
  474 + ],
  475 + content:[
  476 + [
  477 + {
  478 + kpiId: "KPI7AC1664E",
  479 + kpiName: "文件系统挂载",
  480 + flag: "inode-",
  481 + kpiValue: "/ ",
  482 + kpiUnit: "none",
  483 + kpiIdent: "0",
  484 + isWarning: 0,
  485 + isTrend: 0,
  486 + kpiLevel: 0,
  487 + },
  488 + {
  489 + kpiId: "KPI449F5365",
  490 + kpiName: "文件系统使用率",
  491 + flag: "inode-",
  492 + kpiValue: "3%",
  493 + kpiUnit: "percent",
  494 + kpiIdent: "1",
  495 + isWarning: 0,
  496 + isTrend: 0,
  497 + kpiLevel: 0,
  498 + },
  499 + {
  500 + kpiId: "KPIA91F44E7",
  501 + kpiName: "文件系统总大小",
  502 + flag: "inode-",
  503 + kpiValue: "6553600 ",
  504 + kpiUnit: "none",
  505 + kpiIdent: "1",
  506 + isWarning: 0,
  507 + isTrend: 0,
  508 + kpiLevel: 0,
  509 + }, {
  510 + kpiId: "KPI98306224",
  511 + kpiName: "文件系统已使用大小",
  512 + flag: "inode-",
  513 + kpiValue: "81699 ",
  514 + kpiUnit: "none",
  515 + kpiIdent: "1",
  516 + isWarning: 0,
  517 + isTrend: 0,
  518 + kpiLevel: 0,
  519 + }, {
  520 + kpiId: "KPI77C28BBA",
  521 + kpiName: "卷名称",
  522 + flag: "inode-",
  523 + kpiValue: "/dev/vda1 ",
  524 + kpiUnit: "none",
  525 + kpiIdent: "0",
  526 + isWarning: 0,
  527 + isTrend: 0,
  528 + kpiLevel: 0,
  529 + }, {
  530 + kpiId: "KPIF74D9D2B",
  531 + kpiName: "最近采集时间",
  532 + flag: "inode-",
  533 + kpiValue: "2022-01-17 08:51:18 ",
  534 + kpiUnit: "",
  535 + kpiIdent: "0",
  536 + isWarning: 0,
  537 + isTrend: 0,
  538 + kpiLevel: 0,
  539 + }
  540 + ],
  541 + ]
  542 + }
332 543
333 ], 544 ],
334 }, 545 },
1 <template> 1 <template>
2 - <div :style="styleObj" @click="closePressingDialog" ref="detailTable"> 2 + <div :style="styleObj" @mouseleave.stop="closePressingDialog" ref="detailTable">
3 <div class="detail-table-title title-flex-between"> 3 <div class="detail-table-title title-flex-between">
4 <div class="title-left">{{tableStyle.tableName}}</div> 4 <div class="title-left">{{tableStyle.tableName}}</div>
5 <div class="title-right"> 5 <div class="title-right">
6 <span class="title-link" @click="handlerDetailDataNoPage()">更多</span> 6 <span class="title-link" @click="handlerDetailDataNoPage()">更多</span>
7 - <span class="title-link">下载</span> 7 + <span class="title-link" @click="downloadTableList">下载</span>
8 </div> 8 </div>
9 </div> 9 </div>
10 <superslide v-if="hackReset" :options="options" class="txtScroll-top" :style="borderStyle"> 10 <superslide v-if="hackReset" :options="options" class="txtScroll-top" :style="borderStyle">
11 <!--表头--> 11 <!--表头-->
12 <div class="title"> 12 <div class="title">
  13 + <div :style="[headerTableStlye,tableRowHeight(),serialNumber]">序号</div>
13 <div 14 <div
14 v-for="(item, index) in header" 15 v-for="(item, index) in header"
15 :style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]" 16 :style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]"
16 :key="index" 17 :key="index"
  18 + :class="['padding-10',{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}]"
17 > 19 >
18 {{ item.name }} 20 {{ item.name }}
  21 +<!-- <i v-if="tableFiledSort(index)" :class="['cursorClass',{'el-icon-caret-bottom':(sortBy==item.key && sortVal=='bottom'),'el-icon-caret-top':(sortBy==item.key && sortVal=='top')}]" @click="changeSort(item)"></i>-->
  22 + <span v-if="tableFiledSort(index)" class="caret-wrapper">
  23 + <i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i>
  24 + <i class="sort-caret descending" @click="changeSort(item,'descending')"></i>
  25 + </span>
19 </div> 26 </div>
20 </div> 27 </div>
21 <!--数据--> 28 <!--数据-->
22 <div class="bd"> 29 <div class="bd">
23 <ul class="infoList"> 30 <ul class="infoList">
24 <li v-for="(item, index) in list" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" > 31 <li v-for="(item, index) in list" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" >
25 - <div class="infoList-flex" 32 + <div class="infoList-flex" :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(index),tableRowHeight(),serialNumber]">
  33 + {{ index+1 }}</div>
  34 + <div class="infoList-flex text-overflow padding-10"
26 v-for="(itemChild, idx) in header" 35 v-for="(itemChild, idx) in header"
27 :key="idx" 36 :key="idx"
28 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" 37 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
  38 + @mouseenter="pressingTimes(index,idx)"
  39 + :ref="'headerRef'+index+'-'+idx"
  40 + :data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx)"
29 > 41 >
30 - <span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"  
31 - :class="['listName',{'listName-link':item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1}]">  
32 - {{ item[itemChild.key].kpiValue}} </span>  
33 - <div class="basic-img" v-if="item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1">  
34 - <el-popover ref="popoverMenu" placement="right" trigger="click" :auto-close="200">  
35 - <template #reference>  
36 - <img class="info-img" src="@/assets/images/healthStatus/icon_row_menu.png" alt="" @click.stop="pressingTimes(index,idx)"> 42 + <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsis[index+'-'+idx]" ref="elTooltip" trigger="hover" >
  43 + <template #content>
  44 + <span>{{ item[itemChild.key].kpiValue}}</span>
37 </template> 45 </template>
38 - <!-- <div class="info-ul" v-if="pressingVisible==index+'-'+idx">-->  
39 - <div class="info-ul" style="width:140px;" >  
40 - <div class="basic-pressing-times" @click="pressingDialog(itemMenu,item[itemChild.key].kpiValue,'')" v-for="itemMenu in detailMenubox">  
41 - <i class="el-icon-link icon-div"></i>{{itemMenu.name}}  
42 - </div>  
43 - </div>  
44 - </el-popover>  
45 - </div> 46 + <span @mouseleave="" :ref="'isOverflow'+index+'-'+idx" :data-num="index+'-'+idx" @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"
  47 + :class="['listName','width-80','text-overflow',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]">
  48 + {{ item[itemChild.key].kpiValue}}
  49 + </span>
  50 + </el-tooltip>
  51 + <component v-if="itemChild.componentName && itemChild.componentName!=1" :is="itemChild.componentName" :alarmLevel="item[itemChild.key].alarmLevel?item[itemChild.key].alarmLevel:'2'" :way="item[itemChild.key].way?item[itemChild.key].way:'message'" />
  52 +
  53 + <customMenuBox ref="customMenu" v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)"
  54 + :detailMenubox="calcDetailMenubox"
  55 + :tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc"
  56 + :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
  57 +
  58 + ></customMenuBox>
46 </div> 59 </div>
47 </li> 60 </li>
48 </ul> 61 </ul>
49 </div> 62 </div>
50 </superslide> 63 </superslide>
51 -<!-- <el-dialog :visible.sync="tableVisible" :title="tableStyle.tableName" width="80%" center>-->  
52 -  
53 -<!-- <el-popover  
54 - ref="popoverRef"  
55 - v-model:visible="tableVisible"  
56 - placement="left"  
57 - trigger="click"  
58 - :title="tableStyle.tableName"  
59 - virtual-triggering  
60 - persistent 64 +<!-- 更多弹框-->
  65 + <customDialog :dialogVisible="tableVisible" :heightStyle="heightStyle" :marginStyle="marginStyle" :title-name="tableStyle.tableName"
  66 + @hideDialog="hideDialogTable" @okFunc="okFuncTable"
61 > 67 >
62 -  
63 - </el-popover>-->  
64 - <div class="dialog-div" v-if="tableVisible" :style="heightStyle">  
65 - <div class="dialog-div-content" :style="marginStyle" >  
66 - <div class="dialog-div-title title-flex-between"><span>{{tableStyle.tableName}}</span> <span class="dialog-close" @click="tableVisible = false">X</span></div> 68 + <template v-slot>
67 <div v-if="hackReset" class="txtScroll-top" > 69 <div v-if="hackReset" class="txtScroll-top" >
68 <!--表头--> 70 <!--表头-->
69 <div class="title" :style="borderStyle"> 71 <div class="title" :style="borderStyle">
  72 + <div :style="[headerTableStlye,tableRowHeight(),serialNumber]">序号</div>
70 <div 73 <div
71 v-for="(item, index) in headerAll" 74 v-for="(item, index) in headerAll"
72 :style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]" 75 :style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]"
73 :key="index" 76 :key="index"
  77 + :class="{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}"
74 > 78 >
75 {{ item.name }} 79 {{ item.name }}
  80 +<!-- <i v-if="tableFiledSort(index)" :class="['cursorClass',{'el-icon-caret-bottom':sortVal=='bottom','el-icon-caret-top':sortVal=='top'}]" @click="changeSort(item)"></i>-->
  81 + <span v-if="tableFiledSort(index)" class="caret-wrapper">
  82 + <i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i>
  83 + <i class="sort-caret descending" @click="changeSort(item,'descending')"></i>
  84 + </span>
76 </div> 85 </div>
77 </div> 86 </div>
78 <!--数据--> 87 <!--数据-->
79 <div class="bd"> 88 <div class="bd">
80 <ul class="infoList" :style="borderStyle"> 89 <ul class="infoList" :style="borderStyle">
81 <li v-for="(item, index) in listAll" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" > 90 <li v-for="(item, index) in listAll" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" >
  91 + <div class="infoList-flex" :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(index),tableRowHeight(),serialNumber]">
  92 + {{ index+1 }}</div>
82 <div class="infoList-flex" 93 <div class="infoList-flex"
83 v-for="(itemChild, idx) in headerAll" 94 v-for="(itemChild, idx) in headerAll"
84 :key="idx" 95 :key="idx"
85 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" 96 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
  97 + @mouseenter="pressingTimes(index,idx)"
86 > 98 >
87 - <span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)" :class="['listName',{'listName-link':item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1}]">  
88 - {{ item[itemChild.key].kpiValue }}</span>  
89 - <div class="basic-img" v-if="item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1">  
90 - <el-popover ref="popoverMenu" placement="right" trigger="click" :auto-close="200">  
91 - <template #reference>  
92 - <img class="info-img" src="@/assets/images/healthStatus/icon_row_menu.png" alt="" @click.stop="pressingTimes(index,idx)">  
93 - </template>  
94 - <!-- <div class="info-ul" v-if="pressingVisible==index+'-'+idx">-->  
95 - <div class="info-ul" style="width:140px;" >  
96 - <div class="basic-pressing-times" @click="pressingDialog(itemMenu,item[itemChild.key].kpiValue,'dialog')" v-for="itemMenu in detailMenubox">  
97 - <i class="el-icon-link icon-div"></i>{{itemMenu.name}}  
98 - </div>  
99 - </div>  
100 - </el-popover> 99 + <span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)"
  100 + :class="['listName',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]">
  101 + {{ item[itemChild.key]?item[itemChild.key].kpiValue:'' }}</span>
  102 + <customMenuBox v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)"
  103 + :detailMenubox="calcDetailMenubox"
  104 + :tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc"
  105 + :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
101 106
102 - </div> 107 + ></customMenuBox>
103 </div> 108 </div>
104 </li> 109 </li>
105 </ul> 110 </ul>
106 </div> 111 </div>
  112 + <!-- 分页 -->
  113 + <div class="pageClass" style='text-align: left;background-color: white'>
  114 + <el-pagination
  115 + v-if="currentPage"
  116 + @size-change="handleSizeChange"
  117 + @prev-click="prePage"
  118 + @next-click="nextPage"
  119 + @current-change="handleCurrentChange"
  120 + :current-page="currentPage"
  121 + :page-sizes="pageSizes"
  122 + :page-size="pageSize"
  123 + :total="total">
  124 + </el-pagination>
107 </div> 125 </div>
108 </div> 126 </div>
  127 + </template>
  128 + </customDialog>
  129 +<!-- 直接点击表格数据展示 性能趋势弹框-->
  130 + <customDialog :dialogVisible="trendVisible" :heightStyle="heightStyle" :marginStyle="marginStyle" :widthStyle="widthStyle" :title-name="dialogName"
  131 + :showFooter="true" :showCancelBtn="true" :showOkBtn="true" @hideDialog="hideDialog" @okFunc="okFunc"
  132 + >
  133 + <template v-slot>
  134 + <div class="txtScroll-top">
  135 + 性能趋势{{pressingValue}}
  136 + <iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/>
109 </div> 137 </div>
110 - <div class="dialog-div" v-if="dialogVisible" :style="heightStyle">  
111 - <div class="dialog-div-content" :style="marginStyle+widthStyle" >  
112 - <div class="dialog-div-title title-flex-between"><span>{{tableStyle.tableName}}</span> <span class="dialog-close" @click="dialogVisible = false">X</span></div> 138 + </template>
  139 + </customDialog>
  140 +<!-- <div class="dialog-div" v-if="tableVisible" :style="heightStyle">
  141 + <div class="dialog-div-content" :style="marginStyle" >
  142 + <div class="dialog-div-title title-flex-between"><span>{{tableStyle.tableName}}</span> <span class="dialog-close" @click="tableVisible = false">X</span></div>
  143 +
  144 + </div>
  145 + </div>-->
  146 +<!-- <customDialog :dialogVisible="dialogVisible" :heightStyle="heightStyle" :marginStyle="marginStyle" :widthStyle="widthStyle" :title-name="tableStyle.tableName"
  147 + :showFooter="true" :showCancelBtn="true" :showOkBtn="true" @hideDialog="hideDialog" @okFunc="okFunc"
  148 + >
  149 + <template v-slot>
113 <div v-if="dialogName=='alarm_setting'" class="txtScroll-top"> 150 <div v-if="dialogName=='alarm_setting'" class="txtScroll-top">
114 告警设置{{pressingValue}} 151 告警设置{{pressingValue}}
115 </div> 152 </div>
@@ -129,39 +166,36 @@ @@ -129,39 +166,36 @@
129 <div v-if="dialogName=='include_capacity_forecast'" class="txtScroll-top"> 166 <div v-if="dialogName=='include_capacity_forecast'" class="txtScroll-top">
130 纳入容量预测{{pressingValue}} 167 纳入容量预测{{pressingValue}}
131 </div> 168 </div>
132 - <div class="dialog-footer" v-if="dialogName!='table' && dialogName!='performance_trends'">  
133 - <el-button @click="dialogVisible = false">取消</el-button>  
134 - <el-button type="primary" @click="dialogVisible = false"  
135 - >确定</el-button  
136 - >  
137 - </div>  
138 - </div>  
139 -  
140 - </div>  
141 -  
142 -<!-- <template #footer>  
143 - <span class="dialog-footer">  
144 - <el-button @click="tableVisible = false">取消</el-button>  
145 - <el-button type="primary" @click="tableVisible = false"  
146 - >确定</el-button  
147 - >  
148 - </span>  
149 </template> 169 </template>
150 - </el-dialog>--> 170 + </customDialog>-->
  171 +
151 </div> 172 </div>
152 </template> 173 </template>
153 <script> 174 <script>
154 import vue from "vue"; 175 import vue from "vue";
155 import VueSuperSlide from "vue-superslide"; 176 import VueSuperSlide from "vue-superslide";
156 import {getDetailTableData,getDetailTableDataNoPage} from "@/api/platform"; 177 import {getDetailTableData,getDetailTableDataNoPage} from "@/api/platform";
  178 +import customDialog from "../../designerComponents/customDialog";
  179 +import customMenuBox from "../../designerComponents/customMenuBox";//下探组件
  180 +import textToImage from "../../designerComponents/textToImage";//文字转图片
  181 +import textToBg from "../../designerComponents/textToBg";//文字转背景
  182 +
157 vue.use(VueSuperSlide); 183 vue.use(VueSuperSlide);
158 export default { 184 export default {
159 props: { 185 props: {
160 value: Object, 186 value: Object,
161 ispreview: Boolean 187 ispreview: Boolean
162 }, 188 },
  189 + components:{
  190 + customDialog,customMenuBox,textToImage,textToBg
  191 + },
163 data() { 192 data() {
164 return { 193 return {
  194 + currentPage:1,
  195 + pageSize:10,
  196 + pageSizes:[10,50,100, 200, 300, 400],
  197 + total:0,
  198 + trendVisible:false,//性能趋势弹框
165 headerAll:[], 199 headerAll:[],
166 listAll:[], 200 listAll:[],
167 tableVisible:false,//更多表格弹框 201 tableVisible:false,//更多表格弹框
@@ -185,44 +219,53 @@ export default { @@ -185,44 +219,53 @@ export default {
185 optionsData: {}, 219 optionsData: {},
186 pressingVisible:'', 220 pressingVisible:'',
187 isHover:false, 221 isHover:false,
188 - detailMenubox:[ 222 + /*detailMenubox:[
189 { 223 {
190 name:'告警设置', 224 name:'告警设置',
191 - type:'alarm_setting' 225 + type:'alarm_setting',
  226 + isDisplay:true
192 }, 227 },
193 { 228 {
194 name:'过滤单指标', 229 name:'过滤单指标',
195 - type:'filter_sheet_indicator' 230 + type:'filter_sheet_indicator',
  231 + isDisplay:true
196 }, 232 },
197 { 233 {
198 name:'过滤多指标', 234 name:'过滤多指标',
199 - type:'filter_multiple_indicators' 235 + type:'filter_multiple_indicators',
  236 + isDisplay:true
200 }, 237 },
201 { 238 {
202 name:'性能趋势', 239 name:'性能趋势',
203 - type:'performance_trends' 240 + type:'performance_trends',
  241 + isDisplay:true
204 }, 242 },
205 { 243 {
206 name:'压制次数', 244 name:'压制次数',
207 - type:'pressing_times' 245 + type:'pressing_times',
  246 + isDisplay:true
208 }, 247 },
209 { 248 {
210 name:'纳入容量预测', 249 name:'纳入容量预测',
211 - type:'include_capacity_forecast' 250 + type:'include_capacity_forecast',
  251 + isDisplay:true
212 } 252 }
213 - ], 253 + ],*/
214 dialogName:'',//表格名称 254 dialogName:'',//表格名称
215 pressingValue:'',//表格下探值 255 pressingValue:'',//表格下探值
216 trendSrc:'',//性能走势图地址 256 trendSrc:'',//性能走势图地址
217 marginStyle:'',//弹框距离顶部距离 257 marginStyle:'',//弹框距离顶部距离
218 heightStyle:'',//弹框遮罩层高度 258 heightStyle:'',//弹框遮罩层高度
219 widthStyle:';',//弹框宽度样式 259 widthStyle:';',//弹框宽度样式
220 - 260 + sortVal:'bottom',//排序方式
  261 + sortBy:'',//排序参数
  262 + sortCaret:'',//正序倒序
  263 + isEllipsis:[],//是否文字超出
  264 + componentName:'',//组件名称
221 }; 265 };
222 }, 266 },
223 computed: { 267 computed: {
224 styleObj() { 268 styleObj() {
225 - // console.log(this.optionsSetUp);  
226 const allStyle = this.optionsPosition; 269 const allStyle = this.optionsPosition;
227 return { 270 return {
228 position: this.ispreview ? "absolute" : "static", 271 position: this.ispreview ? "absolute" : "static",
@@ -262,6 +305,13 @@ export default { @@ -262,6 +305,13 @@ export default {
262 "border-bottom":'none', 305 "border-bottom":'none',
263 }; 306 };
264 }, 307 },
  308 + serialNumber(){
  309 + const headStyle = this.optionsSetUp;
  310 + return{
  311 + width:'30%',
  312 + display:headStyle.isSerialNumber?"block":"none",
  313 + }
  314 + },
265 borderStyle(){ 315 borderStyle(){
266 const bodyStyle = this.optionsSetUp; 316 const bodyStyle = this.optionsSetUp;
267 return{ 317 return{
@@ -275,6 +325,48 @@ export default { @@ -275,6 +325,48 @@ export default {
275 return{ 325 return{
276 tableName:tableStyleSetup.tableName 326 tableName:tableStyleSetup.tableName
277 } 327 }
  328 + },
  329 + //表格下探列表
  330 + calcDetailMenubox(){
  331 + const menubox = this.optionsSetUp;
  332 + let detailMenuBox=[];
  333 + if(menubox.alarm_setting){
  334 + detailMenuBox.push({
  335 + name:'告警设置',
  336 + type:'alarm_setting'
  337 + })
  338 + }
  339 + if(menubox.filter_sheet_indicator){
  340 + detailMenuBox.push({
  341 + name:'过滤单指标',
  342 + type:'filter_sheet_indicator'
  343 + })
  344 + }
  345 + if(menubox.filter_multiple_indicators){
  346 + detailMenuBox.push({
  347 + name:'过滤多指标',
  348 + type:'filter_multiple_indicators'
  349 + })
  350 + }
  351 + if(menubox.performance_trends){
  352 + detailMenuBox.push({
  353 + name:'性能趋势',
  354 + type:'performance_trends'
  355 + })
  356 + }
  357 + if(menubox.pressing_times){
  358 + detailMenuBox.push({
  359 + name:'压制次数',
  360 + type:'pressing_times'
  361 + })
  362 + }
  363 + if(menubox.include_capacity_forecast){
  364 + detailMenuBox.push({
  365 + name:'纳入容量预测',
  366 + type:'include_capacity_forecast'
  367 + })
  368 + }
  369 + return detailMenuBox;
278 } 370 }
279 }, 371 },
280 watch: { 372 watch: {
@@ -300,7 +392,7 @@ export default { @@ -300,7 +392,7 @@ export default {
300 this.handlerHead(); 392 this.handlerHead();
301 this.handlerData(); 393 this.handlerData();
302 this.visConfig(); 394 this.visConfig();
303 - this.handlerDetailData(); 395 + // this.handlerDetailData();
304 window.addEventListener("scroll", this.handleScroll, true); //监听滚动事件 396 window.addEventListener("scroll", this.handleScroll, true); //监听滚动事件
305 }, 397 },
306 visConfig(){ 398 visConfig(){
@@ -325,7 +417,6 @@ export default { @@ -325,7 +417,6 @@ export default {
325 let ybNum=rollSet.ybNum?rollSet.ybNum:80; 417 let ybNum=rollSet.ybNum?rollSet.ybNum:80;
326 let zyNum=rollSet.zyNum?rollSet.zyNum:85; 418 let zyNum=rollSet.zyNum?rollSet.zyNum:85;
327 let yzNum=rollSet.yzNum?rollSet.yzNum:95; 419 let yzNum=rollSet.yzNum?rollSet.yzNum:95;
328 - console.log("color",ybNum,rollSet.zcColor)  
329 if(val){ 420 if(val){
330 let value=val.split("%") 421 let value=val.split("%")
331 if(value && value.length>1){ 422 if(value && value.length>1){
@@ -364,22 +455,34 @@ export default { @@ -364,22 +455,34 @@ export default {
364 this.selectNum = 1; 455 this.selectNum = 1;
365 456
366 } 457 }
367 - let scroll=window.pageYOffset; 458 + // let scroll=window.pageYOffset;
  459 + let scroll=document.documentElement.scrollTop;
368 let documentHeight=document.documentElement.clientHeight; 460 let documentHeight=document.documentElement.clientHeight;
369 - console.log("123",documentHeight,scroll)  
370 - this.heightStyle="height:"+(documentHeight+scroll)+'px;';  
371 - this.marginStyle+="margin-top:"+(scroll+30)+'px;'; 461 + if (self != top) {
  462 + //嵌入到监控系统iframe中弹框位置样式
  463 + // let documentHeight=document.body.scrollHeight;
  464 + this.heightStyle="height:"+(documentHeight+230)+'px;top:'+scroll+'px';
  465 + if(scroll<600){
  466 + this.marginStyle+="margin-top:"+(110)+'px;';
  467 +
  468 + }else{
  469 + this.marginStyle+="margin-top:"+(230)+'px;';
372 470
  471 + }
  472 + }else{
  473 + //ajreport中弹框位置样式
  474 + this.heightStyle="height:"+(documentHeight+scroll)+'px;';
  475 + this.marginStyle+="margin-top:"+(scroll+100)+'px;';
  476 + }
373 }, 477 },
374 478
375 handleHeadContent(headTable,flg){ 479 handleHeadContent(headTable,flg){
376 - let data = headTable.data[0]; 480 + let data = headTable;
377 let head = data.header; 481 let head = data.header;
378 let content = data.content; 482 let content = data.content;
379 let colArr = []; 483 let colArr = [];
380 let fisttd = ""; 484 let fisttd = "";
381 let datas=[]; 485 let datas=[];
382 -  
383 head.map((v) => { 486 head.map((v) => {
384 fisttd = v.id; 487 fisttd = v.id;
385 let columnObj = { 488 let columnObj = {
@@ -394,13 +497,17 @@ export default { @@ -394,13 +497,17 @@ export default {
394 if (ccv.kpiValue || ccv.kpiValue === 0) { 497 if (ccv.kpiValue || ccv.kpiValue === 0) {
395 kpi[ccv.kpiId] = ccv; 498 kpi[ccv.kpiId] = ccv;
396 } else { 499 } else {
397 - kpi[ccv.kpiId] = {}; 500 + kpi[ccv.kpiId] = {
  501 + kpiValue: "",
  502 + kpiUnit: "",
  503 + kpiIdent: "0",
  504 + isWarning: 0,
  505 + };
398 } 506 }
399 507
400 }) 508 })
401 datas.push(kpi); 509 datas.push(kpi);
402 }) 510 })
403 - console.log("col",colArr)  
404 if(flg=='all'){ 511 if(flg=='all'){
405 this.headerAll=colArr; 512 this.headerAll=colArr;
406 this.listAll=datas; 513 this.listAll=datas;
@@ -408,49 +515,75 @@ export default { @@ -408,49 +515,75 @@ export default {
408 this.list=datas; 515 this.list=datas;
409 this.header=colArr; 516 this.header=colArr;
410 } 517 }
411 - console.log("datas",datas)  
412 - 518 + this.tableFiledColumnSort();
413 }, 519 },
414 - handlerDetailData(){  
415 - let headTable = getDetailTableData(); 520 + handlerDetailData(valData,sortBy){
  521 + let kpiArr=[]
  522 + let kpiIdStr='';
  523 + if(this.header && this.header.length>0){
  524 + this.header.map(item=>{
  525 + if(item.isStatic){
  526 +
  527 + }else{
  528 + kpiArr.push(item.key)
  529 + }
  530 + })
  531 + }
  532 + if(kpiArr && kpiArr.length>0){
  533 + kpiIdStr=kpiArr.join(',');
  534 + }
  535 + let param={
  536 + kpiId:kpiIdStr
  537 + }
  538 + let sort=sortBy;
  539 + if(sort){
  540 + param.sort=sort;
  541 + }
  542 + let headTable = valData;
  543 + if(kpiIdStr){
  544 + //根据kpiId集合获取表格数据
  545 + let tableData=getDetailTableData(param);
  546 + headTable=tableData.data[0];
  547 + }
  548 +
416 this.handleHeadContent(headTable) 549 this.handleHeadContent(headTable)
417 550
418 }, 551 },
419 //打开更多表格 552 //打开更多表格
420 handlerDetailDataNoPage(){ 553 handlerDetailDataNoPage(){
421 let headTable =getDetailTableDataNoPage(); 554 let headTable =getDetailTableDataNoPage();
422 - this.handleHeadContent(headTable,'all'); 555 + this.handleHeadContent(headTable.data[0],'all');
423 this.widthStyle=''; 556 this.widthStyle='';
424 // this.setDialog('table'); 557 // this.setDialog('table');
425 this.tableVisible=true; 558 this.tableVisible=true;
426 }, 559 },
427 - //打开弹框 560 + /*//打开弹框
428 setDialog(name,flg){ 561 setDialog(name,flg){
429 - console.log("123",name,flg)  
430 - /* if(flg=='dialog'){  
431 - this.tableVisible=true;  
432 562
433 - }else{  
434 -  
435 -  
436 - }*/  
437 this.dialogVisible=true; 563 this.dialogVisible=true;
438 564
439 this.dialogName=name; 565 this.dialogName=name;
440 - }, 566 + },*/
441 //点击表格内容名称事件 567 //点击表格内容名称事件
442 clickListName(obj){ 568 clickListName(obj){
443 - console.log("obj",obj) 569 + if(obj.kpiIdent==1 || obj.isWarning==1){
444 let trendsParams=obj; 570 let trendsParams=obj;
445 // this.trendSrc='http://127.0.0.1:8088/vue3/index.html#/vue3/pieDetailLine?resId=08586dba3a5b4a01ad88e8878eed6d53&kpiId=KPI7054BC34&flag=cpu&ident=1&trend=1&name=CPU%E4%BD%BF%E7%94%A8%E7%8E%87x&access_token=6e14ca48-4d05-42cf-b232-97981035824f' 571 // this.trendSrc='http://127.0.0.1:8088/vue3/index.html#/vue3/pieDetailLine?resId=08586dba3a5b4a01ad88e8878eed6d53&kpiId=KPI7054BC34&flag=cpu&ident=1&trend=1&name=CPU%E4%BD%BF%E7%94%A8%E7%8E%87x&access_token=6e14ca48-4d05-42cf-b232-97981035824f'
446 this.trendSrc='https://192.168.0.69:8088/#/user/login/redirect=%2F'; 572 this.trendSrc='https://192.168.0.69:8088/#/user/login/redirect=%2F';
447 this.widthStyle=''; 573 this.widthStyle='';
448 - this.setDialog('performance_trends') 574 + // this.setDialog('performance_trends')
  575 + this.pressingValue=obj.kpiValue;
  576 + this.dialogNameStyle(obj)
  577 +
  578 + this.trendVisible=true;
  579 + }
  580 +
449 }, 581 },
450 //End LSQ 2022/1/20 10:23 TODO 582 //End LSQ 2022/1/20 10:23 TODO
451 handlerHead() { 583 handlerHead() {
452 const head = this.optionsSetUp.dynamicAddTable; 584 const head = this.optionsSetUp.dynamicAddTable;
453 this.header = head; 585 this.header = head;
  586 + // this.headerAll=head;
454 }, 587 },
455 handlerData() { 588 handlerData() {
456 const tableData = this.optionsData; 589 const tableData = this.optionsData;
@@ -458,8 +591,12 @@ export default { @@ -458,8 +591,12 @@ export default {
458 ? this.handlerStaticData(tableData.staticData) 591 ? this.handlerStaticData(tableData.staticData)
459 : this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime); 592 : this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime);
460 }, 593 },
461 - handlerStaticData(data) {  
462 - this.list = data; 594 + handlerStaticData(headTable) {
  595 +
  596 + this.handlerDetailData(headTable[0]);
  597 +
  598 + // this.handleHeadContent(headTable[0])
  599 + // this.list = data;
463 }, 600 },
464 handlerDynamicData(data, refreshTime) { 601 handlerDynamicData(data, refreshTime) {
465 if (!data) return; 602 if (!data) return;
@@ -510,11 +647,64 @@ export default { @@ -510,11 +647,64 @@ export default {
510 tableFiledWidth(index){ 647 tableFiledWidth(index){
511 var styleJson = {}; 648 var styleJson = {};
512 if(this.optionsSetUp.dynamicAddTable[index] && this.optionsSetUp.dynamicAddTable[index].width ){ 649 if(this.optionsSetUp.dynamicAddTable[index] && this.optionsSetUp.dynamicAddTable[index].width ){
513 - styleJson["width"] = this.optionsSetUp.dynamicAddTable[index].width 650 + styleJson["width"] = this.optionsSetUp.dynamicAddTable[index].width;
514 } 651 }
515 return styleJson 652 return styleJson
516 }, 653 },
517 - //表格下探 654 + //列最大宽
  655 + tableFiledMaxWidth(obj,index,idx){
  656 + let that=this;
  657 + this.$nextTick(() => {
  658 + let isOverflow=that.$refs[obj];
  659 + if(isOverflow && isOverflow[0]){
  660 + let cWidth = isOverflow[0].parentElement.scrollWidth;
  661 + let sWidth = isOverflow[0].scrollWidth;
  662 + that.isEllipsis[index+'-'+idx]=!((sWidth+10) > cWidth);
  663 + }
  664 +
  665 + })
  666 + },
  667 + //列是否排序
  668 + tableFiledSort(index){
  669 + let isSort=false;
  670 + if(this.optionsSetUp.dynamicAddTable[index] && this.optionsSetUp.dynamicAddTable[index].sort ){
  671 + isSort = this.optionsSetUp.dynamicAddTable[index].sort;
  672 + }
  673 + return isSort;
  674 + },
  675 + //列展示的排序位置
  676 + tableFiledColumnSort(){
  677 + let headerSet=this.optionsSetUp.dynamicAddTable;
  678 + headerSet.map(item=>{
  679 + this.header.map(v=>{
  680 + if(item.key==v.key){
  681 + v.columnSort=item.columnSort;
  682 + v.sort=item.sort?item.sort:false;
  683 + v.componentName=item.componentName?item.componentName:1;
  684 + }
  685 + })
  686 + if(this.headerAll && this.headerAll.length>0){
  687 + this.headerAll.map(v=>{
  688 + if(item.key==v.key){
  689 + v.columnSort=item.columnSort;
  690 + v.sort=item.sort?item.sort:false;
  691 + v.componentName=item.componentName?item.componentName:1;
  692 + }
  693 + })
  694 + }
  695 +
  696 + })
  697 + this.header.sort(this.compare('columnSort'))
  698 + this.headerAll.sort(this.compare('columnSort'))
  699 + },
  700 + compare(property){
  701 + return function(a,b){
  702 + let value1 = a[property];
  703 + let value2 = b[property];
  704 + return value1 - value2;
  705 + }
  706 + },
  707 + /* //表格下探
518 pressingDialog(itemMenu,value,flg){ 708 pressingDialog(itemMenu,value,flg){
519 this.pressingValue=value; 709 this.pressingValue=value;
520 let styleStr='width: 300px;height: 200px;min-height: 200px;overflow: hidden;' 710 let styleStr='width: 300px;height: 200px;min-height: 200px;overflow: hidden;'
@@ -548,18 +738,116 @@ export default { @@ -548,18 +738,116 @@ export default {
548 } 738 }
549 // this.$refs.popoverMenu.showPopper = false; 739 // this.$refs.popoverMenu.showPopper = false;
550 740
551 - }, 741 + },*/
552 pressingTimes(index,idx){ 742 pressingTimes(index,idx){
553 this.pressingVisible=index+'-'+idx; 743 this.pressingVisible=index+'-'+idx;
554 }, 744 },
555 closePressingDialog(){ 745 closePressingDialog(){
556 - this.pressingVisible=false; 746 + // this.pressingVisible=false;
  747 + },
  748 + //弹框关闭确定
  749 + hideDialog(){
  750 + this.trendVisible=false;
  751 + },
  752 + okFunc(){
  753 + this.trendVisible=false;
  754 + },
  755 + //更多弹框关闭确定
  756 + hideDialogTable(){
  757 + this.tableVisible=false;
  758 + },
  759 + okFuncTable(){
  760 + this.tableVisible=false;
  761 +
  762 + },
  763 + //排序
  764 + changeSort(item,flg){
  765 + if(this.sortCaret==flg){
  766 + this.sortCaret='';
  767 + this.sortBy='';
  768 + }else{
  769 + this.sortCaret=flg;
  770 + this.sortBy=item.key;
  771 + }
  772 + if(this.sortCaret=='ascending'){
  773 + //正序
  774 + }else if(this.sortCaret=='ascending'){
  775 + //倒序
  776 + }else{
  777 + //不排序
  778 + }
  779 + // this.handlerDetailData('',item.key)
  780 + // this.handlerDetailDataNoPage();
  781 + },
  782 + // 每页展示多少条
  783 + handleSizeChange(val){
  784 + // 切换页码重置初始页
  785 + this.currentPage = 1
  786 + //props.pageSize = val;
  787 + this.pageSize = val;
  788 + this.handlerDetailDataNoPage();
  789 + },
  790 +
  791 + // 切换页码
  792 + handleCurrentChange(val){
  793 + //props.currentPage = val;
  794 + this.currentPage = val;
  795 + this.handlerDetailDataNoPage();
  796 + },
  797 + // 切换页码
  798 + prePage(val) {
  799 + // props.currentPage = val - 1;
  800 + this.currentPage = val-1;
  801 + this.handlerDetailDataNoPage();
  802 + },
  803 +
  804 + // 切换页码
  805 + nextPage(val){
  806 + // props.currentPage = val + 1;
  807 + this.currentPage = val+1;
  808 + this.handlerDetailDataNoPage();
  809 + },
  810 + //计算弹框名称
  811 + dialogNameStyle(obj) {
  812 + const tableStyleSetup = this.optionsSetUp;
  813 + let kpiName = obj.kpiName ? '+' + obj.kpiName : '';
  814 + let dialogName = tableStyleSetup.tableName + kpiName;
  815 + if (tableStyleSetup.nameDefault) {
  816 + dialogName = tableStyleSetup.tableName + kpiName;
  817 +
  818 + } else {
  819 + let nameResType = tableStyleSetup.nameResType ? obj.resType ? obj.resType + '|' : '' : '';
  820 + let nameIPAddress = tableStyleSetup.nameIPAddress ? obj.ipAddr ? obj.ipAddr + '|' : '' : '';
  821 + let nameResName = tableStyleSetup.nameResName ? obj.resName ? obj.resName + '|' : '' : '';
  822 + let nameKpiName = tableStyleSetup.nameKpiName ? obj.kpiName ? obj.kpiName + '|' : '' : '';
  823 + let nameKpiFlg = tableStyleSetup.nameKpiFlg ? obj.flag ? obj.flag + '|' : '' : '';
  824 + let name = nameResType + nameIPAddress + nameIPAddress + nameResName + nameKpiName + nameKpiFlg;
  825 + dialogName = name.substring(0, name.length - 1);
  826 + }
  827 + this.dialogName = dialogName;
  828 + return dialogName;
  829 + },
  830 + //下载
  831 + downloadTableList(title, resId, kpiId, flagPrifix, sortBy, order){
  832 + let kpiIdArr=[];
  833 + let param={
  834 + sortBy:this.sortBy
  835 + }
  836 + this.header.map(item=>{
  837 + if(item.sort){
  838 + kpiIdArr.push(item.key)
  839 + }
  840 + })
  841 + console.log("kpiIdArr",kpiIdArr)
557 } 842 }
558 } 843 }
559 }; 844 };
560 </script> 845 </script>
561 <style lang="scss" scoped> 846 <style lang="scss" scoped>
562 /* 本例子css */ 847 /* 本例子css */
  848 +.cursorClass{
  849 + cursor: pointer;
  850 +}
563 .txtScroll-top { 851 .txtScroll-top {
564 overflow: hidden; 852 overflow: hidden;
565 position: relative; 853 position: relative;
@@ -624,8 +912,8 @@ export default { @@ -624,8 +912,8 @@ export default {
624 } 912 }
625 } 913 }
626 } 914 }
627 -.basic-img{  
628 - /*display: flex;*/ 915 +/*.basic-img{
  916 + !*display: flex;*!
629 display: none; 917 display: none;
630 cursor: pointer; 918 cursor: pointer;
631 .info-img{ 919 .info-img{
@@ -639,9 +927,9 @@ export default { @@ -639,9 +927,9 @@ export default {
639 927
640 } 928 }
641 .info-ul{ 929 .info-ul{
642 - /*position: absolute;*/ 930 + !*position: absolute;*!
643 border:1px solid #d2d2d2; 931 border:1px solid #d2d2d2;
644 - /*padding: 16px 20px;*/ 932 + !*padding: 16px 20px;*!
645 padding-bottom: 5px; 933 padding-bottom: 5px;
646 z-index: 999999; 934 z-index: 999999;
647 background: #ffffff; 935 background: #ffffff;
@@ -670,13 +958,18 @@ export default { @@ -670,13 +958,18 @@ export default {
670 } 958 }
671 } 959 }
672 960
673 -} 961 +}*/
674 .listName-link{ 962 .listName-link{
675 cursor: pointer; 963 cursor: pointer;
676 color:#0d82e9; 964 color:#0d82e9;
677 text-decoration: underline; 965 text-decoration: underline;
678 } 966 }
679 -.dialog-div{ 967 +.pageClass{
  968 + position: absolute;
  969 + bottom:30px;
  970 +
  971 +}
  972 +/*.dialog-div{
680 background: rgba(0, 0, 0, 0.35); 973 background: rgba(0, 0, 0, 0.35);
681 position: fixed; 974 position: fixed;
682 top: 0; 975 top: 0;
@@ -686,10 +979,10 @@ export default { @@ -686,10 +979,10 @@ export default {
686 z-index: 1; 979 z-index: 1;
687 } 980 }
688 .dialog-div-content{ 981 .dialog-div-content{
689 - /* display: flex; 982 + !* display: flex;
690 align-items: center; 983 align-items: center;
691 margin: 30px auto 0; 984 margin: 30px auto 0;
692 - flex-flow: column;*/ 985 + flex-flow: column;*!
693 width:80%; 986 width:80%;
694 min-height: 700px; 987 min-height: 700px;
695 max-height: 800px; 988 max-height: 800px;
@@ -732,5 +1025,55 @@ export default { @@ -732,5 +1025,55 @@ export default {
732 bottom: 0; 1025 bottom: 0;
733 text-align: right; 1026 text-align: right;
734 } 1027 }
  1028 +}*/
  1029 +.title .caret-wrapper {
  1030 + display: inline-flex;
  1031 + flex-direction: column;
  1032 + align-items: center;
  1033 + height: 14px;
  1034 + width: 14px;
  1035 + vertical-align: middle;
  1036 + cursor: pointer;
  1037 + overflow: initial;
  1038 + position: relative;
  1039 +}
  1040 +.title .sort-caret {
  1041 + width: 0;
  1042 + height: 0;
  1043 + border: solid 5px transparent;
  1044 + position: absolute;
  1045 + left: 1px;
  1046 +}
  1047 +.title .sort-caret.ascending {
  1048 + border-bottom-color: #c0c4cc;
  1049 + top: -5px;
  1050 +}
  1051 +.title .sort-caret.descending {
  1052 + border-top-color: #c0c4cc;
  1053 + bottom: -3px;
  1054 +}
  1055 +.title .ascending .sort-caret.ascending {
  1056 + border-bottom-color: #409eff;
  1057 +}
  1058 +.title .descending .sort-caret.descending {
  1059 + border-top-color: #409eff;
  1060 +}
  1061 +.text-overflow{
  1062 + white-space:nowrap;
  1063 + overflow:hidden;
  1064 + text-overflow:ellipsis;
  1065 +
  1066 + /*word-break: break-all;
  1067 + text-overflow: ellipsis;
  1068 + overflow: hidden;
  1069 + display: -webkit-box;
  1070 + -webkit-line-clamp: 2;
  1071 + -webkit-box-orient: vertical;*/
  1072 +}
  1073 +.width-80{
  1074 + max-width:80%;
  1075 +}
  1076 +.padding-10{
  1077 + padding:5px;
735 } 1078 }
736 </style> 1079 </style>