@@ -287,8 +355,8 @@
initCurpage: 1,
data: [],
fieldList: [
- { label: "分组名称", value: "groupName", minWidth: 150, tooltip: true },
- { label: "分组描述", value: "description", minWidth: 150, tooltip: true }
+ { label: "分组名称", value: "groupName", minWidth: 120, tooltip: true },
+ { label: "分组描述", value: "description", minWidth: 120, tooltip: true }
],
handle: {
fixed: "right",
@@ -313,8 +381,6 @@
{ type: "button", label: "添加用户组", btType: "primary", icon: "el-icon-plus", event: "addGroup", show: true }
]
},
- //分配权限选中表格数据
- permissionSelectData: [],
//需要进行绑定操作的项目ID
needHandleProjectId: "",
//按钮loading
@@ -343,8 +409,9 @@
title: {
addUser: "添加用户",
addGroup: "添加用户组",
- detail: "用户列表"
+ detail: ""
},
+ width: "80%",
type: "",
visible: false
},
@@ -390,32 +457,64 @@
rules: {}
},
//用户组下用户过滤相关
- groupUserFilterInfo: {
- query: {
- id: undefined
- },
- },
+ // groupUserFilterInfo: {
+ // query: {
+ // id: undefined
+ // },
+ // },
//用户组下用户表格相关
- groupUserTableInfo: {
+ // groupUserTableInfo: {
+ // url: this.nozzle.userGroupUserList, //接口地址
+ // refresh: 1,
+ // initCurpage: 1,
+ // data: [],
+ // fieldList: [
+ // { label: "用户名", value: "login", minWidth: 120, tooltip: true },
+ // { label: "姓名", value: "realName", minWidth: 100, tooltip: true },
+ // { label: "电话", value: "mobile", minWidth: 120, tooltip: true },
+ // ],
+ // handle: {
+ // fixed: "right",
+ // label: "操作",
+ // width: "80",
+ // btList: [
+ // { label: "删除", size: "small", type: "text", event: "delUser", show: true }
+ // ]
+ // }
+ // },
+ //用户表格通用相关
+ userTableInfo: {
url: this.nozzle.userGroupUserList, //接口地址
refresh: 1,
initCurpage: 1,
- data: [],
fieldList: [
{ label: "用户名", value: "login", minWidth: 120, tooltip: true },
{ label: "姓名", value: "realName", minWidth: 100, tooltip: true },
- { label: "电话", value: "mobile", minWidth: 120, tooltip: true },
- ],
- handle: {
- fixed: "right",
- label: "操作",
- width: "80",
- btList: [
- { label: "删除", size: "small", type: "text", event: "delUser", show: true }
- ]
- }
+ { label: "电话", value: "mobile", minWidth: 120, tooltip: true }
+ ]
},
- //站点表格相关
+ //已关联用户表格相关
+ RelatedUserTableInfo: {
+ data: [],
+ query: {
+ sign: ""
+ },
+ selectList: []
+ },
+ //未关联用户表格相关
+ UnRelateUserTableInfo: {
+ data: [],
+ query: {
+ sign: "unbound"
+ },
+ selectList: []
+ },
+ //用户表格搜索相关
+ userQuery: {
+ searchStr: "",
+ groupId: ""
+ },
+ //站点表格通用相关
siteTableInfo: {
url: this.nozzle.sysStationBaseList, //接口地址
refresh: 1,
@@ -520,7 +619,7 @@
this.dialogInfo.width = "500px";
break;
default:
- this.dialogInfo.width = "80%";
+ this.dialogInfo.width = "60%";
break;
}
},
@@ -532,14 +631,30 @@
if (this.userFormInfo.ref) {
this.userFormInfo.ref.resetFields();
}
+ this.RelatedUserTableInfo.data = [];
+ this.UnRelateUserTableInfo.data = [];
+ this.userQuery = {
+ searchStr: ""
+ };
const type = this.userDialogInfo.type;
this.resetForm(type);
}
},
+ "userDialogInfo.type"(val) {
+ if(val === "addUser" || val === "addGroup") {
+ this.userDialogInfo.width = "500px";
+ }else{
+ this.userDialogInfo.width = "80%";
+ }
+ },
"siteQuery.searchStr"(val) {
Object.assign(this.RelatedSiteTableInfo.query, this.siteQuery);
Object.assign(this.UnRelateSiteTableInfo.query, this.siteQuery);
},
+ "userQuery.searchStr"(val) {
+ Object.assign(this.RelatedUserTableInfo.query, this.userQuery);
+ Object.assign(this.UnRelateUserTableInfo.query, this.userQuery);
+ },
"projectFormInfo.data.sysGroup"(val) {
if(val) {
if(val === "1") {//临测项目
@@ -570,7 +685,6 @@
}
}
}
-
}
},
computed: {
@@ -582,6 +696,14 @@
isCanInsertSite() {
return this.UnRelateSiteTableInfo.selectList.length ? false : true;
},
+ //移除按钮是否可点击
+ isCanRemoveUser() {
+ return this.RelatedUserTableInfo.selectList.length ? false : true;
+ },
+ //添加按钮是否可点击
+ isCanInsertUser() {
+ return this.UnRelateUserTableInfo.selectList.length ? false : true;
+ },
...mapGetters(["allDept", "allRole", "allCity"])
},
mounted() {
@@ -745,11 +867,58 @@
case "detail":
this.userDialogInfo.type = event;
this.userDialogInfo.visible = true;
- this.groupUserFilterInfo.query['id'] = data.id;
+ this.userQuery.groupId = data.id;
setTimeout(() => {
- this.groupUserTableInfo.refresh = Math.random();
+ Object.assign(this.RelatedUserTableInfo.query, this.userQuery);
+ Object.assign(this.UnRelateUserTableInfo.query, this.userQuery);
+ this.userTableInfo.refresh = Math.random();
}, 0);
break;
+ //用户搜索
+ case "userSearch":
+ this.userTableInfo.initCurpage = Math.random();
+ this.userTableInfo.refresh = Math.random();
+ break;
+ //绑定用户到用户组
+ case "insertUser":
+ const userIdInsertArr = this.UnRelateUserTableInfo.selectList.map( item => item.id);
+ const insertUserData = {
+ groupId: this.UnRelateUserTableInfo.query.groupId,
+ userIds: userIdInsertArr
+ };
+ this.$http.post(this.nozzle.bindUserToGroup, { data: insertUserData }).then(res => {
+ if (res.data.code === 1) {
+ this.userQuery.searchStr = "";
+ this.userTableInfo.refresh = Math.random();
+ this.userTableInfo.initCurpage = Math.random();
+ }
+ this.$message({
+ message: res.data.msg,
+ type: res.data.code === 1 ? "success" : "error",
+ showClose: true
+ });
+ })
+ break;
+ //从用户组中解绑用户
+ case "removeUser":
+ const userIdRemoveArr = this.RelatedUserTableInfo.selectList.map(item => item.id);
+ const removeUserData = {
+ groupId: this.RelatedUserTableInfo.query.groupId,
+ userIds: userIdRemoveArr
+ };
+ this.$http.post(this.nozzle.removeUserFromGroup, { data: removeUserData }).then(res => {
+ if (res.data.code === 1) {
+ this.userQuery.searchStr = "";
+ this.userTableInfo.refresh = Math.random();
+ this.userTableInfo.initCurpage = Math.random();
+ }
+ this.$message({
+ message: res.data.msg,
+ type: res.data.code === 1 ? "success" : "error",
+ showClose: true
+ });
+ });
+ break;
//删除用户组按钮
case "delGroup":
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
@@ -773,27 +942,27 @@
}).catch(() =>{})
break;
//从用户组中删除用户
- case "delUser":
- this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(res =>{
- this.$http.post(this.nozzle.userGroupRemoveUser,{data:{userIds:[data.id]}}).then(res =>{
- if(res.data.code === 1 || res.data.code === 200) {
- this.groupUserTableInfo.refresh = Math.random();
- this.groupUserTableInfo.initCurpage = Math.random();
- }
- this.$message({
- message: res.data.msg,
- type: res.data.code === 1 ? 'success' : 'error',
- showClose: true,
- })
- }).catch(e =>{
- message(e);
- })
- }).catch(() =>{})
- break;
+ // case "delUser":
+ // this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+ // confirmButtonText: "确定",
+ // cancelButtonText: "取消",
+ // type: "warning"
+ // }).then(res =>{
+ // this.$http.post(this.nozzle.userGroupRemoveUser,{data:{userIds:[data.id]}}).then(res =>{
+ // if(res.data.code === 1 || res.data.code === 200) {
+ // this.groupUserTableInfo.refresh = Math.random();
+ // this.groupUserTableInfo.initCurpage = Math.random();
+ // }
+ // this.$message({
+ // message: res.data.msg,
+ // type: res.data.code === 1 ? 'success' : 'error',
+ // showClose: true,
+ // })
+ // }).catch(e =>{
+ // message(e);
+ // })
+ // }).catch(() =>{})
+ // break;
//添加站点到项目
case "insert":
if (this.UnRelateSiteTableInfo.selectList.length) {
@@ -915,15 +1084,22 @@
//表格checkbox选择事件
handleEvent(event, data) {
switch (event) {
- case "all":
- this.permissionSelectData = data;
- break;
+ //站点关联
case "isRelate":
this.RelatedSiteTableInfo.selectList = data;
break;
+ //站点未关联
case "unRelate":
this.UnRelateSiteTableInfo.selectList = data;
break;
+ //用户关联
+ case "isUserRelate":
+ this.RelatedUserTableInfo.selectList = data;
+ break;
+ //用户未关联
+ case "unUserRelate":
+ this.UnRelateUserTableInfo.selectList = data;
+ break;
}
},
//重置表单
diff --git a/src/components/ServiceWatch/components/applied.vue b/src/components/ServiceWatch/components/applied.vue
index 95e6f3d..a6ceef8 100644
--- a/src/components/ServiceWatch/components/applied.vue
+++ b/src/components/ServiceWatch/components/applied.vue
@@ -68,7 +68,7 @@
//搜索相关
filterInfo: {
query: {
- serverIp: "192.168.32.101"
+ serverIp: ""
}
},
//表格相关
@@ -142,14 +142,14 @@
query: {
exeName: "",
serverIp: "",
- beginTime: "",
- endTime: ""
+ startDate: "",
+ endDate: ""
},
list: [
{
type: "date",
label: "开始时间",
- value: "beginTime",
+ value: "startDate",
dateType: "datetime",
datePickerOptions: "pickerOptionsStart",
hideLabel: true
@@ -157,7 +157,7 @@
{
type: "date",
label: "结束时间",
- value: "endTime",
+ value: "endDate",
dateType: "datetime",
datePickerOptions: "pickerOptionsEnd",
hideLabel: true
@@ -202,6 +202,7 @@
}
},
mounted() {
+ this.filterInfo.query.serverIp = this.$route.query.publicAddress;
this.tableInfo.refresh = Math.random();
},
methods: {
@@ -214,10 +215,10 @@
this.dialogInfo.visible = true;
this.dialogInfo.title = `${data.exeName}应用详情`;
let curTime = new Date().getTime();
- this.dialogFilterInfo.query.beginTime = this.$fn.switchTime(
+ this.dialogFilterInfo.query.startDate = this.$fn.switchTime(
curTime - 3600 * 1000
);
- this.dialogFilterInfo.query.endTime = this.$fn.switchTime(curTime);
+ this.dialogFilterInfo.query.endDate = this.$fn.switchTime(curTime);
this.dialogFilterInfo.query.exeName = data.exeName;
this.dialogFilterInfo.query.serverIp = data.serverIp;
this.handleAjax();
diff --git a/config/index.js b/config/index.js
index 4a1805b..b7287be 100644
--- a/config/index.js
+++ b/config/index.js
@@ -78,7 +78,7 @@
},
"/serverManage": {
// 服务器
- target: "http://192.168.16.254:8080", // 孙逢时
+ target: "http://192.168.16.254:8863", // 孙逢时
changeOrigin: true, //是否跨域
pathRewrite: {
"^/serverManage": "" //需要rewrite重写的,
diff --git a/package.json b/package.json
index cbc3880..c41fff4 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,8 @@
"echarts": "^4.7.0",
"element-ui": "^2.13.1",
"esri-loader": "^2.14.0",
+ "html2canvas": "^1.0.0-rc.7",
+ "js-file-download": "^0.4.12",
"jshint": "^2.11.0",
"moment": "^2.24.0",
"qs.js": "^0.1.12",
diff --git a/src/components/ConfigManager/SiteManagement.vue b/src/components/ConfigManager/SiteManagement.vue
index 36a1de7..c2aa7fc 100644
--- a/src/components/ConfigManager/SiteManagement.vue
+++ b/src/components/ConfigManager/SiteManagement.vue
@@ -81,7 +81,9 @@
class="selectInput"
size="small"
filterable
- v-model="ruleForm.platformCode"
+ value-key="value"
+ @change="handleChange"
+ v-model="projectObj"
placeholder="请选择所属项目"
>
-
+
-
+
查询
@@ -354,13 +356,13 @@
fileList: [] //现场安装图片
},
rules: {
- area: [
- {
- required: true,
- message: "请选择所属区域",
- trigger: "change"
- }
- ],
+ // area: [
+ // {
+ // required: true,
+ // message: "请选择所属区域",
+ // trigger: "change"
+ // }
+ // ],
stationType: [
{
required: true,
@@ -443,7 +445,7 @@
refresh: 1,
initCurpage: 1,
fieldList: [
- { label: "设备编号", value: "equipNo", minWidth: 100, tooltip: true },
+ { label: "设备名称", value: "equipDesc", minWidth: 100, tooltip: true },
{ label: "设备厂家", value: "equipFactory", minWidth: 150, tooltip: true },
]
},
@@ -467,7 +469,9 @@
deviceRelatedQuery: {
searchStr: "",
siteCode: ""
- }
+ },
+ //选中的项目对象
+ projectObj: {}
};
},
mounted() {
@@ -519,6 +523,10 @@
"deviceRelatedQuery.searchStr"(val) {
Object.assign(this.isRelatedDeviceTableInfo.query, this.deviceRelatedQuery);
Object.assign(this.unRelatedDeviceTableInfo.query, this.deviceRelatedQuery);
+ },
+ platformCode(val) {
+ console.log(777,val);
+ this.ruleForm.platformCode = val;
}
},
methods: {
@@ -643,7 +651,9 @@
// 弹框取消表单按钮
resetField(formName) {
this.yzaddflag = false;
- this.$refs[formName].resetFields();
+ // console.log(9999,this.$refs[formName]);
+ // this.$refs[formName].resetFields();
+ this.closedialog();
},
visiblechange(visible) {
let that = this;
@@ -691,7 +701,8 @@
return {
id: item.id,
key: item.name,
- value: item.platformCode
+ value: item.platformCode,
+ areaId: item.area
};
});
}
@@ -729,6 +740,9 @@
if (key === "stationType") {
data[key] = data[key].toString();
}
+ this.projectObj = {
+ value: data.platformCode
+ };
this.ruleForm[key] = data[key];
}
this.syscityList = this.removeEmptyChild(this.allCity);
@@ -825,12 +839,13 @@
person: "", //安装负责人
fileList: [] //现场安装图片
};
- this.$refs.cascader.$refs.panel.activePath = [];
- this.$refs.cascader.$refs.panel.clearCheckedNodes();
+ // this.$refs.cascader.$refs.panel.activePath = [];
+ // this.$refs.cascader.$refs.panel.clearCheckedNodes();
},
- handleChange(value) {
+ handleChange(data) {
// 取选中数组的最后一项的id
- this.ruleForm.area = value.slice(-1)[0];
+ this.ruleForm.platformCode = data.value;
+ this.ruleForm.area = data.areaId;
},
//将空的children置为undefined,避免在没有下一级数据的情况下显示暂无数据
removeEmptyChild(arr) {
diff --git a/src/components/ConfigManager/device.vue b/src/components/ConfigManager/device.vue
index 2d0a78d..1dd1801 100644
--- a/src/components/ConfigManager/device.vue
+++ b/src/components/ConfigManager/device.vue
@@ -173,7 +173,7 @@
list: [
{
type: "input",
- label: "设备名称/编号",
+ label: "设备名称/厂家",
value: "searchStr",
hideLabel: true
},
@@ -221,7 +221,7 @@
fieldList: [
{ label: "设备编号", value: "equipNo", minWidth: 100, tooltip: true },
{
- label: "设备描述",
+ label: "设备名称",
value: "equipDesc",
minWidth: 150,
tooltip: true
@@ -240,12 +240,12 @@
},
{ label: "联系人", value: "contactName", width: 100 },
{ label: "电话", value: "contactMobile", width: 120 },
- {
- label: "站点编号",
- value: "siteCode",
- minWidth: 100,
- tooltip: true
- },
+ // {
+ // label: "站点编号",
+ // value: "siteCode",
+ // minWidth: 100,
+ // tooltip: true
+ // },
{
label: "更新时间",
value: "updateTime",
@@ -290,23 +290,23 @@
ref: null,
data: {
id: undefined,
- equipNo: "",
+ // equipNo: "",
equipDesc: "",
equipFactory: "",
equipFactoryAbb: "",
contactName: "",
contactMobile: "",
- siteCode: ""
+ // siteCode: ""
},
fieldList: [
+ // {
+ // label: "设备编号",
+ // value: "equipNo",
+ // type: "input",
+ // required: true
+ // },
{
- label: "设备编号",
- value: "equipNo",
- type: "input",
- required: true
- },
- {
- label: "设备描述",
+ label: "设备名称",
value: "equipDesc",
type: "input",
required: true
@@ -336,14 +336,14 @@
required: true,
validator: checkPhone
},
- {
- label: "所属站点",
- value: "siteCode",
- type: "select",
- list: "siteList",
- filterable: true,
- required: true
- }
+ // {
+ // label: "所属站点",
+ // value: "siteCode",
+ // type: "select",
+ // list: "siteList",
+ // filterable: true,
+ // required: true
+ // }
],
rules: {}
},
@@ -662,13 +662,13 @@
resetForm() {
this.formInfo.data = {
id: undefined,
- equipNo: "",
+ // equipNo: "",
equipDesc: "",
equipFactory: "",
equipFactoryAbb: "",
contactName: "",
contactMobile: "",
- siteCode: ""
+ // siteCode: ""
};
}
}
diff --git a/src/components/ConfigManager/project.vue b/src/components/ConfigManager/project.vue
index fe435c7..d230b2e 100644
--- a/src/components/ConfigManager/project.vue
+++ b/src/components/ConfigManager/project.vue
@@ -166,7 +166,7 @@
-
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+
+ 未关联用户列表
+
+
+
+
+ 添加
+ 移除
+
+
+
+ 已关联用户列表
+
+
+
@@ -287,8 +355,8 @@
initCurpage: 1,
data: [],
fieldList: [
- { label: "分组名称", value: "groupName", minWidth: 150, tooltip: true },
- { label: "分组描述", value: "description", minWidth: 150, tooltip: true }
+ { label: "分组名称", value: "groupName", minWidth: 120, tooltip: true },
+ { label: "分组描述", value: "description", minWidth: 120, tooltip: true }
],
handle: {
fixed: "right",
@@ -313,8 +381,6 @@
{ type: "button", label: "添加用户组", btType: "primary", icon: "el-icon-plus", event: "addGroup", show: true }
]
},
- //分配权限选中表格数据
- permissionSelectData: [],
//需要进行绑定操作的项目ID
needHandleProjectId: "",
//按钮loading
@@ -343,8 +409,9 @@
title: {
addUser: "添加用户",
addGroup: "添加用户组",
- detail: "用户列表"
+ detail: ""
},
+ width: "80%",
type: "",
visible: false
},
@@ -390,32 +457,64 @@
rules: {}
},
//用户组下用户过滤相关
- groupUserFilterInfo: {
- query: {
- id: undefined
- },
- },
+ // groupUserFilterInfo: {
+ // query: {
+ // id: undefined
+ // },
+ // },
//用户组下用户表格相关
- groupUserTableInfo: {
+ // groupUserTableInfo: {
+ // url: this.nozzle.userGroupUserList, //接口地址
+ // refresh: 1,
+ // initCurpage: 1,
+ // data: [],
+ // fieldList: [
+ // { label: "用户名", value: "login", minWidth: 120, tooltip: true },
+ // { label: "姓名", value: "realName", minWidth: 100, tooltip: true },
+ // { label: "电话", value: "mobile", minWidth: 120, tooltip: true },
+ // ],
+ // handle: {
+ // fixed: "right",
+ // label: "操作",
+ // width: "80",
+ // btList: [
+ // { label: "删除", size: "small", type: "text", event: "delUser", show: true }
+ // ]
+ // }
+ // },
+ //用户表格通用相关
+ userTableInfo: {
url: this.nozzle.userGroupUserList, //接口地址
refresh: 1,
initCurpage: 1,
- data: [],
fieldList: [
{ label: "用户名", value: "login", minWidth: 120, tooltip: true },
{ label: "姓名", value: "realName", minWidth: 100, tooltip: true },
- { label: "电话", value: "mobile", minWidth: 120, tooltip: true },
- ],
- handle: {
- fixed: "right",
- label: "操作",
- width: "80",
- btList: [
- { label: "删除", size: "small", type: "text", event: "delUser", show: true }
- ]
- }
+ { label: "电话", value: "mobile", minWidth: 120, tooltip: true }
+ ]
},
- //站点表格相关
+ //已关联用户表格相关
+ RelatedUserTableInfo: {
+ data: [],
+ query: {
+ sign: ""
+ },
+ selectList: []
+ },
+ //未关联用户表格相关
+ UnRelateUserTableInfo: {
+ data: [],
+ query: {
+ sign: "unbound"
+ },
+ selectList: []
+ },
+ //用户表格搜索相关
+ userQuery: {
+ searchStr: "",
+ groupId: ""
+ },
+ //站点表格通用相关
siteTableInfo: {
url: this.nozzle.sysStationBaseList, //接口地址
refresh: 1,
@@ -520,7 +619,7 @@
this.dialogInfo.width = "500px";
break;
default:
- this.dialogInfo.width = "80%";
+ this.dialogInfo.width = "60%";
break;
}
},
@@ -532,14 +631,30 @@
if (this.userFormInfo.ref) {
this.userFormInfo.ref.resetFields();
}
+ this.RelatedUserTableInfo.data = [];
+ this.UnRelateUserTableInfo.data = [];
+ this.userQuery = {
+ searchStr: ""
+ };
const type = this.userDialogInfo.type;
this.resetForm(type);
}
},
+ "userDialogInfo.type"(val) {
+ if(val === "addUser" || val === "addGroup") {
+ this.userDialogInfo.width = "500px";
+ }else{
+ this.userDialogInfo.width = "80%";
+ }
+ },
"siteQuery.searchStr"(val) {
Object.assign(this.RelatedSiteTableInfo.query, this.siteQuery);
Object.assign(this.UnRelateSiteTableInfo.query, this.siteQuery);
},
+ "userQuery.searchStr"(val) {
+ Object.assign(this.RelatedUserTableInfo.query, this.userQuery);
+ Object.assign(this.UnRelateUserTableInfo.query, this.userQuery);
+ },
"projectFormInfo.data.sysGroup"(val) {
if(val) {
if(val === "1") {//临测项目
@@ -570,7 +685,6 @@
}
}
}
-
}
},
computed: {
@@ -582,6 +696,14 @@
isCanInsertSite() {
return this.UnRelateSiteTableInfo.selectList.length ? false : true;
},
+ //移除按钮是否可点击
+ isCanRemoveUser() {
+ return this.RelatedUserTableInfo.selectList.length ? false : true;
+ },
+ //添加按钮是否可点击
+ isCanInsertUser() {
+ return this.UnRelateUserTableInfo.selectList.length ? false : true;
+ },
...mapGetters(["allDept", "allRole", "allCity"])
},
mounted() {
@@ -745,11 +867,58 @@
case "detail":
this.userDialogInfo.type = event;
this.userDialogInfo.visible = true;
- this.groupUserFilterInfo.query['id'] = data.id;
+ this.userQuery.groupId = data.id;
setTimeout(() => {
- this.groupUserTableInfo.refresh = Math.random();
+ Object.assign(this.RelatedUserTableInfo.query, this.userQuery);
+ Object.assign(this.UnRelateUserTableInfo.query, this.userQuery);
+ this.userTableInfo.refresh = Math.random();
}, 0);
break;
+ //用户搜索
+ case "userSearch":
+ this.userTableInfo.initCurpage = Math.random();
+ this.userTableInfo.refresh = Math.random();
+ break;
+ //绑定用户到用户组
+ case "insertUser":
+ const userIdInsertArr = this.UnRelateUserTableInfo.selectList.map( item => item.id);
+ const insertUserData = {
+ groupId: this.UnRelateUserTableInfo.query.groupId,
+ userIds: userIdInsertArr
+ };
+ this.$http.post(this.nozzle.bindUserToGroup, { data: insertUserData }).then(res => {
+ if (res.data.code === 1) {
+ this.userQuery.searchStr = "";
+ this.userTableInfo.refresh = Math.random();
+ this.userTableInfo.initCurpage = Math.random();
+ }
+ this.$message({
+ message: res.data.msg,
+ type: res.data.code === 1 ? "success" : "error",
+ showClose: true
+ });
+ })
+ break;
+ //从用户组中解绑用户
+ case "removeUser":
+ const userIdRemoveArr = this.RelatedUserTableInfo.selectList.map(item => item.id);
+ const removeUserData = {
+ groupId: this.RelatedUserTableInfo.query.groupId,
+ userIds: userIdRemoveArr
+ };
+ this.$http.post(this.nozzle.removeUserFromGroup, { data: removeUserData }).then(res => {
+ if (res.data.code === 1) {
+ this.userQuery.searchStr = "";
+ this.userTableInfo.refresh = Math.random();
+ this.userTableInfo.initCurpage = Math.random();
+ }
+ this.$message({
+ message: res.data.msg,
+ type: res.data.code === 1 ? "success" : "error",
+ showClose: true
+ });
+ });
+ break;
//删除用户组按钮
case "delGroup":
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
@@ -773,27 +942,27 @@
}).catch(() =>{})
break;
//从用户组中删除用户
- case "delUser":
- this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(res =>{
- this.$http.post(this.nozzle.userGroupRemoveUser,{data:{userIds:[data.id]}}).then(res =>{
- if(res.data.code === 1 || res.data.code === 200) {
- this.groupUserTableInfo.refresh = Math.random();
- this.groupUserTableInfo.initCurpage = Math.random();
- }
- this.$message({
- message: res.data.msg,
- type: res.data.code === 1 ? 'success' : 'error',
- showClose: true,
- })
- }).catch(e =>{
- message(e);
- })
- }).catch(() =>{})
- break;
+ // case "delUser":
+ // this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+ // confirmButtonText: "确定",
+ // cancelButtonText: "取消",
+ // type: "warning"
+ // }).then(res =>{
+ // this.$http.post(this.nozzle.userGroupRemoveUser,{data:{userIds:[data.id]}}).then(res =>{
+ // if(res.data.code === 1 || res.data.code === 200) {
+ // this.groupUserTableInfo.refresh = Math.random();
+ // this.groupUserTableInfo.initCurpage = Math.random();
+ // }
+ // this.$message({
+ // message: res.data.msg,
+ // type: res.data.code === 1 ? 'success' : 'error',
+ // showClose: true,
+ // })
+ // }).catch(e =>{
+ // message(e);
+ // })
+ // }).catch(() =>{})
+ // break;
//添加站点到项目
case "insert":
if (this.UnRelateSiteTableInfo.selectList.length) {
@@ -915,15 +1084,22 @@
//表格checkbox选择事件
handleEvent(event, data) {
switch (event) {
- case "all":
- this.permissionSelectData = data;
- break;
+ //站点关联
case "isRelate":
this.RelatedSiteTableInfo.selectList = data;
break;
+ //站点未关联
case "unRelate":
this.UnRelateSiteTableInfo.selectList = data;
break;
+ //用户关联
+ case "isUserRelate":
+ this.RelatedUserTableInfo.selectList = data;
+ break;
+ //用户未关联
+ case "unUserRelate":
+ this.UnRelateUserTableInfo.selectList = data;
+ break;
}
},
//重置表单
diff --git a/src/components/ServiceWatch/components/applied.vue b/src/components/ServiceWatch/components/applied.vue
index 95e6f3d..a6ceef8 100644
--- a/src/components/ServiceWatch/components/applied.vue
+++ b/src/components/ServiceWatch/components/applied.vue
@@ -68,7 +68,7 @@
//搜索相关
filterInfo: {
query: {
- serverIp: "192.168.32.101"
+ serverIp: ""
}
},
//表格相关
@@ -142,14 +142,14 @@
query: {
exeName: "",
serverIp: "",
- beginTime: "",
- endTime: ""
+ startDate: "",
+ endDate: ""
},
list: [
{
type: "date",
label: "开始时间",
- value: "beginTime",
+ value: "startDate",
dateType: "datetime",
datePickerOptions: "pickerOptionsStart",
hideLabel: true
@@ -157,7 +157,7 @@
{
type: "date",
label: "结束时间",
- value: "endTime",
+ value: "endDate",
dateType: "datetime",
datePickerOptions: "pickerOptionsEnd",
hideLabel: true
@@ -202,6 +202,7 @@
}
},
mounted() {
+ this.filterInfo.query.serverIp = this.$route.query.publicAddress;
this.tableInfo.refresh = Math.random();
},
methods: {
@@ -214,10 +215,10 @@
this.dialogInfo.visible = true;
this.dialogInfo.title = `${data.exeName}应用详情`;
let curTime = new Date().getTime();
- this.dialogFilterInfo.query.beginTime = this.$fn.switchTime(
+ this.dialogFilterInfo.query.startDate = this.$fn.switchTime(
curTime - 3600 * 1000
);
- this.dialogFilterInfo.query.endTime = this.$fn.switchTime(curTime);
+ this.dialogFilterInfo.query.endDate = this.$fn.switchTime(curTime);
this.dialogFilterInfo.query.exeName = data.exeName;
this.dialogFilterInfo.query.serverIp = data.serverIp;
this.handleAjax();
diff --git a/src/components/ServiceWatch/components/monitor.vue b/src/components/ServiceWatch/components/monitor.vue
index 9003c11..622eda4 100644
--- a/src/components/ServiceWatch/components/monitor.vue
+++ b/src/components/ServiceWatch/components/monitor.vue
@@ -170,9 +170,9 @@