This commit is contained in:
zhaotiantian
2023-12-11 13:27:32 +08:00
7 changed files with 149 additions and 33 deletions
+1 -3
View File
@@ -396,7 +396,6 @@
flex: 1;
height: calc(100% + 22px);
margin: 10px 0;
//border: 1px solid red;
}
.map-legend {
@@ -404,7 +403,6 @@
bottom: 15px;
left: 10px;
width: 200px;
//border: 1px solid red;
display: flex;
flex-wrap: wrap;
@@ -458,4 +456,4 @@
}
}
}
</style>
</style>
@@ -0,0 +1,7 @@
import { get } from '/@/api/request.ts';
export enum Api {
depart = 'sys/sysDepart/allSecondaryDeparts',
}
export const allSecondaryDeparts = () => get(Api.depart);
@@ -2,14 +2,11 @@
<div class="center-map">
<div class="china-map-box">
<div class="form-container">
<!-- <a-select placeholder="选择单位" v-model:value="selectValue" class="type-select" :options="selectOptions">-->
<!-- <a-select-option value="全部数据">全部数据</a-select-option>-->
<!-- </a-select>-->
<!-- <a-select v-model:value="selectValue" class="type-select" :options="selectOptions">-->
<!-- <a-select-option value="全部数据">全部数据</a-select-option>-->
<!-- </a-select>-->
<slot name="rightForm"></slot>
</div>
<div style="flex: 1; overflow: hidden; margin: 0 0 10px">
<div id="mapContainer" class="mapContainer"></div>
</div>
<div class="mapContainer" id="mapContainer"></div>
<div v-show="false" id="container"></div>
<div v-show="false" id="panel"></div>
</div>
@@ -45,8 +42,17 @@
position: relative;
}
.form-container {
position: absolute;
//right: 9px;
right: 0;
top: 17px;
z-index: 1;
}
.mapContainer {
flex: 1;
height: calc(100% + 22px);
margin: 10px 0;
}
}
@@ -13,3 +13,58 @@
// },
// ];
import {onMounted, ref} from "vue";
import {allSecondaryDeparts} from "/@/components/secondaryScreen/commonApi";
export function useDepart({selectOption = [],}) {
const orgCode = ref();
const option = ref([]);
const fieldNames = {label: 'departName', value: 'orgCode',}
onMounted(() => {
if (selectOption && Array.isArray(selectOption) && selectOption.length > 0) {
setOption(selectOption);
} else {
getOptionData();
}
});
function setOption(option) {
option.value = selectOption || option;
}
async function getOptionData() {
const {result, code} = await allSecondaryDeparts();
if (code == 200) {
option.value = result;
}
}
return {
orgCode,
option,
setOption,
fieldNames
};
}
export function useTimeType(t) {
const type = ref(t || '')
const timeRangeOption = [
{
label: '近一周',
value: 'week'
},
{
label: '近一月',
value: 'month'
},
{
label: '近一年',
value: 'year'
}
]
return {
type,
timeRangeOption
}
}