update 优化 将同步字典功能迁移到租户管理内
This commit is contained in:
parent
ec0e6a167e
commit
22e8a57b31
@ -49,9 +49,6 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<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-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
|
|
||||||
</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>
|
||||||
</template>
|
</template>
|
||||||
@ -112,15 +109,11 @@
|
|||||||
|
|
||||||
<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 useUserStore from "@/store/modules/user";
|
|
||||||
import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type';
|
import { listType, getType, delType, addType, updateType, refreshCache } 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 { syncTenantDict } from "@/api/system/tenant";
|
|
||||||
|
|
||||||
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);
|
||||||
@ -246,12 +239,7 @@ const handleRefreshCache = async () => {
|
|||||||
proxy?.$modal.msgSuccess('刷新成功');
|
proxy?.$modal.msgSuccess('刷新成功');
|
||||||
useDictStore().cleanDict();
|
useDictStore().cleanDict();
|
||||||
};
|
};
|
||||||
/**同步租户字典*/
|
|
||||||
const handleSyncTenantDict = async () => {
|
|
||||||
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
|
|
||||||
let res = await syncTenantDict();
|
|
||||||
proxy?.$modal.msgSuccess(res.msg);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
|
@ -44,6 +44,9 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
<el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
|
||||||
|
</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>
|
||||||
</template>
|
</template>
|
||||||
@ -141,13 +144,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Tenant" lang="ts">
|
<script setup name="Tenant" lang="ts">
|
||||||
import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenantStatus, syncTenantPackage } from '@/api/system/tenant';
|
import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenantStatus, syncTenantPackage, syncTenantDict } from '@/api/system/tenant';
|
||||||
import { selectTenantPackage } from '@/api/system/tenantPackage';
|
import { selectTenantPackage } from '@/api/system/tenantPackage';
|
||||||
|
import useUserStore from '@/store/modules/user';
|
||||||
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';
|
||||||
|
|
||||||
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);
|
||||||
@ -343,6 +349,13 @@ const handleExport = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**同步租户字典*/
|
||||||
|
const handleSyncTenantDict = async () => {
|
||||||
|
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
|
||||||
|
let res = await syncTenantDict();
|
||||||
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user