feat: delete select tenent and Inject globalTenant (#1487)

Co-authored-by: 吹泡泡的团子 <baoxinyi_i@didiglobal.com>
pull/1488/head
GRL-bxy 9 months ago committed by GitHub
parent 19b465fa24
commit ef73f2569a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,11 +18,16 @@ export default {
.getCurrentUser(userName)
.then((response) => {
const { resources } = response;
resources.map((item) => ({
...item,
tenantId: item.resource
}))
if (response.role == 'ROLE_ADMIN') {
resources.unshift({
action: "rw",
resource: "所有租户",
username: userName
resource: this.$t('common.allTenant'),
username: userName,
tenantId: this.$t('common.allTenant'),
})
}
this.$store.dispatch('tenant/setTenantList', resources)

@ -56,6 +56,7 @@
import Hamburger from '@/components/Hamburger'
import ErrorLog from '@/components/ErrorLog'
import langChange from '@/locale/langChange'
import { i18nConfig } from '@/locale/config'
export default {
data() {
@ -82,6 +83,13 @@
'tenantInfo'
])
},
watch: {
tenantInfo(newVal) {
this.tenant.tenantId = newVal.tenantId
this.tenant.resource = newVal.resource
console.log("ischangLang", newVal)
}
},
methods: {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
@ -97,29 +105,38 @@
.getCurrentUser(userName)
.then((response) => {
const { resources } = response;
resources.map((item) => ({
...item,
tenantId: item.resource
}))
if (response.role == 'ROLE_ADMIN') {
resources.unshift({
action: "rw",
resource: "所有租户",
username: userName
resource: this.$t('common.allTenant'),
username: userName,
tenantId: this.$t('common.allTenant'),
})
}
this.$store.dispatch('tenant/setTenantList', resources)
this.$store.dispatch('tenant/setTenantInfo', this.tenantInfo || resources[0])
this.tenant = this.tenantInfo || resources[0]
console.log("isResour", resources[0], this.tenant)
})
.catch(() => {});
},
async changeTenant(index) {
console.log("isTenList", this.tenantList)
let tenant = {
tenantId: this.tenantList[index].resource,
resource: this.tenantList[index].resource,
current: 1,
desc: true,
size: 10,
}
this.$store.dispatch('tenant/setTenantInfo', tenant)
tenant.tenantId = tenant.tenantId == '所有租户' ? '' : tenant.tenantId
let isAllTenant = tenant.tenantId == i18nConfig.messages.zh.common.allTenant || tenant.tenantId == i18nConfig.messages.en.common.allTenant
tenant.tenantId = isAllTenant ? '' : tenant.tenantId
await jobProjectApi.list(tenant).then((response) => {
console.log("isRes", response)
// this.$store.dispatch('tenant/setTenantList', resources)

@ -51,6 +51,7 @@ export default {
audit: 'Audit',
yes: 'Yes',
no: 'No',
allTenant: 'ALL TENANT'
},
// 运行报表

@ -49,6 +49,7 @@ export default {
audit: '审核',
yes: '是',
no: '否',
allTenant: '所有租户'
},
// 运行报表

@ -18,7 +18,9 @@
</div>
</template>
<script>
import { langSelectList } from './config'
import { langSelectList, i18nConfig } from './config'
import * as user from '@/api/hippo4j-user';
import { mapGetters } from 'vuex';
export default {
data() {
return {
@ -31,6 +33,7 @@ export default {
this.currentLang = lang || null
},
computed: {
...mapGetters(['tenantInfo', 'tenantList']),
currentLangName() {
const langItem = this.langSelectList.find(item => item.lang === this.currentLang)
return langItem?.name || '选择语言'
@ -42,6 +45,42 @@ export default {
this.currentLang = value
this.$i18n.locale = value
localStorage.setItem('locale_lang', value)
this.changeTenant()
},
changeTenant() {
const userName = this.$cookie.get('userName');
user.getCurrentUser(userName)
.then((response) => {
const { resources } = response;
resources.map((item) => ({
...item,
tenantId: item.resource
}))
//change lang = change global tenantInfo
if (response.role == 'ROLE_ADMIN') {
//tenantInfo
let tenantId = this.tenantInfo.resource
let isAllTenant = tenantId == i18nConfig.messages.zh.common.allTenant || tenantId == i18nConfig.messages.en.common.allTenant
let alreadyHasAll = resources[0] == i18nConfig.messages.zh.common.allTenant || resources[0] == i18nConfig.messages.en.common.allTenant
if (alreadyHasAll) {
this.$set(resources[0], 'resource', this.$t('common.allTenant'))
this.$store.dispatch('tenant/setTenantList', resources)
} else {
resources.unshift({
action: "rw",
resource: this.$t('common.allTenant'),
username: userName,
tenantId: this.$t('common.allTenant'),
})
this.$store.dispatch('tenant/setTenantList', resources)
}
if (isAllTenant) {
this.$store.dispatch('tenant/setTenantInfo', resources[0])
}
}
})
}
}
}

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -443,6 +428,8 @@ import * as instanceApi from '@/api/hippo4j-instance';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import axios from 'axios';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
components: { Pagination },
@ -567,6 +554,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -585,6 +575,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
// this.fetchData()
//
@ -595,6 +591,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.tenantId) {
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }));
return;

@ -163,6 +163,8 @@ import * as jobProjectApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -218,6 +220,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -228,6 +233,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
this.fetchData();
//
@ -238,6 +249,9 @@ export default {
},
methods: {
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
this.listLoading = true;
jobProjectApi.list(this.listQuery).then((response) => {
const { records } = response;

@ -142,6 +142,8 @@
import * as logApi from '@/api/hippo4j-log';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -198,6 +200,9 @@ export default {
},
methods: {
fetchData() {
// this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
// let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
// this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
this.listLoading = true;
logApi.list(this.listQuery).then((response) => {
const { records } = response;

@ -1,21 +1,6 @@
<template>
<div class="dashboard-editor-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -156,6 +141,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as instanceApi from '@/api/hippo4j-instance';
import * as monitorApi from '@/api/hippo4j-monitor';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'Monitor',
@ -261,11 +248,25 @@ export default {
lastTaskCount: null,
};
},
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
async created() {
this.initSelect();
},
methods: {
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.tenantId) {
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }));
return;

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenant')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.item')"
@ -307,6 +292,8 @@ import * as notifyApi from '@/api/hippo4j-notify';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -392,6 +379,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -407,6 +397,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
this.fetchData();
//
@ -414,6 +410,9 @@ export default {
},
methods: {
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? undefined : this.listQuery.tenantId
this.listLoading = true;
notifyApi.list(this.listQuery).then((response) => {
const { records } = response;
@ -421,6 +420,8 @@ export default {
this.total = total;
this.list = records;
this.listLoading = false;
}).catch((err) => {
console.log("isAError", err)
});
},
initSelect() {

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -276,6 +263,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -283,6 +273,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -276,6 +263,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -283,6 +273,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -276,6 +263,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -283,6 +273,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -194,6 +194,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -295,6 +297,11 @@ export default {
visible: true,
};
},
computed: {
...mapGetters([
'tenantInfo'
]),
},
created() {
//
this.initSelect();
@ -304,6 +311,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning('线程池类型不允许为空');
return;
@ -331,6 +341,17 @@ export default {
},
},
},
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -340,6 +361,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning('线程池类型不允许为空');
return;

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -186,6 +171,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -275,6 +262,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -282,6 +272,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -291,6 +287,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -276,6 +263,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -283,6 +273,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -186,6 +171,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -275,6 +262,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -282,6 +272,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -291,6 +287,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -276,6 +263,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -283,6 +273,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.mark) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -270,6 +270,8 @@ import * as itemApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -366,6 +368,17 @@ export default {
visible: true,
};
},
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -378,6 +391,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.tenantId) {
this.$message.warning('租户不允许为空');
return;

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -280,6 +265,8 @@ import * as itemApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -364,6 +351,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -371,6 +361,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -383,6 +379,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.tenantId) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }),

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -290,6 +275,8 @@ import * as itemApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -374,6 +361,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -381,6 +371,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -393,6 +389,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.tenantId) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }),

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenantRequired')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')"
@ -290,6 +275,8 @@ import * as itemApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -374,6 +361,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -381,6 +371,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
//
this.initSelect();
@ -393,6 +389,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
if (!this.listQuery.tenantId) {
this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }),

