Merge branch 'develop' of https://gitee.com/likeadmin/likeadmin_java into develop

This commit is contained in:
TinyAnts 2022-09-16 10:23:20 +08:00
commit f4d1344bd3
4 changed files with 42 additions and 6 deletions

View File

@ -20,7 +20,7 @@ export function useCate(type: number) {
const cateLists = ref<any[]>([])
// 选中的分组id
const cateId = ref('')
const cateId = ref<number | string>('')
// 获取分组列表
const getCateLists = async () => {
@ -39,6 +39,9 @@ export function useCate(type: number) {
]
cateLists.value = data
cateLists.value.unshift(...item)
setTimeout(() => {
treeRef.value?.setCurrentKey(cateId.value)
}, 0)
}
// 添加分组
@ -66,6 +69,7 @@ export function useCate(type: number) {
const handleDeleteCate = async (id: number) => {
await feedback.confirm('确定要删除?')
await fileCateDelete({ id })
cateId.value = ''
getCateLists()
}
@ -87,7 +91,12 @@ export function useCate(type: number) {
}
// 处理文件的钩子函数
export function useFile(cateId: Ref<string>, type: Ref<number>, limit: Ref<number>, size: number) {
export function useFile(
cateId: Ref<string | number>,
type: Ref<number>,
limit: Ref<number>,
size: number
) {
const tableRef = shallowRef()
const listShowType = ref('normal')
const moveId = ref(0)

View File

@ -0,0 +1,28 @@
/**
* perm
*
* <el-button v-perms="['auth.menu/edit']"></el-button>
*/
import feedback from '@/utils/feedback'
import useClipboard from 'vue-clipboard3'
const clipboard = 'data-clipboard-text'
export default {
mounted: (el: HTMLElement, binding: any) => {
el.setAttribute(clipboard, binding.value)
const { toClipboard } = useClipboard()
el.onclick = () => {
toClipboard(el.getAttribute(clipboard)!)
.then(() => {
feedback.msgSuccess('复制成功')
})
.catch(() => {
feedback.msgError('复制失败')
})
}
},
updated: (el: HTMLElement, binding: any) => {
el.setAttribute(clipboard, binding.value)
}
}

View File

@ -27,7 +27,7 @@
</el-form-item>
<el-form-item label="访问链接">
<div>{{ formData.accessLink }}</div>
<el-button class="ml-4" @click="copy(formData.accessLink)">复制</el-button>
<el-button class="ml-4" v-copy="formData.accessLink">复制</el-button>
</el-form-item>
</el-form>
</el-card>
@ -39,7 +39,6 @@
<script lang="ts" setup>
import { getH5Config, setH5Config } from '@/api/channel/h5'
import feedback from '@/utils/feedback'
import { useClipboard } from '@vueuse/core'
const formData = reactive({
status: 0,
@ -48,7 +47,7 @@ const formData = reactive({
accessLink: ''
})
const { copy } = useClipboard()
// const { copy } = useClipboard()
const getDetail = async () => {
const data = await getH5Config()
for (const key in formData) {

View File

@ -36,7 +36,7 @@
<el-table-column label="用户编号" prop="sn" min-width="120" />
<el-table-column label="头像" min-width="100">
<template #default="{ row }">
<el-avatar :src="row.image" :size="50" />
<el-avatar :src="row.avatar" :size="50" />
</template>
</el-table-column>
<el-table-column label="昵称" prop="nickname" min-width="100" />