mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-02 07:20:24 +08:00
refactor: 前端风格统一
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
|
||||
<!-- 插槽:预留功能 -->
|
||||
<template #default="scope" v-if="item.slot">
|
||||
<slot :name="item.slot" :data="scope.row"></slot>
|
||||
<slot :name="item.prop" :data="scope.row"></slot>
|
||||
</template>
|
||||
|
||||
<template #default="scope" v-else>
|
||||
|
||||
@@ -29,9 +29,9 @@ export class TableColumn {
|
||||
minWidth: number | string;
|
||||
|
||||
/**
|
||||
* 插槽名
|
||||
* 是否插槽,是的话插槽名则为prop属性名
|
||||
*/
|
||||
slot: string;
|
||||
slot: boolean = false;
|
||||
|
||||
showOverflowTooltip: boolean = true;
|
||||
|
||||
@@ -88,8 +88,12 @@ export class TableColumn {
|
||||
return this;
|
||||
}
|
||||
|
||||
setSlot(slot: string): TableColumn {
|
||||
this.slot = slot
|
||||
/**
|
||||
* 标识该列为插槽
|
||||
* @returns this
|
||||
*/
|
||||
isSlot(): TableColumn {
|
||||
this.slot = true
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
|
||||
<template #queryRight>
|
||||
<el-button v-auth="permissions.saveDb" type="primary" icon="plus" @click="editDb(true)">添加</el-button>
|
||||
<el-button v-auth="permissions.saveDb" :disabled="selectionData.length != 1" @click="editDb(false)"
|
||||
type="primary" icon="edit">编辑</el-button>
|
||||
<el-button v-auth="permissions.delDb" :disabled="selectionData.length < 1" @click="deleteDb()" type="danger"
|
||||
icon="delete">删除</el-button>
|
||||
</template>
|
||||
@@ -49,12 +47,14 @@
|
||||
</el-popover>
|
||||
</template>
|
||||
|
||||
<template #more="{ data }">
|
||||
<el-button @click="showInfo(data)" link>详情</el-button>
|
||||
|
||||
<el-button class="ml5" type="primary" @click="onShowSqlExec(data)" link>SQL执行记录</el-button>
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-link plain size="small" :underline="false" @click="showInfo(data)">
|
||||
详情</el-link>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
<el-link class="ml5" type="primary" plain size="small" :underline="false" @click="onShowSqlExec(data)">
|
||||
SQL执行记录</el-link>
|
||||
<el-button v-auth="permissions.saveDb" @click="editDb(data)" type="primary" link>编辑</el-button>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
@@ -309,14 +309,15 @@ const state = reactive({
|
||||
TableQuery.slot("tagPath", "标签", "tagPathSelect"),
|
||||
],
|
||||
columns: [
|
||||
TableColumn.new("tagPath", "标签路径").setSlot("tagPath").setAddWidth(20),
|
||||
TableColumn.new("tagPath", "标签路径").isSlot().setAddWidth(20),
|
||||
TableColumn.new("name", "名称"),
|
||||
TableColumn.new("host", "host:port").setFormatFunc((data: any, _prop: string) => `${data.host}:${data.port}`),
|
||||
TableColumn.new("type", "类型"),
|
||||
TableColumn.new("database", "数据库").setSlot("database").setMinWidth(70),
|
||||
TableColumn.new("database", "数据库").isSlot().setMinWidth(70),
|
||||
TableColumn.new("username", "用户名"),
|
||||
TableColumn.new("remark", "备注"),
|
||||
TableColumn.new("action", "操作").setSlot("action").setMinWidth(175).fixedRight(),
|
||||
TableColumn.new("more", "更多").isSlot().setMinWidth(165).fixedRight(),
|
||||
TableColumn.new("action", "操作").isSlot().setMinWidth(65).fixedRight(),
|
||||
],
|
||||
datas: [],
|
||||
total: 0,
|
||||
@@ -469,12 +470,12 @@ const getTags = async () => {
|
||||
state.tags = await tagApi.getAccountTags.request(null);
|
||||
};
|
||||
|
||||
const editDb = async (isAdd = false) => {
|
||||
if (isAdd) {
|
||||
const editDb = async (data: any) => {
|
||||
if (!data) {
|
||||
state.dbEditDialog.data = null;
|
||||
state.dbEditDialog.title = '新增数据库资源';
|
||||
} else {
|
||||
state.dbEditDialog.data = state.selectionData[0];
|
||||
state.dbEditDialog.data = data;
|
||||
state.dbEditDialog.title = '修改数据库资源';
|
||||
}
|
||||
state.dbEditDialog.visible = true;
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
<template #queryRight>
|
||||
<el-button v-auth="'machine:add'" type="primary" icon="plus" @click="openFormDialog(false)" plain>添加
|
||||
</el-button>
|
||||
<el-button v-auth="'machine:update'" type="primary" icon="edit" :disabled="selectionData.length != 1"
|
||||
@click="openFormDialog(selectionData)" plain>编辑</el-button>
|
||||
<el-button v-auth="'machine:del'" :disabled="selectionData.length < 1" @click="deleteMachine()"
|
||||
type="danger" icon="delete">删除</el-button>
|
||||
</template>
|
||||
@@ -42,19 +40,17 @@
|
||||
|
||||
<template #action="{ data }">
|
||||
<span v-auth="'machine:terminal'">
|
||||
<el-link :disabled="data.status == -1" type="primary" @click="showTerminal(data)" plain size="small"
|
||||
:underline="false">终端</el-link>
|
||||
<el-button :disabled="data.status == -1" type="primary" @click="showTerminal(data)" link>终端</el-button>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
</span>
|
||||
|
||||
<span v-auth="'machine:file'">
|
||||
<el-link type="success" :disabled="data.status == -1" @click="showFileManage(data)" plain size="small"
|
||||
:underline="false">文件</el-link>
|
||||
<el-button type="success" :disabled="data.status == -1" @click="showFileManage(data)"
|
||||
link>文件</el-button>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
</span>
|
||||
|
||||
<el-link :disabled="data.status == -1" type="warning" @click="serviceManager(data)" plain size="small"
|
||||
:underline="false">脚本</el-link>
|
||||
<el-button :disabled="data.status == -1" type="warning" @click="serviceManager(data)" link>脚本</el-button>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
|
||||
<el-dropdown>
|
||||
@@ -67,24 +63,25 @@
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item>
|
||||
<el-link @click="showInfo(data)" plain :underline="false" size="small">详情
|
||||
</el-link>
|
||||
<el-button @click="showInfo(data)" link>详情</el-button>
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item>
|
||||
<el-link @click="showProcess(data)" :disabled="data.status == -1" plain :underline="false"
|
||||
size="small">进程</el-link>
|
||||
<el-button v-auth="'machine:update'" @click="openFormDialog(data)" link>编辑</el-button>
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item>
|
||||
<el-button @click="showProcess(data)" :disabled="data.status == -1" link>进程</el-button>
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item v-if="data.enableRecorder == 1">
|
||||
<el-link v-auth="'machine:update'" @click="showRec(data)" plain :underline="false"
|
||||
size="small">终端回放</el-link>
|
||||
<el-button v-auth="'machine:update'" @click="showRec(data)" link>终端回放</el-button>
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item>
|
||||
<el-link v-auth="'machine:close-cli'" :disabled="!data.hasCli || data.status == -1"
|
||||
type="danger" @click="closeCli(data)" plain size="small" :underline="false">关闭连接
|
||||
</el-link>
|
||||
<el-button v-auth="'machine:close-cli'" :disabled="!data.hasCli || data.status == -1"
|
||||
type="danger" @click="closeCli(data)" link>关闭连接
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
@@ -182,13 +179,13 @@ const state = reactive({
|
||||
TableQuery.text("name", "名称"),
|
||||
],
|
||||
columns: [
|
||||
TableColumn.new("tagPath", "标签路径").setSlot("tagPath").setAddWidth(20),
|
||||
TableColumn.new("tagPath", "标签路径").isSlot().setAddWidth(20),
|
||||
TableColumn.new("name", "名称"),
|
||||
TableColumn.new("ipPort", "ip:port").setSlot("ipPort").setAddWidth(35),
|
||||
TableColumn.new("ipPort", "ip:port").isSlot().setAddWidth(35),
|
||||
TableColumn.new("username", "用户名"),
|
||||
TableColumn.new("status", "状态").setSlot("status").setMinWidth(85),
|
||||
TableColumn.new("status", "状态").isSlot().setMinWidth(85),
|
||||
TableColumn.new("remark", "备注"),
|
||||
TableColumn.new("action", "操作").setSlot("action").setMinWidth(235).fixedRight(),
|
||||
TableColumn.new("action", "操作").isSlot().setMinWidth(235).fixedRight(),
|
||||
],
|
||||
// 列表数据
|
||||
data: {
|
||||
@@ -280,7 +277,7 @@ const getTags = async () => {
|
||||
const openFormDialog = async (machine: any) => {
|
||||
let dialogTitle;
|
||||
if (machine) {
|
||||
state.machineEditDialog.data = state.selectionData[0];
|
||||
state.machineEditDialog.data = machine;
|
||||
dialogTitle = '编辑机器';
|
||||
} else {
|
||||
state.machineEditDialog.data = null;
|
||||
|
||||
@@ -6,18 +6,20 @@
|
||||
|
||||
<template #queryRight>
|
||||
<el-button type="primary" icon="plus" @click="edit(false)">添加</el-button>
|
||||
<el-button :disabled="selectionData.length !== 1" @click="edit(selectionData)" type="primary" icon="edit">编辑
|
||||
</el-button>
|
||||
<el-button :disabled="selectionData.length < 1" @click="deleteAc(selectionData)" type="danger"
|
||||
icon="delete">删除
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
|
||||
<template #authMethod="{ data }">
|
||||
<el-tag v-if="data.authMethod == 1" type="success" size="small">密码</el-tag>
|
||||
<el-tag v-if="data.authMethod == 2" size="small">密钥</el-tag>
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-button @click="edit(data)" type="primary" link>编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
<auth-cert-edit :title="editor.title" v-model:visible="editor.visible" :data="editor.authcert"
|
||||
@@ -44,12 +46,13 @@ const state = reactive({
|
||||
],
|
||||
columns: [
|
||||
TableColumn.new("name", "名称"),
|
||||
TableColumn.new("authMethod", "认证方式").setSlot("authMethod"),
|
||||
TableColumn.new("authMethod", "认证方式").isSlot(),
|
||||
TableColumn.new("remark", "备注"),
|
||||
TableColumn.new("creator", "创建人"),
|
||||
TableColumn.new("createTime", "创建时间").isTime(),
|
||||
TableColumn.new("creator", "修改者"),
|
||||
TableColumn.new("createTime", "修改时间").isTime(),
|
||||
TableColumn.new("action", "操作").isSlot().fixedRight().setMinWidth(65),
|
||||
],
|
||||
total: 0,
|
||||
authcerts: [],
|
||||
@@ -92,7 +95,7 @@ const editChange = () => {
|
||||
|
||||
const edit = (data: any) => {
|
||||
if (data) {
|
||||
state.editor.authcert = data[0];
|
||||
state.editor.authcert = data;
|
||||
} else {
|
||||
state.editor.authcert = false;
|
||||
}
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
|
||||
<template #queryRight>
|
||||
<el-button type="primary" icon="plus" @click="editMongo(true)" plain>添加</el-button>
|
||||
<el-button type="primary" icon="edit" :disabled="selectionData.length != 1" @click="editMongo(false)"
|
||||
plain>编辑
|
||||
</el-button>
|
||||
<el-button type="danger" icon="delete" :disabled="selectionData.length < 1" @click="deleteMongo" plain>删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -28,7 +25,9 @@
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-link type="primary" @click="showDatabases(data.id)" plain size="small" :underline="false">数据库</el-link>
|
||||
<el-button @click="showDatabases(data.id)" link>数据库</el-button>
|
||||
|
||||
<el-button type="primary" @click="editMongo(data)" link>编辑</el-button>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
@@ -199,12 +198,12 @@ const state = reactive({
|
||||
TableQuery.slot("tagPath", "标签", "tagPathSelect"),
|
||||
],
|
||||
columns: [
|
||||
TableColumn.new("tagPath", "标签路径").setSlot("tagPath").setAddWidth(20),
|
||||
TableColumn.new("tagPath", "标签路径").isSlot().setAddWidth(20),
|
||||
TableColumn.new("name", "名称"),
|
||||
TableColumn.new("uri", "连接uri"),
|
||||
TableColumn.new("createTime", "创建时间").isTime(),
|
||||
TableColumn.new("creator", "创建人"),
|
||||
TableColumn.new("action", "操作").setSlot("action").setMinWidth(100).fixedRight(),
|
||||
TableColumn.new("action", "操作").isSlot().setMinWidth(100).fixedRight(),
|
||||
],
|
||||
mongoEditDialog: {
|
||||
visible: false,
|
||||
@@ -371,12 +370,12 @@ const getTags = async () => {
|
||||
state.tags = await tagApi.getAccountTags.request(null);
|
||||
};
|
||||
|
||||
const editMongo = async (isAdd = false) => {
|
||||
if (isAdd) {
|
||||
const editMongo = async (data: any) => {
|
||||
if (!data) {
|
||||
state.mongoEditDialog.data = null;
|
||||
state.mongoEditDialog.title = '新增mongo';
|
||||
} else {
|
||||
state.mongoEditDialog.data = state.selectionData[0];
|
||||
state.mongoEditDialog.data = data;
|
||||
state.mongoEditDialog.title = '修改mongo';
|
||||
}
|
||||
state.mongoEditDialog.visible = true;
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
|
||||
<template #queryRight>
|
||||
<el-button type="primary" icon="plus" @click="editRedis(true)" plain>添加</el-button>
|
||||
<el-button type="primary" icon="edit" :disabled="selectionData.length != 1" @click="editRedis(false)"
|
||||
plain>编辑
|
||||
</el-button>
|
||||
<el-button type="danger" icon="delete" :disabled="selectionData.length < 1" @click="deleteRedis" plain>删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -28,13 +25,16 @@
|
||||
</template>
|
||||
|
||||
<template #more="{ data }">
|
||||
<el-link @click="showDetail(data)" :underline="false">详情</el-link>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
<el-button @click="showDetail(data)" link>详情</el-button>
|
||||
|
||||
<el-link v-if="data.mode === 'standalone' || data.mode === 'sentinel'" type="primary"
|
||||
@click="showInfoDialog(data)" :underline="false">单机信息</el-link>
|
||||
<el-link @click="onShowClusterInfo(data)" v-if="data.mode === 'cluster'" type="primary"
|
||||
:underline="false">集群信息</el-link>
|
||||
<el-button v-if="data.mode === 'standalone' || data.mode === 'sentinel'" type="primary"
|
||||
@click="showInfoDialog(data)" link>单机信息</el-button>
|
||||
<el-button @click="onShowClusterInfo(data)" v-if="data.mode === 'cluster'" type="primary"
|
||||
link>集群信息</el-button>
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-button type="primary" link @click="editRedis(data)">编辑</el-button>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
@@ -168,12 +168,13 @@ const state = reactive({
|
||||
TableQuery.slot("tagPath", "标签", "tagPathSelect"),
|
||||
],
|
||||
columns: [
|
||||
TableColumn.new("tagPath", "标签路径").setSlot("tagPath").setAddWidth(20),
|
||||
TableColumn.new("tagPath", "标签路径").isSlot().setAddWidth(20),
|
||||
TableColumn.new("name", "名称"),
|
||||
TableColumn.new("host", "host:port"),
|
||||
TableColumn.new("mode", "mode"),
|
||||
TableColumn.new("remark", "备注"),
|
||||
TableColumn.new("more", "更多").setSlot("more").setMinWidth(155).fixedRight(),
|
||||
TableColumn.new("more", "更多").isSlot().setMinWidth(155).fixedRight(),
|
||||
TableColumn.new("action", "操作").isSlot().setMinWidth(65).fixedRight(),
|
||||
],
|
||||
detailDialog: {
|
||||
visible: false,
|
||||
@@ -273,12 +274,12 @@ const getTags = async () => {
|
||||
state.tags = await tagApi.getAccountTags.request(null);
|
||||
};
|
||||
|
||||
const editRedis = async (isAdd = false) => {
|
||||
if (isAdd) {
|
||||
const editRedis = async (data: any) => {
|
||||
if (!data) {
|
||||
state.redisEditDialog.data = null;
|
||||
state.redisEditDialog.title = '新增redis';
|
||||
} else {
|
||||
state.redisEditDialog.data = state.selectionData[0];
|
||||
state.redisEditDialog.data = data;
|
||||
state.redisEditDialog.title = '修改redis';
|
||||
}
|
||||
state.redisEditDialog.visible = true;
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-link @click.prevent="showMembers(data)" :underline="false" type="primary">成员</el-link>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
<el-link @click.prevent="showTags(data)" :underline="false" type="success">标签</el-link>
|
||||
<el-divider v-auth="'team:save'" direction="vertical" border-style="dashed" />
|
||||
<el-link v-auth="'team:save'" @click.prevent="showSaveTeamDialog(data)" :underline="false"
|
||||
type="warning">编辑</el-link>
|
||||
<el-button @click.prevent="showMembers(data)" link type="primary">成员</el-button>
|
||||
|
||||
<el-button @click.prevent="showTags(data)" link type="success">标签</el-button>
|
||||
|
||||
<el-button v-auth="'team:save'" @click.prevent="showSaveTeamDialog(data)" link type="warning">编辑</el-button>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
@@ -163,7 +162,7 @@ const state = reactive({
|
||||
TableColumn.new("remark", "备注"),
|
||||
TableColumn.new("createTime", "创建时间").isTime(),
|
||||
TableColumn.new("creator", "创建人"),
|
||||
TableColumn.new("action", "操作").setSlot("action").setMinWidth(100).fixedRight(),
|
||||
TableColumn.new("action", "操作").isSlot().setMinWidth(100).fixedRight(),
|
||||
],
|
||||
total: 0,
|
||||
data: [],
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
|
||||
<template #queryRight>
|
||||
<el-button v-auth="'account:add'" type="primary" icon="plus" @click="editAccount(true)">添加</el-button>
|
||||
<el-button v-auth="'account:add'" :disabled="state.selectionData.length != 1" @click="editAccount(false)"
|
||||
type="primary" icon="edit">编辑</el-button>
|
||||
<el-button v-auth="'account:saveRoles'" :disabled="state.selectionData.length != 1" @click="showRoleEdit()"
|
||||
type="success" icon="setting">角色分配</el-button>
|
||||
<el-button v-auth="'account:del'" :disabled="state.selectionData.length < 1" @click="deleteAccount()"
|
||||
type="danger" icon="delete">删除</el-button>
|
||||
</template>
|
||||
@@ -26,14 +22,18 @@
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-button v-auth="'account:changeStatus'" @click="changeStatus(data)" v-if="data.status == 1" type="danger"
|
||||
size="small" plain>禁用</el-button>
|
||||
<el-button link v-auth="'account:add'" @click="editAccount(data)" type="primary">编辑</el-button>
|
||||
|
||||
<el-button v-auth="'account:changeStatus'" v-if="data.status == -1" type="success"
|
||||
@click="changeStatus(data)" size="small" plain>启用</el-button>
|
||||
<el-button link v-auth="'account:saveRoles'" @click="showRoleEdit(data)" type="success">角色分配</el-button>
|
||||
|
||||
<el-button v-auth="'account:add'" :disabled="!data.otpSecret || data.otpSecret == '-'"
|
||||
@click="resetOtpSecret(data)" type="warning" size="small" plain>重置OTP</el-button>
|
||||
<el-button link v-auth="'account:changeStatus'" @click="changeStatus(data)" v-if="data.status == 1"
|
||||
type="danger">禁用</el-button>
|
||||
|
||||
<el-button link v-auth="'account:changeStatus'" v-if="data.status == -1" type="success"
|
||||
@click="changeStatus(data)">启用</el-button>
|
||||
|
||||
<el-button link v-auth="'account:add'" :disabled="!data.otpSecret || data.otpSecret == '-'"
|
||||
@click="resetOtpSecret(data)" type="warning">重置OTP</el-button>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
@@ -101,14 +101,14 @@ const state = reactive({
|
||||
columns: [
|
||||
TableColumn.new("name", "姓名"),
|
||||
TableColumn.new("username", "用户名"),
|
||||
TableColumn.new("status", "状态").setSlot("status"),
|
||||
TableColumn.new("status", "状态").isSlot("status"),
|
||||
TableColumn.new("lastLoginTime", "最后登录时间").isTime(),
|
||||
TableColumn.new("showmore", "查看更多").setSlot("showmore").setMinWidth(150),
|
||||
TableColumn.new("showmore", "查看更多").isSlot("showmore").setMinWidth(150),
|
||||
TableColumn.new("creator", "创建账号"),
|
||||
TableColumn.new("createTime", "创建时间").isTime(),
|
||||
TableColumn.new("modifier", "更新账号"),
|
||||
TableColumn.new("updateTime", "更新时间").isTime(),
|
||||
TableColumn.new("action", "操作").setSlot("action").fixedRight().setMinWidth(200),
|
||||
TableColumn.new("action", "操作").isSlot("action").fixedRight().setMinWidth(280),
|
||||
],
|
||||
datas: [],
|
||||
total: 0,
|
||||
@@ -202,16 +202,16 @@ const resetOtpSecret = async (row: any) => {
|
||||
row.otpSecret = "-";
|
||||
};
|
||||
|
||||
const showRoleEdit = () => {
|
||||
const showRoleEdit = (data: any) => {
|
||||
state.roleDialog.visible = true;
|
||||
state.roleDialog.account = state.selectionData[0];
|
||||
state.roleDialog.account = data;
|
||||
};
|
||||
|
||||
const editAccount = (isAdd = false) => {
|
||||
if (isAdd) {
|
||||
const editAccount = (data: any) => {
|
||||
if (!data) {
|
||||
state.accountDialog.data = null;
|
||||
} else {
|
||||
state.accountDialog.data = state.selectionData[0];
|
||||
state.accountDialog.data = data;
|
||||
}
|
||||
state.accountDialog.visible = true;
|
||||
};
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
|
||||
<template #queryRight>
|
||||
<el-button v-auth="'config:save'" type="primary" icon="plus" @click="editConfig(false)">添加</el-button>
|
||||
<el-button v-auth="'config:save'" :disabled="state.selectionData.length != 1"
|
||||
@click="editConfig(state.selectionData[0])" type="primary" icon="edit">编辑
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template #status="{ data }">
|
||||
@@ -16,8 +13,10 @@
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-link :disabled="data.status == -1" type="warning" @click="showSetConfigDialog(data)" plain size="small"
|
||||
:underline="false">配置</el-link>
|
||||
<el-button :disabled="data.status == -1" type="warning" @click="showSetConfigDialog(data)"
|
||||
link>配置</el-button>
|
||||
<el-button v-auth="'config:save'" @click="editConfig(data)" type="primary" link>编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
@@ -76,7 +75,7 @@ const state = reactive({
|
||||
TableColumn.new("remark", "备注"),
|
||||
TableColumn.new("modifier", "更新账号"),
|
||||
TableColumn.new("updateTime", "更新时间").isTime(),
|
||||
TableColumn.new("action", "操作").setSlot("action").fixedRight().setMinWidth(60),
|
||||
TableColumn.new("action", "操作").isSlot().fixedRight().setMinWidth(130),
|
||||
],
|
||||
total: 0,
|
||||
configs: [],
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
|
||||
<template #queryRight>
|
||||
<el-button v-auth="'role:add'" type="primary" icon="plus" @click="editRole(false)">添加</el-button>
|
||||
<el-button v-auth="'role:update'" :disabled="selectionData.length != 1" @click="editRole(selectionData)"
|
||||
type="primary" icon="edit">编辑</el-button>
|
||||
<el-button v-auth="'role:saveResources'" :disabled="selectionData.length != 1"
|
||||
@click="editResource(selectionData)" type="success" icon="setting">分配菜单&权限</el-button>
|
||||
<el-button v-auth="'role:del'" :disabled="selectionData.length < 1" @click="deleteRole(selectionData)"
|
||||
type="danger" icon="delete">删除</el-button>
|
||||
</template>
|
||||
@@ -22,6 +18,12 @@
|
||||
<template #showmore="{ data }">
|
||||
<el-link @click.prevent="showResources(data)" type="info">菜单&权限</el-link>
|
||||
</template>
|
||||
|
||||
<template #action="{ data }">
|
||||
<el-button v-auth="'role:update'" @click="editRole(data)" type="primary" link>编辑</el-button>
|
||||
<el-button v-auth="'role:saveResources'" @click="editResource(data)" type="success" link>权限分配</el-button>
|
||||
</template>
|
||||
|
||||
</page-table>
|
||||
|
||||
<role-edit :title="roleEditDialog.title" v-model:visible="roleEditDialog.visible" :data="roleEditDialog.role"
|
||||
@@ -59,12 +61,13 @@ const state = reactive({
|
||||
TableColumn.new("name", "角色名称"),
|
||||
TableColumn.new("code", "角色code"),
|
||||
TableColumn.new("remark", "备注"),
|
||||
TableColumn.new("status", "状态").setSlot("status"),
|
||||
TableColumn.new("status", "状态").isSlot(),
|
||||
TableColumn.new("creator", "创建账号"),
|
||||
TableColumn.new("createTime", "创建时间").isTime(),
|
||||
TableColumn.new("modifier", "更新账号"),
|
||||
TableColumn.new("updateTime", "更新时间").isTime(),
|
||||
TableColumn.new("showmore", "查看更多").setSlot("showmore").setMinWidth(150).fixedRight(),
|
||||
TableColumn.new("showmore", "查看更多").isSlot().setMinWidth(150),
|
||||
TableColumn.new("action", "操作").isSlot().setMinWidth(160).fixedRight(),
|
||||
],
|
||||
total: 0,
|
||||
roles: [],
|
||||
@@ -119,7 +122,7 @@ const roleEditChange = () => {
|
||||
|
||||
const editRole = (data: any) => {
|
||||
if (data) {
|
||||
state.roleEditDialog.role = data[0];
|
||||
state.roleEditDialog.role = data;
|
||||
} else {
|
||||
state.roleEditDialog.role = false;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ require (
|
||||
golang.org/x/crypto v0.10.0 // ssh
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
// gorm
|
||||
gorm.io/driver/mysql v1.5.0
|
||||
gorm.io/gorm v1.25.1
|
||||
gorm.io/driver/mysql v1.5.1
|
||||
gorm.io/gorm v1.25.2
|
||||
)
|
||||
|
||||
require (
|
||||
|
||||
@@ -46,7 +46,7 @@ func (m *Machine) Machines(rc *req.Ctx) {
|
||||
}
|
||||
condition.TagIds = tagIds
|
||||
|
||||
res := m.MachineApp.GetMachineList(condition, ginx.GetPageParam(rc.GinCtx), new([]vo.MachineVO))
|
||||
res := m.MachineApp.GetMachineList(condition, ginx.GetPageParam(rc.GinCtx), new([]*vo.MachineVO))
|
||||
if res.Total == 0 {
|
||||
rc.ResData = res
|
||||
return
|
||||
|
||||
@@ -32,7 +32,7 @@ type Machine interface {
|
||||
GetById(id uint64, cols ...string) *entity.Machine
|
||||
|
||||
// 分页获取机器信息列表
|
||||
GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO]
|
||||
GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO]
|
||||
|
||||
// 获取机器连接
|
||||
GetCli(id uint64) *machine.Cli
|
||||
@@ -54,7 +54,7 @@ type machineAppImpl struct {
|
||||
}
|
||||
|
||||
// 分页获取机器信息列表
|
||||
func (m *machineAppImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO] {
|
||||
func (m *machineAppImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO] {
|
||||
return m.machineRepo.GetMachineList(condition, pageParam, toEntity, orderBy...)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
type Machine interface {
|
||||
// 分页获取机器信息列表
|
||||
GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO]
|
||||
GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO]
|
||||
|
||||
Count(condition *entity.MachineQuery) int64
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ func newMachineRepo() repository.Machine {
|
||||
}
|
||||
|
||||
// 分页获取机器信息列表
|
||||
func (m *machineRepoImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO] {
|
||||
func (m *machineRepoImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO] {
|
||||
qd := gormx.NewQuery(new(entity.Machine)).
|
||||
Like("ip", condition.Ip).
|
||||
Like("name", condition.Name).
|
||||
|
||||
Reference in New Issue
Block a user