|
@@ -1,61 +1,155 @@
|
|
<template>
|
|
<template>
|
|
- <div class="box">
|
|
|
|
- <el-card class="box-card">
|
|
|
|
- <div slot="header" class="clearfix">
|
|
|
|
- <span>集成方式</span>
|
|
|
|
|
|
+ <el-container>
|
|
|
|
+ <el-row class="first_level_title">集成方式和步骤</el-row>
|
|
|
|
+ <el-row
|
|
|
|
+ class="first_text"
|
|
|
|
+ v-for="(item, index) in content.way"
|
|
|
|
+ :key="index"
|
|
|
|
+ >
|
|
|
|
+ <el-col class="text"> {{ index + 1 }}. {{ item.text }} </el-col>
|
|
|
|
+ <div v-if="item.children">
|
|
|
|
+ <el-row
|
|
|
|
+ class="second_text"
|
|
|
|
+ v-for="(item_, index_) in item.children"
|
|
|
|
+ :key="index_"
|
|
|
|
+ >
|
|
|
|
+ <el-col class="text"> {{ index_ + 1 }}). {{ item_ }} </el-col>
|
|
|
|
+ </el-row>
|
|
</div>
|
|
</div>
|
|
- <div>
|
|
|
|
- 图形绘制工具通过iframe引入。
|
|
|
|
- </div>
|
|
|
|
- </el-card>
|
|
|
|
- <el-card class="box-card">
|
|
|
|
- <div slot="header" class="clearfix">
|
|
|
|
- <span>集成操作步骤</span>
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- <el-tabs v-model="activeName">
|
|
|
|
- <el-tab-pane label="图形绘制工具" name="second"
|
|
|
|
- >1、在页面创建一个iframe标签,src对应的是draw工具包的index.html页面。 例:
|
|
|
|
- <p class="code">{{ code3 }}</p></el-tab-pane
|
|
|
|
- >
|
|
|
|
- </el-tabs>
|
|
|
|
- </div>
|
|
|
|
- </el-card>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
|
|
+ </el-row>
|
|
|
|
+
|
|
|
|
+ <el-row class="first_level_title">方法说明</el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col class="text"> {{ content.methods.text }} </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <div v-for="(item, index) in content.methods.methods" :key="index">
|
|
|
|
+ <el-row class="text">{{ index + 1 }}. {{ item.text }} </el-row>
|
|
|
|
+ <el-row v-if="item.param != undefined">
|
|
|
|
+ <el-row class="text">参数说明:</el-row>
|
|
|
|
+ <el-table :data="item.param" border style="width: 70%">
|
|
|
|
+ <el-table-column prop="name" label="字段名称"> </el-table-column>
|
|
|
|
+ <el-table-column prop="explain" label="说明"> </el-table-column>
|
|
|
|
+ <el-table-column prop="type" label="字段类型"> </el-table-column>
|
|
|
|
+ <el-table-column prop="must" label="是否必传"> </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row v-if="item.example != undefined">
|
|
|
|
+ <el-row class="text">{{ item.example.title }}</el-row>
|
|
|
|
+ <el-row
|
|
|
|
+ class="text second_text"
|
|
|
|
+ v-for="(str1, index1) in item.example.arr"
|
|
|
|
+ :key="index1"
|
|
|
|
+ >{{ index1 + 1 }}). {{ str1 }}</el-row
|
|
|
|
+ >
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row v-if="item.table != undefined">
|
|
|
|
+ <el-row class="text">参数说明:</el-row>
|
|
|
|
+ <el-table :data="item.table" border style="width: 70%">
|
|
|
|
+ <el-table-column prop="name" label="字段名称"> </el-table-column>
|
|
|
|
+ <el-table-column prop="explain" label="说明"> </el-table-column>
|
|
|
|
+ <el-table-column prop="type" label="字段类型"> </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="text" v-if="item.attention != undefined">
|
|
|
|
+ {{ item.attention }}
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+ <el-row class="first_level_title">注意事项</el-row>
|
|
|
|
+ <el-row v-for="(str, index) in content.attention" :key="index">
|
|
|
|
+ <el-col class="text"> {{ index + 1 }}. {{ str }} </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="first_level_title">效果展示</el-row>
|
|
|
|
+ <el-carousel height="550px">
|
|
|
|
+ <el-carousel-item v-for="(item, index) in imageArr" :key="index">
|
|
|
|
+ <el-image :src="item.image" :preview-src-list="item.srcList"></el-image>
|
|
|
|
+ </el-carousel-item>
|
|
|
|
+ </el-carousel>
|
|
|
|
+ </el-container>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-// 图形绘制工具集成说明
|
|
|
|
|
|
+import showImg1 from "@/assets/images/SecondaryDevelopment/graphic.jpg";
|
|
|
|
+// 测量工具集成说明
|
|
export default {
|
|
export default {
|
|
name: "",
|
|
name: "",
|
|
components: {},
|
|
components: {},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- activeName: "second",
|
|
|
|
- code1: `<iframe
|
|
|
|
- src="./static/package/collectdata/dist/index.html"
|
|
|
|
- frameborder="0"
|
|
|
|
- ></iframe>`,
|
|
|
|
- code2: `<iframe
|
|
|
|
- src="./static/package/collectdata/dist/index.html?type=1"
|
|
|
|
- frameborder="0"
|
|
|
|
- ></iframe>
|
|
|
|
- <iframe src="./static/package/collectdata/dist/index.html?type=2" frameborder="0"></iframe>`,
|
|
|
|
- code3: `<iframe
|
|
|
|
- src="./static/package/draw/dist/index.html"
|
|
|
|
- frameborder="0"
|
|
|
|
- ></iframe>`,
|
|
|
|
- code4: `let map = new Map({
|
|
|
|
- target: "map",
|
|
|
|
- logo: false,
|
|
|
|
- controls: defaults({ attribution: false, zoom: false, rotate: false, }),
|
|
|
|
- view: view,
|
|
|
|
- });
|
|
|
|
- globalVariable.map = map; `,
|
|
|
|
- code5: `import measureTool from"@/utils/ol_plugins/measure";
|
|
|
|
- this.measure = new measureTool(globalVariable.map);`,
|
|
|
|
- code6: `this.measure.start("line");
|
|
|
|
- this.measure.start("area");`
|
|
|
|
|
|
+ imageArr: [
|
|
|
|
+ {
|
|
|
|
+ image: showImg1,
|
|
|
|
+ srcList: [showImg1],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ content: {
|
|
|
|
+ // 集成方式和步骤
|
|
|
|
+ way: [
|
|
|
|
+ { text: "在html页面中使用iframe标签加载插件" },
|
|
|
|
+ // {
|
|
|
|
+ // text: "在填写iframe的src属性时,url不拼接参数时,不触发任何绘制事件;",
|
|
|
|
+ // children: [
|
|
|
|
+ // "当拼接参数type=1,开启绘制单点;",
|
|
|
|
+ // "当拼接参数type=2,开启绘制线(注:绘制线段时,支持 鼠标左键双击 / 鼠标右键单击 结束当前线段绘制)",
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ ],
|
|
|
|
+ // 方法说明
|
|
|
|
+ methods: {
|
|
|
|
+ text: '插件对外暴露三个接口,分别为showCoordinates,clear,getCoordinates。 接口调用示例:document.querySelector("iframe").contentWindow.clear()',
|
|
|
|
+ methods: [
|
|
|
|
+ {
|
|
|
|
+ text: "通过showCoordinates接口,可以将需要展示的图形传入插件页面中",
|
|
|
|
+ param: [
|
|
|
|
+ {
|
|
|
|
+ name: "type",
|
|
|
|
+ explain:
|
|
|
|
+ "传入的图形类型(点,多点,线,多线,面,多面分别对应1,2,3,4,5,6)",
|
|
|
|
+ type: "Number",
|
|
|
|
+ must: "是",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: "data",
|
|
|
|
+ explain: "传入的数据",
|
|
|
|
+ type: "Array",
|
|
|
|
+ must: "是",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ example: {
|
|
|
|
+ title: "调用示例:",
|
|
|
|
+ arr: [
|
|
|
|
+ "点: showCoordinates(1,[99.228515625,40.8802948055282])",
|
|
|
|
+ "多点:showCoordinates(2,[[99.228515625,40.88029480552824], [103.4912109375,40.613952441166596]])",
|
|
|
|
+ "线:showCoordinates(3, [[110.12695312499999,43.45291889355465],[107.841796875,37.75334401310656],[102.87597656249999,39.40224434029275]])",
|
|
|
|
+ "多线:showCoordinates(4,[[[110.12695312499999,43.45291889355465],[107.841796875,37.75334401310656],[102.87597656249999,39.40224434029275]],[[108.80859375,37.125286284966805],[102.6123046875,34.30714385628804],[101.337890625,37.23032838760387]]])",
|
|
|
|
+ "面:showCoordinates(5,[[[95.4052734375,45.767522962149876],[96.50390625,38.03078569382294],[101.953125,39.53793974517628],[ 95.4052734375,45.767522962149876]]])",
|
|
|
|
+ "多面:showCoordinates(6,[[[[95.4052734375,45.767522962149876],[96.50390625,38.03078569382294],[101.953125,39.53793974517628],[ 95.4052734375,45.767522962149876]]],[[[103.5791015625,35.71083783530009],[103.974609375,33.394759218577995],[108.984375,33.687781758439364],[108.5888671875,35.92464453144099],[103.5791015625,35.71083783530009]]]])",
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: "通过clear接口,可以将插件页面中当前展示的所有图形清空",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: "通过getCoordinates,可以获取当前插件页面中所有图形坐标",
|
|
|
|
+ example: {
|
|
|
|
+ title: "返回值示例:",
|
|
|
|
+ arr: [
|
|
|
|
+ '{"Polygon":[[[[111.94379253608167,40.71990869432818],[110.64740581733167,39.340371922695],[114.54755230170667,39.382842797308086],[114.36078472358167,40.2016580607922],[111.94379253608167,40.71990869432818]]],[[[116.36029644233166,39.71322862173966],[116.48114605170667,39.340371922695],[114.93207378608167,40.117695055586466],[116.36029644233166,39.71322862173966]]]],"LineString":[[[110.60346050483169,41.80174316976357],[115.42645855170667,41.54735592368354]],[[111.85590191108167,41.20109945851664],[117.66766948920667,41.18456509404331]]],"Point":[[111.02094097358169,42.78503973104256],[114.60248394233167,42.67205558513024]]}',
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ // 效果展示
|
|
|
|
+ effect: "",
|
|
|
|
+ // 注意事项
|
|
|
|
+ attention: [
|
|
|
|
+ "请当iframe加载后再调用各类方法",
|
|
|
|
+ "触发编辑功能时,绘制和选择功能会被强制退出",
|
|
|
|
+ "绘制时,无法选择和编辑",
|
|
|
|
+ "在绘制和编辑功能都退出时,可选择图形,点击图形单独选中,按住shift键后再点击图形可进行多选操作",
|
|
|
|
+ "删除功能规则:当前已有选择的图形时,仅删除已选择的图形;若当前没有选择图形,则删除地图中所有图形",
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
@@ -63,43 +157,39 @@ export default {
|
|
methods: {},
|
|
methods: {},
|
|
|
|
|
|
computed: {},
|
|
computed: {},
|
|
- watch: {}
|
|
|
|
|
|
+ watch: {},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
-.box {
|
|
|
|
- display: flex;
|
|
|
|
- justify-content: space-around;
|
|
|
|
- align-items: center;
|
|
|
|
- align-content: center;
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
- .box-card {
|
|
|
|
- width: calc(50% - 15px);
|
|
|
|
- height: calc(100vh - 400px);
|
|
|
|
- font-size: 18px;
|
|
|
|
- font-family: Microsoft YaHei;
|
|
|
|
- font-weight: 400;
|
|
|
|
- color: #4c4c4c;
|
|
|
|
- line-height: 24px;
|
|
|
|
- div:nth-child(1) {
|
|
|
|
- font-weight: bold;
|
|
|
|
- }
|
|
|
|
- .clearfix span {
|
|
|
|
- font-size: 20px;
|
|
|
|
- font-family: Microsoft YaHei;
|
|
|
|
- font-weight: bold;
|
|
|
|
- color: #258df5;
|
|
|
|
- line-height: 40px;
|
|
|
|
- }
|
|
|
|
- .code {
|
|
|
|
- text-indent: 36px;
|
|
|
|
- font-size: 18px;
|
|
|
|
- font-family: Microsoft YaHei;
|
|
|
|
- font-weight: 400;
|
|
|
|
- color: #808080;
|
|
|
|
- line-height: 32px;
|
|
|
|
|
|
+.el-container {
|
|
|
|
+ display: block;
|
|
|
|
+ width: 100%;
|
|
|
|
+ padding: 10px 20px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ background: #ffffff;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ .el-row {
|
|
|
|
+ line-height: 40px;
|
|
|
|
+ &::before {
|
|
|
|
+ display: unset;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .first_level_title {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .text {
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ .second_text {
|
|
|
|
+ text-indent: 20px;
|
|
|
|
+ }
|
|
|
|
+ .el-table {
|
|
|
|
+ line-height: 23px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|