feat: 资产管理修改 2.0,移植到 ams里面

develop
时启龙 2024-08-28 15:20:14 +08:00
parent 8efeef0677
commit 3e63dd2c7f
2 changed files with 1 additions and 88 deletions

View File

@ -1,84 +0,0 @@
<template>
<el-card v-if="isLeaderPosition">
<el-form>
<el-form-item label="所属阵地:">
<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-form-item>
</el-form>
</el-card>
</template>
<script>
import { getSysconfQueryByCode, getDictChildren } from '@/services'
const addStorageEvent = (key, data) => {
// StorageEvent
var newStorageEvent = document.createEvent('StorageEvent')
const storage = {
setItem: function (k, val) {
sessionStorage.setItem(k, val)
//
newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null, null)
//
window.dispatchEvent(newStorageEvent)
}
}
return storage.setItem(key, data)
}
export default {
setup() {
//
const isLeaderPosition = ref(true)
//
const positionList = ref([])
//
const selectPostion = ref('')
const SET_SELECTED_POSITION = () => {
addStorageEvent('selectPostion', selectPostion.value)
}
async function init() {
const res = await getSysconfQueryByCode({ code: 'isLeaderPosition' })
if (!res.success) return
isLeaderPosition.value = res.data.value === 'true'
addStorageEvent('isLeaderPosition', res.data.value)
if (isLeaderPosition.value) {
const res = await getDictChildren({ value: 'POSITION_DATA' })
if (!res.success) return
positionList.value = [
{
name: '全部',
value: ''
},
...res.data
]
} else {
addStorageEvent('selectPostion', '')
}
}
init()
onUnmounted(() => {
addStorageEvent('isLeaderPosition', '')
addStorageEvent('selectPostion', '')
})
return {
isLeaderPosition,
positionList,
selectPostion,
SET_SELECTED_POSITION
}
}
}
</script>
<style scoped lang="scss">
::v-deep {
.czhj-card__body {
padding: 5px 10px;
}
.czhj-form-item {
margin-bottom: 0;
}
}
</style>

View File

@ -7,7 +7,6 @@
<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> -->
@ -30,7 +29,6 @@ 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'
@ -39,8 +37,7 @@ export default {
CommonHeader, CommonHeader,
SystemTip, SystemTip,
Sidebar, Sidebar,
ThirdMenu, ThirdMenu
AmsPosition
}, },
data() { data() {
return { return {