Merge remote-tracking branch 'origin/master'
| | |
| | | return res |
| | | }, |
| | | error => { |
| | | |
| | | return Promise.reject(new Error(error)) |
| | | } |
| | | ) |
| | |
| | | <script setup> |
| | | import { useStore } from 'vuex' |
| | | import { ElLoading } from 'element-plus' |
| | | import { logOutFun } from '@/utils/util' |
| | | |
| | | const store = useStore() |
| | | const router = useRouter() |
| | |
| | | let loading = ElLoading.service({ background: 'rgba(0, 0, 0, 0.3)', text: '加载中...' }) |
| | | const tagWel = computed(() => store.state.tags.tagWel) |
| | | const redirect = route.query.redirect |
| | | store |
| | | .dispatch('LoginByUsername', { |
| | | username: userName, |
| | | password: userName === 'admin' ? 'admin' :'jadk@2026', |
| | | tenantId: '000000', |
| | | type: 'account', |
| | | }) |
| | | .then(() => { |
| | | loading.close() |
| | | router.push(redirect || tagWel.value) |
| | | }) |
| | | .catch(err => { |
| | | loading.close() |
| | | // 返回上一个路由 |
| | | window.history.go(-1) |
| | | }) |
| | | |
| | | if (userName) { |
| | | store |
| | | .dispatch('LoginByUsername', { |
| | | username: userName, |
| | | password: userName === 'admin' ? 'admin' :'jadk@2026', |
| | | tenantId: '000000', |
| | | type: 'account', |
| | | }) |
| | | .then(() => { |
| | | loading.close() |
| | | router.push(redirect || tagWel.value) |
| | | }) |
| | | .catch(err => { |
| | | loading.close() |
| | | // 返回上一个路由 |
| | | window.history.go(-1) |
| | | }) |
| | | }else{ |
| | | loading.close() |
| | | logOutFun() |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | |
| | | } from '@/utils/auth' |
| | | import { setStore, getStore } from '@/utils/store' |
| | | import { validatenull } from '@/utils/validate' |
| | | import { deepClone } from '@/utils/util' |
| | | import { deepClone, logOutFun } from '@/utils/util' |
| | | import defaultAva from '@/assets/images/defaultava.png' |
| | | import { |
| | | loginByUsername, |
| | |
| | | }) |
| | | }, |
| | | GetMenu ({ commit, dispatch }, tenantId) { |
| | | const errLogOut = () => { |
| | | dispatch('LogOut').then(() => { |
| | | window.location.href = "/drone-command/login" |
| | | // env === 'development' |
| | | // ? window.location.href = "/drone-command/login" |
| | | // : window.location.replace(`${adminUrl}#/login`) |
| | | }) |
| | | } |
| | | return new Promise(resolve => { |
| | | getRoutes({tenantId,sysType}).then(res => { |
| | | const data = res.data.data; |
| | | let menu = deepClone(data); |
| | | if (!res.data?.data?.length){ |
| | | ElMessage.warning('当前角色没有配置菜单,请联系管理员配置') |
| | | errLogOut() |
| | | setTimeout(logOutFun,1500) |
| | | return |
| | | } |
| | | menu.forEach(ele => formatPath(ele, true)) |
| | |
| | | dispatch('GetButtons') |
| | | resolve(menu) |
| | | }).catch(err => { |
| | | errLogOut() |
| | | logOutFun() |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | getList({current: page.currentPage, size: page.pageSize, ...Object.assign(params, this.query)}).then(res => { |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | |
| | | :props="treeProps" |
| | | /> |
| | | </el-tab-pane> |
| | | <!-- <el-tab-pane label="任务工单">--> |
| | | <!-- <el-tree--> |
| | | <!-- class="command-tree"--> |
| | | <!-- ref="workRef"--> |
| | | <!-- :data="menuGrantListWord"--> |
| | | <!-- show-checkbox--> |
| | | <!-- node-key="id"--> |
| | | <!-- :default-checked-keys="menuTreeObjWork"--> |
| | | <!-- :props="treeProps"--> |
| | | <!-- />--> |
| | | <!-- </el-tab-pane>--> |
| | | <!-- <el-tab-pane label="移动app">--> |
| | | <!-- <el-tree--> |
| | | <!-- class="command-tree"--> |
| | | <!-- ref="treeMenuApp"--> |
| | | <!-- :data="menuGrantListApp"--> |
| | | <!-- show-checkbox--> |
| | | <!-- node-key="id"--> |
| | | <!-- :default-checked-keys="menuTreeObjApp"--> |
| | | <!-- :props="treeProps"--> |
| | | <!-- />--> |
| | | <!-- </el-tab-pane>--> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <el-button color="#2B2B4C" @click="visible = false">取消</el-button> |
| | | <el-button color="#284FE3" type="primary" @click="submit">确定</el-button> |
| | | </template> |
| | | |
| | | <!-- 有用wu删,提供给保存接口,防止重置其他系统菜单 --> |
| | | <el-tree |
| | | v-show="false" |
| | | class="command-tree" |
| | | ref="workRef" |
| | | :data="menuGrantListWord" |
| | | show-checkbox |
| | | node-key="id" |
| | | :default-checked-keys="menuTreeObjWork" |
| | | :props="treeProps" |
| | | /> |
| | | <el-tree |
| | | v-show="false" |
| | | class="command-tree" |
| | | ref="treeMenuApp" |
| | | :data="menuGrantListApp" |
| | | show-checkbox |
| | | node-key="id" |
| | | :default-checked-keys="menuTreeObjApp" |
| | | :props="treeProps" |
| | | /> |
| | | |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | <template> |
| | | <div style="width: 100%; height: 100%; background: #FFFFFF"></div> |
| | | <div style="width: 100%; height: 100%; background: #ffffff"></div> |
| | | </template> |
| | | <script setup> |
| | | import { useStore } from 'vuex' |
| | | import { ElLoading } from 'element-plus' |
| | | import { logOutFun } from '@/utils/util' |
| | | |
| | | const store = useStore() |
| | | const router = useRouter() |
| | |
| | | let loading = ElLoading.service({ background: 'rgba(0, 0, 0, 0.3)', text: '加载中...' }) |
| | | const tagWel = computed(() => store.state.tags.tagWel) |
| | | const redirect = route.query.redirect |
| | | store |
| | | .dispatch('LoginByUsername', { |
| | | username: userName, |
| | | password: userName === 'admin' ? 'admin' :'jadk@2026', |
| | | tenantId: '000000', |
| | | type: 'account', |
| | | }) |
| | | .then(() => { |
| | | loading.close() |
| | | router.push(redirect || tagWel.value) |
| | | }) |
| | | .catch(err => { |
| | | loading.close() |
| | | // 返回上一个路由 |
| | | window.history.go(-1) |
| | | }) |
| | | |
| | | if (userName) { |
| | | store |
| | | .dispatch('LoginByUsername', { |
| | | username: userName, |
| | | password: userName === 'admin' ? 'admin' : 'jadk@2026', |
| | | tenantId: '000000', |
| | | type: 'account', |
| | | }) |
| | | .then(() => { |
| | | loading.close() |
| | | router.push(redirect || tagWel.value) |
| | | }) |
| | | .catch(err => { |
| | | loading.close() |
| | | // 返回上一个路由 |
| | | window.history.go(-1) |
| | | }) |
| | | } else { |
| | | loading.close() |
| | | logOutFun() |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | |
| | | }) |
| | | }, |
| | | GetMenu({ commit, dispatch }, tenantId) { |
| | | const errLogOut = () => { |
| | | logOutFun() |
| | | } |
| | | return new Promise(resolve => { |
| | | getRoutes({ tenantId, sysType: 6 }) |
| | | .then(res => { |
| | | const data = res.data.data |
| | | let menu = deepClone(data) |
| | | if (!res.data?.data?.length) { |
| | | errLogOut() |
| | | ElMessage.warning('当前角色没有配置菜单,请联系管理员配置') |
| | | setTimeout(logOutFun,1500) |
| | | return |
| | | } |
| | | menu.forEach(ele => formatPath(ele, true)) |
| | |
| | | resolve(menu) |
| | | }) |
| | | .catch(err => { |
| | | errLogOut() |
| | | logOutFun() |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | @closed="handleClosed" |
| | | > |
| | | <el-tabs type="border-card"> |
| | | <!-- <el-tab-pane label="无人机管控">--> |
| | | <!-- <el-tree--> |
| | | <!-- class="command-tree"--> |
| | | <!-- ref="droneControl"--> |
| | | <!-- :data="menuGrantListDroneControl"--> |
| | | <!-- show-checkbox--> |
| | | <!-- node-key="id"--> |
| | | <!-- :default-checked-keys="droneControlMenuTreeObj"--> |
| | | <!-- :props="treeProps"--> |
| | | <!-- />--> |
| | | <!-- </el-tab-pane>--> |
| | | <el-tab-pane label="任务工单"> |
| | | <el-tree |
| | | class="command-tree" |
| | |
| | | <el-button color="#F2F3F5" @click="visible = false">取消</el-button> |
| | | <el-button color="#4C34FF" type="primary" @click="submit">确定</el-button> |
| | | </template> |
| | | |
| | | <!-- 有用wu删,提供给保存接口,防止重置其他系统菜单 --> |
| | | <el-tree |
| | | v-show="false" |
| | | class="command-tree" |
| | | ref="droneControl" |
| | | :data="menuGrantListDroneControl" |
| | | show-checkbox |
| | | node-key="id" |
| | | :default-checked-keys="droneControlMenuTreeObj" |
| | | :props="treeProps" |
| | | /> |
| | | |
| | | </el-dialog> |
| | | </template> |
| | | |