role1.0
fanluyan 1 year ago
parent 205574e9b6
commit 4392ef299b

@ -72,7 +72,7 @@
<el-table-column prop="updateTimeStr" label="采集时间" min-width="140"> <el-table-column prop="updateTimeStr" label="采集时间" min-width="140">
</el-table-column> </el-table-column>
<el-table-column prop="equip_name" label="装置名称" min-width="140"> <el-table-column prop="equipName" label="装置名称" min-width="140">
</el-table-column> </el-table-column>
<el-table-column prop="model" label="装置型号" show-overflow-tooltip> <el-table-column prop="model" label="装置型号" show-overflow-tooltip>
</el-table-column> </el-table-column>

@ -701,27 +701,27 @@ export default {
console.log(timeArr); console.log(timeArr);
} else { } else {
// //
// if (this.$moment(Stime).isBefore(this.$moment(Etime))) { if (this.$moment(Stime).isBefore(this.$moment(Etime))) {
// timeArr.push(Stime);
// Stime = this.$moment(Stime)
// .add(spanTime, "minute")
// .format("YYYY-MM-DD HH:mm:ss");
// } else if (this.$moment(Stime).isSame(this.$moment(Etime))) {
// // Stime = "";
// timeArr = [];
// // Stime = this.$moment(Stime)
// // .add(spanTime, "minute")
// // .format("YYYY-MM-DD HH:mm:ss");
// }
while (
this.$moment(Stime).isBefore(this.$moment(Etime)) ||
this.$moment(Stime).isSame(this.$moment(Etime))
) {
timeArr.push(Stime); timeArr.push(Stime);
Stime = this.$moment(Stime) Stime = this.$moment(Stime)
.add(spanTime, "minute") .add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm:ss"); .format("YYYY-MM-DD HH:mm:ss");
} else if (this.$moment(Stime).isSame(this.$moment(Etime))) {
// Stime = "";
timeArr = [];
// Stime = this.$moment(Stime)
// .add(spanTime, "minute")
// .format("YYYY-MM-DD HH:mm:ss");
} }
// while (
// this.$moment(Stime).isBefore(this.$moment(Etime)) ||
// this.$moment(Stime).isSame(this.$moment(Etime))
// ) {
// timeArr.push(Stime);
// Stime = this.$moment(Stime)
// .add(spanTime, "minute")
// .format("YYYY-MM-DD HH:mm:ss");
// }
} }
} }
console.log(timeArr); console.log(timeArr);
@ -785,6 +785,7 @@ export default {
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
if (res.data.list.length !== 0) {
this.requestid = res.data.list[0].requestid; this.requestid = res.data.list[0].requestid;
console.log(this.requestid); console.log(this.requestid);
clearInterval(this.timer); clearInterval(this.timer);
@ -793,6 +794,9 @@ export default {
this.deviceNum++; this.deviceNum++;
console.log(this.deviceNum, this.deviceNum * 1000); console.log(this.deviceNum, this.deviceNum * 1000);
}, 1000 * this.deviceNum); }, 1000 * this.deviceNum);
} else {
console.log("未获取到requestid");
}
}) })
.catch((err) => { .catch((err) => {
// this.$message({ // this.$message({

@ -5,13 +5,13 @@
:visible.sync="isShow" :visible.sync="isShow"
:close-on-click-modal="false" :close-on-click-modal="false"
width="470px" width="470px"
@close="handleclose" @close="hide"
> >
<div class="treeBoxList" v-loading="treeLoading"> <div class="treeBoxList" v-loading="treeLoading">
<el-checkbox-group v-model="checkedMenu"> <el-checkbox-group v-model="checkedMenu">
<el-checkbox <el-checkbox
v-for="item in menuCheckOption" v-for="item in menuCheckOption"
:label="item" :label="item.id"
:key="item.id" :key="item.id"
>{{ item.desc }}</el-checkbox >{{ item.desc }}</el-checkbox
> >
@ -38,8 +38,8 @@ export default {
treeLoading: false, treeLoading: false,
rowData: "", rowData: "",
menuList: [], menuList: [],
checkedMenu: [], checkedMenu: [], //checkbox
menuCheckOption: [], menuCheckOption: [], //checkbox
checkedIds: [], //id checkedIds: [], //id
}; };
}, },
@ -48,7 +48,9 @@ export default {
getdataform(val) { getdataform(val) {
this.rowData = JSON.parse(JSON.stringify(val)); this.rowData = JSON.parse(JSON.stringify(val));
}, },
//
getMenuList() { getMenuList() {
this.treeLoading = true;
getMenuListApi() getMenuListApi()
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -61,6 +63,7 @@ export default {
}) })
.catch((err) => {}); .catch((err) => {});
}, },
//
getRolePermission() { getRolePermission() {
console.log(this.rowData); console.log(this.rowData);
getRolePermissionApi({ id: this.rowData.id }) getRolePermissionApi({ id: this.rowData.id })
@ -69,6 +72,9 @@ export default {
console.log(res); console.log(res);
this.checkedIds = res.data; this.checkedIds = res.data;
console.log(this.checkedIds); console.log(this.checkedIds);
this.checkedMenu = this.checkedIds.map((obj) => obj.resourceId);
console.log("我时查询到的选中的值", this.checkedMenu);
this.treeLoading = false;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
@ -79,9 +85,10 @@ export default {
submitForm() { submitForm() {
console.log(this.checkedMenu); console.log(this.checkedMenu);
let paramsList = []; let paramsList = [];
this.checkedMenu.forEach((node) => { this.checkedMenu.map((id) => {
paramsList.push({ resourceId: node.id }); paramsList.push({ resourceId: id });
}); });
//
getRolechangePermissionApi({ getRolechangePermissionApi({
list: paramsList, list: paramsList,
roleId: this.rowData.id, roleId: this.rowData.id,
@ -109,8 +116,8 @@ export default {
}, },
hide() { hide() {
this.isShow = false; this.isShow = false;
this.checkedMenu = [];
}, },
handleclose() {},
}, },
mounted() {}, mounted() {},
}; };

Loading…
Cancel
Save