feat: 资产管理修改 2.0,移植到 ams里面
parent
8efeef0677
commit
3e63dd2c7f
|
@ -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>
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue