前端多租户调整

This commit is contained in:
kerwincui
2022-06-03 17:21:31 +08:00
parent c9623a5ec6
commit 168d987779
8 changed files with 1 additions and 58 deletions

View File

@@ -10,7 +10,7 @@
</div> </div>
<div style="display:table;"> <div style="display:table;">
<div style="width:70px;font-weight: bold;display:table-cell;">企业用户</div> <div style="width:70px;font-weight: bold;display:table-cell;">企业用户</div>
<div style="display:table-cell;line-height:22px;"><b style="color:#F56C6C">可用于商业用途并提供移动端源码通过赞助方式获取企业授权</b>但是不能低价或批量转售源码不能随意分发源码目前赞助费为1500元项目不断完善后会对应增加费用</div> <div style="display:table-cell;line-height:22px;"><b style="color:#F56C6C">可用于商业用途并提供移动端源码通过赞助方式获取企业授权</b>但是不能低价或批量转售源码不能随意分发源码目前赞助费为2000元项目不断完善后会对应增加费用</div>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>

View File

@@ -5,11 +5,6 @@
<el-form-item label="分类名称" prop="categoryName"> <el-form-item label="分类名称" prop="categoryName">
<el-input v-model="queryParams.categoryName" placeholder="请输入产品分类名称" clearable size="small" @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.categoryName" placeholder="请输入产品分类名称" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item> </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-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -121,7 +116,6 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
categoryName: null, categoryName: null,
tenantName: null,
isSys: null, isSys: null,
}, },
// 表单参数 // 表单参数
@@ -133,16 +127,6 @@ export default {
message: "产品分类名称不能为空", message: "产品分类名称不能为空",
trigger: "blur" trigger: "blur"
}], }],
tenantId: [{
required: true,
message: "租户ID不能为空",
trigger: "blur"
}],
tenantName: [{
required: true,
message: "租户名称不能为空",
trigger: "blur"
}],
isSys: [{ isSys: [{
required: true, required: true,
message: "是否系统通用不能为空", message: "是否系统通用不能为空",
@@ -164,9 +148,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
}
listCategory(this.queryParams).then(response => { listCategory(this.queryParams).then(response => {
this.categoryList = response.rows; this.categoryList = response.rows;
this.total = response.total; this.total = response.total;

View File

@@ -447,10 +447,6 @@ export default {
this.queryParams.params['beginActiveTime'] = this.daterangeActiveTime[0]; this.queryParams.params['beginActiveTime'] = this.daterangeActiveTime[0];
this.queryParams.params['endActiveTime'] = this.daterangeActiveTime[1]; 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 => { listDeviceShort(this.queryParams).then(response => {
this.deviceList = response.rows; this.deviceList = response.rows;
this.total = response.total; this.total = response.total;

View File

@@ -173,21 +173,6 @@ export default {
message: "产品名称不能为空", message: "产品名称不能为空",
trigger: "blur" trigger: "blur"
}], }],
tenantId: [{
required: true,
message: "租户ID不能为空",
trigger: "blur"
}],
tenantName: [{
required: true,
message: "租户名称不能为空",
trigger: "blur"
}],
isSys: [{
required: true,
message: "是否系统通用不能为空",
trigger: "blur"
}],
version: [{ version: [{
required: true, required: true,
message: "固件版本不能为空", message: "固件版本不能为空",
@@ -228,9 +213,6 @@ export default {
}, },
/** 查询产品固件列表 */ /** 查询产品固件列表 */
getList() { getList() {
if (this.$store.state.user.roles !="admin"){
this.queryParams.tenantName = this.$store.state.user.name
}
this.loading = true; this.loading = true;
listFirmware(this.queryParams).then(response => { listFirmware(this.queryParams).then(response => {
this.firmwareList = response.rows; this.firmwareList = response.rows;

View File

@@ -107,9 +107,6 @@ export default {
this.queryParams.params["beginActiveTime"] = this.daterangeActiveTime[0]; this.queryParams.params["beginActiveTime"] = this.daterangeActiveTime[0];
this.queryParams.params["endActiveTime"] = this.daterangeActiveTime[1]; 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 => { listDeviceShort(this.queryParams).then(response => {
this.deviceList = response.rows; this.deviceList = response.rows;
this.total = response.total; this.total = response.total;

View File

@@ -158,11 +158,6 @@ export default {
/** 查询设备分组列表 */ /** 查询设备分组列表 */
getList() { getList() {
this.loading = true; 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 => { listGroup(this.queryParams).then(response => {
this.groupList = response.rows; this.groupList = response.rows;
this.total = response.total; this.total = response.total;

View File

@@ -154,9 +154,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
}
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;

View File

@@ -238,8 +238,6 @@ export default {
pageSize: 10, pageSize: 10,
templateName: null, templateName: null,
type: null, type: null,
// 增加属性
tenantName: ''
}, },
// 表单参数 // 表单参数
form: {}, form: {},
@@ -286,9 +284,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;