CN-599 fix: 新报告功能问题修复

This commit is contained in:
chenjinsong
2022-06-09 13:52:57 +08:00
parent 2f6a4827fd
commit abe1d18f18
3 changed files with 35 additions and 27 deletions

View File

@@ -123,6 +123,11 @@
position: relative; position: relative;
font-size: 16px; font-size: 16px;
} }
.table-operation-item--disabled {
cursor: not-allowed;
filter: grayscale(1);
opacity: .6;
}
} }
} }
} }

View File

@@ -11,7 +11,7 @@
<el-form ref="userForm" :model="editObject" :rules="rules" label-position="top" label-width="120px"> <el-form ref="userForm" :model="editObject" :rules="rules" label-position="top" label-width="120px">
<!--name--> <!--name-->
<el-form-item :label="$t('report.name')" prop="name"> <el-form-item :label="$t('report.name')" prop="name">
<el-input id="account-input-name" v-model="editObject.name" maxlength="64" placeholder="" show-word-limit size="small" type="text"></el-input> <el-input id="account-input-name" v-model="editObject.name" maxlength="64" placeholder=" " show-word-limit size="small" type="text"></el-input>
</el-form-item> </el-form-item>
<!--time limit--> <!--time limit-->
<el-form-item :label="$t('report.timeLimit')" prop="timeLimit"> <el-form-item :label="$t('report.timeLimit')" prop="timeLimit">
@@ -20,7 +20,7 @@
class="right-box__select" class="right-box__select"
collapse-tags collapse-tags
:disabled="!!editObject.id" :disabled="!!editObject.id"
placeholder="" placeholder=" "
popper-class="right-box-select-dropdown right-box-select-report " popper-class="right-box-select-dropdown right-box-select-report "
size="small" size="small"
@change="timeConfigTypeChange" @change="timeConfigTypeChange"
@@ -34,9 +34,8 @@
:disabled="!!editObject.id" :disabled="!!editObject.id"
v-model="editObject.config.timeConfig.unit" v-model="editObject.config.timeConfig.unit"
class="right-box__select" class="right-box__select"
clearable
collapse-tags collapse-tags
placeholder="" placeholder=" "
popper-class="right-box-select-dropdown right-box-select-report " popper-class="right-box-select-dropdown right-box-select-report "
size="small" size="small"
@change="()=>{ this.$forceUpdate() }"> @change="()=>{ this.$forceUpdate() }">
@@ -46,17 +45,16 @@
</el-select> </el-select>
</template> </template>
<div v-else-if="editObject.config.timeConfig.type === 'last' || editObject.config.timeConfig.type === 'previous'" style="display: flex;"> <div v-else-if="editObject.config.timeConfig.type === 'last' || editObject.config.timeConfig.type === 'previous'" style="display: flex;">
<el-input v-model.number="editObject.config.timeConfig.offset" size="small" class="el-input-single" placeholder="" :disabled="!!editObject.id"> <el-input v-model.number="editObject.config.timeConfig.offset" size="small" class="el-input-single" placeholder=" " :disabled="!!editObject.id">
<template #prepend><i @click="timeOffsetHandle('m')" class="cn-icon cn-icon-a-"></i></template> <template #prepend><i @click="timeOffsetHandle('m')" class="cn-icon cn-icon-a-"></i></template>
<template #append><i @click="timeOffsetHandle('p')" class="cn-icon cn-icon-a-1"></i></template> <template #append><i @click="timeOffsetHandle('p')" class="cn-icon cn-icon-a-1"></i></template>
</el-input> </el-input>
<el-select id="reportBoxTimeUnitSelect" <el-select id="reportBoxTimeUnitSelect"
v-model="editObject.config.timeConfig.unit" v-model="editObject.config.timeConfig.unit"
class="right-box__select right-box__select-single" class="right-box__select right-box__select-single"
clearable
collapse-tags collapse-tags
:disabled="!!editObject.id" :disabled="!!editObject.id"
placeholder="" placeholder=" "
popper-class="right-box-select-dropdown el-select-last" popper-class="right-box-select-dropdown el-select-last"
size="small" size="small"
@change="()=>{ this.$forceUpdate() }"> @change="()=>{ this.$forceUpdate() }">
@@ -78,7 +76,7 @@
:disabled="!!editObject.id" :disabled="!!editObject.id"
prefix-icon="cn-icon cn-icon-shijian" prefix-icon="cn-icon cn-icon-shijian"
type="datetime" type="datetime"
placeholder="" placeholder=" "
/> />
</div> </div>
</div> </div>
@@ -95,7 +93,7 @@
:disabled="!!editObject.id" :disabled="!!editObject.id"
prefix-icon="cn-icon cn-icon-shijian" prefix-icon="cn-icon cn-icon-shijian"
type="datetime" type="datetime"
placeholder="" placeholder=" "
/> />
</div> </div>
</div> </div>
@@ -110,7 +108,7 @@
</div> </div>
<div class="enable-tabs-daily" v-if="scheduleType === scheduleTypeList[0].value"> <div class="enable-tabs-daily" v-if="scheduleType === scheduleTypeList[0].value">
<div class="enable-tabs-custom">{{$t('report.customEvery')}}</div> <div class="enable-tabs-custom">{{$t('report.customEvery')}}</div>
<el-input v-model.number="editObject.config.schedulerConfig.interval" size="small" placeholder="" style="margin-top: 0.3125rem;" :disabled="!!editObject.id"> <el-input v-model.number="editObject.config.schedulerConfig.interval" size="small" placeholder=" " style="margin-top: 0.3125rem;" :disabled="!!editObject.id">
<template #append>{{$t('report.day')}}</template> <template #append>{{$t('report.day')}}</template>
</el-input> </el-input>
</div> </div>
@@ -135,7 +133,7 @@
<!-- 自定义月循环 --> <!-- 自定义月循环 -->
<template v-if="monthIsCycle"> <template v-if="monthIsCycle">
<div class="enable-tabs-custom">{{$t('report.customEvery')}}</div> <div class="enable-tabs-custom">{{$t('report.customEvery')}}</div>
<el-input v-model="editObject.config.schedulerConfig.interval" size="small" placeholder="" style="margin-top: 0.3125rem;" :disabled="!!editObject.id"> <el-input v-model="editObject.config.schedulerConfig.interval" size="small" placeholder=" " style="margin-top: 0.3125rem;" :disabled="!!editObject.id">
<template #append>{{$t('report.moon')}}</template> <template #append>{{$t('report.moon')}}</template>
</el-input> </el-input>
</template> </template>
@@ -165,7 +163,7 @@
v-model="editObject.config.schedulerConfig.monthWeekDates" v-model="editObject.config.schedulerConfig.monthWeekDates"
class="right-box__select" class="right-box__select"
multiple multiple
placeholder="" placeholder=" "
:disabled="!!editObject.id" :disabled="!!editObject.id"
popper-class="right-box-select-dropdown right-box-select-report " popper-class="right-box-select-dropdown right-box-select-report "
size="small" size="small"
@@ -195,7 +193,7 @@
:format="dateFormat" :format="dateFormat"
prefix-icon="cn-icon cn-icon-shijian" prefix-icon="cn-icon cn-icon-shijian"
type="datetime" type="datetime"
placeholder="" placeholder=" "
/> />
</div> </div>
</div> </div>
@@ -211,7 +209,7 @@
:format="dateFormat" :format="dateFormat"
prefix-icon="cn-icon cn-icon-shijian" prefix-icon="cn-icon cn-icon-shijian"
type="datetime" type="datetime"
placeholder="" placeholder=" "
/> />
</div> </div>
</div> </div>
@@ -221,9 +219,8 @@
<el-select id="account-input-roleIds" <el-select id="account-input-roleIds"
v-model="editObject.categoryId" v-model="editObject.categoryId"
class="right-box__select" class="right-box__select"
clearable
collapse-tags collapse-tags
placeholder="" placeholder=" "
:disabled="!!editObject.id" :disabled="!!editObject.id"
popper-class="right-box-select-dropdown right-box-select-report " popper-class="right-box-select-dropdown right-box-select-report "
size="small" size="small"
@@ -235,7 +232,7 @@
</el-form-item> </el-form-item>
<!-- 参数 --> <!-- 参数 -->
<el-form-item :label="$t('config.operationlog.params')" prop="params" v-if="categoryParams.length > 0"> <el-form-item :label="$t('config.operationlog.params')" prop="params" v-if="categoryParams.length > 0">
<el-input v-model="param.value" placeholder="" v-for="(param, index) in categoryParams" :key="index" size="small" style="vertical-align: unset;" :disabled="!!editObject.id"> <el-input v-model="param.value" placeholder=" " v-for="(param, index) in categoryParams" :key="index" size="small" style="vertical-align: unset;" :disabled="!!editObject.id">
<template #prepend>{{param.key}}</template> <template #prepend>{{param.key}}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>

