From 75291a6831b27cc76a79985269ed73f79ad1e4b6 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期二, 27 九月 2022 17:07:54 +0800
Subject: [PATCH] 修改菜单权限
---
src/views/personalCenter/components/SubAccount.vue | 247 ++++++++++++++++++++++++++----------------------
1 files changed, 134 insertions(+), 113 deletions(-)
diff --git a/src/views/personalCenter/components/SubAccount.vue b/src/views/personalCenter/components/SubAccount.vue
index 5efb91e..f886f23 100644
--- a/src/views/personalCenter/components/SubAccount.vue
+++ b/src/views/personalCenter/components/SubAccount.vue
@@ -45,10 +45,10 @@
<el-table-column label="搴忓彿" width="55" class-name="index">
<template slot-scope="scope">{{ scope.$index + 1 + (page - 1) * size }}</template>
</el-table-column>
- <el-table-column prop="username" label="鐢ㄦ埛鍚�" show-overflow-tooltip ></el-table-column>
- <el-table-column prop="trueName" label="濮撳悕" show-overflow-tooltip ></el-table-column>
- <el-table-column prop="phoneNum" label="鎵嬫満鍙�" show-overflow-tooltip ></el-table-column>
- <el-table-column prop="userType" label="鐢ㄦ埛绫诲瀷" >
+ <el-table-column prop="username" label="鐢ㄦ埛鍚�" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="trueName" label="濮撳悕" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="phoneNum" label="鎵嬫満鍙�" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="userType" label="鐢ㄦ埛绫诲瀷">
<template slot-scope="scope">
<span>{{ scope.row.userType == 1 ? "鏈湴" : "OA璐︽埛" }}</span>
</template>
@@ -94,10 +94,11 @@
</div>
</div>
<div class="sub-account" v-else-if="isShowAdd">
- <div class="add-title" @click="isShowAdd = false">
+ <!-- <div class="add-title" @click="isShowAdd = false">
<span class="iconfont"></span>
- <span>娣诲姞瀛愯处鎴�</span>
- </div>
+ <span>瀛愯处鎴风鐞�</span>
+ </div> -->
+ <div class="head-name" style="margin-bottom:20px">瀛愯处鎴风紪杈�</div>
<el-form
:model="ruleForm"
:rules="rules"
@@ -194,9 +195,32 @@
/>
</div>
</el-form-item>
+ <el-form-item label="鐭俊鎺ㄩ��" v-show="isEditing">
+ <el-select v-model="smsSceneConfig" multiple collapse-tags style="width: 250px" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="item in taskOptions"
+ style="font-size: 12px"
+ :key="item.id"
+ :value="item.name"
+ :label="item.name"
+ :title="item.name"
+ ></el-option>
+ </el-select>
+ <el-select
+ v-model="smsLevelConfig"
+ multiple
+ collapse-tags
+ style="margin-left:10px;width: 150px"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option v-for="item in levelOptions" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ <el-checkbox v-model="smsEnable" style="margin-left:20px">鍚敤</el-checkbox>
+ </el-form-item>
</el-form>
<div class="right">
- <div class="button searchBtn" @click="saveSubUser">淇濆瓨</div>
+ <div class="button searchBtn" @click="saveUser">淇濆瓨</div>
<div class="button resetBtn" @click="resetUser">閲嶇疆</div>
<div class="button resetBtn" style="margin-left:20px" @click="goback">杩斿洖</div>
</div>
@@ -213,6 +237,7 @@
<script>
import { findUserList, saveSubUser, getMenu, getDataTree, deleteUser } from "@/api/user"
+import { findTaskById, updateTask } from "@/api/report"
import { getAreas, getDic } from "@/api/login"
import Steps from "./Steps"
@@ -224,6 +249,11 @@
Steps,
StepsCard,
TreeMenu
+ },
+ computed: {
+ taskOptions() {
+ return this.VideoPhotoData.tasks.filter((item) => !item.isDelete)
+ }
},
data() {
const validateTree = (rule, value, callback) => {
@@ -242,11 +272,11 @@
searchTime: [this.$moment().format("YYYY-MM-DD 00:00:00"), this.$moment().format("YYYY-MM-DD HH:mm:ss")], //鎼滅储鏃堕棿
page: 1,
size: 10, //鍒嗛〉鐩稿叧
+ total: 0, //鎬绘暟,
inputText: "", //杈撳叆妗嗗唴瀹�
activeStep: 0,
activeIndex: 0,
industrys: [],
- total: 0, //鎬绘暟,
treeHeight: 750,
treeData: [],
treeSettings: {
@@ -324,17 +354,27 @@
username: [{ required: true, message: "璇疯緭鍏ョ敤鎴峰悕", trigger: "blur" }],
// password: [{ required: true, message: "璇疯緭鍏ュ瘑鐮�", trigger: "blur" }],
userType: [{ required: true, message: "璇烽�夋嫨鐢ㄦ埛绫诲瀷", trigger: "blur" }],
- trueName: [{ required: true, message: "璇疯緭鍏ュ鍚�", trigger: "blur" }],
- menuIds: [{ validator: validateTree, trigger: "blur" }]
+ trueName: [{ required: true, message: "璇疯緭鍏ュ鍚�", trigger: "blur" }]
+ // menuIds: [{ validator: validateTree, trigger: "blur" }]
},
sysMenus: [],
DataTree: [],
+ smsSceneConfig: [],
+ smsLevelConfig: [],
+ smsEnable: false,
userInfo: {},
curEditId: "",
defaultProp: {
children: "children",
label: "name"
- }
+ },
+ levelOptions: [
+ { value: "涓�绾�", label: "涓�绾�" },
+ { value: "浜岀骇", label: "浜岀骇" },
+ { value: "涓夌骇", label: "涓夌骇" },
+ { value: "鍥涚骇", label: "鍥涚骇" },
+ { value: "浜旂骇", label: "浜旂骇" }
+ ]
}
},
created() {
@@ -347,6 +387,7 @@
mounted() {
this.TreeDataPool.reset()
this.TreeDataPool.multiple = true
+ this.VideoPhotoData.queryTaskList()
},
methods: {
fetchDataTree() {
@@ -396,11 +437,27 @@
this.checkedMenu = row.menuIds
this.checkedData = row.dataIds
+ this.smsSceneConfig = []
+ this.smsLevelConfig = []
+ this.smsEnable = false
+ findTaskById({ id: row.id }).then((rsp) => {
+ if (rsp && rsp.success && rsp.data != "") {
+ if (rsp.data.taskName != "") {
+ this.smsSceneConfig = rsp.data.taskName.split(",")
+ }
+ if (rsp.data.level != "") {
+ this.smsLevelConfig = rsp.data.level.split(",")
+ }
+ this.smsEnable = rsp.data.enable
+ }
+ })
+
// 鏌ヨ褰撳墠鐢ㄦ埛鏉冮檺涓嬫墍鏈夊彲绠$悊鐨勬憚鍍忔満
if (row.dataIds) {
sessionStorage.setItem("clusterId", row.dataIds[0])
await this.TreeDataPool.fetchTreeData()
}
+
// 鐢╡mail瀛楁鏆傛椂浠f浛鎽勫儚鏈洪泦鍚堝瓧娈�
let checkedCameras = row.email
@@ -416,21 +473,21 @@
}
},
delUser(row) {
- this.$confirm('纭瑕佸垹闄よ鐢ㄦ埛鍚�, 鏄惁缁х画?', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(async () => {
- let rsp = await deleteUser({id:row.id})
- if (rsp && rsp.success) {
- this.$message({
- type: 'success',
- message: '鍒犻櫎鎴愬姛!'
- });
- }
+ this.$confirm("纭瑕佸垹闄よ鐢ㄦ埛鍚�, 鏄惁缁х画?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }).then(async () => {
+ let rsp = await deleteUser({ id: row.id })
+ if (rsp && rsp.success) {
+ this.$message({
+ type: "success",
+ message: "鍒犻櫎鎴愬姛!"
+ })
+ }
- this.findUserList()
- })
+ this.findUserList()
+ })
},
resetUser() {
this.ruleForm = {
@@ -449,6 +506,9 @@
provinceId: "",
authDuration: 1
}
+ this.smsSceneConfig = []
+ this.smsLevelConfig = []
+ this.smsEnable = false
this.$nextTick(() => {
this.$refs.treeMenus.setCheckedKeys([])
this.$refs.treeData.setCheckedKeys([])
@@ -462,7 +522,7 @@
console.log("鏌ヨ琛屼笟鍒楄〃澶辫触锛�")
}
},
- saveSubUser() {
+ saveUser() {
let _this = this
this.ruleForm.menuIds = this.$refs.treeMenus.getCheckedKeys()
this.ruleForm.dataIds = this.$refs.treeData.getCheckedKeys()
@@ -495,6 +555,7 @@
// 缂栬緫涓嶆彁浜ゅ瘑鐮�
if (this.isEditing) {
delete json.password
+ json.isChangePwd = false
}
if (typeof json.areaId === "string") {
@@ -509,16 +570,34 @@
saveSubUser(json)
.then((res) => {
if (res.success) {
- this.$notify.success(res.data)
- this.isShowAdd = false
- this.isEditing = false
- this.findUserList()
+ // 淇濆瓨娑堟伅鎺ㄩ��
+ if (_this.isEditing) {
+ let smsTaskInfo = {
+ id: _this.ruleForm.id,
+ taskName: _this.smsSceneConfig.join(","),
+ level: _this.smsLevelConfig.join(","),
+ cameras: json.email,
+ person: json.trueName,
+ tel: json.phoneNum,
+ enable: _this.smsEnable,
+ IsDel: "0"
+ }
+
+ updateTask(smsTaskInfo).then((rsp) => {
+ // console.log(rsp)
+ })
+ }
+
+ _this.$notify.success(res.data)
+ _this.isShowAdd = false
+ _this.isEditing = false
+ _this.findUserList()
} else {
- this.$notify.error(res.msg)
+ _this.$notify.error(res.msg)
}
})
.catch((err) => {
- this.$notify.error(err.data.msg)
+ _this.$notify.error(err.data.msg)
})
} else {
return false
@@ -557,34 +636,7 @@
this.inputText = ""
this.timeLength = null
},
- // 璺冲埌璁惧璇︽儏
- checkDetail(row) {
- this.$router.push({
- path: "/equipmentDetail",
- query: {
- id: row.devId,
- ip: row.devIp,
- port: row.serverPort,
- ndid: row.id
- }
- })
- },
- // 璺冲埌绠楁硶璇︽儏
- algorithmDetail(row) {
- this.$router.push({
- path: "/algorithmDetail",
- query: {
- id: row.devId,
- ip: row.devIp,
- port: row.serverPort
- }
- })
- },
-
- // 鏌ヨ鍒楄〃
-
- save() {},
//鍒嗛〉鍔熻兘
handleSizeChange(size) {
this.size = size
@@ -596,53 +648,14 @@
this.findUserList()
},
- //瑙g粦鎸夐挳
- Untying(row) {
- console.log(row)
- this.unbindId = row.id
- this.isShowUnbind = true
- },
-
- //鑾峰緱榛樿鏃堕棿
- getDateInit() {
- // 瑕佹眰 榛樿涓�涓湀
- const end = new Date()
- const start = new Date()
- const nowDate = new Date()
- nowDate.setHours(0)
- nowDate.setMinutes(0)
- nowDate.setSeconds(0)
- nowDate.setMilliseconds(0)
- start.setTime(nowDate.getTime() - 3600 * 1000 * 24 * 30)
- end.setTime(nowDate.getTime() + 3600 * 1000 * 24 - 1)
- return [this.$moment(start).format("YYYY-MM-DD HH:mm:ss"), this.$moment(end).format("YYYY-MM-DD HH:mm:ss")]
- },
-
- // 鍏抽棴瑙g粦寮圭獥
- closeUnbindBox() {
- this.isShowUnbind = false
- },
-
- //瑙g粦鎴愬姛鍥炶皟
- reflash() {
- this.isShowUnbind = false
- },
-
- clearSearch() {
- this.searchTime = this.getDateInit()
- this.inputText = ""
- },
-
- //閫�鍑洪泦缇�
- quitCluster(equipment) {
- this.activeEquipment = equipment
- this.showQuit = true
- },
-
- //鍔犲叆闆嗙兢
- joinCluster(equipment) {
- this.activeEquipment = equipment
- this.showJoin = true
+ // 鐢熸垚uuid
+ getUuid() {
+ let originStr = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
+ let originChar = "0123456789abcdef"
+ let len = originChar.length
+ return originStr.replace(/x/g, function(match) {
+ return originChar.charAt(Math.floor(Math.random() * len))
+ })
}
}
}
@@ -708,9 +721,10 @@
}
}
.searchBtn {
- width: 60px;
- height: 32px;
- line-height: 32px;
+ width: 50px;
+ height: 25px;
+ line-height: 25px;
+ font-size: 14px;
text-align: center;
color: #fff;
background: #0065ff;
@@ -720,9 +734,10 @@
display: flex;
}
.resetBtn {
- width: 60px;
- height: 32px;
- line-height: 32px;
+ width: 50px;
+ height: 25px;
+ line-height: 25px;
+ font-size: 14px;
text-align: center;
color: #0065ff;
box-sizing: border-box;
@@ -931,6 +946,12 @@
}
}
}
+
+ .el-select ::v-deep {
+ .el-select__tags-text {
+ color: #3d3d3d;
+ }
+ }
}
</style>
--
Gitblit v1.8.0