mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
前端多租户调整
This commit is contained in:
@@ -5,11 +5,6 @@
|
||||
<el-form-item label="分类名称" prop="categoryName">
|
||||
<el-input v-model="queryParams.categoryName" placeholder="请输入产品分类名称" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="系统定义" prop="isSys">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
||||
<el-option v-for="dict in dict.type.iot_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -121,7 +116,6 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
categoryName: null,
|
||||
tenantName: null,
|
||||
isSys: null,
|
||||
},
|
||||
// 表单参数
|
||||
@@ -133,16 +127,6 @@ export default {
|
||||
message: "产品分类名称不能为空",
|
||||
trigger: "blur"
|
||||
}],
|
||||
tenantId: [{
|
||||
required: true,
|
||||
message: "租户ID不能为空",
|
||||
trigger: "blur"
|
||||
}],
|
||||
tenantName: [{
|
||||
required: true,
|
||||
message: "租户名称不能为空",
|
||||
trigger: "blur"
|
||||
}],
|
||||
isSys: [{
|
||||
required: true,
|
||||
message: "是否系统通用不能为空",
|
||||
@@ -164,9 +148,6 @@ export default {
|
||||
/** 查询产品分类列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
if (this.$store.state.user.roles.indexOf("admin") === -1){
|
||||
this.queryParams.tenantName = this.$store.state.user.name
|
||||
}
|
||||
listCategory(this.queryParams).then(response => {
|
||||
this.categoryList = response.rows;
|
||||
this.total = response.total;
|
||||
|
||||
@@ -447,10 +447,6 @@ export default {
|
||||
this.queryParams.params['beginActiveTime'] = this.daterangeActiveTime[0];
|
||||
this.queryParams.params['endActiveTime'] = this.daterangeActiveTime[1];
|
||||
}
|
||||
// 判断是否是admin角色
|
||||
// if (this.$store.state.user.roles.indexOf("admin") === -1) {
|
||||
// this.queryParams.userId = this.$store.state.user.userId
|
||||
// }
|
||||
listDeviceShort(this.queryParams).then(response => {
|
||||
this.deviceList = response.rows;
|
||||
this.total = response.total;
|
||||
|
||||
@@ -173,21 +173,6 @@ export default {
|
||||
message: "产品名称不能为空",
|
||||
trigger: "blur"
|
||||
}],
|
||||
tenantId: [{
|
||||
required: true,
|
||||
message: "租户ID不能为空",
|
||||
trigger: "blur"
|
||||
}],
|
||||
tenantName: [{
|
||||
required: true,
|
||||
message: "租户名称不能为空",
|
||||
trigger: "blur"
|
||||
}],
|
||||
isSys: [{
|
||||
required: true,
|
||||
message: "是否系统通用不能为空",
|
||||
trigger: "blur"
|
||||
}],
|
||||
version: [{
|
||||
required: true,
|
||||
message: "固件版本不能为空",
|
||||
@@ -228,9 +213,6 @@ export default {
|
||||
},
|
||||
/** 查询产品固件列表 */
|
||||
getList() {
|
||||
if (this.$store.state.user.roles !="admin"){
|
||||
this.queryParams.tenantName = this.$store.state.user.name
|
||||
}
|
||||
this.loading = true;
|
||||
listFirmware(this.queryParams).then(response => {
|
||||
this.firmwareList = response.rows;
|
||||
|
||||
@@ -107,9 +107,6 @@ export default {
|
||||
this.queryParams.params["beginActiveTime"] = this.daterangeActiveTime[0];
|
||||
this.queryParams.params["endActiveTime"] = this.daterangeActiveTime[1];
|
||||
}
|
||||
if (this.$store.state.user.roles.indexOf("admin") === -1){
|
||||
this.queryParams.userName=this.$store.state.user.name;
|
||||
}
|
||||
listDeviceShort(this.queryParams).then(response => {
|
||||
this.deviceList = response.rows;
|
||||
this.total = response.total;
|
||||
|
||||
@@ -158,11 +158,6 @@ export default {
|
||||
/** 查询设备分组列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 设置用户的角色 用以区分自己创建的设备
|
||||
// 由于admin可以看所有数据所以判断
|
||||
if (this.$store.state.user.roles.indexOf("admin") === -1){
|
||||
this.queryParams.userName = this.$store.state.user.name
|
||||
}
|
||||
listGroup(this.queryParams).then(response => {
|
||||
this.groupList = response.rows;
|
||||
this.total = response.total;
|
||||
|
||||
@@ -154,9 +154,6 @@ export default {
|
||||
/** 查询产品列表 */
|
||||
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;
|
||||
|
||||
@@ -238,8 +238,6 @@ export default {
|
||||
pageSize: 10,
|
||||
templateName: null,
|
||||
type: null,
|
||||
// 增加属性
|
||||
tenantName: ''
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -286,9 +284,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;
|
||||
|
||||
Reference in New Issue
Block a user