Authored by 王涛

Merge branch 'master-V32-XuHaoJie' into 'master'

通用-端口侦测-前端开发



See merge request !328
... ... @@ -472,6 +472,27 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
}
})
//端口侦测
$("#resManagePostSense").unbind().on("click", function () {
//获取资源ids
var data = table.checkStatus('resManageTable').data;
var resIds = [];
$.each(data, function (i, e) {
resIds.push(e.resId)
})
if (data.length <= 0) {//不传参
layer.open({
type: 1
, title: '端口侦测'
, closeBtn: 1
, area: ['90%', '80%']
, id: 'lay_port_sense' //设定一个id,防止重复弹出
, content: '<iframe src="/vue3/index.html#/vue3/portSense" frameborder="0" class="layadmin-iframe"/>' //支持传入html
});
}else{//传参
}
})
function openResManageCollHtml(callback){
if(data.length<=0){
layer.msg("请选择资源", { offset: '15px' , icon: 7 , time: 1500 });
... ...
... ... @@ -89,6 +89,7 @@
<button id="res_relation_config" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon">&#xe630;</i>关系配置</button>
<div class="right-btns" style="float: right">
<button id="btn-resManageImport" type="button" class="hide"></button>
<button id="resManagePostSense" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon">&#xe631;</i>端口侦测</button>
<button id="resManageImport" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon">&#xe681;</i>导入</button>
<button id="resManageExportExcel" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon layui-icon-export"></i>导出资源</button>
<button id="resManageDownloadTemp" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon">&#xe601;</i>下载模板</button>
... ...
... ... @@ -121,7 +121,6 @@ export default {
proxy.$http.get("/api-web/home/business/findAllBusType", {}, function(res) {
if (res && res.data) {
that.list = res.data;
console.log("getTree:",that.list);
}
})
},
... ...
... ... @@ -121,7 +121,6 @@ export default {
proxy.$http.get("/api-web/manage/kpi/list", {}, function(res) {
if (res && res.data) {
that.list = res.data;
console.log("getTree:",that.list);
}
})
},
... ...
... ... @@ -121,7 +121,6 @@ export default {
proxy.$http.get("/api-web/home/resType/getTree?typeParentFlag=1", {}, function(res) {
if (res && res.data) {
that.list = res.data;
console.log("getTree:",that.list);
}
})
},
... ...
... ... @@ -95,7 +95,6 @@ export default {
let pageSize = Vue.ref(props.pageSize);
// let multipleSelection=Vue.ref([]);
/**
* 获取宽度
* <p>
... ... @@ -187,7 +186,7 @@ export default {
let toggleSelection=(rows)=> {
console.log("rows",rows)
proxy.$nextTick(function () {
console.log("set",props.dataList,props.multipleSelection)
//console.log("set",props.dataList,props.multipleSelection)
if (rows) {
rows.forEach(row => {
... ...
... ... @@ -27,6 +27,11 @@ const routes = [{
path: '/assets/configmanager',
name: 'configmanager',
component: () => myImport('views/assets/configmanager/index')
},
{
path: '/vue3/portSense',
name: 'portSense',
component: () => myImport('views/portSense/index')
}
];
... ...
<div>
<el-row>
<el-col :span="24">
<div class="set-add-div">
<el-row>
<el-col :span="24">
<div class="flex-div-start margin-top-bottom-10">
<el-input style="width:160px;" class="margin-right-10" v-model="keyWords"
placeholder="输入关键字"/>
<div class="flex-div-start">
<el-button type="primary" @click="onReset()">重置</el-button>
<el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button>
</div>
<!-- <el-select v-model="busTypeArr" multiple filterable clearable collapse-tags-->
<!-- placeholder="请选择业务">-->
<!-- <el-option-->
<!-- v-for="item in busTypeList"-->
<!-- :label="item.busTypeName" :value="item.busId"></el-option>-->
<!-- </el-select>-->
<el-dropdown style="margin-top: -15px;margin-left: 10px;">
<el-icon class="el-icon--right">
<arrow-down/>
</el-icon>
<cm-biz-type-tree-input multiple clearable collapseTags @callback="getBizType"/>
</el-dropdown>
<el-dropdown style="margin-top: -15px;margin-left: 10px;">
<el-icon class="el-icon--right">
<arrow-down/>
</el-icon>
<cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>
</el-dropdown>
</div>
</el-col>
</el-row>
<el-row class="margin-bottom-50">
<el-col :span="24" class="table-height">
<cm-table-page v-if="portSenseData" :columns="columns"
:dataList="portSenseData"
:total="count"
:pageSize="pageSize"
@loaddata="loadTableDataList"
@selectionChange="selectionChange"
:showIndex="true"
:showSelection="true"
:showBorder="true"
:loading="false"
:showPage="true"
:showTools="true"
:height="(height - 500)">
<template #tools="{scope}">
<el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">
删除
</el-button>
</template>
</cm-table-page>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
<!-- <div class="margin-top btn-faultDiagnosis flex-center position-bottom">-->
<!-- <el-button @click="cancleList">取消</el-button>-->
<!-- &lt;!&ndash; <el-button @click="saveList" type="primary">保存</el-button>&ndash;&gt;-->
<!-- </div>-->
</div>
<!--<div id="ssss">-->
<!-- {{ portSenseData[0] }}-->
<!-- {{columns}}-->
<!--</div>-->
\ No newline at end of file
... ...
export default {
name: 'portSense',
template: '',
components: {},
data() {
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
const columns = [
{
prop: 'resName',
label: '资源名称',
sortable: true,
align: 'center',
},
{
prop: 'ip',
label: 'ip地址',
sortable: true,
align: 'center',
},
{
prop: 'resTypeName',
label: '资源类型',
sortable: true,
align: 'center',
},
{
prop: 'lastCollTime',
label: '最近采集时间',
sortable: true,
align: 'center',
},
{
prop: 'linkState',
label: '连接状态',
sortable: true,
align: 'center',
}
];
//配置列表总数
let count = Vue.ref(0);
//搜索关键字
let keyWords = Vue.ref('');
//列表数据
let portSenseData = Vue.ref([{resName:'123',ip:'1.2.3.4'}]);
//资源类型数据
let resTypeArr = Vue.ref([]);
//业务类型数据
let busTypeArr = Vue.ref([]);
//业务类型
let busTypeList = Vue.ref([]);
//资源类型数据
let resIdArr = Vue.ref([]);
//列表高度
let height = Vue.ref(window.innerHeight - 150);
//列表分页
let pageSize = Vue.ref(50);
let init = () => {
proxy.$http.get("/api-web/home/business/findAllBusType", {}, function (res) {
if (res && res.data) {
busTypeList.value = res.data;
}
})
}
// 挂载完
Vue.onMounted(() => {
init();
getListData();
})
//定义列表参数
let getParams = Vue.ref({
keyWords: keyWords.value,
resTypes: resTypeArr.value.join(','),
resIds: resIdArr.value.join(','),
busIds: busTypeArr.value.join(','),
page: 1,
limit: pageSize
})
//获取列表数据
const getListData = () => {
proxy.$http.get("/api-web/bResourceExtendParam/page", getParams.value, function (res) {
if (res && res.data) {
// portSenseData.value = res.data;
// count.value = res.count;
}
})
}
// 点击按钮搜索
let onBtnSearch = () => {
loadTableDataList({page: 1, limit: pageSize});
}
// 重置
let onReset = () => {
keyWords.value = '';
resTypeArr.value = '';
resIdArr.value = '';
busTypeArr.value = '';
}
//获取资源类型
let getResType = (arr) => {
let types = arr.map(function (v) {
return v.id;
});
resTypeArr.value = types;
loadTableDataList({page: 1, limit: pageSize});
}
//获取业务系统
let getBizType = (arr) => {
let types = arr.map(function (v) {
return v.busId;
});
busTypeArr.value = types;
loadTableDataList({page: 1, limit: pageSize});
}
//表格全选事件
let selectionChange = (val) => {
proxy.portSenseData.map((v, i) => {
v.checked = false;
});
let selectData = val;
if (selectData.length > 0) {
selectData.map((item, index) => {
proxy.portSenseData.map((v, i) => {
if (item.id == v.id) {
v.checked = true;
}
})
})
} else {
proxy.portSenseData.map((v, i) => {
v.checked = false;
})
}
}
//删除单个数据
let deleteItem = (row, index) => {
let that = this;
this.$global.confirm("确认删除吗?", function () {
deleteItems = (that, [row.resId]);
})
}
//删除多个或单个
let deleteItems = (that, list) => {
let params = {
redIds: list.toString()
}
that.$http.get('/api-web/bResourceExtendParam/delete', params, function (res) {
if (res) {
that.$global.showMsg('删除成功');
loadTableDataList({page: 1, limit: pageSize});
}
// that.$emit('callbackDelete', item)
})
}
//重新加载表格数据
let loadTableDataList = ({page, limit}) => {
getParams.page = page;
getParams.pageSize = limit;
getListData();
}
return {
count,
portSenseData,
columns,
height,
pageSize,
keyWords,
resTypeArr,
busTypeArr,
busTypeList,
selectionChange,
deleteItem,
onBtnSearch,
onReset,
getListData,
loadTableDataList,
getResType,
getBizType,
}
}
}
\ No newline at end of file
... ...
... ... @@ -378,7 +378,6 @@ export default {
*/
// 保存用户信息
let saveUser = () => {
debugger
proxy.$refs.rule.validate((valid) => {
if (valid) {
console.log('submit!!');
... ...
... ... @@ -140,6 +140,11 @@ const routes = [{
name: 'diagnosisDoc',
component: () => myImport('views/faultDiagnosis/components/diagnosisDoc/index')
}*/
,{
path: '/vue3/portSense',
name: 'portSense',
component: () => myImport('views/portSense/index')
}
];
// hash模式: createWebHashHistory
... ...