feat: 资产管理增加阵地选择
parent
4e04b2d068
commit
39b92124af
|
@ -29,6 +29,8 @@ declare module '@vue/runtime-core' {
|
|||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
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']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
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">
|
||||
<ThirdMenu :menuData="thirdMenuData" v-if="thirdMenuData.children"></ThirdMenu>
|
||||
<el-main class="main-body">
|
||||
<AmsPosition v-if="$route.name === 'ams-web'"></AmsPosition>
|
||||
<el-scrollbar class="custom-scrollbar" style="flex: 1">
|
||||
<transition enter-active-class="fadeInUp" mode="out-in">
|
||||
<!-- <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 CommonHeader from './components/Header.vue'
|
||||
import SystemTip from './components/SystemTip.vue'
|
||||
import AmsPosition from './components/AmsPosition.vue'
|
||||
import useRouteItem from '@/hooks/useRouteItem'
|
||||
|
||||
// import startApp from '@/core/register'
|
||||
|
@ -37,7 +39,8 @@ export default {
|
|||
CommonHeader,
|
||||
SystemTip,
|
||||
Sidebar,
|
||||
ThirdMenu
|
||||
ThirdMenu,
|
||||
AmsPosition
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -136,7 +139,6 @@ export default {
|
|||
basePath: computed(() => store.state.app.basePath),
|
||||
expire: computed(() => store.state.app.expire),
|
||||
isFontBig: computed(() => store.state.app.pageConfig.contentFontSize === 'big'),
|
||||
positionList: computed(() => store.state.position.positionList),
|
||||
addRoutes,
|
||||
menuData,
|
||||
showSidebar,
|
||||
|
|
|
@ -29,12 +29,19 @@ export function getDict(data) {
|
|||
params: wrapperParams(data)
|
||||
})
|
||||
}
|
||||
export function getDictChildren(params) {
|
||||
return request.get('/sms/v1/dictionaries/children', { params })
|
||||
}
|
||||
|
||||
export function getSysconf() {
|
||||
return request.get('/sms/v1/configs')
|
||||
}
|
||||
export function getSysconfCode(params) {
|
||||
return request.get('/sms/v1/configs', { params })
|
||||
}
|
||||
export function getSysconfQueryByCode(params) {
|
||||
return request.get('/sms/v1/configs/queryByCode', { params })
|
||||
}
|
||||
export function modifySysconf(data) {
|
||||
return request.put('/sms/v1/configs', wrapperParams(data))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue