给租户增加有效期

This commit is contained in:
季圣华
2021-08-25 00:44:20 +08:00
parent be9786087f
commit 0fcd84d2ad
5 changed files with 72 additions and 12 deletions

View File

@@ -11,6 +11,22 @@
<a-input placeholder="输入登录名称模糊查询" v-model="queryParam.loginName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="租户类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.type" placeholder="请选择租户类型">
<a-select-option value="0">免费租户</a-select-option>
<a-select-option value="1">付费租户</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="租户状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.enabled" placeholder="请选择操作状态">
<a-select-option value="1">启用</a-select-option>
<a-select-option value="0">禁用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
@@ -51,7 +67,11 @@
<a @click="handleEdit(record)">编辑</a>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="enabled">
<template slot="customRenderType" slot-scope="type">
<a-tag v-if="type==0">免费租户</a-tag>
<a-tag v-if="type==1" color="green">付费租户</a-tag>
</template>
<template slot="customRenderEnabled" slot-scope="enabled">
<a-tag v-if="enabled" color="green">启用</a-tag>
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
</template>
@@ -85,7 +105,9 @@
offset: 1
},
queryParam: {
loginName: ""
loginName: '',
type: '',
enabled: ''
},
columns: [
{
@@ -100,8 +122,11 @@
},
{ title: '登录名称', dataIndex: 'loginName', width: 100, align: "center"},
{ title: '用户数量限制', dataIndex: 'userNumLimit', width: 100, align: "center"},
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
{ title: '租户类型',dataIndex: 'type',width:70,align:"center",
scopedSlots: { customRender: 'customRenderType' }
},
{ title: '租户状态',dataIndex: 'enabled',width:70,align:"center",
scopedSlots: { customRender: 'customRenderEnabled' }
},
{ title: '创建时间', dataIndex: 'createTimeStr', width: 100, align: "center"},
{ title: '到期时间', dataIndex: 'expireTimeStr', width: 100, align: "center"},

View File

@@ -16,7 +16,16 @@
suffix="初始密码123456" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="用户数量限制">
<a-input-number style="width:50%" placeholder="请输入用户数量限制" v-decorator.trim="[ 'userNumLimit' ]" />
<a-input-number style="width:60%" placeholder="请输入用户数量限制" v-decorator.trim="[ 'userNumLimit' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="租户类型">
<a-select style="width:60%" placeholder="请选择租户类型" v-decorator.trim="[ 'type' ]">
<a-select-option value="0">免费租户</a-select-option>
<a-select-option value="1">付费租户</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="到期时间">
<j-date style="width:60%" placeholder="请选择到期时间" v-decorator.trim="[ 'expireTime' ]" :show-time="true"/>
</a-form-item>
</a-form>
</a-spin>
@@ -25,8 +34,12 @@
<script>
import pick from 'lodash.pick'
import {registerUser,editTenant,checkTenant } from '@/api/api'
import JDate from '@/components/jeecg/JDate'
export default {
name: "TenantModal",
components: {
JDate
},
data () {
return {
title:"操作",
@@ -62,9 +75,10 @@
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.model.expireTime = this.model.expireTimeStr
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'loginName', 'userNumLimit', 'billsNumLimit'))
this.form.setFieldsValue(pick(this.model,'loginName', 'userNumLimit', 'billsNumLimit', 'type', 'expireTime'))
});
},
close () {