浏览代码

增加页面权限

yanglzh 2 年之前
父节点
当前提交
13020ddec9

+ 9 - 48
src/views/system/assess/totalIndex/index.vue

@@ -9,57 +9,21 @@
 					</el-icon>
 					查询
 				</el-button> -->
-        <el-button
-          size="default"
-          type="primary"
-          class="ml10"
-          @click="onOpenAddItem"
-        >
+        <el-button size="default" type="primary" class="ml10" @click="onOpenAddItem" v-auth="'add'">
           <el-icon>
             <ele-FolderAdd />
           </el-icon>
           新建
         </el-button>
       </div>
-      <el-table
-        v-loading="loading"
-        :data="tableData.data"
-        style="width: 100%"
-      >
-        <el-table-column
-          align="left"
-          prop="title"
-          label="名称"
-          width="260"
-          show-overflow-tooltip
-        ></el-table-column>
-        <el-table-column
-          align="left"
-          prop="explain"
-          label="描述"
-          show-overflow-tooltip
-        ></el-table-column>
-        <el-table-column
-          align="center"
-          label="操作"
-          width="180"
-        >
+      <el-table v-loading="tableData.loading" :data="tableData.data" style="width: 100%">
+        <el-table-column align="left" prop="title" v-col="'title'" label="名称" width="260" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" prop="explain" v-col="'explain'" label="描述" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="操作" width="180" v-col="'handle'">
           <template #default="scope">
-            <el-button
-              size="small"
-              type="text"
-              @click="onOpenEditItem(scope.row)"
-            >编辑</el-button>
-            <el-button
-              size="small"
-              type="text"
-              @click="onRowDel(scope.row)"
-            >删除</el-button>
-            <el-button
-              size="small"
-              type="text"
-              @click="onOpenDetailItem(scope.row)"
-            >详细信息</el-button>
+            <el-button size="small" type="text" @click="onOpenEditItem(scope.row)" v-auth="'edit'">编辑</el-button>
+            <el-button size="small" type="text" @click="onRowDel(scope.row)" v-auth="'del'">删除</el-button>
+            <el-button size="small" type="text" @click="onOpenDetailItem(scope.row)" v-auth="'detail'">详细信息</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -77,10 +41,7 @@
 			>
 			</el-pagination> -->
     </el-card>
-    <EditOrAddItem
-      ref="EditOrAddItem"
-      @fetchList="fetchList"
-    />
+    <EditOrAddItem ref="EditOrAddItem" @fetchList="fetchList" />
     <DetailItem ref="detailItemRef" />
 
   </div>

+ 196 - 211
src/views/system/config/index.vue

@@ -1,89 +1,74 @@
 <template>
-	<div class="system-dic-container">
-		<el-card shadow="hover">
-			<div class="system-user-search mb15">
-				<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
-					<el-form-item label="参数名称" prop="configName">
-						<el-input v-model="tableData.param.configName" placeholder="请输入参数名称" clearable size="default" @keyup.enter.native="dataList" />
-					</el-form-item>
-					<el-form-item label="参数键名" prop="configKey">
-						<el-input v-model="tableData.param.configKey" placeholder="请输入参数键名" clearable size="default" @keyup.enter.native="dataList" />
-					</el-form-item>
-					<el-form-item label="系统内置" prop="configType" style="width: 200px">
-						<el-select v-model="tableData.param.configType" placeholder="系统内置" clearable size="default" style="width: 240px">
-							<el-option v-for="dict in sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
-						</el-select>
-					</el-form-item>
-					<el-form-item label="创建时间" prop="dateRange">
-						<el-date-picker
-							v-model="tableData.param.dateRange"
-							size="default"
-							style="width: 240px"
-							value-format="YYYY-MM-DD"
-							type="daterange"
-							range-separator="-"
-							start-placeholder="开始日期"
-							end-placeholder="结束日期"
-						></el-date-picker>
-					</el-form-item>
-					<el-form-item>
-						<el-button size="default" type="primary" class="ml10" @click="dataList">
-							<el-icon>
-								<ele-Search />
-							</el-icon>
-							查询
-						</el-button>
-						<el-button size="default" @click="resetQuery(queryRef)">
-							<el-icon>
-								<ele-Refresh />
-							</el-icon>
-							重置
-						</el-button>
-						<el-button size="default" type="success" class="ml10" @click="onOpenAddDic">
-							<el-icon>
-								<ele-FolderAdd />
-							</el-icon>
-							新增参数
-						</el-button>
-						<el-button size="default" type="danger" class="ml10" @click="onRowDel(null)">
-							<el-icon>
-								<ele-Delete />
-							</el-icon>
-							删除参数
-						</el-button>
-					</el-form-item>
-				</el-form>
-			</div>
-			<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
-				<el-table-column type="selection" width="55" align="center" />
-				<el-table-column label="ID" align="center" prop="configId" width="60" />
-				<el-table-column label="参数名称" prop="configName" :show-overflow-tooltip="true" />
-				<el-table-column label="参数键名" prop="configKey" :show-overflow-tooltip="true" />
-				<el-table-column label="参数键值" prop="configValue" />
-				<el-table-column label="备注" prop="remark" :show-overflow-tooltip="true" />
-				<!-- <el-table-column label="创建时间" prop="createdAt" width="180" align="center" /> -->
-				<el-table-column label="系统内置" align="center" prop="configType" width="100">
-					<template #default="{ row }">
-						{{ row.configType ? '是' : '否' }}
-					</template>
-				</el-table-column>
-				<el-table-column label="操作" width="100" align="center" fixed="right">
-					<template #default="scope">
-						<el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)">修改</el-button>
-						<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
-					</template>
-				</el-table-column>
-			</el-table>
-			<pagination
-				v-show="tableData.total > 0"
-				:total="tableData.total"
-				v-model:page="tableData.param.pageNum"
-				v-model:limit="tableData.param.pageSize"
-				@pagination="dataList"
-			/>
-		</el-card>
-		<EditConfig ref="editDicRef" @dataList="dataList" :sysYesNoOptions="sys_yes_no" />
-	</div>
+  <div class="system-dic-container">
+    <el-card shadow="hover">
+      <div class="system-user-search mb15">
+        <el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
+          <el-form-item label="参数名称" prop="configName">
+            <el-input v-model="tableData.param.configName" placeholder="请输入参数名称" clearable size="default" @keyup.enter.native="dataList" />
+          </el-form-item>
+          <el-form-item label="参数键名" prop="configKey">
+            <el-input v-model="tableData.param.configKey" placeholder="请输入参数键名" clearable size="default" @keyup.enter.native="dataList" />
+          </el-form-item>
+          <el-form-item label="系统内置" prop="configType" style="width: 200px">
+            <el-select v-model="tableData.param.configType" placeholder="系统内置" clearable size="default" style="width: 240px">
+              <el-option v-for="dict in sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="创建时间" prop="dateRange">
+            <el-date-picker v-model="tableData.param.dateRange" size="default" style="width: 240px" value-format="YYYY-MM-DD" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+          </el-form-item>
+          <el-form-item>
+            <el-button size="default" type="primary" class="ml10" @click="dataList">
+              <el-icon>
+                <ele-Search />
+              </el-icon>
+              查询
+            </el-button>
+            <el-button size="default" @click="resetQuery(queryRef)">
+              <el-icon>
+                <ele-Refresh />
+              </el-icon>
+              重置
+            </el-button>
+            <el-button size="default" type="success" class="ml10" @click="onOpenAddDic" v-auth="'add'">
+              <el-icon>
+                <ele-FolderAdd />
+              </el-icon>
+              新增参数
+            </el-button>
+            <el-button size="default" type="danger" class="ml10" @click="onRowDel()" v-auth="'del'">
+              <el-icon>
+                <ele-Delete />
+              </el-icon>
+              删除参数
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="ID" v-col="'configId'" align="center" prop="configId" width="60" />
+        <el-table-column label="参数名称" v-col="'configName'" prop="configName" :show-overflow-tooltip="true" />
+        <el-table-column label="参数键名" v-col="'configKey'" prop="configKey" :show-overflow-tooltip="true" />
+        <el-table-column label="参数键值" v-col="'configValue'" prop="configValue" />
+        <el-table-column label="备注" prop="remark" v-col="'remark'" :show-overflow-tooltip="true" />
+        <!-- <el-table-column label="创建时间" prop="createdAt" width="180" align="center" /> -->
+        <el-table-column label="系统内置" v-col="'configType'" align="center" prop="configType" width="100">
+          <template #default="{ row }">
+            {{ row.configType ? '是' : '否' }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="100" v-col="'handle'" align="center" fixed="right">
+          <template #default="scope">
+            <el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)" v-auth="'edit'">修改</el-button>
+            <el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-auth="'del'">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="dataList" />
+    </el-card>
+    <EditConfig ref="editDicRef" @dataList="dataList" :sysYesNoOptions="sys_yes_no" />
+  </div>
 </template>
 
 <script lang="ts">
@@ -94,136 +79,136 @@ import api from '/@/api/system';
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
-	configId: number;
-	configName: string;
-	configKey: string;
-	configValue: string;
-	configType: number;
-	remark: string;
-	createdAt: string;
+  configId: number;
+  configName: string;
+  configKey: string;
+  configValue: string;
+  configType: number;
+  remark: string;
+  createdAt: string;
 }
 interface TableDataState {
-	ids: number[];
-	tableData: {
-		data: Array<TableDataRow>;
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-			configName: string;
-			configKey: string;
-			configType: string;
-			dateRange: string[];
-		};
-	};
+  ids: number[];
+  tableData: {
+    data: Array<TableDataRow>;
+    total: number;
+    loading: boolean;
+    param: {
+      pageNum: number;
+      pageSize: number;
+      configName: string;
+      configKey: string;
+      configType: string;
+      dateRange: string[];
+    };
+  };
 }
 
 export default defineComponent({
-	name: 'apiV1SystemDictDataList',
-	components: { EditConfig },
-	setup() {
-		const { proxy } = getCurrentInstance() as any;
-		const addDicRef = ref();
-		const editDicRef = ref();
-		const queryRef = ref();
-		const { sys_yes_no } = proxy.useDict('sys_yes_no');
-		const state = reactive<TableDataState>({
-			ids: [],
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					dateRange: [],
-					pageNum: 1,
-					pageSize: 10,
-					configName: '',
-					configKey: '',
-					configType: '',
-				},
-			},
-		});
-		// 初始化表格数据
-		const initTableData = () => {
-			dataList();
-		};
-		const dataList = () => {
-			state.tableData.loading = true;
-			api.config
-				.getList(state.tableData.param)
-				.then((res: any) => {
-					state.tableData.data = res.list;
-					state.tableData.total = res.total;
-				})
-				.finally(() => (state.tableData.loading = false));
-		};
-		// 打开新增字典弹窗
-		const onOpenAddDic = () => {
-			editDicRef.value.openDialog();
-		};
-		// 打开修改字典弹窗
-		const onOpenEditDic = (row: TableDataRow) => {
-			editDicRef.value.openDialog(row);
-		};
-		// 删除字典
-		const onRowDel = (row: TableDataRow) => {
-			let msg = '你确定要删除所选数据?';
-			let ids: number[] = [];
-			if (row) {
-				msg = `此操作将永久删除用户:“${row.configName}”,是否继续?`;
-				ids = [row.configId];
-			} else {
-				ids = state.ids;
-			}
-			if (ids.length === 0) {
-				ElMessage.error('请选择要删除的数据。');
-				return;
-			}
-			ElMessageBox.confirm(msg, '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
-					api.config.del(ids).then(() => {
-						ElMessage.success('删除成功');
-						dataList();
-					});
-				})
-				.catch(() => {});
-		};
-		// 页面加载时
-		onMounted(() => {
-			initTableData();
-		});
-		/** 重置按钮操作 */
-		const resetQuery = (formEl: FormInstance | undefined) => {
-			if (!formEl) return;
-			formEl.resetFields();
-			dataList();
-		};
-		// 多选框选中数据
-		const handleSelectionChange = (selection: TableDataRow[]) => {
-			state.ids = selection.map((item) => item.configId);
-		};
-		// 参数系统内置字典翻译
-		const typeFormat = (row: TableDataRow) => {
-			return proxy.selectDictLabel(unref(sys_yes_no), row.configType);
-		};
-		return {
-			addDicRef,
-			editDicRef,
-			queryRef,
-			sys_yes_no,
-			onOpenAddDic,
-			onOpenEditDic,
-			onRowDel,
-			dataList,
-			resetQuery,
-			handleSelectionChange,
-			...toRefs(state),
-		};
-	},
+  name: 'apiV1SystemDictDataList',
+  components: { EditConfig },
+  setup() {
+    const { proxy } = getCurrentInstance() as any;
+    const addDicRef = ref();
+    const editDicRef = ref();
+    const queryRef = ref();
+    const { sys_yes_no } = proxy.useDict('sys_yes_no');
+    const state = reactive<TableDataState>({
+      ids: [],
+      tableData: {
+        data: [],
+        total: 0,
+        loading: false,
+        param: {
+          dateRange: [],
+          pageNum: 1,
+          pageSize: 10,
+          configName: '',
+          configKey: '',
+          configType: '',
+        },
+      },
+    });
+    // 初始化表格数据
+    const initTableData = () => {
+      dataList();
+    };
+    const dataList = () => {
+      state.tableData.loading = true;
+      api.config
+        .getList(state.tableData.param)
+        .then((res: any) => {
+          state.tableData.data = res.list;
+          state.tableData.total = res.total;
+        })
+        .finally(() => (state.tableData.loading = false));
+    };
+    // 打开新增字典弹窗
+    const onOpenAddDic = () => {
+      editDicRef.value.openDialog();
+    };
+    // 打开修改字典弹窗
+    const onOpenEditDic = (row: TableDataRow) => {
+      editDicRef.value.openDialog(row);
+    };
+    // 删除字典
+    const onRowDel = (row?: TableDataRow) => {
+      let msg = '你确定要删除所选数据?';
+      let ids: number[] = [];
+      if (row) {
+        msg = `此操作将永久删除用户:“${row.configName}”,是否继续?`;
+        ids = [row.configId];
+      } else {
+        ids = state.ids;
+      }
+      if (ids.length === 0) {
+        ElMessage.error('请选择要删除的数据。');
+        return;
+      }
+      ElMessageBox.confirm(msg, '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          api.config.del(ids).then(() => {
+            ElMessage.success('删除成功');
+            dataList();
+          });
+        })
+        .catch(() => { });
+    };
+    // 页面加载时
+    onMounted(() => {
+      initTableData();
+    });
+    /** 重置按钮操作 */
+    const resetQuery = (formEl: FormInstance | undefined) => {
+      if (!formEl) return;
+      formEl.resetFields();
+      dataList();
+    };
+    // 多选框选中数据
+    const handleSelectionChange = (selection: TableDataRow[]) => {
+      state.ids = selection.map((item) => item.configId);
+    };
+    // 参数系统内置字典翻译
+    const typeFormat = (row: TableDataRow) => {
+      return proxy.selectDictLabel(unref(sys_yes_no), row.configType);
+    };
+    return {
+      addDicRef,
+      editDicRef,
+      queryRef,
+      sys_yes_no,
+      onOpenAddDic,
+      onOpenEditDic,
+      onRowDel,
+      dataList,
+      resetQuery,
+      handleSelectionChange,
+      ...toRefs(state),
+    };
+  },
 });
 </script>

+ 192 - 216
src/views/system/datahub/modeling/index.vue

@@ -1,97 +1,73 @@
 <template>
-	<div class="system-dic-container">
-		<el-card shadow="hover">
-			<div class="system-user-search mb15">
-				<el-form :model="tableData.param" ref="queryRef" :inline="true">
-					<el-form-item label="模型标识" prop="key">
-						<el-input
-							v-model="tableData.param.key"
-							placeholder="请输入模型标识"
-							clearable
-							size="default"
-							style="width: 240px"
-							@keyup.enter.native="typeList"
-						/>
-					</el-form-item>
-					<el-form-item label="模型名称" prop="name">
-						<el-input
-							v-model="tableData.param.name"
-							placeholder="请输入模型名称"
-							clearable
-							size="default"
-							style="width: 240px"
-							@keyup.enter.native="typeList"
-						/>
-					</el-form-item>
-					<el-form-item>
-						<el-button size="default" type="primary" class="ml10" @click="typeList">
-							<el-icon>
-								<ele-Search />
-							</el-icon>
-							查询
-						</el-button>
-						<el-button size="default" @click="resetQuery(queryRef)">
-							<el-icon>
-								<ele-Refresh />
-							</el-icon>
-							重置
-						</el-button>
-						<el-button size="default" type="success" class="ml10" @click="onOpenAdd" v-auth="'add'">
-							<el-icon>
-								<ele-FolderAdd />
-							</el-icon>
-							新增模型
-						</el-button>
-						<el-button size="default" type="danger" class="ml10" @click="onRowDel(null)" v-auth="'del'">
-							<el-icon>
-								<ele-Delete />
-							</el-icon>
-							删除
-						</el-button>
-					</el-form-item>
-				</el-form>
-			</div>
-			<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
-				<el-table-column type="selection" width="55" align="center" />
-				<el-table-column label="ID" align="center" prop="id" width="80" v-col="'id'"/>
-<!--				<el-table-column label="模型标识" prop="key" :show-overflow-tooltip="true" />-->
-				<el-table-column label="模型名称" prop="name" :show-overflow-tooltip="true"  v-col="'name'"/>
-				<el-table-column prop="status" label="状态" width="100" align="center"  v-col="'status'"> 
+  <div class="system-dic-container">
+    <el-card shadow="hover">
+      <div class="system-user-search mb15">
+        <el-form :model="tableData.param" ref="queryRef" :inline="true">
+          <el-form-item label="模型标识" prop="key">
+            <el-input v-model="tableData.param.key" placeholder="请输入模型标识" clearable size="default" style="width: 240px" @keyup.enter.native="typeList" />
+          </el-form-item>
+          <el-form-item label="模型名称" prop="name">
+            <el-input v-model="tableData.param.name" placeholder="请输入模型名称" clearable size="default" style="width: 240px" @keyup.enter.native="typeList" />
+          </el-form-item>
+          <el-form-item>
+            <el-button size="default" type="primary" class="ml10" @click="typeList">
+              <el-icon>
+                <ele-Search />
+              </el-icon>
+              查询
+            </el-button>
+            <el-button size="default" @click="resetQuery(queryRef)">
+              <el-icon>
+                <ele-Refresh />
+              </el-icon>
+              重置
+            </el-button>
+            <el-button size="default" type="success" class="ml10" @click="onOpenAdd" v-auth="'add'">
+              <el-icon>
+                <ele-FolderAdd />
+              </el-icon>
+              新增模型
+            </el-button>
+            <el-button size="default" type="danger" class="ml10" @click="onRowDel()" v-auth="'del'">
+              <el-icon>
+                <ele-Delete />
+              </el-icon>
+              删除
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="ID" align="center" prop="id" width="80" v-col="'id'" />
+        <!--				<el-table-column label="模型标识" prop="key" :show-overflow-tooltip="true" />-->
+        <el-table-column label="模型名称" prop="name" :show-overflow-tooltip="true" v-col="'name'" />
+        <el-table-column prop="status" label="状态" width="100" align="center" v-col="'status'">
           <template #default="scope">
             <el-tag type="success" size="small" v-if="scope.row.status==1">已发布</el-tag>
             <el-tag type="info" size="small" v-else>未发布</el-tag>
           </template>
         </el-table-column>
-				<el-table-column prop="createdAt" label="创建时间"  width="200" align="center" v-col="'createdAt'"></el-table-column>
+        <el-table-column prop="createdAt" label="创建时间" width="200" align="center" v-col="'createdAt'"></el-table-column>
 
-				<el-table-column label="操作" width="280" align="center" fixed="right">
-					<template #default="scope" >
-						<router-link
-							:to="'/datahub/modeling/detail/' + scope.row.id"
-							class="link-type"
-							style="padding-right: 12px; font-size: 12px; color: #409eff"
-							v-auth="'detail'">
-							<span>字段管理</span>
-						</router-link>
-						<el-button size="small" text type="success" @click="onOpenRecord(scope.row)"  v-if="scope.row.status==1" v-auth="'record'">数据记录</el-button>
-						<el-button size="small" text type="warning" @click="onOpenEdit(scope.row)" v-if="scope.row.status==0" v-auth="'edit'">修改</el-button>
-						<el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-if="scope.row.status==0" v-auth="'del'">删除</el-button>
-						<el-button size="small" text type="primary" @click="copy(scope.row)" v-auth="'copy'">复制</el-button>
+        <el-table-column label="操作" width="280" align="center" fixed="right">
+          <template #default="scope">
+            <router-link :to="'/datahub/modeling/detail/' + scope.row.id" class="link-type" style="padding-right: 12px; font-size: 12px; color: #409eff" v-auth="'detail'">
+              <span>字段管理</span>
+            </router-link>
+            <el-button size="small" text type="success" @click="onOpenRecord(scope.row)" v-if="scope.row.status==1" v-auth="'record'">数据记录</el-button>
+            <el-button size="small" text type="warning" @click="onOpenEdit(scope.row)" v-if="scope.row.status==0" v-auth="'edit'">修改</el-button>
+            <el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-if="scope.row.status==0" v-auth="'del'">删除</el-button>
+            <el-button size="small" text type="primary" @click="copy(scope.row)" v-auth="'copy'">复制</el-button>
 
-					</template>
-				</el-table-column>
-			</el-table>
-			<pagination
-				v-show="tableData.total > 0"
-				:total="tableData.total"
-				v-model:page="tableData.param.pageNum"
-				v-model:limit="tableData.param.pageSize"
-				@pagination="typeList"
-			/>
-		</el-card>
-		<EditDic ref="editDicRef" @typeList="typeList" />
-		<Detail ref="detailRef" />
-	</div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="typeList" />
+    </el-card>
+    <EditDic ref="editDicRef" @typeList="typeList" />
+    <Detail ref="detailRef" />
+  </div>
 </template>
 
 <script lang="ts">
@@ -103,146 +79,146 @@ import api from '/@/api/datahub';
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
-	id: number;
-	name: string;
-	key: string;
+  id: number;
+  name: string;
+  key: string;
 
-	createBy: string;
+  createBy: string;
 }
 interface TableDataState {
-	ids: number[];
-	tableData: {
-		data: Array<TableDataRow>;
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-			name: string;
-			key: string;
-		};
-	};
+  ids: number[];
+  tableData: {
+    data: Array<TableDataRow>;
+    total: number;
+    loading: boolean;
+    param: {
+      pageNum: number;
+      pageSize: number;
+      name: string;
+      key: string;
+    };
+  };
 }
 
 export default defineComponent({
-	name: 'sourcelist',
-	components: { EditDic,Detail },
-	setup() {
-		const addDicRef = ref();
-		const editDicRef = ref();
-		const detailRef=ref();
-		const queryRef = ref();
-		const state = reactive<TableDataState>({
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					pageNum: 1,
-					pageSize: 10,
-					name: '',
-					key: '',
-				},
-			},
-		});
-		// 初始化表格数据
-		const initTableData = () => {
-			typeList();
-		};
-		const typeList = () => {
-			state.tableData.loading = true;
-			api.template.getList(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.list;
-				state.tableData.total = res.Total;
-			}).finally(() => (state.tableData.loading = false));
-		};
-		// 打开新增菜单弹窗
-		const onOpenAdd = (row?: TableDataRow) => {
-			editDicRef.value.openDialog(row?.id);
-		};
-		// 打开修改模型弹窗
-		const onOpenEdit = (row: TableDataRow) => {
-			editDicRef.value.openDialog(row);
-		};
-		//打开数据记录
-		const onOpenRecord=(row: TableDataRow)=>{
-			detailRef.value.openDialog(row);
-		};
-		const onRowDel = (row: TableDataRow) => {
-			let msg = '你确定要删除所选数据?';
-			let ids: number[] = [];
-			if (row) {
-				msg = `此操作将永久删除模型:“${row.name}”,是否继续?`;
-				ids = [row.id];
-			} else {
-				ids = state.ids;
-			}
-			if (ids.length === 0) {
-				ElMessage.error('请选择要删除的数据。');
-				return;
-			}
-			ElMessageBox.confirm(msg, '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
-					api.template.delete(ids).then(() => {
-						ElMessage.success('删除成功');
-						typeList();
-					});
-				})
-				.catch(() => {});
-		};
+  name: 'sourcelist',
+  components: { EditDic, Detail },
+  setup() {
+    const addDicRef = ref();
+    const editDicRef = ref();
+    const detailRef = ref();
+    const queryRef = ref();
+    const state = reactive<TableDataState>({
+      tableData: {
+        data: [],
+        total: 0,
+        loading: false,
+        param: {
+          pageNum: 1,
+          pageSize: 10,
+          name: '',
+          key: '',
+        },
+      },
+    });
+    // 初始化表格数据
+    const initTableData = () => {
+      typeList();
+    };
+    const typeList = () => {
+      state.tableData.loading = true;
+      api.template.getList(state.tableData.param).then((res: any) => {
+        state.tableData.data = res.list;
+        state.tableData.total = res.Total;
+      }).finally(() => (state.tableData.loading = false));
+    };
+    // 打开新增菜单弹窗
+    const onOpenAdd = (row?: TableDataRow) => {
+      editDicRef.value.openDialog(row?.id);
+    };
+    // 打开修改模型弹窗
+    const onOpenEdit = (row: TableDataRow) => {
+      editDicRef.value.openDialog(row);
+    };
+    //打开数据记录
+    const onOpenRecord = (row: TableDataRow) => {
+      detailRef.value.openDialog(row);
+    };
+    const onRowDel = (row?: TableDataRow) => {
+      let msg = '你确定要删除所选数据?';
+      let ids: number[] = [];
+      if (row) {
+        msg = `此操作将永久删除模型:“${row.name}”,是否继续?`;
+        ids = [row.id];
+      } else {
+        ids = state.ids;
+      }
+      if (ids.length === 0) {
+        ElMessage.error('请选择要删除的数据。');
+        return;
+      }
+      ElMessageBox.confirm(msg, '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          api.template.delete(ids).then(() => {
+            ElMessage.success('删除成功');
+            typeList();
+          });
+        })
+        .catch(() => { });
+    };
 
