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. 16
      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 }) {

16
src/components/earthMap/components/seneIdTreeSelect.vue

@ -5,10 +5,9 @@
功能概述原生的折现属性面板 添加一个场景选择器功能用于决定防区添加到哪个区域场景
-->
<template>
<ApiTreeSelect :api="sceneIdTree" v-model:value="sceneId" placeholder="请选择所属区域"
:disabled="disabled"
@change="(value: any) => handleChange(value)"
>
<ApiTreeSelect :api="sceneIdTree" v-model:value="sceneId" placeholder="请选择所属区域" :disabled="disabled"
:allowClear="false"
@change="(value: any) => handleChange(value)">
</ApiTreeSelect>
</template>
@ -43,7 +42,7 @@ onMounted(()=>{
// console.log("currentModelaaaaaa",props.currentModel);
// console.log("currentModelaaaaaa",props);
// 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) {
// console.log("params",params);
@ -66,9 +65,13 @@ const sceneIdTree = () => defHttp.get<Recordable[]>
</script>
<style scoped lang="less">
:deep(.ant-select) {
width: 180px !important;
}
: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) {
@ -96,5 +99,4 @@ const sceneIdTree = () => defHttp.get<Recordable[]>
: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