Selaa lähdekoodia

style: 移除按钮的type="primary"和class="is-solid"属性以简化样式

统一移除多个组件中按钮的type="primary"和class="is-solid"属性,使界面更加简洁。同时优化了auto-imports.d.ts文件的格式,将多行导出合并为单行。
piks 9 tuntia sitten
vanhempi
commit
53fed157bf

+ 2 - 2
src/views/sdk/components/ConnectionList.vue

@@ -27,10 +27,10 @@
         </template>
         一键解除封禁名单</el-button
       >
-      <el-button type="primary" :icon="Refresh" size="large" class="is-solid">刷新</el-button>
+      <el-button :icon="Refresh" size="large">刷新</el-button>
     </template>
     <template #toolbar-right>
-      <el-button :icon="Upload" type="primary" class="is-solid" size="large">导出</el-button>
+      <el-button :icon="Upload" size="large">导出</el-button>
     </template>
 
     <template #column-enableStatus="{ row }">

+ 5 - 14
src/views/sdk/components/ForwardRules.vue

@@ -9,18 +9,9 @@
     @selection-change="handleSelectionChange"
   >
     <template #toolbar-left>
-      <el-button
-        type="primary"
-        :icon="CirclePlus"
-        size="large"
-        class="is-solid"
-        @click="dialogForm.visible = true"
-        >添加</el-button
-      >
-      <el-button type="primary" disabled :icon="Delete" size="large" class="is-solid"
-        >删除</el-button
-      >
-      <el-button type="primary" :icon="Refresh" size="large" class="is-solid">刷新</el-button>
+      <el-button :icon="CirclePlus" size="large" @click="dialogForm.visible = true">添加</el-button>
+      <el-button disabled :icon="Delete" size="large">删除</el-button>
+      <el-button :icon="Refresh" size="large">刷新</el-button>
     </template>
     <template #toolbar-right>
       <el-input
@@ -31,8 +22,8 @@
         style="width: 300px"
         clearable
       />
-      <el-button :icon="Search" type="primary" class="is-solid" size="large">搜索</el-button>
-      <el-button :icon="Upload" type="primary" class="is-solid" size="large">导出</el-button>
+      <el-button :icon="Search" type="primary" size="large">搜索</el-button>
+      <el-button :icon="Upload" type="primary" size="large">导出</el-button>
     </template>
 
     <template #column-enableStatus="{ row }">

+ 111 - 99
src/views/sdk/index.vue

@@ -2,21 +2,34 @@
   <div>
     <Breadcrumb />
     <TabFilter v-model="activeTab" :options="options" @change="handleTabChange" />
-    <TableCard :data="tableData" :columns="columns" v-model:page-no="queryParams.pageNo"
-      v-model:page-size="queryParams.pageSize" @change="handleChange" :total="total"
-      @selection-change="handleSelectionChange">
+    <TableCard
+      v-model:page-no="queryParams.pageNo"
+      v-model:page-size="queryParams.pageSize"
+      :data="tableData"
+      :columns="columns"
+      :total="total"
+      @change="handleChange"
+      @selection-change="handleSelectionChange"
+    >
       <template #toolbar-left>
-        <el-button type="primary" :icon="CirclePlus" size="large" class="is-solid"
-          @click="dialogForm.visible = true">添加实例</el-button>
-        <el-button type="primary" disabled :icon="Delete" size="large" class="is-solid">删除</el-button>
-        <el-button type="primary" disabled :icon="MoreFilled" size="large" class="is-solid">更多</el-button>
-        <el-button type="primary" :icon="Refresh" size="large" class="is-solid">刷新</el-button>
+        <el-button :icon="CirclePlus" size="large" @click="dialogForm.visible = true"
+          >添加实例</el-button
+        >
+        <el-button disabled :icon="Delete" size="large">删除</el-button>
+        <el-button disabled :icon="MoreFilled" size="large">更多</el-button>
+        <el-button :icon="Refresh" size="large">刷新</el-button>
       </template>
       <template #toolbar-right>
-        <el-input :prefix-icon="Search" v-model="searchKeyword" size="large" placeholder="请输入关键词搜索" style="width: 300px"
-          clearable />
-        <el-button :icon="Search" type="primary" class="is-solid" size="large">搜索</el-button>
-        <el-button :icon="Upload" type="primary" class="is-solid" size="large">导出</el-button>
+        <el-input
+          v-model="searchKeyword"
+          :prefix-icon="Search"
+          size="large"
+          placeholder="请输入关键词搜索"
+          style="width: 300px"
+          clearable
+        />
+        <el-button :icon="Search" size="large">搜索</el-button>
+        <el-button :icon="Upload" size="large">导出</el-button>
       </template>
 
       <template #column-status="{ row }">
@@ -35,7 +48,7 @@
       </template>
 
       <template #column-operation="{ row }">
-        <el-button @click="btnClickHandler('detail', row)" type="primary" link>管理详情</el-button>
+        <el-button type="primary" link @click="btnClickHandler('detail', row)">管理详情</el-button>
         <el-button type="primary" link>升级</el-button>
         <el-button type="primary" link>编辑</el-button>
         <el-button type="warning" link>续费</el-button>
