|
@@ -0,0 +1,297 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="page">
|
|
|
|
+ <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
|
|
+ <el-form-item prop="roleId">
|
|
|
|
+ <el-select size="small" v-model="searchForm.roleId" placeholder="选择角色" clearable>
|
|
|
|
+ <el-option label="都企供需-挂钩干部" value="1910141956174053377"></el-option>
|
|
|
|
+ <el-option label="区“企业大走访”办公室" value="1910175386924417025"></el-option>
|
|
|
|
+ <el-option label="办理部门" value="1910175949166673921"></el-option>
|
|
|
|
+ <el-option label="大走访-挂钩干部/部门" value="1915280292672946177"></el-option>
|
|
|
|
+ <el-option label="企业用户" value="38a14f1f42ed424eab4cb5d489596b0d"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item prop="des1">
|
|
|
|
+ <el-select size="small" v-model="searchForm.des1" placeholder="选择地区" clearable>
|
|
|
|
+ <el-option label="台创园" value="台创园"></el-option>
|
|
|
|
+ <el-option label="大冈" value="大冈"></el-option>
|
|
|
|
+ <el-option label="大纵湖" value="大纵湖"></el-option>
|
|
|
|
+ <el-option label="学富" value="学富"></el-option>
|
|
|
|
+ <el-option label="尚庄" value="尚庄"></el-option>
|
|
|
|
+ <el-option label="张庄" value="张庄"></el-option>
|
|
|
|
+ <el-option label="楼王" value="楼王"></el-option>
|
|
|
|
+ <el-option label="潘黄" value="潘黄"></el-option>
|
|
|
|
+ <el-option label="盐渎" value="盐渎"></el-option>
|
|
|
|
+ <el-option label="秦南" value="秦南"></el-option>
|
|
|
|
+ <el-option label="郭猛" value="郭猛"></el-option>
|
|
|
|
+ <el-option label="高新区" value="高新区"></el-option>
|
|
|
|
+ <el-option label="龙冈" value="龙冈"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item prop="dtime">
|
|
|
|
+ <el-select size="small" v-model="searchForm.dtime" placeholder="选择时间" clearable>
|
|
|
|
+ <el-option label="本年" value="1"></el-option>
|
|
|
|
+ <el-option label="本月" value="2"></el-option>
|
|
|
|
+ <el-option label="本周" value="3"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <!-- 搜索框-->
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
|
|
|
|
+ <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+
|
|
|
|
+ <div class="bg-white top">
|
|
|
|
+ <vxe-toolbar :refresh="{query: refreshList}" import export print custom>
|
|
|
|
+ <template #buttons>
|
|
|
|
+ <!-- <el-button v-if="hasPermission('loginacea:loginAce:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
|
|
|
|
+ <el-button v-if="hasPermission('loginacea:loginAce:edit')" type="warning" size="small" icon="el-icon-edit-outline" @click="edit()" :disabled="$refs.loginAceTable && $refs.loginAceTable.getCheckboxRecords().length !== 1" plain>修改</el-button>
|
|
|
|
+ <el-button v-if="hasPermission('loginacea:loginAce:del')" type="danger" size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.loginAceTable && $refs.loginAceTable.getCheckboxRecords().length === 0" plain>删除</el-button> -->
|
|
|
|
+ </template>
|
|
|
|
+ <template #tools>
|
|
|
|
+ <vxe-button
|
|
|
|
+ type="default"
|
|
|
|
+ title="下载导入模板"
|
|
|
|
+ v-if="hasPermission('loginacea:loginAce:import')"
|
|
|
|
+ class="el-icon-document m-r-12"
|
|
|
|
+ @click="downloadTpl()"
|
|
|
|
+ circle
|
|
|
|
+ >
|
|
|
|
+ </vxe-button>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-toolbar>
|
|
|
|
+ <div style="height: calc(100% - 80px);">
|
|
|
|
+ <vxe-table
|
|
|
|
+ border="inner"
|
|
|
|
+ auto-resize
|
|
|
|
+ resizable
|
|
|
|
+ height="auto"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ size="small"
|
|
|
|
+ ref="loginAceTable"
|
|
|
|
+ show-header-overflow
|
|
|
|
+ show-overflow
|
|
|
|
+ highlight-hover-row
|
|
|
|
+ :menu-config="{}"
|
|
|
|
+ :print-config="{}"
|
|
|
|
+ :import-config="{
|
|
|
|
+ importMethod: importMethod,
|
|
|
|
+ types: ['csv', 'xls', 'xlsx'],
|
|
|
|
+ remote: true,
|
|
|
|
+ }"
|
|
|
|
+ :export-config="{
|
|
|
|
+ remote: true,
|
|
|
|
+ filename: `地区登入报表数据${moment(new Date()).format(
|
|
|
|
+ 'YYYY-MM-DD'
|
|
|
|
+ )}`,
|
|
|
|
+ sheetName: '地区登入报表数据',
|
|
|
|
+ exportMethod: exportMethod,
|
|
|
|
+ types: ['xlsx'],
|
|
|
|
+ modes: ['current', 'selected', 'all'],
|
|
|
|
+ }"
|
|
|
|
+ @sort-change="sortChangeHandle"
|
|
|
|
+ :sort-config="{remote:true}"
|
|
|
|
+ :data="dataList"
|
|
|
|
+ :checkbox-config="{}">
|
|
|
|
+ <vxe-column type="seq" width="40"></vxe-column>
|
|
|
|
+ <vxe-column type="checkbox" width="100px"></vxe-column>
|
|
|
|
+ <vxe-column
|
|
|
|
+ field="des1"
|
|
|
|
+ sortable
|
|
|
|
+ title="地区">
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column
|
|
|
|
+ field="totalCount"
|
|
|
|
+ sortable
|
|
|
|
+ title="关联总数">
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column
|
|
|
|
+ field="loginYesc"
|
|
|
|
+ sortable
|
|
|
|
+ title="已登入用户数">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-link type="primary" :underline="false" v-if="hasPermission('loginacea:loginAce:edit')" @click="edit(scope.row.id,scope.row.des1, searchForm,1)">{{scope.row.loginYesc}}</el-link>
|
|
|
|
+ <el-link type="primary" :underline="false" v-else-if="hasPermission('loginacea:loginAce:view')" @click="view(scope.row.id,scope.row.des1, searchForm,1)">{{scope.row.loginYesc}}</el-link>
|
|
|
|
+ <span v-else>{{scope.row.des1}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column
|
|
|
|
+ field="loginNotc"
|
|
|
|
+ sortable
|
|
|
|
+ title="未登入用户数">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-link type="primary" :underline="false" v-if="hasPermission('loginacea:loginAce:edit')" @click="edit(scope.row.id,scope.row.des1, searchForm,2)">{{scope.row.loginNotc}}</el-link>
|
|
|
|
+ <el-link type="primary" :underline="false" v-else-if="hasPermission('loginacea:loginAce:view')" @click="view(scope.row.id,scope.row.des1, searchForm,2)">{{scope.row.loginNotc}}</el-link>
|
|
|
|
+ <span v-else>{{scope.row.des1}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ </vxe-table>
|
|
|
|
+ <vxe-pager
|
|
|
|
+ background
|
|
|
|
+ size="small"
|
|
|
|
+ :current-page="tablePage.currentPage"
|
|
|
|
+ :page-size="tablePage.pageSize"
|
|
|
|
+ :total="tablePage.total"
|
|
|
|
+ :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
|
|
|
|
+ :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
|
|
|
|
+ @page-change="currentChangeHandle">
|
|
|
|
+ </vxe-pager>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 弹窗, 新增 / 修改 -->
|
|
|
|
+ <LoginAceForm ref="loginAceForm" @refreshDataList="refreshList"></LoginAceForm>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import LoginAceForm from './LoginAceForm'
|
|
|
|
+ import loginAceService from '@/api/loginacea/loginAceService'
|
|
|
|
+ export default {
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ searchForm: {
|
|
|
|
+ roleId:'',
|
|
|
|
+ des1:'',
|
|
|
|
+ dtime:''
|
|
|
|
+ },
|
|
|
|
+ dataList: [],
|
|
|
|
+ tablePage: {
|
|
|
|
+ total: 0,
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 100
|
|
|
|
+ },
|
|
|
|
+ loading: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ components: {
|
|
|
|
+ LoginAceForm
|
|
|
|
+ },
|
|
|
|
+ activated () {
|
|
|
|
+ this.refreshList()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 获取数据列表
|
|
|
|
+ refreshList () {
|
|
|
|
+ this.loading = true
|
|
|
|
+ loginAceService.list({
|
|
|
|
+ 'current': this.tablePage.currentPage,
|
|
|
|
+ 'size': this.tablePage.pageSize,
|
|
|
|
+ 'orders': this.tablePage.orders,
|
|
|
|
+ ...this.searchForm
|
|
|
|
+ }).then(({data}) => {
|
|
|
|
+ this.dataList = data.records
|
|
|
|
+ this.tablePage.total = data.total
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 当前页
|
|
|
|
+ currentChangeHandle ({ currentPage, pageSize }) {
|
|
|
|
+ this.tablePage.currentPage = currentPage
|
|
|
|
+ this.tablePage.pageSize = pageSize
|
|
|
|
+ this.refreshList()
|
|
|
|
+ },
|
|
|
|
+ // 排序
|
|
|
|
+ sortChangeHandle (obj) {
|
|
|
|
+ this.tablePage.orders = []
|
|
|
|
+ if (obj.order != null) {
|
|
|
|
+ this.tablePage.orders = [{ column: obj.column.sortBy || this.$utils.toLine(obj.property), asc: obj.order === 'asc' }]
|
|
|
|
+ } else {
|
|
|
|
+ this.tablePage.orders = [{ column: 'create_date', asc: false }]
|
|
|
|
+ }
|
|
|
|
+ this.refreshList()
|
|
|
|
+ },
|
|
|
|
+ // 新增
|
|
|
|
+ add () {
|
|
|
|
+ this.$refs.loginAceForm.init('add', '')
|
|
|
|
+ },
|
|
|
|
+ // 修改
|
|
|
|
+ edit (id,des1, searchForm,status) {
|
|
|
|
+ id = id || this.$refs.loginAceTable.getCheckboxRecords().map(item => {
|
|
|
|
+ return item.id
|
|
|
|
+ })[0]
|
|
|
|
+ this.$refs.loginAceForm.init('edit', id, des1, searchForm.roleId, searchForm.dtime,status)
|
|
|
|
+ },
|
|
|
|
+ // 查看
|
|
|
|
+ view (id) {
|
|
|
|
+ this.$refs.loginAceForm.init('view', id, des1, searchForm.roleId, searchForm.dtime,status)
|
|
|
|
+ },
|
|
|
|
+ // 删除
|
|
|
|
+ del (id) {
|
|
|
|
+ let ids = id || this.$refs.loginAceTable.getCheckboxRecords().map(item => {
|
|
|
|
+ return item.id
|
|
|
|
+ }).join(',')
|
|
|
|
+ this.$confirm(`确定删除所选项吗?`, '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.loading = true
|
|
|
|
+ loginAceService.delete(ids).then(({data}) => {
|
|
|
|
+ this.$message.success(data)
|
|
|
|
+ this.refreshList()
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 下载模板
|
|
|
|
+ downloadTpl () {
|
|
|
|
+ this.loading = true
|
|
|
|
+ loginAceService.exportTemplate().then(({data}) => {
|
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
|
+ this.$utils.downloadExcel(data, '请假表单导入模板')
|
|
|
|
+ this.loading = false
|
|
|
|
+ }).catch(function (err) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ if (err.response) {
|
|
|
|
+ console.log(err.response)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 自定义服务端导入
|
|
|
|
+ importMethod ({ file }) {
|
|
|
|
+ // 处理表单
|
|
|
|
+ const formBody = new FormData()
|
|
|
|
+ formBody.append('file', file)
|
|
|
|
+ this.loading = true
|
|
|
|
+ loginAceService.importExcel(formBody).then(({data}) => {
|
|
|
|
+ this.$message.success({
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ message: data
|
|
|
|
+ })
|
|
|
|
+ this.refreshList()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 自定义服务端导出
|
|
|
|
+ exportMethod ({ options }) {
|
|
|
|
+ // 传给服务端的参数
|
|
|
|
+ const params = {
|
|
|
|
+ current: this.tablePage.currentPage,
|
|
|
|
+ size: this.tablePage.pageSize,
|
|
|
|
+ orders: this.tablePage.orders,
|
|
|
|
+ ...this.searchForm,
|
|
|
|
+ filename: options.filename,
|
|
|
|
+ sheetName: options.sheetName,
|
|
|
|
+ isHeader: options.isHeader,
|
|
|
|
+ original: options.original,
|
|
|
|
+ mode: options.mode,
|
|
|
|
+ selectIds: options.mode === 'selected' ? options.data.map((item) => item.id) : [],
|
|
|
|
+ exportFields: options.columns.map((column) => column.property && column.property.split('.')[0])
|
|
|
|
+ }
|
|
|
|
+ this.loading = true
|
|
|
|
+ return loginAceService.exportExcel(params).then(({data}) => {
|
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
|
+ this.$utils.downloadExcel(data, options.filename)
|
|
|
|
+ this.loading = false
|
|
|
|
+ }).catch(function (err) {
|
|
|
|
+ if (err.response) {
|
|
|
|
+ console.log(err.response)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ resetSearch () {
|
|
|
|
+ this.$refs.searchForm.resetFields()
|
|
|
|
+ this.refreshList()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|