From ff895d99ccc8cbff646c713cebe077d09f978ec5 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期三, 08 一月 2025 17:37:00 +0800
Subject: [PATCH] 修改bug表中bug
---
Source/plt-web/plt-web-ui/src/views/system/department/index.vue | 95 +++++++++++++++++++++++++++++++++++++----------
1 files changed, 74 insertions(+), 21 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/system/department/index.vue b/Source/plt-web/plt-web-ui/src/views/system/department/index.vue
index d56868a..8f6cebd 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/department/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/department/index.vue
@@ -15,20 +15,46 @@
@current-row-change="handleCurrentRowChange"
>
<template slot="menu" slot-scope="{row,size,type}">
- <el-button icon="el-icon-circle-plus-outline" size="small" type="text" @click="handleAdd()">鏂板瀛愮骇</el-button>
- <el-button v-if="row.ALLDept !== 'ALLDept'" icon="el-icon-edit" size="small" type="text"
- @click="editBtnClick(row)">缂栬緫
+ <el-button v-if="permissionList.departmentAddChildrenBtn" size="small"
+ type="text" @click="handleAdd()">
+ <icon-show :name="permissionList.departmentAddChildrenBtn.source"></icon-show>
+ 鏂板瀛愮骇
</el-button>
- <el-button v-if="row.ALLDept !== 'ALLDept'" icon="el-icon-delete" size="small" type="text"
- @click="rowDeleteHandler(row)">鍒犻櫎
+ <el-button v-if="row.ALLDept !== 'ALLDept' && permissionList.editBtn" size="small"
+ type="text"
+ @click="editBtnClick(row)">
+ <icon-show :name="permissionList.editBtn.source"></icon-show>
+ 缂栬緫
+ </el-button>
+ <el-button v-if="row.ALLDept !== 'ALLDept' && permissionList.delBtn" size="small"
+ type="text"
+ @click="rowDeleteHandler(row)">
+ <icon-show :name="permissionList.delBtn.source"></icon-show>
+ 鍒犻櫎
</el-button>
</template>
<template slot="menuLeft" slot-scope="scope">
- <el-button icon="el-icon-school" plain size="small" type="primary" @click="assignMembersHandler">鍒嗛厤鎴愬憳</el-button>
- <el-button icon="el-icon-user" plain size="small" type="primary" @click="statisticsHandler">缁熻</el-button>
- <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="statisticsHandler">瀵煎叆閮ㄩ棬</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">涓嬭浇瀵煎叆妯℃澘</el-button>
+ <el-button v-if="permissionList.assignMembersBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="assignMembersHandler">
+ <icon-show :name="permissionList.assignMembersBtn.source"></icon-show>
+ 鍒嗛厤鎴愬憳
+ </el-button>
+ <el-button v-if="permissionList.statisticsBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="statisticsHandler">
+ <icon-show :name="permissionList.statisticsBtn.source"></icon-show>
+ 缁熻
+ </el-button>
+ <el-button v-if="permissionList.importDepartmentBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="upLoadHandler">
+ <icon-show :name="permissionList.importDepartmentBtn.source"></icon-show>
+ 瀵煎叆閮ㄩ棬
+ </el-button>
+ <el-button v-if="permissionList.downloadImportTemplateBtn" class="button-custom-icon" plain size="small"
+ type="primary" @click="downLoadHandler">
+ <icon-show :name="permissionList.downloadImportTemplateBtn.source"></icon-show>
+ 涓嬭浇瀵煎叆妯℃澘
+ </el-button>
</template>
</avue-crud>
@@ -36,7 +62,6 @@
<el-dialog
v-dialogDrag
v-loading="statisticsLoading"
- :destroy-on-close="true"
:visible.sync="statisticsVisible"
append-to-body="true"
class="avue-dialog"
@@ -63,6 +88,10 @@
@transferSend="departTransferSend">
</transfer>
+ <!-- 瀵煎叆閮ㄩ棬 -->
+ <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆閮ㄩ棬"
+ @updata="getTableList"></upload-file>
+
</basic-container>
</template>
@@ -81,6 +110,7 @@
import basicOption from '@/util/basic-option';
import {column} from './option'
import func from "@/util/func";
+import {mapGetters} from "vuex";
export default {
name: "departmentManage",
@@ -91,12 +121,15 @@
...basicOption,
rowKey: 'oid',
rowParentKey: 'parentId',
+ expandRowKeys: [],
selection: false,
addBtn: false,
editBtn: false,
delBtn: false,
gridBtn: false,
+ menuWidth: 280,
highlightCurrentRow: true,
+ calcHeight: -50,
column: column
},
tableLoading: false,
@@ -110,7 +143,9 @@
selection: false,
refreshBtn: false,
addBtn: false,
+ header: false,
menu: false,
+ calcHeight: 80,
column: [
{
label: '閮ㄩ棬',
@@ -131,19 +166,38 @@
label: '瑙掕壊',
prop: 'pkPersonName',
sortable: true,
+ overHidden: true,
},
]
},
leftTransferData: [],
rightTransferData: [],
transferTitle: ['寰呴�変汉鍛�', '宸查�変汉鍛�'],
+ tipList: ['瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」', '瀵煎叆缁撴瀯涓烘爲缁撴瀯鏃惰淇濊瘉ID鍒椾笉鑳介噸澶�', '鐖禝D璇蜂娇鐢ㄧ晫闈笂閮ㄩ棬鐨勫敮涓�鏍囪瘑ID鎴栬�匛xcel涓墜鍔ㄨ緭鍏ョ殑ID', '鐖禝D鍒椾负绌烘椂锛屽鍏ョ殑閮ㄩ棬鍗充负椤跺眰閮ㄩ棬'],
+ upFileType: ['xls', 'xlsx'],
+ fileUrl: 'api/departmentQueryController/importDept',
}
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+ editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+ assignMembersBtn: this.vaildData(this.permission[this.$route.query.id].FREEZE, false),
+ departmentAddChildrenBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+ downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOADFILE, false),
+ importDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].MGR, false),
+ statisticsBtn: this.vaildData(this.permission[this.$route.query.id].DISCARD, false),
+ };
+ },
},
methods: {
// 琛ㄦ牸鍒濆鍖栬姹�
getTableList() {
refTree({queryAllLevel: true, 'extandParamsMap[showAllDepartmentNode]': true}).then(res => {
this.tableData = this.departDtaFormAtter(res.data.treeData);
+ this.option.expandRowKeys = [res.data.treeData[0].oid];
})
},
@@ -152,6 +206,7 @@
return items.map(item => {
// 杞崲褰撳墠鑺傜偣鐨勫睘鎬�
const formList = {
+ expanded: item.expanded,
oid: item.oid,
id: item.attributes.id,
name: item.attributes.name,
@@ -195,7 +250,6 @@
done();
}
}).catch(err => {
- console.log(err);
loading();
})
@@ -223,7 +277,6 @@
done();
}
}).catch(err => {
- console.log(err);
loading();
})
},
@@ -273,7 +326,6 @@
}
countSmUserByDeptOid({pkDepartment: this.departCurrenRow.ALLDept === 'ALLDept' ? null : this.departCurrenRow.oid}).then(res => {
- console.log(res);
if (res.data.code === 200) {
const data = res.data.data;
this.countData = data.map(item => {
@@ -318,19 +370,17 @@
this.rightTransferData = byRoleRes.data.data.map(item => item.oid);
this.$refs.transfer.visible = true;
}
- }).catch(err => {
- console.error(err);
});
},
// 鍒嗛厤鎴愬憳绌挎妗嗗洖濉�
departTransferSend(row) {
let params = {
- userOids: row.join(','),
+ userOIds: row.join(','),
deptId: this.departCurrenRow.oid
}
saveUsersDepts(params).then(res => {
- console.log(res);
+ //console.log(res);
this.$message.success(res.data.obj);
this.getTableList();
}).catch(err => {
@@ -339,13 +389,16 @@
},
// 涓嬭浇瀵煎叆妯℃澘
- downLoadHandler(){
+ downLoadHandler() {
download().then(res => {
func.downloadFileByBlobHandler(res);
this.$message.success('涓嬭浇鎴愬姛')
- }).catch(err => {
- this.$message.error(err);
- })
+ });
+ },
+
+ // 瀵煎叆閮ㄩ棬
+ upLoadHandler() {
+ this.$refs.upload.visible = true;
}
}
}
--
Gitblit v1.9.3