| | |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 350px; |
| | | width: 250px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 110px; |
| | | width: 90px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | width: calc(100% - 90px); |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 10px; |
| | | margin-top: 4px; |
| | | background-color: #fff; |
| | | height: calc(100% - 100px); |
| | | padding: 20px; |
| | | height: calc(100% - 44px); |
| | | } |
| | | </style> |
| | | <style> |
| | |
| | | <!-- <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;">用户管理</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="medium" type="primary" @click="opeaAdd" v-if="addPower">新增用户</el-button> |
| | | |
| | | </el-col> |
| | | </el-row> --> |
| | | <div class="left"> |
| | |
| | | <el-button size="small" @click="refresh()">重 置</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <el-button size="small" type="primary" @click="openthirdParty">获取三方人员</el-button> |
| | | <el-button size="small" type="primary" @click="opeaAdd" v-if="addPower">新增用户</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.user.selectUserList" :upUrl="$api.user.updateUser" :componentData="componentData" :key="upIndex" @upUser="upUser"/> |
| | |
| | | <el-button type="primary" @click="addStandardTree" :loading="addLoad">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="添加三方人员" :visible.sync="addthirdParty" width="400px"> |
| | | <div class="body"> |
| | | <el-tree |
| | | :data="datathirdParty" |
| | | show-checkbox |
| | | node-key="id" |
| | | :default-expanded-keys="[2, 3]" |
| | | :default-checked-keys="[5]" |
| | | :props="defaultProps"> |
| | | </el-tree> |
| | | <span slot="footer" style="padding-left: 200px"> |
| | | <el-button @click="addthirdParty = false" size="mini">取 消</el-button> |
| | | <el-button type="primary" @click="" :loading="addLoad" size="mini">确 定</el-button> |
| | | </span> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | datathirdParty:[{ |
| | | id: 1, |
| | | label: '一级 1', |
| | | children: [{ |
| | | id: 4, |
| | | label: '二级 1-1', |
| | | children: [{ |
| | | id: 9, |
| | | label: '三级 1-1-1' |
| | | }, { |
| | | id: 10, |
| | | label: '三级 1-1-2' |
| | | }] |
| | | }] |
| | | }, { |
| | | id: 2, |
| | | label: '一级 2', |
| | | children: [{ |
| | | id: 5, |
| | | label: '二级 2-1' |
| | | }, { |
| | | id: 6, |
| | | label: '二级 2-2' |
| | | }] |
| | | }, { |
| | | id: 3, |
| | | label: '一级 3', |
| | | children: [{ |
| | | id: 7, |
| | | label: '二级 3-1' |
| | | }, { |
| | | id: 8, |
| | | label: '二级 3-2' |
| | | }] |
| | | }], |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'label' |
| | | }, |
| | | addthirdParty:false, |
| | | componentData: { |
| | | entity: { |
| | | name: null, |
| | |
| | | upIndex: 0, |
| | | addDia: false, |
| | | addPower: true, |
| | | delStandardTree:true, |
| | | addDia0:false, |
| | | addOb:{ |
| | | fatherId:'', |
| | |
| | | this.getPower() |
| | | }, |
| | | methods: { |
| | | openthirdParty(){ |
| | | this.addthirdParty=true; |
| | | |
| | | }, |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | | }, |
| | |
| | | nodeClose(data, node, el) { |
| | | $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder') |
| | | }, |
| | | getNodeParent(val) { |
| | | if (val.parent != null) { |
| | | this.selectTree += ' - ' + val.label |
| | | this.getNodeParent(val.parent) |
| | | } |
| | | }, |
| | | remove(node, data) { |
| | | this.$confirm("是否删除该层级", "提示", { |
| | | type: "error" |
| | |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | | addStandardTree() { |
| | | if (this.addOb.name == null || this.addOb.factory == '') { |
| | | this.$message.error('构架名称是必填项') |
| | | return |
| | | } |
| | | this.addLoad = true |
| | | this.$axios.post(this.$api.department.addDepartment, this.addOb, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | if (res.code === 201) { |
| | | this.addLoad = false |
| | | return |
| | | } |
| | | this.$message.success('添加成功') |
| | | this.addDia0 = false |
| | | this.selectTreeList() |
| | | this.addLoad = false |
| | | this.addOb.name = '' |
| | | this.addOb.fatherId = '' |
| | | }).catch(e => { |
| | | this.addDia0 = false |
| | | this.addLoad = false |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |