Browse Source

1.修改UI

2.增加判断
3.ApiTreeSelect 新增allowClear控制
master
DIAMOND 11 months ago
parent
commit
cb7466796a
  1. 5
      src/components/Form/src/components/ApiTreeSelect.vue
  2. 56
      src/components/earthMap/components/seneIdTreeSelect.vue
  3. 6
      src/components/earthMap/toolbar/AddModelWin.vue

5
src/components/Form/src/components/ApiTreeSelect.vue

@ -1,5 +1,5 @@
<template>
<a-tree-select v-bind="getAttrs" @change="handleChange" :placeholder=placeholder allow-clear
<a-tree-select v-bind="getAttrs" @change="handleChange" :placeholder=placeholder :allowClear="allowClear"
:getPopupContainer="(triggerNode) => triggerNode.parentNode">
<template #[item]="data" v-for="item in Object.keys($slots)">
<slot :name="item" v-bind="data || {}"></slot>
@ -25,7 +25,8 @@
params: { type: Object },
immediate: { type: Boolean, default: true },
resultField: propTypes.string.def(''),
placeholder: { type: String, default:'' }
placeholder: { type: String, default:'' },
allowClear: { type: Boolean, default: true },
},
emits: ['options-change', 'change'],
setup(props, { attrs, emit }) {

56
src/components/earthMap/components/seneIdTreeSelect.vue

@ -5,11 +5,10 @@
功能概述原生的折现属性面板 添加一个场景选择器功能用于决定防区添加到哪个区域场景
-->
<template>
<ApiTreeSelect :api="sceneIdTree" v-model:value="sceneId" placeholder="请选择所属区域"
:disabled="disabled"
@change="(value: any) => handleChange(value)"
>
</ApiTreeSelect>
<ApiTreeSelect :api="sceneIdTree" v-model:value="sceneId" placeholder="请选择所属区域" :disabled="disabled"
:allowClear="false"
@change="(value: any) => handleChange(value)">
</ApiTreeSelect>
</template>
<script lang="ts" setup>
@ -39,13 +38,13 @@ const props = defineProps({
})
let sceneId = ref<string>();
onMounted(()=>{
// console.log("currentModelaaaaaa",props.currentModel);
// console.log("currentModelaaaaaa",props);
// console.log("proxy",proxy);
sceneId.value = props.currentModel.sceneId? props.currentModel.sceneId: "";
onMounted(() => {
// console.log("currentModelaaaaaa",props.currentModel);
// console.log("currentModelaaaaaa",props);
// console.log("proxy",proxy);
sceneId.value = props.currentModel.sceneId ? props.currentModel.sceneId : null;
})
function handleChange(params:type) {
function handleChange(params: type) {
// console.log("params",params);
let model = window.$earth.getObject(props.currentModel.xbsjGuid);
model.sceneId = params;
@ -59,42 +58,45 @@ const sceneIdTree = () => defHttp.get<Recordable[]>
sceneId: userStore.userInfo?.sceneId + "*"
}
}).then(res => { return [res]; })
;
;
</script>
<style scoped lang="less">
:deep(.ant-select) {
width: 180px !important;
}
:deep(.ant-select-selector){
background-color: rgba(0,0,0,.5) !important
:deep(.ant-select-selector) {
background-color: rgba(0, 0, 0, .5) !important;
width: 180px !important;
}
:deep(.ant-select-selection-placeholder){
color: #ddd !important;
:deep(.ant-select-selection-placeholder) {
color: #ddd !important;
}
:deep(.ant-select-arrow){
color: #474747 !important;
:deep(.ant-select-arrow) {
color: #474747 !important;
}
:deep(.ant-select-dropdown){
background-color: #8a8a8a !important;
color: #ddd !important;
:deep(.ant-select-dropdown) {
background-color: #8a8a8a !important;
color: #ddd !important;
}
:deep(.ant-select-tree){
background-color: #8a8a8a !important;
color: #ddd !important;
:deep(.ant-select-tree) {
background-color: #8a8a8a !important;
color: #ddd !important;
}
:deep(.ant-select-tree .ant-select-tree-node-content-wrapper:hover){
:deep(.ant-select-tree .ant-select-tree-node-content-wrapper:hover) {
background: #6b6b6b;
}
:deep(.ant-select-selection-item){
:deep(.ant-select-selection-item) {
color: #ddd !important;
}
</style>

6
src/components/earthMap/toolbar/AddModelWin.vue

@ -849,6 +849,12 @@
okBtn.onclick = function () {
// console.log("currentModel",currentModel);
// return
//
if (!currentModel.sceneId) {
createMessage.warning('请选择所属区域', 2);
return;
}
//
$mitt.emit('windowCancel');
//
const submitData: any = {};

Loading…
Cancel
Save