yunxinguanli
This commit is contained in:
@@ -4,6 +4,14 @@ import createAxios from '@/utils/request'
|
||||
export function saveLogParam() {
|
||||
return createAxios({
|
||||
url: '/system-boot/audit/saveLogParam',
|
||||
method:'POST'
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
// 区域列表
|
||||
export function getAreaList() {
|
||||
return createAxios({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
26
src/components/form/area/index.vue
Normal file
26
src/components/form/area/index.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<el-cascader v-bind='$attrs' :options='options' :props='cascaderProps' />
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'Area'
|
||||
})
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
|
||||
const cascaderProps = {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
showAllLevels: false
|
||||
}
|
||||
const dictData = useDictData()
|
||||
const options = dictData.state.area
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -31,7 +31,7 @@
|
||||
<script setup lang='ts'>
|
||||
import { inject, ref } from 'vue'
|
||||
import type TableStore from '@/utils/tableStore'
|
||||
import DatePicker from '@/components/datePicker/index.vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const date = ref([window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd'), window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd')])
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<component :is="config.layout.layoutMode"></component>
|
||||
<component :is='config.layout.layoutMode'></component>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup lang='ts'>
|
||||
import { reactive } from 'vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { useNavTabs } from '@/stores/navTabs'
|
||||
@@ -21,6 +21,8 @@ import { isEmpty } from 'lodash-es'
|
||||
import { setNavTabsWidth } from '@/utils/layout'
|
||||
import { adminBaseRoutePath } from '@/router/static'
|
||||
import { getRouteMenu, dictDataCache } from '@/api/auth'
|
||||
import { getAreaList } from '@/api/common'
|
||||
import { BasicDictData } from '@/stores/interface'
|
||||
|
||||
defineOptions({
|
||||
components: { Default, Classic, Streamline, Double }
|
||||
@@ -30,7 +32,7 @@ const navTabs = useNavTabs()
|
||||
const config = useConfig()
|
||||
const route = useRoute()
|
||||
const adminInfo = useAdminInfo()
|
||||
const DictData = useDictData()
|
||||
const dictData = useDictData()
|
||||
const state = reactive({
|
||||
autoMenuCollapseLock: false
|
||||
})
|
||||
@@ -47,10 +49,18 @@ onBeforeMount(() => {
|
||||
useEventListener(window, 'resize', onAdaptiveLayout)
|
||||
})
|
||||
|
||||
const init = () => {
|
||||
const init = async () => {
|
||||
await Promise.all([
|
||||
getAreaList(),
|
||||
dictDataCache()
|
||||
]).then(res => {
|
||||
dictData.state.area = res[0].data
|
||||
dictData.state.basic = res[1].data
|
||||
})
|
||||
/**
|
||||
* 后台初始化请求,获取站点配置,动态路由等信息
|
||||
*/
|
||||
getRouteMenu().then((res: any) => {
|
||||
const arr = [
|
||||
{
|
||||
id: 1,
|
||||
@@ -191,7 +201,7 @@ const init = () => {
|
||||
]
|
||||
}
|
||||
]
|
||||
getRouteMenu().then((res: any) => {
|
||||
|
||||
const handlerMenu = (data: any) => {
|
||||
data.forEach((item: any) => {
|
||||
item.path = item.routeName || item.title
|
||||
@@ -223,9 +233,6 @@ const init = () => {
|
||||
console.log(firstRoute)
|
||||
if (firstRoute) routePush(firstRoute.path)
|
||||
})
|
||||
dictDataCache().then(res => {
|
||||
DictData.setBasicData(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
const onAdaptiveLayout = () => {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
class="default-main ba-main-loading"
|
||||
></div>
|
||||
<div v-if="state.showReload" class="loading-footer">
|
||||
<el-button @click="refresh" type="warning">utils.Reload</el-button>
|
||||
<el-button @click="refresh" type="warning">重新加载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -8,17 +8,14 @@ export const useDictData = defineStore(
|
||||
() => {
|
||||
const state: DictData = reactive({
|
||||
basic: [],
|
||||
area: []
|
||||
// 其他接口获取的字典,比如区域
|
||||
})
|
||||
const setBasicData = (data: BasicDictData[]) => {
|
||||
state.basic = data
|
||||
}
|
||||
const getBasicData = (code: string) => {
|
||||
return state.basic.filter(item => item.code === code)[0]?.children || []
|
||||
}
|
||||
return {
|
||||
state,
|
||||
setBasicData,
|
||||
getBasicData
|
||||
}
|
||||
},
|
||||
|
||||
@@ -47,6 +47,7 @@ export interface AdminInfo {
|
||||
|
||||
export interface DictData {
|
||||
basic: BasicDictData[]
|
||||
area: BasicDictData[]
|
||||
}
|
||||
|
||||
export interface BasicDictData {
|
||||
|
||||
@@ -54,7 +54,7 @@ saveLogParam().then(res => {
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
// tableStore.index()
|
||||
})
|
||||
|
||||
const addMenu = () => {}
|
||||
|
||||
@@ -1,30 +1,58 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div class='default-main'>
|
||||
<TableHeader date-picker>
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label="用户名">
|
||||
<el-select v-model="value" class="m-2" placeholder="Select" size="large">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label='区域'>
|
||||
<Area v-model='tableStore.table.params.deptIndex' />
|
||||
</el-form-item>
|
||||
<el-form-item label='终端状态'>
|
||||
<el-select v-model='tableStore.table.params.runFlag'
|
||||
placeholder='请选择'>
|
||||
<el-option label='投运' value='0' />
|
||||
<el-option label='热备用' value='1' />
|
||||
<el-option label='停运' value='2' />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作类型">
|
||||
<el-input v-model="tableStore.table.params.loginName" placeholder="Please input" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label='通讯状态'>
|
||||
<el-select v-model='tableStore.table.params.comFlag'
|
||||
placeholder='请选择'>
|
||||
<el-option label='正常' value='1' />
|
||||
<el-option label='中断' value='0' />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='厂家'>
|
||||
<el-select v-model='tableStore.table.params.manufacturer'
|
||||
placeholder='请选择'
|
||||
>
|
||||
<el-option
|
||||
v-for='item in manufacturer'
|
||||
:key='item.id'
|
||||
:label='item.name'
|
||||
:value='item.id'
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='筛选数据'>
|
||||
<el-input v-model='tableStore.table.params.searchValue' placeholder='请输入' />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<Table ref='tableRef' />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="tsx">
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
<script setup lang='tsx'>
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'comptroller/list'
|
||||
})
|
||||
const dictData = useDictData()
|
||||
const manufacturer = dictData.getBasicData('Dev_Manufacturers')
|
||||
const tableStore = new TableStore({
|
||||
isWebPaging: true,
|
||||
url: '/device-boot/runManage/getRuntimeData',
|
||||
@@ -54,19 +82,19 @@ const tableStore = new TableStore({
|
||||
return <span></span>
|
||||
} else if (props.renderValue * 100 > 90) {
|
||||
return (
|
||||
<el-tag effect="dark" type="success">
|
||||
<el-tag effect='dark' type='success'>
|
||||
优
|
||||
</el-tag>
|
||||
)
|
||||
} else if (props.renderValue * 100 > 60) {
|
||||
return (
|
||||
<el-tag effect="dark" type="warning">
|
||||
<el-tag effect='dark' type='warning'>
|
||||
良
|
||||
</el-tag>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<el-tag effect="dark" type="danger">
|
||||
<el-tag effect='dark' type='danger'>
|
||||
差
|
||||
</el-tag>
|
||||
)
|
||||
@@ -76,16 +104,16 @@ const tableStore = new TableStore({
|
||||
]
|
||||
})
|
||||
tableStore.table.params.deptIndex = '5699e5916a18a6381e1ac92da5bd2628'
|
||||
tableStore.table.params.serverName = 'event-boot'
|
||||
tableStore.table.params.statisticalType = {}
|
||||
tableStore.table.params.runFlag = []
|
||||
tableStore.table.params.comFlag = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.runFlag = []
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const addMenu = () => {}
|
||||
const addMenu = () => {
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user