xq feat:"做好了切换项目的准备"
This commit is contained in:
@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
<div class="right-menu flex align-center">
|
<div class="right-menu flex align-center">
|
||||||
<template v-if="appStore.device !== 'mobile'">
|
<template v-if="appStore.device !== 'mobile'">
|
||||||
<el-select class="program-list" placeholder="高光村农业光伏"> </el-select>
|
<el-select class="program-list" placeholder="高光村农业光伏">
|
||||||
|
<el-option v-for="item in programList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
||||||
|
</el-select>
|
||||||
<el-select
|
<el-select
|
||||||
v-if="userId === 1 && tenantEnabled"
|
v-if="userId === 1 && tenantEnabled"
|
||||||
v-model="companyName"
|
v-model="companyName"
|
||||||
@ -142,7 +144,11 @@ const dynamicClearEvent = async () => {
|
|||||||
await proxy?.$tab.refreshPage();
|
await proxy?.$tab.refreshPage();
|
||||||
};
|
};
|
||||||
|
|
||||||
const programList = ref([]);
|
const programList = ref([{}]);
|
||||||
|
|
||||||
|
const programName = ref();
|
||||||
|
|
||||||
|
const programId = ref();
|
||||||
|
|
||||||
/** 租户列表 */
|
/** 租户列表 */
|
||||||
const initTenantList = async () => {
|
const initTenantList = async () => {
|
||||||
|
18
src/store/modules/program.ts
Normal file
18
src/store/modules/program.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { defineStore } from 'pinia';
|
||||||
|
|
||||||
|
interface ProgramState {
|
||||||
|
programID: string;
|
||||||
|
}
|
||||||
|
const useProgram = defineStore('program', {
|
||||||
|
state: (): ProgramState => ({
|
||||||
|
programID: ''
|
||||||
|
}),
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
updateId(id: string) {
|
||||||
|
this.programID = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export { useProgram };
|
@ -134,6 +134,7 @@
|
|||||||
<script setup name="Nbq" lang="ts">
|
<script setup name="Nbq" lang="ts">
|
||||||
import { listNbq, getNbq, delNbq, addNbq, updateNbq } from '@/api/business/nbq';
|
import { listNbq, getNbq, delNbq, addNbq, updateNbq } from '@/api/business/nbq';
|
||||||
import { NbqVO, NbqQuery, NbqForm } from '@/api/business/nbq/types';
|
import { NbqVO, NbqQuery, NbqForm } from '@/api/business/nbq/types';
|
||||||
|
import { useProgram } from '@/store/modules/program';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { type } = toRefs<any>(proxy?.useDict('type'));
|
const { type } = toRefs<any>(proxy?.useDict('type'));
|
||||||
@ -150,6 +151,22 @@ const total = ref(0);
|
|||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const nbqFormRef = ref<ElFormInstance>();
|
const nbqFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
const programState = useProgram();
|
||||||
|
|
||||||
|
const programID = computed(() => {
|
||||||
|
return programState.programID;
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
programID,
|
||||||
|
(nv, ov) => {
|
||||||
|
if (nv !== ov) {
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
title: ''
|
title: ''
|
||||||
|
Reference in New Issue
Block a user