租户字典同步方法命名修正
This commit is contained in:
parent
d124fdf5ca
commit
0b7ea880fa
@ -62,9 +62,9 @@ export function optionselect(): AxiosPromise<DictTypeVO[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 同步租户字典
|
// 同步租户字典
|
||||||
export function asyncTenantDict(tenantId?: string) {
|
export function syncTenantDict(tenantId?: string | number) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/asyncTenantDict',
|
url: '/system/dict/type/syncTenantDict',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { tenantId }
|
params: { tenantId }
|
||||||
});
|
});
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
|
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasRole="['superadmin']" type="success" plain icon="Refresh" @click="handleAsyncTenantDict">同步租户字典</el-button>
|
<el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -112,11 +112,14 @@
|
|||||||
|
|
||||||
<script setup name="Dict" lang="ts">
|
<script setup name="Dict" lang="ts">
|
||||||
import useDictStore from '@/store/modules/dict';
|
import useDictStore from '@/store/modules/dict';
|
||||||
import { listType, getType, delType, addType, updateType, refreshCache ,asyncTenantDict} from '@/api/system/dict/type';
|
import { listType, getType, delType, addType, updateType, refreshCache , syncTenantDict} from '@/api/system/dict/type';
|
||||||
import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types';
|
import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types';
|
||||||
|
import useUserStore from '@/store/modules/user';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userId = ref(userStore.userId);
|
||||||
const typeList = ref<DictTypeVO[]>([]);
|
const typeList = ref<DictTypeVO[]>([]);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
@ -243,9 +246,9 @@ const handleRefreshCache = async () => {
|
|||||||
useDictStore().cleanDict();
|
useDictStore().cleanDict();
|
||||||
};
|
};
|
||||||
/**同步租户字典*/
|
/**同步租户字典*/
|
||||||
const handleAsyncTenantDict = async () => {
|
const handleSyncTenantDict = async () => {
|
||||||
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
|
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
|
||||||
let res = await asyncTenantDict();
|
let res = await syncTenantDict();
|
||||||
proxy?.$modal.msgSuccess(res.msg);
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="同步字典" placement="top">
|
<el-tooltip content="同步字典" placement="top">
|
||||||
<el-button v-hasRole="['superadmin']" link type="primary" icon="Refresh" @click="handleAsyncTenantDict(scope.row)"></el-button>
|
<el-button v-if="userId === 1" link type="primary" icon="Refresh" @click="handleSyncTenantDict(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button v-hasPermi="['system:tenant:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
<el-button v-hasPermi="['system:tenant:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||||
@ -148,10 +148,13 @@ import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenant
|
|||||||
import { selectTenantPackage } from '@/api/system/tenantPackage';
|
import { selectTenantPackage } from '@/api/system/tenantPackage';
|
||||||
import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types';
|
import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types';
|
||||||
import { TenantPkgVO } from '@/api/system/tenantPackage/types';
|
import { TenantPkgVO } from '@/api/system/tenantPackage/types';
|
||||||
import { asyncTenantDict } from '@/api/system/dict/type';
|
import { syncTenantDict } from '@/api/system/dict/type';
|
||||||
|
import useUserStore from '@/store/modules/user';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userId = ref(userStore.userId);
|
||||||
const tenantList = ref<TenantVO[]>([]);
|
const tenantList = ref<TenantVO[]>([]);
|
||||||
const packageList = ref<TenantPkgVO[]>([]);
|
const packageList = ref<TenantPkgVO[]>([]);
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
@ -336,11 +339,11 @@ const handleSyncTenantPackage = async (row: TenantVO) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**同步租户字典*/
|
/**同步租户字典*/
|
||||||
const handleAsyncTenantDict = async (row: TenantVO) => {
|
const handleSyncTenantDict = async (row: TenantVO) => {
|
||||||
try {
|
try {
|
||||||
await proxy?.$modal.confirm('是否确认同步租户套餐租户编号为"' + row.tenantId + '"的字典数据吗?');
|
await proxy?.$modal.confirm('是否确认同步租户套餐租户编号为"' + row.tenantId + '"的字典数据吗?');
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await asyncTenantDict(row.tenantId);
|
await syncTenantDict(row.tenantId);
|
||||||
await getList();
|
await getList();
|
||||||
proxy?.$modal.msgSuccess('同步成功');
|
proxy?.$modal.msgSuccess('同步成功');
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user