Merge branch 'dev-3.4' of git.mesalab.cn:nezha/nezha-fronted into dev-3.4

This commit is contained in:
zyh
2022-06-27 10:28:47 +08:00
4 changed files with 35 additions and 17 deletions

View File

@@ -291,8 +291,11 @@ export function moveElementAwayFromCollision (layout, collidesWith, itemToMove,
// Previously this was optimized to move below the collision directly, but this can cause problems
// with cascading moves, as an item may actually leapflog a collision and cause a reversal in order.
return moveElement(layout, itemToMove, undefined, itemToMove.y + 0.15, preventCollision)
let addY = 0.15
if (itemToMove.groupId) {
addY = 1
}
return moveElement(layout, itemToMove, undefined, itemToMove.y + addY, preventCollision)
}
/**

View File

@@ -479,6 +479,9 @@ export default {
// } catch (e) {
// console.info(e)
// }
if (item.y < 0) {
item.y = 0
}
height = (item.type === 'group' && item.param.collapse) ? this.headerH : item.height
// param.showHeader = true
if (param.valueMapping) {

View File

@@ -39,7 +39,7 @@
<el-input slot="reference" maxlength="64" show-word-limit v-model="scope.row[item.prop]" size="small" ></el-input>
</el-popover>
</template>
<template v-if="item.prop == 'role'">
<!-- <template v-if="item.prop == 'role'">
<el-popover :content="rules.roleId.message" placement="top" trigger="manual" v-model="rules.roleId.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.roleId)">
<el-select v-model="scope.row[item.prop]" size="small" :placeholder="$t('el.select.placeholder')" value-key="id" slot="reference" popper-class="api-select right-box-select-top right-public-box-dropdown-top role-system-table">
<template v-for="role in roles" >
@@ -47,7 +47,7 @@
</template>
</el-select>
</el-popover>
</template>
</template> -->
<template v-if="item.prop == 'expireAt'">
<!-- <el-popover :content="rules.expireAt.message" placement="top" trigger="manual" v-model="rules.expireAt.switch" popper-class="small-pop warn-pop" @after-enter="popShow(rules.expireAt)">-->
<my-date-picker
@@ -68,15 +68,21 @@
<template v-if="item.prop == 'createUser'">
{{scope.row[item.prop]?scope.row[item.prop].name:'-'}}
</template>
<template v-else-if="item.prop == 'role'">
<!-- <template v-else-if="item.prop == 'role'">
{{scope.row[item.prop]?scope.row[item.prop].name:'-'}}
</template>
</template> -->
<template v-else-if="item.prop == 'expireAt'">
{{scope.row[item.prop]?utcTimeToTimezoneStr(scope.row[item.prop]):$t('config.system.apiKey.noExpire')}}
</template>
<template v-else-if="item.prop == 'createAt'">
{{scope.row[item.prop]?utcTimeToTimezoneStr(scope.row[item.prop]):$t('config.system.apiKey.noExpire')}}
</template>
<template v-else-if="item.prop == 'token'">
<div style="cursor:text" class="document-copy-block">
<span class="document-copy-text"> {{scope.row[item.prop].replace(reg, '*')}}</span>
<i class="nz-icon nz-icon-override" style="cursor: pointer;visibility: hidden" @click="onCopy(scope.row[item.prop])"></i>
</div>
</template>
<template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
<template v-else>-</template>
</template>
@@ -133,12 +139,14 @@ export default {
}, {
label: this.$t('apiKey.key'),
prop: 'token',
show: true
}, {
label: this.$t('profile.role'),
prop: 'role',
show: true
}, {
show: false
},
// {
// label: this.$t('profile.role'),
// prop: 'role',
// show: true
// },
{
label: this.$t('config.system.apiKey.expireAt'),
prop: 'expireAt',
show: true
@@ -164,7 +172,8 @@ export default {
disabledDate (time) {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000
}
}
},
reg: new RegExp("(?<=.{8}).", 'g')
}
},
methods: {
@@ -203,7 +212,6 @@ export default {
}
},
mounted () {
}
}
</script>

View File

@@ -40,7 +40,10 @@
{{scope.row[item.prop]?scope.row[item.prop]:'-'}}
</template>
<template v-if="item.prop == 'token'">
{{scope.row[item.prop]?scope.row[item.prop]:'-'}}
<div style="cursor:text" class="document-copy-block">
<span class="document-copy-text"> {{scope.row[item.prop]?scope.row[item.prop].replace(reg, '*'):'-'}}</span>
<i class="nz-icon nz-icon-override" style="cursor: pointer;visibility: hidden" @click="onCopy(scope.row[item.prop])"></i>
</div>
</template>
<template v-if="item.prop == 'expireAt'">
{{scope.row[item.prop]?utcTimeToTimezoneStr(scope.row[item.prop]):'-'}}
@@ -106,7 +109,7 @@ export default {
label: this.$t('asset.talon.token'),
prop: 'token',
minWidth: 180,
show: true
show: false
}, {
label: this.$t('config.system.apiKey.expireAt'),
prop: 'expireAt',
@@ -123,7 +126,8 @@ export default {
minWidth: 100,
show: true
}
]
],
reg: new RegExp("(?<=.{8}).", 'g')
}
},
methods: {