| | |
| | | <template> |
| | | <div class="content"> |
| | | <div class="content" v-drag="true"> |
| | | <div class="title"> |
| | | <label>详细编辑</label> |
| | | <el-icon |
| | | @click="setSpatialClose" |
| | | :size="20" |
| | | style="cursor: pointer" |
| | | > |
| | | <el-icon @click="setSpatialClose" :size="20" style="cursor: pointer"> |
| | | <Close /> |
| | | </el-icon> |
| | | </div> |
| | |
| | | layerName |
| | | }}</el-checkbox> --> |
| | | {{ layerData.cnName }} |
| | | <img |
| | | src="../../assets/img/layer.png" |
| | | alt="" |
| | | /> |
| | | <img src="../../assets/img/layer.png" alt="" /> |
| | | </div> |
| | | <div class="slider-demo-block"> |
| | | <div class="slider-demo-block" v-show="diaphaneityShow"> |
| | | <div class="demonstration">透明度</div> |
| | | <el-slider |
| | | v-model="transparence" |
| | |
| | | /> |
| | | <div class="demonstration">{{ transparence }}%</div> |
| | | </div> |
| | | <div class="slider-demo-block"> |
| | | <div class="slider-demo-block" v-show="contrastShow"> |
| | | <div class="demonstration">对比度</div> |
| | | <el-slider |
| | | v-model="contrast" |
| | | @change="contrastChange" |
| | | :format-tooltip="contrastFormatTooltip" |
| | | :max="3" |
| | | :step="0.1" |
| | | /> |
| | | <div class="demonstration">{{ contrast }}%</div> |
| | | <div class="demonstration">{{ contrast }}</div> |
| | | </div> |
| | | <div class="selectBox"> |
| | | <div class="selectBox" v-show="drawingModeShow"> |
| | | <div class="selectTile demonstration">拉伸方式</div> |
| | | <el-select |
| | | v-model="stretchValue" |
| | | class="imgSelect" |
| | | placeholder="选择拉伸方式" |
| | | size="small" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in stretchOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | <div class="stretchSelect"> |
| | | <el-select |
| | | :teleported="false" |
| | | v-model="stretchValue" |
| | | class="stretchSelect" |
| | | :class="{ imgSelect: stretchNumShow }" |
| | | placeholder="选择拉伸方式" |
| | | size="small" |
| | | clearable |
| | | @change="stretchChange" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <el-option |
| | | v-for="item in stretchOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <span v-show="stretchNumShow">-</span> |
| | | <el-input-number |
| | | class="stretchNum" |
| | | v-show="stretchNumShow" |
| | | :precision="2" |
| | | :step="0.01" |
| | | v-model="stretchNum" |
| | | :min="stretchMin" |
| | | :max="stretchMax" |
| | | controls-position="right" |
| | | size="small" |
| | | @change="stretchNumChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="selectBox"> |
| | | <div class="selectBox" v-show="colorShow"> |
| | | <div class="selectTile demonstration">渲染类型</div> |
| | | <el-select |
| | | v-model="renderType" |
| | | class="imgSelect" |
| | | placeholder="选择渲染类型" |
| | | size="small" |
| | | @change="changeSelection(renderType)" |
| | |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in renderTypeOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="(item, i) in renderTypeOptions" |
| | | :key="i" |
| | | :label="item.data_id" |
| | | :value="item.name" |
| | | > |
| | | <!-- <img :src="item.url" style="height: 30px; margin-right: 10px" /> |
| | | <span>{{ item.label }}</span> --> |
| | | <div |
| | | style=" |
| | | height: 30px; |
| | | width: 100%; |
| | | position: relative; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | " |
| | | :style="item.domCss" |
| | | ></div> |
| | | |
| | | <img |
| | | :src="item.url" |
| | | style="height: 30px; width: 100%" |
| | | /> |
| | | <!-- <img :src="item.url" style="height: 30px; width: 100%" /> --> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | defineEmits, |
| | | } from "vue"; |
| | | import server from "@/assets/js/Map/server"; |
| | | import { publish_selectSjColorTables } from "@/api/api"; |
| | | import json from "@/assets/js/colorValue"; |
| | | |
| | | const stretchValue = ref(""); |
| | | const transparence = ref(0); |
| | | const contrast = ref(0); |
| | | const contrast = ref(1); |
| | | let layerName = ref("图层名称"); |
| | | let layerState = ref(false); |
| | | let select = ref(); |
| | | let renderType = ref(""); |
| | | const renderTypeOptions = [ |
| | | let renderTypeOptions = ref([]); |
| | | let stretchOptions = [ |
| | | { |
| | | value: "Option1", |
| | | label: "Option1", |
| | | url: "https://img2.baidu.com/it/u=3727554264,855092936&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500", |
| | | value: 0, |
| | | label: "不拉伸", |
| | | }, |
| | | { |
| | | value: "Option2", |
| | | label: "Option2", |
| | | url: "https://img1.baidu.com/it/u=3226786080,888437008&fm=253&fmt=auto&app=138&f=JPEG?w=200&h=200", |
| | | value: 1, |
| | | label: "线性拉伸", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "直方图均衡", |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "标准差拉伸", |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: "伽马拉伸", |
| | | }, |
| | | ]; |
| | | const stretchOptions = [ |
| | | { |
| | | value: "Option1", |
| | | label: "Option1", |
| | | }, |
| | | { |
| | | value: "Option2", |
| | | label: "Option2", |
| | | }, |
| | | ]; |
| | | let stretchNum = ref(0); |
| | | let stretchMin = ref(0); |
| | | let stretchMax = ref(0); |
| | | let stretchNumShow = ref(false); |
| | | const formatTooltip = (val: number) => { |
| | | return val / 100; |
| | | }; |
| | |
| | | const setSpatialClose = () => { |
| | | emits("detailClose", false); |
| | | }; |
| | | const handlCheckAllChange = (res) => {}; |
| | | |
| | | const getColorJson = async () => { |
| | | const dt = await publish_selectSjColorTables({ |
| | | pageIndex: 1, |
| | | pageSize: 1000, |
| | | }); |
| | | renderTypeOptions.value = dt.result.item_list; |
| | | |
| | | renderTypeOptions.value.forEach((e) => { |
| | | let css = ""; |
| | | let css1 = ""; |
| | | e.content.levels.forEach((v) => { |
| | | if ("r_start" in v) { |
| | | console.log(v.r_start); |
| | | css += `rgb(${v.r_start}, ${v.g_start}, ${v.b_start}),rgb(${v.r_end}, ${v.g_end}, ${v.b_end}),`; |
| | | } else if ("r" in v) { |
| | | css1 += `rgb(${v.r}, ${v.g}, ${v.b}),`; |
| | | } |
| | | }); |
| | | |
| | | let cssColor = `${css1}${css}`; |
| | | let cssStr = ""; |
| | | |
| | | if (cssColor.length == 19) { |
| | | cssStr = `background: ${cssColor.slice(0, -1)}`; |
| | | } else { |
| | | cssStr = `background-image:linear-gradient(to right, ${cssColor.slice( |
| | | 0, |
| | | -1 |
| | | )})`; |
| | | } |
| | | e.domCss = cssStr; |
| | | }); |
| | | // console.log(renderTypeOptions.value); |
| | | }; |
| | | |
| | | const changeSelection = (scope) => { |
| | | if (scope == "") { |
| | | select.value.$el.children[0].children[0].removeAttribute("style"); |
| | |
| | | } |
| | | for (let index in renderTypeOptions) { |
| | | let obj = renderTypeOptions[index]; |
| | | if (obj.value == scope) { |
| | | if (obj.name == scope) { |
| | | // select.value.$el.children[0].children[0].setAttribute( |
| | | // "style", |
| | | // `background: url(${obj.url}) no-repeat; |
| | | // width: 100%; height: 100%; |
| | | // border: none; |
| | | // height: 33px; |
| | | // background-size:100% 100%` |
| | | // ); |
| | | select.value.$el.children[0].children[0].setAttribute( |
| | | "style", |
| | | `background: url(${obj.url}) no-repeat; |
| | | `background-image: linear-gradient(to right,${obj.domCss}); |
| | | width: 100%; height: 100%; |
| | | border: none; |
| | | height: 33px; |
| | | background-size:100% 100%` |
| | | height: 33px;` |
| | | ); |
| | | select.value.$el.children[0].children[0].children[0].setAttribute( |
| | | "style", |
| | |
| | | // let aa = stretchOptions[index]; |
| | | // let value = aa.value; |
| | | // if (brand === value) { |
| | | // console.log(select.value.$el.children); |
| | | |
| | | // select.value.$el.children[0].children[0].setAttribute( |
| | | // "style", |
| | | // "background:url(" + |
| | |
| | | server.layerList[layerLength.value].layerData.alpha = val / 100; |
| | | }; |
| | | const contrastChange = (val) => { |
| | | server.layerList[layerLength.value].layerData.alpha = val / 100; |
| | | server.layerList[layerLength.value].layerData.contrast = val; |
| | | }; |
| | | let diaphaneityShow = ref(false); |
| | | let contrastShow = ref(false); |
| | | let drawingModeShow = ref(false); |
| | | let colorShow = ref(false); |
| | | //判断类型显示 |
| | | const typeDisplay = (val) => { |
| | | if ( |
| | | val.data == 1 || |
| | | val.data == 3 || |
| | | val.data == 4 || |
| | | val.data == 5 || |
| | | val.data == 6 || |
| | | val.data == 7 || |
| | | val.data == 8 |
| | | ) { |
| | | diaphaneityShow.value = true; |
| | | } |
| | | if ( |
| | | val.data == 1 || |
| | | val.data == 3 || |
| | | val.data == 4 || |
| | | val.data == 5 || |
| | | val.data == 6 |
| | | ) { |
| | | contrastShow.value = true; |
| | | drawingModeShow.value = true; |
| | | } |
| | | if (val.data == 3 || val.data == 4) { |
| | | colorShow.value = true; |
| | | } |
| | | }; |
| | | //拉伸选择 |
| | | const stretchChange = (val) => { |
| | | console.log(val); |
| | | if (val == 0) { |
| | | stretchNumShow.value = false; |
| | | stretchNum.value = 0; |
| | | stretchMin.value = 0; |
| | | stretchMax.value = 0; |
| | | } else if (val == 1) { |
| | | stretchNumShow.value = true; |
| | | //1 线性拉伸 |
| | | stretchNum.value = 0.02; |
| | | stretchMin.value = 0; |
| | | stretchMax.value = 0.05; |
| | | } else if (val == 2) { |
| | | stretchNumShow.value = false; |
| | | //1 直方图均衡 |
| | | stretchNum.value = 0; |
| | | stretchMin.value = 0; |
| | | stretchMax.value = 0; |
| | | } else if (val == 3) { |
| | | stretchNumShow.value = true; |
| | | //1 标准差拉伸 |
| | | stretchNum.value = 0.02; |
| | | stretchMin.value = 0; |
| | | stretchMax.value = 0.05; |
| | | } else if (val == 4) { |
| | | stretchNumShow.value = true; |
| | | //1 伽马拉伸 |
| | | stretchNum.value = 0.6; |
| | | stretchMin.value = 0.1; |
| | | stretchMax.value = 1.6; |
| | | } |
| | | }; |
| | | const stretchNumChange = (val) => {}; |
| | | onMounted(() => { |
| | | typeDisplay(props.layerData); |
| | | server.layerList.forEach((e, i) => { |
| | | if (props.layerData.id == e.id) { |
| | | if (props.layerData.id == e.id && e.layerData) { |
| | | layerLength.value = i; |
| | | transparence.value = e.layerData.alpha * 100; |
| | | } |
| | | }); |
| | | }); |
| | | getColorJson(); |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .content { |
| | | background: #1e2a3d; |
| | | padding: 20px; |
| | | height: 400px; |
| | | // height: 400px; |
| | | margin-left: 20px; |
| | | margin-top: 40px; |
| | | min-width: 200px; |
| | | z-index: 30; |
| | | z-index: 40; |
| | | position: absolute; |
| | | .title { |
| | | font-size: 18px; |
| | |
| | | /deep/.el-select-dropdown__item { |
| | | font-size: 12px !important; |
| | | } |
| | | .stretchSelect { |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | .stretchSelect { |
| | | width: 100%; |
| | | } |
| | | .imgSelect { |
| | | width: 60%; |
| | | } |
| | | span { |
| | | color: #fff; |
| | | margin: 0 10px; |
| | | } |
| | | .stretchNum { |
| | | width: 30%; |
| | | } |
| | | } |
| | | </style> |