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

58
src/components/earthMap/components/seneIdTreeSelect.vue

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

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

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

Loading…
Cancel
Save