@@ -47,97 +60,96 @@
 </template>
 
 <script setup lang="ts">
-import SDKModal from './components/SDKModal.vue'
-import TabFilter from '@/components/TabFilter/index.vue'
-import TableCard from '@/components/TableCard/index.vue'
-import { CirclePlus, Delete, MoreFilled, Refresh, Search, Upload } from '@element-plus/icons-vue'
-
-const activeTab = ref('all')
-const searchKeyword = ref('')
-const selectedRows = ref<any[]>([])
-
-const router = useRouter()
-
-const state = reactive({
-  queryParams: {
-    pageNo: 1,
-    pageSize: 10,
-    searchKeyword: '',
-  },
-  total: 20
-})
-
-const dialogForm = reactive({
-  visible: false
-})
-
-const { queryParams, total } = toRefs(state)
-
-const options = [
-  { label: '全部', value: 'all' },
-  { label: '正常', value: 'normal' },
-  { label: '即将到期', value: 'expiring' },
-  { label: '禁用', value: 'disabled' }
-]
-
-const columns = [
-  { type: 'selection' as const, width: 55 },
-  { prop: 'name', label: '实例唯一标识', minWidth: 120 },
-  { prop: 'userId', label: '所属用户', },
-  { prop: 'address', label: '实例名称', },
-  { prop: 'expireTime', label: '到期时间', },
-  { prop: 'instanceType', label: '实例类型', },
-  { prop: 'status', label: '状态', },
-  { prop: 'noHeartbeat', label: '无心跳通讯', minWidth: 120 },
-  { prop: 'noDataTimeout', label: '无数据超时时间', minWidth: 130 },
-  { prop: 'enableLTS', label: '是否启用LTS', minWidth: 120 },
-  { prop: 'autoReconnect', label: '断线自动重连', minWidth: 120 },
-  { prop: 'maxConcurrent', label: '客户端最大并发数', minWidth: 150 },
-  { prop: 'createTime', label: '创建时间', minWidth: 150 },
-  { prop: 'operation', label: '操作', minWidth: 280, isAction: true }
-]
-
-const tableData = ref([
-  {
-    name: '实例1',
-    userId: '用户1',
-    address: '实例1',
-    expireTime: '2023-12-31',
-    instanceType: '普通实例',
-    status: '正常',
-    noHeartbeat: true,
-    noDataTimeout: '10秒',
-    enableLTS: true,
-    autoReconnect: false,
-    maxConcurrent: '100',
-    createTime: '2023-01-01 10:00:00'
-  }
-])
-
-const btnClickHandler = (type: string, row: any) => {
-  const typeMap: Record<string, () => void> = {
-    detail() {
-      router.push({
-        path: "/sdk/detail",
-        query: row
-      })
+  import SDKModal from './components/SDKModal.vue'
+  import TabFilter from '@/components/TabFilter/index.vue'
+  import TableCard from '@/components/TableCard/index.vue'
+  import { CirclePlus, Delete, MoreFilled, Refresh, Search, Upload } from '@element-plus/icons-vue'
+
+  const activeTab = ref('all')
+  const searchKeyword = ref('')
+  const selectedRows = ref<any[]>([])
+
+  const router = useRouter()
+
+  const state = reactive({
+    queryParams: {
+      pageNo: 1,
+      pageSize: 10,
+      searchKeyword: '',
+    },
+    total: 20,
+  })
+
+  const dialogForm = reactive({
+    visible: false,
+  })
+
+  const { queryParams, total } = toRefs(state)
+
+  const options = [
+    { label: '全部', value: 'all' },
+    { label: '正常', value: 'normal' },
+    { label: '即将到期', value: 'expiring' },
+    { label: '禁用', value: 'disabled' },
+  ]
+
+  const columns = [
+    { type: 'selection' as const, width: 55 },
+    { prop: 'name', label: '实例唯一标识', minWidth: 120 },
+    { prop: 'userId', label: '所属用户' },
+    { prop: 'address', label: '实例名称' },
+    { prop: 'expireTime', label: '到期时间' },
+    { prop: 'instanceType', label: '实例类型' },
+    { prop: 'status', label: '状态' },
+    { prop: 'noHeartbeat', label: '无心跳通讯', minWidth: 120 },
+    { prop: 'noDataTimeout', label: '无数据超时时间', minWidth: 130 },
+    { prop: 'enableLTS', label: '是否启用LTS', minWidth: 120 },
+    { prop: 'autoReconnect', label: '断线自动重连', minWidth: 120 },
+    { prop: 'maxConcurrent', label: '客户端最大并发数', minWidth: 150 },
+    { prop: 'createTime', label: '创建时间', minWidth: 150 },
+    { prop: 'operation', label: '操作', minWidth: 280, isAction: true },
+  ]
+
+  const tableData = ref([
+    {
+      name: '实例1',
+      userId: '用户1',
+      address: '实例1',
+      expireTime: '2023-12-31',
+      instanceType: '普通实例',
+      status: '正常',
+      noHeartbeat: true,
+      noDataTimeout: '10秒',
+      enableLTS: true,
+      autoReconnect: false,
+      maxConcurrent: '100',
+      createTime: '2023-01-01 10:00:00',
     },
+  ])
+
+  const btnClickHandler = (type: string, row: any) => {
+    const typeMap: Record<string, () => void> = {
+      detail() {
+        router.push({
+          path: '/sdk/detail',
+          query: row,
+        })
+      },
+    }
+    typeMap[type]?.()
   }
-  typeMap[type]?.()
-}
-
-function handleTabChange(value: string | number) {
-  console.log('切换到:', value)
-}
 
-function handleChange(page: number, size: number) {
-  console.log('分页变化:', page, size)
-}
+  function handleTabChange(value: string | number) {
+    console.log('切换到:', value)
+  }
 
-function handleSelectionChange(selection: any[]) {
-  selectedRows.value = selection
-}
+  function handleChange(page: number, size: number) {
+    console.log('分页变化:', page, size)
+  }
 
+  function handleSelectionChange(selection: any[]) {
+    selectedRows.value = selection
+  }
 </script>
 
 <style lang="scss" scoped></style>

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

@@ -7,16 +7,12 @@
         <div class="toolbar-left">
           <el-button
             v-permission="'sys:menu:add'"
-            type="primary"
             :icon="CirclePlus"
             size="large"
-            class="is-solid"
             @click="handleAdd()"
             >新增菜单</el-button
           >
-          <el-button type="primary" :icon="Sort" size="large" class="is-solid" @click="toggleExpand"
-            >展开/折叠</el-button
-          >
+          <el-button :icon="Sort" size="large" @click="toggleExpand">展开/折叠</el-button>
         </div>
         <div class="toolbar-right">
           <el-input
@@ -27,22 +23,8 @@
             style="width: 240px"
             clearable
           />
-          <el-button
-            :icon="Search"
-            type="primary"
-            class="is-solid"
-            size="large"
-            @click="handleSearch"
-            >搜索</el-button
-          >
-          <el-button
-            :icon="Refresh"
-            type="primary"
-            class="is-solid"
-            size="large"
-            @click="handleReset"
-            >重置</el-button
-          >
+          <el-button :icon="Search" size="large" @click="handleSearch">搜索</el-button>
+          <el-button :icon="Refresh" size="large" @click="handleReset">重置</el-button>
         </div>
       </div>
 

+ 2 - 19
src/views/system/role/index.vue

@@ -11,36 +11,19 @@
       @selection-change="handleSelectionChange"
     >
       <template #toolbar-left>
-        <el-button
-          v-permission="'sys:role:add'"
-          type="primary"
-          :icon="CirclePlus"
-          size="large"
-          class="is-solid"
-          @click="handleAdd"
-        >
+        <el-button v-permission="'sys:role:add'" :icon="CirclePlus" size="large" @click="handleAdd">
           新增
         </el-button>
         <el-button
           v-permission="'sys:role:delete'"
-          type="primary"
           :icon="Delete"
           size="large"
-          class="is-solid"
           :disabled="selectedRows.length === 0"
           @click="handleBatchDelete"
         >
           删除
         </el-button>
-        <el-button
-          type="primary"
-          :icon="Refresh"
-          size="large"
-          class="is-solid"
-          @click="handleRefresh"
-        >
-          刷新
-        </el-button>
+        <el-button :icon="Refresh" size="large" @click="handleRefresh"> 刷新 </el-button>
       </template>
       <template #toolbar-right>
         <el-input

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

@@ -11,33 +11,18 @@
       @selection-change="handleSelectionChange"
     >
       <template #toolbar-left>
-        <el-button
-          v-permission="'sys:user:add'"
-          type="primary"
-          :icon="CirclePlus"
-          size="large"
-          class="is-solid"
-          @click="handleAdd"
+        <el-button v-permission="'sys:user:add'" :icon="CirclePlus" size="large" @click="handleAdd"
           >新增用户</el-button
         >
         <el-button
           v-permission="'sys:user:delete'"
-          type="primary"
           :icon="Delete"
           size="large"
-          class="is-solid"
           :disabled="selectedRows.length === 0"
           @click="handleBatchDelete"
           >删除</el-button
         >
-        <el-button
-          type="primary"
-          :icon="Refresh"
-          size="large"
-          class="is-solid"
-          @click="handleRefresh"
-          >刷新</el-button
-        >
+        <el-button :icon="Refresh" size="large" @click="handleRefresh">刷新</el-button>
       </template>
       <template #toolbar-right>
         <el-input
@@ -48,9 +33,7 @@
           style="width: 300px"
           clearable
         />
-        <el-button :icon="Search" type="primary" class="is-solid" size="large" @click="handleSearch"
-          >搜索</el-button
-        >
+        <el-button :icon="Search" size="large" @click="handleSearch">搜索</el-button>
       </template>
 
       <template #column-roles="{ row }">