|
@@ -4,12 +4,10 @@ import { getWorkLocationList } from '@/api/datamanagement/alert'
|
|
|
type Location = {
|
|
type Location = {
|
|
|
value: number,
|
|
value: number,
|
|
|
label: string,
|
|
label: string,
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- value: number,
|
|
|
|
|
- label: string
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ children: {
|
|
|
|
|
+ value: number,
|
|
|
|
|
+ label: string
|
|
|
|
|
+ }[]
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export function useWorkLocation() {
|
|
export function useWorkLocation() {
|
|
@@ -17,18 +15,16 @@ export function useWorkLocation() {
|
|
|
|
|
|
|
|
const getLocationOptions = () => {
|
|
const getLocationOptions = () => {
|
|
|
getWorkLocationList().then((res) => {
|
|
getWorkLocationList().then((res) => {
|
|
|
- res.forEach((item) => {
|
|
|
|
|
- locationOptions.value.push({
|
|
|
|
|
|
|
+ locationOptions.value = res?.map((item) => {
|
|
|
|
|
+ const newChildren = item.workspaceList?.map(x => {
|
|
|
|
|
+ return { value: x.workspaceId, label: x.workspaceName }
|
|
|
|
|
+ }) || []
|
|
|
|
|
+ return {
|
|
|
value: item.workshopId,
|
|
value: item.workshopId,
|
|
|
label: item.workshopName,
|
|
label: item.workshopName,
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- value: item.workspaceList[0].workspaceId,
|
|
|
|
|
- label: item.workspaceList[0].workspaceName
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ children: newChildren
|
|
|
|
|
+ }
|
|
|
|
|
+ }) || []
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
|
|
|
|