mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
完成多租户测试
This commit is contained in:
@@ -16,14 +16,6 @@ export function listShortCategory() {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询产品简短分类列表
|
|
||||||
export function listShortCategory1(query) {
|
|
||||||
return request({
|
|
||||||
url: '/iot/category/shortlist',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询产品分类详细
|
// 查询产品分类详细
|
||||||
export function getCategory(categoryId) {
|
export function getCategory(categoryId) {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<el-row :gutter="40" style="margin-bottom:100px;">
|
<el-row :gutter="40" style="margin-bottom:100px;">
|
||||||
<el-col :xs="24" :sm="24" :md="24" :lg="14" :xl="14">
|
<el-col :xs="24" :sm="24" :md="24" :lg="14" :xl="14">
|
||||||
<el-card style="margin:-10px;" shadow="hover" body-style="background-color:#eee;">
|
<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-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,16 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||||
<el-table-column label="分类名称" align="center" prop="categoryName" />
|
<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">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="联网方式" align="center" prop="networkMethod">
|
<el-table-column label="联网方式" align="center" prop="networkMethod">
|
||||||
@@ -30,7 +37,7 @@
|
|||||||
<dict-tag :options="dict.type.iot_network_method" :value="scope.row.networkMethod" />
|
<dict-tag :options="dict.type.iot_network_method" :value="scope.row.networkMethod" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -53,7 +60,7 @@ import {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Product",
|
name: "Product",
|
||||||
dicts: [ 'iot_product_status', 'iot_network_method'],
|
dicts: ['iot_vertificate_method', 'iot_network_method'],
|
||||||
props: {
|
props: {
|
||||||
productId: {
|
productId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -95,10 +102,6 @@ export default {
|
|||||||
/** 查询产品列表 */
|
/** 查询产品列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
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 => {
|
listProduct(this.queryParams).then(response => {
|
||||||
this.productList = response.rows;
|
this.productList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备认证" prop="vertificateMethod">
|
<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-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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -122,7 +122,6 @@ import productAuthorize from "./product-authorize"
|
|||||||
import imageUpload from "../../../components/ImageUpload/index"
|
import imageUpload from "../../../components/ImageUpload/index"
|
||||||
import {
|
import {
|
||||||
listShortCategory,
|
listShortCategory,
|
||||||
listShortCategory1
|
|
||||||
} from "@/api/iot/category";
|
} from "@/api/iot/category";
|
||||||
import {
|
import {
|
||||||
getProduct,
|
getProduct,
|
||||||
@@ -188,11 +187,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
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;
|
this.categoryShortList = response.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
templateName: null,
|
templateName: null,
|
||||||
type: null,
|
type: null,
|
||||||
tenantName:''
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -83,9 +82,6 @@ export default {
|
|||||||
/** 查询通用物模型列表 */
|
/** 查询通用物模型列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
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) => {
|
listTemplate(this.queryParams).then((response) => {
|
||||||
this.templateList = response.rows;
|
this.templateList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
|
|||||||
Reference in New Issue
Block a user