From 6c170b6b427f0882da35957e73f385d318970a06 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 25 十月 2024 17:59:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue | 235 ++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 171 insertions(+), 64 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue b/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue
index ae1270c..ccad73e 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue
@@ -3,132 +3,239 @@
<basic-container>
<avue-crud
ref="logCrud"
+ v-model="form"
:data="tableData"
:option="option"
- :page.sync="page"
:table-loading="tableLoading"
@on-load="getTableList"
- @refresh-change="handleRefresh"
- @search-change="handleSearch"
- @search-reset="handleReset"
- @size-change="sizeChange"
- @current-change="currentChange"
+ @row-save="rowSaveHandler"
+ @row-update="rowUpdateHandler"
+ @row-del="rowDeleteHandler"
+ @selection-change="selectionChange"
>
<template slot="menuLeft" slot-scope="scope">
<el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button>
</template>
+ <!--<template #menu="{row,index,size}">
+ <el-button icon="el-icon-user" type="text" size="small" @click="userHandler(row,index)">鍒嗛厤鎴愬憳</el-button>
+ </template>-->
</avue-crud>
+ <!-- 鍒嗛厤鎴愬憳绌挎妗� -->
+ <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData"
+ :transferTitle="transferTitle" title="鏂囦欢鏌滄坊鍔犳垚鍛�"
+ @transferSend="roleSendHandler">
+ </transfer>
</basic-container>
</template>
<script>
-import {exportLog, getLogListByContion} from "@/api/system/log/logBasic";
+import {exportPvolumes, getPvolumesPage,savePvolume,updatePvolume,deletePvolume} from "@/api/system/fileCab/api";
import func from "@/util/func";
import basicOption from "@/util/basic-option";
+import {listUserByRoleOid, listUserUnInRoleOid, saveRight} from "@/api/system/role/api";
export default {
name: "index",
data: function () {
return {
+ form:{},
tableLoading: false,
tableData: [],
option: {
...basicOption,
- addBtn:false,
- editBtn: false,
- delBtn: false,
calcHeight: -60,
align:'left',
headerAlign:'center',
- menu:false,
- searchMenuSpan: 6,
- searchIcon:false,
+ menuWidth:160,
+ dialogMenuPosition: 'right',
+ dialogWidth:600,
column: [
{
label: '鍗峰悕',
- prop: 'truename',
- width: 300
- }, {
- label: '鏈哄櫒绫诲瀷',
- prop: 'username',
- width: 150
- },{
- label: '璺緞鍚嶇О',
- prop: 'userIp'
- },{
- label: '棣栭�夎矾寰�',
- prop: 'moduleName',
+ prop: 'name',
+ width: 200,
+ span: 24,
+ rules: [{ required: true, message: '璇疯緭鍏ュ嵎鍚�', trigger: 'blur' }]
},{
label: '鏈嶅姟鍣�',
- prop: 'type',
- width: 150
+ prop: 'host',
+ span: 24,
+ rules: [{ required: true, message: '璇疯緭鍏ユ湇鍔″櫒', trigger: 'blur' }]
},{
label: '鍗锋湇鍔�',
- prop: 'date',
+ prop: 'service',
+ span: 24,
+ rules: [{ required: true, message: '璇疯緭鍏ュ嵎鏈嶅姟', trigger: 'blur' }]
+ }, {
+ label: '鏈哄櫒绫诲瀷',
+ prop: 'type',
+ width: 120,
+ span: 24,
+ type:'radio',
+ dicData:[{
+ label:'Unix',
+ value:0
+ },{
+ label:'Win NT',
+ value:1
+ }],
+ value:1
+ },{
+ label: '璺緞鍚嶇О',
+ prop: 'path',
+ span: 24,
+ overHidden: true,
+ rules: [{ required: true, message: '璇疯緭鍏ヨ矾寰勫悕绉�', trigger: 'blur' }]
+ },{
+ label: '棣栭�夎矾寰�',
+ prop: 'isvalid',
+ width: 120,
+ span: 24,
+ type: 'switch',
+ value:false,
+ beforeChange: (done) => {debugger;
+ this.$confirm('鎮ㄧ‘瀹炶淇敼鍗风殑棣栭�夎矾寰勫悧锛�', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ done(true);
+ }).catch(() => {
+ done(false);
+ });
+ },
}]
},
- page: {
- currentPage: 1,
- pageSize: 50,
- total: 0,
- pageSizes: [10, 30, 50, 100],
- },
- searchParams: {}
+ currentRow:null,
+ leftRoleData: [], // 鍒嗛厤鎴愬憳绌挎妗嗗乏渚у垵濮嬫暟鎹�
+ rightRoleData: [], // 鍒嗛厤鎴愬憳绌挎妗嗗彸渚у垵濮嬫暟鎹�
+ transferTitle: ['鏂囦欢鏌滃鎴愬憳', '鏂囦欢鏌滃唴鎴愬憳'],
+ selectionList: [],
+ }
+ },
+ computed: {
+ ids() {
+ let ids = [];
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
}
},
methods: {
// 琛ㄦ牸璇锋眰
getTableList() {
this.tableLoading = true;
- getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType':this.$route.query.logType,...this.searchParams}).then(res => {
+ getPvolumesPage().then(res => {
this.tableData = res.data.data;
- this.page.total = res.data.total;
this.tableLoading = false;
})
},
- // 鎼滅储鏌ヨ
- handleSearch(params, done) {
- this.searchParams = {
- userName:params.truename,
- ipText:params.userIp,
- startDate:params.date[0],
- endDate:params.date[1]
- };
-
- this.getTableList();
- done();
+ // 鏂板
+ rowSaveHandler(row, done,loading) {
+ savePvolume(row).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.getTableList();
+ done();
+ }
+ }).catch(err => {
+ loading()
+ });
},
- // 閲嶇疆鎼滅储鏉′欢
- handleReset() {
- this.searchParams = {};
- this.getTableList();
+ // 缂栬緫
+ rowUpdateHandler(row, index, done,loading) {
+ updatePvolume(row).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.getTableList();
+ done()
+ }
+ }).catch(err => {
+ loading()
+ });
},
- // 鏉℃暟
- sizeChange(val) {
- this.page.pageSize = val;
- },
+ // 鍒犻櫎
+ rowDeleteHandler(row) {
+ let params = {
+ ids: row.id
+ }
- // 椤电爜
- currentChange(val) {
- this.page.currentPage = val;
- },
-
- handleRefresh(){
- this.getTableList();
+ this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎褰撳墠鐨勫嵎鑺傜偣鍚楋紵', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deletePvolume(params).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.getTableList();
+ }
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
},
// 瀵煎嚭
exportClickHandler() {
+ if(this.ids == null || this.ids == ""){
+ this.$message({
+ type: 'warning',
+ message: '璇峰嬀閫夎瀵煎嚭鐨勬暟鎹�!'
+ });
+ return;
+ }
const loading = this.$loading({});
- exportLog().then(res => {
+ exportPvolumes({"pvolumeIds": this.ids}).then(res => {
func.downloadFileByBlobHandler(res);
this.createdLoading = false
this.$message.success('瀵煎嚭鎴愬姛');
loading.close();
})
},
+
+ //鍒嗛厤鎴愬憳
+ userHandler(row,index){
+ this.currentRow=row;
+ Promise.all([
+ listUserUnInRoleOid({pkRole: row.id}),
+ listUserByRoleOid({pkRole: row.id})
+ ]).then(([unInRoleRes, byRoleRes]) => {
+ if (unInRoleRes.data.code === 200 && byRoleRes.data.code === 200) {
+ const leftData = [...unInRoleRes.data.data, ...byRoleRes.data.data];
+ // 缁勮濂界┛姊鍙敤鏁版嵁
+ this.leftRoleData = leftData.map(item => {
+ return {
+ name: item.name + `(${item.id})`,
+ oid: item.oid
+ }
+ })
+ this.rightRoleData = byRoleRes.data.data.map(item => item.oid);
+ this.$refs.transfer.visible = true;
+ }
+ });
+ },
+ // 鍒嗛厤鎴愬憳绌挎妗嗗洖濉�
+ roleSendHandler(row) {
+ let params = {
+ userOids: row.join(','),
+ roleId: this.currentRow.id
+ }
+ saveRight(params).then(res => {
+ this.$message.success(res.data.obj);
+ this.getTableList();
+ })
+ },
+ //閫夋嫨鐨勮
+ selectionChange(list) {
+ this.selectionList = list;
+ },
}
}
</script>
--
Gitblit v1.9.3