Jelajahi Sumber

style: 代码格式化

wanggaokun 1 tahun lalu
induk
melakukan
e52ac194b8
36 mengubah file dengan 83 tambahan dan 385 penghapusan
  1. 1 1
      .prettierrc.cjs
  2. 1 4
      src/api/index.ts
  3. 1 6
      src/components/DictTag/index.vue
  4. 1 6
      src/components/ECharts/config/index.ts
  5. 1 3
      src/components/ECharts/index.vue
  6. 1 3
      src/components/Grid/components/GridItem.vue
  7. 1 3
      src/components/Highlight/index.vue
  8. 1 2
      src/components/HighlightDialog/index.vue
  9. 2 14
      src/components/ImportExcel/index.vue
  10. 2 12
      src/components/ProForm/components/Item.vue
  11. 1 5
      src/components/ProTable/components/TableColumn.vue
  12. 13 37
      src/components/ProTable/index.vue
  13. 1 2
      src/components/ProTable/interface/index.ts
  14. 1 3
      src/components/SelectFilter/index.vue
  15. 1 4
      src/hooks/useTheme.ts
  16. 3 7
      src/hooks/useTime.ts
  17. 1 7
      src/layouts/LayoutClassic/index.vue
  18. 1 7
      src/layouts/LayoutColumns/index.vue
  19. 1 7
      src/layouts/LayoutVertical/index.vue
  20. 1 6
      src/layouts/components/Header/components/AssemblySize.vue
  21. 1 5
      src/layouts/components/Header/components/Breadcrumb.vue
  22. 1 6
      src/layouts/components/Header/components/Language.vue
  23. 3 27
      src/layouts/components/ThemeDrawer/index.vue
  24. 1 3
      src/views/login/components/LoginForm.vue
  25. 1 2
      src/views/monitor/logininfor/index.vue
  26. 1 2
      src/views/monitor/operlog/index.vue
  27. 4 27
      src/views/system/dept/index.vue
  28. 5 29
      src/views/system/dict/data.vue
  29. 2 10
      src/views/system/dict/index.vue
  30. 3 15
      src/views/system/menu/index.vue
  31. 4 20
      src/views/system/post/index.vue
  32. 4 20
      src/views/system/role/authRole.vue
  33. 4 20
      src/views/system/role/index.vue
  34. 3 15
      src/views/system/user/authUser.vue
  35. 3 15
      src/views/system/user/index.vue
  36. 7 30
      src/views/tool/gen/index.vue

+ 1 - 1
.prettierrc.cjs

@@ -2,7 +2,7 @@
 
 module.exports = {
   // 指定最大换行长度
-  printWidth: 130,
+  printWidth: 150,
   // 缩进制表符宽度 | 空格数
   tabWidth: 2,
   // 使用制表符而不是空格缩进行 (true:制表符,false:空格)

+ 1 - 4
src/api/index.ts

@@ -110,10 +110,7 @@ class RequestHttp {
           // 生成一个 AES 密钥
           const aesKey = generateAesKey()
           config.headers[encryptHeader] = encrypt(encryptBase64(aesKey))
-          config.data =
-            typeof config.data === 'object'
-              ? encryptWithAes(JSON.stringify(config.data), aesKey)
-              : encryptWithAes(config.data, aesKey)
+          config.data = typeof config.data === 'object' ? encryptWithAes(JSON.stringify(config.data), aesKey) : encryptWithAes(config.data, aesKey)
         }
         return config
       },

+ 1 - 6
src/components/DictTag/index.vue

@@ -2,12 +2,7 @@
   <div>
     <template v-for="(item, index) in options">
       <template v-if="values.includes(item.value)">
-        <span
-          v-if="item.elTagType == 'default' || item.elTagType == ''"
-          :key="item.value"
-          :index="index"
-          :class="item.elTagClass"
-        >
+        <span v-if="item.elTagType == 'default' || item.elTagType == ''" :key="item.value" :index="index" :class="item.elTagClass">
           {{ item.label }}
         </span>
         <el-tag

+ 1 - 6
src/components/ECharts/config/index.ts

@@ -23,12 +23,7 @@ import type {
   RadarSeriesOption,
   GaugeSeriesOption
 } from 'echarts/charts'
-import type {
-  TitleComponentOption,
-  TooltipComponentOption,
-  GridComponentOption,
-  DatasetComponentOption
-} from 'echarts/components'
+import type { TitleComponentOption, TooltipComponentOption, GridComponentOption, DatasetComponentOption } from 'echarts/components'
 import type { ComposeOption } from 'echarts/core'
 import 'echarts-liquidfill'
 

+ 1 - 3
src/components/ECharts/index.vue

@@ -26,9 +26,7 @@ const props = withDefaults(defineProps<Props>(), {
 })
 
 const echartsStyle = computed(() => {
-  return props.width || props.height
-    ? { height: props.height + 'px', width: props.width + 'px' }
-    : { height: '100%', width: '100%' }
+  return props.width || props.height ? { height: props.height + 'px', width: props.width + 'px' } : { height: '100%', width: '100%' }
 })
 
 const chartRef = ref<HTMLDivElement | HTMLCanvasElement>()

+ 1 - 3
src/components/Grid/components/GridItem.vue

@@ -58,9 +58,7 @@ const style = computed(() => {
     }
   } else {
     return {
-      gridColumn: `span ${span + offset > cols.value ? cols.value : span + offset}/span ${
-        span + offset > cols.value ? cols.value : span + offset
-      }`,
+      gridColumn: `span ${span + offset > cols.value ? cols.value : span + offset}/span ${span + offset > cols.value ? cols.value : span + offset}`,
       marginLeft: offset !== 0 ? `calc(((100% + ${gap}px) / ${span + offset}) * ${offset})` : 'unset'
     }
   }

+ 1 - 3
src/components/Highlight/index.vue

@@ -1,7 +1,5 @@
 <template>
-  <pre
-    :class="'hx-scroll ' + lineNumbers"
-  ><code :class="'language-'+ type" v-html="Prism.highlight(code, Prism.languages[type], type)"></code></pre>
+  <pre :class="'hx-scroll ' + lineNumbers"><code :class="'language-'+ type" v-html="Prism.highlight(code, Prism.languages[type], type)"></code></pre>
 </template>
 <script setup lang="ts">
 import { onMounted, computed } from 'vue'

+ 1 - 2
src/components/HighlightDialog/index.vue

@@ -7,8 +7,7 @@
     :width="parameter.width"
     draggable
   >
-    <preview-code v-if="flag" :code="parameter.code" :type="parameter.type" :is-show-line-numbers="parameter.isShowLineNumbers">
-    </preview-code>
+    <preview-code v-if="flag" :code="parameter.code" :type="parameter.type" :is-show-line-numbers="parameter.isShowLineNumbers"> </preview-code>
     <template #footer>
       <span class="dialog-footer">
         <el-button type="primary" v-if="parameter.isEdit" :loading="butLoading">导出</el-button>

+ 2 - 14
src/components/ImportExcel/index.vue

@@ -1,12 +1,5 @@
 <template>
-  <el-dialog
-    v-model="dialogVisible"
-    :width="parameter.width"
-    :top="parameter.top"
-    :title="`${parameter.title}`"
-    :destroy-on-close="true"
-    draggable
-  >
+  <el-dialog v-model="dialogVisible" :width="parameter.width" :top="parameter.top" :title="`${parameter.title}`" :destroy-on-close="true" draggable>
     <el-form class="drawer-multiColumn-form" label-width="100px">
       <el-form-item label="文件上传">
         <el-upload
@@ -38,12 +31,7 @@
               </div>
               <div class="el-upload__tip text-center">
                 请上传 .xls , .xlsx 标准格式文件,文件最大为 {{ parameter.fileSize }}M。
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  style="font-size: 12px; vertical-align: baseline"
-                  @click="downloadTemp"
-                >
+                <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="downloadTemp">
                   模板下载
                 </el-link>
               </div>

+ 2 - 12
src/components/ProForm/components/Item.vue

@@ -19,22 +19,12 @@
       ></component>
     </template>
     <template v-if="item.compOptions.elTagName === 'radio-group'">
-      <component
-        :is="`el-radio`"
-        v-for="(col, index) in itemEnum"
-        :key="index"
-        :label="col[item.compOptions.valueKey || 'value']"
-      >
+      <component :is="`el-radio`" v-for="(col, index) in itemEnum" :key="index" :label="col[item.compOptions.valueKey || 'value']">
         {{ col[item.compOptions.labelKey || 'label'] }}
       </component>
     </template>
     <template v-if="item.compOptions.elTagName === 'radio-button'">
-      <component
-        :is="`el-radio-button`"
-        v-for="(col, index) in itemEnum"
-        :key="index"
-        :label="col[item.compOptions.valueKey || 'value']"
-      >
+      <component :is="`el-radio-button`" v-for="(col, index) in itemEnum" :key="index" :label="col[item.compOptions.valueKey || 'value']">
         {{ col[item.compOptions.labelKey || 'label'] }}
       </component>
     </template>

+ 1 - 5
src/components/ProTable/components/TableColumn.vue

