修复bug
This commit is contained in:
parent
729a63deca
commit
479fae0430
|
|
@ -19,3 +19,8 @@ export function deptEdit(params: any) {
|
|||
export function deptDelete(params: any) {
|
||||
return request.post({ url: '/system/dept/del', params })
|
||||
}
|
||||
|
||||
// 部门详情
|
||||
export function deptDetail(params?: any) {
|
||||
return request.get({ url: '/system/dept/detail', params })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,3 +23,8 @@ export function postEdit(params: any) {
|
|||
export function postDelete(params: any) {
|
||||
return request.post({ url: '/system/post/del', params })
|
||||
}
|
||||
|
||||
// 岗位详情
|
||||
export function postDetail(params: any) {
|
||||
return request.get({ url: '/system/post/detail', params })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,3 +19,8 @@ export function menuEdit(params: Record<string, any>) {
|
|||
export function menuDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/system/menu/del', params })
|
||||
}
|
||||
|
||||
// 菜单删除
|
||||
export function menuDetail(params: Record<string, any>) {
|
||||
return request.get({ url: '/system/menu/detail', params })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
<template>
|
||||
<div class="icon-select">
|
||||
<el-popover v-model:visible="state.popoverVisible" :width="state.popoverWidth">
|
||||
<el-popover
|
||||
trigger="contextmenu"
|
||||
v-model:visible="state.popoverVisible"
|
||||
:width="state.popoverWidth"
|
||||
>
|
||||
<div
|
||||
@mouseover.stop="state.mouseoverSelect = true"
|
||||
@mouseout.stop="state.mouseoverSelect = false"
|
||||
|
|
@ -41,6 +45,7 @@
|
|||
ref="inputRef"
|
||||
v-model.trim="state.inputValue"
|
||||
placeholder="搜索图标"
|
||||
:autofocus="false"
|
||||
:disabled="disabled"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
|
|
@ -112,7 +117,7 @@ const handleFocus = () => {
|
|||
state.inputFocus = state.popoverVisible = true
|
||||
}
|
||||
|
||||
// // input 框失去焦点
|
||||
// input 框失去焦点
|
||||
const handleBlur = () => {
|
||||
state.inputFocus = false
|
||||
state.popoverVisible = state.mouseoverSelect
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import useTabsStore, { getRouteParams } from '@/stores/modules/multipleTabs'
|
|||
const router = useRouter()
|
||||
const tabsStore = useTabsStore()
|
||||
const { route } = useWatchRoute((route) => {
|
||||
tabsStore.addTab(route)
|
||||
tabsStore.addTab(route, router)
|
||||
})
|
||||
|
||||
const currentTab = computed(() => {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
|
|||
children: [
|
||||
{
|
||||
path: 'setting',
|
||||
name: Symbol(),
|
||||
component: () => import('@/views/user/setting.vue'),
|
||||
meta: {
|
||||
title: '个人设置'
|
||||
|
|
@ -53,10 +54,12 @@ export const constantRoutes: Array<RouteRecordRaw> = [
|
|||
children: [
|
||||
{
|
||||
path: 'code/edit',
|
||||
name: Symbol(),
|
||||
component: () => import('@/views/dev_tools/code/edit.vue'),
|
||||
meta: {
|
||||
title: '编辑数据表',
|
||||
activeMenu: '/dev_tools/code'
|
||||
activeMenu: '/dev_tools/code',
|
||||
name: Symbol()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -67,6 +70,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
|
|||
children: [
|
||||
{
|
||||
path: 'dict/data',
|
||||
name: Symbol(),
|
||||
component: () => import('@/views/setting/dict/data/index.vue'),
|
||||
meta: {
|
||||
title: '数据管理',
|
||||
|
|
@ -74,6 +78,21 @@ export const constantRoutes: Array<RouteRecordRaw> = [
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/article',
|
||||
component: LAYOUT,
|
||||
children: [
|
||||
{
|
||||
path: 'lists/edit',
|
||||
name: Symbol(),
|
||||
component: () => import('@/views/article/lists/edit.vue'),
|
||||
meta: {
|
||||
title: '文章编辑',
|
||||
activeMenu: '/article/lists'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@ const getHasTabIndex = (path: string, tabList: TabItem[]) => {
|
|||
return tabList.findIndex((item) => item.path == path)
|
||||
}
|
||||
|
||||
const isCannotAddRoute = (route: RouteLocationNormalized) => {
|
||||
const { path, meta } = route
|
||||
const isCannotAddRoute = (route: RouteLocationNormalized, router: Router) => {
|
||||
const { path, meta, name } = route
|
||||
if (!path || isExternal(path)) return true
|
||||
if (meta?.hideTab) return true
|
||||
if (!router.hasRoute(name!)) return true
|
||||
if (([PageEnum.LOGIN, PageEnum.ERROR_403] as string[]).includes(path)) {
|
||||
return true
|
||||
}
|
||||
|
|
@ -74,9 +75,9 @@ const useTabsStore = defineStore({
|
|||
this.tasMap = {}
|
||||
this.indexRouteName = ''
|
||||
},
|
||||
addTab(route: RouteLocationNormalized) {
|
||||
addTab(route: RouteLocationNormalized, router: Router) {
|
||||
const { name, path, query, meta, params } = route
|
||||
if (isCannotAddRoute(route)) return
|
||||
if (isCannotAddRoute(route, router)) return
|
||||
const hasTabIndex = getHasTabIndex(path!, this.tabList)
|
||||
|
||||
const tabItem = {
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@
|
|||
}"
|
||||
>
|
||||
编辑
|
||||
</router-link></el-button
|
||||
>
|
||||
</router-link>
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
class="ml-2"
|
||||
@command="handleCommand($event, row)"
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { deptLists, deptEdit, deptAdd } from '@/api/org/department'
|
||||
import { deptLists, deptEdit, deptAdd, deptDetail } from '@/api/org/department'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
|
@ -118,12 +118,20 @@ const setFormData = (data: Record<any, any>) => {
|
|||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await deptDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -128,10 +128,11 @@ const handleEdit = async (data: any) => {
|
|||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.getDetail(data)
|
||||
}
|
||||
|
||||
const handleDelete = async (id: number) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await deptDelete({ id })
|
||||
feedback.msgSuccess('删除成功')
|
||||
getLists()
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { postEdit, postAdd } from '@/api/org/post'
|
||||
import { postEdit, postAdd, postDetail } from '@/api/org/post'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import feedback from '@/utils/feedback'
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
|
@ -77,6 +78,7 @@ const formRules = {
|
|||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
mode.value == 'edit' ? await postEdit(formData) : await postAdd(formData)
|
||||
feedback.msgSuccess('操作成功')
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
|
@ -95,12 +97,20 @@ const setFormData = (data: Record<any, any>) => {
|
|||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await postDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { postDelete, postLists } from '@/api/org/post'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const showEdit = ref(false)
|
||||
|
|
@ -97,11 +98,13 @@ const handleEdit = async (data: any) => {
|
|||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.getDetail(data)
|
||||
}
|
||||
|
||||
const handleDelete = async (id: number) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await postDelete({ id })
|
||||
feedback.msgSuccess('删除成功')
|
||||
getLists()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { menuLists, menuEdit, menuAdd } from '@/api/perms/menu'
|
||||
import { menuLists, menuEdit, menuAdd, menuDetail } from '@/api/perms/menu'
|
||||
import { MenuEnum } from '@/enums/appEnums'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
|
@ -253,6 +253,13 @@ const setFormData = (data: Record<any, any>) => {
|
|||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await menuDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
|
@ -261,6 +268,7 @@ getMenu()
|
|||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ const handleEdit = async (data: any) => {
|
|||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
editRef.value?.getDetail(data)
|
||||
}
|
||||
|
||||
const handleDelete = async (id: number) => {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { getWebsite, setWebsite } from '@/api/setting/website'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
|
|
@ -77,6 +78,7 @@ const getData = async () => {
|
|||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
await setWebsite(formData)
|
||||
feedback.msgSuccess('操作成功')
|
||||
getData()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { getProtocol, setProtocol } from '@/api/setting/website'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
||||
const formData = ref({
|
||||
privacy: {
|
||||
|
|
@ -48,6 +49,7 @@ const getProtocolDetail = async () => {
|
|||
}
|
||||
const handelSave = async () => {
|
||||
await setProtocol(formData.value)
|
||||
feedback.msgSuccess('操作成功')
|
||||
getProtocolDetail()
|
||||
}
|
||||
getProtocolDetail()
|
||||
|
|
|
|||
Loading…
Reference in New Issue