|
@@ -32,6 +32,7 @@
|
|
<div class="msg flex-wrap">
|
|
<div class="msg flex-wrap">
|
|
<p :title="item.RoleName" class="name">{{item.RoleName}}</p>
|
|
<p :title="item.RoleName" class="name">{{item.RoleName}}</p>
|
|
<div v-is="['role_edit']" @click="editRole(item)" class="cap cap-edit"></div>
|
|
<div v-is="['role_edit']" @click="editRole(item)" class="cap cap-edit"></div>
|
|
|
|
+ <div @click="authRole(item)" class="cap cap-auth"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-is="['role_delete']" class="info-close">
|
|
<div v-is="['role_delete']" class="info-close">
|
|
@@ -79,6 +80,30 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Dialog>
|
|
</Dialog>
|
|
|
|
+ <!--新增/编辑-->
|
|
|
|
+ <Dialog :flag="editDialogVisible" width="508px" :show-flag="true">
|
|
|
|
+ <div class="airportInfoDialog dialog-public-background">
|
|
|
|
+ <div class="title">{{ editDialogTitle }}</div>
|
|
|
|
+ <div class="content">
|
|
|
|
+ <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="130px" class="demo-ruleForm">
|
|
|
|
+ <el-form-item label="角色名称" prop="RoleName">
|
|
|
|
+ <el-input v-model="ruleForm.RoleName" size="medium" placeholder="请输入节点名称(必填)" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="角色描述" prop="RoleDesc">
|
|
|
|
+ <el-input v-model="ruleForm.RoleDesc" size="medium" type="textarea" :rows="3" placeholder="请输入跟踪节点描述" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="是否启用" prop="RoleStatus">
|
|
|
|
+ <el-radio v-model="ruleForm.RoleStatus" :label="1">是</el-radio>
|
|
|
|
+ <el-radio v-model="ruleForm.RoleStatus" :label="0">否</el-radio>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="foot center t30">
|
|
|
|
+ <el-button size="medium" type="primary" class="r25 r26" @click="submitClickHandler()">提交</el-button>
|
|
|
|
+ <el-button size="medium" class="r26" @click="resetForm('ruleForm')">取消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </Dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -86,7 +111,7 @@
|
|
import Search from '@/layout/components/Search'
|
|
import Search from '@/layout/components/Search'
|
|
import Dialog from '@/layout/components/Dialog'
|
|
import Dialog from '@/layout/components/Dialog'
|
|
import roleData from '../minixs/roleData'
|
|
import roleData from '../minixs/roleData'
|
|
-import { UpdateStatus } from '@/api/apiAuthority'
|
|
|
|
|
|
+import { UpdateStatus, SaveRole, RoleDetails, EditRole } from '@/api/apiAuthority'
|
|
export default {
|
|
export default {
|
|
name: 'AuthorityRole',
|
|
name: 'AuthorityRole',
|
|
components: { Search, Dialog },
|
|
components: { Search, Dialog },
|
|
@@ -105,7 +130,24 @@ export default {
|
|
loading: false,
|
|
loading: false,
|
|
keyWords: '',
|
|
keyWords: '',
|
|
total: null,
|
|
total: null,
|
|
- search: null
|
|
|
|
|
|
+ search: null,
|
|
|
|
+ editDialogVisible: false,
|
|
|
|
+ editDialogTitle: '新增角色',
|
|
|
|
+ editType: 'add',
|
|
|
|
+ ruleForm: {
|
|
|
|
+ // 协议信息表单
|
|
|
|
+ RoleName: "",
|
|
|
|
+ RoleStatus: "",
|
|
|
|
+ RoleDesc: "",
|
|
|
|
+ },
|
|
|
|
+ rules: {
|
|
|
|
+ // 协议信息表单验证
|
|
|
|
+ RoleName: [
|
|
|
|
+ { required: true, message: "请输入角色名称", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ruleFormObj: {},
|
|
|
|
+ roleId: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
@@ -141,10 +183,22 @@ export default {
|
|
},
|
|
},
|
|
//角色新增
|
|
//角色新增
|
|
addRole () {
|
|
addRole () {
|
|
- this.$router.push('/role/addRole')
|
|
|
|
|
|
+ this.editDialogTitle = '新增角色'
|
|
|
|
+ this.editDialogVisible = true
|
|
|
|
+ this.editType = 'add'
|
|
|
|
+ // this.$router.push('/role/addRole')
|
|
},
|
|
},
|
|
//角色编辑
|
|
//角色编辑
|
|
editRole (item) {
|
|
editRole (item) {
|
|
|
|
+ this.editDialogVisible = true
|
|
|
|
+ this.editType = 'edit'
|
|
|
|
+ this.editDialogTitle = '编辑角色'
|
|
|
|
+ this.roleId = item.RoleId
|
|
|
|
+ this.roleDetails(item.RoleId)
|
|
|
|
+ // this.$router.push({ path: '/role/editRole', query: { RoleId: item.RoleId, Status: item.Status } })
|
|
|
|
+ },
|
|
|
|
+ // 角色授权
|
|
|
|
+ authRole (item) {
|
|
this.$router.push({ path: '/role/editRole', query: { RoleId: item.RoleId, Status: item.Status } })
|
|
this.$router.push({ path: '/role/editRole', query: { RoleId: item.RoleId, Status: item.Status } })
|
|
},
|
|
},
|
|
//查询
|
|
//查询
|
|
@@ -195,6 +249,85 @@ export default {
|
|
console.log('出错了', error)
|
|
console.log('出错了', error)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 新增/编辑-确认
|
|
|
|
+ submitClickHandler () {
|
|
|
|
+ this.$refs["ruleForm"].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if (this.editType == 'add') {
|
|
|
|
+ this.saveRole()
|
|
|
|
+ } else {
|
|
|
|
+ this.editRoleFunc()
|
|
|
|
+ }
|
|
|
|
+ this.resetForm('ruleForm')
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 重置
|
|
|
|
+ resetForm (formName) {
|
|
|
|
+ this.$refs[formName].resetFields()
|
|
|
|
+ this.editDialogVisible = false
|
|
|
|
+ },
|
|
|
|
+ //新增保存
|
|
|
|
+ async saveRole () {
|
|
|
|
+ try {
|
|
|
|
+ const res = await SaveRole(this.ruleForm);
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.$message.success(res.message);
|
|
|
|
+ this.gueryRole({
|
|
|
|
+ QueryName: this.keyWords,
|
|
|
|
+ PageSize: this.PageSize,
|
|
|
|
+ PageIndex: this.pageNum
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log("出错了", error);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //角色明细
|
|
|
|
+ async roleDetails (id) {
|
|
|
|
+ try {
|
|
|
|
+ const res = await RoleDetails({
|
|
|
|
+ RoleId: id,
|
|
|
|
+ });
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ const { RoleName, RoleDesc, RoleStatus } = res.returnData;
|
|
|
|
+ this.ruleForm.RoleName = RoleName;
|
|
|
|
+ this.ruleForm.RoleDesc = RoleDesc;
|
|
|
|
+ this.ruleForm.RoleStatus = RoleStatus;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log("出错了", error);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //确认保存
|
|
|
|
+ async editRoleFunc () {
|
|
|
|
+ try {
|
|
|
|
+ const res = await EditRole({
|
|
|
|
+ RoleName: this.ruleForm.RoleName,
|
|
|
|
+ RoleDesc: this.ruleForm.RoleDesc,
|
|
|
|
+ RoleStatus: this.ruleForm.RoleStatus,
|
|
|
|
+ RoleId: this.roleId,
|
|
|
|
+ });
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.$message.success(res.message);
|
|
|
|
+ this.gueryRole({
|
|
|
|
+ QueryName: this.keyWords,
|
|
|
|
+ PageSize: this.PageSize,
|
|
|
|
+ PageIndex: this.pageNum
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log("出错了", error);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//滚动加载数据
|
|
//滚动加载数据
|
|
load () {
|
|
load () {
|
|
this.pageNum += 1
|
|
this.pageNum += 1
|
|
@@ -301,6 +434,13 @@ export default {
|
|
background-image: url("../../../assets/status/ic_subordinate_hovar.png");
|
|
background-image: url("../../../assets/status/ic_subordinate_hovar.png");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .cap-auth {
|
|
|
|
+ margin-left: 12px;
|
|
|
|
+ background-image: url("../../../assets/status/ic_edit_authorization.png");
|
|
|
|
+ &:hover {
|
|
|
|
+ background-image: url("../../../assets/status/ic_edit_authorization_hover.png");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.team {
|
|
.team {
|