From 83aa382fd3b88ec7a564f14d41a9c8e5d43beeb3 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 09 十二月 2024 10:26:31 +0800
Subject: [PATCH] 修改表单定义样式&&修改ui上下文btmName&&添加登录密码即将过期进入首页并提醒
---
Source/plt-web/plt-web-ui/src/views/system/role/index.vue | 87 ++++++++++++++++++++++++++-----------------
1 files changed, 52 insertions(+), 35 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
index 19ec3c8..9858341 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
@@ -30,7 +30,7 @@
</template>
</avue-crud>
- <!-- 鍒嗛厤瑙掕壊绌挎妗� -->
+ <!-- 鍒嗛厤鎴愬憳绌挎妗� -->
<transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData"
:transferTitle="transferTitle" title="瑙掕壊娣诲姞鎴愬憳"
@transferSend="roleSendHandler">
@@ -40,7 +40,6 @@
<el-dialog
v-dialogDrag
v-loading="statisticsLoading"
- :destroy-on-close="true"
:visible.sync="statisticsVisible"
append-to-body="true"
class="avue-dialog"
@@ -54,14 +53,15 @@
</avue-crud>
<div slot="footer" class="dialog-footer" style="display: flex;gap: 20px;justify-content: center">
<div>
- <el-tag>褰撳墠瑙掕壊鎬讳汉鏁�: {{this.countData.length}}</el-tag>
+ <el-tag>褰撳墠瑙掕壊鎬讳汉鏁�: {{ this.countData.length }}</el-tag>
</div>
- <el-button size="small" @click="statisticsVisible = false" icon="el-icon-close" type="danger">鍏� 闂�</el-button>
+ <el-button icon="el-icon-close" size="small" type="danger" @click="statisticsVisible = false">鍏� 闂�</el-button>
</div>
</el-dialog>
<!-- 瀵煎叆瑙掕壊 -->
- <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" @updata="getTableList" title="瀵煎叆瑙掕壊"></upload-file>
+ <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆瑙掕壊"
+ @updata="getTableList"></upload-file>
</basic-container>
</template>
@@ -78,6 +78,7 @@
} from '@/api/system/role/api'
import basicOption from "@/util/basic-option";
import {column} from "@/views/system/role/option";
+import func from "@/util/func";
export default {
name: "index",
@@ -88,8 +89,8 @@
...basicOption,
dialogTop: 0,
dialogWidth: '30%',
+ column: column,
calcHeight: -60,
- column: column
},
page: {
currentPage: 1,
@@ -108,10 +109,11 @@
countData: [],
countOption: {
...basicOption,
- selection:false,
+ selection: false,
refreshBtn: false,
- addBtn:false,
- menu:false,
+ addBtn: false,
+ menu: false,
+ header:false,
column: [
{
label: '閮ㄩ棬',
@@ -132,11 +134,13 @@
label: '瑙掕壊',
prop: 'pkPersonName',
sortable: true,
+ overHidden: true,
},
]
},
upFileType: ['xls', 'xlsx'],
fileUrl: 'api/roleQueryController/importRole',
+ tipList: ["瑙掕壊瀵煎叆鍙湁 鍚嶇О 鍜� 鎻忚堪 涓ゅ垪锛屼笖鍚嶇О涓哄繀杈撻」涓嶈兘涓虹┖"]
}
},
methods: {
@@ -173,34 +177,42 @@
// 琛屽崟閫�
rowClickHandler(row) {
- this.$refs.roleCrud.toggleRowSelection(row);
+ func.rowClickHandler(
+ row,
+ this.$refs.roleCrud,
+ this.lastIndex,
+ (newIndex) => { this.lastIndex = newIndex; },
+ () => { this.selectList = [row]; }
+ );
},
// 娣诲姞
- rowSaveHandler(row, done) {
+ rowSaveHandler(row, done, loading) {
delete row.roleClassifyText;
addRole(row).then(res => {
- console.log(res)
if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.getTableList();
+ done();
}
+ }).catch(err => {
+ console.log(err);
+ loading();
})
- done();
},
// 缂栬緫
- rowUpdateHandler(row, index, done) {
+ rowUpdateHandler(row, index, done, loading) {
delete row.roleClassifyText;
updateRole(row).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.getTableList();
+ done();
}
}).catch(err => {
- console.log(err);
+ loading();
});
- done()
},
// 鍒犻櫎
@@ -208,14 +220,24 @@
let params = {
ids: row.oid
}
- deleteRole(params).then(res => {
- if (res.data.code === 200) {
- this.$message.success(res.data.obj);
- this.getTableList();
- }
- }).catch(err => {
- console.log(err);
- })
+
+ this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎褰撳墠瑙掕壊鍚楋紵', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteRole(params).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.getTableList();
+ }
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
},
// 澶氶�夊垹闄�
@@ -261,6 +283,8 @@
listUserUnInRoleOid({pkRole: this.selectList[0].oid}),
listUserByRoleOid({pkRole: this.selectList[0].oid})
]).then(([unInRoleRes, byRoleRes]) => {
+ this.leftRoleData=[];
+ this.rightRoleData=[];
if (unInRoleRes.data.code === 200 && byRoleRes.data.code === 200) {
const leftData = [...unInRoleRes.data.data, ...byRoleRes.data.data];
// 缁勮濂界┛姊鍙敤鏁版嵁
@@ -273,8 +297,6 @@
this.rightRoleData = byRoleRes.data.data.map(item => item.oid);
this.$refs.transfer.visible = true;
}
- }).catch(err => {
- console.error(err);
});
},
@@ -288,8 +310,6 @@
saveRight(params).then(res => {
this.$message.success(res.data.obj);
this.getTableList();
- }).catch(err => {
- this.$message.error(err)
})
},
@@ -305,26 +325,23 @@
return;
}
listUserByRoleOid({pkRole: this.selectList[0].oid}).then(res => {
- console.log(res)
if (res.data.code === 200) {
const data = res.data.data;
this.countData = data.map(item => {
return {
pkDepartmentName: item.pkDepartmentName,
- name:item.name,
- id:item.id,
- pkPersonName:this.selectList[0].name
+ name: item.name,
+ id: item.id,
+ pkPersonName: this.selectList[0].name
}
});
this.statisticsVisible = true;
}
- }).catch(err => {
- console.log(err)
})
},
// 瀵煎叆瑙掕壊
- upLoadRole(){
+ upLoadRole() {
this.$refs.upload.visible = true;
}
}
--
Gitblit v1.9.3