| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="权限名称" prop="owner"> |
| | | <el-input v-model="editConfig.infomation.owner"></el-input> |
| | | <el-form-item label="权限名称" prop="authorityName"> |
| | | <el-input v-model="editConfig.infomation.authorityName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="btn"> |
| | | <el-button type="primary" size="small" @click="editConfig.visible = false">保 存</el-button> |
| | | <el-button type="primary" size="small" @click="saveClick('form')">保 存</el-button> |
| | | <el-button size="small" @click="editConfig.visible = false">取 消</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addAuthority } from "@/api/backgroundConfig/rolePermssion" // setMenuAuthority |
| | | export default { |
| | | name: "AddRolePermissionDialog", |
| | | props: { |
| | |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: { |
| | | owner: "", |
| | | notes: "" |
| | | } |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | |
| | | dialogWidth: "60%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | owner: [{ required: true, message: "请输入", trigger: "blur" }] |
| | | authorityName: [{ required: true, message: "请输入", trigger: "blur" }] |
| | | }, |
| | | moduleSelTitle: "全部", |
| | | tableData: [], |
| | |
| | | methods: { |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | if (this.editConfig.title === "新建") { |
| | | addAuthority({ |
| | | authorityName: this.editConfig.infomation.authorityName, |
| | | casbinInfos: [] |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | message: "添加成功", |
| | | type: "success" |
| | | }) |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | } else { |
| | | // getUpdateClient(params) |
| | | // .then((res) => { |
| | | // console.log(res) |
| | | // this.editConfig.visible = false |
| | | // if (res.code === 200) { |
| | | // this.$message({ |
| | | // message: "编辑成功", |
| | | // type: "success" |
| | | // }) |
| | | // this.$parent.getData() |
| | | // } |
| | | // }) |
| | | // .catch((err) => { |
| | | // console.log(err) |
| | | // }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | // 模块选择 |
| | | moduleSelectClick(value) { |
| | |
| | | this.tableData = [] |
| | | } |
| | | }, |
| | | // 模块全选 |
| | | // 模块全选 / 取消全选 |
| | | selAllChange(row) { |
| | | if (row.checked) { |
| | | let arr = [] |
| | |
| | | arr.push(ele.name) |
| | | }) |
| | | row.checkedList = arr |
| | | } else { |
| | | row.checkedList = [] |
| | | } |
| | | }, |
| | | handleCheckedChange(value, row) { |