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