Merge remote-tracking branch 'origin/main' into gitee

This commit is contained in:
xiaoxian521 2024-01-16 13:05:40 +08:00
commit fdf0b9ba7e
3 changed files with 25 additions and 10 deletions

View File

@ -10,7 +10,7 @@ const themeColors = {
light: { light: {
subMenuActiveText: "#000000d9", subMenuActiveText: "#000000d9",
menuBg: "#fff", menuBg: "#fff",
menuHover: "#e0ebf6", menuHover: "#f6f6f6",
subMenuBg: "#fff", subMenuBg: "#fff",
subMenuActiveBg: "#e0ebf6", subMenuActiveBg: "#e0ebf6",
menuText: "rgb(0 0 0 / 60%)", menuText: "rgb(0 0 0 / 60%)",
@ -22,7 +22,7 @@ const themeColors = {
default: { default: {
subMenuActiveText: "#fff", subMenuActiveText: "#fff",
menuBg: "#001529", menuBg: "#001529",
menuHover: "#4091f7", menuHover: "rgb(64 145 247 / 15%)",
subMenuBg: "#0f0303", subMenuBg: "#0f0303",
subMenuActiveBg: "#4091f7", subMenuActiveBg: "#4091f7",
menuText: "rgb(254 254 254 / 65%)", menuText: "rgb(254 254 254 / 65%)",
@ -34,7 +34,7 @@ const themeColors = {
saucePurple: { saucePurple: {
subMenuActiveText: "#fff", subMenuActiveText: "#fff",
menuBg: "#130824", menuBg: "#130824",
menuHover: "#693ac9", menuHover: "rgb(105 58 201 / 15%)",
subMenuBg: "#000", subMenuBg: "#000",
subMenuActiveBg: "#693ac9", subMenuActiveBg: "#693ac9",
menuText: "#7a80b4", menuText: "#7a80b4",
@ -46,7 +46,7 @@ const themeColors = {
pink: { pink: {
subMenuActiveText: "#fff", subMenuActiveText: "#fff",
menuBg: "#28081a", menuBg: "#28081a",
menuHover: "#d84493", menuHover: "rgb(216 68 147 / 15%)",
subMenuBg: "#000", subMenuBg: "#000",
subMenuActiveBg: "#d84493", subMenuActiveBg: "#d84493",
menuText: "#7a80b4", menuText: "#7a80b4",
@ -58,7 +58,7 @@ const themeColors = {
dusk: { dusk: {
subMenuActiveText: "#fff", subMenuActiveText: "#fff",
menuBg: "#2a0608", menuBg: "#2a0608",
menuHover: "#e13c39", menuHover: "rgb(225 60 57 / 15%)",
subMenuBg: "#000", subMenuBg: "#000",
subMenuActiveBg: "#e13c39", subMenuActiveBg: "#e13c39",
menuText: "rgb(254 254 254 / 65.1%)", menuText: "rgb(254 254 254 / 65.1%)",
@ -70,7 +70,7 @@ const themeColors = {
volcano: { volcano: {
subMenuActiveText: "#fff", subMenuActiveText: "#fff",
menuBg: "#2b0e05", menuBg: "#2b0e05",
menuHover: "#e85f33", menuHover: "rgb(232 95 51 / 15%)",
subMenuBg: "#0f0603", subMenuBg: "#0f0603",
subMenuActiveBg: "#e85f33", subMenuActiveBg: "#e85f33",
menuText: "rgb(254 254 254 / 65%)", menuText: "rgb(254 254 254 / 65%)",
@ -82,7 +82,7 @@ const themeColors = {
mingQing: { mingQing: {
subMenuActiveText: "#fff", subMenuActiveText: "#fff",
menuBg: "#032121", menuBg: "#032121",
menuHover: "#59bfc1", menuHover: "rgb(89 191 193 / 15%)",
subMenuBg: "#000", subMenuBg: "#000",
subMenuActiveBg: "#59bfc1", subMenuActiveBg: "#59bfc1",
menuText: "#7a80b4", menuText: "#7a80b4",
@ -94,7 +94,7 @@ const themeColors = {
auroraGreen: { auroraGreen: {
subMenuActiveText: "#fff", subMenuActiveText: "#fff",
menuBg: "#0b1e15", menuBg: "#0b1e15",
menuHover: "#60ac80", menuHover: "rgb(96 172 128 / 15%)",
subMenuBg: "#000", subMenuBg: "#000",
subMenuActiveBg: "#60ac80", subMenuActiveBg: "#60ac80",
menuText: "#7a80b4", menuText: "#7a80b4",

View File

@ -10,6 +10,7 @@ const props = defineProps({
const emit = defineEmits(["cropper"]); const emit = defineEmits(["cropper"]);
const infos = ref(); const infos = ref();
const popoverRef = ref();
const refCropper = ref(); const refCropper = ref();
const showPopover = ref(false); const showPopover = ref(false);
const cropperImg = ref<string>(""); const cropperImg = ref<string>("");
@ -19,11 +20,22 @@ function onCropper({ base64, blob, info }) {
cropperImg.value = base64; cropperImg.value = base64;
emit("cropper", { base64, blob, info }); emit("cropper", { base64, blob, info });
} }
function hidePopover() {
popoverRef.value.hide();
}
defineExpose({ hidePopover });
</script> </script>
<template> <template>
<div v-loading="!showPopover" element-loading-background="transparent"> <div v-loading="!showPopover" element-loading-background="transparent">
<el-popover :visible="showPopover" placement="right" width="18vw"> <el-popover
ref="popoverRef"
:visible="showPopover"
placement="right"
width="18vw"
>
<template #reference> <template #reference>
<div class="w-[18vw]"> <div class="w-[18vw]">
<ReCropper <ReCropper

View File

@ -351,6 +351,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
}); });
} }
const cropRef = ref();
/** 上传头像 */ /** 上传头像 */
function handleUpload(row) { function handleUpload(row) {
addDialog({ addDialog({
@ -360,6 +361,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
closeOnClickModal: false, closeOnClickModal: false,
contentRenderer: () => contentRenderer: () =>
h(croppingUpload, { h(croppingUpload, {
ref: cropRef,
imgSrc: row.avatar, imgSrc: row.avatar,
onCropper: info => (avatarInfo.value = info) onCropper: info => (avatarInfo.value = info)
}), }),
@ -368,7 +370,8 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
// 根据实际业务使用avatarInfo.value和row里的某些字段去调用上传头像接口即可 // 根据实际业务使用avatarInfo.value和row里的某些字段去调用上传头像接口即可
done(); // 关闭弹框 done(); // 关闭弹框
onSearch(); // 刷新表格数据 onSearch(); // 刷新表格数据
} },
closeCallBack: () => cropRef.value.hidePopover()
}); });
} }