Ver Fonte

Merge branch 'feature/v2.4.0-liugh-logManage' into 'develop_2.4.0_LogManage'

提交基础log基础文件

See merge request dcuc-tjdsj/auth-web!3
刘光华 há 4 anos atrás
pai
commit
446bf1d2cc

+ 2 - 2
config/dev.env.js

@@ -40,8 +40,8 @@ module.exports = merge(prodEnv, {
             // target: "http://10.254.11.200:8861" // 傅志强
             // target: "http://10.254.10.15:8861" // 傅志强
             // target: "http://10.11.1.164:8861"
-            // target: "http://10.11.0.48:8861",// 邱宇
-            target: "http://10.254.11.203:8861"
+            target: "http://10.11.0.48:8861",// 邱宇
+            // target: "http://10.254.11.203:8861"
 
         }
     })

+ 41 - 0
src/pages/log-manage/DataConfig.js

@@ -0,0 +1,41 @@
+/*
+ * @Author: Liugh
+ * @Date: 2021-05-25 14:09:24
+ * @LastEditTime: 2021-05-26 15:28:10
+ * @LastEditors: Do not edit
+ * @FilePath: \auth-web\src\pages\log-manage\DataConfig.js
+ * @Description:
+ */
+const earlyWarningPlanTable = [
+    {
+        label: "鉴权预警方案名称",
+        prop: "name"
+    },
+    {
+        label: "创建时间",
+        prop: "createTime	"
+    },
+    {
+        label: "修改时间",
+        prop: "updateTime"
+    },
+    {
+        label: "预警数量",
+        prop: "number"
+    },
+    {
+        label: "方案状态",
+        // custom: true, // 如果需要自定义请加上这个属性,插槽名称为prop
+        prop: "state"
+    }
+];
+const earlyWarningPlanTableInfo = [
+    { label: "方案名称", value: "name", span: 24 },
+    { label: "方案状态", value: "state", span: 24 },
+    { label: "创建时间", value: "createTime", span: 12 },
+    { label: "修改时间", value: "updateTime", span: 12 },
+    { label: "预警规则", value: "ruleContent", span: 24 },
+    { label: "规则说明", value: "ruleExplain", span: 24 },
+    { label: "预警信息", value: "warningMsg", span: 24 }
+];
+export { earlyWarningPlanTable, earlyWarningPlanTableInfo };

+ 138 - 0
src/pages/log-manage/err-auth-earlywarning-manage/auth-earlywarning-plan.vue

@@ -0,0 +1,138 @@
+<!--
+ * @Author: Liugh
+ * @Date: 2021-05-25 13:49:40
+ * @LastEditTime: 2021-05-26 15:59:42
+ * @LastEditors: Do not edit
+ * @FilePath: \auth-web\src\pages\log-manage\err-auth-earlywarning-manage\auth-earlywarning-plan.vue
+ * @Description: 鉴权预警方案
+-->
+<template>
+    <main class="auth-earlywarning-plan">
+        <el-form ref="ruleForm" inline :rules="rules" :model="form">
+            <el-form-item label="鉴权预警方案名称">
+                <el-input v-model="form.userName.value" placeholder="请输入鉴权预警方案名称" clearable></el-input>
+            </el-form-item>
+            <el-form-item label="方案状态">
+                <dg-select
+                    v-model="form.applyStatus.value"
+                    placeholder="请选择方案状态"
+                    code="DM_APPLY_STATUS"
+                    style="width: 13rem"
+                    clearable
+                >
+                </dg-select>
+            </el-form-item>
+            <el-form-item>
+                <dg-button type="primary" @click="handleSearch" icon="el-icon-search">查询</dg-button>
+                <dg-button type="primary" @click="handleReset" icon="el-icon-refresh-right">重置</dg-button>
+            </el-form-item>
+        </el-form>
+        <Table ref="myTable" :url="tableUrl" :headerData="earlyWarningPlanTable" :condition="form">
+            <dg-table-column fixed="right" label="操作" align="center">
+                <template slot-scope="scope">
+                    <div class="u-table__operation">
+                        <el-tooltip content="详情" effect="dark" placement="top-end">
+                            <i class="el-icon-document" @click="handleViewDetail(scope.row)"></i>
+                        </el-tooltip>
+                        <el-tooltip content="编辑" effect="dark" placement="top-end">
+                            <i class="el-icon-edit" @click="handleViewEdit(scope.row)"></i>
+                        </el-tooltip>
+                    </div>
+                </template>
+            </dg-table-column>
+        </Table>
+    </main>
+</template>
+
+<script>
+import Table from "@/pages/common/table";
+import { earlyWarningPlanTable } from "../DataConfig";
+import { authUserTableUrl } from "@/api/data-auth";
+import detail from "./detail";
+import edit from "./edit";
+export default {
+    name: "auth-earlywarning-plan", // 组件名称
+    props: {
+        // 接收父组件的数据
+    },
+    data() {
+        // 组件内部参数
+        return {
+            // 参数名称及默认值
+            earlyWarningPlanTable,
+            form: {
+                userName: {
+                    value: "",
+                    op: "like"
+                },
+                applyStatus: {
+                    value: "",
+                    op: "="
+                }
+            },
+            rules: {},
+            tableUrl: authUserTableUrl
+        };
+    },
+    computed: {}, // 计算属性
+    watch: {}, // 侦听器(扩展的计算属性)
+    components: { Table }, // 注册局部组件
+    methods: {
+        /**
+         * @description:表单查询
+         */
+        handleSearch() {},
+        /**
+         * @description:表单重置
+         */
+        handleReset() {},
+        /**
+         * @description: 编辑
+         */
+        handleViewEdit(row) {
+            const layer = this.$dgLayer({
+                title: `异常鉴权预警方案修改`,
+                shade: [0.4, "#FFF"],
+                content: edit,
+                props: {
+                    info: row
+                },
+                on: {
+                    success() {
+                        layer.close(layer.dialogIndex);
+                    }
+                },
+                area: ["900px", "500px"]
+            });
+        },
+        /**
+         * @description:详情
+         */
+        handleViewDetail(row) {
+            const layer = this.$dgLayer({
+                title: `异常鉴权预警方案详情`,
+                shade: [0.4, "#FFF"],
+                content: detail,
+                props: {
+                    info: row
+                },
+                on: {
+                    success() {
+                        layer.close(layer.dialogIndex);
+                    }
+                },
+                area: ["900px", "500px"]
+            });
+        }
+    }, // 内部方法
+    beforeCreate() {}, // 组件创建前
+    created() {}, // 组件创建完成后
+    beforeMount() {}, // 组件挂载前
+    mounted() {}, // 组件挂载完成后
+    beforeUpdate() {}, // 组件更新前
+    updated() {}, // 组件挂载完成后
+    beforeDestroy() {}, // 组件销毁前
+    destroyed() {} // 组件销毁完成后
+};
+</script>
+<style lang="scss" scoped></style>

