feat: 资产管理增加阵地选择
parent
4e04b2d068
commit
39b92124af
|
@ -29,6 +29,8 @@ declare module '@vue/runtime-core' {
|
||||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
|
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||||
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
<template>
|
||||||
|
<el-card v-if="isLeaderPosition" body-class="custom-body">
|
||||||
|
<el-radio-group v-model="selectPostion" @change="SET_SELECTED_POSITION">
|
||||||
|
<el-radio v-for="item in positionList" :key="item.value" :label="item.value">{{ item.name }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getSysconfQueryByCode, getDictChildren } from '@/services'
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
// 是否为主阵地
|
||||||
|
const isLeaderPosition = ref(true)
|
||||||
|
// 子阵地列表
|
||||||
|
const positionList = ref([])
|
||||||
|
// 已选择
|
||||||
|
const selectPostion = ref('')
|
||||||
|
const SET_SELECTED_POSITION = () => {
|
||||||
|
sessionStorage.setItem('selectPostion', selectPostion.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function init() {
|
||||||
|
const res = await getSysconfQueryByCode({ code: 'isLeaderPosition' })
|
||||||
|
if (!res.success) return
|
||||||
|
isLeaderPosition.value = res.data.value
|
||||||
|
if (isLeaderPosition.value) {
|
||||||
|
const res = await getDictChildren({ value: 'POSITION_DATA' })
|
||||||
|
if (!res.success) return
|
||||||
|
positionList.value = [
|
||||||
|
{
|
||||||
|
name: '全部',
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
...res.data
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
init()
|
||||||
|
onUnmounted(() => {
|
||||||
|
sessionStorage.removeItem('selectPostion')
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
isLeaderPosition,
|
||||||
|
positionList,
|
||||||
|
selectPostion,
|
||||||
|
SET_SELECTED_POSITION
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
::v-deep {
|
||||||
|
.czhj-card__body {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -7,6 +7,7 @@
|
||||||
<el-container class="main-container">
|
<el-container class="main-container">
|
||||||
<ThirdMenu :menuData="thirdMenuData" v-if="thirdMenuData.children"></ThirdMenu>
|
<ThirdMenu :menuData="thirdMenuData" v-if="thirdMenuData.children"></ThirdMenu>
|
||||||
<el-main class="main-body">
|
<el-main class="main-body">
|
||||||
|
<AmsPosition v-if="$route.name === 'ams-web'"></AmsPosition>
|
||||||
<el-scrollbar class="custom-scrollbar" style="flex: 1">
|
<el-scrollbar class="custom-scrollbar" style="flex: 1">
|
||||||
<transition enter-active-class="fadeInUp" mode="out-in">
|
<transition enter-active-class="fadeInUp" mode="out-in">
|
||||||
<!-- <router-view v-if="$route.path === '/404'"></router-view> -->
|
<!-- <router-view v-if="$route.path === '/404'"></router-view> -->
|
||||||
|
@ -29,6 +30,7 @@ import Sidebar from './components/sidebar/Sidebar.vue'
|
||||||
import ThirdMenu from './components/ThirdMenu.vue'
|
import ThirdMenu from './components/ThirdMenu.vue'
|
||||||
import CommonHeader from './components/Header.vue'
|
import CommonHeader from './components/Header.vue'
|
||||||
import SystemTip from './components/SystemTip.vue'
|
import SystemTip from './components/SystemTip.vue'
|
||||||
|
import AmsPosition from './components/AmsPosition.vue'
|
||||||
import useRouteItem from '@/hooks/useRouteItem'
|
import useRouteItem from '@/hooks/useRouteItem'
|
||||||
|
|
||||||
// import startApp from '@/core/register'
|
// import startApp from '@/core/register'
|
||||||
|
@ -37,7 +39,8 @@ export default {
|
||||||
CommonHeader,
|
CommonHeader,
|
||||||
SystemTip,
|
SystemTip,
|
||||||
Sidebar,
|
Sidebar,
|
||||||
ThirdMenu
|
ThirdMenu,
|
||||||
|
AmsPosition
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -136,7 +139,6 @@ export default {
|
||||||
basePath: computed(() => store.state.app.basePath),
|
basePath: computed(() => store.state.app.basePath),
|
||||||
expire: computed(() => store.state.app.expire),
|
expire: computed(() => store.state.app.expire),
|
||||||
isFontBig: computed(() => store.state.app.pageConfig.contentFontSize === 'big'),
|
isFontBig: computed(() => store.state.app.pageConfig.contentFontSize === 'big'),
|
||||||
positionList: computed(() => store.state.position.positionList),
|
|
||||||
addRoutes,
|
addRoutes,
|
||||||
menuData,
|
menuData,
|
||||||
showSidebar,
|
showSidebar,
|
||||||
|
|
|
@ -29,12 +29,19 @@ export function getDict(data) {
|
||||||
params: wrapperParams(data)
|
params: wrapperParams(data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function getDictChildren(params) {
|
||||||
|
return request.get('/sms/v1/dictionaries/children', { params })
|
||||||
|
}
|
||||||
|
|
||||||
export function getSysconf() {
|
export function getSysconf() {
|
||||||
return request.get('/sms/v1/configs')
|
return request.get('/sms/v1/configs')
|
||||||
}
|
}
|
||||||
export function getSysconfCode(params) {
|
export function getSysconfCode(params) {
|
||||||
return request.get('/sms/v1/configs', { params })
|
return request.get('/sms/v1/configs', { params })
|
||||||
}
|
}
|
||||||
|
export function getSysconfQueryByCode(params) {
|
||||||
|
return request.get('/sms/v1/configs/queryByCode', { params })
|
||||||
|
}
|
||||||
export function modifySysconf(data) {
|
export function modifySysconf(data) {
|
||||||
return request.put('/sms/v1/configs', wrapperParams(data))
|
return request.put('/sms/v1/configs', wrapperParams(data))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue