Commit 72566ef3 authored by 张耀's avatar 张耀

Merge branch 'dev' into zy

parents f8fe0a25 6a0a1390
...@@ -126,8 +126,6 @@ export default { ...@@ -126,8 +126,6 @@ export default {
this.readFlag = !this.readFlag; this.readFlag = !this.readFlag;
}, },
initMsg() { initMsg() {
console.log(this.userInfo);
console.log(this.$trace);
if (this.userInfo && this.userInfo.system_id) { if (this.userInfo && this.userInfo.system_id) {
this.$trace.setOptionValue("userId", this.userInfo.system_id); this.$trace.setOptionValue("userId", this.userInfo.system_id);
// this.$trace.setOptionValue('userType',this.userInfo.userType) // this.$trace.setOptionValue('userType',this.userInfo.userType)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
ref="table" ref="table"
class="bg-table" class="bg-table"
:data="rows" :data="rows"
:border="border"
@selection-change="selectAction" @selection-change="selectAction"
@select="selectActionRow" @select="selectActionRow"
@select-all="selectActionAll" @select-all="selectActionAll"
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
<div class="text">暂无数据</div> <div class="text">暂无数据</div>
</div> </div>
</template> </template>
<el-table-column v-if="paddingLeft > 10" :width="paddingLeft - 10"></el-table-column> <el-table-column v-if="paddingLeft > 10 && !border" :width="paddingLeft - 10"></el-table-column>
<el-table-column type="selection" :selectable="selectable" width="38" v-if="select"> <el-table-column type="selection" :selectable="selectable" width="38" v-if="select">
<!-- checkbox --> <!-- checkbox -->
</el-table-column> </el-table-column>
...@@ -84,6 +85,10 @@ const props = defineProps({ ...@@ -84,6 +85,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
border: {
type: Boolean,
default: false,
},
paddingLeft: { paddingLeft: {
type: [Number, String], type: [Number, String],
default: () => 12, default: () => 12,
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</div> </div>
</div> </div>
<div class="person-menu" v-if="userInfo && userInfo.system_id"> <div class="person-menu">
<!-- 用户中心 --> <!-- 用户中心 -->
<div class="user-center nav-item"> <div class="user-center nav-item">
<span class="user-icon"> <span class="user-icon">
...@@ -86,14 +86,14 @@ ...@@ -86,14 +86,14 @@
style="width: 24px; height: 24px; border-radius: 50%; vertical-align: middle" style="width: 24px; height: 24px; border-radius: 50%; vertical-align: middle"
src="../assets/imgs/home_ic_user.png" /> src="../assets/imgs/home_ic_user.png" />
</span> </span>
<span v-if="userInfo && userInfo.system_id" class="user-name"> <span v-if="userInfo" class="user-name">
{{ userInfo.system_account || userInfo.system_id }} {{ userInfo.system_account }}
<bg-icon icon="#bg-ic-arrow-down" style="font-size: 8px; margin-left: 3px" /> <bg-icon icon="#bg-ic-arrow-down" style="font-size: 8px; margin-left: 3px" />
</span> </span>
<span v-else class="user-name"> 请登录 </span> <span v-else class="user-name"> 请登录 </span>
<div class="menu-virtual"></div> <div class="menu-virtual"></div>
<div v-if="userInfo && userInfo.system_id" class="menu-list"> <div v-if="userInfo" class="menu-list">
<div <div
v-for="(item, index) in systemMenu" v-for="(item, index) in systemMenu"
:key="index + 700" :key="index + 700"
...@@ -179,14 +179,9 @@ export default { ...@@ -179,14 +179,9 @@ export default {
return temp; return temp;
}, },
systemMenu(state) { systemMenu(state) {
const { is_admin } = state.userInfo;
let temp = []; let temp = [];
state.menu?.forEach((e) => { state.menu?.forEach((e) => {
if (e.dict_group_id == "26d3903a-863e-4efc-b53e-0fb8772ddaa4") { if (e.dict_group_id == "26d3903a-863e-4efc-b53e-0fb8772ddaa4") {
// 业务系统用户和组织管理员配置了后台管理,将其隐藏
if (is_admin < 3 && e.menuName === "管理中心") {
return;
}
temp.push(e); temp.push(e);
} }
}); });
......
...@@ -153,7 +153,7 @@ const getUser = () => { ...@@ -153,7 +153,7 @@ const getUser = () => {
store.commit("setMenuObj", menuObj); store.commit("setMenuObj", menuObj);
// } // }
generateRoutes(); generateRoutes();
router.push("/"); router.push("/forewarning/list");
} }
}); });
}; };
......
...@@ -3,9 +3,54 @@ ...@@ -3,9 +3,54 @@
<bg-breadcrumb></bg-breadcrumb> <bg-breadcrumb></bg-breadcrumb>
<div class="main_container"> <div class="main_container">
<bg-form-gap title="基本信息"></bg-form-gap> <bg-form-gap title="基本信息"></bg-form-gap>
<bg-detail-table2 style="width: 1076px" :list="state.baseInfo">
<template #status>
<span> <i class="use"></i> 启用 </span>
</template>
</bg-detail-table2>
<bg-form-gap title="执行脚本"></bg-form-gap> <bg-form-gap title="执行脚本"></bg-form-gap>
<div style="height: 260px; margin-bottom: 20px; width: 1076px">
<bg-code-editor v-model="state.useText"></bg-code-editor>
</div>
<div class="file-box">
<bg-icon icon="#bg-ic-c-file-data"></bg-icon>&nbsp;&nbsp; 文件.yml
<el-button type="primary" @click="downloadFile(url)"
><bg-icon icon="#bg-ic-to-bottom"></bg-icon>&nbsp;&nbsp;下载</el-button
>
</div>
<bg-form-gap title="执行主机"></bg-form-gap> <bg-form-gap title="执行主机"></bg-form-gap>
<bg-table
class="pc-box input_table"
:headers="state.pcHeaders"
:rows="state.pcTableRows"
:border="true"
:isIndex="true">
<template v-slot:account="{ row }">
<span>
{{ row.account }}
</span>
</template>
</bg-table>
<bg-form-gap title="任务历史"></bg-form-gap> <bg-form-gap title="任务历史"></bg-form-gap>
<bg-table style="width: 1076px" :headers="state.historyHeaders" :rows="state.historyTableRows" :stripe="true">
<template v-slot:state="{ row }">
<span>
{{ row.state }}
</span>
</template>
</bg-table>
<div style="width: 1076px" v-if="state.tableTotal > 10">
<bg-pagination
:page="state.filter.page"
:size="state.filter.size"
:total="state.tableTotal"
@change-page="changePage"
@change-size="changeSize">
</bg-pagination>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -17,12 +62,179 @@ import { ElMessage } from "element-plus"; ...@@ -17,12 +62,179 @@ import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue"; import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const state = reactive({ data: 1 }); const state = reactive({
const { data } = toRefs(state); baseInfo: [
{
label: "预警规则名称",
value: "服务中断推送规则1",
},
{
label: "启用状态",
value: "启用",
childSlot: "status",
},
{
label: "预警对象",
value: "容器云",
},
{
label: "预警分类",
value: "容器集群",
},
{
label: "创建人",
value: "admin",
},
{
label: "创建时间",
value: "2023-08-19 23:22:22",
},
{
label: "更新时间",
value: "2023-08-19 23:22:22",
},
{
label: "预警指标",
value: "CPU使用率",
},
],
useText: "",
historyHeaders: [
{
label: "状态",
prop: "state",
},
{
label: "执行说明",
prop: "desc",
},
{
label: "执行开始时间",
prop: "begin",
},
{
label: "执行耗时",
prop: "time",
},
{
label: "操作人",
prop: "person",
},
],
historyTableRows: [],
filter: {
page: 1,
size: 10,
},
tableTotal: 0,
pcHeaders: [
{
label: "账号",
prop: "account",
},
{
label: "端口",
prop: "port",
},
],
pcTableRows: [
{
account: "asasdd",
port: "8080",
},
{
account: "asasdd",
port: "8080",
},
],
});
const downloadFile = () => {};
const changePage = (page) => {
state.filter.page = page;
getTableRows();
};
const changeSize = (size) => {
state.filter.limit = size;
changePage(1);
};
const getTableRows = () => {};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main_container { .main_container {
padding: 24px 32px; padding: 24px 32px;
display: block;
}
.use {
width: 6px;
height: 6px;
display: inline-block;
vertical-align: middle;
border-radius: 50%;
background-color: #48ad97;
}
.file-box {
width: 1076px;
height: 48px;
line-height: 48px;
background-color: #fafafa;
border-radius: 4px;
font-size: 14px;
color: #202531;
padding: 0 12px;
margin-bottom: 20px;
.bg-icon {
font-size: 24px;
vertical-align: middle;
}
.el-button {
float: right;
margin-top: 6px;
.bg-icon {
font-size: 10px;
}
}
}
.vue-ace-editor {
margin-top: 0;
}
.pc-box {
width: 1076px;
margin-bottom: 20px;
}
.input_table {
:deep() {
.el-table__header {
th {
background-color: #f5f6f9;
border-color: #dadee7;
border-top: 1px solid #dadee7 !important;
&:first-child {
border-left: 1px solid #dadee7;
}
&:last-child {
border-right: 1px solid #dadee7;
}
}
}
.el-scrollbar {
border-radius: 0px;
}
.el-table__border-left-patch {
width: 0;
}
.el-table__inner-wrapper .el-table__row td:nth-of-type(1) {
border-left: 1px solid #dadee7;
}
}
} }
</style> </style>
...@@ -907,7 +907,7 @@ markdown-it@^13.0.1: ...@@ -907,7 +907,7 @@ markdown-it@^13.0.1:
mavon-editor@^3.0.1: mavon-editor@^3.0.1:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/mavon-editor/-/mavon-editor-3.0.1.tgz#0c2660569ded5b29e59d0e429af61eb618783a90" resolved "https://registry.npmmirror.com/mavon-editor/-/mavon-editor-3.0.1.tgz#0c2660569ded5b29e59d0e429af61eb618783a90"
integrity sha512-973cYCwv+AB+fcecsU6Ua6UXATxDMaY0Q7QzKQ/GmRW1sg+3DolZDnCGXth7XHDgrmqKTO57N42fVYujt0wfFw== integrity sha512-973cYCwv+AB+fcecsU6Ua6UXATxDMaY0Q7QzKQ/GmRW1sg+3DolZDnCGXth7XHDgrmqKTO57N42fVYujt0wfFw==
dependencies: dependencies:
xss "^1.0.10" xss "^1.0.10"
...@@ -1085,7 +1085,7 @@ ssr-window@^3.0.0-alpha.1: ...@@ -1085,7 +1085,7 @@ ssr-window@^3.0.0-alpha.1:
string-format@^2.0.0: string-format@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" resolved "https://registry.npmmirror.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b"
integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==
supports-preserve-symlinks-flag@^1.0.0: supports-preserve-symlinks-flag@^1.0.0:
...@@ -1168,7 +1168,7 @@ vue-demi@*: ...@@ -1168,7 +1168,7 @@ vue-demi@*:
vue-demi@^0.14.5: vue-demi@^0.14.5:
version "0.14.5" version "0.14.5"
resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.5.tgz#676d0463d1a1266d5ab5cba932e043d8f5f2fbd9" resolved "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.5.tgz#676d0463d1a1266d5ab5cba932e043d8f5f2fbd9"
integrity sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA== integrity sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==
vue-i18n@^9.1.7: vue-i18n@^9.1.7:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment