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

Co-authored-by: 吹泡泡的团子 <baoxinyi_i@didiglobal.com>
pull/1488/head
GRL-bxy 2 years 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) .getCurrentUser(userName)
.then((response) => { .then((response) => {
const { resources } = response; const { resources } = response;
resources.map((item) => ({
...item,
tenantId: item.resource
}))
if (response.role == 'ROLE_ADMIN') { if (response.role == 'ROLE_ADMIN') {
resources.unshift({ resources.unshift({
action: "rw", action: "rw",
resource: "所有租户", resource: this.$t('common.allTenant'),
username: userName username: userName,
tenantId: this.$t('common.allTenant'),
}) })
} }
this.$store.dispatch('tenant/setTenantList', resources) this.$store.dispatch('tenant/setTenantList', resources)

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

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

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

@ -18,7 +18,9 @@
</div> </div>
</template> </template>
<script> <script>
import { langSelectList } from './config' import { langSelectList, i18nConfig } from './config'
import * as user from '@/api/hippo4j-user';
import { mapGetters } from 'vuex';
export default { export default {
data() { data() {
return { return {
@ -31,6 +33,7 @@ export default {
this.currentLang = lang || null this.currentLang = lang || null
}, },
computed: { computed: {
...mapGetters(['tenantInfo', 'tenantList']),
currentLangName() { currentLangName() {
const langItem = this.langSelectList.find(item => item.lang === this.currentLang) const langItem = this.langSelectList.find(item => item.lang === this.currentLang)
return langItem?.name || '选择语言' return langItem?.name || '选择语言'
@ -42,6 +45,42 @@ export default {
this.currentLang = value this.currentLang = value
this.$i18n.locale = value this.$i18n.locale = value
localStorage.setItem('locale_lang', 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> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -443,6 +428,8 @@ import * as instanceApi from '@/api/hippo4j-instance';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import Pagination from '@/components/Pagination'; import Pagination from '@/components/Pagination';
import axios from 'axios'; import axios from 'axios';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
components: { Pagination }, components: { Pagination },
@ -567,6 +554,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// this.fetchData() // this.fetchData()
// //
@ -595,6 +591,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.tenantId) {
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }));
return; return;

@ -163,6 +163,8 @@ import * as jobProjectApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant'; import * as tenantApi from '@/api/hippo4j-tenant';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import Pagination from '@/components/Pagination'; import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -218,6 +220,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
this.fetchData(); this.fetchData();
// //
@ -238,6 +249,9 @@ export default {
}, },
methods: { methods: {
fetchData() { 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; this.listLoading = true;
jobProjectApi.list(this.listQuery).then((response) => { jobProjectApi.list(this.listQuery).then((response) => {
const { records } = response; const { records } = response;

@ -142,6 +142,8 @@
import * as logApi from '@/api/hippo4j-log'; import * as logApi from '@/api/hippo4j-log';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import Pagination from '@/components/Pagination'; import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -198,6 +200,9 @@ export default {
}, },
methods: { methods: {
fetchData() { 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; this.listLoading = true;
logApi.list(this.listQuery).then((response) => { logApi.list(this.listQuery).then((response) => {
const { records } = response; const { records } = response;

@ -1,21 +1,6 @@
<template> <template>
<div class="dashboard-editor-container"> <div class="dashboard-editor-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -156,6 +141,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as instanceApi from '@/api/hippo4j-instance'; import * as instanceApi from '@/api/hippo4j-instance';
import * as monitorApi from '@/api/hippo4j-monitor'; import * as monitorApi from '@/api/hippo4j-monitor';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'Monitor', name: 'Monitor',
@ -261,11 +248,25 @@ export default {
lastTaskCount: null, lastTaskCount: null,
}; };
}, },
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
async created() { async created() {
this.initSelect(); this.initSelect();
}, },
methods: { methods: {
fetchData() { 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) { if (!this.listQuery.tenantId) {
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') })); this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }));
return; return;

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.item')" :placeholder="$t('projectManage.item')"
@ -307,6 +292,8 @@ import * as notifyApi from '@/api/hippo4j-notify';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import Pagination from '@/components/Pagination'; import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -392,6 +379,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
this.fetchData(); this.fetchData();
// //
@ -414,6 +410,9 @@ export default {
}, },
methods: { methods: {
fetchData() { 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; this.listLoading = true;
notifyApi.list(this.listQuery).then((response) => { notifyApi.list(this.listQuery).then((response) => {
const { records } = response; const { records } = response;
@ -421,6 +420,8 @@ export default {
this.total = total; this.total = total;
this.list = records; this.list = records;
this.listLoading = false; this.listLoading = false;
}).catch((err) => {
console.log("isAError", err)
}); });
}, },
initSelect() { initSelect() {

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -276,6 +263,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }), this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -276,6 +263,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }), this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -276,6 +263,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }), 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 threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -294,6 +296,11 @@ export default {
}, },
visible: true, visible: true,
}; };
},
computed: {
...mapGetters([
'tenantInfo'
]),
}, },
created() { created() {
// //
@ -304,6 +311,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning('线程池类型不允许为空'); this.$message.warning('线程池类型不允许为空');
return; return;
@ -331,6 +341,17 @@ export default {
}, },
}, },
}, },
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() { created() {
// //
this.initSelect(); this.initSelect();
@ -340,6 +361,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning('线程池类型不允许为空'); this.$message.warning('线程池类型不允许为空');
return; return;

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -186,6 +171,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -275,6 +262,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -291,6 +287,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }), this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -276,6 +263,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }), this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -186,6 +171,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -275,6 +262,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -291,6 +287,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }), this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }),

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -187,6 +172,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -276,6 +263,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -292,6 +288,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.mark) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('frameworkThreadPool.threadPoolType') }), 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 tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -366,6 +368,17 @@ export default {
visible: true, visible: true,
}; };
}, },
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() { created() {
// //
this.initSelect(); this.initSelect();
@ -378,6 +391,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.tenantId) {
this.$message.warning('租户不允许为空'); this.$message.warning('租户不允许为空');
return; return;

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -280,6 +265,8 @@ import * as itemApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant'; import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -364,6 +351,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -383,6 +379,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.tenantId) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }), this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }),

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -290,6 +275,8 @@ import * as itemApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant'; import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -374,6 +361,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -393,6 +389,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.tenantId) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }), this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }),

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.itemRequired')" :placeholder="$t('projectManage.itemRequired')"
@ -290,6 +275,8 @@ import * as itemApi from '@/api/hippo4j-item';
import * as tenantApi from '@/api/hippo4j-tenant'; import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -374,6 +361,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
// //
this.initSelect(); this.initSelect();
@ -393,6 +389,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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) { if (!this.listQuery.tenantId) {
this.$message.warning( this.$message.warning(
this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }), this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }),

@ -1,5 +1,33 @@
<template> <template>
<div class="app-container"> <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 <el-table
v-loading="listLoading" v-loading="listLoading"
:data="list" :data="list"
@ -108,6 +136,7 @@ import * as jobProjectApi from '@/api/hippo4j-tenant';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import Pagination from '@/components/Pagination'; import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -164,7 +193,7 @@ export default {
}, },
watch: { watch: {
tenantInfo(newVal, oldVal) { tenantInfo(newVal, oldVal) {
this.listQuery = newVal; this.listQuery.tenantId = newVal.tenantId;
this.fetchData() this.fetchData()
} }
}, },
@ -193,10 +222,9 @@ export default {
}, },
methods: { methods: {
fetchData() { fetchData() {
// debugger this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
this.listQuery = this?.tenantInfo || this.listQuery let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
console.log("Quary", this.tenantInfo) this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
this.listQuery.tenantId = this.listQuery.tenantId == '所有租户' ? '' : this.listQuery.tenantId
this.listLoading = true; this.listLoading = true;
jobProjectApi.list(this.listQuery).then((response) => { jobProjectApi.list(this.listQuery).then((response) => {
const { records } = response; const { records } = response;

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.item')" :placeholder="$t('projectManage.item')"
@ -384,6 +369,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import Pagination from '@/components/Pagination'; import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
export default { export default {
name: 'JobProject', name: 'JobProject',
@ -507,6 +494,9 @@ export default {
}; };
}, },
computed:{ computed:{
...mapGetters([
'tenantInfo'
]),
rules(){ rules(){
return{ return{
tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], 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() { created() {
this.fetchData(); this.fetchData();
// //
@ -553,6 +549,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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; this.listLoading = true;
threadPoolApi.list(this.listQuery).then((response) => { threadPoolApi.list(this.listQuery).then((response) => {
const { records } = response; const { records } = response;

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

@ -1,21 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="filter-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 <el-select
v-model="listQuery.itemId" v-model="listQuery.itemId"
:placeholder="$t('projectManage.item')" :placeholder="$t('projectManage.item')"
@ -314,6 +299,8 @@ import * as tenantApi from '@/api/hippo4j-tenant';
import * as verifyApi from '@/api/verify'; import * as verifyApi from '@/api/verify';
import waves from '@/directive/waves'; import waves from '@/directive/waves';
import Pagination from '@/components/Pagination'; import Pagination from '@/components/Pagination';
import { mapGetters } from 'vuex';
import { i18nConfig } from '@/locale/config'
import * as threadPoolApi from '@/api/hippo4j-threadPool'; import * as threadPoolApi from '@/api/hippo4j-threadPool';
import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool'; import * as threadPoolAdapterApi from '@/api/hippo4j-adapterThreadPool';
@ -489,6 +476,17 @@ export default {
that: this, that: this,
}; };
}, },
computed: {
...mapGetters([
'tenantInfo'
]),
},
watch: {
tenantInfo(newVal, oldVal) {
this.listQuery.tenantId = newVal.tenantId;
this.fetchData()
}
},
created() { created() {
this.fetchData(); this.fetchData();
this.initSelect(); this.initSelect();
@ -501,6 +499,9 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
fetchData() { 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; this.listLoading = true;
verifyApi.list(this.listQuery).then((response) => { verifyApi.list(this.listQuery).then((response) => {
const { records } = response; const { records } = response;

Loading…
Cancel
Save