@@ -29,11 +29,7 @@ const RenderTableColumn = (item: ColumnProps) => {
   return (
     <>
       {item.isShow && (
-        <el-table-column
-          {...item}
-          align={item.align ?? 'center'}
-          showOverflowTooltip={item.showOverflowTooltip ?? item.prop !== 'operation'}
-        >
+        <el-table-column {...item} align={item.align ?? 'center'} showOverflowTooltip={item.showOverflowTooltip ?? item.prop !== 'operation'}>
           {{
             default: (scope: RenderScope<any>) => {
               if (item._children) return item._children.map(child => RenderTableColumn(child))

+ 13 - 37
src/components/ProTable/index.vue

@@ -1,13 +1,6 @@
 <template>
   <!-- 查询表单 -->
-  <SearchForm
-    v-show="isShowSearch"
-    :search="_search"
-    :reset="_reset"
-    :columns="searchColumns"
-    :search-param="searchParam"
-    :search-col="searchCol"
-  />
+  <SearchForm v-show="isShowSearch" :search="_search" :reset="_reset" :columns="searchColumns" :search-param="searchParam" :search-col="searchCol" />
 
   <!-- 表格主体 -->
   <div class="card table-main">
@@ -20,24 +13,12 @@
         <slot name="toolButton">
           <el-button v-if="showToolButton('refresh')" :icon="Refresh" circle @click="getTableList" />
           <el-button v-if="showToolButton('setting') && columns.length" :icon="Operation" circle @click="openColSetting" />
-          <el-button
-            v-if="showToolButton('search') && searchColumns?.length"
-            :icon="Search"
-            circle
-            @click="isShowSearch = !isShowSearch"
-          />
+          <el-button v-if="showToolButton('search') && searchColumns?.length" :icon="Search" circle @click="isShowSearch = !isShowSearch" />
         </slot>
       </div>
     </div>
     <!-- 表格主体 -->
-    <el-table
-      ref="tableRef"
-      v-bind="$attrs"
-      :data="processTableData"
-      :border="border"
-      :row-key="rowKey"
-      @selection-change="selectionChange"
-    >
+    <el-table ref="tableRef" v-bind="$attrs" :data="processTableData" :border="border" :row-key="rowKey" @selection-change="selectionChange">
       <!-- 默认插槽 -->
       <slot />
       <template v-for="item in tableColumns" :key="item">
@@ -87,12 +68,7 @@
     </el-table>
     <!-- 分页组件 -->
     <slot name="pagination">
-      <Pagination
-        v-if="pagination"
-        :pageable="pageable"
-        :handle-size-change="handleSizeChange"
-        :handle-current-change="handleCurrentChange"
-      />
+      <Pagination v-if="pagination" :pageable="pageable" :handle-size-change="handleSizeChange" :handle-current-change="handleCurrentChange" />
     </slot>
   </div>
   <!-- 列设置 -->
@@ -165,8 +141,13 @@ const radio = ref('')
 const { selectionChange, selectedList, selectedListIds, isSelected } = useSelection(props.rowKey)
 
 // 表格操作 Hooks
-const { tableData, pageable, searchParam, searchInitParam, getTableList, search, reset, handleSizeChange, handleCurrentChange } =
-  useTable(props.requestApi, props.initParam, props.pagination, props.dataCallback, props.requestError)
+const { tableData, pageable, searchParam, searchInitParam, getTableList, search, reset, handleSizeChange, handleCurrentChange } = useTable(
+  props.requestApi,
+  props.initParam,
+  props.pagination,
+  props.dataCallback,
+  props.requestError
+)
 
 // 清空选中数据列表
 const clearSelection = () => tableRef.value!.clearSelection()
@@ -182,10 +163,7 @@ onMounted(() => {
 const processTableData = computed(() => {
   if (!props.data) return tableData.value
   if (!props.pagination) return props.data
-  return props.data.slice(
-    (pageable.value.pageNum - 1) * pageable.value.pageSize,
-    pageable.value.pageSize * pageable.value.pageNum
-  )
+  return props.data.slice((pageable.value.pageNum - 1) * pageable.value.pageSize, pageable.value.pageSize * pageable.value.pageNum)
 })
 
 // 监听页面 initParam 改化,重新获取表格数据
@@ -237,9 +215,7 @@ const flatColumnsFunc = (columns: ColumnProps[], flatArr: ColumnProps[] = []) =>
 
 // 过滤需要搜索的配置项 && 排序
 const searchColumns = computed(() => {
-  return flatColumns.value
-    ?.filter(item => item.search?.el || item.search?.render)
-    .sort((a, b) => a.search!.order! - b.search!.order!)
+  return flatColumns.value?.filter(item => item.search?.el || item.search?.render).sort((a, b) => a.search!.order! - b.search!.order!)
 })
 
 // 设置 搜索表单默认排序 && 搜索表单项的默认值

+ 1 - 2
src/components/ProTable/interface/index.ts

@@ -68,8 +68,7 @@ export type HeaderRenderScope<T> = {
   [key: string]: any
 }
 
-export interface ColumnProps<T = any>
-  extends Partial<Omit<TableColumnCtx<T>, 'type' | 'children' | 'renderCell' | 'renderHeader'>> {
+export interface ColumnProps<T = any> extends Partial<Omit<TableColumnCtx<T>, 'type' | 'children' | 'renderCell' | 'renderHeader'>> {
   type?: TypeProps // 列类型
   tag?: boolean | Ref<boolean> // 是否是标签展示
   isShow?: boolean | Ref<boolean> // 是否显示在表格当中

+ 1 - 3
src/components/SelectFilter/index.vue

@@ -11,9 +11,7 @@
             v-for="option in item.options"
             :key="option.value"
             :class="{
-              active:
-                option.value === selected[item.key] ||
-                (Array.isArray(selected[item.key]) && selected[item.key].includes(option.value))
+              active: option.value === selected[item.key] || (Array.isArray(selected[item.key]) && selected[item.key].includes(option.value))
             }"
             @click="select(item, option)"
           >

+ 1 - 4
src/hooks/useTheme.ts

@@ -33,10 +33,7 @@ export const useTheme = () => {
     }
     // 计算主题颜色变化
     document.documentElement.style.setProperty('--el-color-primary', val)
-    document.documentElement.style.setProperty(
-      '--el-color-primary-dark-2',
-      isDark.value ? `${getLightColor(val, 0.2)}` : `${getDarkColor(val, 0.3)}`
-    )
+    document.documentElement.style.setProperty('--el-color-primary-dark-2', isDark.value ? `${getLightColor(val, 0.2)}` : `${getDarkColor(val, 0.3)}`)
     for (let i = 1; i <= 9; i++) {
       const primaryColor = isDark.value ? `${getDarkColor(val, i / 10)}` : `${getLightColor(val, i / 10)}`
       document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, primaryColor)

+ 3 - 7
src/hooks/useTime.ts

@@ -20,15 +20,11 @@ export const useTime = () => {
     month.value = date.getMonth() + 1
     week.value = '日一二三四五六'.charAt(date.getDay())
     day.value = date.getDate()
-    hour.value =
-      (date.getHours() + '')?.padStart(2, '0') ||
-      new Intl.NumberFormat(undefined, { minimumIntegerDigits: 2 }).format(date.getHours())
+    hour.value = (date.getHours() + '')?.padStart(2, '0') || new Intl.NumberFormat(undefined, { minimumIntegerDigits: 2 }).format(date.getHours())
     minute.value =
-      (date.getMinutes() + '')?.padStart(2, '0') ||
-      new Intl.NumberFormat(undefined, { minimumIntegerDigits: 2 }).format(date.getMinutes())
+      (date.getMinutes() + '')?.padStart(2, '0') || new Intl.NumberFormat(undefined, { minimumIntegerDigits: 2 }).format(date.getMinutes())
     second.value =
-      (date.getSeconds() + '')?.padStart(2, '0') ||
-      new Intl.NumberFormat(undefined, { minimumIntegerDigits: 2 }).format(date.getSeconds())
+      (date.getSeconds() + '')?.padStart(2, '0') || new Intl.NumberFormat(undefined, { minimumIntegerDigits: 2 }).format(date.getSeconds())
     nowTime.value = `${year.value}年${month.value}月${day.value} ${hour.value}:${minute.value}:${second.value}`
   }
 

+ 1 - 7
src/layouts/LayoutClassic/index.vue

@@ -17,13 +17,7 @@
       <el-aside>
         <div class="aside-box" :style="{ width: isCollapse ? '65px' : '210px' }">
           <el-scrollbar>
-            <el-menu
-              :router="false"
-              :default-active="activeMenu"
-              :collapse="isCollapse"
-              :unique-opened="accordion"
-              :collapse-transition="false"
-            >
+            <el-menu :router="false" :default-active="activeMenu" :collapse="isCollapse" :unique-opened="accordion" :collapse-transition="false">
               <SubMenu :menu-list="menuList" />
             </el-menu>
           </el-scrollbar>

+ 1 - 7
src/layouts/LayoutColumns/index.vue

@@ -27,13 +27,7 @@
         <span v-show="subMenuList.length" class="logo-text">{{ isCollapse ? 'G' : title }}</span>
       </div>
       <el-scrollbar>
-        <el-menu
-          :router="false"
-          :default-active="activeMenu"
-          :collapse="isCollapse"
-          :unique-opened="accordion"
-          :collapse-transition="false"
-        >
+        <el-menu :router="false" :default-active="activeMenu" :collapse="isCollapse" :unique-opened="accordion" :collapse-transition="false">
           <SubMenu :menu-list="subMenuList" />
         </el-menu>
       </el-scrollbar>

+ 1 - 7
src/layouts/LayoutVertical/index.vue

@@ -8,13 +8,7 @@
           <span v-show="!isCollapse" class="logo-text">{{ title }}</span>
         </div>
         <el-scrollbar>
-          <el-menu
-            :router="false"
-            :default-active="activeMenu"
-            :collapse="isCollapse"
-            :unique-opened="accordion"
-            :collapse-transition="false"
-          >
+          <el-menu :router="false" :default-active="activeMenu" :collapse="isCollapse" :unique-opened="accordion" :collapse-transition="false">
             <SubMenu :menu-list="menuList" />
           </el-menu>
         </el-scrollbar>

+ 1 - 6
src/layouts/components/Header/components/AssemblySize.vue

@@ -3,12 +3,7 @@
     <i :class="'iconfont icon-contentright'" class="toolBar-icon"></i>
     <template #dropdown>
       <el-dropdown-menu>
-        <el-dropdown-item
-          v-for="item in assemblySizeList"
-          :key="item.value"
-          :command="item.value"
-          :disabled="assemblySize === item.value"
-        >
+        <el-dropdown-item v-for="item in assemblySizeList" :key="item.value" :command="item.value" :disabled="assemblySize === item.value">
           {{ item.label }}
         </el-dropdown-item>
       </el-dropdown-menu>

+ 1 - 5
src/layouts/components/Header/components/Breadcrumb.vue

@@ -3,11 +3,7 @@
     <el-breadcrumb :separator-icon="ArrowRight">
       <transition-group name="breadcrumb">
         <el-breadcrumb-item v-for="(item, index) in breadcrumbList" :key="item.path">
-          <div
-            class="el-breadcrumb__inner is-link"
-            :class="{ 'item-no-icon': !item.meta.icon }"
-            @click="onBreadcrumbClick(item, index)"
-          >
+          <div class="el-breadcrumb__inner is-link" :class="{ 'item-no-icon': !item.meta.icon }" @click="onBreadcrumbClick(item, index)">
             <el-icon v-if="item.meta.icon && globalStore.breadcrumbIcon" class="breadcrumb-icon">
               <component :is="item.meta.icon"></component>
             </el-icon>

+ 1 - 6
src/layouts/components/Header/components/Language.vue

@@ -3,12 +3,7 @@
     <i :class="'iconfont icon-zhongyingwen'" class="toolBar-icon"></i>
     <template #dropdown>
       <el-dropdown-menu>
-        <el-dropdown-item
-          v-for="item in languageList"
-          :key="item.value"
-          :command="item.value"
-          :disabled="language === item.value"
-        >
+        <el-dropdown-item v-for="item in languageList" :key="item.value" :command="item.value" :disabled="language === item.value">
           {{ item.label }}
         </el-dropdown-item>
       </el-dropdown-menu>

+ 3 - 27
src/layouts/components/ThemeDrawer/index.vue

@@ -140,35 +140,11 @@ import SwitchDark from '@/components/SwitchDark/index.vue'
 const { changePrimary, changeGreyOrWeak, setAsideTheme, setHeaderTheme } = useTheme()
 
 const globalStore = useGlobalStore()
-const {
-  layout,
-  primary,
-  isGrey,
-  isWeak,
-  asideInverted,
-  headerInverted,
-  isCollapse,
-  accordion,
-  breadcrumb,
-  breadcrumbIcon,
-  tabs,
-  tabsIcon,
-  footer
-} = storeToRefs(globalStore)
+const { layout, primary, isGrey, isWeak, asideInverted, headerInverted, isCollapse, accordion, breadcrumb, breadcrumbIcon, tabs, tabsIcon, footer } =
+  storeToRefs(globalStore)
 
 // 预定义主题颜色
-const colorList = [
-  DEFAULT_PRIMARY,
-  '#daa96e',
-  '#0c819f',
-  '#409eff',
-  '#27ae60',
-  '#ff5c93',
-  '#e74c3c',
-  '#fd726d',
-  '#f39c12',
-  '#9b59b6'
-]
+const colorList = [DEFAULT_PRIMARY, '#daa96e', '#0c819f', '#409eff', '#27ae60', '#ff5c93', '#e74c3c', '#fd726d', '#f39c12', '#9b59b6']
 
 // 设置布局方式
 const setLayout = (val: LayoutType) => {

+ 1 - 3
src/views/login/components/LoginForm.vue

@@ -26,9 +26,7 @@
   </el-form>
   <div class="login-btn">
     <el-button :icon="CircleClose" round size="large" @click="resetForm(loginFormRef)"> 重置 </el-button>
-    <el-button :icon="UserFilled" round size="large" type="primary" :loading="loading" @click="handleLogin(loginFormRef)">
-      登录
-    </el-button>
+    <el-button :icon="UserFilled" round size="large" type="primary" :loading="loading" @click="handleLogin(loginFormRef)"> 登录 </el-button>
   </div>
 </template>
 

+ 1 - 2
src/views/monitor/logininfor/index.vue

@@ -1,7 +1,6 @@
 <template>
   <div class="table-box">
-    <ProTable ref="proTable" :columns="columns" row-key="infoId" :request-api="listLogininforApi" :init-param="initParam">
-    </ProTable>
+    <ProTable ref="proTable" :columns="columns" row-key="infoId" :request-api="listLogininforApi" :init-param="initParam"> </ProTable>
     <FormDialog ref="formDialogRef" />
     <ImportExcel ref="dialogRef" />
   </div>

+ 1 - 2
src/views/monitor/operlog/index.vue

@@ -1,7 +1,6 @@
 <template>
   <div class="table-box">
-    <ProTable ref="proTable" :columns="columns" row-key="operId" :request-api="listOperlogApi" :init-param="initParam">
-    </ProTable>
+    <ProTable ref="proTable" :columns="columns" row-key="operId" :request-api="listOperlogApi" :init-param="initParam"> </ProTable>
   </div>
 </template>
 

+ 4 - 27
src/views/system/dept/index.vue

@@ -11,38 +11,15 @@
     >
       <!-- 表格 header 按钮 -->
       <template #tableHeader>
-        <el-button type="primary" v-auth="['system:dept:add']" :icon="CirclePlus" @click="openDialog(1, '部门新增')">
-          新增
-        </el-button>
+        <el-button type="primary" v-auth="['system:dept:add']" :icon="CirclePlus" @click="openDialog(1, '部门新增')"> 新增 </el-button>
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button
-          type="primary"
-          link
-          :icon="EditPen"
-          v-auth="['system:dept:edit']"
-          @click="openDialog(2, '部门编辑', scope.row)"
-        >
-          编辑
-        </el-button>
-        <el-button
-          type="primary"
-          link
-          :icon="CirclePlus"
-          v-auth="['system:dept:add']"
-          @click="openDialog(4, '部门新增', scope.row)"
-        >
+        <el-button type="primary" link :icon="EditPen" v-auth="['system:dept:edit']" @click="openDialog(2, '部门编辑', scope.row)"> 编辑 </el-button>
+        <el-button type="primary" link :icon="CirclePlus" v-auth="['system:dept:add']" @click="openDialog(4, '部门新增', scope.row)">
           新增
         </el-button>
-        <el-button
-          v-if="scope.row.parentId != 0"
-          type="primary"
-          link
-          :icon="Delete"
-          v-auth="['system:dept:remove']"
-          @click="deleteDept(scope.row)"
-        >
+        <el-button v-if="scope.row.parentId != 0" type="primary" link :icon="Delete" v-auth="['system:dept:remove']" @click="deleteDept(scope.row)">
           删除
         </el-button>
       </template>

+ 5 - 29
src/views/system/dict/data.vue

@@ -4,9 +4,7 @@
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
         <el-button type="primary" v-auth="['system/dict:data:add']" @click="openDialog(1, '字典数据新增')">新增</el-button>
-        <el-button type="primary" v-auth="['system/dict:data:export']" :icon="Download" plain @click="downloadFile">
-          导出
-        </el-button>
+        <el-button type="primary" v-auth="['system/dict:data:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
           type="danger"
           v-auth="['system:user:remove']"
@@ -20,27 +18,13 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button
-          type="primary"
-          link
-          :icon="View"
-          v-auth="['system/dict:data:query']"
-          @click="openDialog(3, '字典数据查看', scope.row)"
-        >
+        <el-button type="primary" link :icon="View" v-auth="['system/dict:data:query']" @click="openDialog(3, '字典数据查看', scope.row)">
           查看
         </el-button>
-        <el-button
-          type="primary"
-          link
-          :icon="EditPen"
-          v-auth="['system/dict:data:edit']"
-          @click="openDialog(2, '字典数据编辑', scope.row)"
-        >
+        <el-button type="primary" link :icon="EditPen" v-auth="['system/dict:data:edit']" @click="openDialog(2, '字典数据编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system/dict:data:remove']" @click="deleteDictData(scope.row)">
-          删除
-        </el-button>
+        <el-button type="primary" link :icon="Delete" v-auth="['system/dict:data:remove']" @click="deleteDictData(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -58,15 +42,7 @@ import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/DialogOld/form.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
 import { Delete, EditPen, Download, View } from '@element-plus/icons-vue'
-import {
-  listDataApi,
-  delDataApi,
-  addDataApi,
-  updateDataApi,
-  getDataApi,
-  exportApi,
-  getDictsApi
-} from '@/api/modules/system/dictData'
+import { listDataApi, delDataApi, addDataApi, updateDataApi, getDataApi, exportApi, getDictsApi } from '@/api/modules/system/dictData'
 import { getDictApi } from '@/api/modules/system/dict'
 
 import { useRoute } from 'vue-router'

+ 2 - 10
src/views/system/dict/index.vue

@@ -18,18 +18,10 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button
-          type="primary"
-          link
-          :icon="EditPen"
-          v-auth="['system:dict:edit']"
-          @click="openDialog(2, '字典类型编辑', scope.row)"
-        >
+        <el-button type="primary" link :icon="EditPen" v-auth="['system:dict:edit']" @click="openDialog(2, '字典类型编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system:dict:remove']" @click="deleteDict(scope.row)">
-          删除
-        </el-button>
+        <el-button type="primary" link :icon="Delete" v-auth="['system:dict:remove']" @click="deleteDict(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />

+ 3 - 15
src/views/system/menu/index.vue

@@ -22,21 +22,9 @@
       </template> -->
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button
-          type="primary"
-          link
-          :icon="EditPen"
-          v-auth="['system:menu:edit']"
-          @click="openDialog(2, '菜单编辑', scope.row)"
-        >
-          编辑
-        </el-button>
-        <el-button type="primary" link :icon="CirclePlus" v-auth="['system:menu:add']" @click="openDialog(1, '菜单新增')">
-          新增
-        </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system:menu:remove']" @click="deleteMenu(scope.row)">
-          删除
-        </el-button>
+        <el-button type="primary" link :icon="EditPen" v-auth="['system:menu:edit']" @click="openDialog(2, '菜单编辑', scope.row)"> 编辑 </el-button>
+        <el-button type="primary" link :icon="CirclePlus" v-auth="['system:menu:add']" @click="openDialog(1, '菜单新增')"> 新增 </el-button>
+        <el-button type="primary" link :icon="Delete" v-auth="['system:menu:remove']" @click="deleteMenu(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />

+ 4 - 20
src/views/system/post/index.vue

@@ -3,9 +3,7 @@
     <ProTable ref="proTable" :columns="columns" row-key="postId" :request-api="listPostApi">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['system:post:add']" :icon="CirclePlus" @click="openDialog(1, '岗位信息新增')">
-          新增
-        </el-button>
+        <el-button type="primary" v-auth="['system:post:add']" :icon="CirclePlus" @click="openDialog(1, '岗位信息新增')"> 新增 </el-button>
         <el-button type="primary" v-auth="['system:post:import']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
         <el-button type="primary" v-auth="['system:post:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
@@ -21,27 +19,13 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button
-          type="primary"
-          link
-          :icon="View"
-          v-auth="['system:post:query']"
-          @click="openDialog(3, '岗位信息查看', scope.row)"
-        >
+        <el-button type="primary" link :icon="View" v-auth="['system:post:query']" @click="openDialog(3, '岗位信息查看', scope.row)">
           查看
         </el-button>
-        <el-button
-          type="primary"
-          link
-          :icon="EditPen"
-          v-auth="['system:post:edit']"
-          @click="openDialog(2, '岗位信息编辑', scope.row)"
-        >
+        <el-button type="primary" link :icon="EditPen" v-auth="['system:post:edit']" @click="openDialog(2, '岗位信息编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system:post:remove']" @click="deletePost(scope.row)">
-          删除
-        </el-button>
+        <el-button type="primary" link :icon="Delete" v-auth="['system:post:remove']" @click="deletePost(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />

+ 4 - 20
src/views/system/role/authRole.vue

@@ -3,9 +3,7 @@
     <ProTable ref="proTable" :columns="columns" row-key="roleId" :request-api="listRoleApi">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['system:role:add']" :icon="CirclePlus" @click="openDialog(1, '角色信息新增')">
-          新增
-        </el-button>
+        <el-button type="primary" v-auth="['system:role:add']" :icon="CirclePlus" @click="openDialog(1, '角色信息新增')"> 新增 </el-button>
         <el-button type="primary" v-auth="['system:role:import']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
         <el-button type="primary" v-auth="['system:role:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
@@ -21,27 +19,13 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button
-          type="primary"
-          link
-          :icon="View"
-          v-auth="['system:role:query']"
-          @click="openDialog(3, '角色信息查看', scope.row)"
-        >
+        <el-button type="primary" link :icon="View" v-auth="['system:role:query']" @click="openDialog(3, '角色信息查看', scope.row)">
           查看
         </el-button>
-        <el-button
-          type="primary"
-          link
-          :icon="EditPen"
-          v-auth="['system:role:edit']"
-          @click="openDialog(2, '角色信息编辑', scope.row)"
-        >
+        <el-button type="primary" link :icon="EditPen" v-auth="['system:role:edit']" @click="openDialog(2, '角色信息编辑', scope.row)">
           编辑
         </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['system:role:remove']" @click="deleteRole(scope.row)">
-          删除
-        </el-button>
+        <el-button type="primary" link :icon="Delete" v-auth="['system:role:remove']" @click="deleteRole(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />

+ 4 - 20
src/views/system/role/index.vue

@@ -3,9 +3,7 @@
     <ProTable ref="proTable" :columns="columns" row-key="roleId" :request-api="listRoleApi" :init-param="initParam">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button type="primary" v-auth="['system:role:add']" :icon="CirclePlus" @click="openDialog(1, '角色信息新增')">
-          新增
-        </el-button>
+        <el-button type="primary" v-auth="['system:role:add']" :icon="CirclePlus" @click="openDialog(1, '角色信息新增')"> 新增 </el-button>
         <el-button type="primary" v-auth="['system:role:import']" :icon="Upload" plain @click="batchAdd"> 导入 </el-button>
         <el-button type="primary" v-auth="['system:role:export']" :icon="Download" plain @click="downloadFile"> 导出 </el-button>
         <el-button
@@ -21,28 +19,14 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button
-          type="primary"
-          link
-          :icon="EditPen"
-          v-auth="['system:role:edit']"
-          @click="openDialog(2, '角色信息编辑', scope.row)"
-        >
+        <el-button type="primary" link :icon="EditPen" v-auth="['system:role:edit']" @click="openDialog(2, '角色信息编辑', scope.row)">
           编辑
         </el-button>
-        <el-button
-          type="primary"
-          link
-          :icon="View"
-          v-auth="['system:role:query']"
-          @click="openDialog(3, '角色信息查看', scope.row)"
-        >
+        <el-button type="primary" link :icon="View" v-auth="['system:role:query']" @click="openDialog(3, '角色信息查看', scope.row)">
           查看
         </el-button>
 
-        <el-button type="primary" link :icon="Delete" v-auth="['system:role:remove']" @click="deleteRole(scope.row)">
-          删除
-        </el-button>
+        <el-button type="primary" link :icon="Delete" v-auth="['system:role:remove']" @click="deleteRole(scope.row)"> 删除 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />

+ 3 - 15
src/views/system/user/authUser.vue

@@ -1,12 +1,6 @@
 <template>
   <div class="main-box">
-    <TreeFilter
-      title="部门列表"
-      :is-all="false"
-      :data="treeFilterData"
-      :default-value="initParam.deptId"
-      @change="changeTreeFilter"
-    />
+    <TreeFilter title="部门列表" :is-all="false" :data="treeFilterData" :default-value="initParam.deptId" @change="changeTreeFilter" />
     <div class="table-box">
       <ProTable
         ref="proTable"
@@ -21,9 +15,7 @@
       >
         <!-- 表格 header 按钮 -->
         <template #tableHeader="scope">
-          <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="openDialog(1, '用户新增')">
-            新增
-          </el-button>
+          <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="openDialog(1, '用户新增')"> 新增 </el-button>
           <el-button type="primary" v-auth="['system:user:import']" :icon="Upload" plain @click="batchAdd">导入</el-button>
           <el-button type="primary" v-auth="['system:user:export']" :icon="Download" plain @click="downloadFile">导出</el-button>
           <el-button
@@ -112,11 +104,7 @@ const dataCallback = (data: any) => {
 
 // 切换用户状态
 const changeStatus = async (row: User.ResUserList) => {
-  await useHandleData(
-    changeUserStatus,
-    { userId: row.userId, status: row.status == '1' ? 0 : 1 },
-    `切换【${row.userName}】用户状态`
-  )
+  await useHandleData(changeUserStatus, { userId: row.userId, status: row.status == '1' ? 0 : 1 }, `切换【${row.userName}】用户状态`)
   proTable.value?.getTableList()
 }
 

+ 3 - 15
src/views/system/user/index.vue

@@ -1,12 +1,6 @@
 <template>
   <div class="main-box">
-    <TreeFilter
-      title="部门列表"
-      :is-all="false"
-      :data="treeFilterData"
-      :default-value="initParam.deptId"
-      @change="changeTreeFilter"
-    />
+    <TreeFilter title="部门列表" :is-all="false" :data="treeFilterData" :default-value="initParam.deptId" @change="changeTreeFilter" />
     <div class="table-box">
       <ProTable
         ref="proTable"
@@ -20,9 +14,7 @@
       >
         <!-- 表格 header 按钮 -->
         <template #tableHeader="scope">
-          <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="openDialog(1, '用户新增')">
-            新增
-          </el-button>
+          <el-button type="primary" v-auth="['system:user:add']" :icon="CirclePlus" @click="openDialog(1, '用户新增')"> 新增 </el-button>
           <el-button type="primary" v-auth="['system:user:import']" :icon="Upload" plain @click="batchAdd">导入</el-button>
           <el-button type="primary" v-auth="['system:user:export']" :icon="Download" plain @click="downloadFile">导出</el-button>
           <el-button
@@ -101,11 +93,7 @@ const changeTreeFilter = (val: string) => {
 
 // 切换用户状态
 const changeStatus = async (row: User.ResUserList) => {
-  await useHandleData(
-    changeUserStatus,
-    { userId: row.userId, status: row.status == '1' ? 0 : 1 },
-    `切换【${row.userName}】用户状态`
-  )
+  await useHandleData(changeUserStatus, { userId: row.userId, status: row.status == '1' ? 0 : 1 }, `切换【${row.userName}】用户状态`)
   proTable.value?.getTableList()
 }
 

+ 7 - 30
src/views/tool/gen/index.vue

@@ -3,13 +3,7 @@
     <ProTable ref="proTable" :columns="columns" row-key="tableId" :request-api="listTableApi">
       <!-- 表格 header 按钮 -->
       <template #tableHeader="scope">
-        <el-button
-          type="primary"
-          v-auth="['tool:gen:code']"
-          :disabled="!scope.isSelected"
-          :icon="CirclePlus"
-          @click="handleGenTable()"
-        >
+        <el-button type="primary" v-auth="['tool:gen:code']" :disabled="!scope.isSelected" :icon="CirclePlus" @click="handleGenTable()">
           生成
         </el-button>
         <el-button type="primary" v-auth="['tool:gen:import']" :icon="Upload" plain @click="batchAdd"> 导入表 </el-button>
@@ -26,19 +20,11 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
-        <el-button type="primary" link :icon="View" v-auth="['tool:gen:query']" @click="openDialog(1, '代码预览', scope.row)">
-          预览
-        </el-button>
+        <el-button type="primary" link :icon="View" v-auth="['tool:gen:query']" @click="openDialog(1, '代码预览', scope.row)"> 预览 </el-button>
         <el-button type="primary" link :icon="EditPen" v-auth="['tool:gen:edit']" @click="toDetail(scope.row)"> 编辑 </el-button>
-        <el-button type="primary" link :icon="Delete" v-auth="['tool:gen:remove']" @click="deleteRole(scope.row)">
-          删除
-        </el-button>
-        <el-button type="primary" link :icon="Refresh" v-auth="['tool:gen:edit']" @click="handleSyncDb(scope.row)">
-          同步
-        </el-button>
-        <el-button type="primary" link :icon="Download" v-auth="['tool:gen:code']" @click="handleGenTable(scope.row)">
-          生成代码
-        </el-button>
+        <el-button type="primary" link :icon="Delete" v-auth="['tool:gen:remove']" @click="deleteRole(scope.row)"> 删除 </el-button>
+        <el-button type="primary" link :icon="Refresh" v-auth="['tool:gen:edit']" @click="handleSyncDb(scope.row)"> 同步 </el-button>
+        <el-button type="primary" link :icon="Download" v-auth="['tool:gen:code']" @click="handleGenTable(scope.row)"> 生成代码 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef">
@@ -62,8 +48,7 @@
                     : key
                         .toString()
                         .substring(key.toString().lastIndexOf('/') + 1, key.toString().indexOf('.vm'))
-                        .split('.')[1] ||
-                      key.toString().substring(key.toString().lastIndexOf('/') + 1, key.toString().indexOf('.vm'))
+                        .split('.')[1] || key.toString().substring(key.toString().lastIndexOf('/') + 1, key.toString().indexOf('.vm'))
                 "
               >
               </preview-code>
@@ -87,15 +72,7 @@ import TableDialog from '@/components/DialogOld/table.vue'
 import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
 import { Delete, EditPen, Download, Upload, Refresh, View, CirclePlus } from '@element-plus/icons-vue'
 import PreviewCode from '@/components/Highlight/index.vue'
-import {
-  listTableApi,
-  batchGenCodeApi,
-  listDbTableApi,
-  importTableApi,
-  previewTableApi,
-  delTableApi,
-  synchDbApi
-} from '@/api/modules/tool/gen'
+import { listTableApi, batchGenCodeApi, listDbTableApi, importTableApi, previewTableApi, delTableApi, synchDbApi } from '@/api/modules/tool/gen'
 // ProTable 实例
 const proTable = ref<ProTableInstance>()
 const router = useRouter()