From 49f13be32b8c3a0742df021f13300f34d86c9b89 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 23 十月 2024 17:46:50 +0800
Subject: [PATCH] 日志导出接口上传
---
Source/plt-web/plt-web-ui/src/views/system/user/index.vue | 69 ++++++++++++++++++++++------------
1 files changed, 44 insertions(+), 25 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue
index 1970aa3..f51774b 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue
@@ -53,7 +53,7 @@
<el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">鍒犻櫎</el-button>
<el-button size="small" type="text" @click.stop="stopUserHandler(row)">
<span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> 鍋滅敤</span>
- <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-pause"></i> 鍚敤</span>
+ <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-play"></i> 鍚敤</span>
</el-button>
</template>
@@ -62,7 +62,7 @@
<el-button icon="el-icon-user" plain size="small" type="primary" @click="roleHandler">鍒嗛厤瑙掕壊</el-button>
<el-button icon="el-icon-school" plain size="small" type="primary" @click="departmentHandler">鍒嗛厤閮ㄩ棬</el-button>
<el-button icon="el-icon-key" plain size="small" type="success" @click="setPwsHandler">璁剧疆瀵嗙爜绛栫暐</el-button>
- <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadRole">瀵煎叆浜哄憳</el-button>
+ <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">瀵煎叆浜哄憳</el-button>
<el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">涓嬭浇瀵煎叆妯℃澘</el-button>
</template>
</avue-crud>
@@ -77,7 +77,6 @@
<el-dialog
v-dialogDrag
v-loading="pwdLoading"
- :destroy-on-close="true"
:visible.sync="pwdVisible"
append-to-body="true"
class="avue-dialog"
@@ -100,13 +99,12 @@
</el-dialog>
<!-- 瀵煎叆浜哄憳 -->
- <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" title="瀵煎叆浜哄憳"></upload-file>
+ <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" title="瀵煎叆浜哄憳" @updata="getTableList"></upload-file>
<!-- 鍒嗛厤閮ㄩ棬瀵硅瘽妗� -->
<el-dialog
v-dialogDrag
v-loading="departLoading"
- :destroy-on-close="true"
:visible.sync="departVisible"
append-to-body="true"
class="avue-dialog"
@@ -161,6 +159,7 @@
departCurrenRow: {},
departOption: {
...basicOption,
+ addBtn:false,
rowKey: 'oid',
rowParentKey: 'parentId',
selection: false,
@@ -173,6 +172,7 @@
{
label: '鍚嶇О',
prop: 'name',
+ align:'left'
},
{
label: '缂栧彿',
@@ -213,7 +213,9 @@
selectList: [],
leftRoleData: [], // 鍒嗛厤瑙掕壊绌挎妗嗗乏渚у垵濮嬫暟鎹�
rightRoleData: [], // 鍒嗛厤瑙掕壊绌挎妗嗗彸渚у垵濮嬫暟鎹�
- transferTitle: ['鐜版湁瑙掕壊', '鎷ユ湁瑙掕壊']
+ transferTitle: ['鐜版湁瑙掕壊', '鎷ユ湁瑙掕壊'],
+ tipList:["瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」","閮ㄩ棬鍒椾笂涓嬬骇鍏崇郴蹇呴』鎸夌収鍙嶆枩鏉犻殧寮�(/)"],
+ lastIndex:null,
}
},
created() {
@@ -227,6 +229,7 @@
}
done();
},
+
// 琛ㄦ牸璇锋眰
getTableList() {
this.tableLoading = true;
@@ -235,9 +238,7 @@
this.tableData = data;
this.page.total = res.data.total;
this.tableLoading = false;
- }).catch(err => {
- this.$message.error(err)
- });
+ })
},
// 琛ㄦ牸鍙充晶鍒锋柊鍥炬爣
@@ -310,7 +311,13 @@
// 鐐瑰嚮琛�
rowClickHandler(row) {
- this.$refs.userCrud.toggleRowSelection(row);
+ func.rowClickHandler(
+ row,
+ this.$refs.userCrud,
+ this.lastIndex,
+ (newIndex) => { this.lastIndex = newIndex; },
+ () => { this.selectList = []; }
+ );
},
// 鍒嗛厤瑙掕壊
@@ -387,7 +394,7 @@
},
// 鏂板
- rowSaveHandler(row, done) {
+ rowSaveHandler(row, done,loading) {
if (row.password != row.confirmPassword) {
this.$message.error('璇锋鏌ヤ袱娆″瘑鐮佹槸鍚﹁緭鍏ヤ竴鑷达紒')
return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false;
@@ -397,11 +404,12 @@
if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.getTableList();
+ done();
}
}).catch(err => {
+ loading()
console.log(err);
})
- done()
},
// 鎿嶄綔鏍忕紪杈�
@@ -417,7 +425,7 @@
},
// 缂栬緫
- rowUpdateHandler(row, index, done) {
+ rowUpdateHandler(row, index, done,loading) {
if (row.password != row.confirmPassword) {
this.$message.error('璇锋鏌ヤ袱娆″瘑鐮佹槸鍚﹁緭鍏ヤ竴鑷达紒')
return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false;
@@ -427,11 +435,12 @@
if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.getTableList();
+ done()
}
}).catch(err => {
+ loading()
console.log(err);
});
- done()
},
// 鍒犻櫎
@@ -439,14 +448,24 @@
let params = {
ids: row.oid
}
- deleteUser(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(() => {
+ deleteUser(params).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.getTableList();
+ }
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
},
// 澶氶�夊垹闄�
@@ -482,21 +501,21 @@
download().then(res => {
console.log(res);
func.downloadFileByBlobHandler(res);
- this.$message.success('涓嬭浇鎴愬姛')
+ this.$message.success('涓嬭浇鎴愬姛');
}).catch(err => {
this.$message.error(err);
})
},
// 瀵煎叆浜哄憳
- uploadRole() {
+ uploadUser() {
this.$refs.upload.visible = true;
},
// 鍒嗛厤閮ㄩ棬
departmentHandler() {
if (this.selectList.length <= 0) {
- this.$message.warning('娓呭厛閫夋嫨浜哄憳鍐嶈繘琛屾搷浣滐紒')
+ this.$message.warning('娓呭厛閫夋嫨浜哄憳鍐嶈繘琛屾搷浣滐紒');
return;
}
this.departStatus = 'default'; // 鍖哄垎涓嶅悓鏂瑰紡鎵撳紑閮ㄩ棬瀵硅瘽妗�
--
Gitblit v1.9.3