|
@@ -6,26 +6,38 @@
|
|
|
<div class="head-img">
|
|
<div class="head-img">
|
|
|
<img src="../../../public/images/img-1.png" />
|
|
<img src="../../../public/images/img-1.png" />
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="head-info">设备添加身份权限</div>
|
|
|
|
|
- <div class="input">
|
|
|
|
|
|
|
+ <div class="head-info">设备与身份绑定</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 搜索区域 -->
|
|
|
|
|
+ <div class="form-head">
|
|
|
|
|
+ <span>序列号:</span>
|
|
|
|
|
+ <span class="input">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="listQuery.serialNumber"
|
|
|
|
|
+ placeholder="请输入序列号"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @clear="getList"
|
|
|
|
|
+ @keyup.enter.native="handleFilter"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </span>
|
|
|
|
|
+
|
|
|
|
|
+ <span>设备名称:</span>
|
|
|
|
|
+ <span class="input">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="listQuery.name"
|
|
v-model="listQuery.name"
|
|
|
- size="small"
|
|
|
|
|
placeholder="请输入设备名称"
|
|
placeholder="请输入设备名称"
|
|
|
clearable
|
|
clearable
|
|
|
@clear="getList"
|
|
@clear="getList"
|
|
|
@keyup.enter.native="handleFilter"
|
|
@keyup.enter.native="handleFilter"
|
|
|
>
|
|
>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </span>
|
|
|
|
|
|
|
|
- <div class="input-serch">
|
|
|
|
|
- <el-row>
|
|
|
|
|
- <el-button size="small" type="primary" @click="handleFilter"
|
|
|
|
|
- >搜索</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <el-button type="primary" size="mini" class="button" @click="handleFilter"
|
|
|
|
|
+ >查询</el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 表格区域 -->
|
|
<!-- 表格区域 -->
|
|
@@ -39,20 +51,20 @@
|
|
|
|
|
|
|
|
<el-table-column label="名称" align="center" width="440px">
|
|
<el-table-column label="名称" align="center" width="440px">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <span>{{ row.deviceName }}</span>
|
|
|
|
|
|
|
+ <span>{{ row.name }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="操作" width="440px" align="center">
|
|
<el-table-column label="操作" width="440px" align="center">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
<el-button type="text" size="small" @click="checkPower(row)"
|
|
<el-button type="text" size="small" @click="checkPower(row)"
|
|
|
- >查看当前权限</el-button
|
|
|
|
|
|
|
+ >查看当前身份</el-button
|
|
|
>
|
|
>
|
|
|
<el-button type="text" size="small" @click="bindPower(row)"
|
|
<el-button type="text" size="small" @click="bindPower(row)"
|
|
|
- >添加权限</el-button
|
|
|
|
|
|
|
+ >添加身份</el-button
|
|
|
>
|
|
>
|
|
|
<el-button type="text" size="small" @click="unbindPower(row)"
|
|
<el-button type="text" size="small" @click="unbindPower(row)"
|
|
|
- >删除权限</el-button
|
|
|
|
|
|
|
+ >删除身份</el-button
|
|
|
>
|
|
>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -72,15 +84,15 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 查看权限弹窗区域 -->
|
|
|
|
|
|
|
+ <!-- 查看当前身份弹窗 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
- title="查看当前权限"
|
|
|
|
|
|
|
+ title="查看当前身份"
|
|
|
:visible.sync="dialogCheckPowers"
|
|
:visible.sync="dialogCheckPowers"
|
|
|
width="30%"
|
|
width="30%"
|
|
|
center
|
|
center
|
|
|
>
|
|
>
|
|
|
<el-form>
|
|
<el-form>
|
|
|
- <el-form-item label="已绑定权限:" class="switch-button-item">
|
|
|
|
|
|
|
+ <el-form-item label="已绑定身份:" class="switch-button-item">
|
|
|
<span>
|
|
<span>
|
|
|
<el-tag
|
|
<el-tag
|
|
|
class="groupclass"
|
|
class="groupclass"
|
|
@@ -94,10 +106,10 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
- <!-- 添加权限弹窗区域 -->
|
|
|
|
|
|
|
+ <!-- 添加身份弹窗 -->
|
|
|
|
|
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
- title="添加权限"
|
|
|
|
|
|
|
+ title="添加身份"
|
|
|
:visible.sync="dialogBindPower"
|
|
:visible.sync="dialogBindPower"
|
|
|
width="30%"
|
|
width="30%"
|
|
|
center
|
|
center
|
|
@@ -110,7 +122,12 @@
|
|
|
prop="groups"
|
|
prop="groups"
|
|
|
>
|
|
>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-select v-model="temp.groups" multiple placeholder="请选择">
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="temp.groups"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ multiple
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in groupList"
|
|
v-for="item in groupList"
|
|
|
:key="item.idIdentity"
|
|
:key="item.idIdentity"
|
|
@@ -129,9 +146,9 @@
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
- <!-- 删除权限弹窗区域 -->
|
|
|
|
|
|
|
+ <!-- 删除身份弹窗 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
- title="解绑权限"
|
|
|
|
|
|
|
+ title="删除身份"
|
|
|
:visible.sync="dialogUnbindPower"
|
|
:visible.sync="dialogUnbindPower"
|
|
|
width="30%"
|
|
width="30%"
|
|
|
center
|
|
center
|
|
@@ -175,10 +192,6 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
list: [],
|
|
list: [],
|
|
|
groupList: [
|
|
groupList: [
|
|
|
- // { id: 1, value: "学生", label: "学生" },
|
|
|
|
|
- // { id: 2, value: "老师", label: "老师" },
|
|
|
|
|
- // { id: 3, value: "家长", label: "家长" },
|
|
|
|
|
- // { id: 4, value: "临时人员", label: "临时人员" },
|
|
|
|
|
{ idIdentity: 0, identityName: "其它" },
|
|
{ idIdentity: 0, identityName: "其它" },
|
|
|
{ idIdentity: 1, identityName: "学生" },
|
|
{ idIdentity: 1, identityName: "学生" },
|
|
|
{ idIdentity: 4, identityName: "教职工" },
|
|
{ idIdentity: 4, identityName: "教职工" },
|
|
@@ -194,8 +207,9 @@ export default {
|
|
|
total: 0, //数据的总数//
|
|
total: 0, //数据的总数//
|
|
|
listQuery: {
|
|
listQuery: {
|
|
|
page: 1, //当前在第几页//
|
|
page: 1, //当前在第几页//
|
|
|
- limit: 100, //一页几条//
|
|
|
|
|
|
|
+ limit: 8, //一页几条//
|
|
|
name: "",
|
|
name: "",
|
|
|
|
|
+ serialNumber: "",
|
|
|
},
|
|
},
|
|
|
dialogBindPower: false,
|
|
dialogBindPower: false,
|
|
|
dialogUnbindPower: false,
|
|
dialogUnbindPower: false,
|
|
@@ -231,7 +245,7 @@ export default {
|
|
|
// },
|
|
// },
|
|
|
checkPower(row) {
|
|
checkPower(row) {
|
|
|
this.temp = Object.assign({}, row);
|
|
this.temp = Object.assign({}, row);
|
|
|
- checkPowers({ deviceId: row.idDevice }).then((response) => {
|
|
|
|
|
|
|
+ checkPowers({ deviceId: row.id }).then((response) => {
|
|
|
this.deviceWithPowerList = response.data;
|
|
this.deviceWithPowerList = response.data;
|
|
|
});
|
|
});
|
|
|
this.dialogCheckPowers = true;
|
|
this.dialogCheckPowers = true;
|
|
@@ -248,13 +262,13 @@ export default {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
const tempData = Object.assign({}, this.temp);
|
|
const tempData = Object.assign({}, this.temp);
|
|
|
bindPowers({
|
|
bindPowers({
|
|
|
- id: tempData.idDevice,
|
|
|
|
|
|
|
+ id: tempData.id,
|
|
|
serialNumber: tempData.serialNumber,
|
|
serialNumber: tempData.serialNumber,
|
|
|
identities: tempData.groups,
|
|
identities: tempData.groups,
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
this.dialogBindPower = false;
|
|
this.dialogBindPower = false;
|
|
|
this.$notify({
|
|
this.$notify({
|
|
|
- title: "添加权限成功",
|
|
|
|
|
|
|
+ title: "添加身份成功",
|
|
|
type: "success",
|
|
type: "success",
|
|
|
duration: 1500,
|
|
duration: 1500,
|
|
|
});
|
|
});
|
|
@@ -264,20 +278,20 @@ export default {
|
|
|
},
|
|
},
|
|
|
unbindPower(row) {
|
|
unbindPower(row) {
|
|
|
this.temp = Object.assign({}, row);
|
|
this.temp = Object.assign({}, row);
|
|
|
- checkPowers({ deviceId: row.idDevice }).then((response) => {
|
|
|
|
|
|
|
+ checkPowers({ deviceId: row.id }).then((response) => {
|
|
|
this.deviceWithPowerList = response.data;
|
|
this.deviceWithPowerList = response.data;
|
|
|
});
|
|
});
|
|
|
this.dialogUnbindPower = true;
|
|
this.dialogUnbindPower = true;
|
|
|
},
|
|
},
|
|
|
deletePower(row, index) {
|
|
deletePower(row, index) {
|
|
|
- if (confirm("确定删除权限吗?")) {
|
|
|
|
|
|
|
+ if (confirm("确定删除身份吗?")) {
|
|
|
deletePowers({
|
|
deletePowers({
|
|
|
- id: this.temp.idDevice,
|
|
|
|
|
|
|
+ id: this.temp.id,
|
|
|
serialNumber: this.temp.serialNumber,
|
|
serialNumber: this.temp.serialNumber,
|
|
|
identities: [row.idIdentity],
|
|
identities: [row.idIdentity],
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
this.$notify({
|
|
this.$notify({
|
|
|
- title: "删除权限成功",
|
|
|
|
|
|
|
+ title: "删除身份成功",
|
|
|
type: "success",
|
|
type: "success",
|
|
|
duration: 1500,
|
|
duration: 1500,
|
|
|
});
|
|
});
|
|
@@ -287,9 +301,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleFilter() {
|
|
handleFilter() {
|
|
|
if (!this.listQuery.name) {
|
|
if (!this.listQuery.name) {
|
|
|
- alert("请输入设备名称");
|
|
|
|
|
|
|
+ alert("请输入搜索条件");
|
|
|
} else {
|
|
} else {
|
|
|
- searchList({ name: this.listQuery.name }).then((response) => {
|
|
|
|
|
|
|
+ searchList(this.listQuery).then((response) => {
|
|
|
this.list = response.data;
|
|
this.list = response.data;
|
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
|
});
|
|
});
|
|
@@ -335,6 +349,23 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .form-head {
|
|
|
|
|
+ margin: 0 40px;
|
|
|
|
|
+ width: 1504px;
|
|
|
|
|
+ line-height: 118px;
|
|
|
|
|
+ font-size: 9px;
|
|
|
|
|
+
|
|
|
|
|
+ .input {
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ margin-right: 30px;
|
|
|
|
|
+ width: 210px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .button {
|
|
|
|
|
+ margin-left: 41px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.form {
|
|
.form {
|
|
|
margin-left: 40px;
|
|
margin-left: 40px;
|
|
|
width: 1380px;
|
|
width: 1380px;
|