@ -1,5 +1,33 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.tenantId"
clearable
:placeholder="$t('tenantManage.tenant')"
style="width: 200px"
class="filter-item"
/>
<el-button
v-waves
class="filter-item"
type="primary"
icon="el-icon-search"
@click="fetchData"
>
{{ $t('common.query') }}
</el-button>
<el-button
:disabled="isEditDisabled"
class="filter-item"
style="margin-left: 10px"
type="primary"
icon="el-icon-edit"
@click="handleCreate"
>
{{ $t('common.insert') }}
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
@ -108,6 +136,7 @@ import * as jobProjectApi from '@/api/hippo4j-tenant';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -164,7 +193,7 @@ export default {
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery = newVal;
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
@ -193,10 +222,9 @@ export default {
},
methods: {
fetchData() {
// debugger
this.listQuery = this?.tenantInfo || this.listQuery
console.log("Quary", this.tenantInfo)
this.listQuery.tenantId = this.listQuery.tenantId == '所有租户' ? '' : this.listQuery.tenantId
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
this.listLoading = true;
jobProjectApi.list(this.listQuery).then((response) => {
const { records } = response;

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenant')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.item')"
@ -384,6 +369,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default {
name: 'JobProject',
@ -507,6 +494,9 @@ export default {
};
},
computed:{
...mapGetters([
'tenantInfo'
]),
rules(){
return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }],
@ -538,6 +528,12 @@ export default {
}
},
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
this.fetchData();
//
@ -553,6 +549,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
this.listLoading = true;
threadPoolApi.list(this.listQuery).then((response) => {
const { records } = response;

@ -128,6 +128,7 @@ import * as user from '@/api/hippo4j-user';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import * as tenantApi from '@/api/hippo4j-tenant';
export default {
name: 'User',
components: { Pagination },

@ -1,21 +1,6 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-select
v-model="listQuery.tenantId"
:placeholder="$t('tenantManage.tenant')"
style="width: 220px"
filterable
class="filter-item"
@change="tenantSelectList()"
>
<el-option
v-for="item in tenantOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-select
v-model="listQuery.itemId"
:placeholder="$t('projectManage.item')"
@ -314,6 +299,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as verifyApi from '@/api/verify';
import waves from '@/directive/waves';
import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
@ -489,6 +476,17 @@ export default {
that: this,
};
},
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() {
this.fetchData();
this.initSelect();
@ -501,6 +499,9 @@ export default {
this.$forceUpdate();
},
fetchData() {
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
this.listLoading = true;
verifyApi.list(this.listQuery).then((response) => {
const { records } = response;

Loading…
Cancel
Save