zhaothird

This commit is contained in:
redamancy-qian
2022-04-16 00:48:53 +08:00
parent 4bc2b41a38
commit f052bda831
42 changed files with 369 additions and 73 deletions

View File

@@ -24,8 +24,7 @@
</el-card>
<el-card style="padding-bottom:100px;">
<el-row :gutter="30" v-loading="loading" >
<el-col :span="6" v-for="(item,index) in productList" :key="index" style="margin-bottom:30px;text-align:center;" v-show="(item.isSys == 1) || (userName == item.tenantName)">
<div>
<el-col :span="6" v-for="(item,index) in productList" :key="index" style="margin-bottom:30px;text-align:center;">
<el-card :body-style="{ padding: '20px'}" shadow="always">
<el-row type="flex" :gutter="10" justify="space-between">
<el-col :span="20" style="text-align:left;">
@@ -80,7 +79,6 @@
<el-button size="mini" type="warning" icon="el-icon-search" @click="handleViewDevice(item.productId)" v-hasPermi="['tool:gen:edit']">查看设备</el-button>
</el-button-group>
</el-card>
</div>
</el-col>
</el-row>
@@ -118,9 +116,6 @@ export default {
dicts: ['iot_yes_no', 'iot_product_status', 'iot_device_type', 'iot_network_method', 'iot_vertificate_method', 'iot_device_chip'],
data() {
return {
userName:'',
// 判断用户是否是管理员
isAdmin:false,
// 遮罩层
loading: true,
// 总条数
@@ -152,7 +147,6 @@ export default {
},
created() {
this.getList();
this.init();
},
activated() {
const time = this.$route.query.t;
@@ -163,20 +157,12 @@ export default {
}
},
methods: {
init(){
if (this.$store.state.user.roles =="admin"){
this.isAdmin = true
// 显示全部的情况 = 角色是管理员admin
// 显示系统定义和自己 = 角色是租户
// 都会显示 = 系统定义
// 条件: isSys = '1' || this.$store.state.user.name == item.tenantName
}
this.userName = this.$store.state.user.name
console.log(this.userName)
},
/** 查询产品列表 */
getList() {
this.loading = true;
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;