| | |
| | | selectDepartment: "/department/selectDepartment", //人员架构树 |
| | | addDepartment: "/department/addDepartment", //添加部门 |
| | | delDepartment: "/department/delDepartment", //删除部门 |
| | | showUserById: "/department/showUserById", //根据选择的树展示相关的人员 |
| | | } |
| | |
| | | <span v-else-if="data.linkEvent&&showLink(a.label, data.linkEvent)" style="color:#409EFF;cursor: pointer;" |
| | | @click="handleLinkEvent(scope.row,data.linkEvent[a.label])">{{scope.row[a.label]}}</span> |
| | | <img style="width: 40px;height: 40px;margin-top: 10px;" :src="javaApi+'/img/'+scope.row[a.label]" v-else-if="showUpload(a.label)&&scope.row[a.label]" alt=""> |
| | | <span v-else-if="showCascader(a.label)&&scope.row[a.label]">{{handleTree(data.cascaderField[a.label].tree,scope.row[a.label].split(',')[scope.row[a.label].split(',').length-1])}}</span> |
| | | <span v-else>{{scope.row[a.label]}}</span> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader> |
| | | <el-cascader |
| | | :value="upData[a.label]" |
| | | :options="data.cascaderField[a.label].tree" |
| | | v-if="showCascader(a.label)" |
| | | :show-all-levels="false" |
| | | clearable |
| | | :props="data.cascaderField.props" |
| | | size="small" |
| | | style="width: 100%;" |
| | | @change="m=>handleCascader(m,a.label)"></el-cascader> |
| | | </el-col> |
| | | </div> |
| | | </div> |
| | |
| | | <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader> |
| | | <el-cascader :value="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props" size="small" style="width: 100%;" @change="m=>handleCascader(m,a.label)"></el-cascader> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader> |
| | | <el-cascader :options="data.cascaderField[a.label].tree" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props" size="small" style="width: 100%;" :show-all-levels="false" @change="m=>handleCascader(m,a.label)"></el-cascader> |
| | | </el-col> |
| | | </div> |
| | | </div> |
| | |
| | | <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar" style="width: 80px;height: 80px;border-radius: 6px;"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | <el-cascader v-model="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props"></el-cascader> |
| | | <el-cascader :options="data.cascaderField[a.label].tree" v-if="showCascader(a.label)" clearable :props="data.cascaderField.props" size="small" style="width: 100%;" :show-all-levels="false" @change="m=>handleCascader(m,a.label)"></el-cascader> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | this.$refs.eltable.doLayout() |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.data = this.componentData |
| | |
| | | return false; |
| | | } |
| | | }, |
| | | handleTree(arr,value){ |
| | | let label = '' |
| | | for (let i = 0; i < arr.length; i++) { |
| | | if(arr[i].id==value){ |
| | | label = arr[i].name |
| | | return label |
| | | }else if(arr[i].children){ |
| | | label = this.handleTree(arr[i].children,value) |
| | | } |
| | | } |
| | | return label |
| | | }, |
| | | main(row, val) { |
| | | if (val.method == undefined) return |
| | | else if (val.method == 'doDiy') { |
| | | if (val.id == 'update') { |
| | | this.upDia = true, |
| | | this.upData = this.HaveJson(row) |
| | | this.upData = this.HaveJson(row) |
| | | this.upHead = this.HaveJson(this.tableHead) |
| | | this.upHead.forEach((item,index)=>{ |
| | | if(this.data.cascaderField&&this.data.cascaderField[item.label]){ |
| | | if(this.upData[item.label]){ |
| | | this.upData[item.label] = this.upData[item.label].split(',').map(m=>Number(m)); |
| | | }else{ |
| | | this.upData[item.label] = [] |
| | | } |
| | | } |
| | | }) |
| | | this.upHead = this.upHead.filter(a => a.label != 'createTime' && a.label != 'updateTime') |
| | | delete this.upData.orderBy |
| | | delete this.upData.createTime |
| | |
| | | this.upData[a] = JSON.stringify(this.upData[a]) |
| | | } |
| | | } |
| | | this.upHead.forEach((item,index)=>{ |
| | | if(this.data.cascaderField&&this.data.cascaderField[item.label]){ |
| | | if(this.upData[item.label]){ |
| | | this.upData[item.label] = this.upData[item.label].join(','); |
| | | }else{ |
| | | this.upData[item.label] = '' |
| | | } |
| | | } |
| | | }) |
| | | this.$axios.post(this.upUrl, this.upData, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | |
| | | this.$message.success('修改成功') |
| | | this.upDia = false |
| | | this.selectList() |
| | | this.$refs.eltable.doLayout(); |
| | | this.upLoad = false |
| | | }).catch(e => { |
| | | this.$message.error('修改失败') |
| | |
| | | this.selectList() |
| | | } |
| | | } |
| | | }, |
| | | handleCascader(e,label){ |
| | | this.upData[label] = e; |
| | | } |
| | | } |
| | | } |
| | |
| | | <el-tree :data="list" ref="tree" :props="{ children: 'children', label: 'name' }" node-key="id" |
| | | :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen" |
| | | @node-collapse="nodeClose" v-loading="treeLoad" :expand-on-click-node="false" |
| | | :default-expanded-keys="expandedKeys"> |
| | | :default-expanded-keys="expandedKeys" |
| | | :default-checked-keys="[1]"> |
| | | <div class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <el-row style="width: 100%;"> |
| | | <el-col :span="21" :class="{sort:node.level>3}"> |
| | | <span><i |
| | | :class="`node_i ${data.children != undefined&&data.children.length>0 ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i> |
| | | [{{ node.level-1 }}] {{ data.name }}</span> |
| | | {{ data.name }}</span> |
| | | </el-col> |
| | | <el-col :span="2" style="text-align: right;" v-if="delStandardTree"> |
| | | <el-col :span="2" style="text-align: right;" v-if="delStandardTree&&node.level>1"> |
| | | <el-button type="text" size="mini" @click.stop="remove(node, data)"> |
| | | <i class="el-icon-delete"></i> |
| | | </el-button> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="standard_table" v-loading="tableLoad"> |
| | | <ValueTable ref="ValueTable" :url="$api.capacityScope.selectItemParameterList" :componentData="componentData" /> |
| | | <ValueTable ref="ValueTable" :url="$api.department.showUserById" :componentData="componentData" /> |
| | | </el-row> |
| | | </div> |
| | | <el-dialog title="架构新增" :visible.sync="addDia" width="400px"> |
| | |
| | | addStandardProduct: false, |
| | | componentData: { |
| | | entity: { |
| | | name:'', |
| | | departId:'', |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | |
| | | }, |
| | | init:false, |
| | | isIndex: true, |
| | | showSelect: true, |
| | | select: true, |
| | | showSelect: false, |
| | | select: false, |
| | | do: [], |
| | | isPage: false, |
| | | tagField: { |
| | |
| | | this.$refs.ValueTable.selectList() |
| | | }, |
| | | refresh() { |
| | | this.upIndex++ |
| | | this.upIndex++; |
| | | this.componentData.entity.departId = this.list[0].id; |
| | | this.refreshTable() |
| | | }, |
| | | handleNodeClick(val, node, el) { //树的值 |
| | |
| | | } |
| | | this.selectTree = data2.replace(' - ', '') |
| | | this.addOb.fatherId = val.id; |
| | | this.componentData.entity.departId = val.id; |
| | | this.refreshTable() |
| | | }, |
| | | getNodeParent(val) { |
| | | if (val.parent != null) { |
| | |
| | | this.list.forEach(a => { |
| | | a.children.forEach(b => { |
| | | b.children.forEach(c => { |
| | | this.expandedKeys.push(c.name) |
| | | this.expandedKeys.push(c.id) |
| | | }) |
| | | // this.expandedKeys.push(b.label) |
| | | }) |
| | | }) |
| | | this.treeLoad = false |
| | | this.componentData.entity.departId = this.list[0].id; |
| | | this.selectTree = '全部' |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | | addStandardTree() { |
| | |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: false, |
| | | init:false, |
| | | do: [{ |
| | | id: 'update', |
| | | font: '编辑', |
| | |
| | | } |
| | | }, |
| | | cascaderField:{ |
| | | name:{ |
| | | departId:{ |
| | | tree:[] |
| | | }, |
| | | // 字段配置 |
| | | props:{ |
| | | value:'id', |
| | | label:'name', |
| | | checkStrictly: true |
| | | } |
| | | }, |
| | | requiredAdd:['account','name','state','roleId','password'], |
| | | requiredAdd:['account','name','state','roleId','password','departId'], |
| | | requiredUp:['account','name','state','roleId','departId'], |
| | | addUpload:['pictureUrl','signatureUrl'], |
| | | addUploadConfig:{ |
| | | accept:'.png, .jpg, .jpeg, .gif', |
| | | url:this.$api.deviceScope.uploadFile |
| | | }, |
| | | requiredUp:['account','name','state','roleId'] |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.selectTreeList() |
| | | this.selectRole() |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.getPower() |
| | |
| | | opeaAdd(){ |
| | | this.$refs.ValueTable.openAddDia(this.$api.user.addUser); |
| | | }, |
| | | selectTreeList(){ |
| | | this.$axios.get(this.$api.department.selectDepartment).then(res => { |
| | | this.componentData.cascaderField.departId.tree = this.handleTree(res.data[0].children) |
| | | this.$refs.ValueTable.selectList() |
| | | }) |
| | | }, |
| | | handleTree(arr){ |
| | | arr.forEach(a => { |
| | | if(a.children.length==0){ |
| | | a.children = null; |
| | | }else{ |
| | | this.handleTree(a.children) |
| | | } |
| | | }) |
| | | return arr |
| | | }, |
| | | // 权限分配 |
| | | getPower(){ |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |