Authored by 鲁尚清

Merge branch 'master-500-dev' of http://192.168.1.136:82/monitor_v3/hg-monitor-w…

…eb into master-500-dev-lushangqing
... ... @@ -4840,20 +4840,27 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
{field: 'state', title: '资源状态', width: 110, align: 'center', sort: true, templet: '#resStateTpl'}
],
"DATABASE_KINGBASE": [
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
{field: 'ip', title: 'IP地址', minWidth: x_130, align: 'center', sort: true},
{
field: 'resName', title: '资源名称', width: resNameWidth, sort: true,
templet: '<div><span data-zymc="{{ d.resId }}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-childrennum="{{d.childrenNum}}" data-ip="{{ d.ip }}" data-resTypeName="{{ d.resTypeName }}" data-admin="{{ d.admin }}" data-adminName="{{ d.adminName }}" data-pingenable="{{d.pingEnable}}" class="layui-table-link">{{ d.resName }}</span></div>'
field: 'resName', title: '资源名称', minWidth: x_330, sort: true,
templet: '#resindex_resName'
},
// {field: 'shortName', title: '别名', width: 100, align: 'center', sort: true, templet:'#shortNameTpl'},
{field: 'resTypeName', title: '资源类型', width: 101, align: 'center'},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 105, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', width: 100, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 151, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 100, templet: '#linkStateTpl', sort: true}
],
{field: 'resTypeName', title: '资源类型', minWidth: x_120, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_130, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_140, align: 'center', sort: true},
{field: 'state', title: '资源状态', minWidth: x_110, align: 'center', sort: true, templet: '#resStateTpl'},
{field: 'health', title: '健康状态', minWidth: x_110, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
{
field: 'linkState',
title: '连接状态',
align: 'center',
minWidth: x_110,
templet: '#linkStateTpl',
sort: true
}
]
},
/**
* 验证是否跳转详情页
... ...
... ... @@ -178,7 +178,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
var $html = addIconByValue(valueStr);
var resStyle = obj.alarmEleMatchStyle(v.flag, v.id);
li += ' <li><span ' + menuId + ' style="text-align:left;width:40%">' + v.name + '</span>' +
'<span title="' + titleStr + '" style="' + fontColor + 'width:60%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' + resStyle + '">'
'<span title="' + titleStr + '" style="' + fontColor + 'width:60%;overflow: hidden !important;text-overflow: ellipsis;white-space: nowrap !important;' + resStyle + '">'
+ $html + valueStr + '</span></li>'
});
$("#" + targetId).html(li);
... ...
... ... @@ -27,7 +27,6 @@
<el-image style="width: 50%; height: 50%;border-radius: 10px;" :src="domainName+row.code"
:preview-src-list="[domainName+row.code]"
:initial-index="1"
:z-index="99999999999999"
:preview-teleported="true"
fit="cover"/>
</div>
... ...
... ... @@ -4,24 +4,7 @@ export default {
components: {},
data() {
return {
radio: '0',
docRulesForm: {
name: [{
required: true,
message: '请填写名称!',
trigger: 'blur'
}],
code: [{
required: true,
message: '请填写编码!',
trigger: 'blur'
}],
groupId: [{
required: true,
message: '请填写组Id!',
trigger: 'blur'
}]
}
radio: '0'
}
},
props: {},
... ... @@ -173,6 +156,7 @@ export default {
uploadFile:''
};
cacheVisible.value = true;
isAdd.value = true;
}
//关闭弹框
let cancelBtn = () => {
... ... @@ -185,30 +169,58 @@ export default {
fileFrom.value = row;
isAdd.value = false;
}
//表单规则校验
let docRulesForm = Vue.ref({
name: [{
required: true,
message: '请填写名称!',
trigger: 'blur'
}],
code: [{
required: true,
message: '请填写编码!',
trigger: 'blur'
}],
groupId: [{
required: true,
message: '请填写组Id!',
trigger: 'blur'
}]
});
// 新增
let addFrom = () => {
let params = fileFrom.value;
if (isAdd.value){
proxy.$http.uploadFile("/api-web/file/add", params, function (res) {
hasRefresh.value = false;
if (res && res.success) {
proxy.$global.showMsg("新增成功!");
cacheVisible.value = false;
getDataList();
}
})
}else {
proxy.$http.uploadFile("/api-web/file/update", params, function (res) {
hasRefresh.value = false;
if (res && res.success) {
proxy.$global.showMsg("修改成功!");
cacheVisible.value = false;
getDataList();
proxy.$refs.ruleForm.validate((valid) => {
if (valid) {
if (isAdd.value){
proxy.$http.uploadFile("/api-web/file/add", params, function (res) {
hasRefresh.value = false;
if (res && res.success) {
proxy.$global.showMsg("新增成功!");
cacheVisible.value = false;
getDataList();
}
})
}else {
proxy.$global.showMsg(res.msg,'warning');
proxy.$http.uploadFile("/api-web/file/update", params, function (res) {
hasRefresh.value = false;
if (res && res.success) {
proxy.$global.showMsg("修改成功!");
cacheVisible.value = false;
getDataList();
}else {
proxy.$global.showMsg(res.msg,'warning');
}
})
}
}else {
return false;
}
})
})
}
}
//重新加载表格数据
... ... @@ -244,7 +256,8 @@ export default {
handleUpdate,
isAdd,
titleName,
loadTableDataList
loadTableDataList,
docRulesForm
}
}
}
... ...
... ... @@ -11,44 +11,38 @@
<el-button :size="$global.elementConfig.size.button" @click="handleAdd()">新增</el-button>
</div>
<div class="search-table">
<el-table
:data="tableData"
style="width: 100%;margin: 0px 0px;"
row-key="id"
border
:tree-props="{ children: 'children'}"
header-row-class-name="tbl-header-class">
<el-table-column prop="name" label="第三方系统" sortable=true align="center" width="350" >
<template #default="scope">
<el-tag effect="light" v-if="scope.row.type == 'user'">
<i class="iconfont icon-haoyou" /> {{scope.row.name}}
<cm-table-page :columns="columns" :dataList="tableData" :height="(height - 130)"
:loading="false" :pageSize="pageSize" :showBorder="true"
:showIndex="true" :showPage="true" :showSelection="false"
:showTools="true" :total="count" @loaddata="loadTableDataList" :toolsWith="120">
<template #default="{row,prop,column}">
<div v-if="prop == 'auth'">
<el-tag
v-for="tag in row.authorizeList"
:key="tag"
class="mx-1"
closable
:disable-transitions="false"
@close="handleClose(tag)"
>
{{tag.nickName}}
</el-tag>
<el-tag effect="light" v-if="scope.row.type == 'role'">
<i class="iconfont icon-jiaoseguanli" /> {{scope.row.name}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="detail" label="系统请求地址" sortable=true align="center" />
<el-table-column prop="sort" label="排序" sortable=true align="center" width="100" />
<el-table-column prop="createTime" label="创建时间" sortable=true align="center"width="300" />
<el-table-column fixed="right" label="操作" width="150" align="center">
<template #default="scope">
<div class="list-handle">
<span class="icon-bg" v-if="scope.row.type == '0'">
<i @click="handleAuth(scope.row)" class="iconfont icon-icon--quanxian" title="授权"></i>
</span>
<span class="icon-bg" v-if="scope.row.type == '0'">
<i @click="handleUpdate(scope.row)" class="el-icon-edit-outline" title="修改"></i>
</span>
<span class="icon-bg">
<i @click="handleDelete(scope.row)" class="el-icon-delete" title="删除"></i>
</span>
</div>
</template>
</el-table-column>
</el-table>
</div>
</template>
<template #tools="{scope}">
<div class="list-handle">
<span class="icon-bg" v-if="scope.row.type == '0'">
<i @click="handleAuth(scope.row)" class="iconfont icon-icon--quanxian" title="授权"></i>
</span>
<span class="icon-bg" v-if="scope.row.type == '0'">
<i @click="handleUpdate(scope.row)" class="el-icon-edit-outline" title="修改"></i>
</span>
<span class="icon-bg">
<i @click="handleDelete(scope.row)" class="el-icon-delete" title="删除"></i>
</span>
</div>
</template>
</cm-table-page>
</div>
... ... @@ -77,8 +71,8 @@
<el-form-item label="请求地址" prop="detail">
<el-input :size="$global.elementConfig.size.input" placeholder="请输入请求地址或事件" clearable v-model="confAdd.detail"></el-input>
</el-form-item>
<el-form-item label="排序" prop="detail">
<el-input :size="$global.elementConfig.size.input" placeholder="请输入排序" clearable v-model="confAdd.sort"></el-input>
<el-form-item label="排序" prop="sort">
<el-input type="number" :size="$global.elementConfig.size.input" placeholder="请输入排序" clearable v-model="confAdd.sort"></el-input>
</el-form-item>
<el-form-item>
... ...
... ... @@ -3,23 +3,6 @@ export default {
template:"",
data() {
return {
docRulesForm: {
name: [{
required: true,
message: '请填写系统名称!',
trigger: 'blur'
}],
detail: [{
required: true,
message: '请填写请求地址或事件!',
trigger: 'blur'
}],
sort: [{
required: true,
message: '请填写排序!',
trigger: 'blur'
}]
}
}
},
setup(props,{attrs,slots,emit}){
... ... @@ -46,6 +29,41 @@ export default {
let userFileRight = Vue.ref([]);
//获取用户
let userList = Vue.ref([]);
let columns = Vue.ref([
{
prop: 'name',
label: '第三方系统',
sortable: true,
width: '300',
align: 'center'
},
{
prop: 'detail',
label: '系统请求地址',
sortable: true,
align: 'center'
},
{
prop: 'auth',
label: '授权用户(角色)',
sortable: true,
align: 'center'
},
{
prop: 'sort',
label: '排序',
sortable: true,
align: 'center',
width: '120'
},
{
prop: 'createTime',
label: '创建时间',
sortable: true,
align: 'center',
width: '170'
}
])
// 获取系统
... ... @@ -53,29 +71,6 @@ export default {
proxy.$http.get(`/api-web/thirdParty/conf/list`, {keywords:keyword.value}, function (res) {
if (res && res.success == true) {
tableData.value = res.data;
tableData.value.forEach(function (e) {
let report = {}
let authUser = e.authorizeList;
let authRole = e.authorizeRoleList;
let children = [];
if(authUser){
authUser.forEach((v) => {
children.push({id:v.id,type:'user',name:v.nickName,code:v.userName});
})
}
if(authRole){
authRole.forEach((v) => {
children.push({id:v.id,type:'role',name:v.roleName,code:v.id});
})
}
e.children = children;
report.label = e.name;
report.value = e.id;
options.value.push(report)
});
}
})
};
... ... @@ -146,15 +141,6 @@ export default {
proxy.$http.get("/api-user/org/getOrgUserList?orgCode=xxzx", {}, function (res) {
if (res && res.data) {
res.data.map(function (v) {
let desc = [];
let orgName = v.orgName;
let nickname = v.nickname;
if (orgName) {
desc.push(orgName);
}
if (nickname) {
desc.push(nickname);
}
proxy.userList.push({
value: v.username,
type: 'USER',
... ... @@ -185,28 +171,53 @@ export default {
}
}
let docRulesForm = Vue.ref({
name: [{
required: true,
message: '请填写系统名称!',
trigger: 'blur'
}],
detail: [{
required: true,
message: '请填写请求地址或事件!',
trigger: 'blur'
}],
sort: [{
required: true,
message: '请填写排序!',
trigger: 'blur'
}]
});
// 新增或修改配置
let handleConfAdd = () => {
let url = '';
let msg = '';
if (isAdd.value){
url='/api-web/thirdParty/conf/add';
msg='新增成功'
}else {
url='/api-web/thirdParty/conf/update';
msg='修改成功'
}
proxy.$http.post(url, confAdd.value, function (res) {
if (res && res.success){
proxy.$global.showMsg(msg,'success');
cacheVisible.value = false;
getDetailList();
proxy.$refs.ruleForm.validate((valid) => {
if (valid) {
if (isAdd.value){
url='/api-web/thirdParty/conf/add';
msg='新增成功'
}else {
url='/api-web/thirdParty/conf/update';
msg='修改成功'
}
proxy.$http.post(url, confAdd.value, function (res) {
if (res && res.success){
proxy.$global.showMsg(msg,'success');
cacheVisible.value = false;
getDetailList();
}else {
proxy.$global.showMsg(res.msg,'warning');
}
})
}else {
proxy.$global.showMsg(res.msg,'warning');
return false;
}
})
}
// 删除
let handleDelete = (row) => {
... ... @@ -233,6 +244,10 @@ export default {
})
})
}
//删除标签授权
let handleClose = (tag) => {
handleDelete(tag);
}
let handleUpdate = (row) =>{
cacheVisible.value = true;
isAdd.value = false;
... ... @@ -240,6 +255,7 @@ export default {
confAdd.value.id = row.id;
confAdd.value.name = row.name;
confAdd.value.detail = row.detail;
confAdd.value.sort = row.sort;
}
//关闭弹框
... ... @@ -275,7 +291,10 @@ export default {
showUserDialogVisible,
selectUser,
userFileRight,
userList
userList,
columns,
handleClose,
docRulesForm
}
}
}
... ...