部署
This commit is contained in:
parent
ea2481dc5c
commit
8e37f74602
|
@ -1,5 +1,5 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 智能开关管理系统
|
VUE_APP_TITLE = 智能开关-开发
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 17 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.1 KiB |
|
@ -5,7 +5,7 @@ const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dyn
|
||||||
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
|
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
|
||||||
const state = {
|
const state = {
|
||||||
title: '',
|
title: '',
|
||||||
theme: storageSetting.theme || '#409EFF',
|
theme: storageSetting.theme || '#8883F0',
|
||||||
sideTheme: storageSetting.sideTheme || sideTheme,
|
sideTheme: storageSetting.sideTheme || sideTheme,
|
||||||
showSettings: showSettings,
|
showSettings: showSettings,
|
||||||
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
||||||
|
|
|
@ -25,3 +25,32 @@ export const $view = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显隐列
|
||||||
|
**/
|
||||||
|
export const $showColumns = {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
showColumns() {
|
||||||
|
if (this.columns == null) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return this.columns.filter(item => item.visible);
|
||||||
|
},
|
||||||
|
isShow() {
|
||||||
|
return (key) => {
|
||||||
|
if (this.columns == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let column = this.columns.find(item => item.key === key);
|
||||||
|
return column != null && column.visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
@ -312,9 +312,6 @@ export default {
|
||||||
modelId: [
|
modelId: [
|
||||||
{ required: true, message: "型号不能为空", trigger: "change" }
|
{ required: true, message: "型号不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
deviceName: [
|
|
||||||
{ required: true, message: "设备名称不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
mac: [
|
mac: [
|
||||||
{ required: true, message: "设备MAC不能为空", trigger: "change" }
|
{ required: true, message: "设备MAC不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
|
|
|
@ -89,66 +89,61 @@
|
||||||
v-hasPermi="['system:smUser:export']"
|
v-hasPermi="['system:smUser:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table ref="table" v-loading="loading" :data="smUserList" @row-click="changeSelection" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="loading"
|
||||||
|
:data="smUserList"
|
||||||
|
@row-click="changeSelection"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@sort-change="onSortChange"
|
||||||
|
:default-sort="defaultSort"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="用户ID" align="center" prop="userId" width="80"/>
|
<template v-for="column of showColumns">
|
||||||
<el-table-column label="头像" align="center" width="80">
|
<el-table-column
|
||||||
<template slot-scope="d">
|
:key="column.key"
|
||||||
<el-avatar :src="d.row.avatar" :width="50" :height="50"/>
|
:label="column.label"
|
||||||
</template>
|
:prop="column.key"
|
||||||
</el-table-column>
|
:align="column.align"
|
||||||
<el-table-column label="用户账号" align="center" prop="userName" />
|
:min-width="column.minWidth"
|
||||||
<el-table-column label="用户昵称" align="center" prop="nickName" />
|
:sort-orders="['ascending', 'descending', null]"
|
||||||
<el-table-column label="用户类型" align="center" prop="isMch" width="100">
|
:sortable="column.sortable"
|
||||||
<template slot-scope="d">
|
:show-overflow-tooltip="column.overflow"
|
||||||
<el-tag :type="d.row.isMch ? 'primary' : 'success'" >{{d.row.isMch ? '商户' : '普通用户'}}</el-tag>
|
>
|
||||||
</template>
|
<template slot-scope="d">
|
||||||
</el-table-column>
|
<template v-if="column.key === 'isMch'">
|
||||||
<el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
|
<el-tag :type="d.row.isMch ? 'primary' : 'success'" >{{d.row.isMch ? '商户' : '普通用户'}}</el-tag>
|
||||||
<el-table-column label="用户性别" align="center" prop="sex">
|
</template>
|
||||||
<template slot-scope="scope">
|
<template v-else-if="column.key === 'storeCount'">
|
||||||
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
|
{{d.row.storeCount | defaultValue}} 间
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
<template v-else-if="column.key === 'rechargeAmount'">
|
||||||
<el-table-column label="店铺数量" align="center" prop="storeCount" width="100">
|
{{d.row.rechargeAmount | money}} 元
|
||||||
<template slot-scope="d">
|
</template>
|
||||||
{{d.row.storeCount | defaultValue}} 间
|
<template v-else-if="column.key === 'withDrawlAmount'">
|
||||||
</template>
|
{{d.row.withDrawlAmount | money}} 元
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column label="充值金额" align="center" prop="rechargeAmount">
|
<template v-else-if="column.key === 'balance'">
|
||||||
<template slot-scope="d">
|
{{d.row.balance | money}} 元
|
||||||
{{d.row.rechargeAmount | money}} 元
|
</template>
|
||||||
</template>
|
<template v-else-if="column.key === 'serviceRate'">
|
||||||
</el-table-column>
|
{{d.row.serviceRate == null ? '未设置' : d.row.serviceRate + '%'}}
|
||||||
<el-table-column label="提现金额" align="center" prop="withDrawlAmount">
|
</template>
|
||||||
<template slot-scope="d">
|
<template v-else-if="column.key === 'status'">
|
||||||
{{d.row.withDrawlAmount | money}} 元
|
<dict-tag :options="dict.type.sm_user_status" :value="d.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
<template v-else-if="column.key === 'deviceCount'">
|
||||||
<el-table-column label="账户余额" align="center" prop="balance" >
|
{{d.row.deviceCount | defaultValue}} 台
|
||||||
<template slot-scope="d">
|
</template>
|
||||||
{{d.row.balance | money}} 元
|
<template v-else>
|
||||||
</template>
|
{{d.row[column.key]}}
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column label="服务费费率" align="center" prop="serviceRate" width="150" >
|
</template>
|
||||||
<template slot-scope="d">
|
</el-table-column>
|
||||||
{{d.row.serviceRate == null ? '未设置' : d.row.serviceRate + '%'}}
|
</template>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="帐号状态" align="center" prop="status">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.sm_user_status" :value="scope.row.status"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="设备数量" align="center" prop="deviceCount" >
|
|
||||||
<template slot-scope="d">
|
|
||||||
{{d.row.deviceCount | defaultValue}} 台
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
|
|
||||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
|
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -206,15 +201,8 @@
|
||||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号" :maxlength="11" show-word-limit
|
<el-input v-model="form.phonenumber" placeholder="请输入手机号" :maxlength="11" show-word-limit
|
||||||
clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
|
clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="性别" prop="sex">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-select v-model="form.sex" placeholder="请选择性别" :style="{width: '100%'}">
|
<el-input v-model="form.remark" placeholder="请输入备注" :maxlength="500" show-word-limit type="textarea"/>
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_user_sex"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -231,13 +219,36 @@
|
||||||
<script>
|
<script>
|
||||||
import { listSmUser, getSmUser, addSmUser, updateSmUser, delSmUser } from '@/api/system/smUser'
|
import { listSmUser, getSmUser, addSmUser, updateSmUser, delSmUser } from '@/api/system/smUser'
|
||||||
import ServiceRateForm from '@/views/system/smUser/components/serviceRateForm.vue'
|
import ServiceRateForm from '@/views/system/smUser/components/serviceRateForm.vue'
|
||||||
|
import { $showColumns } from '@/utils/mixins'
|
||||||
|
|
||||||
|
const defaultSort = {
|
||||||
|
prop: "createTime",
|
||||||
|
order: "descending"
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SmUser",
|
name: "SmUser",
|
||||||
|
mixins: [$showColumns],
|
||||||
components: { ServiceRateForm },
|
components: { ServiceRateForm },
|
||||||
dicts: ['sm_user_status', 'user_type', 'sys_user_sex'],
|
dicts: ['sm_user_status', 'user_type', 'sys_user_sex'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
defaultSort,
|
||||||
|
columns: [
|
||||||
|
{key: 'userId', visible: true, label: '用户ID', align: 'center', minWidth: "80", sortable: true},
|
||||||
|
{key: 'phonenumber', visible: true, label: '手机号码', align: 'center', minWidth: null, sortable: true},
|
||||||
|
{key: 'userName', visible: false, label: '用户名称', align: 'center', minWidth: null, sortable: false},
|
||||||
|
{key: 'isMch', visible: true, label: '用户类型', align: 'center', minWidth: null, sortable: true},
|
||||||
|
{key: 'remark', visible: true, label: '备注', align: 'center', minWidth: null, sortable: false, overflow: true},
|
||||||
|
{key: 'createTime', visible: true, label: '创建时间', align: 'center', minWidth: "180", sortable: true},
|
||||||
|
{key: 'storeCount', visible: true, label: '店铺数量', align: 'center', minWidth: null, sortable: false},
|
||||||
|
{key: 'rechargeAmount', visible: true, label: '充值金额', align: 'center', minWidth: null, sortable: true},
|
||||||
|
{key: 'withDrawlAmount', visible: true, label: '提现金额', align: 'center', minWidth: null, sortable: true},
|
||||||
|
{key: 'balance', visible: true, label: '账户余额', align: 'center', minWidth: null, sortable: true},
|
||||||
|
{key: 'serviceRate', visible: true, label: '服务费费率', align: 'center', minWidth: null, sortable: true},
|
||||||
|
{key: 'status', visible: true, label: '账号状态', align: 'center', minWidth: null, sortable: true},
|
||||||
|
{key: 'deviceCount', visible: true, label: '设备数量', align: 'center', minWidth: null, sortable: false},
|
||||||
|
],
|
||||||
openServiceRate: false,
|
openServiceRate: false,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
|
@ -261,6 +272,8 @@ export default {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
orderByColumn: defaultSort.prop,
|
||||||
|
isAsc: defaultSort.order,
|
||||||
userName: null,
|
userName: null,
|
||||||
nickName: null,
|
nickName: null,
|
||||||
isMch: null,
|
isMch: null,
|
||||||
|
@ -310,6 +323,16 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onSortChange(column) {
|
||||||
|
if (column.order == null) {
|
||||||
|
this.queryParams.orderByColumn = defaultSort.prop;
|
||||||
|
this.queryParams.isAsc = defaultSort.order;
|
||||||
|
} else {
|
||||||
|
this.queryParams.orderByColumn = column.prop;
|
||||||
|
this.queryParams.isAsc = column.order;
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
// 更换某一行的选中状态
|
// 更换某一行的选中状态
|
||||||
changeSelection(row){
|
changeSelection(row){
|
||||||
if (this.ids.includes(row.userId)){
|
if (this.ids.includes(row.userId)){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user