| | |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="68px"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="字典名称" prop="dictName"> |
| | | <el-input v-model="queryParams.dictName" placeholder="请输入字典名称" clearable style="width: 240px" @keyup.enter="handleQuery" /> |
| | | <el-input v-model="queryParams.dictName" placeholder="请输入字典名称" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="字典类型" prop="dictType"> |
| | | <el-input v-model="queryParams.dictType" placeholder="请输入字典类型" clearable style="width: 240px" @keyup.enter="handleQuery" /> |
| | | <el-input v-model="queryParams.dictType" placeholder="请输入字典类型" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间" style="width: 308px"> |
| | | <el-date-picker |
| | |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button> |
| | | </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> |
| | | </el-row> |
| | |
| | | |
| | | <script setup name="Dict" lang="ts"> |
| | | 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 { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types'; |
| | | import { syncTenantDict } from "@/api/system/tenant"; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const userStore = useUserStore(); |
| | | const userId = ref(userStore.userId); |
| | | const typeList = ref<DictTypeVO[]>([]); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | |
| | | proxy?.$modal.msgSuccess('刷新成功'); |
| | | useDictStore().cleanDict(); |
| | | }; |
| | | /**同步租户字典*/ |
| | | const handleSyncTenantDict = async () => { |
| | | await proxy?.$modal.confirm('确认要同步所有租户字典吗?'); |
| | | let res = await syncTenantDict(); |
| | | proxy?.$modal.msgSuccess(res.msg); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |