forked from github/dataease
Merge pull request #6946 from dataease/pr@dev-v2@perf_lark_setting
perf: 飞书设置页面重构
This commit is contained in:
commit
6317ba8a9e
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="info-template-container">
|
<div class="info-template-container">
|
||||||
<div class="info-template-header">
|
<div v-if="!props.hideHead" class="info-template-header">
|
||||||
<div class="info-template-title">
|
<div class="info-template-title">
|
||||||
<span>{{ curTitle }}</span>
|
<span>{{ curTitle }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -24,19 +24,50 @@
|
|||||||
<div class="info-item-content">
|
<div class="info-item-content">
|
||||||
<div class="info-item-pwd" v-if="item.type === 'pwd'">
|
<div class="info-item-pwd" v-if="item.type === 'pwd'">
|
||||||
<span>{{ pwdItem[item.pkey]['hidden'] ? '********' : item.pval }}</span>
|
<span>{{ pwdItem[item.pkey]['hidden'] ? '********' : item.pval }}</span>
|
||||||
<el-tooltip effect="dark" content="新页面预览" placement="top">
|
|
||||||
<el-icon
|
<el-tooltip
|
||||||
class="hover-icon hover-icon-in-table switch-pwd-icon"
|
v-if="props.copyList.includes(item.pkey)"
|
||||||
@click="switchPwd(item.pkey)"
|
effect="dark"
|
||||||
>
|
:content="t('common.copy')"
|
||||||
<Icon :name="pwdItem[item.pkey]['hidden'] ? 'eye' : 'eye-open'"></Icon>
|
placement="top"
|
||||||
</el-icon>
|
>
|
||||||
|
<el-button text @click="copyVal(item.pval)" class="setting-tip-btn">
|
||||||
|
<template #icon>
|
||||||
|
<Icon name="de-copy"></Icon>
|
||||||
|
</template>
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
|
||||||
|
<el-tooltip
|
||||||
|
effect="dark"
|
||||||
|
:content="pwdItem[item.pkey]['hidden'] ? '点击隐藏' : '点击显示'"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<el-button text @click="switchPwd(item.pkey)" class="setting-tip-btn">
|
||||||
|
<template #icon>
|
||||||
|
<Icon :name="pwdItem[item.pkey]['hidden'] ? 'eye' : 'eye-open'"></Icon>
|
||||||
|
</template>
|
||||||
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<span v-else-if="item.pkey.includes('basic.dsIntervalTime')">
|
<span v-else-if="item.pkey.includes('basic.dsIntervalTime')">
|
||||||
<span>{{ item.pval + ' ' + executeTime + '执行一次' }}</span>
|
<span>{{ item.pval + ' ' + executeTime + '执行一次' }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-else>{{ item.pval }}</span>
|
<span v-else>
|
||||||
|
<span>{{ item.pval }}</span>
|
||||||
|
<el-tooltip
|
||||||
|
v-if="props.copyList.includes(item.pkey)"
|
||||||
|
effect="dark"
|
||||||
|
:content="t('common.copy')"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<el-button text @click="copyVal(item.pval)" class="setting-tip-btn">
|
||||||
|
<template #icon>
|
||||||
|
<Icon name="de-copy"></Icon>
|
||||||
|
</template>
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -46,6 +77,9 @@
|
|||||||
import { ref, defineProps, PropType, computed } from 'vue'
|
import { ref, defineProps, PropType, computed } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { SettingRecord, ToolTipRecord } from './SettingTemplate'
|
import { SettingRecord, ToolTipRecord } from './SettingTemplate'
|
||||||
|
import useClipboard from 'vue-clipboard3'
|
||||||
|
import { ElMessage } from 'element-plus-secondary'
|
||||||
|
const { toClipboard } = useClipboard()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
settingKey: {
|
settingKey: {
|
||||||
@ -63,13 +97,28 @@ const props = defineProps({
|
|||||||
settingTitle: {
|
settingTitle: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '基础设置'
|
default: '基础设置'
|
||||||
|
},
|
||||||
|
hideHead: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
copyList: {
|
||||||
|
type: Array as PropType<string[]>,
|
||||||
|
default: () => []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const executeTime = ref('0分0秒')
|
const executeTime = ref('0分0秒')
|
||||||
const curTitle = computed(() => {
|
const curTitle = computed(() => {
|
||||||
return props.settingTitle
|
return props.settingTitle
|
||||||
})
|
})
|
||||||
|
const copyVal = async val => {
|
||||||
|
try {
|
||||||
|
await toClipboard(val)
|
||||||
|
ElMessage.success(t('common.copy_success'))
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.warning(t('common.copy_unsupported'), e)
|
||||||
|
}
|
||||||
|
}
|
||||||
const loadList = () => {
|
const loadList = () => {
|
||||||
settingList.value = []
|
settingList.value = []
|
||||||
if (props.settingData?.length) {
|
if (props.settingData?.length) {
|
||||||
@ -133,6 +182,11 @@ formatLabel()
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scope>
|
<style lang="less" scope>
|
||||||
|
.setting-tip-btn {
|
||||||
|
height: 22px !important;
|
||||||
|
line-height: 22px !important;
|
||||||
|
margin-left: 2px !important;
|
||||||
|
}
|
||||||
.info-template-container {
|
.info-template-container {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
.info-template-header {
|
.info-template-header {
|
||||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
|||||||
Subproject commit 3ac39a121cd415012d66c912ccd788ac1272aaf6
|
Subproject commit 0d5c846bffb10aaaf57253d09912bbbff1401fe2
|
@ -1,5 +1,6 @@
|
|||||||
package io.dataease.api.lark.api;
|
package io.dataease.api.lark.api;
|
||||||
|
|
||||||
|
import io.dataease.api.lark.dto.LarkEnableEditor;
|
||||||
import io.dataease.api.lark.dto.LarkTokenRequest;
|
import io.dataease.api.lark.dto.LarkTokenRequest;
|
||||||
import io.dataease.api.lark.vo.LarkInfoVO;
|
import io.dataease.api.lark.vo.LarkInfoVO;
|
||||||
import io.dataease.api.lark.dto.LarkSettingCreator;
|
import io.dataease.api.lark.dto.LarkSettingCreator;
|
||||||
@ -18,4 +19,7 @@ public interface LarkApi {
|
|||||||
@PostMapping("/token")
|
@PostMapping("/token")
|
||||||
String larkToken(@RequestBody LarkTokenRequest request);
|
String larkToken(@RequestBody LarkTokenRequest request);
|
||||||
|
|
||||||
|
@PostMapping("/switchEnable")
|
||||||
|
void switchEnable(@RequestBody LarkEnableEditor editor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package io.dataease.api.lark.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LarkEnableEditor implements Serializable {
|
||||||
|
|
||||||
|
private boolean enable;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user