+ 57 - 0
src/pages/log-manage/err-auth-earlywarning-manage/detail.vue

@@ -0,0 +1,57 @@
+<!--
+ * @Author: Liugh
+ * @Date: 2021-05-26 15:09:38
+ * @LastEditTime: 2021-05-26 15:27:40
+ * @LastEditors: Do not edit
+ * @FilePath: \auth-web\src\pages\log-manage\err-auth-earlywarning-manage\detail.vue
+ * @Description: 
+-->
+<template>
+    <main class="auth-earlywarning-plan-detail">
+        <el-form ref="ruleForm" :model="detailInfo" label-width="100px" label-suffix=":">
+            <el-row>
+                <el-col :span="item.span" v-for="(item, index) in earlyWarningPlanTableInfo" :key="index">
+                    <el-form-item :label="item.label">{{ detailInfo[item.value] }} </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+    </main>
+</template>
+
+<script>
+import { earlyWarningPlanTableInfo } from "../DataConfig";
+import { getAuthUserDetail } from "@/api/data-auth";
+import transferBusinessTagMixin from "@/mixins/transfer-business-tag";
+
+export default {
+    name: "auth-earlywarning-plan-detail", // 组件名称
+    props: {
+        // 接收父组件的数据
+        info: Object
+    },
+    mixins: [transferBusinessTagMixin],
+    data() {
+        // 组件内部参数
+        return {
+            earlyWarningPlanTableInfo,
+            detailInfo: {}
+        };
+    },
+    components: {}, // 注册局部组件
+    computed: {},
+    methods: {
+        getDetail() {
+            return new Promise(resolve => {
+                getAuthUserDetail(this.userInfo.id).then(res => {
+                    this.detailInfo = res.data;
+                    resolve(res.data);
+                });
+            });
+        }
+    }, // 内部方法
+    async created() {
+        // await this.getDetail();
+    }
+};
+</script>
+<style lang="scss" scoped></style>

+ 112 - 0
src/pages/log-manage/err-auth-earlywarning-manage/edit.vue

