fix: 修复bug

pull/9/head
TianYu 2023-06-01 14:21:31 +08:00
parent 8748e0dcc9
commit 45779d8252
4 changed files with 158 additions and 14 deletions

View File

@ -9,6 +9,15 @@ export function listDept(query) {
})
}
// 查询商户列表
export function listMerchant(query) {
return request({
url: '/system/dept/list-all',
method: 'get',
params: query
})
}
// 查询部门列表(排除节点)
export function listDeptExcludeChild(deptId) {
return request({

View File

@ -0,0 +1,147 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="组织名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入组织名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">/</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="id" :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column prop="name" label="组织名称"></el-table-column>
<el-table-column prop="leader" label="负责人" :formatter="userNicknameFormat" width="120"/>
<el-table-column prop="sort" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { listMerchant } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {CommonStatusEnum} from '@/utils/constants'
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import {listSimpleUsers} from "@/api/system/user";
import {getBaseHeader} from '@/utils/request';
export default {
name: "SystemMerchant",
components: { Treeselect },
data() {
return {
//
loading: true,
//
showSearch: true,
//
deptList: [],
//
deptOptions: [],
//
users: [],
//
title: "",
//
open: false,
//
isExpandAll: true,
//
refreshTable: true,
//
expand: false,
submitLoading: false,
upload: {
//
open: false,
//
title: '批量导入',
//
isUploading: false,
//
headers: getBaseHeader(),
//
url: process.env.VUE_APP_BASE_API + '/admin-api/system/dept/batch/import'
},
//
queryParams: {
name: undefined,
status: undefined
},
//
CommonStatusEnum: CommonStatusEnum,
//
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS)
};
},
created() {
this.getList()
},
methods: {
/** 查询组织列表 */
getList() {
this.loading = true;
listMerchant(this.queryParams).then(response => {
this.deptList = this.handleTree(response.data, "id");
this.loading = false;
});
},
//
userNicknameFormat(row, column) {
if (!row.leaderUserId) {
return '未设置';
}
for (const user of this.users) {
if (row.leaderUserId === user.id) {
return user.nickname;
}
}
return '未知【' + row.leaderUserId + '】';
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
}
}
};
</script>

View File

@ -1,8 +1,7 @@
<template>
<view class="wechat-wrap">
<u-navbar autoBack title="关注公众号"></u-navbar>
<view class="bg"></view>
<image src="@/static/images/qrcod.jpg" mode="widthFix" style="width: 400rpx;"></image>
<image src="@/static/images/qrcod.jpg" style="width:100%" mode="widthFix"></image>
</view>
</template>
@ -16,21 +15,10 @@
height: 100%;
}
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: linear-gradient(0deg, #F94B78 0%, #FFD35C 100%);
opacity: 0.18;
z-index: 0
}
.wechat-wrap {
width: 100%;
min-height: 100%;
padding: 260rpx 20rpx 0 20rpx;
padding-top: 90rpx;
text-align: center;
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 73 KiB