Authored by CN守护者

Merge branch 'master' of http://192.168.1.136:82/monitor_v3/hg-monitor-web into wuhl-master

# Conflicts:
#	hg-monitor-web-zj/src/main/resources/static/vue3/src/router/index.js
Showing 37 changed files with 3903 additions and 524 deletions
<el-dialog :top="top" :title="title" v-model="show" custom-class="config-dialog"
:fullscreen="fullscreen" :show-close="showFooter"
:fullscreen="fullscreen" :show-close="showFooter" @close="hideElDialog"
:width="width" destroy-on-close @before-close="hideElDialog" :close-on-click-modal="false" :close-on-press-escape="false">
<slot>弹框内容</slot>
<template #footer v-if="showFooter">
<span class="dialog-footer">
<el-button @click="hideElDialog">{{cancelText}}</el-button>
<el-button type="primary" @click="okFunc">{{okText}}</el-button>
<el-button @click="hideElDialog" v-if="showCancelBtn">{{cancelText}}</el-button>
<el-button type="primary" @click="okFunc" v-if="showOkBtn">{{okText}}</el-button>
</span>
</template>
</el-dialog>
... ...
... ... @@ -15,11 +15,21 @@ export default {
type: String,
default: "新建"
},
// 展示取消按钮
showCancelBtn: {
type: Boolean,
default: true
},
// 取消文本
cancelText: {
type: String,
default: "取消"
},
// 展示确定按钮
showOkBtn: {
type: Boolean,
default: true
},
// 确定文本
okText: {
type: String,
... ...
... ... @@ -6,10 +6,9 @@
<div style="text-align: left;padding-left: 10px;padding-top: 3px;font-weight: bold">
<el-link type="info" :underline="false"><i class="iconfont icon-ziliaoku"></i> 文档管理</el-link>
</div>
<!--:default-expanded-keys="[currentNodeData.id]"-->
<!---->
<el-tree ref="tree" style="padding:6px;" :props="props" :data="treeData" node-key="id"
:expand-on-click-node="false" :expand-on-click-node="true"
>
:expand-on-click-node="false" :expand-on-click-node="true" :default-expanded-keys="defaultExpandedKeys">
<template #default="{ node, data }">
<div style="display: flex;flex-direction: row;width: 100%;">
<div style="width: calc(100% - 85px);max-width: calc(100% - 85px);overflow: hidden;text-overflow: ellipsis;text-align: left;" @click="nodeClick(node, data)" :title="node.label">
... ...
... ... @@ -9,7 +9,7 @@ export default {
// 展示文档类型,默认展示类型
types: {
type: Array,
default: ['fxbg', 'gf', 'gzgl', 'jkjc', 'lxwh', 'pzgl', '', 'rcxj']
default: ['fxbg', 'gf', 'gzgl', 'jkjc', 'lxwh', 'pzgl', 'rcxj']
},
// 是否是预览模式
// 预览模式不展示授权按钮
... ... @@ -22,7 +22,12 @@ export default {
viewTypeId: {
type: String,
default: ''
},
fileIds: {
type: Array,
default: []
}
},
data() {
return {
... ... @@ -90,8 +95,12 @@ export default {
'vob': 'icon-avi',
'zip': 'icon-zip-full',
}
// 树数据
let treeData = Vue.ref([]);
// 当前节点数据
let currentNodeData = Vue.ref({});
// 默认打开节点
let defaultExpandedKeys = Vue.ref([]);
// 获取文件列表或者打开文件
let getFile = (item) => {
... ... @@ -148,26 +157,30 @@ export default {
// 左侧树
let getTree = () => {
// 加载列表
proxy.$http.get("/inspection-report/doc/type/tree", {}, function (res) {
proxy.$http.get("/inspection-report/doc/type/tree", {types: props.types.join(',')}, function (res) {
if (res && res.data) {
treeData.value = res.data;
let first = res.data[0];
currentNodeData.value = first;
// 加载所有
getPage('0');
let arr = [];
arr.push(first.id);
defaultExpandedKeys.value = arr;
// 加载第一个节点数据
getPage(first.id);
}
})
}
// 获取表格树
let getPage = (id) => {
let docIds = props.fileIds.length == 0 ? '' : props.fileIds.join(',')
let params = {
id: id,
name: keyWord.value,
types: props.types.join(',')
types: props.types.join(','),
docIds:docIds
}
// 加载列表
proxy.$http.get(`/inspection-report/file/document/list`, params, function (res) {
... ... @@ -185,6 +198,10 @@ export default {
let nodeClick = (node, data) => {
let id = data.id;
currentNodeData.value = data;
let arr = [];
arr.push(id);
defaultExpandedKeys.value = arr;
getPage(id);
}
... ... @@ -236,7 +253,6 @@ export default {
params = info;
}
proxy.$global.confirm(msg, function () {
debugger
// ok
proxy.$http.post(`/inspection-report/file/change`,params , function (res) {
if (res && res.code == 0) {
... ... @@ -379,8 +395,6 @@ export default {
proxy.$global.showMsg('授权失败!', 'warning');
}
})
// 隐藏授权弹框
showUserDialog(false);
}
// 上传
... ... @@ -393,7 +407,8 @@ export default {
}
let uploadCallBack = ({document,fileInfo}) => {
reload(false);
console.log(111111111111,document,fileInfo);
// 执行回调
emit('callback',{document,fileInfo});
}
/**
... ... @@ -435,6 +450,11 @@ export default {
left: 0,
right: 24
}
currentNodeData.value = {
docType: props.viewTypeId,
docNo: props.viewTypeId,
id: props.viewTypeId
}
getPage(props.viewTypeId);
}
})
... ... @@ -460,6 +480,7 @@ export default {
downloadFile,
defaultExpandedKeys,
currentNodeData,
docForm,
addFolder,
... ...
... ... @@ -14,10 +14,10 @@
<div v-if="typeof(item.render) == 'function'" >
<div v-if="typeof(item.click) == 'function'">
<el-link type="primary" @click="item.click(scope.row)" v-html="item.render(scope.row)"></el-link>
<el-link :type="linkType" :underline="isLink" @click="item.click(scope.row)" v-html="item.render(scope.row)"></el-link>
</div>
<div v-else>
<el-link type="primary" v-html="item.render(scope.row)"></el-link>
<el-link :type="linkType" :underline="isLink" v-html="item.render(scope.row)"></el-link>
</div>
</div>
<span v-else>
... ...
... ... @@ -45,7 +45,7 @@ export default {
// 默认展示
pageSize: {
type: Number,
default: 100
default: 50
},
// 总数
total: {
... ... @@ -67,10 +67,21 @@ export default {
type: Array,
default: []
},
// 是否展示加载
loading:{
type: Boolean,
default: false
},
// 是否展示链接
isLink:{
type: Boolean,
default: false
},
// 是否展示链接
linkType:{
type: String,
default: 'primary'
},
},
data() {
return {}
... ...
<cm-dialog title="文件上传" width="500px" :showDialogVisible="show" @hidedialog="hidedialog" @okfunc="uploadFile" okText="上传">
<cm-dialog v-if="!isInset" title="文件上传" width="500px" :showDialogVisible="show" @hidedialog="hidedialog" @okfunc="uploadFile" okText="上传">
<template v-slot>
<el-upload
... ... @@ -6,9 +6,10 @@
ref="upload"
:http-request="getFile"
:multiple="true"
:before-upload="beforeUpload"
:auto-upload="false">
<template #trigger>
<el-button size="small" type="primary">选择文件</el-button>
<el-button size="small" type="primary">{{btnText}}</el-button>
</template>
支持格式:
<el-tooltip placement="top" effect="light">
... ... @@ -25,3 +26,14 @@
</el-upload>
</template>
</cm-dialog>
<!--页面嵌套方式-->
<el-upload
v-if="isInset"
:show-file-list="false"
:before-upload="beforeUpload"
:multiple="false"
:http-request="getInsetFile"
:auto-upload="true">
<el-button size="small" type="primary">上传照片</el-button>
</el-upload>
... ...
... ... @@ -6,6 +6,15 @@ export default {
template: '',
components: {},
props: {
// 嵌套方式
isInset: {
type: Boolean,
default: false
},
btnText:{
type: String,
default: '选择文件'
},
showDialogVisible: {
type: Boolean,
default: false
... ... @@ -126,6 +135,17 @@ export default {
let uploadFile = () => {
proxy.$refs.upload.submit()
}
// 提交前的验证
let beforeUpload = (file) =>{
return emit('beforeUpload',file)
}
let getInsetFile = (param) =>{
let fileObj = param.file
emit('callback',fileObj)
}
// 监听编辑状态
Vue.watch(
() => props.showDialogVisible, (newValue, oldVlaue) => {
... ... @@ -142,10 +162,12 @@ export default {
return {
getInsetFile,
getFile,
show,
uploadFile,
hidedialog
hidedialog,
beforeUpload
}
}
}
... ...
<cm-dialog title="用户授权" width="900px" :showDialogVisible="show" @hidedialog="hidedialog" @okfunc="getUser">
<cm-dialog :title="title" width="900px" :showDialogVisible="show" @hidedialog="hidedialog" @okfunc="getUser">
<template v-slot>
<el-transfer v-model="value" :props="props" filterable
:render-content="renderFunc"
:data="userArr" :titles="['所有用户/角色', '已授权用户/角色']"
:button-texts="['取消', '授权']">
:data="userArr" :titles="titles"
:button-texts="buttonTexts">
<!--<template #left-footer>
<el-button class="transfer-footer" size="small">Operation</el-button>
</template>-->
... ...
... ... @@ -13,7 +13,29 @@ export default {
users: {
type: Array,
default: []
}
},
// 加载用户数据
loadUserDta: {
type: Boolean,
default: true
},
title: {
type: String,
default: '添加授权'
},
// 加载角色数据
loadRoleDta: {
type: Boolean,
default: true
},
titles: {
type: Array,
default: ['所有用户/角色', '已授权用户/角色']
},
buttonTexts: {
type: Array,
default: ['取消', '授权']
},
},
data() {
return {
... ... @@ -26,53 +48,59 @@ export default {
let v = Vue.ref(props.users);
let userArr = Vue.ref([]);
const getAllUser = () => {
// 查询全部用户
proxy.$http.get("/api-user/users?page=1&limit=10000&username=&nickname=&enabled=&orgId=&roles=", {}, 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);
}
userArr.value.push({
value: v.username,
type:'USER',
desc: `${desc.join(' / ')}`,
props : v
})
});
}
})
if(props.loadUserDta){
// 查询全部用户
proxy.$http.get("/api-user/users?page=1&limit=10000&username=&nickname=&enabled=&orgId=&roles=", {}, 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);
}
userArr.value.push({
value: v.username,
type:'USER',
desc: `${desc.join(' / ')}`,
props : v
})
});
}
},function (){},false)
}
if(props.loadRoleDta){
// 查询全部角色
proxy.$http.get("/api-user/roles?page=1&limit=10000", {}, function (res) {
if (res && res.data) {
res.data.map(function (v) {
let desc = [];
let code = v.code;
let name = v.name;
if (name) {
desc.push(name);
}
if (code) {
desc.push(code);
}
userArr.value.push({
value: v.id,
type:'ROLE',
desc: `${desc.join(' / ')}`,
props : v
})
});
}
},function (){},false)
}
// 查询全部角色
proxy.$http.get("/api-user/roles?page=1&limit=10000", {}, function (res) {
if (res && res.data) {
res.data.map(function (v) {
let desc = [];
let code = v.code;
let name = v.name;
if (name) {
desc.push(name);
}
if (code) {
desc.push(code);
}
userArr.value.push({
value: v.id,
type:'ROLE',
desc: `${desc.join(' / ')}`,
props : v
})
});
}
})
}
... ... @@ -106,6 +134,8 @@ export default {
}
emit('callback', data);
emit('hideDialog', false);
}
let renderFunc = (h, option) =>{
... ... @@ -165,7 +195,7 @@ export default {
userArr,
value: v,
getUser,
renderFunc
renderFunc,
}
}
}
... ...
... ... @@ -94,6 +94,18 @@ global.confirm = (msg,okFunc,cancelFunc) =>{
*/
global.getQueryVariable = (variable) => {
var query = window.location.search.substring(1);
if(query == ''){
query = document.location.href
let arr = query.split('?');
for (var i = 0; i < arr.length; i++) {
var pair = arr[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
}
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
... ... @@ -104,10 +116,38 @@ global.getQueryVariable = (variable) => {
return (false);
}
/**
* 文件预览
* @param path
*/
global.viewer = (path) =>{
window.open("/src/lib/extend/pdfjs/web/viewer.html?test=" + encodeURIComponent(path));
}
/**
* 将文件转成base64
* @param file
* @returns {Promise<String>}
*/
global.getBase64 = (file) =>{
return new Promise(function(resolve, reject) {
let reader = new FileReader();
let imgResult = "";
reader.readAsDataURL(file);
reader.onload = function() {
imgResult = reader.result;
};
reader.onerror = function(error) {
reject(error);
};
reader.onloadend = function() {
resolve(imgResult);
};
});
}
// 组件默认大小
global.elementSize = 'small';
... ...
... ... @@ -12,13 +12,19 @@ let http = {
window.location.reload();
}
},
post: function (requestUrl, data, callback) {
post: function (requestUrl, data, callback, errFunc,showLoadding) {
if (http.proxy == null) {
const {proxy} = Vue.getCurrentInstance()
http.proxy = proxy;
}
const loading = http.proxy.$global.showLoading();
// 默认展示加载狂
if(showLoadding == undefined){
showLoadding = true;
}
let loading = null;
if(showLoadding && showLoadding == true){
loading = http.proxy.$global.showLoading();
}
var access_token = 'access_token=' + http.getToken();
if (requestUrl.indexOf('?') == -1) {
requestUrl += '?' + access_token;
... ... @@ -34,7 +40,12 @@ let http = {
async: true,
data: JSON.stringify(data),
error: function (xhr, textStatus) {
loading.close();
if(showLoadding && showLoadding == true){
loading.close();
}
if (errFunc) {
errFunc();
}
console.log("==>", requestUrl, xhr, textStatus)
http.reqErr(textStatus.status);
},
... ... @@ -42,19 +53,28 @@ let http = {
if (callback) {
callback(data);
}
loading.close()
if(showLoadding && showLoadding == true){
loading.close();
}
//console.log("==>", requestUrl, jqXHR, textStatus)
}
});
},
get: function (requestUrl, data, callback, errFunc) {
get: function (requestUrl, data, callback, errFunc,showLoadding) {
if (http.proxy == null) {
const {proxy} = Vue.getCurrentInstance()
http.proxy = proxy;
}
const loading = http.proxy.$global.showLoading();
// 默认展示加载狂
if(showLoadding == undefined){
showLoadding = true;
}
let loading = null;
if(showLoadding == true){
loading = http.proxy.$global.showLoading();
}
var access_token = 'access_token=' + http.getToken();
if (requestUrl.indexOf('?') == -1) {
requestUrl += '?' + access_token;
... ... @@ -69,7 +89,9 @@ let http = {
},
data: data,
error: function (xhr, textStatus) {
loading.close();
if(showLoadding && showLoadding == true){
loading.close();
}
console.log("==>", requestUrl, xhr, textStatus)
http.reqErr(textStatus.status);
... ... @@ -82,7 +104,9 @@ let http = {
if (callback) {
callback(data);
}
loading.close();
if(showLoadding && showLoadding == true){
loading.close();
}
//console.log("==>", requestUrl, jqXHR, textStatus)
}
});
... ... @@ -146,9 +170,7 @@ let http = {
return `${keys}`;
}
let p = formart(parmas);
debugger
window.open(sessionStorage.getItem('domainName') + requestUrl + "&" + p);
},
getToken() {
return localStorage.getItem('access_token');
... ...
... ... @@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HGMonitorZJWebApplication {
public static void main(String[] args) {
SpringApplication.run(HGMonitorZJWebApplication.class, args);
}
... ...
... ... @@ -12,12 +12,14 @@ server:
key-store-password: Hg0801..
key-password: Hg0801..
url:
gateway: http://192.168.0.41:8080
gateway: http://172.16.20.43:8080
inspection_web: http://127.0.0.1:8082
assetsweb: http://127.0.0.1:8082
mxgraph_editor: http://127.0.0.1:8085
tingyun: http://127.0.0.1:8088
bigScreen: http://127.0.0.1:8081
# 一体化视图
ythView: http://192.168.0.69:18089
#流程系统路径,当ssl.enabled=true时,http要改为https,并修改流程nginx的conf文件
workflow: http://192.168.0.248:8002
# 积木报表工具
... ...
// 业务类型管理
layui.define(['table', 'form', 'admin', 'layer', 'laytpl', 'common', 'view', 'sessions', 'commonDetail', 'treeTable', 'xmSelect', 'userlist', 'reslist'], function (exports) {
var $ = layui.$;
var form = layui.form;
var layer = layui.layer;
var admin = layui.admin;
var table = layui.table;
var treeTable = layui.treeTable;
var xmSelect = layui.xmSelect;
var laytpl = layui.laytpl;
var view = layui.view;
var common = layui.common;
var commonDetail = layui.commonDetail;
var domainName = common.domainName;
// 业务类型展示表格
var busTypeTable;
// 对外暴露的接口
exports('bustype', function (data) {
var sessions = layui.sessions;
var accessToken = sessions.getToken()['access_token'];
var cutoverId = '', targetType = '';
if (data && data.cutoverId) {
cutoverId = data.cutoverId;
targetType = data.targetType;
}
var mode = (data && data.mode) ? data.mode : '';
var username = (data && data.username) ? data.username : '';
//展示类型
var showTypeList=[];
var dataBusType=[];
initShowType();
// 查询条件
var conditions = {busTypeName: ''};
// 加载遮罩
var loading;
var checkList = common.checkPermission(accessToken);
loadBusTypeTable();
// 查询条件框回车查询事件
$('#condition-bustype-name').keydown(function (e) {
if (e.keyCode === 13) {
loadBusTypeTable();
return false;
}
});
//查询按钮点击事件 joke add 20210428
$('#bustypeQueryBtn').on('click',function () {
loadBusTypeTable();
});
// 删除按钮删除事件
$('#btn-bustype-delete').click(function () {
var checks = busTypeTable.checkStatus(false);
var busId = $.map(checks, function (item) {
return item.busId;
});
deleteBusTypeByIds(busId);
});
//授权按钮事件
$("#btn-bustype-authorization").click(function () {
var checks = busTypeTable.checkStatus(false);
var busId = [];
var j = 0;
var number = 0;
for (var i = 0; i < checks.length; i++) {
if (checks[i].children != null) {
j++;
number = checks[i].children.length;
}
}
if (j = 1 && checks.length - number == 1) {
busId = checks[0].busId;
} else {
busId = $.map(checks, function (item) {
return item.busId;
});
}
if (busId.length == 0) {
layer.msg('请先选择数据', {icon: 0, timeout: 3000});
return;
} else if (busId.length == 1) {
busId = busId[0];
} else {
busId = busId.toString();
}
authorizationIndex(busId)
})
var cols = []
if (!mode) {
cols.push({
type: 'checkbox'
})
}
cols = cols.concat([{
type: 'numbers', title: '序号', align: 'center', width: 70
}, {
field: 'busTypeName', title: '名称', align: 'left',
templet:
'<div>' +
' <span' +
' data-code="{{d.busTypeCode}}"' +
' class="layui-table-link btn-bustype-edit">{{d.busTypeName}}' +
' </span>' +
'</div>'
}, {
field: 'nickname', title: '负责人', align: 'center'
}, {
field: 'busTypeDesc', title: '业务类型描述', align: 'left'
}, {
field: 'isOps', title: '乙方运维', align: 'center',width: 120,
templet: function (d) {
if(d.isOps==0){
return '否';
}else{
return '是';
}
}
}, {
field: 'isUse', title: '是否使用', align: 'center',width: 120,
templet: function (d) {
switch (d.isUse) {
case 0:
return '否';
case 1:
return '是';
default:
return '';
}
}
}, {
field: 'important', title: '重要程度', align: 'center', width: 120,
templet: function (d) {
switch (d.important) {
case 1:
return '核心';
case 2:
return '重要';
case 3:
return '一般';
case 9:
return '虚拟业务';
default:
return '';
}
}
}, {
field: 'sort', title: '排序', align: 'right', width: 120,
}])
if (!mode) {
cols.push({
title: '操作', align: 'center', fixed: 'right', width: '10%',
templet: function (d) {
if (d.isLeaf) {
return '' +
'<div>' +
'<button data-id="' + d.busId + '" lay-tips="删除" type="button" class="layui-btn layui-btn-xs layui-btn-normal btn-bustype-delete"><i class="layui-icon layui-icon-delete"></i></button>' +
'<button data-id="' + d.busId + '" lay-tips="资源分配" type="button" class="layui-btn layui-btn-xs layui-btn-normal btn-bustype-res-config"><i class="layui-icon layui-icon-menu-fill"></i></button>' +
'<button data-id="' + d.busId + '" lay-tips="授权" type="button" class="layui-btn layui-btn-xs layui-btn-normal btn-bustype-authorize"><i class="layui-icon layui-icon-auz"></i></button>' +
'<button data-id="' + d.busId + '" lay-tips="乙方运维配置" type="button" class="layui-btn layui-btn-xs layui-btn-normal btn-bustype-yf-config"><i class="layui-icon layui-icon-auz"></i></button>' +
'</div>'
} else {
return '' +
'<div class="layui-row">' +
'<button data-id="' + d.busId + '" lay-tips="删除" type="button" class="layui-btn layui-btn-xs layui-btn-normal btn-bustype-delete"><i class="layui-icon layui-icon-delete"></i></button>' +
'<button data-id="' + d.busId + '" lay-tips="授权" type="button" class="layui-btn layui-btn-xs layui-btn-normal btn-bustype-authorize"><i class="layui-icon layui-icon-auz"></i></button>' +
'</div>'
}
}
});
} else {
cols.push({field: 'showType', title: '展示类型', align: 'center',sort:true,width:210,
templet: function (d) {
if(d.parentId == '0' && dataBusType.indexOf(d.busId)>-1){
return '';
}else{
//初始化select内容
var html='<div><select lay-ignore data-index="99" name="showType" class="layui-input resourceType_showType" style="min-width: 150px;display:inline">';
$.each(showTypeList,function (i,v) {
if(d.showType == v.value){
html += '<option value="' + v.value + '" selected>' + v.name + '</option> '
}else{
html += '<option value="' + v.value + '">' + v.name + '</option> '
}
});
html+='</select></div>';
return html;
}
}
});
cols.push({
title: '操作', align: 'center', fixed: 'right', width: '10%',
templet: function (d) {
if (d.userCount) {
return '' +
'<div class="layui-row">' +
'<button data-id="' + d.busId + '" type="button" class="layui-btn layui-btn-xs btn-bustype-bind hide" lay-tips="未授权,点击授权"><i class="layui-icon layui-icon-link"></i> 添加授权</button>' +
'<button data-id="' + d.busId + '" type="button" style="margin-left: 0" class="layui-btn layui-btn-xs layui-btn-danger btn-bustype-unbind" lay-tips="已授权,点击解除授权"><i class="layui-icon layui-icon-unlink"></i> 解除授权</button>' +
'</div>';
} else {
return '' +
'<div class="layui-row">' +
'<button data-id="' + d.busId + '" type="button" class="layui-btn layui-btn-xs btn-bustype-bind" lay-tips="未授权,点击授权"><i class="layui-icon layui-icon-link"></i> 添加授权</button>' +
'<button data-id="' + d.busId + '" type="button" style="margin-left: 0" class="layui-btn layui-btn-xs layui-btn-danger btn-bustype-unbind hide" lay-tips="已授权,点击解除授权"><i class="layui-icon layui-icon-unlink"></i> 解除授权</button>' +
'</div>';
}
}
});
}
/**
* 加载业务类型表格
*/
function loadBusTypeTable() {
conditions = {
busTypeName: $('#condition-bustype-name').val() ? $('#condition-bustype-name').val().trim() : '',
access_token: accessToken,
cutoverId: cutoverId,
targetType: targetType,
username: username,
page: -1,
limit: -1
};
conditions.limit = -1;
admin.req({
url: domainName + '/api-web/manage/bustype/page',
data: conditions
}).done(function (response) {
$.each(response.data,function (i,v) {
dataBusType.push(v.parentId);
})
// 设置总数
$('#span-bustype-total').html('共 ' + response.data.length + ' 个业务');
// 渲染表格
busTypeTable = treeTable.render({
elem: '#bustype-table',
data: response.data,
page: {
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
theme: '#1E9FFF'
},
tree: {
iconIndex: mode ? 1 : 2, // 折叠图标显示在第几列
isPidData: true, // 是否是id、pid形式数据
idName: 'busId', // id字段名称
pidName: 'parentId', // pid字段名称
onlyIconControl: true // 仅允许点击图标折叠
},
cols: cols
});
//回填数据
if (data && data.username) {
if (data.username.length == 1) {
$.ajax({
type: "get",
url: domainName + "/api-web/manage/bustype/getBusTypeByUser?access_token=" + accessToken + "&username=" + data.username[0],
success: function (res) {
if (res && res.success) {
var busTypeData = res.data;
busTypeTable.setChecked(busTypeData.map(item => item.busId))
}
},
})
}
}
// 点击编号编辑事件
$('.btn-bustype-edit').click(function () {
if ($.inArray('back:bustype:update', checkList) == -1) {
layer.msg('暂无权限!', {icon: 7, time: 3000});
return;
}
var busTypeCode = $(this).data('code');
saveBusType(busTypeCode);
});
// 删除事件
$('.btn-bustype-delete').click(function () {
var busId = $(this).data('id');
deleteBusTypeByIds([busId]);
});
// 授权事件
$('.btn-bustype-authorize').click(function () {
loading = layer.load(2);
var busId = $(this).data('id')
authorizationIndex(busId)
});
// 乙方运维配置
$('.btn-bustype-yf-config').click(function () {
var busId = $(this).data('id');
layer.open({
type: 2
,title: "乙方运维配置"
,closeBtn: true
,area: ['50%', '70%']
,shade: 0.8
,id: 'operationMaintenance-config' //设定一个id,防止重复弹出
,content:`/vue3/index.html#/operationMaintenance/config?id=${busId}`
, success: function (layero, index) {
}
,yes: function(index, layero){
layer.closeAll();
return false;
}
});
});
$('.btn-bustype-bind').unbind('click').on('click', function () {
var $this = $(this);
var busId = $this.data('id')
layer.load(2);
admin.req({
url: domainName + '/api-web/manage/bustype/bindUser/' + busId,
data: {username},
success(response) {
layer.closeAll('loading');
if (response && response.success) {
$this.addClass('hide');
$this.parent().find('.btn-bustype-unbind').removeClass('hide')
var $child = $('tr[data-pid="' + busId + '"] .btn-bustype-bind');
$child.addClass('hide')
$child.parent().find('.btn-bustype-unbind').removeClass('hide')
} else {
layer.msg('授权失败!', {icon: 2});
}
},
error() {
layer.closeAll('loading');
}
})
});
$('.btn-bustype-unbind').unbind('click').on('click', function () {
var $this = $(this);
var busId = $this.data('id')
layer.load(2);
admin.req({
url: domainName + '/api-web/manage/bustype/unBindUser/' + busId,
data: {username},
success(response) {
layer.closeAll('loading');
if (response && response.success) {
$this.addClass('hide');
$this.parent().find('.btn-bustype-bind').removeClass('hide')
} else {
layer.msg('取消授权失败!', {icon: 2});
}
},
error() {
layer.closeAll('loading');
}
})
});
// 资源分配事件
// $('.btn-bustype-res-config').click(function () {
// var busId = $(this).data('id');
// var bustypeReslist = layui.reslist({busId: busId, idSuffix: 1})
// // 展示资源页面layerindex
// var bustypeReslayerIndex;
// common.openWin("template/res/reslist", "当前绑定的资源", {busId: busId, idSuffix: 1}, ["完成", "取消"], function () {
// layer.close(bustypeReslayerIndex);
// }, null, ['80%', '90%'],
// function (layero, layerIndex) {
// bustypeReslayerIndex = layerIndex;
// // 新增按钮
// $("#bustype-reslist-add").click(function () {
// var reslist = layui.reslist();
// // 添加绑定页面的layerindex
// var addResLayerIndex;
// common.openWin("template/res/reslist", "添加绑定", {}, ["添加", "取消"], function () {
// loading = layer.load(2);
// // 当前选中的资源
// var checks = reslist.getData();
// // 之前已经选择过的资源
// var oldResIdList = [];
// admin.req({
// url: domainName + '/api-web/manage/bustype/resourceList/' + busId,
// async: false,
// error: function () {
// layer.close(loading);
// }
// }).done(function (response) {
// $.each(response.data, function (index, value) {
// oldResIdList.push(value.resId);
// });
// });
// // 需要进行插入的资源
// var inserts = [];
// var insertCount = 0;
// var isExistCount = 0;
// $.each(checks, function (index, value) {
// if (oldResIdList.indexOf(value.resId) === -1) {
// inserts.push(value.resId);
// insertCount++;
// } else {
// isExistCount++;
// }
// });
// if (inserts.length === 0) {
// layer.msg('所选的都已存在,无需重复添加!', {icon: 7, time: 5000});
// layer.close(loading);
// return;
// }
// // 发送请求添加绑定
// admin.req({
// url: domainName + '/api-web/manage/bustype/addResource/' + busId + '?access_token=' + accessToken,
// type: 'POST',
// contentType: 'application/json',
// data: JSON.stringify(inserts),
// error: function () {
// layer.close(loading);
// }
// }).done(function (response) {
// layer.close(loading);
// if (response.success) {
// layer.msg('添加绑定成功!此次添加了' + insertCount + '个新资源' + (isExistCount > 0 ? ',有' + isExistCount + '个已经存在。' : ''), {icon: 1, time: 5000});
// layer.close(addResLayerIndex);
// bustypeReslist.reloadResTable();
// } else {
// layer.msg('添加绑定失败!', {icon: 2, time: 3000});
// }
// });
// }, null, ['90%', '80%'], function (layero, layerIndex) {
// addResLayerIndex = layerIndex
// });
// });
// // 取消绑定按钮
// $("#bustype-reslist-unbind").click(function () {
// // 需要取消绑定的资源id集合
// var deletes = [];
// $.each(bustypeReslist.getData(), function (index, value) {
// deletes.push(value.resId);
// });
// admin.req({
// url: domainName + '/api-web/manage/bustype/deleteResource/' + busId + '?access_token=' + accessToken,
// type: 'POST',
// contentType: 'application/json',
// data: JSON.stringify(deletes)
// }).done(function (response) {
// if (response.success) {
// layer.msg('取消绑定成功!', {icon: 1, time: 3000});
// bustypeReslist.reloadResTable();
// } else {
// layer.msg('取消绑定失败!', {icon: 2, time: 3000});
// }
// });
// });
// });
// });
//资源分配
$('.btn-bustype-res-config').click(function () {
if ($.inArray('back:bustype:resource', checkList) == -1) {
layer.closeAll();
layer.msg('暂无权限!', {icon: 7, time: 3000});
return;
}
var busId = $(this).data('id');
layer.open({
title: '当前绑定的资源',
type: 1,
content: $('#bustype-reslist-table').html(),
btn: ['完成'],
area: ['80%', '90%'],
success: function () {
// 表格
var resType = 'all';
$("#bustype_reslist_resListBizTypes").attr("disabled",true);
form.render();
//绑定业务下拉选择数据
common.bizTypeSelect("bustype_reslist_resListBizTypes",function () {
$("#bustype_reslist_resListBizTypes").val(busId);
form.render("select");
});
//绑定资源类型下拉选择
common.resTypeSelect("bustype_reslist_restype",function () {
form.render("select");
});
//回车搜索
$('#bustype_reslist_keyword').keydown(function (e) {
if (e.keyCode === 13) {
reloadTable(resType);
}
});
//选择框搜索事件
bindSelectEvent();
//渲染表格
table.render({
elem: '#bustype_reslist_resListTable'
, url: common.domainName + '/api-web/home/res-list/' + resType
, where: {
access_token: accessToken,
resName: $("#bustype_reslist_keyword").val(),
busId: busId,
resHealth: $("#bustype_reslist_resStatus").val()
}
, height: 'full-300'
, cellMinWidth: 80
, page: {
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
, theme: '#1E9FFF'
}
, limit: common.limit
, limits: common.limits
, cols: [[
{type: 'checkbox'},
{type: 'numbers', title: '序号', align: 'center'}
, {field: 'resName', title: '资源名称', minWidth: 300, align: 'center'}
, {field: 'ip', title: 'IP地址', align: 'center'}
, {field: 'admin', title: '负责人', align: 'center'}
, {field: 'resTypeName', title: '资源类型', align: 'center'}
, {field: 'healthDesc', title: '资源状态', align: 'center'}
]]
});
//绑定下拉搜索事件
function bindSelectEvent() {
// 资源状态
form.on('select(bustype_reslist_resStatus)', function(data){
reloadTable(resType);
});
// 资源类型
form.on('select(bustype_reslist_restype)', function(data){
resType = data.value;
reloadTable(resType);
});
}
//刷新表格
function reloadTable(resType) {
table.reload('bustype_reslist_resListTable', {
url: common.domainName + '/api-web/home/res-list/' + (resType ? resType : 'all'),
where: {
access_token: accessToken,
resName: $("#bustype_reslist_keyword").val(),
busId: busId,
resHealth: $("#bustype_reslist_resStatus").val()
}
});
}
// 新增按钮
$("#bustype-reslist-add").click(function () {
var reslist = layui.reslist();
// 添加绑定页面的layerindex
var addResLayerIndex;
common.openWin("template/res/reslist", "添加绑定", {}, ["添加", "取消"], function () {
loading = layer.load(2);
// 当前选中的资源
var checks = reslist.getData();
if (checks.length ==0) {
layer.msg('请先选择资源后,再进行添加!', {icon: 7, time: 3000});
layer.close(loading);
return;
}
// 之前已经选择过的资源
var oldResIdList = [];
admin.req({
url: domainName + '/api-web/manage/bustype/resourceList/' + busId,
async: false,
error: function () {
layer.close(loading);
}
}).done(function (response) {
$.each(response.data, function (index, value) {
oldResIdList.push(value.resId);
});
});
// 需要进行插入的资源
var inserts = [];
var insertCount = 0;
var isExistCount = 0;
var resTypes=[];
var parentIds=[];
$.each(checks, function (index, value) {
if (oldResIdList.indexOf(value.resId) === -1) {
resTypes.push(value.resType);
parentIds.push(value.parentId);
inserts.push(value.resId);
insertCount++;
} else {
isExistCount++;
}
});
if (inserts.length === 0) {
layer.msg('所选的都已存在,无需重复添加!', {icon: 7, time: 5000});
layer.close(loading);
return;
}
var ArrIndex=[];
if(resTypes.length>0){
var identify=0;
$.each(resTypes,function (i,v) {
if(v=='MIDDLEWARE_WEBLOGIC' && parentIds[i]==''){
identify=1;
ArrIndex.push(i);
}
});
if(identify==1){
//询问框
layer.confirm('选择的资源中包含weblogic控制台,是否将控制台下的服务一起分配到当前业务下?', {
btn: ['是','否'] //按钮
}, function(){//是
//获得控制台下所有服务的resID
//如果选择将控制台下的服务一起分配到当前业务下
var arrResIds=[];
$.each(ArrIndex,function (i,v) {
arrResIds.push(inserts[v]);
})
var map={
resIds: arrResIds.toString()
};
admin.req({
url: common.domainName + '/api-web/bResource/resourceByResId?access_token='+accessToken,
type:'post',
data:JSON.stringify(map),
contentType: "application/json;charset=utf-8",
async:false,
error: function () {
layer.msg('获取控制台下所有服务失败', {icon: 2});
layer.close(layer.index);
}
}).done(function (response) {
if(response.success && response.data && response.data.length>0){
$.each(response.data,function (i,v) {
inserts.push(v.resId);
insertCount++;
});
}
inserts=Array.from(new Set(inserts));
isExistCount = insertCount-inserts;
add(addResLayerIndex,inserts,busId,insertCount,isExistCount,resType);
layer.close(layer.index);
})
}, function(){//否
add(addResLayerIndex,inserts,busId,insertCount,isExistCount,resType);
layer.close(layer.index);
});
}else{
add(addResLayerIndex,inserts,busId,insertCount,isExistCount,resType);
}
}
}, null, ['90%', '80%'], function (layero, layerIndex) {
addResLayerIndex = layerIndex
});
});
// 取消绑定按钮
$("#bustype-reslist-unbind").click(function () {
// 需要取消绑定的资源id集合
var deletes = [];
var resTypes=[];
var parentIds=[];
$.each(table.checkStatus('bustype_reslist_resListTable').data, function (index, value) {
deletes.push(value.resId);
resTypes.push(value.resType);
parentIds.push(value.parentId);
});
if(deletes.length<1){
layer.msg('请选择要解除绑定的数据!', {icon: 7, time: 3000});
layer.close(loading);
return;
}
var ArrIndex=[];
if(resTypes.length>0){
var identify=0;
$.each(resTypes,function (i,v) {
if(v=='MIDDLEWARE_WEBLOGIC' && parentIds[i]==''){
identify=1;
ArrIndex.push(i);
}
});
if(identify==1){
//询问框
layer.confirm('选择的资源中包含weblogic控制台,是否将控制台下的服务一起取消?', {
btn: ['是','否'] //按钮
}, function(){//是
//获得控制台下所有服务的resID
//如果选择将控制台下的服务一起取消
var arrResIds=[];
$.each(ArrIndex,function (i,v) {
arrResIds.push(deletes[v]);
})
var map={
resIds: arrResIds.toString()
};
admin.req({
url: common.domainName + '/api-web/bResource/resourceByResId?access_token='+accessToken,
type:'post',
data:JSON.stringify(map),
contentType: "application/json;charset=utf-8",
async:false,
error: function () {
layer.msg('获取控制台下所有服务失败', {icon: 2});
layer.close(layer.index);
}
}).done(function (response) {
if(response.success && response.data && response.data.length>0){
$.each(response.data,function (i,v) {
deletes.push(v.resId);
});
}
deletes=Array.from(new Set(deletes));
del(busId,deletes,resType);
layer.close(layer.index);
})
}, function(){//否
del(busId,deletes,resType);
layer.close(layer.index);
});
}else{
del(busId,deletes,resType);
}
}
});
},
yes: function (index) {
layer.close(index);
}
});
});
});
}
//授权页面
function authorizationIndex(busId) {
if ($.inArray('back:bustype:impower', checkList) == -1) {
layer.closeAll();
layer.msg('暂无权限!', {icon: 7, time: 3000});
return;
}
var params = {
oldUsers: [],
bindUrl: '/api-web/manage/bustype/bindUser/' + busId,
unBindUrl: '/api-web/manage/bustype/unBindUser/' + busId
};
// 获取当前资源类型的权限用于回显
admin.req({
url: domainName + '/api-web/manage/bustype/getUsersByBusId',
async: false,
data: {
busId: busId
}
}).done(function (response) {
$.each(response.data, function (index, value) {
params.oldUsers.push(value.userAccount);
})
return false;
});
layer.close(loading);
var userlist;
layer.open({
title: '授权',
id: 'busType-role-config-layer',
type: 1,
area: ['80%', '90%'],
btn: ['关闭'],
scrollbar: false,
success: function () {
view(this.id).render('/template/user/userlist').done(function () {
userlist = layui.userlist(params);
});
},
yes: function (index, layero) {
layer.close(index);
}
});
}
// 新增按钮
$('#bustype-create').click(function () {
if ($.inArray('back:bustype:save', checkList) == -1) {
layer.msg('暂无权限!', {icon: 7, time: 3000});
return;
}
saveBusType();
});
// 刷新表格按钮
$('#btn-bustype-reload-table').click(function () {
loadBusTypeTable();
});
/**
* 新增或者编辑业务类型
*
* @param busTypeCode 业务类型编号
*/
function saveBusType(busTypeCode) {
// 打开(新增/编辑)窗口
common.openWin('/baseconfig/bustype/add', '<a class="layui-icon layui-icon-edit win_title_icon"></a>' + busTypeCode ? '编辑' : '新增',
{busTypeCode: busTypeCode}, ['保存', '取消'], function () {
$('#btn-bustype-submit').click();
}, null, ['40%', 'auto']);
}
function deleteBusTypeByIds(busIds) {
if ($.inArray('back:bustype:delete', checkList) == -1) {
layer.msg('暂无权限!', {icon: 7, time: 3000});
return;
}
if (busIds.length == 0) {
layer.msg('请先选择数据,再点击删除。', {icon: 0, timeout: 3000});
return;
}
layer.confirm('确认要删除吗?', {icon: 3, title: '提示'}, function () {
loading = layer.load(2);
admin.req({
url: domainName + '/api-web/manage/bustype/deleteByIds?access_token=' + accessToken,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(busIds),
success: function () {
layer.close(loading);
},
error: function () {
layer.close(loading);
}
}).done(function (response) {
if (response.success) {
layer.msg('删除成功!', {icon: 1, time: 3000});
loadBusTypeTable();
} else {
layer.msg('删除失败!', {icon: 2, time: 3000});
}
});
});
}
//添加绑定
function add(addResLayerIndex,inserts,busId,insertCount,isExistCount,resType) {
// 发送请求添加绑定
admin.req({
url: domainName + '/api-web/manage/bustype/addResource/' + busId + '?access_token=' + accessToken,
type: 'POST',
async: false,
contentType: 'application/json',
data: JSON.stringify(inserts),
error: function () {
layer.close(layer.index);
}
}).done(function (response) {
layer.close(loading);
if (response.success) {
layer.msg('添加绑定成功!此次添加了' + insertCount + '个新资源' + (isExistCount > 0 ? ',有' + isExistCount + '个已经存在。' : ''), {icon: 1, time: 5000});
layer.close(addResLayerIndex);
reloadTable(resType,busId);
} else {
layer.msg('添加绑定失败!', {icon: 2, time: 3000});
}
});
}
//取消绑定
function del(busId,deletes,resType) {
admin.req({
url: domainName + '/api-web/manage/bustype/deleteResource/' + busId + '?access_token=' + accessToken,
type: 'POST',
async: false,
contentType: 'application/json',
data: JSON.stringify(deletes)
}).done(function (response) {
if (response.success) {
layer.msg('取消绑定成功!', {icon: 1, time: 3000});
reloadTable(resType,busId);
} else {
layer.msg('取消绑定失败!', {icon: 2, time: 3000});
}
});
}
//获取展示类型的字典数据
function initShowType(){
if(mode){//如果不展示字段就不去请求
admin.req({
url: domainName + '/api-web/manage/ddic/findSucDdics/DETAILS_POWER'
, method: 'POST'
, async: false
, success: function (res) {
$.each(res.data, function (i, v) {
showTypeList.push({
name: v.ddicName
,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
})
});
}
});
}
}
//刷新表格
function reloadTable(resType,busId) {
table.reload('bustype_reslist_resListTable', {
url: common.domainName + '/api-web/home/res-list/' + (resType ? resType : 'all'),
where: {
access_token: accessToken,
resName: $("#bustype_reslist_keyword").val(),
busId: busId,
resHealth: $("#bustype_reslist_resStatus").val()
}
});
}
//获取选中的数据
function getCheckData() {
if(mode){
//获取改变的值
var str='';
var $tr=$('#bustype-table').next().find('tbody tr');
$.each($tr,function (i,v) {
var $btn=$(this).find('.btn-bustype-unbind');
var showType=$(this).find('.resourceType_showType') && $(this).find('.resourceType_showType').eq(0) && $(this).find('.resourceType_showType').eq(0).val() ? $(this).find('.resourceType_showType').eq(0).val():'<';
if(!$btn.hasClass('hide')){
str += $btn.attr("data-id")+'_'+showType+',';
}
});
if(str!=''){
str=str.substring(0,str.length-1);
}
return str;
}else{
return busTypeTable.checkStatus(false);
}
}
return {getData: getCheckData};
});
});
... ...
/**
@Name:layuiAdmin 核心模块
@Author:贤心
@Site:http://www.layui.com/admin/
@License:LPPL
*/
layui.define(['view'], function(exports){
var $ = layui.jquery
,laytpl = layui.laytpl
,element = layui.element
,setter = layui.setter
,view = layui.view
,layer = layui.layer
,sessions = layui.sessions
,device = layui.device()
,$win = $(window), $body = $('body')
,container = $('#'+ setter.container)
,SHOW = 'layui-show', HIDE = 'layui-hide', THIS = 'layui-this', DISABLED = 'layui-disabled', TEMP = 'template'
,APP_BODY = '#LAY_app_body', APP_FLEXIBLE = 'LAY_app_flexible'
,FILTER_TAB_TBAS = 'layadmin-layout-tabs'
,APP_SPREAD_SM = 'layadmin-side-spread-sm', TABS_BODY = 'layadmin-tabsbody-item'
,ICON_SHRINK = 'layui-icon-shrink-right', ICON_SPREAD = 'layui-icon-spread-left'
,SIDE_SHRINK = 'layadmin-side-shrink', SIDE_MENU = 'LAY-system-side-menu'
// ,accessToken = sessions.getToken()['access_token']
//通用方法
,admin = {
domainName: sessionStorage.getItem('domainName'), // gateway地址
v: '1.2.1 pro'
//数据的异步请求
,req: view.req
//清除本地 token,并跳转到登入页
,exit: view.exit
//xss 转义
,escape: function(html){
return String(html || '').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&amp;')
.replace(/</g, '&lt;').replace(/>/g, '&gt;')
.replace(/'/g, '&#39;').replace(/"/g, '&quot;');
}
//事件监听
,on: function(events, callback){
return layui.onevent.call(this, setter.MOD_NAME, events, callback);
}
//弹出面板
,popup: view.popup
//右侧面板
,popupRight: function(options){
//layer.close(admin.popup.index);
return admin.popup.index = layer.open($.extend({
type: 1
,id: 'LAY_adminPopupR'
,anim: -1
,title: false
,closeBtn: false
,offset: 'r'
,shade: 0.1
,shadeClose: true
,skin: 'layui-anim layui-anim-rl layui-layer-adminRight'
,area: '300px'
}, options));
}
//发送验证码
,sendAuthCode: function(options){
options = $.extend({
seconds: 60
,elemPhone: '#LAY_phone'
,elemVercode: '#LAY_vercode'
}, options);
var seconds = options.seconds
,token = null
,timer, countDown = function(loop){
var btn = $(options.elem)
seconds--;
if(seconds < 0){
btn.removeClass(DISABLED).html('获取验证码');
seconds = options.seconds;
clearInterval(timer);
} else {
btn.addClass(DISABLED).html(seconds + '秒后重获');
}
if(!loop){
timer = setInterval(function(){
countDown(true);
}, 1000);
}
};
$body.off('click', options.elem).on('click', options.elem, function(){
options.elemPhone = $(options.elemPhone);
options.elemVercode = $(options.elemVercode);
var elemPhone = options.elemPhone
,value = elemPhone.val();
if(seconds !== options.seconds || $(this).hasClass(DISABLED)) return;
if(!/^1\d{10}$/.test(value)){
elemPhone.focus();
return layer.msg('请输入正确的手机号')
};
if(typeof options.ajax === 'object'){
var success = options.ajax.success;
delete options.ajax.success;
}
admin.req($.extend(true, {
url: '/auth/code'
,type: 'get'
,data: {
phone: value
}
,success: function(res){
layer.msg('验证码已发送至你的手机,请注意查收', {
icon: 1
,shade: 0
});
options.elemVercode.focus();
countDown();
success && success(res);
}
}, options.ajax));
});
}
//屏幕类型
,screen: function(){
var width = $win.width();
if(width > 1200){
return 3; //大屏幕
} else if(width > 992){
return 2; //中屏幕
} else if(width > 768){
return 1; //小屏幕
} else {
return 0; //超小屏幕
}
}
//侧边伸缩
,sideFlexible: function(status){
var app = container
,iconElem = $('#'+ APP_FLEXIBLE)
,screen = admin.screen();
//设置状态,PC:默认展开、移动:默认收缩
if(status === 'spread'){
//切换到展开状态的 icon,箭头:←
iconElem.removeClass(ICON_SPREAD).addClass(ICON_SHRINK);
//移动:从左到右位移;PC:清除多余选择器恢复默认
if(screen < 2){
app.addClass(APP_SPREAD_SM);
} else {
app.removeClass(APP_SPREAD_SM);
}
app.removeClass(SIDE_SHRINK)
} else {
//切换到搜索状态的 icon,箭头:→
iconElem.removeClass(ICON_SHRINK).addClass(ICON_SPREAD);
//移动:清除多余选择器恢复默认;PC:从右往左收缩
if(screen < 2){
app.removeClass(SIDE_SHRINK);
} else {
app.addClass(SIDE_SHRINK);
}
app.removeClass(APP_SPREAD_SM)
}
layui.event.call(this, setter.MOD_NAME, 'side({*})', {
status: status
});
}
//重置主体区域表格尺寸
,resizeTable: function(delay){
var that = this, runResizeTable = function(){
that.tabsBody(admin.tabsPage.index).find('.layui-table-view').each(function(){
var tableID = $(this).attr('lay-id');
layui.table.resize(tableID);
});
};
if(!layui.table) return;
delay ? setTimeout(runResizeTable, delay) : runResizeTable();
}
//主题设置
,theme: function(options){
var theme = setter.theme
,local = layui.data(setter.tableName)
,id = 'LAY_layadmin_theme'
,style = document.createElement('style')
,styleText = laytpl([
//主题色
'.layui-side-menu,'
,'.layadmin-pagetabs .layui-tab-title li:after,'
,'.layadmin-pagetabs .layui-tab-title li.layui-this:after,'
,'.layui-layer-admin .layui-layer-title,'
,'.layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child'
,'{background-color:{{d.color.main}} !important;}'
//选中色
,'.layui-nav-tree .layui-this,'
,'.layui-nav-tree .layui-this>a,'
,'.layui-nav-tree .layui-nav-child dd.layui-this,'
,'.layui-nav-tree .layui-nav-child dd.layui-this a'
,'{background-color:{{d.color.selected}} !important;}'
//logo
,'.layui-layout-admin .layui-logo{background-color:{{d.color.logo || d.color.main}} !important;}'
//头部色
,'{{# if(d.color.header){ }}'
,'.layui-layout-admin .layui-header{background-color:{{ d.color.header }};}'
,'.layui-layout-admin .layui-header a,'
,'.layui-layout-admin .layui-header a cite{color: #f8f8f8;}'
,'.layui-layout-admin .layui-header a:hover{color: #fff;}'
,'.layui-layout-admin .layui-header .layui-nav .layui-nav-more{border-top-color: #fbfbfb;}'
,'.layui-layout-admin .layui-header .layui-nav .layui-nav-mored{border-color: transparent; border-bottom-color: #fbfbfb;}'
,'.layui-layout-admin .layui-header .layui-nav .layui-this:after, .layui-layout-admin .layui-header .layui-nav-bar{background-color: #fff; background-color: rgba(255,255,255,.5);}'
,'.layadmin-pagetabs .layui-tab-title li:after{display: none;}'
,'{{# } }}'
].join('')).render(options = $.extend({}, local.theme, options))
,styleElem = document.getElementById(id);
//添加主题样式
if('styleSheet' in style){
style.setAttribute('type', 'text/css');
style.styleSheet.cssText = styleText;
} else {
style.innerHTML = styleText;
}
style.id = id;
styleElem && $body[0].removeChild(styleElem);
$body[0].appendChild(style);
$body.attr('layadmin-themealias', options.color.alias);
//本地存储记录
local.theme = local.theme || {};
layui.each(options, function(key, value){
local.theme[key] = value;
});
layui.data(setter.tableName, {
key: 'theme'
,value: local.theme
});
}
//初始化主题
,initTheme: function(index){
var theme = setter.theme;
index = index || 0;
if(theme.color[index]){
theme.color[index].index = index;
admin.theme({
color: theme.color[index]
});
}
}
//记录最近一次点击的页面标签数据
,tabsPage: {}
//wtc 给主页判断使用
,mainTabsPage: {}
//获取标签页的头元素
,tabsHeader: function(index){
return $('#LAY_app_tabsheader').children('li').eq(index || 0);
}
//获取页面标签主体元素
,tabsBody: function(index){
return $(APP_BODY).find('.'+ TABS_BODY).eq(index || 0);
}
//切换页面标签主体
,tabsBodyChange: function(index){
admin.tabsHeader(index).attr('lay-attr', layui.router().href);
admin.tabsBody(index).addClass(SHOW).siblings().removeClass(SHOW);
events.rollPage('auto', index);
}
//resize事件管理
,resize: function(fn){
var router = layui.router()
,key = router.path.join('-');
if(admin.resizeFn[key]){
$win.off('resize', admin.resizeFn[key]);
delete admin.resizeFn[key];
}
if(fn === 'off') return; //如果是清除 resize 事件,则终止往下执行
fn(), admin.resizeFn[key] = fn;
$win.on('resize', admin.resizeFn[key]);
}
,resizeFn: {}
,runResize: function(){
var router = layui.router()
,key = router.path.join('-');
admin.resizeFn[key] && admin.resizeFn[key]();
}
,delResize: function(){
this.resize('off');
}
//关闭当前 pageTabs
,closeThisTabs: function(){
if(!admin.tabsPage.index) return;
$(TABS_HEADER).eq(admin.tabsPage.index).find('.layui-tab-close').trigger('click');
}
//全屏
,fullScreen: function(){
var ele = document.documentElement
,reqFullScreen = ele.requestFullScreen || ele.webkitRequestFullScreen
|| ele.mozRequestFullScreen || ele.msRequestFullscreen;
if(typeof reqFullScreen !== 'undefined' && reqFullScreen) {
reqFullScreen.call(ele);
};
}
//退出全屏
,exitScreen: function(){
var ele = document.documentElement
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
//纠正单页路由格式
,correctRouter: function(href){
if(!/^\//.test(href)) href = '/' + href;
//纠正首尾
return href.replace(/^(\/+)/, '/')
.replace(new RegExp('\/' + setter.entry + '$'), '/'); //过滤路由最后的默认视图文件名(如:index)
}
//……
};
//事件
var events = admin.events = {
//伸缩
flexible: function(othis){
var iconElem = othis.find('#'+ APP_FLEXIBLE)
,isSpread = iconElem.hasClass(ICON_SPREAD);
admin.sideFlexible(isSpread ? 'spread' : null); //控制伸缩
admin.resizeTable(350);
setTimeout(function () {
// 伸缩导致页面变化重新绘制下页面上对尺寸敏感的元素
window.resizeEventFn();
}, 500);
}
//刷新
,refresh: function(){
layui.index.render();
}
//输入框搜索
,serach: function(othis){
othis.off('keypress').on('keypress',function(e){
if(!this.value.replace(/\s/g, '')) return;
//回车跳转
if(e.keyCode === 13){
var href = othis.attr('lay-action')
,text = othis.attr('lay-text') || '搜索';
href = href + this.value;
text = text + ' <span style="color: #FF5722;">'+ admin.escape(this.value) +'</span>';
//打开标签页
location.hash = admin.correctRouter(href)
//如果搜索关键词已经打开,则刷新页面即可
events.serach.keys || (events.serach.keys = {});
events.serach.keys[admin.tabsPage.index] = this.value;
if(this.value === events.serach.keys[admin.tabsPage.index]){
events.refresh(othis);
}
//清空输入框
this.value = '';
}
});
}
//点击消息
,message: function(othis){
othis.find('.layui-badge-dot').remove();
}
//弹出主题面板
,theme: function(){
admin.popupRight({
id: 'LAY_adminPopupTheme'
,success: function(){
view(this.id).render('system/theme')
}
});
}
//便签
,note: function(othis){
var mobile = admin.screen() < 2
,note = layui.data(setter.tableName).note;
events.note.index = admin.popup({
title: '便签'
,shade: 0
,offset: [
'41px'
,(mobile ? null : (othis.offset().left - 250) + 'px')
]
,anim: -1
,id: 'LAY_adminNote'
,skin: 'layadmin-note layui-anim layui-anim-upbit'
,content: '<textarea placeholder="内容"></textarea>'
,resize: false
,success: function(layero, index){
var textarea = layero.find('textarea')
,value = note === undefined ? '便签中的内容会存储在本地,这样即便你关掉了浏览器,在下次打开时,依然会读取到上一次的记录。是个非常小巧实用的本地备忘录' : note;
textarea.val(value).focus().on('keyup', function(){
layui.data(setter.tableName, {
key: 'note'
,value: this.value
});
});
}
})
}
//全屏
,fullscreen: function(othis){
var SCREEN_FULL = 'layui-icon-screen-full'
,SCREEN_REST = 'layui-icon-screen-restore'
,iconElem = othis.children("i");
if(iconElem.hasClass(SCREEN_FULL)){
admin.fullScreen();
iconElem.addClass(SCREEN_REST).removeClass(SCREEN_FULL);
} else {
admin.exitScreen();
iconElem.addClass(SCREEN_FULL).removeClass(SCREEN_REST);
}
}
//弹出关于面板
,about: function(){
admin.popupRight({
id: 'LAY_adminPopupAbout'
,success: function(){
view(this.id).render('system/about')
}
});
}
//弹出更多面板
,more: function(){
admin.popupRight({
id: 'LAY_adminPopupMore'
,success: function(){
view(this.id).render('system/more')
}
});
}
//返回上一页
,back: function(){
history.back();
}
//主题设置
,setTheme: function(othis){
var index = othis.data('index')
,nextIndex = othis.siblings('.layui-this').data('index');
if(othis.hasClass(THIS)) return;
othis.addClass(THIS).siblings('.layui-this').removeClass(THIS);
admin.initTheme(index);
}
//左右滚动页面标签
,rollPage: function(type, index){
var tabsHeader = $('#LAY_app_tabsheader')
,liItem = tabsHeader.children('li')
,scrollWidth = tabsHeader.prop('scrollWidth')
,outerWidth = tabsHeader.outerWidth()
,tabsLeft = parseFloat(tabsHeader.css('left'));
//右左往右
if(type === 'left'){
if(!tabsLeft && tabsLeft <=0) return;
//当前的left减去可视宽度,用于与上一轮的页标比较
var prefLeft = -tabsLeft - outerWidth;
liItem.each(function(index, item){
var li = $(item)
,left = li.position().left;
if(left >= prefLeft){
tabsHeader.css('left', -left);
return false;
}
});
} else if(type === 'auto'){ //自动滚动
(function(){
var thisLi = liItem.eq(index), thisLeft;
if(!thisLi[0]) return;
thisLeft = thisLi.position().left;
//当目标标签在可视区域左侧时
if(thisLeft < -tabsLeft){
return tabsHeader.css('left', -thisLeft);
}
//当目标标签在可视区域右侧时
if(thisLeft + thisLi.outerWidth() >= outerWidth - tabsLeft){
var subLeft = thisLeft + thisLi.outerWidth() - (outerWidth - tabsLeft);
liItem.each(function(i, item){
var li = $(item)
,left = li.position().left;
//从当前可视区域的最左第二个节点遍历,如果减去最左节点的差 > 目标在右侧不可见的宽度,则将该节点放置可视区域最左
if(left + tabsLeft > 0){
if(left - tabsLeft > subLeft){
tabsHeader.css('left', -left);
return false;
}
}
});
}
}());
} else {
//默认向左滚动
liItem.each(function(i, item){
var li = $(item)
,left = li.position().left;
if(left + li.outerWidth() >= outerWidth - tabsLeft){
tabsHeader.css('left', -left);
return false;
}
});
}
}
, globalSearch: function (type, index) {
var othis = $(this);
var href="globalSearch/index"
//搜索框检索,暂时不用
// var keywords = $('#allSearchKeywords').val();
// if (keywords.trim() === '') {
// return false;
// } else {
// var loading = layer.load(2);
// $.ajax({
// url: admin.domainName + '/api-web/home/hasResult?keywords=' + keywords + '&access_token=' + localStorage.getItem('access_token'),
// type: 'get',
// async: false,
// success: function (res) {
// layer.close(loading);
// if (res) {
// if (res.count === 0) {
// layer.msg('未查到任何数据!', { offset: '15px' , icon: 7, time: 2000});
// } else {
// admin.tabsPage.elem = othis;
// //执行跳转
// sessionStorage.setItem('keywords',keywords);
// href = admin.correctRouter(href);
// if(location.hash !== '#' + href) {
// location.hash = href;
// } else {
// layui.index.render();
// }
// }
// }
// }
// })
// }
layer.prompt({
id: "all_search_id",
title: '全局关键字搜索',
formType: 0,
area: ['300px','200px'],
offset: 'auto'
}, function (value, index) {
if (value.trim() !== '') {
layer.close(index);
var loading = layer.load(2);
$.ajax({
url: admin.domainName + '/api-web/home/hasResult?keywords=' + value + '&access_token=' + localStorage.getItem('access_token'),
type: 'get',
async: false,
success: function (res) {
layer.close(loading);
if (res) {
if (res.count === 0) {
layer.msg('未查到任何数据!', { offset: '15px' , icon: 7, time: 2000});
} else {
admin.tabsPage.elem = othis;
//执行跳转
sessionStorage.setItem('keywords',value);
href = admin.correctRouter(href);
if(location.hash !== '#' + href) {
location.hash = href;
} else {
layui.index.render();
}
}
}
}
})
} else {
return false;
}
});
$("#all_search_id").find('input.layui-layer-input').attr("placeholder", "关键字查询(必填)").attr("autocomplete","off");
$("#all_search_id").find('input.layui-layer-input').attr("id", "allSearchConfirm");
$("#all_search_id").find('input.layui-layer-input').css("width",'96%');
$("#all_search_id").append('<br/>' +
'<div style="margin-top: 25px"><span>注:支持资源名称、别名、资源类型、业务类型、ip地址等关键字查询!</span></div>');
//全局搜索框弹窗回车事件
$("#all_search_id").find('input.layui-layer-input').keydown(function (e) {
if (e.keyCode === 13) {
$("#all_search_id").next().next().find('.layui-layer-btn0').trigger("click");
}
})
}
, toBigScreen: function () {
window.open(sessionStorage.getItem("bigScreen") + '?access_token=' + localStorage.getItem("access_token"));
}
, toYTHViewScreen: function () {
window.open(sessionStorage.getItem("ythView") + '?access_token=' + localStorage.getItem("access_token"));
}
//向右滚动页面标签
, leftPage: function () {
events.rollPage('left');
}
//向左滚动页面标签
, rightPage: function () {
events.rollPage();
}
//关闭当前标签页
, closeThisTabs: function () {
admin.closeThisTabs();
}
//关闭其它标签页
, closeOtherTabs: function (type) {
var TABS_REMOVE = 'LAY-system-pagetabs-remove';
if(type === 'all'){
$(TABS_HEADER+ ':gt(0)').remove();
$(APP_BODY).find('.'+ TABS_BODY+ ':gt(0)').remove();
} else {
$(TABS_HEADER).each(function(index, item){
if(index && index != admin.tabsPage.index){
$(item).addClass(TABS_REMOVE);
admin.tabsBody(index).addClass(TABS_REMOVE);
}
});
$('.'+ TABS_REMOVE).remove();
}
}
//关闭全部标签页
,closeAllTabs: function(){
events.closeOtherTabs('all');
location.hash = '';
}
//遮罩
,shade: function(){
admin.sideFlexible();
}
};
//初始
!function(){
//主题初始化,本地主题记录优先,其次为 initColorIndex
var local = layui.data(setter.tableName);
if(local.theme){
admin.theme(local.theme);
} else if(setter.theme){
admin.initTheme(setter.theme.initColorIndex);
}
//禁止水平滚动
$body.addClass('layui-layout-body');
//移动端强制不开启页面标签功能
if(admin.screen() < 1){
delete setter.pageTabs;
}
//不开启页面标签时
if(!setter.pageTabs){
container.addClass('layadmin-tabspage-none');
}
//低版本IE提示
if(device.ie && device.ie < 10){
view.error('IE'+ device.ie + '下访问可能不佳,推荐使用:Chrome / Firefox / Edge 等高级浏览器', {
offset: 'auto'
,id: 'LAY_errorIE'
});
}
}();
//admin.prevRouter = {}; //上一个路由
//监听 hash 改变侧边状态
admin.on('hash(side)', function(router){
var path = router.path, getData = function(item){
return {
list: item.children('.layui-nav-child')
,name: item.data('name')
,jump: item.data('jump')
}
}
,sideMenu = $('#'+ SIDE_MENU)
,SIDE_NAV_ITEMD = 'layui-nav-itemed'
//捕获对应菜单
,matchMenu = function(list){
var pathURL = admin.correctRouter(path.join('/'));
list.each(function(index1, item1){
var othis1 = $(item1)
,data1 = getData(othis1)
,listChildren1 = data1.list.children('dd')
,matched1 = path[0] == data1.name || (index1 === 0 && !path[0])
|| (data1.jump && pathURL == admin.correctRouter(data1.jump));
listChildren1.each(function(index2, item2){
var othis2 = $(item2)
,data2 = getData(othis2)
,listChildren2 = data2.list.children('dd')
,matched2 = (path[0] == data1.name && path[1] == data2.name)
|| (data2.jump && pathURL == admin.correctRouter(data2.jump));
listChildren2.each(function(index3, item3){
var othis3 = $(item3)
,data3 = getData(othis3)
,matched3 = (path[0] == data1.name && path[1] == data2.name && path[2] == data3.name)
|| (data3.jump && pathURL == admin.correctRouter(data3.jump))
if(matched3){
var selected = data3.list[0] ? SIDE_NAV_ITEMD : THIS;
othis3.addClass(selected).siblings().removeClass(selected); //标记选择器
return false;
}
});
if(matched2){
var selected = data2.list[0] ? SIDE_NAV_ITEMD : THIS;
othis2.addClass(selected).siblings().removeClass(selected); //标记选择器
return false
}
});
if(matched1){
var selected = data1.list[0] ? SIDE_NAV_ITEMD : THIS;
if(selected !== SIDE_NAV_ITEMD){
othis1.addClass(selected).siblings().removeClass(selected); //标记选择器
}else{
othis1.addClass(selected);
}
// othis1.addClass(selected).siblings().removeClass(selected); //标记选择器
return false;
}
});
}
//重置状态
sideMenu.find('.'+ THIS).removeClass(THIS);
//移动端点击菜单时自动收缩
if(admin.screen() < 2) admin.sideFlexible();
//开始捕获
matchMenu(sideMenu.children('li'));
});
//监听侧边导航点击事件
element.on('nav(layadmin-system-side-menu)', function(elem){
if(elem.siblings('.layui-nav-child')[0] && container.hasClass(SIDE_SHRINK)){
admin.sideFlexible('spread');
layer.close(elem.data('index'));
};
admin.tabsPage.type = 'nav';
admin.mainTabsPage.type = 'nav';
});
//监听选项卡的更多操作
element.on('nav(layadmin-pagetabs-nav)', function(elem){
var dd = elem.parent();
dd.removeClass(THIS);
dd.parent().removeClass(SHOW);
});
//同步路由
var setThisRouter = function(othis){
var layid = othis.attr('lay-id')
,attr = othis.attr('lay-attr')
,index = othis.index();
location.hash = layid === setter.entry ? '/' : (attr || '/');
admin.tabsBodyChange(index);
}
,TABS_HEADER = '#LAY_app_tabsheader>li';
//页面标签点击
$body.on('click', TABS_HEADER, function(){
var othis = $(this)
,index = othis.index();
admin.tabsPage.type = 'tab';
admin.mainTabsPage.type = 'tab';
admin.tabsPage.index = index;
//如果是iframe类型的标签页
if(othis.attr('lay-attr') === 'iframe'){
return admin.tabsBodyChange(index);
};
setThisRouter(othis); //同步路由
admin.runResize(); //执行resize事件,如果存在的话
admin.resizeTable(); //重置当前主体区域的表格尺寸
});
//监听 tabspage 删除
element.on('tabDelete(layadmin-layout-tabs)', function(obj){
var othis = $(TABS_HEADER+ '.layui-this');
obj.index && admin.tabsBody(obj.index).remove();
setThisRouter(othis);
//移除resize事件
admin.delResize();
});
//页面跳转
$body.on('click', '*[lay-href]', function(){
var othis = $(this)
,href = othis.attr('lay-href')
,router = layui.router();
admin.tabsPage.elem = othis;
//admin.prevRouter[router.path[0]] = router.href; //记录上一次各菜单的路由信息
//执行跳转
location.hash = admin.correctRouter(href);
});
//点击事件
$body.on('click', '*[layadmin-event]', function(){
var othis = $(this)
,attrEvent = othis.attr('layadmin-event');
events[attrEvent] && events[attrEvent].call(this, othis);
});
//tips
$body.on('mouseenter', '*[lay-tips]', function(){
var othis = $(this);
if(othis.parent().hasClass('layui-nav-item') && !container.hasClass(SIDE_SHRINK)) return;
var tips = othis.attr('lay-tips')
,offset = othis.attr('lay-offset')
,direction = othis.attr('lay-direction')
,index = layer.tips(tips, this, {
tips: direction || 1
,time: -1
,success: function(layero, index){
if(offset){
layero.css('margin-left', offset + 'px');
}
}
});
othis.data('index', index);
}).on('mouseleave', '*[lay-tips]', function(){
layer.close($(this).data('index'));
});
//点击A-view3.1收缩菜单栏
admin.events.lefMenuflexible = function () {
var leftbox = $("#LAY_app");
if(leftbox.hasClass("layadmin-side-shrink")){
leftbox.removeClass("layadmin-side-shrink");
}else{
leftbox.addClass("layadmin-side-shrink");
}
}
//窗口resize事件
var resizeSystem = layui.data.resizeSystem = function(){
//layer.close(events.note.index);
layer.closeAll('tips');
if(!resizeSystem.lock){
setTimeout(function(){
admin.sideFlexible(admin.screen() < 2 ? '' : 'spread');
delete resizeSystem.lock;
}, 100);
}
resizeSystem.lock = true;
}
$win.on('resize', layui.data.resizeSystem);
//接口输出
exports('admin', admin);
});
... ...
<!--默认布局-->
<div class="layui-layout layui-layout-admin">
<script>
var show = location.search.substr(1).split("&")[0].split("=")[1];
if(show === '0'){
document.querySelector("body").classList.add("layout-nav-hide");
}
var editFlag = location.search.substr(1).split("&")[1];
if(editFlag){
var name = editFlag.split("=")[0];
var val = editFlag.split("=")[1] == "true"?true:false;
if(name === "editFlag"){
localStorage.setItem("editFlag",val);
}
}
var menuIsopen = 'false';
layui.use(['jquery'], function () {
var $ = layui.jquery;
// 读取配置文件
$.ajax({
url: sessionStorage.getItem('domainName') + '/api-web/sysConf/getByCode',
async: false,
data: {
code: 'view_menu_isopen',
access_token: localStorage.getItem('access_token')
},
success(response) {
if (response && response.success && response.object) {
menuIsopen = response.object.value;
}
}
});
});
</script>
<div class="layui-header">
<!-- 头部区域 -->
<ul class="layui-nav layui-layout-left">
<li class="layui-nav-item layadmin-flexible" lay-unselect>
<a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
<i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
</a>
</li>
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;" layadmin-event="refresh" title="刷新">
<i class="layui-icon layui-icon-refresh-3"></i>
</a>
</li>
</ul>
<img src="/src/style/img/logo-tj.png" class="logo">
<ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
<!--搜索框检索-->
<!-- <li class="layui-nav-item layui-hide-xs">-->
<!-- <input type="text" class="layui-input" id="allSearchKeywords" style="margin-top: 6px">-->
<!-- </li>-->
<li class="layui-nav-item layui-hide-xs" lay-tips="全局搜索">
<a href="javascript:;" layadmin-event="globalSearch"><i class="layui-icon layui-icon-search"></i></a>
</li>
<li class="layui-nav-item" lay-tips="一体化视图">
<a href="javascript:;" layadmin-event="toYTHViewScreen"><i class="layui-icon layui-icon-chart-screen"></i></a>
</li>
<li class="layui-nav-item" lay-tips="大屏">
<a href="javascript:;" layadmin-event="toBigScreen"><i class="layui-icon layui-icon-chart-screen"></i></a>
</li>
<li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>
<a href="javascript:;" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a href="javascript:;" layadmin-event="theme">
<i class="layui-icon layui-icon-theme"></i>
</a>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a href="javascript:;" layadmin-event="fullscreen">
<i class="layui-icon layui-icon-screen-full"></i>
</a>
</li>
<!-- 报表通知统计 -->
<li class="layui-nav-item" lay-unselect>
<script type="text/html" template lay-url="{{sessionStorage.getItem('domainName')}}/api-web/home/messageRemind">
<a href="javascript:;" class="notice_msg">
<i class="layui-icon layui-icon-notice"></i><span>{{d.map==null? 0 : d.map.totalCountByUser}}</span>
</a>
<dl class="layui-nav-child">
<dd><a href="javascript:;" lay-href="/alarm/activewarning">活动告警:{{d.map==null? 0 : d.map.totalCountByUser}}</a></dd>
<!-- <hr>-->
<!-- <dd><a href="javascript:;" lay-href="/iframe/insp/monitor/flag=0">未处理报表:{{d.map==null? 0 : d.map.statusCountByUser}}</a></dd>-->
<!-- <hr>-->
<!-- <dd><a href="javascript:;" lay-href="/iframe/insp/workview/read=0/type=1">工作汇报未读:{{d.map==null? 0 : d.map.notReadCountByUser}}</a></dd>-->
<!-- <hr>-->
<!-- <dd><a href="javascript:;" lay-href="/iframe/insp/notice/t=day">今日通知:{{d.map==null? 0 : d.map.countByUserAndToday}}</a></dd>-->
</dl>
</script>
</li>
<li class="layui-nav-item" lay-unselect>
<script type="text/html" template lay-url="{{sessionStorage.getItem('domainName')}}/api-user/users/getUserByToken"
lay-done="layui.element.render('nav', 'layadmin-layout-right');">
<a href="javascript:;">
欢迎&nbsp;&nbsp;<cite style="color: #1E9FFF">{{d.object.nickname}}</cite>
</a>
{{#
var roles = '';
layui.each(d.object.sysRoles, function(idx, role){
roles += role.code+",";
});
}}
<li><input type="hidden" id="user_roles" value="{{roles}}"></li>
<dl class="layui-nav-child">
<dd layadmin-event="updtpswd" style="text-align: center;"><a>修改密码</a></dd>
<dd layadmin-event="logout" style="text-align: center;"><a>退出</a></dd>
</dl>
</script>
</li>
<!-- <script type="text/html" template lay-url="{{sessionStorage.getItem('domainName')}}/api-user/users/getUserByToken"-->
<!-- lay-done="layui.element.render('nav', 'layadmin-text-name');">-->
<!-- <li class="layui-nav-item layui-hide-xs" lay-unselect lay-filter="layadmin-text-name">-->
<!-- <a href="javascript:;" style="text-align: center;" >欢迎&nbsp;&nbsp;<b id="user-name" lay-tips="点击退出" layadmin-event="logout" style="color: #3d9fe6">{{d.object.nickname }}</b></a>-->
<!-- </li>-->
<!-- </script>-->
</ul>
</div>
<!-- 侧边菜单 -->
<!-- 先获取默认菜单拼接 d.str 返回数据格式 modeleid#path-->
<!-- 如果配置默认首页,则给默认首页,否则给工作台(moduleid为work,path为work/index)-->
<div class="layui-side layui-side-menu">
<div class="layui-side-scroll">
<script type="text/html" template lay-url="{{sessionStorage.getItem('domainName')}}/api-user/menus/current?type=1"
lay-done="layui.element.render('nav', 'layadmin-system-side-menu');" id="TPL_layout">
{{#
var dataName = layui.setter.response.dataName;
var fisthref = "/index";
var defaultMenu = d.str;
var defaultModuleid = '';
var defaultPath = '';
if(defaultMenu && defaultMenu != ''){
defaultModuleid = d.str.split('#')[0];
defaultPath = d.str.split('#')[1];
fisthref = defaultPath;
}
}}
<div class="layui-logo" lay-href="{{fisthref}}">
<span>{{ layui.setter.name || 'layuiAdmin' }}</span>
</div>
<ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu"
lay-filter="layadmin-system-side-menu">
{{#
var show = location.search.substr(1).split("&")[0].split("=")[1];
if(show == '1') window.history.pushState({} ,'' ,'#');
if(show != '0') location.hash = "/";
var path = layui.router().path
,pathURL = layui.admin.correctRouter(path.join('/'))
,dataName = layui.setter.response.dataName;
var fistModuleid = '';
if(d && d[dataName].length>0){
fistModuleid = d[dataName][0].moduleid;
}
layui.each(d[dataName], function(index, item){
var isselectd = '';
var isSelectedModuleid = '';
if(defaultModuleid != '' || item.moduleid != ''){
if(item.moduleid == defaultModuleid){
isselectd = "layui-this";
}else{
isselectd = "";
}
}else {
if(!defaultModuleid || defaultModuleid == ''){
if(index = 0){
isselectd = "layui-this";
}
}else{
isselectd = "";
}
}
var hasChildren = typeof item.subMenus === 'object' && item.subMenus && item.subMenus.length > 0
,classSelected = function(){
var match = path[0] == item.moduleid || (index == 0 && !path[0]) || (item.path && pathURL ==
layui.admin.correctRouter(item.path)) || item.spread;
if(match){
return hasChildren ? 'layui-nav-itemed' : 'layui-nav-itemed';
}
return '';
}
,url = (item.path && typeof item.path === 'string') ? item.path : item.moduleid;
var closeMenuEvent = '';
if(item.moduleid == 'biz' || item.moduleid == 'res'){ closeMenuEvent = 'closeMenu'}
}}
<li data-name="{{ item.moduleid || '' }}" data-jump="{{ item.path || '' }}"
class="layui-nav-item {{ menuIsopen == 'true' ? 'layui-nav-itemed' : '' }} {{isselectd}}">
{{# if(item.moduleid == 'cmdbsys' || item.moduleid == 'sxview' || item.moduleid == 'dpsys'){ }}
<a href="javascript:;" layadmin-event="{{item.moduleid}}" lay-tips="{{ item.name
}}" lay-direction="2">
<i class="layui-icon {{ item.css }}"></i>
<cite>{{ item.name }}</cite>
</a>
{{# } }}
{{# if(item.moduleid != 'cmdbsys' && item.moduleid != 'sxview' && item.moduleid != 'dpsys'){ }}
<a href="javascript:;" {{ hasChildren ? '' : 'lay-href="'+ url +'"' }} layadmin-event="{{closeMenuEvent}}" lay-tips="{{ item.name
}}" lay-direction="2">
<i class="layui-icon {{ item.css }}"></i>
<cite>{{ item.name }}</cite>
</a>
{{# } }}
{{# if(hasChildren){ }}
<dl class="layui-nav-child">
{{# layui.each(item.subMenus, function(index2, item2){
if(item2.moduleid && item2.moduleid == defaultModuleid){
isselectd = "layui-this";
}else{
isselectd = "";
}
var hasChildren2 = typeof item2.subMenus == 'object' && item2.subMenus &&
item2.subMenus.length > 0
,classSelected2 = function(){
var match = (path[0] == item.moduleid && path[1] == item2.moduleid) || (item2.path &&
pathURL == layui.admin.correctRouter(item2.path)) || item2.spread;
return '';
}
,url2 = (item2.path && typeof item2.path === 'string')
? item2.path
: [item.moduleid, item2.moduleid, ''].join('/');
}}
<dd data-name="{{ item2.moduleid || '' }}" data-jump="{{ item2.path || '' }}"
class="layui-nav-item {{ classSelected2() }} {{isselectd}}"
>
{{# if(item2.menuDesc.indexOf('第三方') == '-1') {}}
<a href="javascript:;" {{ hasChildren2 ? '' : 'lay-href="'+ url2 +'"' }}>{{ item2.name }}</a>
{{# }else{ }}
<a href="javascript:;" {{ hasChildren2 ? '' : 'data-url="'+ url2 +'" layadmin-event="IntegratedEntrance"' }} data-moduleid="{{item2.moduleid}}">{{ item2.name }}</a>
{{# } }}
{{# if(hasChildren2){ }}
<dl class="layui-nav-child {{}}">
{{# layui.each(item2.subMenus, function(index3, item3){
var match = (path[0] == item.moduleid && path[1] == item2.moduleid && path[2] ==
item3.moduleid)
|| (item3.path && pathURL == layui.admin.correctRouter(item3.path))
,url3 = (item3.path && typeof item3.path === 'string')
? item3.path
: [item.moduleid, item2.moduleid, item3.moduleid].join('/')
}}
<dd data-name="{{ item3.moduleid || '' }}" data-jump="{{ item3.path || '' }}">
{{# if(item2.menuDesc.indexOf('第三方') == '-1') {}}
<a href="javascript:;" lay-href="{{ url3 }}" {{ item3.iframe ? 'lay-iframe="true"' : ''}}>{{ item3.name }}</a>
{{# }else{ }}
<a href="javascript:;" data-url="{{ url3 }}" layadmin-event="IntegratedEntrance" data-moduleid="{{item3.moduleid}}">{{ item3.name }}</a>
{{# } }}
</dd>
{{# }); }}
</dl>
{{# } }}
</dd>
{{# }); }}
</dl>
{{# } }}
</li>
{{# }); }}
</ul>
</script>
</div>
<div class="right-bottom-tips"></div>
</div>
<!-- 页面标签 -->
<script type="text/html" template lay-url="{{sessionStorage.getItem('domainName')}}/api-user/menus/findSettingDefaultMenus"
lay-done="layui.element.render('nav', 'layadmin-pagetabs-nav')">
<div class="layadmin-pagetabs" id="LAY_app_tabs">
<div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
<div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
<div class="layui-icon layadmin-tabs-control layui-icon-down">
<ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
<li class="layui-nav-item" lay-unselect>
<a href="javascript:;"></a>
<dl class="layui-nav-child layui-anim-fadein">
<dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
<dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
<dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
</dl>
</li>
</ul>
</div>
<div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
<ul class="layui-tab-title" id="LAY_app_tabsheader">
{{# if(d.data.length >= 1 ){ }}
{{# if(d.data[0].moduleid == 'index'){ }}
<li lay-id="/"><i class="layui-icon layui-icon-home"></i></li>
{{# } }}
{{# if(d.data[0].moduleid != 'index'){ }}
<li lay-id="/{{d.data[0].moduleid}}/" lay-attr="/{{d.data[0].moduleid}}/"><i class="layui-icon layui-icon-home"></i></li>
{{# } }}
{{# } }}
{{# if(d.data.length == 0){ }}
<li lay-id="/"><i class="layui-icon layui-icon-home"></i></li>
{{# } }}
</ul>
</div>
</div>
</script>
<!-- 主体内容 -->
<div class="layui-body" id="LAY_app_body">
<!-- 单页模式接入-->
<div class="layadmin-tabsbody-item layui-show"></div>
</div>
<!-- 辅助元素,一般用于移动设备下遮罩 -->
<div class="layadmin-body-shade" layadmin-event="shade"></div>
</div>
<!--告警操作记录-->
<script type="text/html" id="warnViewWinTpl">
<div class="warn-win">
<div class="warn-win-item">
<h5>告警确认【{{d.confirm.length}}</h5>
{{# layui.each(d.confirm, function(index, item){ }}
<div class="warn-win-item-con">
<span>{{layui.util.toDateString(item.confirmTime)}}</span>
<ul>
<li>备注:{{item.remark}}</li>
<li>告警确认人:{{item.confirmUserId}}</li>
<li>紧急程度:{{item.levelName}}</li>
</ul>
</div>
{{# }); }}
</div>
<div class="warn-win-item">
<h5>告警关闭【{{d.close.length}}</h5>
{{# layui.each(d.close, function(index, item){ }}
{{# var closeTypeStr = '告警'}}
{{# if(item.closeType == 1){ closeTypeStr = '通知' } }}
<div class="warn-win-item-con">
<span>备注:{{item.remark}}</span>
<ul>
<li>告警关闭时间:{{layui.util.toDateString(item.closeTime)}}</li>
<li>告警关闭人:{{item.closeUserId}}</li>
<li>关闭范围:{{closeTypeStr}}</li>
<li>关闭时长:{{item.closeDuration}}小时</li>
</ul>
</div>
{{# }); }}
</div>
<div class="warn-win-item">
<h5>告警恢复【{{d.resume.length}}</h5>
{{# layui.each(d.resume, function(index, item){ }}
{{# var resumeTypeStr = '恢复关闭的活动告警'}}
{{# if(item.resumeType == 1){resumeTypeStr = '恢复历史告警' } }}
<div class="warn-win-item-con">
<span>备注:{{item.remark}}</span>
<ul>
<li>告警恢复时间:{{layui.util.toDateString(item.resumeTime)}}</li>
<li>告警恢复人:{{item.resumeUserId}}</li>
<li>恢复类型:{{resumeTypeStr}}</li>
</ul>
</div>
{{# }); }}
</div>
</div>
</script>
<!--详细页左侧面板-->
<script type="text/html" id="detailPageLeftPanel">
<div class="detail-left-panel">
<a class="detail-left-panel-btn" href="javascript:void(0)"><i class="layui-icon layui-icon-next"></i></a>
<div class="detail-left-panel-node" style="display: none">
{{# layui.each(d.map, function(k, v){ }}
<div class="left-panel-restype">
<div class="layui-title">{{v[0].reTypeName}}</div>
<div class="">
{{# layui.each(v, function(i, e){ }}
<div class="info-box link"
data-resid="{{e.targetId}}"
data-restype="{{e.resType}}"
data-restypename="{{e.resTypeName}}"
data-ip="{{e.ip}}"
data-admin="{{e.admin}}"
>
{{e.targetName}}
</div>
{{# }); }}
</div>
</div>
{{# }); }}
{{# if(!Object.keys(d.map).length) { }}
<div class="left-panel-restype">
<div class="desc-box">
暂无关联关系
</div>
</div>
{{# } }}
</div>
</div>
</script>
<!--下探top30表格展示内容-->
<script type="text/html" id="detailKpiTableTpl">
<table class="layui-table" lay-even="" lay-skin="row">
<colgroup>
<col width="100">
<col width="150">
<col width="180">
<col width="180">
</colgroup>
<thead>
<tr>
<th>序号</th>
<th>进程号</th>
<th>所属用户</th>
{{# if(d.kpi == 'KPI7054BC34'){ }}
<th>使用率</th>
{{# } }}
{{# if(d.kpi != 'KPI7054BC34'){ }}
<th>使用量</th>
{{# } }}
</tr>
</thead>
<tbody>
{{# layui.each(d.data, function(index, item){ }}
<tr>
<td>{{index + 1}}</td>
<td>{{item.pid}}</td>
<td>{{item.username}}</td>
<td>{{item.usedPercent}}</td>
<!--<td>{{item.info}}</td>-->
</tr>
{{# }); }}
</tbody>
</table>
</script>
<!--corn表达式-->
<script type="text/html" id="cronHtml" >
<div id="cronContent" style="color:#000000">
<p style="margin: 10px auto; padding: 0px;">
  <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">常用表达式例子</span></strong>
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">1</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0/2 * * * * ?</span></strong>&nbsp;&nbsp;</span>&nbsp;表示每2秒 执行任
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">1</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0/2 * * * ? </span></strong>&nbsp;&nbsp;</span>&nbsp;表示每2分钟 执行任
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">1</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0 2 1 * ?</span></strong>&nbsp;&nbsp;</span>&nbsp;表示在每月的1日的凌晨2点调整任
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">2</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 ? * MON-FRI</span>&nbsp;</strong>&nbsp; 表示周一到周五每天上午10:15执行作业
</p>
<p style="margin: 10px auto; padding: 0px;">
  (3<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 ? 6L 2002-2006</span></strong>&nbsp;&nbsp; 表示2002-2006年的每个月的最后一个星期五上午10:15执行作
</p>
<p style="margin: 10px auto; padding: 0px;">
  (4<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0 10,14,16 * * ?</span></strong>&nbsp;&nbsp;&nbsp;每天上午10点,下午2点,4&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (5<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0/30 9-17 * * ?</span></strong>&nbsp;&nbsp; 朝九晚五工作时间内每半小时&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (6<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0 12 ? * WED</span></strong>&nbsp;&nbsp; &nbsp;表示每个星期三中午12&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (7<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0 12 * * ?</span></strong>&nbsp;&nbsp;&nbsp;每天中午12点触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (8<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 ? * * &nbsp;</span></strong>&nbsp;&nbsp;每天上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (9<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 * * ?</span></strong>&nbsp;&nbsp; &nbsp; 每天上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (10<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 * * ?</span>&nbsp;</strong>&nbsp; &nbsp;每天上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (11<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 * * ? 2005</span></strong>&nbsp;&nbsp; &nbsp;2005年的每天上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (12<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 * 14 * * ?</span></strong>&nbsp;&nbsp; &nbsp; 在每天下午2点到下午2:59期间的每1分钟触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (13<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0/5 14 * * ?</span></strong>&nbsp;&nbsp; &nbsp;在每天下午2点到下午2:55期间的每5分钟触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (14<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0/5 14,18 * * ?</span></strong>&nbsp;&nbsp; &nbsp; 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (15<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 0-5 14 * * ?</span>&nbsp;</strong>&nbsp; &nbsp;在每天下午2点到下午2:05期间的每1分钟触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (16<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 10,44 14 ? 3 WED</span></strong>&nbsp;&nbsp; &nbsp;每年三月的星期三的下午2:102:44触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (17<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 ? * MON-FRI</span>&nbsp;</strong>&nbsp; &nbsp;周一至周五的上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (18<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 15 * ?</span>&nbsp;</strong>&nbsp; &nbsp;每月15日上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (19<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 L * ?</span>&nbsp;</strong>&nbsp; &nbsp;每月最后一日的上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (20<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 ? * 6L</span>&nbsp;</strong>&nbsp; &nbsp;每月的最后一个星期五上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (21<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 ? * 6L 2002-2005</span></strong>&nbsp;&nbsp; 2002年至2005年的每月的最后一个星期五上午10:15触发&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  (22<strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">0 15 10 ? * 6#3</span></strong>&nbsp;&nbsp; 每月的第三个星期五上午10:15触发
</p>
<p style="margin: 10px auto; padding: 0px;">
&nbsp;
</p>
</div>
</script>
<!--资源名称-->
<script type="text/html" id="resindex_resName">
<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}}" data-manageIp="{{d.manageIp}}" data-collProtocol="{{d.collProtocol}}" data-provider="{{d.provider}}" data-state="{{d.state}}" class="layui-table-link">{{ d.resName }}</span>
{{# if (d.favId == null) { }}
<a class="layui-icon layui-icon-rate hide" data-favid="{{d.favId}}" data-id="{{d.resId}}" lay-tips="加入收藏夹" style="font-size: 14px"></a>
{{# } else { }}
<a class="layui-icon layui-icon-rate-solid" data-favid="{{d.favId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" data-id="{{d.resId}}" lay-tips="移出收藏夹"></a>
{{# } }}
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="查看资源拓扑"><i class="iconfont">&#XE515;</i></a>
{{# if (d.resCategory == 'share' && d.hardwareFlag && d.hardwareFlag.endsWith("Y")) { }}
<a class="layui-icon reslist-assets-details hide" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-ip="{{ d.ip }}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>
{{# } }}
</div>
</script>
<!--最大文件系统使用率-->
<script type="text/html" id="fileUseRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI449F5365" data-flag="fs" data-name="{{d.os=='windows'?'磁盘使用情况':'文件系统使用情况'}}" data-showtype="bar" data-barkpiid="{{d.os=='windows'?'KPI29D42042,KPI1988842F':'KPIA91F44E7,KPI98306224'}}" data-barxaxis="{{d.os=='windows'?'KPI9D22EAB6':'KPI7AC1664E'}}"
data-warning="0" data-ident="1" data-trend="0">
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div style="position:absolute; z-index:1;width: 100%" id="{{d.resId}}_bizfileName" lay-tips="{{d.fileSysUseName}}"
data-id="{{d.resId}}_bizfileName" data-message="{{d.fileSysUseName}}"><span style="color: #000000;">{{d.fileSysUseName}}</span>
</div>
<div class="layui-progress-bar layui-bg-green {{ d.fileSysUseRate >= 98 ? 'layui-bg-red' : (d.fileSysUseRate >= 95 ? 'layui-bg-orange' : (d.fileSysUseRate >= 90 ? 'layui-bg-blue':'')) }}"
lay-percent="{{ d.fileSysUseRate }}%"
style="width: {{ d.fileSysUseRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.fileSysUseRate == null || d.fileSysUseRate == '' || d.fileSysUseRate === '未知' || d.fileSysUseRate === '无' )? '0%' : d.fileSysUseRate +'%' }}</span>
</div>
</script>
<!--CPU使用率-->
<script type="text/html" id="cpuRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI7054BC34" data-flag="cpu" data-name="CPU使用率"
data-warning="0" data-ident="1" data-trend="1">
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar layui-bg-green {{ d.cpuRate >= 95 ? 'layui-bg-red' : (d.cpuRate >= 90 ? 'layui-bg-orange' : (d.cpuRate >= 80 ? 'layui-bg-blue':''))}}"
lay-percent="{{ d.cpuRate }}%"
style="width: {{ d.cpuRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.cpuRate == null || d.cpuRate == '' || d.cpuRate === '未知' || d.cpuRate === '无' )? '0%' : d.cpuRate +'%' }}</span>
</div>
</script>
<!--内存使用率-->
<script type="text/html" id="memoryRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI31CB8D97" data-flag="mem" data-name="内存使用率"
data-warning="1" data-ident="1" data-trend="1">
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar layui-bg-green {{ d.memoryRate >= 95 ? 'layui-bg-red' : (d.memoryRate >= 90 ? 'layui-bg-orange' : (d.memoryRate >= 80 ? 'layui-bg-blue':''))}}"
lay-percent="{{ d.memoryRate }}%"
style="width: {{ d.memoryRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.memoryRate == null || d.memoryRate == '' || d.memoryRate === '未知' || d.memoryRate === '无' )? '0%' : d.memoryRate +'%' }}</span>
</div>
</script>
<!--虚拟内存使用率-->
<script type="text/html" id="vmmemoryRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI20352505" data-flag="vmem" data-name="虚拟内存使用率"
data-warning="1" data-ident="1" data-trend="1">
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar layui-bg-green {{ d.vmmemoryUseRate >= 95 ? 'layui-bg-red' : (d.vmmemoryUseRate >= 90 ? 'layui-bg-orange' : (d.vmmemoryUseRate >= 80 ? 'layui-bg-blue':''))}}"
lay-percent="{{ d.vmmemoryUseRate }}%"
style="width: {{ d.vmmemoryUseRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.vmmemoryUseRate == null || d.vmmemoryUseRate == '' || d.vmmemoryUseRate === '未知' || d.vmmemoryUseRate === '无' )? '0%' : d.vmmemoryUseRate +'%' }}</span>
</div>
</script>
<!--会话百分比-->
<script type="text/html" id="sessionRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI18F18278" data-name="活动会话百分比" data-flag="session"
data-warning="0" data-ident="1" data-trend="0">
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar layui-bg-green {{ d.sessionRate >= 80 ? 'layui-bg-red' : (d.sessionRate <= 50 ? '' : 'layui-bg-orange') }}"
lay-percent="{{ d.sessionRate }}%"
style="width: {{ d.sessionRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.sessionRate == null || d.sessionRate == '' || d.sessionRate === '未知' || d.sessionRate === '无' )? '0%' : d.sessionRate +'%' }}</span>
</div>
</script>
<!--CPU分配率-->
<script type="text/html" id="cpuSetRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPIBFA3F5CD" data-name="CPU分配率" data-flag="cpu"
data-warning="0" data-ident="1" data-trend="0">
{{#
d.cpuSetRate = parseFloat(d.cpuSetRate).toFixed(2);
}}
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar layui-bg-green {{ d.cpuSetRate >= 80 ? 'layui-bg-red' : (d.cpuSetRate <= 50 ? '' : 'layui-bg-orange') }}"
lay-percent="{{ d.cpuSetRate }}%"
style="width: {{ d.cpuSetRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.cpuSetRate == null || d.cpuSetRate == '' || d.cpuSetRate === '未知' || d.cpuSetRate === '无' )? '0%' : d.cpuSetRate +'%' }}</span>
</div>
</script>
<!--内存分配率-->
<script type="text/html" id="memorySetRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPIC40A80AC" data-name="内存分配率" data-flag="mem"
data-warning="0" data-ident="1" data-trend="0">
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar layui-bg-green {{ d.memorySetRate >= 80 ? 'layui-bg-red' : (d.memorySetRate <= 50 ? '' : 'layui-bg-orange') }}"
lay-percent="{{ d.memorySetRate }}%"
style="width: {{ d.memorySetRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.memorySetRate == null || d.memorySetRate == '' || d.memorySetRate === '未知' || d.memorySetRate === '无' )? '0%' : d.memorySetRate +'%' }}</span>
</div>
</script>
<!--存储分配率-->
<script type="text/html" id="storageSetRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI46BAA9BE" data-name="存储分配率" data-flag="storage"
data-warning="0" data-ident="1" data-trend="0">
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar layui-bg-green {{ d.storageSetRate >= 80 ? 'layui-bg-red' : (d.storageSetRate <= 50 ? '' : 'layui-bg-orange') }}"
lay-percent="{{ d.storageSetRate }}%"
style="width: {{ d.storageSetRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.storageSetRate == null || d.storageSetRate == '' || d.storageSetRate === '未知' || d.storageSetRate === '无' )? '0%' : d.storageSetRate +'%' }}</span>
</div>
</script>
<!--连接状态-->
<script type="text/html" id="linkStateTpl">
{{#
var linkStateHtml = '';
var linkStateTips = '无连接信息';
if(d.linkStateList && d.linkStateList.length) {
linkStateTips = '';
if(d.linkStateList.length == 1) {
var linkState = d.linkStateList[0];
linkStateTips = `${linkState.protocol}: ${linkState.state}`;
if(linkState.state.indexOf('成功') !== -1) {
linkStateHtml = '<button type="button" class="layui-btn layui-btn-radius layui-bg-green layui-btn-xs p-0-15 cant-click">成功</button>';
} else {
linkStateHtml = `<button type="button"
id="${d.resId}_bizdanger"
data-message="${d.message}"
data-state="${d.state}"
data-id="${d.resId}_bizdanger"
class="layui-btn showTip layui-btn-danger layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click">
失败
</button>`;
}
} else {
linkStateTips += `<ul class='ul-link-state-tips'>`;
layui.each(d.linkStateList, function(index, value) {
if(value.state.indexOf('成功') !== -1) {
linkStateTips += `<li class='li-link-state-tips-green'>${value.protocol}: ${value.state}</li>`;
linkStateHtml += '<span class="layui-badge-dot layui-bg-green"></span>';
} else {
linkStateTips += `<li class='li-link-state-tips-red'>${value.protocol}: ${value.state}</li>`;
linkStateHtml += '<span class="layui-badge-dot layui-bg-red"></span>';
}
});
linkStateTips += '</ul>';
}
}
}}
<div class="div-link-state-list" lay-tips="{{linkStateTips}}">
{{linkStateHtml}}
</div>
</script>
<!--详情页面连接状态-->
<script type="text/html" id="linkStateDetailTpl">
{{#
var linkStateHtml = '';
var linkStateTips = '无连接信息';
if(d.linkStateList && d.linkStateList.length) {
linkStateTips = '';
if(d.linkStateList.length == 1) {
var linkState = d.linkStateList[0];
linkStateTips = `${linkState.protocol}: ${linkState.state}`;
if(linkState.state.indexOf('成功') !== -1) {
linkStateHtml = `<span class="span-green">${linkState.state}</span>`;
} else {
linkStateHtml = `<span class="span-red">${linkState.state}</span>`;
}
} else {
linkStateTips += `<ul class='ul-link-state-tips'>`;
layui.each(d.linkStateList, function(index, value) {
if(value.state.indexOf('成功') !== -1) {
linkStateTips += `<li class='li-link-state-tips-green'>${value.protocol}: ${value.state}</li>`;
linkStateHtml += '<div class="layui-badge-dot layui-bg-green"></div>';
} else {
linkStateTips += `<li class='li-link-state-tips-red'>${value.protocol}: ${value.state}</li>`;
linkStateHtml += '<div class="layui-badge-dot layui-bg-red"></div>';
}
});
linkStateTips += '</ul>';
}
}
}}
<div class="div-link-state-list" lay-tips="{{linkStateTips}}">
{{linkStateHtml}}
</div>
</script>
<!--电源状态-->
<script type="text/html" id="powerStateTpl">
{{# if(d.powerState != null && d.powerState == 'poweredOn'){ }}
<button type="button" class="layui-btn layui-btn-radius layui-bg-green layui-btn-xs p-0-15 cant-click">
开机
</button>
{{# }else if(d.powerState != null && d.powerState == 'poweredOff'){ }}
<button type="button" class="layui-btn layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click">
关机
</button>
{{# }else if(d.powerState != null && d.powerState == 'standBy'){ }}
<button type="button" class="layui-btn layui-bg-orange layui-btn-radius layui-btn-xs p-0-15 cant-click">
待机
</button>
{{# }else if(d.powerState != null && d.powerState == 'unknown'){ }}
<button type="button" class="layui-btn layui-bg-gray layui-btn-radius layui-btn-xs p-0-15 cant-click">
未知
</button>
{{# }else{ }}
<button type="button"
class="layui-btn layui-btn-radius layui-bg-gray layui-btn-xs p-0-15 cant-click">{{
'未监控'}}
</button>
{{# }}}
</script>
<!--健康状态-->
<script type="text/html" id="healthTpl">
{{# if(d.state != 'new'){ }}
{{# if(d.health === '1'){ }}
<button type="button" class="layui-btn layui-btn-danger layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click">
</button>
{{# } }}
{{# if(d.health === '2'){ }}
<button type="button" class="layui-btn layui-btn-warm layui-bg-orange layui-btn-radius layui-btn-xs p-0-15 cant-click">
</button>
{{# } }}
{{# if(d.health === '3'){ }}
<button type="button" class="layui-btn layui-btn-radius layui-bg-green layui-btn-xs p-0-15 cant-click"></button>
{{# } }}
{{# } }}
</script>
<!--主机状态-->
<script type="text/html" id="hostStateTpl">
{{# if(d.hostState != null && d.hostState == 'connected'){ }}
<button type="button" class="layui-btn layui-btn-radius layui-bg-green layui-btn-xs p-0-15 cant-click">
已连接
</button>
{{# }else if(d.hostState != null && d.hostState == 'notResponding'){ }}
<button type="button" class="layui-btn layui-bg-orange layui-btn-radius layui-btn-xs p-0-15 cant-click">
未响应
</button>
{{# }else if(d.hostState != null && d.hostState == 'disconnected'){ }}
<button type="button" class="layui-btn layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click">
断开连接
</button>
{{# }else{ }}
<button type="button"
class="layui-btn layui-btn-radius layui-bg-gray layui-btn-xs p-0-15 cant-click">{{
'未监控'}}
</button>
{{# }}}
</script>
<!--ping状态-->
<script type="text/html" id="pingStatusTpl">
{{# if(d.pingStatus === '正常'){ }}
<button type="button" class="layui-btn layui-btn-danger layui-bg-green layui-btn-radius layui-btn-xs p-0-15">正常
</button>
{{# }else{ }}
<button type="button" class="layui-btn layui-btn-radius layui-bg-red layui-btn-xs p-0-15">异常</button>
{{# } }}
</script>
<!--资源状态-->
<script type="text/html" id="resStateTpl">
{{#
switch (d.state) {
case "new" :
}} <button type="button" class="layui-btn layui-btn-warm layui-bg-blue layui-btn-radius layui-btn-xs p-0-15 cant-click">未监控</button> {{#
break;
case "monitor" :
}} <button type="button" class="layui-btn layui-btn-warm layui-bg-green layui-btn-radius layui-btn-xs p-0-15 cant-click">监控中</button> {{#
break;
case "stop" :
}} <button type="button" class="layui-btn layui-btn-warm layui-bg-red layui-btn-radius layui-btn-xs p-0-15 cant-click">暂停监控</button> {{#
break;
case "alarmIgnore" :
}} <button type="button" class="layui-btn layui-btn-warm layui-bg-orange layui-btn-radius layui-btn-xs p-0-15 cant-click">告警压制中</button> {{#
break;
}
}}
</script>
<!--判断树结构有无子节点-->
<script type="text/html" id="bizResNameTpl">
<div>
{{# if(d.resType == 'MIDDLEWARE_WEBLOGIC' && (d.parentId == null || d.parentId == '') ){ }}
<span data-childrennum="{{d.childrenNum}}">{{d.resName}}</span>
{{# }else{ }}
<span data-zymc="{{d.resId}}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-ip="{{d.ip}}" data-childrennum="{{d.childrenNum}}" data-resTypeName="{{d.resTypeName}}" data-admin="{{d.admin}}" data-pingenable="{{d.pingEnable}}" class="layui-table-link">{{d.resName}}</span>
{{# } }}
{{# if (d.favId == null) { }}
<a class="layui-icon layui-icon-rate hide" data-favid="{{d.favId}}" data-id="{{d.resId}}" lay-tips="加入收藏夹" style="font-size: 14px"></a>
{{# } else { }}
<a class="layui-icon layui-icon-rate-solid" data-favid="{{d.favId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" data-id="{{d.resId}}" lay-tips="移出收藏夹"></a>
{{# } }}
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="查看资源拓扑"><i class="iconfont">&#XE515;</i></a>
</div>
</script>
<!--表空间使用率(最大)-->
<script type="text/html" id="tableSpaceUseRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI64B1610A" data-name="表空间使用率" data-showtype="bar" data-barkpiid="KPI2EC3F15A,KPI6AD9EBD6" data-barxaxis="KPI4332BAC8"
data-warning="0" data-ident="1" data-trend="0" data-flag="tps" >
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div style="position:absolute; z-index:1;width: 100%" id="{{d.resId}}_bizTableSpaceUseRate" class="showTipsName" data-id="{{d.resId}}_bizTableSpaceUseRate" data-message="{{d.tableSpaceUseName}}"><span style="color: #000000;" >{{d.tableSpaceUseName}}</span></div>
<div class="layui-progress-bar layui-bg-green {{ d.tableSpaceUseRate >= 80 ? 'layui-bg-red' : (d.tableSpaceUseRate <= 50 ? '' : 'layui-bg-orange') }}"
lay-percent="{{ d.tableSpaceUseRate }}%"
style="width: {{ d.tableSpaceUseRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.tableSpaceUseRate == null || d.tableSpaceUseRate == '' || d.tableSpaceUseRate === '未知' || d.tableSpaceUseRate === '无' )? '0%' : d.tableSpaceUseRate +'%' }}</span>
</div>
</script>
<!--ASM磁盘空间使用率-->
<script type="text/html" id="asmDiskUsedRateTpl">
<div class="layui-progress-wrap kpiSubDiv" data-resid={{d.resId}} data-kpiid="KPI922F8FF7" data-name="ASM磁盘空间使用率" data-showtype="bar" data-barkpiid="KPI4D710FDA,KPI811E751E" data-barxaxis="KPI50267025"
data-warning="0" data-ident="1" data-trend="0" data-flag="asm" >
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div style="position:absolute; z-index:1;width: 100%" id="{{d.resId}}_asmDiskUsedRate" class="showTipsName" data-id="{{d.resId}}_asmDiskUsedRate" data-message="{{d.asmDiskUsedRate}}"><span style="color: #000000;" >{{d.asmDiskUsedRateName}}</span></div>
<div class="layui-progress-bar layui-bg-green {{ d.asmDiskUsedRate >= 80 ? 'layui-bg-red' : (d.asmDiskUsedRate <= 50 ? '' : 'layui-bg-orange') }}"
lay-percent="{{ d.asmDiskUsedRate }}%"
style="width: {{ d.asmDiskUsedRate }}%;">
</div>
</div>
<span class="layui-progress-text">{{ (d.asmDiskUsedRate == null || d.asmDiskUsedRate == '' || d.asmDiskUsedRate === '未知' || d.asmDiskUsedRate === '无' )? '0%' : d.asmDiskUsedRate +'%' }}</span>
</div>
</script>
<!--weblogic定制表头-->
<script type="text/html" id="webLogicResNameTpl">
<div>
{{# if(d.resType == 'MIDDLEWARE_WEBLOGIC' && (d.parentId == null || d.parentId == '') ){ }}
<span data-childrennum="{{d.childrenNum}}">{{d.resName}}</span>
{{# }else{ }}
<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-pingenable="{{d.pingEnable}}" class="layui-table-link">{{ d.resName }}</span>
{{# } }}
{{# if (d.favId == null) { }}
<a class="layui-icon layui-icon-rate hide" data-favid="{{d.favId}}" data-id="{{d.resId}}" lay-tips="加入收藏夹" style="font-size: 14px"></a>
{{# } else { }}
<a class="layui-icon layui-icon-rate-solid" data-favid="{{d.favId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" data-id="{{d.resId}}" lay-tips="移出收藏夹"></a>
{{# } }}
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="查看资源拓扑"><i class="iconfont">&#XE515;</i></a>
</div>
</script>
<script type="text/html" id="weblogicIpTpl">
<div>{{d.ip?d.ip:""}}</div>
</script>
<script type="text/html" id="weblogicListenAddrTpl">
<div>{{d.listenAddr?d.listenAddr:""}}</div>
</script>
<!--cup核心数-->
<script type="text/html" id="cpuCoresTpl">
<div>{{d.cpuCores?(d.cpuCores+"核"):""}}</div>
</script>
<!--cup个数-->
<script type="text/html" id="cpuNumTpl">
<div>{{d.cpuNum?(d.cpuNum+"个"):""}}</div>
</script>
... ...
<title>乙方运维</title>
<iframe src="/vue3/index.html#/operationMaintenance" class="layadmin-iframe"/>
<iframe src="/vue3/index.html#/operationMaintenance" class="layadmin-iframe" style="height: 99.5%!important;"/>
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>综合监控管理平台</title>
<link rel="shortcut icon" href="../src/style/res/shui.png">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="/start/layui/css/layui.css" media="all">
<script>
/^http(s*):\/\//.test(location.href) || alert('请先部署到 localhost 下再访问');
</script>
</head>
<body>
<div id="LAY_app"></div>
<script src="/start/layui/layui.js"></script>
<script>
layui.use(['jquery'], function () {
var $ = layui.jquery;
// 读取配置文件
$.when(
$.ajax({
url: '/config/getConfig',
data: {
configName: 'url'
},
async: false
}),$.ajax({
url: '/config/getConfig',
data: {
configName: 'config.audio'
},
}),
).done(function (res1,res2) {
sessionStorage.setItem('domainName', res1[0].gateway);
sessionStorage.setItem('domainInspectionURI', res1[0].inspection_web);
sessionStorage.setItem('domainAssetsManage', res1[0].assetsweb);
sessionStorage.setItem('graphEditorOrigin', res1[0].mxgraph_editor);
sessionStorage.setItem('tingyun', res1[0].tingyun);
sessionStorage.setItem('bigScreen', res1[0].bigScreen);
sessionStorage.setItem('ythView', res1[0].ythView);
sessionStorage.setItem('workflow', res1[0].workflow);
sessionStorage.setItem('mp3', res2[0].mp3);
sessionStorage.setItem('jimuReport', res1[0].jimuReport);
})
});
layui.config({
base: '../src/' //指定 layuiAdmin 项目路径,本地开发用 src,线上用 dist
// ,version: '1.2.1'//运行环境用个固定版本号
,version: new Date().getTime()//本地开发环境,避免改动后的文件未及时生效,所以用时间戳作为版本
}).use('index');
</script>
</body>
</html>
... ...
<div>
<div>
文档管理组件
</div>
</div>
<cm-document v-if="initFlg" :isView="true" :viewTypeId="docType" :types="[docType]" :fileIds="docIds" @callback="saveOpsLog"></cm-document>
... ...
... ... @@ -5,149 +5,86 @@ export default {
data() {
return {}
},
setup() {
let height = Vue.ref(window.innerHeight - 130);
props: {
// 当前节点
treeNode: {
type: Object,
default: {}
},
// 当前节点的上级节点
parentNode: {
type: Object,
default: {}
},
// 项目id
projectId: {
type: String,
default: ''
},
// 文件类型
docType: {
type: String,
default: ''
},
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
let docIds = Vue.ref([]);
let initFlg = Vue.ref(false);
let columns = Vue.ref([
{
prop: 'fileName',
label: '年度',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm1',
label: '1月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm2',
label: '2月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm3',
label: '3月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm4',
label: '4月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm5',
label: '5月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm6',
label: '6月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm7',
label: '7月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm8',
label: '8月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm9',
label: '9月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm110',
label: '10月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm11',
label: '11月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm12',
label: '12月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
let init = () => {
// 查询绑定的文件列表
let params = {
opsId: props.projectId,
personId: props.parentNode.id,
code: props.treeNode.map.nodeType.code
}
]);
proxy.$http.get('/api-web/bOpsFile/search', params, function (res) {
if (res && res.code == 0 && res.data) {
let dataList = Vue.ref([]);
let currentPage = Vue.ref(1);
let total = Vue.ref(0);
// 获取表格树
let getPage = () => {
let ids = res.data.map(function (v) {
return v.id;
});
docIds.value = ids;
}
initFlg.value = true;
})
}
let saveOpsLog = ({document, fileInfo}) => {
let params = {
id: document.id,
personId: props.parentNode.id,
username: document.createUser,
opsId: props.projectId,
name: document.name,
fileUrl: document.localPath,
code: props.treeNode.map.nodeType.code
};
proxy.$http.post('/api-web/bOpsFile/fileSynchronization', params, function (res) {
if (res && res.code == 0) {
// proxy.$global.showMsg("");
console.log('执行回调成功', res)
}
});
}
// 监听编辑状态
Vue.watch(() => props.treeNode, (newValue, oldVlaue) => {
initFlg.value = false;
init();
});
// 挂载完
Vue.onMounted(() => {
init();
})
return {
columns,
height,
dataList,
currentPage,
total,
getPage
docIds,
saveOpsLog,
initFlg
}
}
}
... ...
... ... @@ -3,7 +3,7 @@
<!-- 人员信息总汇-->
<el-divider content-position="left">项目评价汇总</el-divider>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="true"
:showPage="true" :height="height - 54"></cm-table-page>
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="true" :height="(height - 54)/3"></cm-table-page>
</div>
</div>
... ...
... ... @@ -13,121 +13,82 @@ export default {
let columns = Vue.ref([
{
prop: 'fileName',
prop: 'opsYear',
label: '年度',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'center',
},
{
prop: 'm1',
prop: 'month1',
label: '1月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm2',
prop: 'month2',
label: '2月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm3',
prop: 'month3',
label: '3月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm4',
prop: 'month4',
label: '4月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm5',
prop: 'month5',
label: '5月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm6',
prop: 'month6',
label: '6月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm7',
prop: 'month7',
label: '7月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm8',
prop: 'month8',
label: '8月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm9',
prop: 'month9',
label: '9月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm110',
prop: 'month10',
label: '10月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm11',
prop: 'month11',
label: '11月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
},
{
prop: 'm12',
prop: 'month12',
label: '12月',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
align: 'right',
}
]);
... ... @@ -135,11 +96,24 @@ export default {
let currentPage = Vue.ref(1);
let total = Vue.ref(0);
// 获取表格
// 获取表格数据
let getPage = () => {
proxy.$http.post("/api-web/bOpsScore/scoreCollect", {
"page":1,
"limit":10,
"projectId":"1"
}, function (res) {
if (res && res.data) {
dataList.value = res.data;
total.value = res.count;
}
});
}
// 挂载完
Vue.onMounted(() => {
getPage();
})
return {
columns,
... ...
<div>
<el-row>
<el-col :span="12">
<div id="main" style="width: 500px;height:600px;"></div>
<el-row :gutter="5">
<el-col :span="16" >
<div id="main" :style="{'width':(width/3)*2 + 'px)','height' : height + 'px'}"></div>
</el-col>
<el-col :span="12">
<div id="score" style="width: 600px;height:400px;"></div>
<el-col :span="8" >
<div id="score" :style="{'width':(width/3)+'px','height' : height + 'px'}"></div>
</el-col>
</el-row>
<el-dialog
v-model="dialogVisible"
title="3月各项评分"
width="60%"
:before-close="handleClose"
>
<el-table border :data="tableData" stripe @cell-dblclick='handleCell' header-row-class-name="tbl-header-class" style="width: 100%;margin: 20px 0;">
<el-table-column prop="date" label="分类" align="center" min-width="100" />
<el-table-column prop="date" label="项目" align="center" min-width="100" />
<el-table-column prop="name" label="分值" align="center" min-width="100" />
<el-table-column prop="name" label="打分人" align="center" min-width="100"/>
<el-table-column prop="name" label="得分" align="center" min-width="100">
<template #default="scope">
<el-input v-model="scope.row.name" style='width: 80px;'></el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="扣分原因" align="center" min-width="100">
<template #default="scope">
<el-input v-model="scope.row.name" style='width: 80px;'></el-input>
</template>
</el-table-column>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" size="small" @click="dialogVisible = false">确认</el-button>
<el-button size="small"@click="dialogVisible = false">关闭</el-button>
</span>
<cm-dialog :title="title" width="60%" :showDialogVisible="dialogVisible" :showFooter="true" @hidedialog="closeDetail" :showOkBtn="false">
<template v-slot>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true"
:showPage="false" :height="height - 100"></cm-table-page>
</template>
</el-dialog>
</cm-dialog>
</div>
... ...
... ... @@ -5,59 +5,196 @@ export default {
data() {
return {}
},
setup() {
props: {
treeNode: {
type: Object,
default: {}
},
parentNode: {
type: Object,
default: {}
},
projectId: {
type: String,
default: ''
},
key: {
type: String,
default: ''
},
},
setup(props, {attrs, slots, emit}) {
let height = Vue.ref(window.innerHeight - 130);
let width = Vue.ref(window.innerWidth * 0.6);
let dialogVisible = Vue.ref(false);
let title = Vue.ref('');
let dataList = Vue.ref([]);
let columns = Vue.ref([{
prop: 'item',
label: '分类',
sortable: true,
},{
prop: 'standardScore',
label: '分值',
sortable: true,
},{
prop: 'score',
label: '得分',
sortable: true,
},{
prop: 'rater',
label: '打分人',
sortable: true,
},{
prop: 'deduction',
label: '扣分原因',
sortable: true,
},]);
const {proxy} = Vue.getCurrentInstance();
// 柱状图
let main = () => {
let columns = Vue.ref([
{
prop: 'fileName',
label: '日常资料',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm1',
label: '文档资料',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
},
{
prop: 'm2',
label: '项目保密协议',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
let params = {
projectId: props.projectId,
year: props.treeNode.label
}
proxy.$http.get("/api-web/bOpsScore/getScoreFindProjectIdYear", params, function (res) {
if (res && res.map) {
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
var option = {
xAxis: {
data: res.map.x
},
yAxis: {},
series: [{
name: '分值',
type: 'bar',
data: res.map.y,
itemStyle: { //上方显示数值
normal: {
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: { //数值样式
fontSize: 12
}
}
}
}
}]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
// 处理点击事件并且弹出数据名称
myChart.on('click', function (params) {
console.log(params);
detail(params);
});
}
}, function () {
proxy.$global.showMsg('没有查询到记录!', 'warning');
});
}
let detail = (v) =>{
let name = v.name;
let month = parseInt(name)
title.value = name + "各项评分";
let params = {
projectId: props.projectId,
opsYear: props.treeNode.label,
opsMonth:month
}
]);
proxy.$http.post("/api-web/bOpsScoreDetails/page", params, function (res) {
if(res && res.code == 0){
// console.log(res)
closeDetail(true);
dataList.value = res.data;
}
});
}
let dataList = Vue.ref([]);
let currentPage = Vue.ref(1);
let total = Vue.ref(0);
let closeDetail = (flg) => {
dialogVisible.value = flg
}
// 获取表格树
let getPage = () => {
// 柱状图
let score = () => {
proxy.$http.post("/api-web/bOpsScore/scoreRatio", {}, function (res) {
if (res && res.data) {
let arr = [];
res.data.forEach(item => {
arr.push({value: item.ddicDesc, name: item.ddicName})
})
// 指定图表的配置项和数据
var option = {
title: {
text: '评分分类值占比'
},
tooltip: {
triggeer: 'item',
formatter: '{b} : {c} ({d}%)'
},
series: [
{
name: '评分分类值占比',
type: 'pie', // 设置图表类型为饼图
radius: '40%', // 饼图的半径,外半径为可视区尺寸(容器高宽中较小一项)的 55% 长度。
center: ["45%", "50%"],
data: arr,
label: {
normal: {
show: true,
formatter: '{b}:({d}%)'
},
labelLine: {show: true}
}
}
],
};
var myChart = echarts.init(document.getElementById('score'));
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
} else {
proxy.$global.showMsg('暂无数据!');
}
});
}
let init =() =>{
main();
score();
}
// 监听编辑状态
Vue.watch(() => props.treeNode, (newValue, oldVlaue) => {
init();
});
// 挂载完
Vue.onMounted(() => {
init();
})
return {
columns,
width,
height,
title,
dialogVisible,
columns,
dataList,
currentPage,
total,
getPage
closeDetail
}
}
}
... ...
<div>
<div>
<!-- 人员信息总汇-->
<project-ry/>
</div>
<!-- 人员信息总汇-->
<project-ry/>
</div>
<div>
<!-- 项目评价总汇-->
... ...
... ... @@ -3,7 +3,7 @@
<!-- 人员信息总汇-->
<el-divider content-position="left">人员信息汇总</el-divider>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="true"
:showPage="true" :height="height - 54"></cm-table-page>
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="true" :height="(height - 54)/3"></cm-table-page>
</div>
</div>
... ...
... ... @@ -9,49 +9,89 @@ export default {
},
setup() {
let height = Vue.ref(window.innerHeight - 130);
const {proxy} = Vue.getCurrentInstance();
let columns = Vue.ref([{
prop: 'fileName',
prop: 'nickname',
label: '运维人员姓名',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
}
}, {
prop: 'createUser',
prop: 'state',
label: '在职状态',
sortable: true,
width: '120px'
width: '120px',
render: function (row) {
if(row.state==1){
return "在职";
}else{
return "<span style='color: red'>离职</span>";
}
}
}, {
prop: 'createTime',
prop: 'personalMessage',
label: '个人信息',
sortable: true,
width: '180px'
width: '180px',
render: function (row) {
if(row.personalMessage =="YES"){
return `<i class="iconfont icon-icon--yes" style="font-size: 22px;margin-right: 10px;"></i><span></span>`;
}else{
return `<i class="iconfont icon-icon--shanchu" style="font-size: 22px;margin-right: 10px;color:red"></i><span></span>`;
}
}
}, {
prop: 'createTime',
prop: 'personalSecrecyBook',
label: '个人保密协议书',
sortable: true,
width: '180px'
width: '180px',
render: function (row) {
if(row.personalSecrecyBook =="YES"){
return `<i class="iconfont icon-icon--yes" style="font-size: 22px;margin-right: 10px;"></i><span></span>`;
}else{
return `<i class="iconfont icon-icon--shanchu" style="font-size: 22px;margin-right: 10px;color:red"></i><span></span>`;
}
}
}, {
prop: 'createTime',
prop: 'monthlySummary',
label: '月度总结',
sortable: true,
width: '180px'
width: '180px',
render: function (row) {
if(row.monthlySummary =="YES"){
return `<i class="iconfont icon-icon--yes" style="font-size: 22px;margin-right: 10px;"></i><span></span>`;
}else{
return `<i class="iconfont icon-icon--shanchu" style="font-size: 22px;margin-right: 10px;color:red"></i><span></span>`;
}
}
}]);
let dataList = Vue.ref([]);
let currentPage = Vue.ref(1);
let total = Vue.ref(0);
// 获取表格
// 获取表格数据
let getPage = () => {
proxy.$http.post("/api-web/bOpsPerson/personCollect", {
"page":1,
"limit":10,
"projectId":"1"
}, function (res) {
if (res && res.data) {
dataList.value = res.data
total.value = res.count;
}
});
}
// 挂载完
Vue.onMounted(() => {
getPage();
})
return {
columns,
... ...
<div>
<el-form
:model="ruleForm"
label-width="120px"
size="small"
>
<div style="padding-top: 20px;">
<el-form :model="ruleForm" label-width="120px" :size="$global.elementSize">
<el-row>
<el-col :span="8">
<el-form-item label="姓名" prop="nickname" class="form-class">
<el-input v-model="ruleForm.nickname" style='width: 190px;'></el-input>
<el-input v-model="ruleForm.nickname" disabled style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="性别" prop="sex" class="form-class">
<el-radio-group v-model="ruleForm.sex">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="学历" prop="education" class="form-class">
<el-input v-model="ruleForm.education" style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="手机号" prop="name" class="form-class">
<el-input v-model="ruleForm.phone" style='width: 190px;'></el-input>
<el-form-item label="手机号" prop="phone" class="form-class">
<el-input v-model="ruleForm.phone" disabled style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="电子邮箱" prop="name" class="form-class">
<el-form-item label="电子邮箱" prop="email" class="form-class">
<el-input v-model="ruleForm.email" style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="入职时间" prop="name" class="form-class">
<el-form-item label="入职时间" prop="entryTime" class="form-class">
<el-date-picker
disabled
v-model="ruleForm.entryTime"
type="date"
style='width: 190px;'
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="获得证书" prop="name" class="form-class">
<el-form-item label="获得证书" prop="certificate" disabled class="form-class">
<el-input v-model="ruleForm.certificate" style='width: 190px;'></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所在公司" prop="name" class="form-class">
<el-input v-model="ruleForm.company" style='width: 190px;'></el-input>
<el-form-item label="所在公司" prop="company" class="form-class">
<el-input v-model="ruleForm.company" disabled style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="年龄" prop="name" class="form-class">
<el-form-item label="年龄" prop="age" class="form-class">
<el-input v-model="ruleForm.age" style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="毕业院校" prop="name" class="form-class">
<el-input v-model="ruleForm.university" style='width: 190px;'></el-input>
<el-form-item label="毕业院校" prop="university" class="form-class">
<el-input v-model="ruleForm.university" disabled style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="座机号码" prop="name" class="form-class">
<el-form-item label="座机号码" prop="tel" class="form-class">
<el-input v-model="ruleForm.tel" style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="家庭住址" prop="name" class="form-class">
<el-form-item label="家庭住址" prop="post" class="form-class">
<el-input v-model="ruleForm.post" style='width: 190px;'></el-input>
</el-form-item>
<el-form-item label="离职时间" prop="name" class="form-class">
<el-form-item label="离职时间" prop="quitTime" class="form-class">
<el-date-picker
v-model="ruleForm.quitTime"
disabled
type="date"
style='width: 190px;'
placeholder="选择日期">
... ... @@ -67,21 +65,16 @@
<el-upload
class="upload-demo"
:show-file-list="false"
action=""
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:http-request="uploadFile"
multiple
:limit="3"
:on-exceed="handleExceed"
>
:before-upload="beforeAvatarUpload"
:multiple="false"
:http-request="getFile"
:auto-upload="true">
<el-button size="small" type="primary">上传照片</el-button>
</el-upload>
</el-col>
</el-row>
<div style="text-align: center;">
<el-button type="primary" size="small" @click="handleSave">保存</el-button>
<el-button type="primary" size="small" @click="saveUser">保存</el-button>
</div>
<!-- <el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')"
... ...
... ... @@ -2,34 +2,112 @@ export default {
name: 'projectPJIndex',
template: '',
components: {},
props: {
treeNode: {
type: Object,
default: {}
},
parentNode: {
type: Object,
default: {}
},
projectId: {
type: String,
default: ''
},
},
data() {
return {}
},
setup() {
setup(props, {attrs, slots, emit}) {
let height = Vue.ref(window.innerHeight - 130);
const {proxy} = Vue.getCurrentInstance();
let imageUrl = Vue.ref('');
let ruleForm = Vue.reactive({
nickname:'',
sex: '',
let ruleForm = Vue.ref({
nickname: '',
sex: 0,
education: '',
phone: '',
tel: '',
email: '',
post: '',
headImgUrl: '',
age: '',
entryTime: '',
certificate: '',
university: '',
education: '',
quitTime: '',
entryTime:'',
age: '',
company: '',
certificate: ''
headImgUrl: '',
post: '',
projectId: null,
quitTime: '',
state: '',
tel: ''
})
// 获取表格数据
let getPage = () => {
proxy.$http.get("/api-web/bOpsPerson/search", {
"nickname": props.parentNode.label,
"projectId": props.projectId
}, function (res) {
if (res && res.object) {
ruleForm.value = res.object
}
});
}
// 保存用户信息
let saveUser = () => {
console.log(ruleForm.value);
proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate",ruleForm.value , function (res) {
if (res && res.code == 0) {
proxy.$global.showMsg('保存成功!');
}
});
}
let getFile = (param) =>{
let fileObj = param.file
getBase64(fileObj).then(res => {
console.log(res)
});
imageUrl.value = URL.createObjectURL(fileObj)
}
let beforeAvatarUpload = (file) =>{
const isJPG = file.type.indexOf('image/') != -1
if (!isJPG) {
proxy.$global.showMsg('您上传的不是图片文件,请选择图片!','error');
}
return isJPG
}
// // 挂载完
Vue.onMounted(() => {
getPage();
})
// 监听编辑状态
Vue.watch(() => props.projectId, (newValue, oldVlaue) => {
getPage();
});
return {
ruleForm
imageUrl,
ruleForm,
saveUser,
getFile,
beforeAvatarUpload,
}
}
}
... ...
... ... @@ -3,7 +3,7 @@
<!-- 人员信息总汇-->
<el-divider content-position="left">项目资料汇总</el-divider>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="true"
:showPage="true" :height="height - 54"></cm-table-page>
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="false" :height="(height - 54)/3"></cm-table-page>
</div>
</div>
... ...
... ... @@ -13,30 +13,37 @@ export default {
let columns = Vue.ref([
{
prop: 'fileName',
prop: 'dayMaterial',
label: '日常资料',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
if(row.dayMaterial =="YES"){
return `<i class="iconfont icon-icon--yes" style="font-size: 22px;margin-right: 10px;"></i><span></span>`;
}else{
return `<i class="iconfont icon-icon--shanchu" style="font-size: 22px;margin-right: 10px;color:red"></i><span></span>`;
}
}
},
{
prop: 'm1',
prop: 'documentMaterial',
label: '文档资料',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
if(row.documentMaterial =="YES"){
return `<i class="iconfont icon-icon--yes" style="font-size: 22px;margin-right: 10px;"></i><span></span>`;
}else{
return `<i class="iconfont icon-icon--shanchu" style="font-size: 22px;margin-right: 10px;color:red"></i><span></span>`;
}
}
},
{
prop: 'm2',
prop: 'nda',
label: '项目保密协议',
sortable: true,
align: 'left',
render: function (row) {
return `<i class="iconfont 22222" style="font-size: 22px;margin-right: 10px;"></i><span>${row.fileName}</span>`
if(row.nda =="YES"){
return `<i class="iconfont icon-icon--yes" style="font-size: 22px;margin-right: 10px;"></i><span></span>`;
}else{
return `<i class="iconfont icon-icon--shanchu" style="font-size: 22px;margin-right: 10px;color:red"></i><span></span>`;
}
}
}
]);
... ... @@ -45,11 +52,21 @@ export default {
let currentPage = Vue.ref(1);
let total = Vue.ref(0);
// 获取表格
// 获取表格数据
let getPage = () => {
proxy.$http.get("/api-web/bOpsFile/fileCollect?projectId=1", {}, function (res) {
if (res && res.data) {
dataList.value = res.data
total.value = res.count;
}
});
}
// 挂载完
Vue.onMounted(() => {
getPage();
})
return {
columns,
... ...
... ... @@ -48,6 +48,10 @@ const routes = [{
name: 'operationMaintenance',
component: () => myImport('views/operationMaintenance/index')
},{
path: '/operationMaintenance/config',
name: 'operationMaintenanceConfig',
component: () => myImport('views/operationMaintenance/config/index')
},{
path: '/bigscreen',
name: 'zjBigScreen',
component: () => myImport('views/dp/index')
... ...
<div class="container tree-config" :style="{'height':height+'px','max-height':height+'px','overflow':'auto'}" style="background-color: white;padding-top: 50px">
<el-form :rules="formRules"
label-position="right"
label-width="220px"
ref="ruleForm"
:model="form">
<el-form-item label="是否是乙方运维" prop="isOps">
<el-switch
v-model="form.isOps"
active-text="是"
inactive-text="否"
></el-switch>
</el-form-item>
<el-form-item label="项目名称" prop="alias">
<el-input v-model="form.alias" :disabled="form.isOps == 0" clearable></el-input>
</el-form-item>
<el-form-item label="项目编号" prop="code" >
<el-input v-model="form.code" :disabled="form.isOps == 0" clearable></el-input>
</el-form-item>
<el-form-item label="项目负责人" prop="principalName">
<div style="display: flex">
<el-input v-model="form.principalName" :disabled="form.isOps == 0" clearable></el-input>
<el-button style="margin-left: 5px" @click="showUserDialog(true)" :disabled="form.isOps == 0" >选择</el-button>
</div>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input type="number" v-model="form.sort" :disabled="form.isOps == 0" clearable></el-input>
</el-form-item>
<el-form-item label="描述" prop="remark">
<el-input v-model="form.remark" type="textarea" :disabled="form.isOps == 0" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('ruleForm')">保存配置</el-button>
</el-form-item>
</el-form>
<cm-userright :showDialogVisible="showUserDialogFlg" :users="users" @callback="selectUser" title="选择用户"
:titles="['所有用户', '已添加用户']" :buttonTexts="['删除', '添加']" :loadRoleDta="false"
@hideDialog="showUserDialog"></cm-userright>
</div>
... ...
export default {
name: 'operationMaintenanceConfigIndex',
template: '',
components: {},
data() {
return {
formRules: {
alias: [
{
required: true,
message: '请填项目名称!',
trigger: 'blur',
}
],
code: [
{
required: true,
message: '请填项目编号!',
trigger: 'blur',
}
],
principalName: [
{
required: true,
message: '请填项目负责人!',
trigger: 'blur',
}
],
sort: [
{
required: true,
message: '请填项目负责人!',
trigger: 'blur',
}
]
}
}
},
setup() {
const {proxy} = Vue.getCurrentInstance();
let showUserDialogFlg = Vue.ref(false);
let users = Vue.ref([]);
let form = Vue.ref({
isOps: 0,
code: '',
alias: '',
principal: '',
principalName: '',
busId: '',
sort: 1,
remark: ''
});
let onSubmit = (id) => {
proxy.$refs[id].validate((valid) => {
if (valid) {
let params = form.value;
if (params.isOps) {
params.isOps = 1;
} else {
params.isOps = 0;
}
// 新增
proxy.$http.post(`/api-web/bOpsProject/saveOrUpdate`, params, function (res) {
if (res && res.code == 0) {
proxy.$global.showMsg("配置成功!");
}
})
} else {
console.log('error submit!!')
return false
}
})
}
let init = () => {
let busId = proxy.$global.getQueryVariable("id")
//let isOps = proxy.$global.getQueryVariable("isOps")
if (!busId) {
return;
}
// 业务id
form.value.busId = busId;
// 是否是乙方运维
//form.value.isOps = isOps;
proxy.$http.get("/api-web/bOpsProject/search", {busId: busId}, function (res) {
if (res && res.object) {
res.object.isOps = true;
form.value = res.object
let principal = res.object.principal
if(principal){
users.value = principal.split(",")
}
}
});
}
/**
* 获取用户授权
*/
let showUserDialog = (flg) => {
showUserDialogFlg.value = flg;
}
// 获取用户选择的用户
let selectUser = (userObj) =>{
let userArr = userObj.user;
let names = [];
let nickNames = [];
userArr.map(function (v) {
names.push(v.username);
nickNames.push(v.nickname)
})
form.value.principal = names.join(',');
form.value.principalName = nickNames.join(',');
}
// 挂载完
Vue.onMounted(() => {
init();
})
return {
form,
onSubmit,
users,
selectUser,
showUserDialog,
showUserDialogFlg
}
}
}
... ...
<div class="assets-configmanagers">
<!-- 乙方运营-->
<div>
<!-- 左侧树结构 -->
<el-row>
<el-col :span="4" class='col-class'>
<el-tree :data="dataSource" :default-expanded-keys="[1]" :props="defaultProps" @node-click="handleNodeClick" />
</el-col>
<!-- 右侧显示 -->
<el-col :span="19" class='col-class'>
<!-- 失活的组件将会被缓存!-->
<keep-alive>
<component v-bind:is="componentName"></component>
</keep-alive>
</el-col>
</el-row>
</div>
<div class="container" :style="{'height':height+'px','max-height':height+'px','overflow':'auto'}">
<!-- 乙方运营-->
<el-row :gutter="5">
<el-col :span="4">
<div :style="{'min-height':height+'px','height':'100%','overflow':'auto'}" style="background-color: white;border-radius: 3px">
<el-tree :data="dataSource" :default-expanded-keys="[1]" :props="defaultProps"
@node-click="handleNodeClick"/>
</div>
</el-col>
<el-col :span="20" >
<div :style="{'min-height':height+'px','height':'100%','overflow':'auto'}" style="background-color: white;border-radius: 3px">
<component v-bind:is="componentName"
:docType="docType"
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId"></component>
</div>
</el-col>
</el-row>
</div>
... ...
export default {
name: 'operationMaintenance',
template: '',
components: {
// 所有汇总
'COLLECT_ALL': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/project/index')
),
// 人员汇总
'COLLECT_USER': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/ry/index')
),
// 评价汇总
'COLLECT_EVALUATE': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/pj/index')
),
// 资料汇总
'COLLECT_MATERIAL': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/zl/index')
),
//文档
'DOCUMENT': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/doc/index')
),
// 评分图(项目评价具体年份)
'EVALUATE': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/pjt/index')
),
// 人员信息
'USER': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/user/index')
),
},
components: {
// 所有汇总
'COLLECT_ALL': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/project/index')
),
// 人员汇总
'COLLECT_USER': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/ry/index')
),
// 评价汇总
'COLLECT_EVALUATE': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/pj/index')
),
// 资料汇总
'COLLECT_MATERIAL': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/zl/index')
),
//文档
// 个人保密协议(THREE_PERSONAGE_NDA)
// 月度总结 THREE_MONTHLY_SUMMARY
// 月报 FOUR_MONTHLY
// 考勤记录 FOUR_CHECKING_IN
// 健康检查报告 FOUR_HEALTH
// 文档资料 TWO_DOCUMENT_MATERIAL
// 项目保密协议 TWO_NDA
'DOCUMENT': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/doc/index')
),
// 评分图(项目评价具体年份)
'EVALUATE': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/pjt/index')
),
// 人员信息
'USER': Vue.defineAsyncComponent(
() => myImport('components/page/operationMaintenance/user/index')
),
},
setup() {
const { proxy } = Vue.getCurrentInstance()
let dataSource = Vue.ref([]);
const {proxy} = Vue.getCurrentInstance()
let height = Vue.ref(window.innerHeight -20);
let dataSource = Vue.ref([]);
let componentName = Vue.ref('COLLECT_ALL');
// 当前点击节点
let treeNode = Vue.ref({});
let parentNode = Vue.ref({});
let projectId = Vue.ref('');
let docType = Vue.ref('');
// 搜索
let getTree = () => {
var params = {
// page: pageInfo.page,
// limit: pageInfo.limit,
username: '1',
};
proxy.$http.get("/api-web/bOpsProject/getTree", params, function (res) {
if (res && res.data) {
dataSource.value = res.data;
treeNode.value = res.data[0];
} else {
proxy.$global.showMsg('暂无数据!');
}
}, function () {
proxy.$global.showMsg('没有查询到记录!');
});
}
// 搜索
let getTree = () => {
var params = {
// page: pageInfo.page,
// limit: pageInfo.limit,
username: '1',
};
proxy.$http.get("/api-web/bOpsProject/getTree", params, function (res) {
if (res && res.data) {
dataSource.value = res.data;
} else {
proxy.$global.showMsg('暂无数据!');
}
},function (){
proxy.$global.showMsg('没有查询到记录!');
});
}
let getParent = (arr, parentId) => {
// 获取父节点
arr.filter(function (v) {
if (v.id == parentId) {
parentNode.value = v;
}
let child = v.children;
if (child && child.length > 0) {
getParent(child, parentId);
}
})
}
let handleNodeClick=(data)=> {
let comName= data.map.nodeType.view.code;
console.log(comName)
componentName.value = comName;
}
Vue.onMounted(() => {
getTree();
let handleNodeClick = (data) => {
let comName = data.map.nodeType.view.code;
if (comName == 'DOCUMENT') {
docType.value = data.map.nodeType.code;
}
getParent(dataSource.value, data.parentId);
projectId.value = data.map.nodeType.projectId;
treeNode.value = data;
componentName.value = comName;
}
Vue.onMounted(() => {
getTree();
})
// 搜索
// 搜索
return {
dataSource,
handleNodeClick,
componentName
height,
projectId,
treeNode,
parentNode,
dataSource,
handleNodeClick,
componentName,
docType
};
},
}
... ...