| | |
| | | <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> |
| | | <right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | |
| | | <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | <span>{{ proxy.parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
| | |
| | | |
| | | <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); |
| | |
| | | await refreshCache(); |
| | | proxy?.$modal.msgSuccess('刷新成功'); |
| | | useDictStore().cleanDict(); |
| | | }; |
| | | /**同步租户字典*/ |
| | | const handleSyncTenantDict = async () => { |
| | | await proxy?.$modal.confirm('确认要同步所有租户字典吗?'); |
| | | let res = await syncTenantDict(); |
| | | proxy?.$modal.msgSuccess(res.msg); |
| | | }; |
| | | |
| | | onMounted(() => { |