-		//复制数据
-		const copy=(row:TableDataRow)=>{
-			ElMessageBox.confirm("确定要复制该数据吗?", '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
+    //复制数据
+    const copy = (row: TableDataRow) => {
+      ElMessageBox.confirm("确定要复制该数据吗?", '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
 
-					api.template.copy({id:row.id}).then(() => {
-						ElMessage.success('复制成功');
-						typeList();
-					});
-				})
-				.catch(() => {});
-		}
+          api.template.copy({ id: row.id }).then(() => {
+            ElMessage.success('复制成功');
+            typeList();
+          });
+        })
+        .catch(() => { });
+    }
 
 
-		// 页面加载时
-		onMounted(() => {
-			initTableData();
-		});
-		/** 重置按钮操作 */
-		const resetQuery = (formEl: FormInstance | undefined) => {
-			if (!formEl) return;
-			formEl.resetFields();
-			typeList();
-		};
-		// 多选框选中数据
-		const handleSelectionChange = (selection: TableDataRow[]) => {
-			state.ids = selection.map((item) => item.id);
-		};
+    // 页面加载时
+    onMounted(() => {
+      initTableData();
+    });
+    /** 重置按钮操作 */
+    const resetQuery = (formEl: FormInstance | undefined) => {
+      if (!formEl) return;
+      formEl.resetFields();
+      typeList();
+    };
+    // 多选框选中数据
+    const handleSelectionChange = (selection: TableDataRow[]) => {
+      state.ids = selection.map((item) => item.id);
+    };
 
-		return {
-			addDicRef,
-			editDicRef,
-			detailRef,
-			queryRef,
-			onOpenRecord,
-			onOpenAdd,
-			onOpenEdit,
-			onRowDel,
-			copy,
-			typeList,
-			resetQuery,
-			handleSelectionChange,
-			...toRefs(state),
-		};
-	},
+    return {
+      addDicRef,
+      editDicRef,
+      detailRef,
+      queryRef,
+      onOpenRecord,
+      onOpenAdd,
+      onOpenEdit,
+      onRowDel,
+      copy,
+      typeList,
+      resetQuery,
+      handleSelectionChange,
+      ...toRefs(state),
+    };
+  },
 });
 </script>

+ 235 - 261
src/views/system/datahub/source/index.vue

@@ -1,111 +1,85 @@
 <template>
-	<div class="system-dic-container">
-		<el-card shadow="hover">
-			<div class="system-user-search mb15">
-				<el-form :model="tableData.param" ref="queryRef" :inline="true">
-					<el-form-item label="数据源标识" prop="key">
-						<el-input
-							v-model="tableData.param.key"
-							placeholder="数据源标识"
-							clearable
-							size="default"
-							style="width: 240px"
-							@keyup.enter.native="typeList"
-						/>
-					</el-form-item>
-					<el-form-item label="数据源名称" prop="name">
-						<el-input
-							v-model="tableData.param.name"
-							placeholder="请输入数据源名称"
-							clearable
-							size="default"
-							style="width: 240px"
-							@keyup.enter.native="typeList"
-						/>
-					</el-form-item>
+  <div class="system-dic-container">
+    <el-card shadow="hover">
+      <div class="system-user-search mb15">
+        <el-form :model="tableData.param" ref="queryRef" :inline="true">
+          <el-form-item label="数据源标识" prop="key">
+            <el-input v-model="tableData.param.key" placeholder="数据源标识" clearable size="default" style="width: 240px" @keyup.enter.native="typeList" />
+          </el-form-item>
+          <el-form-item label="数据源名称" prop="name">
+            <el-input v-model="tableData.param.name" placeholder="请输入数据源名称" clearable size="default" style="width: 240px" @keyup.enter.native="typeList" />
+          </el-form-item>
 
-					<el-form-item label="数据源类型" prop="host">
-						<el-select v-model="tableData.param.from" placeholder="请选择数据源类型" @keyup.enter.native="typeList">
-							<el-option v-for="item in typeData" :key="item.value" :label="item.label" :value="item.value" />
-						</el-select>
-					</el-form-item>
+          <el-form-item label="数据源类型" prop="host">
+            <el-select v-model="tableData.param.from" placeholder="请选择数据源类型" @keyup.enter.native="typeList">
+              <el-option v-for="item in typeData" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
 
-					<el-form-item>
-						<el-button size="default" type="primary" class="ml10" @click="typeList">
-							<el-icon>
-								<ele-Search />
-							</el-icon>
-							查询
-						</el-button>
-						<el-button size="default" @click="resetQuery(queryRef)">
-							<el-icon>
-								<ele-Refresh />
-							</el-icon>
-							重置
-						</el-button>
-						<el-button size="default" type="success" class="ml10" @click="onOpenAdd" v-auth="'add'"> 
-							<el-icon>
-								<ele-FolderAdd />
-							</el-icon>
-							新增数据源
-						</el-button>
-						<el-button size="default" type="danger" class="ml10" @click="onRowDel(null)" v-auth="'del'">
-							<el-icon>
-								<ele-Delete />
-							</el-icon>
-							删除
-						</el-button>
-					</el-form-item>
-				</el-form>
-			</div>
-			<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
-				<el-table-column type="selection" width="55" align="center" />
-				<el-table-column label="ID" align="center" prop="sourceId" width="80" v-col="'sourceId'" />
-				<el-table-column label="数据源名称" prop="name" :show-overflow-tooltip="true" v-col="'name'"/>
-				<el-table-column prop="from" label="数据源类型" width="160" align="center" v-col="'from'">
-					<template #default="scope">
-						<span v-if="scope.row.from == 1">api导入</span>
-						<span v-if="scope.row.from == 2">数据库</span>
-						<span v-if="scope.row.from == 3">文件</span>
-						<span v-if="scope.row.from == 4">设备</span>
-					</template>
-				</el-table-column>
-				<el-table-column prop="status" label="状态" width="100" align="center" v-col="'status'">
-					<template #default="scope">
-						<el-tag type="success" size="small" v-if="scope.row.status == 1">已发布</el-tag>
-						<el-tag type="info" size="small" v-if="scope.row.status == 0">未发布</el-tag>
-					</template>
-				</el-table-column>
+          <el-form-item>
+            <el-button size="default" type="primary" class="ml10" @click="typeList">
+              <el-icon>
+                <ele-Search />
+              </el-icon>
+              查询
+            </el-button>
+            <el-button size="default" @click="resetQuery(queryRef)">
+              <el-icon>
+                <ele-Refresh />
+              </el-icon>
+              重置
+            </el-button>
+            <el-button size="default" type="success" class="ml10" @click="onOpenAdd" v-auth="'add'">
+              <el-icon>
+                <ele-FolderAdd />
+              </el-icon>
+              新增数据源
+            </el-button>
+            <el-button size="default" type="danger" class="ml10" @click="onRowDel()" v-auth="'del'">
+              <el-icon>
+                <ele-Delete />
+              </el-icon>
+              删除
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="ID" align="center" prop="sourceId" width="80" v-col="'sourceId'" />
+        <el-table-column label="数据源名称" prop="name" :show-overflow-tooltip="true" v-col="'name'" />
+        <el-table-column prop="from" label="数据源类型" width="160" align="center" v-col="'from'">
+          <template #default="scope">
+            <span v-if="scope.row.from == 1">api导入</span>
+            <span v-if="scope.row.from == 2">数据库</span>
+            <span v-if="scope.row.from == 3">文件</span>
+            <span v-if="scope.row.from == 4">设备</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="status" label="状态" width="100" align="center" v-col="'status'">
+          <template #default="scope">
+            <el-tag type="success" size="small" v-if="scope.row.status == 1">已发布</el-tag>
+            <el-tag type="info" size="small" v-if="scope.row.status == 0">未发布</el-tag>
+          </template>
+        </el-table-column>
 
-
-				<el-table-column label="操作" width="200" align="center" fixed="right">
-					<template #default="scope">
-						<router-link
-							:to="'/datahub/source/detail/' + scope.row.sourceId"
-							class="link-type"
-							style="padding-right: 12px; font-size: 12px; color: #409eff"
-							v-auth="'detail'"
-						>
-							<span>详情</span>
-						</router-link>
-						<el-button size="small" text type="success" @click="onOpenList(scope.row)"  v-if="scope.row.status==1" v-auth="'detail'">数据记录</el-button>
-						<el-button size="small" text type="warning" @click="onOpenEdit(scope.row)" v-if="scope.row.status==0" v-auth="'edit'">修改</el-button>
-						<el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-if="scope.row.status==0" v-auth="'del'">删除</el-button>
-						<el-button size="small" text type="primary" @click="copy(scope.row)" v-auth="'copy'">复制</el-button>
-					</template>
-				</el-table-column>
-			</el-table>
-			<pagination
-				v-show="tableData.total > 0"
-				:total="tableData.total"
-				v-model:page="tableData.param.pageNum"
-				v-model:limit="tableData.param.pageSize"
-				@pagination="typeList"
-			/>
-		</el-card>
-		<EditDic ref="editDicRef" @typeList="typeList" />
-		<ListDic ref="listDicRef" />
-	</div>
+        <el-table-column label="操作" width="200" align="center" fixed="right">
+          <template #default="scope">
+            <router-link :to="'/datahub/source/detail/' + scope.row.sourceId" class="link-type" style="padding-right: 12px; font-size: 12px; color: #409eff" v-auth="'detail'">
+              <span>详情</span>
+            </router-link>
+            <el-button size="small" text type="success" @click="onOpenList(scope.row)" v-if="scope.row.status==1" v-auth="'detail'">数据记录</el-button>
+            <el-button size="small" text type="warning" @click="onOpenEdit(scope.row)" v-if="scope.row.status==0" v-auth="'edit'">修改</el-button>
+            <el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-if="scope.row.status==0" v-auth="'del'">删除</el-button>
+            <el-button size="small" text type="primary" @click="copy(scope.row)" v-auth="'copy'">复制</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="typeList" />
+    </el-card>
+    <EditDic ref="editDicRef" @typeList="typeList" />
+    <ListDic ref="listDicRef" />
+  </div>
 </template>
 
 <script lang="ts">
@@ -117,171 +91,171 @@ import api from '/@/api/datahub';
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
-	sourceId: number;
-	name: string;
-	key: string;
-	status: number;
-	from: string;
-	createBy: string;
+  sourceId: number;
+  name: string;
+  key: string;
+  status: number;
+  from: string;
+  createBy: string;
 }
 interface TableDataState {
-	ids: number[];
-	tableData: {
-		data: Array<TableDataRow>;
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-			name: string;
-			key: string;
-			from: string;
-		};
-	};
+  ids: number[];
+  tableData: {
+    data: Array<TableDataRow>;
+    total: number;
+    loading: boolean;
+    param: {
+      pageNum: number;
+      pageSize: number;
+      name: string;
+      key: string;
+      from: string;
+    };
+  };
 }
 
 export default defineComponent({
-	name: 'sourcelist',
-	components: { EditDic,ListDic },
-	setup() {
-		const addDicRef = ref();
-		const editDicRef = ref();
-		const listDicRef=ref();
-		const queryRef = ref();
-		const state = reactive<TableDataState>({
-			typeData: [
-				{
-					label: '全部',
-					value: '-1',
-				},
-				{
-					label: 'api导入',
-					value: '1',
-				},
-				{
-					label: '数据库',
-					value: '2',
-				},
-				{
-					label: '文件',
-					value: '3',
-				},
-				{
-					label: '设备',
-					value: '4',
-				},
-			],
-			ids: [],
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					pageNum: 1,
-					pageSize: 10,
-					name: '',
-					types: '',
-					status: '',
-				},
-			},
-		});
-		// 初始化表格数据
-		const initTableData = () => {
-			typeList();
-		};
-		const typeList = () => {
-			state.tableData.loading = true;
-			api.common.getList(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.list;
-				state.tableData.total = res.Total;
-			}).finally(() => (state.tableData.loading = false));
-		};
+  name: 'sourcelist',
+  components: { EditDic, ListDic },
+  setup() {
+    const addDicRef = ref();
+    const editDicRef = ref();
+    const listDicRef = ref();
+    const queryRef = ref();
+    const state = reactive<TableDataState>({
+      typeData: [
+        {
+          label: '全部',
+          value: '-1',
+        },
+        {
+          label: 'api导入',
+          value: '1',
+        },
+        {
+          label: '数据库',
+          value: '2',
+        },
+        {
+          label: '文件',
+          value: '3',
+        },
+        {
+          label: '设备',
+          value: '4',
+        },
+      ],
+      ids: [],
+      tableData: {
+        data: [],
+        total: 0,
+        loading: false,
+        param: {
+          pageNum: 1,
+          pageSize: 10,
+          name: '',
+          types: '',
+          status: '',
+        },
+      },
+    });
+    // 初始化表格数据
+    const initTableData = () => {
+      typeList();
+    };
+    const typeList = () => {
+      state.tableData.loading = true;
+      api.common.getList(state.tableData.param).then((res: any) => {
+        state.tableData.data = res.list;
+        state.tableData.total = res.Total;
+      }).finally(() => (state.tableData.loading = false));
+    };
 
-		//复制数据
-		const copy=(row:TableDataRow)=>{
-			ElMessageBox.confirm("确定要复制该数据吗?", '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
+    //复制数据
+    const copy = (row: TableDataRow) => {
+      ElMessageBox.confirm("确定要复制该数据吗?", '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
 
-					api.common.copy({sourceId:row.sourceId}).then(() => {
-						ElMessage.success('复制成功');
-						typeList();
-					});
-				})
-				.catch(() => {});
-		}
+          api.common.copy({ sourceId: row.sourceId }).then(() => {
+            ElMessage.success('复制成功');
+            typeList();
+          });
+        })
+        .catch(() => { });
+    }
 
-		//打开数据记录
-		const onOpenList=(row: TableDataRow)=>{
-			listDicRef.value.openDialog(row);
-		}
-		// 打开新增数据源弹窗
-		const onOpenAdd = () => {
-			editDicRef.value.openDialog();
-		};
-		// 打开修改数据源弹窗
-		const onOpenEdit = (row: TableDataRow) => {
-			editDicRef.value.openDialog(row);
-		};
-		const onRowDel = (row: TableDataRow) => {
-			let msg = '你确定要删除所选数据?';
-			let ids: number[] = [];
-			if (row) {
-				msg = `此操作将永久删除数据源:“${row.name}”,是否继续?`;
-				ids = [row.sourceId];
-			} else {
-				ids = state.ids;
-			}
-			if (ids.length === 0) {
-				ElMessage.error('请选择要删除的数据。');
-				return;
-			}
-			ElMessageBox.confirm(msg, '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
-					api.common.delete(ids).then(() => {
-						ElMessage.success('删除成功');
-						typeList();
-					});
-				})
-				.catch(() => {});
-		};
-		// 页面加载时
-		onMounted(() => {
-			initTableData();
-		});
-		/** 重置按钮操作 */
-		const resetQuery = (formEl: FormInstance | undefined) => {
-			if (!formEl) return;
-			formEl.resetFields();
-			typeList();
-		};
-		// 多选框选中数据
-		const handleSelectionChange = (selection: TableDataRow[]) => {
-			state.ids = selection.map((item) => item.sourceId);
-		};
+    //打开数据记录
+    const onOpenList = (row: TableDataRow) => {
+      listDicRef.value.openDialog(row);
+    }
+    // 打开新增数据源弹窗
+    const onOpenAdd = () => {
+      editDicRef.value.openDialog();
+    };
+    // 打开修改数据源弹窗
+    const onOpenEdit = (row: TableDataRow) => {
+      editDicRef.value.openDialog(row);
+    };
+    const onRowDel = (row?: TableDataRow) => {
+      let msg = '你确定要删除所选数据?';
+      let ids: number[] = [];
+      if (row) {
+        msg = `此操作将永久删除数据源:“${row.name}”,是否继续?`;
+        ids = [row.sourceId];
+      } else {
+        ids = state.ids;
+      }
+      if (ids.length === 0) {
+        ElMessage.error('请选择要删除的数据。');
+        return;
+      }
+      ElMessageBox.confirm(msg, '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          api.common.delete(ids).then(() => {
+            ElMessage.success('删除成功');
+            typeList();
+          });
+        })
+        .catch(() => { });
+    };
+    // 页面加载时
+    onMounted(() => {
+      initTableData();
+    });
+    /** 重置按钮操作 */
+    const resetQuery = (formEl: FormInstance | undefined) => {
+      if (!formEl) return;
+      formEl.resetFields();
+      typeList();
+    };
+    // 多选框选中数据
+    const handleSelectionChange = (selection: TableDataRow[]) => {
+      state.ids = selection.map((item) => item.sourceId);
+    };
 
-		return {
-			addDicRef,
-			editDicRef,
-			listDicRef,
-			queryRef,
-			copy,
-			onOpenList,
-			onOpenAdd,
-			onOpenEdit,
-			onRowDel,
-			typeList,
-			resetQuery,
-			handleSelectionChange,
-			...toRefs(state),
-		};
-	},
+    return {
+      addDicRef,
+      editDicRef,
+      listDicRef,
+      queryRef,
+      copy,
+      onOpenList,
+      onOpenAdd,
+      onOpenEdit,
+      onRowDel,
+      typeList,
+      resetQuery,
+      handleSelectionChange,
+      ...toRefs(state),
+    };
+  },
 });
 </script>

+ 128 - 128
src/views/system/dict/dataList.vue

@@ -23,13 +23,13 @@
               </el-icon>
               查询
             </el-button>
-            <el-button size="default" type="success" class="ml10" @click="onOpenAddDic">
+            <el-button size="default" type="success" class="ml10" @click="onOpenAddDic" v-auth="'add'">
               <el-icon>
                 <ele-FolderAdd />
               </el-icon>
               新增字典
             </el-button>
-            <el-button size="default" type="danger" class="ml10" @click="onRowDel(null)">
+            <el-button size="default" type="danger" class="ml10" @click="onRowDel()" v-auth="'del'">
               <el-icon>
                 <ele-Delete />
               </el-icon>
@@ -40,22 +40,22 @@
       </div>
       <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="字典编码" width="90"  align="center" prop="dictCode" />
-        <el-table-column label="字典标签" align="center" prop="dictLabel" />
-        <el-table-column label="字典键值" align="center" prop="dictValue" />
-        <el-table-column label="字典排序" width="100" align="center" prop="dictSort" />
-        <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
+        <el-table-column label="字典编码" v-col="'dictCode'" width="90" align="center" prop="dictCode" />
+        <el-table-column label="字典标签" v-col="'dictLabel'" align="center" prop="dictLabel" />
+        <el-table-column label="字典键值" v-col="'dictValue'" align="center" prop="dictValue" />
+        <el-table-column label="字典排序" v-col="'dictSort'" width="100" align="center" prop="dictSort" />
+        <el-table-column label="备注" v-col="'remark'" align="center" prop="remark" :show-overflow-tooltip="true" />
         <!-- <el-table-column label="创建时间" align="center" prop="createdAt" width="180" /> -->
-        <el-table-column prop="status" label="字典状态" width="120" align="center">
+        <el-table-column prop="status" label="字典状态" v-col="'status'" width="120" align="center">
           <template #default="scope">
             <el-tag type="success" size="small" v-if="scope.row.status">启用</el-tag>
             <el-tag type="info" size="small" v-else>禁用</el-tag>
           </template>
         </el-table-column>
-        <el-table-column label="操作" width="100" align="center">
+        <el-table-column label="操作" width="100" align="center" v-col="'handle'">
           <template #default="scope">
-            <el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)">修改</el-button>
-            <el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
+            <el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)" v-auth="'edit'">修改</el-button>
+            <el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-auth="'del'">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -74,127 +74,127 @@ import { useRoute } from 'vue-router';
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
-	dictCode: number;
-	dictSort: number;
-	dictLabel: string;
-	dictValue: string;
-	dictType: string;
-	status: number;
-	remark: string;
-	createdAt: string;
+  dictCode: number;
+  dictSort: number;
+  dictLabel: string;
+  dictValue: string;
+  dictType: string;
+  status: number;
+  remark: string;
+  createdAt: string;
 }
 interface TableDataState {
-	ids: number[];
-	tableData: {
-		data: Array<TableDataRow>;
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-			dictType: string;
-			dictLabel: string;
-			status: number;
-		};
-	};
+  ids: number[];
+  tableData: {
+    data: Array<TableDataRow>;
+    total: number;
+    loading: boolean;
+    param: {
+      pageNum: number;
+      pageSize: number;
+      dictType: string;
+      dictLabel: string;
+      status: number;
+    };
+  };
 }
 
 export default defineComponent({
-	name: 'apiV1SystemDictDataList',
-	components: { EditDic },
-	setup() {
-		const route = useRoute();
-		const addDicRef = ref();
-		const editDicRef = ref();
-		const queryRef = ref();
-		const state = reactive<TableDataState>({
-			ids: [],
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					pageNum: 1,
-					pageSize: 10,
-					dictLabel: '',
-					dictType: '',
-					status: -1,
-				},
-			},
-		});
-		// 初始化表格数据
-		const initTableData = () => {
-			dataList();
-		};
-		const dataList = () => {
-			api.dict.getDataList(state.tableData.param).then((res: any) => {
-				state.tableData.data = res.list;
-				state.tableData.total = res.total;
-			});
-		};
-		// 打开新增字典弹窗
-		const onOpenAddDic = () => {
-			editDicRef.value.openDialog();
-		};
-		// 打开修改字典弹窗
-		const onOpenEditDic = (row: TableDataRow) => {
-			editDicRef.value.openDialog(row);
-		};
-		// 删除字典
-		const onRowDel = (row: TableDataRow) => {
-			let msg = '你确定要删除所选数据?';
-			let ids: number[] = [];
-			if (row) {
-				msg = `此操作将永久删除用户:“${row.dictLabel}”,是否继续?`;
-				ids = [row.dictCode];
-			} else {
-				ids = state.ids;
-			}
-			if (ids.length === 0) {
-				ElMessage.error('请选择要删除的数据。');
-				return;
-			}
-			ElMessageBox.confirm(msg, '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
-					api.dict.deleteData(ids).then(() => {
-						ElMessage.success('删除成功');
-						dataList();
-					});
-				})
-				.catch(() => {});
-		};
-		// 页面加载时
-		onMounted(() => {
-			const dictType = route.params && route.params.dictType;
-			state.tableData.param.dictType = <string>dictType;
-			initTableData();
-		});
-		/** 重置按钮操作 */
-		const resetQuery = (formEl: FormInstance | undefined) => {
-			if (!formEl) return;
-			formEl.resetFields();
-			dataList();
-		};
-		// 多选框选中数据
-		const handleSelectionChange = (selection: TableDataRow[]) => {
-			state.ids = selection.map((item) => item.dictCode);
-		};
-		return {
-			addDicRef,
-			editDicRef,
-			queryRef,
-			onOpenAddDic,
-			onOpenEditDic,
-			onRowDel,
-			dataList,
-			resetQuery,
-			handleSelectionChange,
-			...toRefs(state),
-		};
-	},
+  name: 'apiV1SystemDictDataList',
+  components: { EditDic },
+  setup() {
+    const route = useRoute();
+    const addDicRef = ref();
+    const editDicRef = ref();
+    const queryRef = ref();
+    const state = reactive<TableDataState>({
+      ids: [],
+      tableData: {
+        data: [],
+        total: 0,
+        loading: false,
+        param: {
+          pageNum: 1,
+          pageSize: 10,
+          dictLabel: '',
+          dictType: '',
+          status: -1,
+        },
+      },
+    });
+    // 初始化表格数据
+    const initTableData = () => {
+      dataList();
+    };
+    const dataList = () => {
+      api.dict.getDataList(state.tableData.param).then((res: any) => {
+        state.tableData.data = res.list;
+        state.tableData.total = res.total;
+      });
+    };
+    // 打开新增字典弹窗
+    const onOpenAddDic = () => {
+      editDicRef.value.openDialog();
+    };
+    // 打开修改字典弹窗
+    const onOpenEditDic = (row: TableDataRow) => {
+      editDicRef.value.openDialog(row);
+    };
+    // 删除字典
+    const onRowDel = (row?: TableDataRow) => {
+      let msg = '你确定要删除所选数据?';
+      let ids: number[] = [];
+      if (row) {
+        msg = `此操作将永久删除用户:“${row.dictLabel}”,是否继续?`;
+        ids = [row.dictCode];
+      } else {
+        ids = state.ids;
+      }
+      if (ids.length === 0) {
+        ElMessage.error('请选择要删除的数据。');
+        return;
+      }
+      ElMessageBox.confirm(msg, '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          api.dict.deleteData(ids).then(() => {
+            ElMessage.success('删除成功');
+            dataList();
+          });
+        })
+        .catch(() => { });
+    };
+    // 页面加载时
+    onMounted(() => {
+      const dictType = route.params && route.params.dictType;
+      state.tableData.param.dictType = <string>dictType;
+      initTableData();
+    });
+    /** 重置按钮操作 */
+    const resetQuery = (formEl: FormInstance | undefined) => {
+      if (!formEl) return;
+      formEl.resetFields();
+      dataList();
+    };
+    // 多选框选中数据
+    const handleSelectionChange = (selection: TableDataRow[]) => {
+      state.ids = selection.map((item) => item.dictCode);
+    };
+    return {
+      addDicRef,
+      editDicRef,
+      queryRef,
+      onOpenAddDic,
+      onOpenEditDic,
+      onRowDel,
+      dataList,
+      resetQuery,
+      handleSelectionChange,
+      ...toRefs(state),
+    };
+  },
 });
 </script>

+ 195 - 224
src/views/system/dict/index.vue

@@ -1,110 +1,81 @@
 <template>
-	<div class="system-dic-container">
-		<el-card shadow="hover">
-			<div class="system-user-search mb15">
-				<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
-					<el-form-item label="字典名称" prop="dictName">
-						<el-input
-							v-model="tableData.param.dictName"
-							placeholder="请输入字典名称"
-							clearable
-							size="default"
-							style="width: 240px"
-							@keyup.enter.native="typeList"
-						/>
-					</el-form-item>
-					<el-form-item label="字典类型" prop="dictType">
-						<el-input
-							v-model="tableData.param.dictType"
-							placeholder="请输入字典类型"
-							clearable
-							size="default"
-							style="width: 240px"
-							@keyup.enter.native="typeList"
-						/>
-					</el-form-item>
-					<el-form-item label="状态" prop="status" style="width: 200px">
-						<el-select v-model="tableData.param.status" placeholder="字典状态" clearable size="default" style="width: 240px">
-							<el-option label="启用" :value="1" />
-							<el-option label="禁用" :value="0" />
-						</el-select>
-					</el-form-item>
-					<el-form-item label="创建时间" prop="dateRange">
-						<el-date-picker
-							v-model="tableData.param.dateRange"
-							size="default"
-							style="width: 240px"
-							value-format="YYYY-MM-DD"
-							type="daterange"
-							range-separator="-"
-							start-placeholder="开始日期"
-							end-placeholder="结束日期"
-						></el-date-picker>
-					</el-form-item>
-					<el-form-item>
-						<el-button size="default" type="primary" class="ml10" @click="typeList">
-							<el-icon>
-								<ele-Search />
-							</el-icon>
-							查询
-						</el-button>
-						<el-button size="default" @click="resetQuery(queryRef)">
-							<el-icon>
-								<ele-Refresh />
-							</el-icon>
-							重置
-						</el-button>
-						<el-button size="default" type="success" class="ml10" @click="onOpenAddDic">
-							<el-icon>
-								<ele-FolderAdd />
-							</el-icon>
-							新增字典
-						</el-button>
-						<el-button size="default" type="danger" class="ml10" @click="onRowDel(null)">
-							<el-icon>
-								<ele-Delete />
-							</el-icon>
-							删除字典
-						</el-button>
-					</el-form-item>
-				</el-form>
-			</div>
-			<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
-				<el-table-column type="selection" width="55" align="center" />
-				<el-table-column label="字典ID" align="center" prop="dictId" width="80" />
-				<el-table-column label="字典名称" prop="dictName" :show-overflow-tooltip="true" />
-				<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
-					<template #default="scope">
-						<router-link :to="'/system/dict/data/list/' + scope.row.dictType" class="link-type">
-							<span>{{ scope.row.dictType }}</span>
-						</router-link>
-					</template>
-				</el-table-column>
-				<el-table-column prop="status" label="字典状态" width="120" align="center">
-					<template #default="scope">
-						<el-tag type="success" size="small" v-if="scope.row.status">启用</el-tag>
-						<el-tag type="info" size="small" v-else>禁用</el-tag>
-					</template>
-				</el-table-column>
-				<el-table-column prop="remark" label="字典描述" show-overflow-tooltip></el-table-column>
-				<!-- <el-table-column prop="createdAt" label="创建时间" align="center" width="180"></el-table-column> -->
-				<el-table-column label="操作" width="100" align="center">
-					<template #default="scope">
-						<el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)">修改</el-button>
-						<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
-					</template>
-				</el-table-column>
-			</el-table>
-			<pagination
-				v-show="tableData.total > 0"
-				:total="tableData.total"
-				v-model:page="tableData.param.pageNum"
-				v-model:limit="tableData.param.pageSize"
-				@pagination="typeList"
-			/>
-		</el-card>
-		<EditDic ref="editDicRef" @typeList="typeList" />
-	</div>
+  <div class="system-dic-container">
+    <el-card shadow="hover">
+      <div class="system-user-search mb15">
+        <el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
+          <el-form-item label="字典名称" prop="dictName">
+            <el-input v-model="tableData.param.dictName" placeholder="请输入字典名称" clearable size="default" style="width: 240px" @keyup.enter.native="typeList" />
+          </el-form-item>
+          <el-form-item label="字典类型" prop="dictType">
+            <el-input v-model="tableData.param.dictType" placeholder="请输入字典类型" clearable size="default" style="width: 240px" @keyup.enter.native="typeList" />
+          </el-form-item>
+          <el-form-item label="状态" prop="status" style="width: 200px">
+            <el-select v-model="tableData.param.status" placeholder="字典状态" clearable size="default" style="width: 240px">
+              <el-option label="启用" :value="1" />
+              <el-option label="禁用" :value="0" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="创建时间" prop="dateRange">
+            <el-date-picker v-model="tableData.param.dateRange" size="default" style="width: 240px" value-format="YYYY-MM-DD" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+          </el-form-item>
+          <el-form-item>
+            <el-button size="default" type="primary" class="ml10" @click="typeList">
+              <el-icon>
+                <ele-Search />
+              </el-icon>
+              查询
+            </el-button>
+            <el-button size="default" @click="resetQuery(queryRef)">
+              <el-icon>
+                <ele-Refresh />
+              </el-icon>
+              重置
+            </el-button>
+            <el-button size="default" type="success" class="ml10" @click="onOpenAddDic" v-auth="'add'">
+              <el-icon>
+                <ele-FolderAdd />
+              </el-icon>
+              新增字典
+            </el-button>
+            <el-button size="default" type="danger" class="ml10" @click="onRowDel()" v-auth="'del'">
+              <el-icon>
+                <ele-Delete />
+              </el-icon>
+              删除字典
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="字典ID" v-col="'dictId'" align="center" prop="dictId" width="80" />
+        <el-table-column label="字典名称" v-col="'dictName'" prop="dictName" :show-overflow-tooltip="true" />
+        <el-table-column label="字典类型" v-col="'dictType'" align="center" :show-overflow-tooltip="true">
+          <template #default="scope">
+            <router-link :to="'/system/dict/data/list/' + scope.row.dictType" class="link-type">
+              <span>{{ scope.row.dictType }}</span>
+            </router-link>
+          </template>
+        </el-table-column>
+        <el-table-column prop="status" label="字典状态" v-col="'status'" width="120" align="center">
+          <template #default="scope">
+            <el-tag type="success" size="small" v-if="scope.row.status">启用</el-tag>
+            <el-tag type="info" size="small" v-else>禁用</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column prop="remark" v-col="'remark'" label="字典描述" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column prop="createdAt" label="创建时间" align="center" width="180"></el-table-column> -->
+        <el-table-column label="操作" width="100" align="center" v-col="'handle'">
+          <template #default="scope">
+            <el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)" v-auth="'edit'">修改</el-button>
+            <el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-auth="'del'">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="typeList" />
+    </el-card>
+    <EditDic ref="editDicRef" @typeList="typeList" />
+  </div>
 </template>
 
 <script lang="ts">
@@ -115,128 +86,128 @@ import api from '/@/api/system';
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
-	dictId: number;
-	dictName: string;
-	dictType: string;
-	status: number;
-	remark: string;
-	createdAt: string;
+  dictId: number;
+  dictName: string;
+  dictType: string;
+  status: number;
+  remark: string;
+  createdAt: string;
 }
 interface TableDataState {
-	ids: number[];
-	tableData: {
-		data: Array<TableDataRow>;
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-			dictName: string;
-			dictType: string;
-			status: string;
-			dateRange: string[];
-		};
-	};
+  ids: number[];
+  tableData: {
+    data: Array<TableDataRow>;
+    total: number;
+    loading: boolean;
+    param: {
+      pageNum: number;
+      pageSize: number;
+      dictName: string;
+      dictType: string;
+      status: string;
+      dateRange: string[];
+    };
+  };
 }
 
 export default defineComponent({
-	name: 'systemDic',
-	components: { EditDic },
-	setup() {
-		const addDicRef = ref();
-		const editDicRef = ref();
-		const queryRef = ref();
-		const state = reactive<TableDataState>({
-			ids: [],
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					pageNum: 1,
-					pageSize: 10,
-					dictName: '',
-					dictType: '',
-					status: '',
-					dateRange: [],
-				},
-			},
-		});
-		// 初始化表格数据
-		const initTableData = () => {
-			typeList();
-		};
-		const typeList = () => {
-			state.tableData.loading = true;
-			api.dict
-				.getTypeList(state.tableData.param)
-				.then((res: any) => {
-					state.tableData.data = res.dictTypeList;
-					state.tableData.total = res.total;
-				})
-				.finally(() => (state.tableData.loading = false));
-		};
-		// 打开新增字典弹窗
-		const onOpenAddDic = () => {
-			editDicRef.value.openDialog();
-		};
-		// 打开修改字典弹窗
-		const onOpenEditDic = (row: TableDataRow) => {
-			editDicRef.value.openDialog(row);
-		};
-		// 删除字典
-		const onRowDel = (row: TableDataRow) => {
-			let msg = '你确定要删除所选数据?';
-			let ids: number[] = [];
-			if (row) {
-				msg = `此操作将永久删除用户:“${row.dictName}”,是否继续?`;
-				ids = [row.dictId];
-			} else {
-				ids = state.ids;
-			}
-			if (ids.length === 0) {
-				ElMessage.error('请选择要删除的数据。');
-				return;
-			}
-			ElMessageBox.confirm(msg, '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
-					api.dict.deleteType(ids).then(() => {
-						ElMessage.success('删除成功');
-						typeList();
-					});
-				})
-				.catch(() => {});
-		};
-		// 页面加载时
-		onMounted(() => {
-			initTableData();
-		});
-		/** 重置按钮操作 */
-		const resetQuery = (formEl: FormInstance | undefined) => {
-			if (!formEl) return;
-			formEl.resetFields();
-			typeList();
-		};
-		// 多选框选中数据
-		const handleSelectionChange = (selection: TableDataRow[]) => {
-			state.ids = selection.map((item) => item.dictId);
-		};
-		return {
-			addDicRef,
-			editDicRef,
-			queryRef,
-			onOpenAddDic,
-			onOpenEditDic,
-			onRowDel,
-			typeList,
-			resetQuery,
-			handleSelectionChange,
-			...toRefs(state),
-		};
-	},
+  name: 'systemDic',
+  components: { EditDic },
+  setup() {
+    const addDicRef = ref();
+    const editDicRef = ref();
+    const queryRef = ref();
+    const state = reactive<TableDataState>({
+      ids: [],
+      tableData: {
+        data: [],
+        total: 0,
+        loading: false,
+        param: {
+          pageNum: 1,
+          pageSize: 10,
+          dictName: '',
+          dictType: '',
+          status: '',
+          dateRange: [],
+        },
+      },
+    });
+    // 初始化表格数据
+    const initTableData = () => {
+      typeList();
+    };
+    const typeList = () => {
+      state.tableData.loading = true;
+      api.dict
+        .getTypeList(state.tableData.param)
+        .then((res: any) => {
+          state.tableData.data = res.dictTypeList;
+          state.tableData.total = res.total;
+        })
+        .finally(() => (state.tableData.loading = false));
+    };
+    // 打开新增字典弹窗
+    const onOpenAddDic = () => {
+      editDicRef.value.openDialog();
+    };
+    // 打开修改字典弹窗
+    const onOpenEditDic = (row: TableDataRow) => {
+      editDicRef.value.openDialog(row);
+    };
+    // 删除字典
+    const onRowDel = (row?: TableDataRow) => {
+      let msg = '你确定要删除所选数据?';
+      let ids: number[] = [];
+      if (row) {
+        msg = `此操作将永久删除用户:“${row.dictName}”,是否继续?`;
+        ids = [row.dictId];
+      } else {
+        ids = state.ids;
+      }
+      if (ids.length === 0) {
+        ElMessage.error('请选择要删除的数据。');
+        return;
+      }
+      ElMessageBox.confirm(msg, '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          api.dict.deleteType(ids).then(() => {
+            ElMessage.success('删除成功');
+            typeList();
+          });
+        })
+        .catch(() => { });
+    };
+    // 页面加载时
+    onMounted(() => {
+      initTableData();
+    });
+    /** 重置按钮操作 */
+    const resetQuery = (formEl: FormInstance | undefined) => {
+      if (!formEl) return;
+      formEl.resetFields();
+      typeList();
+    };
+    // 多选框选中数据
+    const handleSelectionChange = (selection: TableDataRow[]) => {
+      state.ids = selection.map((item) => item.dictId);
+    };
+    return {
+      addDicRef,
+      editDicRef,
+      queryRef,
+      onOpenAddDic,
+      onOpenEditDic,
+      onRowDel,
+      typeList,
+      resetQuery,
+      handleSelectionChange,
+      ...toRefs(state),
+    };
+  },
 });
 </script>

+ 94 - 93
src/views/system/menu/component/btn.vue

@@ -1,52 +1,53 @@
 <template>
-	<el-drawer v-model="drawer" :title="title" direction="rtl" size="700px">
-		<div class="p-3">
-			<el-button size="default" type="success" class="mr-3" @click="onAddRow">
-				<el-icon>
-					<ele-FolderAdd />
-				</el-icon>
-				新增按钮
-			</el-button>
+  <el-drawer v-model="drawer" :title="title" direction="rtl" size="700px">
+    <div class="p-3">
+      <el-button size="default" type="success" class="mr-3" @click="onAddRow">
+        <el-icon>
+          <ele-FolderAdd />
+        </el-icon>
+        新增按钮
+      </el-button>
 
-			<el-dropdown @command="addCommonType">
-				<el-button text type="primary">
-					<el-icon>
-						<ele-Plus />
-					</el-icon>常用按钮权限
-				</el-button>
-				<template #dropdown>
-					<el-dropdown-menu>
-						<el-dropdown-item command="add-新增">新增</el-dropdown-item>
-						<el-dropdown-item command="edit-编辑">编辑</el-dropdown-item>
-						<el-dropdown-item command="detail-详情">详情</el-dropdown-item>
-						<el-dropdown-item command="del-删除">删除</el-dropdown-item>
-						<el-dropdown-item command="upload-导入">导入</el-dropdown-item>
-						<el-dropdown-item command="dwonload-导出">导出</el-dropdown-item>
-						<el-dropdown-item command="reset-重置">重置</el-dropdown-item>
-					</el-dropdown-menu>
-				</template>
-			</el-dropdown>
-		</div>
+      <el-dropdown @command="addCommonType">
+        <el-button text type="primary">
+          <el-icon>
+            <ele-Plus />
+          </el-icon>常用按钮权限
+        </el-button>
+        <template #dropdown>
+          <el-dropdown-menu>
+            <el-dropdown-item command="add-新增">新增</el-dropdown-item>
+            <el-dropdown-item command="edit-编辑">编辑</el-dropdown-item>
+            <el-dropdown-item command="detail-详情">详情</el-dropdown-item>
+            <el-dropdown-item command="del-删除">删除</el-dropdown-item>
+            <el-dropdown-item command="upload-导入">导入</el-dropdown-item>
+            <el-dropdown-item command="dwonload-导出">导出</el-dropdown-item>
+            <el-dropdown-item command="reset-重置">重置</el-dropdown-item>
+            <el-dropdown-item command="more-更多">更多</el-dropdown-item>
+          </el-dropdown-menu>
+        </template>
+      </el-dropdown>
+    </div>
 
-		<el-table :data="tableData" style="width: 100%" row-key="id" border :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
-			<el-table-column type="index" label="序号" width="60" align="center" />
-			<el-table-column prop="name" label="按钮名称" width="220" show-overflow-tooltip></el-table-column>
-			<el-table-column prop="types" label="按钮编码" show-overflow-tooltip></el-table-column>
-			<el-table-column prop="status" label="状态" width="100" align="center">
-				<template #default="scope">
-					<el-switch v-model="scope.row.status" inline-prompt :active-value="1" :inactive-value="0" active-text="启" inactive-text="禁" @change="handleStatusChange(scope.row)">
-					</el-switch>
-				</template>
-			</el-table-column>
-			<el-table-column label="操作" width="100" align="center">
-				<template #default="scope">
-					<el-button size="small" text type="warning" @click="onEdit(scope.row)">修改</el-button>
-					<el-button size="small" text type="danger" @click="onDel(scope.row)">删除</el-button>
-				</template>
-			</el-table-column>
-		</el-table>
-	</el-drawer>
-	<btnForm ref="btnFormRef" :parent-data="tableData" @getList="getList"></btnForm>
+    <el-table :data="tableData" style="width: 100%" row-key="id" border :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
+      <el-table-column type="index" label="序号" width="60" align="center" />
+      <el-table-column prop="name" label="按钮名称" width="220" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="types" label="按钮编码" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="status" label="状态" width="100" align="center">
+        <template #default="scope">
+          <el-switch v-model="scope.row.status" inline-prompt :active-value="1" :inactive-value="0" active-text="启" inactive-text="禁" @change="handleStatusChange(scope.row)">
+          </el-switch>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" width="100" align="center">
+        <template #default="scope">
+          <el-button size="small" text type="warning" @click="onEdit(scope.row)">修改</el-button>
+          <el-button size="small" text type="danger" @click="onDel(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+  </el-drawer>
+  <btnForm ref="btnFormRef" :parent-data="tableData" @getList="getList"></btnForm>
 </template>
 
 <script lang="ts" setup>
@@ -63,73 +64,73 @@ const tableData = ref<MenuBtnRow[]>([]);
 const menuRow = ref();
 const btnFormRef = ref();
 const getList = async () => {
-	tableData.value = [];
-	let res = await api.menu.btn.getList({ menuId: menuRow.value.id as number, status: -1 });
-	tableData.value = res || [];
+  tableData.value = [];
+  let res = await api.menu.btn.getList({ menuId: menuRow.value.id as number, status: -1 });
+  tableData.value = res || [];
 };
 
 const open = async (row: any) => {
-	// console.log(row);
-	title.value = '按钮权限 - ' + row.title;
-	drawer.value = true;
-	menuRow.value = row;
-	getList();
+  // console.log(row);
+  title.value = '按钮权限 - ' + row.title;
+  drawer.value = true;
+  menuRow.value = row;
+  getList();
 };
 
 const onAddRow = () => {
-	btnFormRef.value.open({ menuId: menuRow.value.id });
+  btnFormRef.value.open({ menuId: menuRow.value.id });
 };
 
 const onEdit = (row: MenuBtnRow) => {
-	btnFormRef.value.open(row);
+  btnFormRef.value.open(row);
 };
 
 // 添加常用类型
 const addCommonType = async (command: string) => {
-	const [types, name] = command.split('-');
-	const formData: MenuBtnRow = {
-		parentId: -1,
-		menuId: menuRow.value.id as number,
-		name,
-		types,
-		description: '',
-		status: 1,
-	};
-	await api.menu.btn.add(formData);
-	ElMessage.success('操作成功');
-	getList();
-	getBackEndControlRoutes();
+  const [types, name] = command.split('-');
+  const formData: MenuBtnRow = {
+    parentId: -1,
+    menuId: menuRow.value.id as number,
+    name,
+    types,
+    description: '',
+    status: 1,
+  };
+  await api.menu.btn.add(formData);
+  ElMessage.success('操作成功');
+  getList();
+  getBackEndControlRoutes();
 };
 
 // 修改启用停用状态
 const handleStatusChange = (row: MenuBtnRow) => {
-	let text = row.status === 1 ? '启用' : '停用';
-	ElMessageBox.confirm('确认要"' + text + '":"' + row.name + '"按钮吗?', '警告', {
-		confirmButtonText: '确定',
-		cancelButtonText: '取消',
-		type: 'warning',
-	})
-		.then(async function () {
-			await api.menu.btn.setStatus(row.id as number, row.menuId as number, row.status);
-			ElMessage.success('操作成功');
-			getBackEndControlRoutes();
-		})
-		.catch(function () {
-			row.status = row.status === 0 ? 1 : 0;
-		});
+  let text = row.status === 1 ? '启用' : '停用';
+  ElMessageBox.confirm('确认要"' + text + '":"' + row.name + '"按钮吗?', '警告', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning',
+  })
+    .then(async function () {
+      await api.menu.btn.setStatus(row.id as number, row.menuId as number, row.status);
+      ElMessage.success('操作成功');
+      getBackEndControlRoutes();
+    })
+    .catch(function () {
+      row.status = row.status === 0 ? 1 : 0;
+    });
 };
 
 const onDel = (row: MenuBtnRow) => {
-	ElMessageBox.confirm(`此操作将删除按钮:“${row.name}”,是否继续?`, '提示', {
-		confirmButtonText: '确认',
-		cancelButtonText: '取消',
-		type: 'warning',
-	}).then(async () => {
-		await api.menu.btn.del(row.id as number);
-		ElMessage.success('删除成功');
-		getList();
-		getBackEndControlRoutes();
-	});
+  ElMessageBox.confirm(`此操作将删除按钮:“${row.name}”,是否继续?`, '提示', {
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    type: 'warning',
+  }).then(async () => {
+    await api.menu.btn.del(row.id as number);
+    ElMessage.success('删除成功');
+    getList();
+    getBackEndControlRoutes();
+  });
 };
 
 defineExpose({ open });

+ 111 - 119
src/views/system/menu/index.vue

@@ -1,87 +1,79 @@
 <template>
-	<div class="system-user-container">
-		<el-card shadow="hover">
-			<div class="system-menu-search">
-				<el-form inline>
-					<el-form-item label="菜单名称">
-						<el-input v-model="state.queryParams.title" placeholder="请输入菜单名称" size="default" clearable class="w-50" />
-					</el-form-item>
-					<!-- <el-form-item label="组件路径">
+  <div class="system-user-container">
+    <el-card shadow="hover">
+      <div class="system-menu-search">
+        <el-form inline>
+          <el-form-item label="菜单名称">
+            <el-input v-model="state.queryParams.title" placeholder="请输入菜单名称" size="default" clearable class="w-50" />
+          </el-form-item>
+          <!-- <el-form-item label="组件路径">
             <el-input v-model="queryParams.component" placeholder="请输入组件路径" clearable  class="w-50" />
           </el-form-item> -->
