New file |
| | |
| | | import request from "@/common/untils/request.js" |
| | | |
| | | // 新增用户(注册账号) |
| | | export function registerUser(data) { |
| | | return request({ |
| | | url: "/api/user/register", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
New file |
| | |
| | | import request from "@/common/untils/request.js" |
| | | |
| | | // 创建角色 |
| | | export function addAuthority(data) { |
| | | return request({ |
| | | url: "/api/authority/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 设置角色菜单 |
| | | export function setMenuAuthority(data) { |
| | | return request({ |
| | | url: "/api/authority/setMenuAuthority", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | |
| | | <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) { |
| | |
| | | tableInfomation: [ |
| | | { |
| | | number: "1", |
| | | owner: "总经理", |
| | | authorityName: "总经理", |
| | | notes: "" |
| | | } |
| | | ], |
| | | tableColumn: [ |
| | | { label: "#", prop: "number", width: 80 }, |
| | | { label: "权限名称", prop: "owner", width: 160 }, |
| | | { label: "权限名称", prop: "authorityName", width: 160 }, |
| | | { label: "备注", prop: "notes" } |
| | | ] |
| | | } |
| | |
| | | addBtnClick() { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.infomation = { |
| | | customName: "", |
| | | documentNumber: "ZDYBD01-3", |
| | | owner: "", |
| | | contractStatus: "", |
| | | salesQuotation: "", |
| | | approvalWorkflow: "", |
| | | approvalSteps: "", |
| | | approvalPerson: "", |
| | | approvalOpinion: "" |
| | | } |
| | | this.editConfig.infomation = {} |
| | | }, |
| | | // 编辑 |
| | | handleClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { |
| | | customName: "", |
| | | documentNumber: "TKD20230521-12", |
| | | owner: "", |
| | | contractStatus: "", |
| | | salesQuotation: "", |
| | | approvalWorkflow: "", |
| | | approvalSteps: "", |
| | | approvalPerson: "", |
| | | approvalOpinion: "" |
| | | } |
| | | this.editConfig.infomation = { ...row } |
| | | } |
| | | } |
| | | } |