| | |
| | | @search-change="handleSearch" |
| | | @search-reset="handleReset" |
| | | @size-change="sizeChange" |
| | | @row-click="rowClickHandler" |
| | | @current-change="currentChange" |
| | | > |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出</el-button> |
| | | <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary" |
| | | @click="exportClickHandler"> |
| | | <icon-show :name="permissionList.exportBtn.source"></icon-show> |
| | | 导出 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | |
| | | |
| | | <script> |
| | | import basicOption from "@/util/basic-option"; |
| | | import {getLogListByContion,getOperatingUsers,exportLog} from "@/api/system/log/logBasic"; |
| | | import {getLogListByContion, getOperatingUsers, exportLog} from "@/api/system/log/logBasic"; |
| | | import func from "@/util/func"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "index", |
| | |
| | | column: [ |
| | | { |
| | | label: '用户名', |
| | | prop: 'truename', |
| | | prop: 'username', |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabel: '操作用户', |
| | | type: 'select', |
| | | dicUrl: '/api/loginBasicController/getOperatingUsers', |
| | | sortable: true, |
| | | width: 150 |
| | | width: 200 |
| | | }, { |
| | | label: '姓名', |
| | | prop: 'username', |
| | | prop: 'truename', |
| | | sortable: true, |
| | | width: 150 |
| | | }, { |
| | |
| | | total: 0, |
| | | pageSizes: [10, 30, 50, 100], |
| | | }, |
| | | searchParams: {} |
| | | searchParams: {}, |
| | | selectList: [], |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.getTableList(); |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false), |
| | | }; |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | // 表格请求 |
| | | getTableList() { |
| | | this.tableLoading = true; |
| | | getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType': this.$route.query.logType, ...this.searchParams}).then(res => { |
| | | getLogListByContion(this.page.currentPage, this.page.pageSize, { |
| | | 'logType': this.$route.query.logType, |
| | | 'roleType': this.$route.query.roleType, ...this.searchParams |
| | | }).then(res => { |
| | | this.tableData = res.data.data; |
| | | this.page.total = res.data.total; |
| | | this.selectList=[]; |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | |
| | | // 导出 |
| | | exportClickHandler() { |
| | | const loading = this.$loading({}); |
| | | exportLog().then(res => { |
| | | exportLog({ |
| | | 'pageNo': 1, |
| | | 'pageSize': -1, |
| | | 'logType': this.$route.query.logType, |
| | | 'roleType': this.$route.query.roleType, ...this.searchParams |
| | | }).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('导出成功'); |
| | | loading.close(); |
| | | }) |
| | | }, |
| | | // 行单选 |
| | | rowClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.logCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = [row]; |
| | | } |
| | | ); |
| | | }, |
| | | } |
| | | } |
| | | </script> |