完成多租户测试

This commit is contained in:
kerwincui
2022-06-05 17:41:12 +08:00
parent edf36d3dd1
commit c9a036043e
5 changed files with 14 additions and 27 deletions

View File

@@ -49,7 +49,7 @@
<el-row :gutter="40" style="margin-bottom:100px;">
<el-col :xs="24" :sm="24" :md="24" :lg="14" :xl="14">
<el-card style="margin:-10px;" shadow="hover" body-style="background-color:#eee;">
<div ref="map" style="height:650px;margin:-17px;margin-top:-12px;"></div>
<div ref="map" style="height:651px;margin:-17px;margin-top:-12px;"></div>
</el-card>
</el-col>

View File

@@ -20,9 +20,16 @@
</el-table-column>
<el-table-column label="产品名称" align="center" prop="productName" />
<el-table-column label="分类名称" align="center" prop="categoryName" />
<el-table-column label="状态" align="center" prop="status">
<el-table-column label="租户名称" align="center" prop="tenantName" />
<el-table-column label="授权码" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.iot_product_status" :value="scope.row.status" />
<el-tag type="success" v-if="scope.row.isAuthorize==1">启用</el-tag>
<el-tag type="info" v-if="scope.row.isAuthorize==0">未启用</el-tag>
</template>
</el-table-column>
<el-table-column label="认证方式" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.iot_vertificate_method" :value="scope.row.vertificateMethod" />
</template>
</el-table-column>
<el-table-column label="联网方式" align="center" prop="networkMethod">
@@ -30,7 +37,7 @@
<dict-tag :options="dict.type.iot_network_method" :value="scope.row.networkMethod" />
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150">
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
@@ -53,7 +60,7 @@ import {
export default {
name: "Product",
dicts: [ 'iot_product_status', 'iot_network_method'],
dicts: ['iot_vertificate_method', 'iot_network_method'],
props: {
productId: {
type: Number,
@@ -95,10 +102,6 @@ export default {
/** 查询产品列表 */
getList() {
this.loading = true;
// 判断是否是admin角色
if (this.$store.state.user.roles.indexOf("admin") === -1){
this.queryParams.tenantName = this.$store.state.user.name
}
listProduct(this.queryParams).then(response => {
this.productList = response.rows;
this.total = response.total;

View File

@@ -33,7 +33,7 @@
</el-select>
</el-form-item>
<el-form-item label="设备认证" prop="vertificateMethod">
<el-select v-model="form.vertificateMethod" placeholder="请选择认证方式" style="width:100%">
<el-select v-model="form.vertificateMethod" placeholder="请选择认证方式" style="width:100%" :disabled="form.status==2">
<el-option v-for="dict in dict.type.iot_vertificate_method" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item>
@@ -122,7 +122,6 @@ import productAuthorize from "./product-authorize"
import imageUpload from "../../../components/ImageUpload/index"
import {
listShortCategory,
listShortCategory1
} from "@/api/iot/category";
import {
getProduct,
@@ -188,11 +187,8 @@ export default {
},
methods: {
init() {
if (this.$store.state.user.roles.indexOf("admin") === -1) {
this.queryParams.tenantName = this.$store.state.user.name
}
// 获取简短分类列表
listShortCategory1(this.queryParams).then(response => {
listShortCategory().then(response => {
this.categoryShortList = response.data;
})
},

View File

@@ -71,7 +71,6 @@ export default {
pageSize: 10,
templateName: null,
type: null,
tenantName:''
},
};
},
@@ -83,9 +82,6 @@ export default {
/** 查询通用物模型列表 */
getList() {
this.loading = true;
if (this.$store.state.user.roles.indexOf("admin") === -1){
this.queryParams.tenantName = this.$store.state.user.name
}
listTemplate(this.queryParams).then((response) => {
this.templateList = response.rows;
this.total = response.total;