mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-04 22:57:10 +08:00
refactor: eslint src --fix
This commit is contained in:
@@ -9,4 +9,3 @@ export * from './auth/type'
|
|||||||
export * from './common/type'
|
export * from './common/type'
|
||||||
export * from './monitor/type'
|
export * from './monitor/type'
|
||||||
export * from './system/type'
|
export * from './system/type'
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<span v-if="!dictItem"></span>
|
<span v-if="!dictItem"></span>
|
||||||
<span v-else-if="!dictItem.color">{{ dictItem.label }}</span>
|
<span v-else-if="!dictItem.color">{{ dictItem.label }}</span>
|
||||||
<a-tag v-else-if="dictItem.color === 'primary'" color="arcoblue">{{
|
<a-tag v-else-if="dictItem.color === 'primary'" color="arcoblue">{{ dictItem.label }}</a-tag>
|
||||||
dictItem.label
|
<a-tag v-else-if="dictItem.color === 'success'" color="green">{{ dictItem.label }}</a-tag>
|
||||||
}}</a-tag>
|
<a-tag v-else-if="dictItem.color === 'warning'" color="orangered">{{ dictItem.label }}</a-tag>
|
||||||
<a-tag v-else-if="dictItem.color === 'success'" color="green">{{
|
<a-tag v-else-if="dictItem.color === 'error'" color="red">{{ dictItem.label }}</a-tag>
|
||||||
dictItem.label
|
<a-tag v-else-if="dictItem.color === 'default'" color="gray">{{ dictItem.label }}</a-tag>
|
||||||
}}</a-tag>
|
|
||||||
<a-tag v-else-if="dictItem.color === 'warning'" color="orangered">{{
|
|
||||||
dictItem.label
|
|
||||||
}}</a-tag>
|
|
||||||
<a-tag v-else-if="dictItem.color === 'error'" color="red">{{
|
|
||||||
dictItem.label
|
|
||||||
}}</a-tag>
|
|
||||||
<a-tag v-else-if="dictItem.color === 'default'" color="gray">{{
|
|
||||||
dictItem.label
|
|
||||||
}}</a-tag>
|
|
||||||
<a-tag v-else :color="dictItem.color">{{ dictItem.label }}</a-tag>
|
<a-tag v-else :color="dictItem.color">{{ dictItem.label }}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -27,19 +17,17 @@ defineOptions({ name: 'GiCellTag' })
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dict: {
|
dict: {
|
||||||
type: Array<LabelValueState>,
|
type: Array<LabelValueState>,
|
||||||
required: true,
|
required: true
|
||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
required: true,
|
required: true
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
const dictItem = computed(() =>
|
const dictItem = computed(() =>
|
||||||
props.dict.find(
|
props.dict.find((d) => d.value === String(props.value) || d.value === Number(props.value))
|
||||||
(d) => d.value === String(props.value) || d.value === Number(props.value),
|
)
|
||||||
),
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import Dayjs from 'dayjs'
|
import Dayjs from 'dayjs'
|
||||||
import {useAppStore} from "@/stores";
|
import { useAppStore } from '@/stores'
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore()
|
||||||
|
|
||||||
defineOptions({ name: 'GiFooter' })
|
defineOptions({ name: 'GiFooter' })
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ const searchValue = ref('') // 搜索词
|
|||||||
// 图标列表
|
// 图标列表
|
||||||
const isGridView = ref(false)
|
const isGridView = ref(false)
|
||||||
|
|
||||||
let iconList: string[] = []
|
const iconList: string[] = []
|
||||||
for (const path in SvgIconModules) {
|
for (const path in SvgIconModules) {
|
||||||
console.log(path)
|
console.log(path)
|
||||||
const name = path.replace('/src/assets/icons/', '').replace('.svg', '')
|
const name = path.replace('/src/assets/icons/', '').replace('.svg', '')
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="json_pretty_container">
|
<div class="json_pretty_container">
|
||||||
<vue-json-pretty
|
<vue-json-pretty :path="'res'" :data="JSONObject" :show-length="true" />
|
||||||
:path="'res'"
|
|
||||||
:data="JSONObject"
|
|
||||||
:show-length="true"
|
|
||||||
/>
|
|
||||||
<icon-copy class="copy_icon" @click="onCopy(JSONObject)" />
|
<icon-copy class="copy_icon" @click="onCopy(JSONObject)" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Message } from "@arco-design/web-vue"
|
import { Message } from '@arco-design/web-vue'
|
||||||
interface Props {
|
interface Props {
|
||||||
value: any
|
value: any
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,16 +10,11 @@ import { Message, Notification } from '@arco-design/web-vue'
|
|||||||
interface NavigatorWithMsSaveOrOpenBlob extends Navigator {
|
interface NavigatorWithMsSaveOrOpenBlob extends Navigator {
|
||||||
msSaveOrOpenBlob(blob: Blob, fileName: string): void
|
msSaveOrOpenBlob(blob: Blob, fileName: string): void
|
||||||
}
|
}
|
||||||
export const useDownload = async (
|
export const useDownload = async (api: () => Promise<any>, isNotify = true, tempName = '', fileType = '.xlsx') => {
|
||||||
api: () => Promise<any>,
|
|
||||||
isNotify = true,
|
|
||||||
tempName: string = '',
|
|
||||||
fileType = '.xlsx'
|
|
||||||
) => {
|
|
||||||
try {
|
try {
|
||||||
const res = await api()
|
const res = await api()
|
||||||
if (res.headers['content-disposition']) {
|
if (res.headers['content-disposition']) {
|
||||||
tempName = decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]);
|
tempName = decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1])
|
||||||
} else {
|
} else {
|
||||||
tempName = tempName ? tempName : new Date().getTime() + fileType
|
tempName = tempName ? tempName : new Date().getTime() + fileType
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {useAppStore} from "@/stores";
|
import { useAppStore } from '@/stores'
|
||||||
|
|
||||||
const appStore= useAppStore();
|
const appStore = useAppStore()
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
collapsed?: boolean
|
collapsed?: boolean
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const mode = computed(() => {
|
|||||||
|
|
||||||
// 是否默认展开选中的菜单
|
// 是否默认展开选中的菜单
|
||||||
const autoOpenSelected = computed(() => {
|
const autoOpenSelected = computed(() => {
|
||||||
return ['left', 'mix'].includes(appStore.layout);
|
return ['left', 'mix'].includes(appStore.layout)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 当前页面激活菜单路径,先从路由里面找
|
// 当前页面激活菜单路径,先从路由里面找
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ export const resetHasRouteFlag = () => {
|
|||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const routeStore = useRouteStore()
|
const routeStore = useRouteStore()
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore()
|
||||||
appStore.initWebConfig();
|
appStore.initWebConfig()
|
||||||
|
|
||||||
// 判断该用户是否登录
|
// 判断该用户是否登录
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const storeSetup = () => {
|
|||||||
const webConfig = reactive({}) as BasicConfigRecordResp
|
const webConfig = reactive({}) as BasicConfigRecordResp
|
||||||
|
|
||||||
const getLogo = () => {
|
const getLogo = () => {
|
||||||
return webConfig.site_logo;
|
return webConfig.site_logo
|
||||||
}
|
}
|
||||||
const getFavicon = () => {
|
const getFavicon = () => {
|
||||||
return webConfig.site_favicon
|
return webConfig.site_favicon
|
||||||
@@ -33,10 +33,10 @@ const storeSetup = () => {
|
|||||||
res.data.forEach((item) => {
|
res.data.forEach((item) => {
|
||||||
resMap.set(item.label, item.value)
|
resMap.set(item.label, item.value)
|
||||||
})
|
})
|
||||||
webConfig.site_title=resMap.get('site_title');
|
webConfig.site_title = resMap.get('site_title')
|
||||||
webConfig.site_copyright=resMap.get('site_copyright');
|
webConfig.site_copyright = resMap.get('site_copyright')
|
||||||
webConfig.site_logo=resMap.get('site_logo');
|
webConfig.site_logo = resMap.get('site_logo')
|
||||||
webConfig.site_favicon=resMap.get('site_favicon');
|
webConfig.site_favicon = resMap.get('site_favicon')
|
||||||
document.title = resMap.get('site_title')
|
document.title = resMap.get('site_title')
|
||||||
document
|
document
|
||||||
.querySelector('link[rel="shortcut icon"]')
|
.querySelector('link[rel="shortcut icon"]')
|
||||||
|
|||||||
1
src/types/global.d.ts
vendored
1
src/types/global.d.ts
vendored
@@ -20,7 +20,6 @@ export interface DictState {
|
|||||||
items: Array<LabelValueState>
|
items: Array<LabelValueState>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 状态(1:启用;2:禁用) */
|
/** 状态(1:启用;2:禁用) */
|
||||||
type Status = 1 | 2
|
type Status = 1 | 2
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { isExternal } from "@/utils/validate";
|
import { isExternal } from '@/utils/validate'
|
||||||
import { browse, mapTree } from "xe-utils";
|
import { browse, mapTree } from 'xe-utils'
|
||||||
import _ from "lodash";
|
import _ from 'lodash'
|
||||||
import { Message } from "@arco-design/web-vue";
|
import { Message } from '@arco-design/web-vue'
|
||||||
|
|
||||||
export function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
|
export function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
|
||||||
return obj[key]
|
return obj[key]
|
||||||
@@ -76,7 +76,7 @@ export function isEmpty(data: unknown) {
|
|||||||
if (data === '' || data === 'undefined' || data === undefined || data === null || data === 'null') {
|
if (data === '' || data === 'undefined' || data === undefined || data === null || data === 'null') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return JSON.stringify(data) == '{}' || JSON.stringify(data) == '[]' || JSON.stringify(data) == '[{}]';
|
return JSON.stringify(data) == '{}' || JSON.stringify(data) == '[]' || JSON.stringify(data) == '[{}]'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -244,11 +244,11 @@ export const formatFileSize = (fileSize: number) => {
|
|||||||
return `${size.toFixed(2)} ${unitArr[index]}`
|
return `${size.toFixed(2)} ${unitArr[index]}`
|
||||||
}
|
}
|
||||||
export const copyText = (text: any) => {
|
export const copyText = (text: any) => {
|
||||||
const textarea = document.createElement('textarea');
|
const textarea = document.createElement('textarea')
|
||||||
textarea.value = text;
|
textarea.value = text
|
||||||
document.body.appendChild(textarea);
|
document.body.appendChild(textarea)
|
||||||
textarea.select();
|
textarea.select()
|
||||||
document.execCommand('copy');
|
document.execCommand('copy')
|
||||||
document.body.removeChild(textarea);
|
document.body.removeChild(textarea)
|
||||||
Message.success('复制成功')
|
Message.success('复制成功')
|
||||||
}
|
}
|
||||||
@@ -22,16 +22,16 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
interface ImageType {
|
interface ImageType {
|
||||||
src: string;
|
src: string
|
||||||
title: string;
|
title: string
|
||||||
link: string;
|
link: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const imageList: ImageType[] = [
|
const imageList: ImageType[] = [
|
||||||
{
|
{
|
||||||
src: `https://doc.charles7c.top/img/sponsor/ad/roovps.jpg?${new Date().getTime()}`,
|
src: `https://doc.charles7c.top/img/sponsor/ad/roovps.jpg?${new Date().getTime()}`,
|
||||||
title: 'ROOVPS',
|
title: 'ROOVPS',
|
||||||
link: 'https://roovps.com/cart',
|
link: 'https://roovps.com/cart'
|
||||||
},
|
}
|
||||||
];
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts"></script>
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.login-bg {
|
.login-bg {
|
||||||
|
|||||||
@@ -63,7 +63,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>-->
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -75,7 +74,7 @@ import { useStorage } from '@vueuse/core'
|
|||||||
import { useLoading } from '@/hooks'
|
import { useLoading } from '@/hooks'
|
||||||
import { encryptByRsa } from '@/utils/encrypt'
|
import { encryptByRsa } from '@/utils/encrypt'
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore()
|
||||||
|
|
||||||
defineOptions({ name: 'Login' })
|
defineOptions({ name: 'Login' })
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ const columns: TableInstance['columns'] = [
|
|||||||
value: '2'
|
value: '2'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
filter: () =>{return true},
|
filter: () => {
|
||||||
|
return true
|
||||||
|
},
|
||||||
alignLeft: true
|
alignLeft: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
<a-drawer v-model:visible="visible" title="日志详情" :width="720" :footer="false">
|
<a-drawer v-model:visible="visible" title="日志详情" :width="720" :footer="false">
|
||||||
<a-descriptions title="基本信息" :column="2" size="large" class="general-description">
|
<a-descriptions title="基本信息" :column="2" size="large" class="general-description">
|
||||||
<a-descriptions-item label="日志 ID">{{ dataDetail?.id }}</a-descriptions-item>
|
<a-descriptions-item label="日志 ID">{{ dataDetail?.id }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="Trace ID" >{{ dataDetail?.traceId }}<TextCopy :value="dataDetail?.traceId" /></a-descriptions-item>
|
<a-descriptions-item label="Trace ID"
|
||||||
|
>{{ dataDetail?.traceId }}<TextCopy :value="dataDetail?.traceId"
|
||||||
|
/></a-descriptions-item>
|
||||||
<a-descriptions-item label="操作人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
<a-descriptions-item label="操作人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="操作时间">{{ dataDetail?.createTime }}</a-descriptions-item>
|
<a-descriptions-item label="操作时间">{{ dataDetail?.createTime }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="操作内容">{{ dataDetail?.description }}</a-descriptions-item>
|
<a-descriptions-item label="操作内容">{{ dataDetail?.description }}</a-descriptions-item>
|
||||||
@@ -16,12 +18,8 @@
|
|||||||
<a-tag v-else color="red">失败</a-tag>
|
<a-tag v-else color="red">失败</a-tag>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="耗时">
|
<a-descriptions-item label="耗时">
|
||||||
<a-tag v-if="dataDetail?.timeTaken > 500" color="red">
|
<a-tag v-if="dataDetail?.timeTaken > 500" color="red"> {{ dataDetail?.timeTaken }}ms </a-tag>
|
||||||
{{ dataDetail?.timeTaken }}ms
|
<a-tag v-else-if="dataDetail?.timeTaken > 200" color="orange"> {{ dataDetail?.timeTaken }}ms </a-tag>
|
||||||
</a-tag>
|
|
||||||
<a-tag v-else-if="dataDetail?.timeTaken > 200" color="orange">
|
|
||||||
{{ dataDetail?.timeTaken }}ms
|
|
||||||
</a-tag>
|
|
||||||
<a-tag v-else color="green">{{ dataDetail?.timeTaken }} ms</a-tag>
|
<a-tag v-else color="green">{{ dataDetail?.timeTaken }} ms</a-tag>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="请求 URI" :span="2">
|
<a-descriptions-item label="请求 URI" :span="2">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<div class="page"></div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -10,7 +9,6 @@ defineOptions({ name: 'Notification' })
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const form = reactive({ name: '' })
|
const form = reactive({ name: '' })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ defineOptions({ name: 'Profile' })
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<div class="page"></div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -10,7 +9,6 @@ defineOptions({ name: 'Security' })
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const form = reactive({ name: '' })
|
const form = reactive({ name: '' })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -169,9 +169,9 @@ const query = reactive({
|
|||||||
* 重置表单
|
* 重置表单
|
||||||
*/
|
*/
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.site_title=siteTitle.value?.value || '';
|
form.site_title = siteTitle.value?.value || ''
|
||||||
form.site_copyright= siteCopyright.value?.value || '';
|
form.site_copyright = siteCopyright.value?.value || ''
|
||||||
form.site_logo= siteLogo.value?.value || '';
|
form.site_logo = siteLogo.value?.value || ''
|
||||||
form.site_favicon = siteFavicon.value?.value || ''
|
form.site_favicon = siteFavicon.value?.value || ''
|
||||||
logoFile.value.url = siteLogo.value?.value
|
logoFile.value.url = siteLogo.value?.value
|
||||||
faviconFile.value.url = siteFavicon.value?.value
|
faviconFile.value.url = siteFavicon.value?.value
|
||||||
@@ -226,8 +226,8 @@ const handleSave = () => {
|
|||||||
* @param options /
|
* @param options /
|
||||||
*/
|
*/
|
||||||
const handleUploadLogo = (options: RequestOption) => {
|
const handleUploadLogo = (options: RequestOption) => {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController()
|
||||||
(async function requestWrap() {
|
;(async function requestWrap() {
|
||||||
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
|
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
|
||||||
onProgress(20)
|
onProgress(20)
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ const { form, resetForm } = useForm<DeptReq>({
|
|||||||
name: '',
|
name: '',
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
sort: 999,
|
sort: 999,
|
||||||
status: 1,
|
status: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
// 重置
|
// 重置
|
||||||
|
|||||||
@@ -55,12 +55,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="组件路径" field="component" v-if="form.type === 2">
|
<a-form-item label="组件路径" field="component" v-if="form.type === 2">
|
||||||
<a-input
|
<a-input v-if="form.isExternal" v-model.trim="form.component" placeholder="请输入组件路径" allow-clear />
|
||||||
v-if="form.isExternal"
|
|
||||||
v-model.trim="form.component"
|
|
||||||
placeholder="请输入组件路径"
|
|
||||||
allow-clear
|
|
||||||
/>
|
|
||||||
<a-input v-else v-model.trim="form.component" placeholder="请输入组件路径" allow-clear>
|
<a-input v-else v-model.trim="form.component" placeholder="请输入组件路径" allow-clear>
|
||||||
<template #prepend>@/views/</template>
|
<template #prepend>@/views/</template>
|
||||||
<template #append>.vue</template>
|
<template #append>.vue</template>
|
||||||
@@ -241,7 +236,6 @@ const save = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'save-success'): void
|
(e: 'save-success'): void
|
||||||
}>()
|
}>()
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-drawer
|
<a-drawer v-model:visible="visible" title="角色详情" :width="width >= 580 ? 580 : '100%'" :footer="false">
|
||||||
v-model:visible="visible"
|
|
||||||
title="角色详情"
|
|
||||||
:width="width >= 580 ? 580 : '100%'"
|
|
||||||
:footer="false"
|
|
||||||
>
|
|
||||||
<a-descriptions title="基础信息" :column="2" size="large" class="general-description">
|
<a-descriptions title="基础信息" :column="2" size="large" class="general-description">
|
||||||
<a-descriptions-item label="ID" :span="2">{{ dataDetail?.id }}</a-descriptions-item>
|
<a-descriptions-item label="ID" :span="2">{{ dataDetail?.id }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="名称">{{ dataDetail?.name }}</a-descriptions-item>
|
<a-descriptions-item label="名称">{{ dataDetail?.name }}</a-descriptions-item>
|
||||||
@@ -22,7 +17,13 @@
|
|||||||
<a-descriptions-item label="修改时间">{{ dataDetail?.updateTime }}</a-descriptions-item>
|
<a-descriptions-item label="修改时间">{{ dataDetail?.updateTime }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="描述" :span="2">{{ dataDetail?.description }}</a-descriptions-item>
|
<a-descriptions-item label="描述" :span="2">{{ dataDetail?.description }}</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
<a-descriptions title="功能权限" :column="2" size="large" class="general-description" style="margin-top: 20px; position: relative">
|
<a-descriptions
|
||||||
|
title="功能权限"
|
||||||
|
:column="2"
|
||||||
|
size="large"
|
||||||
|
class="general-description"
|
||||||
|
style="margin-top: 20px; position: relative"
|
||||||
|
>
|
||||||
<a-descriptions-item :span="2">
|
<a-descriptions-item :span="2">
|
||||||
<a-tree
|
<a-tree
|
||||||
ref="menuTreeRef"
|
ref="menuTreeRef"
|
||||||
@@ -34,7 +35,14 @@
|
|||||||
/>
|
/>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
<a-descriptions v-if="dataDetail?.dataScope === 5" title="数据权限" :column="2" size="large" class="general-description" style="margin-top: 20px; position: relative">
|
<a-descriptions
|
||||||
|
v-if="dataDetail?.dataScope === 5"
|
||||||
|
title="数据权限"
|
||||||
|
:column="2"
|
||||||
|
size="large"
|
||||||
|
class="general-description"
|
||||||
|
style="margin-top: 20px; position: relative"
|
||||||
|
>
|
||||||
<a-descriptions-item :span="2">
|
<a-descriptions-item :span="2">
|
||||||
<a-tree
|
<a-tree
|
||||||
ref="deptTreeRef"
|
ref="deptTreeRef"
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ const RoleDetailDrawerRef = ref<InstanceType<typeof RoleDetailDrawer>>()
|
|||||||
const openDetail = (item: RoleResp) => {
|
const openDetail = (item: RoleResp) => {
|
||||||
RoleDetailDrawerRef.value?.open(item.id)
|
RoleDetailDrawerRef.value?.open(item.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getStorage, addStorage, updateStorage } from '@/apis'
|
import { getStorage, addStorage, updateStorage } from '@/apis'
|
||||||
import type { StorageReq } from './type'
|
import type { StorageReq } from './type'
|
||||||
import { Message, type FormInstance } from "@arco-design/web-vue";
|
import { Message, type FormInstance } from '@arco-design/web-vue'
|
||||||
import { useForm } from '@/hooks'
|
import { useForm } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
|
|||||||
@@ -100,15 +100,11 @@ const title = computed(() => (isUpdate.value ? '修改用户' : '新增用户'))
|
|||||||
const formRef = ref<FormInstance>()
|
const formRef = ref<FormInstance>()
|
||||||
|
|
||||||
const rules: FormInstance['rules'] = {
|
const rules: FormInstance['rules'] = {
|
||||||
username: [
|
username: [{ required: true, message: '请输入用户名' }],
|
||||||
{ required: true, message: '请输入用户名' },
|
nickname: [{ required: true, message: '请输入昵称' }],
|
||||||
],
|
|
||||||
nickname: [
|
|
||||||
{ required: true, message: '请输入昵称' },
|
|
||||||
],
|
|
||||||
password: [{ required: true, message: '请输入密码' }],
|
password: [{ required: true, message: '请输入密码' }],
|
||||||
deptId: [{ required: true, message: '请选择所属部门' }],
|
deptId: [{ required: true, message: '请选择所属部门' }],
|
||||||
roleIds: [{ required: true, message: '请选择角色' }],
|
roleIds: [{ required: true, message: '请选择角色' }]
|
||||||
}
|
}
|
||||||
|
|
||||||
const { form, resetForm } = useForm({
|
const { form, resetForm } = useForm({
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-drawer
|
<a-drawer v-model:visible="visible" title="用户详情" :width="width >= 580 ? 580 : '100%'" :footer="false">
|
||||||
v-model:visible="visible"
|
|
||||||
title="用户详情"
|
|
||||||
:width="width >= 580 ? 580 : '100%'"
|
|
||||||
:footer="false"
|
|
||||||
>
|
|
||||||
<a-descriptions :column="2" size="large" class="general-description">
|
<a-descriptions :column="2" size="large" class="general-description">
|
||||||
<a-descriptions-item label="ID" :span="2">{{ dataDetail?.id }}</a-descriptions-item>
|
<a-descriptions-item label="ID" :span="2">{{ dataDetail?.id }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="用户名">{{ dataDetail?.username }}</a-descriptions-item>
|
<a-descriptions-item label="用户名">{{ dataDetail?.username }}</a-descriptions-item>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const options: Options = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columns: Columns = [
|
const columns: Columns = [
|
||||||
{ label: '密码', field: 'newPassword', type: 'input-password', rules: [{ required: true, message: '请输入密码' }] },
|
{ label: '密码', field: 'newPassword', type: 'input-password', rules: [{ required: true, message: '请输入密码' }] }
|
||||||
]
|
]
|
||||||
|
|
||||||
const { form, resetForm } = useForm({
|
const { form, resetForm } = useForm({
|
||||||
|
|||||||
@@ -6,14 +6,7 @@
|
|||||||
<a-input v-model="deptName" placeholder="请输入部门名称" allow-clear style="margin-bottom: 10px">
|
<a-input v-model="deptName" placeholder="请输入部门名称" allow-clear style="margin-bottom: 10px">
|
||||||
<template #prefix><icon-search /></template>
|
<template #prefix><icon-search /></template>
|
||||||
</a-input>
|
</a-input>
|
||||||
<a-tree
|
<a-tree ref="treeRef" :data="deptList" default-expand-all show-line block-node @select="handleSelectDept">
|
||||||
ref="treeRef"
|
|
||||||
:data="deptList"
|
|
||||||
default-expand-all
|
|
||||||
show-line
|
|
||||||
block-node
|
|
||||||
@select="handleSelectDept"
|
|
||||||
>
|
|
||||||
</a-tree>
|
</a-tree>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
@@ -57,7 +50,12 @@
|
|||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #nickname="{ record }">
|
<template #nickname="{ record }">
|
||||||
<GiCellAvatar :avatar="getAvatar(record.avatar, record.gender)" :name="record.nickname" is-link @click="openDetail(record)" />
|
<GiCellAvatar
|
||||||
|
:avatar="getAvatar(record.avatar, record.gender)"
|
||||||
|
:name="record.nickname"
|
||||||
|
is-link
|
||||||
|
@click="openDetail(record)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #gender="{ record }">
|
<template #gender="{ record }">
|
||||||
<GiCellGender :gender="record.gender" />
|
<GiCellGender :gender="record.gender" />
|
||||||
|
|||||||
Reference in New Issue
Block a user