| | |
| | | <!--文仓管理页面--> |
| | | <basic-container> |
| | | <avue-crud |
| | | ref="logCrud" |
| | | ref="crud" |
| | | v-model="form" |
| | | :data="tableData" |
| | | :option="option" |
| | | :table-loading="tableLoading" |
| | |
| | | @row-save="rowSaveHandler" |
| | | @row-update="rowUpdateHandler" |
| | | @row-del="rowDeleteHandler" |
| | | @row-click="rowClickHandler" |
| | | @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}"> |
| | | <!--<template #menu="{row,index,size}"> |
| | | <el-button icon="el-icon-user" type="text" size="small" @click="userHandler(row,index)">分配成员</el-button> |
| | | </template> |
| | | </template>--> |
| | | </avue-crud> |
| | | <!-- 分配成员穿梭框 --> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" |
| | |
| | | </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 {addUser, deleteUser, updateUser} from "@/api/system/user/api"; |
| | | import {listUserByRoleOid, listUserUnInRoleOid, saveRight} from "@/api/system/role/api"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data: function () { |
| | | return { |
| | | form:{}, |
| | | tableLoading: false, |
| | | tableData: [], |
| | | option: { |
| | |
| | | calcHeight: -60, |
| | | align:'left', |
| | | headerAlign:'center', |
| | | menuWidth:260, |
| | | menuWidth:160, |
| | | dialogMenuPosition: 'right', |
| | | dialogWidth:600, |
| | | column: [ |
| | | { |
| | | label: '卷名', |
| | | prop: 'truename', |
| | | prop: 'name', |
| | | width: 200, |
| | | span: 24, |
| | | rules: [{ required: true, message: '请输入卷名', trigger: 'blur' }] |
| | | },{ |
| | | label: '服务器', |
| | | prop: 'type', |
| | | 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: 'username', |
| | | prop: 'type', |
| | | width: 120, |
| | | span: 24, |
| | | type:'radio', |
| | | dicData:[{ |
| | | label:'Unix', |
| | | value:'Unix' |
| | | value:0 |
| | | },{ |
| | | label:'Win NT', |
| | | value:'Win NT' |
| | | value:1 |
| | | }], |
| | | value:'Win NT' |
| | | value:1 |
| | | },{ |
| | | label: '路径名称', |
| | | prop: 'userIp', |
| | | prop: 'path', |
| | | span: 24, |
| | | overHidden: true, |
| | | rules: [{ required: true, message: '请输入路径名称', trigger: 'blur' }] |
| | | },{ |
| | | label: '首选路径', |
| | | prop: 'loc', |
| | | prop: 'isvalid', |
| | | width: 120, |
| | | span: 24, |
| | | type: 'switch', |
| | | value:false |
| | | value:false, |
| | | beforeChange: (done) => {debugger; |
| | | this.$confirm('您确实要修改卷的首选路径吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | done(true); |
| | | }).catch(() => { |
| | | done(false); |
| | | }); |
| | | }, |
| | | }] |
| | | }, |
| | | 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(1, 50, {}).then(res => { |
| | | getPvolumesPage().then(res => { |
| | | this.tableData = res.data.data; |
| | | this.tableLoading = false; |
| | | }) |
| | |
| | | |
| | | // 新增 |
| | | rowSaveHandler(row, done,loading) { |
| | | addUser(row).then(res => { |
| | | savePvolume(row).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | |
| | | |
| | | // 编辑 |
| | | rowUpdateHandler(row, index, done,loading) { |
| | | updateUser(row).then(res => { |
| | | updatePvolume(row).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteUser(params).then(res => { |
| | | deletePvolume(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | |
| | | }, |
| | | // 导出 |
| | | 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('导出成功'); |
| | |
| | | this.getTableList(); |
| | | }) |
| | | }, |
| | | //选择的行 |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | |
| | | // 行单选 |
| | | rowClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.crud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectionList = []; } |
| | | ); |
| | | }, |
| | | } |
| | | } |
| | | </script> |