-					<el-form-item>
-						<el-button type="primary" class="ml10" @click="handleQuery">
-							<el-icon>
-								<ele-Search />
-							</el-icon>
-							查询
-						</el-button>
-						<el-button type="success" class="ml10" @click="onOpenAddMenu(null)">
-							<el-icon>
-								<ele-FolderAdd />
-							</el-icon>
-							新增菜单
-						</el-button>
-					</el-form-item>
-				</el-form>
-			</div>
-			<el-table
-				:data="state.menuTableData"
-				default-expand-all
-				style="width: 100%"
-				row-key="path"
-				:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-        v-loading="state.loading"
-			>
-				<el-table-column label="菜单名称" show-overflow-tooltip>
-					<template #default="scope">
-						<SvgIcon :name="scope.row.icon" />
-						<span class="ml10">{{ scope.row.title }}</span>
-					</template>
-				</el-table-column>
-				<el-table-column prop="path" label="路由路径" show-overflow-tooltip></el-table-column>
-				<el-table-column label="组件路径" prop="component" show-overflow-tooltip></el-table-column>
-				<el-table-column label="排序" prop="weigh" width="80" align="center"></el-table-column>
-				<el-table-column label="类型" width="80" align="center">
-					<template #default="scope">
-						<el-tag :type="scope.row.menuType === 0 ? 'danger' : scope.row.menuType === 1 ? 'success' : 'warning'" size="small">{{
+          <el-form-item>
+            <el-button type="primary" class="ml10" @click="handleQuery">
+              <el-icon>
+                <ele-Search />
+              </el-icon>
+              查询
+            </el-button>
+            <el-button type="success" class="ml10" @click="onOpenAddMenu(null)" v-auth="'add'">
+              <el-icon>
+                <ele-FolderAdd />
+              </el-icon>
+              新增菜单
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="state.menuTableData" default-expand-all style="width: 100%" row-key="path" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" v-loading="state.loading">
+        <el-table-column label="菜单名称" show-overflow-tooltip v-col="'title'">
+          <template #default="scope">
+            <SvgIcon :name="scope.row.icon" />
+            <span class="ml10">{{ scope.row.title }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="path" v-col="'path'" label="路由路径" show-overflow-tooltip></el-table-column>
+        <el-table-column label="组件路径" v-col="'component'" prop="component" show-overflow-tooltip></el-table-column>
+        <el-table-column label="排序" v-col="'weigh'" prop="weigh" width="80" align="center"></el-table-column>
+        <el-table-column label="类型" v-col="'menuType'" width="80" align="center">
+          <template #default="scope">
+            <el-tag :type="scope.row.menuType === 0 ? 'danger' : scope.row.menuType === 1 ? 'success' : 'warning'" size="small">{{
 							scope.row.menuType === 0 ? '目录' : scope.row.menuType === 1 ? '菜单' : '按钮'
 						}}</el-tag>
-					</template>
-				</el-table-column>
-				<el-table-column prop="isHide" label="显示状态" align="center" width="120">
-					<template #default="{ row }">
-						{{ row.isHide ? '隐藏' : '显示' }}
-					</template>
-				</el-table-column>
-				<el-table-column label="操作" width="200" align="center" fixed="right">
-					<template #default="scope">
-						<el-button v-if="!scope.row.menuType" size="small" type="text" @click="onOpenAddMenu(scope.row)">新增</el-button>
-						<el-button size="small" text type="warning" @click="onOpenEditMenu(scope.row)">修改</el-button>
-						<el-button size="small" text type="danger" @click="onTabelRowDel(scope.row)">删除</el-button>
-						<el-dropdown v-if="scope.row.menuType">
-							<el-button type="text" size="small" style="margin-top: 1px; margin-left: 10px"
-								>更多
-								<el-icon>
-									<ele-ArrowDown />
-								</el-icon>
-							</el-button>
-							<template #dropdown>
-								<el-dropdown-menu>
-									<el-dropdown-item @click.native="authOpen(scope.row, 'buttonAuthorizeList')">按钮权限</el-dropdown-item>
-									<el-dropdown-item @click.native="authOpen(scope.row, 'listAuthorizeList')">列表权限</el-dropdown-item>
-								</el-dropdown-menu>
-							</template>
-						</el-dropdown>
-					</template>
-				</el-table-column>
-			</el-table>
-		</el-card>
-		<EditMenu ref="editMenuRef" @menuList="menuList" :menu="state.menuTableData" :visibleOptions="sys_show_hide" :acType="acType" />
-		<ButtonAuthorizeListDrawer ref="buttonAuthorizeList" />
-		<ListAuthorizeListDrawer ref="listAuthorizeList" />
-		<ApiAuthorizeListDrawer ref="apiAuthorizeList" />
-	</div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="isHide" v-col="'isHide'" label="显示状态" align="center" width="120">
+          <template #default="{ row }">
+            {{ row.isHide ? '隐藏' : '显示' }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" v-col="'handle'" width="200" align="center" fixed="right">
+          <template #default="scope">
+            <el-button v-if="!scope.row.menuType" size="small" type="text" @click="onOpenAddMenu(scope.row)" v-auth="'add'">新增</el-button>
+            <el-button size="small" text type="warning" @click="onOpenEditMenu(scope.row)" v-auth="'edit'">修改</el-button>
+            <el-button size="small" text type="danger" @click="onTabelRowDel(scope.row)" v-auth="'del'">删除</el-button>
+            <el-dropdown v-if="scope.row.menuType">
+              <el-button type="text" size="small" style="margin-top: 1px; margin-left: 10px" v-auth="'more'">更多
+                <el-icon>
+                  <ele-ArrowDown />
+                </el-icon>
+              </el-button>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item @click.native="authOpen(scope.row, 'buttonAuthorizeList')" v-auth="'btn'">按钮权限</el-dropdown-item>
+                  <el-dropdown-item @click.native="authOpen(scope.row, 'listAuthorizeList')" v-auth="'list'">列表权限</el-dropdown-item>
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-card>
+    <EditMenu ref="editMenuRef" @menuList="menuList" :menu="state.menuTableData" :visibleOptions="sys_show_hide" :acType="acType" />
+    <ButtonAuthorizeListDrawer ref="buttonAuthorizeList" />
+    <ListAuthorizeListDrawer ref="listAuthorizeList" />
+    <ApiAuthorizeListDrawer ref="apiAuthorizeList" />
+  </div>
 </template>
 
 <script lang="ts" setup>
@@ -95,68 +87,68 @@ const editMenuRef = ref();
 const buttonAuthorizeList = ref();
 const listAuthorizeList = ref();
 const state = reactive({
-  loading:false,
-	queryParams: {
-		title: '',
-		component: '',
-		status: -1,
-	},
-	menuTableData: [],
+  loading: false,
+  queryParams: {
+    title: '',
+    component: '',
+    status: -1,
+  },
+  menuTableData: [],
 });
 const { proxy } = getCurrentInstance() as any;
 const { sys_show_hide } = proxy.useDict('sys_show_hide');
 const acType = ref('add');
 // 打开新增菜单弹窗
 const onOpenAddMenu = (row: any) => {
-	acType.value = 'add';
-	editMenuRef.value.openDialog(row);
+  acType.value = 'add';
+  editMenuRef.value.openDialog(row);
 };
 // 打开编辑菜单弹窗
 const onOpenEditMenu = (row: any) => {
-	acType.value = 'edit';
-	editMenuRef.value.openDialog(row);
+  acType.value = 'edit';
+  editMenuRef.value.openDialog(row);
 };
 
 // 打开按钮权限抽下
 const authOpen = (row: any, key: string) => {
-	if (key === 'buttonAuthorizeList') {
-		return buttonAuthorizeList.value.open(row);
-	}
-	if (key === 'listAuthorizeList') {
-		return listAuthorizeList.value.open(row);
-	}
+  if (key === 'buttonAuthorizeList') {
+    return buttonAuthorizeList.value.open(row);
+  }
+  if (key === 'listAuthorizeList') {
+    return listAuthorizeList.value.open(row);
+  }
 };
 
 // 删除当前行
 const onTabelRowDel = (row: any) => {
-	ElMessageBox.confirm(`此操作将永久删除菜单:“${row.title}”, 是否继续?`, '提示', {
-		confirmButtonText: '删除',
-		cancelButtonText: '取消',
-		type: 'warning',
-	})
-		.then(() => {
-			api.menu.del(row.id).then(() => {
-				ElMessage.success('删除成功');
-				proxy.$refs['editMenuRef'].resetMenuSession();
-				menuList();
-			});
-		})
-		.catch(() => {});
+  ElMessageBox.confirm(`此操作将永久删除菜单:“${row.title}”, 是否继续?`, '提示', {
+    confirmButtonText: '删除',
+    cancelButtonText: '取消',
+    type: 'warning',
+  })
+    .then(() => {
+      api.menu.del(row.id).then(() => {
+        ElMessage.success('删除成功');
+        proxy.$refs['editMenuRef'].resetMenuSession();
+        menuList();
+      });
+    })
+    .catch(() => { });
 };
 onBeforeMount(() => {
-	menuList();
+  menuList();
 });
 const handleQuery = () => {
-	menuList();
+  menuList();
 };
 const menuList = () => {
-	state.loading = true;
-	api.menu
-		.getList(state.queryParams)
-		.then((res: any) => {
-			// console.log({...res[0]})
-			state.menuTableData = res || [];
-		})
-		.finally(() => (state.loading = false));
+  state.loading = true;
+  api.menu
+    .getList(state.queryParams)
+    .then((res: any) => {
+      // console.log({...res[0]})
+      state.menuTableData = res || [];
+    })
+    .finally(() => (state.loading = false));
 };
 </script>

+ 235 - 235
src/views/system/task/index.vue

@@ -1,78 +1,78 @@
 <template>
-	<div class="system-dic-container">
-		<el-card shadow="hover">
-			<div class="system-user-search mb15">
-				<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
-					<el-form-item label="任务名称" prop="configName">
-						<el-input v-model="tableData.param.configName" placeholder="请输入参数名称" clearable size="default" @keyup.enter="dataList" />
-					</el-form-item>
-					<el-form-item label="任务组名" prop="jobGroup">
-						<el-select v-model="tableData.param.jobGroup" size="mini" placeholder="请选择">
-							<el-option v-for="dict in sys_job_group" :key="dict.value" :label="dict.label" :value="dict.value"> </el-option>
-						</el-select>
-					</el-form-item>
-					<el-form-item label="任务状态" prop="status" style="width: 200px">
-						<el-select v-model="tableData.param.status" size="mini" placeholder="请选择">
-							<el-option label="正常" :value="1" />
-							<el-option label="暂停" :value="0" />
-						</el-select>
-					</el-form-item>
+  <div class="system-dic-container">
+    <el-card shadow="hover">
+      <div class="system-user-search mb15">
+        <el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
+          <el-form-item label="任务名称" prop="configName">
+            <el-input v-model="tableData.param.configName" placeholder="请输入参数名称" clearable size="default" @keyup.enter="dataList" />
+          </el-form-item>
+          <el-form-item label="任务组名" prop="jobGroup">
+            <el-select v-model="tableData.param.jobGroup" size="mini" placeholder="请选择">
+              <el-option v-for="dict in sys_job_group" :key="dict.value" :label="dict.label" :value="dict.value"> </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="任务状态" prop="status" style="width: 200px">
+            <el-select v-model="tableData.param.status" size="mini" placeholder="请选择">
+              <el-option label="正常" :value="1" />
+              <el-option label="暂停" :value="0" />
+            </el-select>
+          </el-form-item>
 
-					<el-form-item>
-						<el-button size="default" type="primary" class="ml10" @click="dataList">
-							<el-icon>
-								<ele-Search />
-							</el-icon>
-							查询
-						</el-button>
-						<el-button size="default" @click="resetQuery(queryRef)">
-							<el-icon>
-								<ele-Refresh />
-							</el-icon>
-							重置
-						</el-button>
-						<el-button size="default" type="success" class="ml10" @click="onOpenAddDic">
-							<el-icon>
-								<ele-FolderAdd />
-							</el-icon>
-							新增任务
-						</el-button>
-						<el-button size="default" type="danger" class="ml10" @click="onRowDel(null)">
-							<el-icon>
-								<ele-Delete />
-							</el-icon>
-							删除任务
-						</el-button>
-					</el-form-item>
-				</el-form>
-			</div>
-			<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
-				<el-table-column type="selection" width="55" align="center" />
-				<el-table-column label="ID" align="center" prop="jobId" width="60" />
-				<el-table-column label="任务名称" prop="jobName" :show-overflow-tooltip="true" />
-				<el-table-column label="任务描述" prop="remark" show-overflow-tooltip />
-				<el-table-column label="任务分组" prop="jobGroup" width="120" :formatter="jobGroupFormat" />
-				<el-table-column label="任务方法名" prop="invokeTarget" />
-				<el-table-column label="cron执行表达式" prop="cronExpression" />
-				<el-table-column label="状态" align="center" prop="status" width="100">
-					<template #default="scope">
-						<!-- {{ row.status ? '正常' : '暂停' }} -->
-						<el-switch v-model="scope.row.status" inline-prompt :active-value="0" :inactive-value="1" active-text="启" inactive-text="禁" @change="handleStatusChange(scope.row)">
-						</el-switch>
-					</template>
-				</el-table-column>
-				<el-table-column label="操作" width="180" align="center" fixed="right">
-					<template #default="scope">
-						<el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)">修改</el-button>
-						<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
-						<el-button size="small" text type="primary" @click="onRowRun(scope.row)">执行一次</el-button>
-					</template>
-				</el-table-column>
-			</el-table>
-			<pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="dataList" />
-		</el-card>
-		<EditConfig ref="editDicRef" @dataList="dataList" />
-	</div>
+          <el-form-item>
+            <el-button size="default" type="primary" class="ml10" @click="dataList">
+              <el-icon>
+                <ele-Search />
+              </el-icon>
+              查询
+            </el-button>
+            <el-button size="default" @click="resetQuery(queryRef)">
+              <el-icon>
+                <ele-Refresh />
+              </el-icon>
+              重置
+            </el-button>
+            <el-button size="default" type="success" class="ml10" @click="onOpenAddDic">
+              <el-icon>
+                <ele-FolderAdd />
+              </el-icon>
+              新增任务
+            </el-button>
+            <el-button size="default" type="danger" class="ml10" @click="onRowDel(null)">
+              <el-icon>
+                <ele-Delete />
+              </el-icon>
+              删除任务
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="ID" align="center" prop="jobId" width="60" />
+        <el-table-column label="任务名称" prop="jobName" :show-overflow-tooltip="true" />
+        <el-table-column label="任务描述" prop="remark" show-overflow-tooltip />
+        <el-table-column label="任务分组" prop="jobGroup" width="120" :formatter="jobGroupFormat" />
+        <el-table-column label="任务方法名" prop="invokeTarget" />
+        <el-table-column label="cron执行表达式" prop="cronExpression" />
+        <el-table-column label="状态" align="center" prop="status" width="100">
+          <template #default="scope">
+            <!-- {{ row.status ? '正常' : '暂停' }} -->
+            <el-switch v-model="scope.row.status" inline-prompt :active-value="0" :inactive-value="1" active-text="启" inactive-text="禁" @change="handleStatusChange(scope.row)">
+            </el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="180" align="center" fixed="right">
+          <template #default="scope">
+            <el-button size="small" text type="warning" @click="onOpenEditDic(scope.row)">修改</el-button>
+            <el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
+            <el-button size="small" text type="primary" @click="onRowRun(scope.row)">执行一次</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="dataList" />
+    </el-card>
+    <EditConfig ref="editDicRef" @dataList="dataList" />
+  </div>
 </template>
 
 <script lang="ts">
@@ -83,172 +83,172 @@ import api from '/@/api/system';
 
 // 定义接口来定义对象的类型
 interface TableDataRow {
-	jobName: string;
-	jobParams: string;
-	jobGroup: string;
-	invokeTarget: string;
-	cronExpression: string;
-	misfirePolicy: number;
-	status: number;
-	jobId: number;
+  jobName: string;
+  jobParams: string;
+  jobGroup: string;
+  invokeTarget: string;
+  cronExpression: string;
+  misfirePolicy: number;
+  status: number;
+  jobId: number;
 }
 interface TableDataState {
-	ids: number[] | undefined;
-	tableData: {
-		data: Array<TableDataRow>;
-		total: number;
-		loading: boolean;
-		param: {
-			pageNum: number;
-			pageSize: number;
-			jobName: string;
-			jobGroup: string;
-			status: number | null;
-		};
-	};
+  ids: number[] | undefined;
+  tableData: {
+    data: Array<TableDataRow>;
+    total: number;
+    loading: boolean;
+    param: {
+      pageNum: number;
+      pageSize: number;
+      jobName: string;
+      jobGroup: string;
+      status: number | null;
+    };
+  };
 }
 
 export default defineComponent({
-	name: 'apiV1SystemDictDataList',
-	components: { EditConfig },
-	setup() {
-		const { proxy } = getCurrentInstance() as any;
-		const addDicRef = ref();
-		const editDicRef = ref();
-		const queryRef = ref();
-		const { sys_yes_no, sys_job_group } = proxy.useDict('sys_yes_no', 'sys_job_group');
-		const state = reactive<TableDataState>({
-			ids: [],
-			tableData: {
-				data: [],
-				total: 0,
-				loading: false,
-				param: {
-					pageNum: 1,
-					pageSize: 10,
-					jobName: '',
-					jobGroup: '',
-					status: null,
-				},
-			},
-		});
-		// 初始化表格数据
-		const initTableData = () => {
-			dataList();
-		};
-		const dataList = () => {
-			state.tableData.loading = true;
-			api.task
-				.getList(state.tableData.param)
-				.then((res: any) => {
-					state.tableData.data = res.list;
-					state.tableData.total = res.total;
-				})
-				.finally(() => (state.tableData.loading = false));
-		};
-		// 打开新增任务弹窗
-		const onOpenAddDic = () => {
-			editDicRef.value.openDialog();
-		};
-		// 打开修改任务弹窗
-		const onOpenEditDic = (row: TableDataRow) => {
-			editDicRef.value.openDialog(row);
-		};
-		// 删除任务
-		const onRowDel = (row: TableDataRow) => {
-			let msg = '你确定要删除所选数据?';
-			let ids: any = [];
-			if (row) {
-				msg = `此操作将永久删除任务名称:“${row.jobName}”,是否继续?`;
-				ids = [row.jobId];
-			} else {
-				ids = state.ids;
-			}
-			if (ids.length === 0) {
-				ElMessage.error('请选择要删除的数据。');
-				return;
-			}
-			ElMessageBox.confirm(msg, '提示', {
-				confirmButtonText: '确认',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(() => {
-					api.task.del(ids).then(() => {
-						ElMessage.success('删除成功');
-						dataList();
-					});
-				})
-				.catch(() => { });
-		};
-		const onRowRun = (row: TableDataRow) => {
-			ElMessageBox.confirm(`是否确认立即执行一次该任务?`, '警告', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning',
-			}).then(() => {
-				api.task.run(row.jobId).then(() => {
-					ElMessage.success('操作成功');
-					dataList();
-				});
-			});
-		};
-		const handleStatusChange = (row: TableDataRow) => {
-			let text = row.status === 0 ? '启用' : '停用';
-			ElMessageBox.confirm('确认要"' + text + '":"' + row.jobName + '"任务吗?', '警告', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning',
-			})
-				.then(function () {
-					if (row.status === 0) {
-						return api.task.start(row.jobId);
-					} else {
-						return api.task.stop(row.jobId);
-					}
-				})
-				.then(() => {
-					ElMessage.success(text + '成功');
-				})
-				.catch(function () {
-					row.status = row.status === 0 ? 1 : 0;
-				});
-		};
-		// 页面加载时
-		onMounted(() => {
-			initTableData();
-		});
-		/** 重置按钮操作 */
-		const resetQuery = (formEl: FormInstance | undefined) => {
-			if (!formEl) return;
-			formEl.resetFields();
-			dataList();
-		};
-		// 多选框选中数据
-		const handleSelectionChange = (selection: TableDataRow[]) => {
-			state.ids = selection.map((item) => item.jobId);
-		};
-		const jobGroupFormat = (row: TableDataRow) => {
-			console.log(row);
-			return proxy.selectDictLabel(unref(sys_job_group), row.jobGroup);
-		};
-		return {
-			addDicRef,
-			editDicRef,
-			queryRef,
-			sys_yes_no,
-			sys_job_group,
-			onOpenAddDic,
-			onOpenEditDic,
-			onRowDel,
-			onRowRun,
-			handleStatusChange,
-			dataList,
-			resetQuery,
-			handleSelectionChange,
-			jobGroupFormat,
-			...toRefs(state),
-		};
-	},
+  name: 'apiV1SystemDictDataList',
+  components: { EditConfig },
+  setup() {
+    const { proxy } = getCurrentInstance() as any;
+    const addDicRef = ref();
+    const editDicRef = ref();
+    const queryRef = ref();
+    const { sys_yes_no, sys_job_group } = proxy.useDict('sys_yes_no', 'sys_job_group');
+    const state = reactive<TableDataState>({
+      ids: [],
+      tableData: {
+        data: [],
+        total: 0,
+        loading: false,
+        param: {
+          pageNum: 1,
+          pageSize: 10,
+          jobName: '',
+          jobGroup: '',
+          status: null,
+        },
+      },
+    });
+    // 初始化表格数据
+    const initTableData = () => {
+      dataList();
+    };
+    const dataList = () => {
+      state.tableData.loading = true;
+      api.task
+        .getList(state.tableData.param)
+        .then((res: any) => {
+          state.tableData.data = res.list;
+          state.tableData.total = res.total;
+        })
+        .finally(() => (state.tableData.loading = false));
+    };
+    // 打开新增任务弹窗
+    const onOpenAddDic = () => {
+      editDicRef.value.openDialog();
+    };
+    // 打开修改任务弹窗
+    const onOpenEditDic = (row: TableDataRow) => {
+      editDicRef.value.openDialog(row);
+    };
+    // 删除任务
+    const onRowDel = (row: TableDataRow) => {
+      let msg = '你确定要删除所选数据?';
+      let ids: any = [];
+      if (row) {
+        msg = `此操作将永久删除任务名称:“${row.jobName}”,是否继续?`;
+        ids = [row.jobId];
+      } else {
+        ids = state.ids;
+      }
+      if (ids.length === 0) {
+        ElMessage.error('请选择要删除的数据。');
+        return;
+      }
+      ElMessageBox.confirm(msg, '提示', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          api.task.del(ids).then(() => {
+            ElMessage.success('删除成功');
+            dataList();
+          });
+        })
+        .catch(() => { });
+    };
+    const onRowRun = (row: TableDataRow) => {
+      ElMessageBox.confirm(`是否确认立即执行一次该任务?`, '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(() => {
+        api.task.run(row.jobId).then(() => {
+          ElMessage.success('操作成功');
+          dataList();
+        });
+      });
+    };
+    const handleStatusChange = (row: TableDataRow) => {
+      let text = row.status === 0 ? '启用' : '停用';
+      ElMessageBox.confirm('确认要"' + text + '":"' + row.jobName + '"任务吗?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(function () {
+          if (row.status === 0) {
+            return api.task.start(row.jobId);
+          } else {
+            return api.task.stop(row.jobId);
+          }
+        })
+        .then(() => {
+          ElMessage.success(text + '成功');
+        })
+        .catch(function () {
+          row.status = row.status === 0 ? 1 : 0;
+        });
+    };
+    // 页面加载时
+    onMounted(() => {
+      initTableData();
+    });
+    /** 重置按钮操作 */
+    const resetQuery = (formEl: FormInstance | undefined) => {
+      if (!formEl) return;
+      formEl.resetFields();
+      dataList();
+    };
+    // 多选框选中数据
+    const handleSelectionChange = (selection: TableDataRow[]) => {
+      state.ids = selection.map((item) => item.jobId);
+    };
+    const jobGroupFormat = (row: TableDataRow) => {
+      console.log(row);
+      return proxy.selectDictLabel(unref(sys_job_group), row.jobGroup);
+    };
+    return {
+      addDicRef,
+      editDicRef,
+      queryRef,
+      sys_yes_no,
+      sys_job_group,
+      onOpenAddDic,
+      onOpenEditDic,
+      onRowDel,
+      onRowRun,
+      handleStatusChange,
+      dataList,
+      resetQuery,
+      handleSelectionChange,
+      jobGroupFormat,
+      ...toRefs(state),
+    };
+  },
 });
 </script>