@@ -0,0 +1,112 @@
+<!--
+ * @Author: Liugh
+ * @Date: 2021-05-26 15:09:38
+ * @LastEditTime: 2021-05-26 16:44:01
+ * @LastEditors: Do not edit
+ * @FilePath: \auth-web\src\pages\log-manage\err-auth-earlywarning-manage\edit.vue
+ * @Description: 
+-->
+<template>
+    <main class="auth-earlywarning-plan-edit">
+        <el-form ref="ruleForm" :model="form" label-width="100px" label-suffix=":">
+            <el-row>
+                <el-col :span="24">
+                    <el-form-item label="方案名称">
+                        <el-input clearable placeholder="请输入方案名称" v-model="form.name"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="方案状态">
+                        <dg-select
+                            v-model="form.value"
+                            placeholder="请选择方案状态"
+                            code="DM_APPLY_STATUS"
+                            style="width: 100%"
+                            clearable
+                        >
+                        </dg-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="预警规则">
+                        <!--TODO 内嵌form  -->
+                        <!-- <el-input type="textarea" :rows="2" placeholder="请输入预警规则" v-model="form.textarea"></el-input> -->
+                        <el-form-item
+                            v-for="(domain, index) in form.domains"
+                            :label="'域名' + index"
+                            :key="domain.key"
+                            :prop="'domains.' + index + '.value'"
+                            :rules="{
+                                required: true,
+                                message: '域名不能为空',
+                                trigger: 'blur'
+                            }"
+                        >
+                            <el-input v-model="domain.value"></el-input
+                            ><el-button @click.prevent="removeDomain(domain)">删除</el-button>
+                        </el-form-item>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="规则说明">
+                        <el-input type="textarea" :rows="2" placeholder="请输入规则说明" v-model="form.textarea">
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="预警信息">
+                        <el-input type="textarea" :rows="2" placeholder="请输入预警信息" v-model="form.textarea">
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <!-- <el-col :span="item.span" v-for="(item, index) in earlyWarningPlanTableInfo" :key="index"> -->
+                <!-- <el-form-item :label="item.label">{{ detailInfo[item.value] }} </el-form-item> -->
+                <!-- </el-col> -->
+            </el-row>
+        </el-form>
+    </main>
+</template>
+
+<script>
+import { earlyWarningPlanTableInfo } from "../DataConfig";
+import { getAuthUserDetail } from "@/api/data-auth";
+import transferBusinessTagMixin from "@/mixins/transfer-business-tag";
+
+export default {
+    name: "auth-earlywarning-plan-edit", // 组件名称
+    props: {
+        // 接收父组件的数据
+        info: Object
+    },
+    mixins: [transferBusinessTagMixin],
+    data() {
+        // 组件内部参数
+        return {
+            earlyWarningPlanTableInfo,
+            form: {
+                domains: [
+                    {
+                        value: ""
+                    }
+                ]
+            }
+        };
+    },
+    components: {}, // 注册局部组件
+    computed: {},
+    methods: {
+        getDetail() {
+            return new Promise(resolve => {
+                getAuthUserDetail(this.userInfo.id).then(res => {
+                    this.form = res.data;
+                    resolve(res.data);
+                });
+            });
+        }
+    }, // 内部方法
+    async created() {
+        // await this.getDetail();
+    }
+};
+</script>
+<style lang="scss" scoped></style>

+ 10 - 0
src/pages/log-manage/index.scss

@@ -0,0 +1,10 @@
+/*
+ * @Author: Liugh
+ * @Date: 2021-05-25 14:09:38
+ * @LastEditTime: 2021-05-26 16:09:25
+ * @LastEditors: Do not edit
+ * @FilePath: \auth-web\src\pages\log-manage\index.scss
+ * @Description: 
+ */
+.auth-earlywarning-plan-edit {
+}

+ 3 - 1
src/router/index.js

@@ -14,6 +14,7 @@ let layoutType = getSetting("LAYOUT");
 import userManage from "./modules/user-manage";
 import adminManage from "./modules/admin-manage";
 import logReport from "./modules/log-report";
+import logManage from "./modules/log-manage";
 import applicationManage from "./modules/application-manage";
 import statisticsManage from "./modules/statistics-manage";
 import authorizationManage from "./modules/authorization-manage";
@@ -113,7 +114,8 @@ export const asyncRouterMap = [{
             meta: { title: "动态授权管理", noCache: false, permission: ["YHGLPT_DTSQGL_DTSQGL"] }
         }]
     },
-    ...dataAuthModuleRouter
+    ...dataAuthModuleRouter,
+    logManage
 ];
 
 export default new Router({

+ 44 - 0
src/router/modules/log-manage.js

@@ -0,0 +1,44 @@
+/*
+ * @Author: Liugh
+ * @Date: 2021-05-25 11:19:26
+ * @LastEditTime: 2021-05-27 11:11:50
+ * @LastEditors: Do not edit
+ * @FilePath: \auth-web\src\router\modules\log-manage.js
+ * @Description: 日志管理模块
+ */
+import Layout from "@/pages/layout/layout";
+import common from "@/pages/common";
+// const Layout = () => import("@/pages/" + process.env.LAYOUT + "/layout");
+
+const componentsRouter = {
+    path: "/log-manage",
+    component: Layout,
+    redirect: "/log-manage",
+    alwaysShow: true,
+    meta: { title: "日志管理", icon: "el-icon-document-checked", noCache: true, permission: ["YHGLPT_RZSJGL"] },
+    children: [
+        {
+            path: "/err-auth-earlywarning-manage",
+            component: common,
+            name: "common",
+            redirect: "/err-auth-earlywarning-manage",
+            alwaysShow: true,
+            meta: { title: "异常鉴权预警管理", icon: "el-icon-goods", noCache: true, permission: ["YHGLPT_RZSJGL"] },
+            children: [
+                {
+                    path: "auth-earlywarning-plan",
+                    component: () => import("@/pages/log-manage/err-auth-earlywarning-manage/auth-earlywarning-plan"),
+                    name: "auth-earlywarning-plan",
+                    meta: {
+                        title: "鉴权预警方案",
+                        noCache: false,
+                        permission: ["YHGLPT_RZSJGL"]
+                        // layout: "page"
+                    }
+                }
+            ]
+        }
+    ]
+};
+
+export default componentsRouter;