fix: 修复bug
parent
8748e0dcc9
commit
45779d8252
|
@ -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({
|
||||
|
|
|
@ -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>
|
|
@ -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 |
Loading…
Reference in New Issue