View File

@@ -19,7 +19,7 @@
<loading :loading="loadingDown"></loading> <loading :loading="loadingDown"></loading>
<div class="block drop-down-time"> <div class="block drop-down-time">
<el-date-picker <el-date-picker
v-model="value" v-model="timeRange"
size="small" size="small"
:format="format" :format="format"
type="datetimerange" type="datetimerange"
@@ -33,7 +33,7 @@
<div class="expand-cell" v-for="(item, index) in downDataList" :key="index"> <div class="expand-cell" v-for="(item, index) in downDataList" :key="index">
<div class="expand-right"> <div class="expand-right">
<div class="demo-progress"> <div class="demo-progress">
<el-progress type="circle" :percentage="item.percent * 100" :color="item.percent === 1 ? '#21bf9a' : '#50b3ef'"> <el-progress type="circle" :percentage="item.percent === 1 ? 100 : parseFloat(item.percent * 100).toFixed(2)" :color="item.percent === 1 ? '#21bf9a' : '#50b3ef'">
<template #default="{ percentage }"> <template #default="{ percentage }">
<span style="font-size: 0.875rem;">{{ percentage }}%</span> <span style="font-size: 0.875rem;">{{ percentage }}%</span>
</template> </template>
@@ -47,13 +47,13 @@
<div>{{dateFormatByAppearance(item.ctime)}}</div> <div>{{dateFormatByAppearance(item.ctime)}}</div>
</div> </div>
<div class="expand-icon"> <div class="expand-icon">
<div class="table-operation-item--no-border" @click="tableOperation(['download', item])"> <div class="table-operation-item--no-border" :class="{'table-operation-item--disabled': item.percent < 1}" @click="reportOperation(['download', item])">
<loading :loading="loadingTableId === item.id"></loading> <loading :loading="loadingTableId === item.id"></loading>
<svg class="icon" aria-hidden="true" :class="{'table-operation-all-loading': loadingTableId}"> <svg class="icon" aria-hidden="true" :class="{'table-operation-all-loading': loadingTableId}">
<use xlink:href="#cn-icon-download2"></use> <use xlink:href="#cn-icon-download2"></use>
</svg> </svg>
</div> </div>
<div class="table-operation-item--no-border" @click="tableOperation(['preview', item])"> <div class="table-operation-item--no-border" :class="{'table-operation-item--disabled': item.percent < 1}" @click="reportOperation(['preview', item])">
<loading :loading="loadingPreviewId === item.id"></loading> <loading :loading="loadingPreviewId === item.id"></loading>
<svg class="icon" aria-hidden="true" :class="{'table-operation-all-loading': loadingPreviewId}"> <svg class="icon" aria-hidden="true" :class="{'table-operation-all-loading': loadingPreviewId}">
<use xlink:href="#cn-icon-preview"></use> <use xlink:href="#cn-icon-preview"></use>
@@ -151,7 +151,7 @@ import { del, get } from '@/utils/http'
import { api } from '@/utils/api' import { api } from '@/utils/api'
import { storageKey } from '@/utils/constants' import { storageKey } from '@/utils/constants'
import { ref } from 'vue' import { ref } from 'vue'
import { dateFormatToUTC } from '@/utils/date-util' import {dateFormatToUTC, getNowTime} from '@/utils/date-util'
import chartDetectionPagination from '@/views/charts/charts/chartDetectionPagination' import chartDetectionPagination from '@/views/charts/charts/chartDetectionPagination'
export default { export default {
name: 'builtinReportTable', name: 'builtinReportTable',
@@ -230,7 +230,7 @@ export default {
let str = '' let str = ''
if (row.config && row.config.timeConfig && row.config.timeConfig.type) { if (row.config && row.config.timeConfig && row.config.timeConfig.type) {
str += row.config.timeConfig.type str += row.config.timeConfig.type
if (row.config.timeConfig.offset) { if (['today', 'yesterday', 'this', 'customize'].indexOf(row.config.timeConfig.type) === -1 && row.config.timeConfig.offset) {
str += ` ${row.config.timeConfig.offset} ${row.config.timeConfig.unit}` str += ` ${row.config.timeConfig.offset} ${row.config.timeConfig.unit}`
} }
} }
@@ -246,6 +246,11 @@ export default {
return this.$t('overall.inProgress') return this.$t('overall.inProgress')
} }
}, },
reportOperation (arr) {
if (arr[1].percent === 1) {
this.tableOperation(arr)
}
},
selectionChange (objs) { selectionChange (objs) {
this.$emit('selectionChange', objs) this.$emit('selectionChange', objs)
this.checkboxIds = objs.map(item => { return item.id }).join(',') this.checkboxIds = objs.map(item => { return item.id }).join(',')
@@ -271,8 +276,8 @@ export default {
datePickerChange (row) { datePickerChange (row) {
const param = { const param = {
tempId: row.id, tempId: row.id,
startTime: dateFormatToUTC(this.value[0]), startTime: dateFormatToUTC(this.timeRange[0]),
endTime: dateFormatToUTC(this.value[1]), endTime: dateFormatToUTC(this.timeRange[1]),
...this.pageObj ...this.pageObj
} }
this.dropDownQueryChange(param) this.dropDownQueryChange(param)
@@ -316,9 +321,10 @@ export default {
} }
}, },
setup () { setup () {
const value = ref('') const { startTime, endTime } = getNowTime(60 * 24 * 30)
const timeRange = ref([startTime, endTime])
return { return {
value timeRange
} }
} }
} }