| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="5"> |
| | | <!-- <el-col :span="5"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | </el-col> --> |
| | | <el-col :span="24"> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :search.sync="search" |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot-scope="{type,row,size}" slot="menu"> |
| | | <el-button |
| | | :type="type" |
| | | :size="size" |
| | | icon="el-icon-edit" |
| | | :disabled="row.roleId == 1123598816738675201" |
| | | @click="update(row)">编辑</el-button> |
| | | <el-button |
| | | :type="type" |
| | | :size="size" |
| | | icon="el-icon-delete" |
| | | :disabled="row.roleId == 1123598816738675201" |
| | | @click="rowDel(row)">删除</el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | |
| | | </template> |
| | | </avue-crud> |
| | | </el-dialog> |
| | | <el-drawer |
| | | title="编辑" |
| | | size="60%" |
| | | :visible.sync="dialogVisible" |
| | | width="width" |
| | | :modal="true" |
| | | :modal-append-to-body="false" |
| | | :append-to-body="true" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | > |
| | | <div> |
| | | <avue-form |
| | | ref="form" |
| | | :option="option" |
| | | v-model="form" |
| | | @reset-change="emptytChange" |
| | | @submit="submitUpdate" |
| | | > |
| | | </avue-form> |
| | | </div> |
| | | </el-drawer> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | roleBox: false, |
| | | excelBox: false, |
| | | platformBox: false, |
| | | dialogVisible:false, |
| | | initFlag: true, |
| | | selectionList: [], |
| | | query: {}, |
| | |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | | delBtn:false, |
| | | editBtn:false, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | refreshBtn:false, |
| | | columnBtn:false, |
| | | searchShowBtn:false, |
| | | selectable:(row,index)=>{ |
| | | return row.roleId != "1123598816738675201"; |
| | | }, |
| | | column: [ |
| | | { |
| | | label: "登录账号", |
| | |
| | | label: "所属租户", |
| | | prop: "tenantName", |
| | | slot: true, |
| | | display: false |
| | | display: false, |
| | | hide:true |
| | | }, |
| | | { |
| | | label: "用户姓名", |
| | |
| | | label: "所属部门", |
| | | prop: "deptName", |
| | | slot: true, |
| | | display: false |
| | | display: false, |
| | | hide:true |
| | | }, |
| | | // { |
| | | // label: "用户平台", |
| | |
| | | type: "tree", |
| | | value:"000000", |
| | | display:false, |
| | | hide:true, |
| | | dicUrl: "/api/blade-system/tenant/select", |
| | | props: { |
| | | label: "tenantName", |
| | |
| | | label: '密码', |
| | | prop: 'password', |
| | | hide: true, |
| | | editDisplay: false, |
| | | display: false, |
| | | viewDisplay: false, |
| | | rules: [{required: true, validator: validatePass, trigger: 'blur'}] |
| | | }, |
| | |
| | | label: '确认密码', |
| | | prop: 'password2', |
| | | hide: true, |
| | | editDisplay: false, |
| | | display: false, |
| | | viewDisplay: false, |
| | | rules: [{required: true, validator: validatePass2, trigger: 'blur'}] |
| | | }, |
| | |
| | | label: "所属租户", |
| | | prop: "tenantName", |
| | | slot: true, |
| | | hide:true, |
| | | display: false |
| | | }, |
| | | { |
| | |
| | | const column = this.findObject(this.option.group, "roleId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | const data = { |
| | | deptId:this.userInfo.dept_id |
| | | } |
| | | getFarmList(data).then(res => { |
| | | getFarmList().then(res => { |
| | | const column = this.findObject(this.option.group, "farmId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | update(row){ |
| | | this.form = { |
| | | id:row.id, |
| | | account:row.account, |
| | | name:row.name, |
| | | realName:row.realName, |
| | | phone:row.phone, |
| | | email:row.email, |
| | | sex:row.sex, |
| | | birthday:row.birthday, |
| | | roleId:row.roleId.split(','), |
| | | farmId : row.farmId.split(",") |
| | | } |
| | | this.dialogVisible = true |
| | | }, |
| | | submitUpdate(row, done, loading){ |
| | | this.form['deptId'] = this.userInfo.dept_id; |
| | | this.form.roleId = this.form.roleId.join(",") |
| | | this.form.farmId = this.form.farmId.join(",") |
| | | update(this.form).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.dialogVisible = false |
| | | done(); |
| | | |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | done(); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | |
| | | if(type == "add"&& column.dicData == ""){ |
| | | this.initData(website.tenantId) |
| | | } |
| | | this.form = {} |
| | | if (["edit", "view"].includes(type)) { |
| | | getUser(this.form.id).then(res => { |
| | | this.form = res.data.data; |