mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	perf: 系统管理、系统监控兼容移动端
This commit is contained in:
		
							parent
							
								
									6270ec712f
								
							
						
					
					
						commit
						c0005b4bc9
					
				@ -39,7 +39,7 @@ const {
 | 
				
			|||||||
      ref="formRef"
 | 
					      ref="formRef"
 | 
				
			||||||
      :inline="true"
 | 
					      :inline="true"
 | 
				
			||||||
      :model="form"
 | 
					      :model="form"
 | 
				
			||||||
      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-form-item label="用户名" prop="username">
 | 
					      <el-form-item label="用户名" prop="username">
 | 
				
			||||||
        <el-input
 | 
					        <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -39,7 +39,7 @@ const {
 | 
				
			|||||||
      ref="formRef"
 | 
					      ref="formRef"
 | 
				
			||||||
      :inline="true"
 | 
					      :inline="true"
 | 
				
			||||||
      :model="form"
 | 
					      :model="form"
 | 
				
			||||||
      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-form-item label="所属模块" prop="module">
 | 
					      <el-form-item label="所属模块" prop="module">
 | 
				
			||||||
        <el-input
 | 
					        <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -42,7 +42,7 @@ const {
 | 
				
			|||||||
      ref="formRef"
 | 
					      ref="formRef"
 | 
				
			||||||
      :inline="true"
 | 
					      :inline="true"
 | 
				
			||||||
      :model="form"
 | 
					      :model="form"
 | 
				
			||||||
      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-form-item label="所属模块" prop="module">
 | 
					      <el-form-item label="所属模块" prop="module">
 | 
				
			||||||
        <el-input
 | 
					        <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@ const {
 | 
				
			|||||||
      ref="formRef"
 | 
					      ref="formRef"
 | 
				
			||||||
      :inline="true"
 | 
					      :inline="true"
 | 
				
			||||||
      :model="form"
 | 
					      :model="form"
 | 
				
			||||||
      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-form-item label="用户名" prop="username">
 | 
					      <el-form-item label="用户名" prop="username">
 | 
				
			||||||
        <el-input
 | 
					        <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -34,7 +34,7 @@ const {
 | 
				
			|||||||
      ref="formRef"
 | 
					      ref="formRef"
 | 
				
			||||||
      :inline="true"
 | 
					      :inline="true"
 | 
				
			||||||
      :model="form"
 | 
					      :model="form"
 | 
				
			||||||
      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-form-item label="部门名称:" prop="name">
 | 
					      <el-form-item label="部门名称:" prop="name">
 | 
				
			||||||
        <el-input
 | 
					        <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -7,7 +7,7 @@ import { usePublicHooks } from "../../hooks";
 | 
				
			|||||||
import { addDialog } from "@/components/ReDialog";
 | 
					import { addDialog } from "@/components/ReDialog";
 | 
				
			||||||
import { reactive, ref, onMounted, h } from "vue";
 | 
					import { reactive, ref, onMounted, h } from "vue";
 | 
				
			||||||
import type { FormItemProps } from "../utils/types";
 | 
					import type { FormItemProps } from "../utils/types";
 | 
				
			||||||
import { cloneDeep, isAllEmpty } from "@pureadmin/utils";
 | 
					import { cloneDeep, isAllEmpty, deviceDetection } from "@pureadmin/utils";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function useDept() {
 | 
					export function useDept() {
 | 
				
			||||||
  const form = reactive({
 | 
					  const form = reactive({
 | 
				
			||||||
@ -120,6 +120,7 @@ export function useDept() {
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      width: "40%",
 | 
					      width: "40%",
 | 
				
			||||||
      draggable: true,
 | 
					      draggable: true,
 | 
				
			||||||
 | 
					      fullscreen: deviceDetection(),
 | 
				
			||||||
      fullscreenIcon: true,
 | 
					      fullscreenIcon: true,
 | 
				
			||||||
      closeOnClickModal: false,
 | 
					      closeOnClickModal: false,
 | 
				
			||||||
      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
					      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
				
			||||||
 | 
				
			|||||||
@ -35,7 +35,7 @@ const {
 | 
				
			|||||||
      ref="formRef"
 | 
					      ref="formRef"
 | 
				
			||||||
      :inline="true"
 | 
					      :inline="true"
 | 
				
			||||||
      :model="form"
 | 
					      :model="form"
 | 
				
			||||||
      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-form-item label="菜单名称:" prop="title">
 | 
					      <el-form-item label="菜单名称:" prop="title">
 | 
				
			||||||
        <el-input
 | 
					        <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -6,8 +6,8 @@ import { transformI18n } from "@/plugins/i18n";
 | 
				
			|||||||
import { addDialog } from "@/components/ReDialog";
 | 
					import { addDialog } from "@/components/ReDialog";
 | 
				
			||||||
import { reactive, ref, onMounted, h } from "vue";
 | 
					import { reactive, ref, onMounted, h } from "vue";
 | 
				
			||||||
import type { FormItemProps } from "../utils/types";
 | 
					import type { FormItemProps } from "../utils/types";
 | 
				
			||||||
import { cloneDeep, isAllEmpty } from "@pureadmin/utils";
 | 
					 | 
				
			||||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
 | 
					import { useRenderIcon } from "@/components/ReIcon/src/hooks";
 | 
				
			||||||
 | 
					import { cloneDeep, isAllEmpty, deviceDetection } from "@pureadmin/utils";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function useMenu() {
 | 
					export function useMenu() {
 | 
				
			||||||
  const form = reactive({
 | 
					  const form = reactive({
 | 
				
			||||||
@ -161,6 +161,7 @@ export function useMenu() {
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      width: "45%",
 | 
					      width: "45%",
 | 
				
			||||||
      draggable: true,
 | 
					      draggable: true,
 | 
				
			||||||
 | 
					      fullscreen: deviceDetection(),
 | 
				
			||||||
      fullscreenIcon: true,
 | 
					      fullscreenIcon: true,
 | 
				
			||||||
      closeOnClickModal: false,
 | 
					      closeOnClickModal: false,
 | 
				
			||||||
      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
					      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
				
			||||||
 | 
				
			|||||||
@ -96,7 +96,7 @@ onMounted(() => {
 | 
				
			|||||||
      ref="formRef"
 | 
					      ref="formRef"
 | 
				
			||||||
      :inline="true"
 | 
					      :inline="true"
 | 
				
			||||||
      :model="form"
 | 
					      :model="form"
 | 
				
			||||||
      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					      class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-form-item label="角色名称:" prop="name">
 | 
					      <el-form-item label="角色名称:" prop="name">
 | 
				
			||||||
        <el-input
 | 
					        <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -4,11 +4,11 @@ import { handleTree } from "@/utils/tree";
 | 
				
			|||||||
import { message } from "@/utils/message";
 | 
					import { message } from "@/utils/message";
 | 
				
			||||||
import { ElMessageBox } from "element-plus";
 | 
					import { ElMessageBox } from "element-plus";
 | 
				
			||||||
import { usePublicHooks } from "../../hooks";
 | 
					import { usePublicHooks } from "../../hooks";
 | 
				
			||||||
import { getKeyList } from "@pureadmin/utils";
 | 
					 | 
				
			||||||
import { transformI18n } from "@/plugins/i18n";
 | 
					import { transformI18n } from "@/plugins/i18n";
 | 
				
			||||||
import { addDialog } from "@/components/ReDialog";
 | 
					import { addDialog } from "@/components/ReDialog";
 | 
				
			||||||
import type { FormItemProps } from "../utils/types";
 | 
					import type { FormItemProps } from "../utils/types";
 | 
				
			||||||
import type { PaginationProps } from "@pureadmin/table";
 | 
					import type { PaginationProps } from "@pureadmin/table";
 | 
				
			||||||
 | 
					import { getKeyList, deviceDetection } from "@pureadmin/utils";
 | 
				
			||||||
import { getRoleList, getRoleMenu, getRoleMenuIds } from "@/api/system";
 | 
					import { getRoleList, getRoleMenu, getRoleMenuIds } from "@/api/system";
 | 
				
			||||||
import { type Ref, reactive, ref, onMounted, h, toRaw, watch } from "vue";
 | 
					import { type Ref, reactive, ref, onMounted, h, toRaw, watch } from "vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -192,6 +192,7 @@ export function useRole(treeRef: Ref) {
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      width: "40%",
 | 
					      width: "40%",
 | 
				
			||||||
      draggable: true,
 | 
					      draggable: true,
 | 
				
			||||||
 | 
					      fullscreen: deviceDetection(),
 | 
				
			||||||
      fullscreenIcon: true,
 | 
					      fullscreenIcon: true,
 | 
				
			||||||
      closeOnClickModal: false,
 | 
					      closeOnClickModal: false,
 | 
				
			||||||
      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
					      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
				
			||||||
 | 
				
			|||||||
@ -32,6 +32,7 @@ const {
 | 
				
			|||||||
  selectedNum,
 | 
					  selectedNum,
 | 
				
			||||||
  pagination,
 | 
					  pagination,
 | 
				
			||||||
  buttonClass,
 | 
					  buttonClass,
 | 
				
			||||||
 | 
					  deviceDetection,
 | 
				
			||||||
  onSearch,
 | 
					  onSearch,
 | 
				
			||||||
  resetForm,
 | 
					  resetForm,
 | 
				
			||||||
  onbatchDel,
 | 
					  onbatchDel,
 | 
				
			||||||
@ -50,20 +51,22 @@ const {
 | 
				
			|||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div class="flex justify-between">
 | 
					  <div :class="['flex', 'justify-between', deviceDetection() && 'flex-wrap']">
 | 
				
			||||||
    <tree
 | 
					    <tree
 | 
				
			||||||
      ref="treeRef"
 | 
					      ref="treeRef"
 | 
				
			||||||
      class="min-w-[200px] mr-2"
 | 
					      :class="['mr-2', deviceDetection() ? 'w-full' : 'min-w-[200px]']"
 | 
				
			||||||
      :treeData="treeData"
 | 
					      :treeData="treeData"
 | 
				
			||||||
      :treeLoading="treeLoading"
 | 
					      :treeLoading="treeLoading"
 | 
				
			||||||
      @tree-select="onTreeSelect"
 | 
					      @tree-select="onTreeSelect"
 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
    <div class="w-[calc(100%-200px)]">
 | 
					    <div
 | 
				
			||||||
 | 
					      :class="[deviceDetection() ? ['w-full', 'mt-2'] : 'w-[calc(100%-200px)]']"
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
      <el-form
 | 
					      <el-form
 | 
				
			||||||
        ref="formRef"
 | 
					        ref="formRef"
 | 
				
			||||||
        :inline="true"
 | 
					        :inline="true"
 | 
				
			||||||
        :model="form"
 | 
					        :model="form"
 | 
				
			||||||
        class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px]"
 | 
					        class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto"
 | 
				
			||||||
      >
 | 
					      >
 | 
				
			||||||
        <el-form-item label="用户名称:" prop="username">
 | 
					        <el-form-item label="用户名称:" prop="username">
 | 
				
			||||||
          <el-input
 | 
					          <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -36,8 +36,9 @@ const defaultProps = {
 | 
				
			|||||||
const buttonClass = computed(() => {
 | 
					const buttonClass = computed(() => {
 | 
				
			||||||
  return [
 | 
					  return [
 | 
				
			||||||
    "!h-[20px]",
 | 
					    "!h-[20px]",
 | 
				
			||||||
 | 
					    "!text-sm",
 | 
				
			||||||
    "reset-margin",
 | 
					    "reset-margin",
 | 
				
			||||||
    "!text-gray-500",
 | 
					    "!text-[var(--el-text-color-regular)]",
 | 
				
			||||||
    "dark:!text-white",
 | 
					    "dark:!text-white",
 | 
				
			||||||
    "dark:hover:!text-primary"
 | 
					    "dark:hover:!text-primary"
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
@ -96,7 +97,7 @@ defineExpose({ onTreeReset });
 | 
				
			|||||||
  <div
 | 
					  <div
 | 
				
			||||||
    v-loading="props.treeLoading"
 | 
					    v-loading="props.treeLoading"
 | 
				
			||||||
    class="h-full bg-bg_color overflow-auto"
 | 
					    class="h-full bg-bg_color overflow-auto"
 | 
				
			||||||
    :style="{ minHeight: `calc(100vh - 145px)` }"
 | 
					    :style="{ minHeight: `calc(100vh - 141px)` }"
 | 
				
			||||||
  >
 | 
					  >
 | 
				
			||||||
    <div class="flex items-center h-[34px]">
 | 
					    <div class="flex items-center h-[34px]">
 | 
				
			||||||
      <el-input
 | 
					      <el-input
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,12 @@ import { usePublicHooks } from "../../hooks";
 | 
				
			|||||||
import { addDialog } from "@/components/ReDialog";
 | 
					import { addDialog } from "@/components/ReDialog";
 | 
				
			||||||
import type { PaginationProps } from "@pureadmin/table";
 | 
					import type { PaginationProps } from "@pureadmin/table";
 | 
				
			||||||
import type { FormItemProps, RoleFormItemProps } from "../utils/types";
 | 
					import type { FormItemProps, RoleFormItemProps } from "../utils/types";
 | 
				
			||||||
import { hideTextAtIndex, getKeyList, isAllEmpty } from "@pureadmin/utils";
 | 
					import {
 | 
				
			||||||
 | 
					  getKeyList,
 | 
				
			||||||
 | 
					  isAllEmpty,
 | 
				
			||||||
 | 
					  hideTextAtIndex,
 | 
				
			||||||
 | 
					  deviceDetection
 | 
				
			||||||
 | 
					} from "@pureadmin/utils";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  getRoleIds,
 | 
					  getRoleIds,
 | 
				
			||||||
  getDeptList,
 | 
					  getDeptList,
 | 
				
			||||||
@ -322,6 +327,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      width: "46%",
 | 
					      width: "46%",
 | 
				
			||||||
      draggable: true,
 | 
					      draggable: true,
 | 
				
			||||||
 | 
					      fullscreen: deviceDetection(),
 | 
				
			||||||
      fullscreenIcon: true,
 | 
					      fullscreenIcon: true,
 | 
				
			||||||
      closeOnClickModal: false,
 | 
					      closeOnClickModal: false,
 | 
				
			||||||
      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
					      contentRenderer: () => h(editForm, { ref: formRef }),
 | 
				
			||||||
@ -360,6 +366,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
 | 
				
			|||||||
      width: "40%",
 | 
					      width: "40%",
 | 
				
			||||||
      draggable: true,
 | 
					      draggable: true,
 | 
				
			||||||
      closeOnClickModal: false,
 | 
					      closeOnClickModal: false,
 | 
				
			||||||
 | 
					      fullscreen: deviceDetection(),
 | 
				
			||||||
      contentRenderer: () =>
 | 
					      contentRenderer: () =>
 | 
				
			||||||
        h(croppingUpload, {
 | 
					        h(croppingUpload, {
 | 
				
			||||||
          ref: cropRef,
 | 
					          ref: cropRef,
 | 
				
			||||||
@ -389,6 +396,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
 | 
				
			|||||||
      width: "30%",
 | 
					      width: "30%",
 | 
				
			||||||
      draggable: true,
 | 
					      draggable: true,
 | 
				
			||||||
      closeOnClickModal: false,
 | 
					      closeOnClickModal: false,
 | 
				
			||||||
 | 
					      fullscreen: deviceDetection(),
 | 
				
			||||||
      contentRenderer: () => (
 | 
					      contentRenderer: () => (
 | 
				
			||||||
        <>
 | 
					        <>
 | 
				
			||||||
          <ElForm ref={ruleFormRef} model={pwdForm}>
 | 
					          <ElForm ref={ruleFormRef} model={pwdForm}>
 | 
				
			||||||
@ -471,6 +479,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      width: "400px",
 | 
					      width: "400px",
 | 
				
			||||||
      draggable: true,
 | 
					      draggable: true,
 | 
				
			||||||
 | 
					      fullscreen: deviceDetection(),
 | 
				
			||||||
      fullscreenIcon: true,
 | 
					      fullscreenIcon: true,
 | 
				
			||||||
      closeOnClickModal: false,
 | 
					      closeOnClickModal: false,
 | 
				
			||||||
      contentRenderer: () => h(roleForm),
 | 
					      contentRenderer: () => h(roleForm),
 | 
				
			||||||
@ -507,6 +516,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
 | 
				
			|||||||
    selectedNum,
 | 
					    selectedNum,
 | 
				
			||||||
    pagination,
 | 
					    pagination,
 | 
				
			||||||
    buttonClass,
 | 
					    buttonClass,
 | 
				
			||||||
 | 
					    deviceDetection,
 | 
				
			||||||
    onSearch,
 | 
					    onSearch,
 | 
				
			||||||
    resetForm,
 | 
					    resetForm,
 | 
				
			||||||
    onbatchDel,
 | 
					    onbatchDel,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user