@mapgis/mapgis-pan-spatial-map-widgets-config-ui 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +3 -0
- package/.env.production +5 -0
- package/.eslintignore +5 -0
- package/.eslintrc.js +18 -0
- package/README.md +24 -0
- package/babel.config.js +5 -0
- package/dist-libs/demo.html +10 -0
- package/dist-libs/fonts/ionicons.99ac3308.woff +0 -0
- package/dist-libs/fonts/ionicons.d535a25a.ttf +0 -0
- package/dist-libs/img/iconfont.573255ce.svg +36 -0
- package/dist-libs/img/image-icon.dd06d30b.dd06d30b.png +0 -0
- package/dist-libs/img/ionicons.17bf2ac0.svg +870 -0
- package/dist-libs/img/jsoneditor-icons.2b9b4872.2b9b4872.svg +749 -0
- package/dist-libs/img/plus.bdc6b5b1.bdc6b5b1.svg +1 -0
- package/dist-libs/img/text-icon.dd1b3d87.dd1b3d87.png +0 -0
- package/dist-libs/img/video-icon.499ddeb4.499ddeb4.png +0 -0
- package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.common.js +33467 -0
- package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.css +6 -0
- package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.umd.js +33477 -0
- package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.umd.min.js +1183 -0
- package/docs/.vuepress/config.js +81 -0
- package/docs/.vuepress/public/favicon.ico +0 -0
- package/docs/.vuepress/public/logo.svg +7 -0
- package/docs/.vuepress/styles/palette.styl +1 -0
- package/docs/README.md +35 -0
- package/docs/api/common/MultiImgWithForm.md +87 -0
- package/docs/api/common/MultiTypeForm.md +113 -0
- package/docs/api/images/basemapConfigUI.png +0 -0
- package/docs/api/images/comprehensiveQueryConfigUI.png +0 -0
- package/docs/guide/README.md +42 -0
- package/docs/guide/publish.md +84 -0
- package/docs/guide/yarn/mapgis.png +0 -0
- package/docs/guide/yarn/use_mapgis.png +0 -0
- package/package.json +58 -0
- package/postcss.config.js +5 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/api/app/config.js +10 -0
- package/src/assets/iviewIcon/fonts/ionicons.svg +870 -0
- package/src/assets/iviewIcon/fonts/ionicons.ttf +0 -0
- package/src/assets/iviewIcon/fonts/ionicons.woff +0 -0
- package/src/assets/iviewIcon/iview.css +3461 -0
- package/src/assets/logo.png +0 -0
- package/src/components/BasemapManagerSetting/BasemapManagerSetting.vue +461 -0
- package/src/components/CityGrowSetting/CityGrowSetting.vue +145 -0
- package/src/components/CityGrowSetting/EditableCell.vue +103 -0
- package/src/components/CommonComponents/MultiImgWithForm/MultiImgWithForm.scss +106 -0
- package/src/components/CommonComponents/MultiImgWithForm/MultiImgWithForm.vue +128 -0
- package/src/components/CommonComponents/MultiTypeForm/MultiTypeForm.vue +78 -0
- package/src/components/CommonComponents/ServiceSelect/index.vue +325 -0
- package/src/components/ComprehensiveQuerySetting/ComprehensiveQuerySetting.vue +745 -0
- package/src/components/ComprehensiveQuerySetting/EditAttrs.vue +254 -0
- package/src/components/DataCatalogSetting/DataCatalogSetting.vue +71 -0
- package/src/components/DataCatalogSetting/components/DataSetting.vue +126 -0
- package/src/components/DataCatalogSetting/components/IconSetting.vue +160 -0
- package/src/components/DataCatalogSetting/components/NoSpatialSetting.vue +37 -0
- package/src/components/DataCatalogSetting/components/OtherSetting.vue +54 -0
- package/src/components/DataCatalogSetting/components/ParamSetting.vue +95 -0
- package/src/components/DataCatalogSetting/components/component/DataSourceSetting.vue +929 -0
- package/src/components/DataCatalogSetting/components/component/NodeDataSetting.vue +644 -0
- package/src/components/DataCatalogSetting/components/component/ServiceSelectWithData.vue +413 -0
- package/src/components/DataCatalogSetting/index.js +29 -0
- package/src/components/FeatureQuerySetting/FeatureQuerySetting.vue +121 -0
- package/src/components/KibanaVSetting/KibanaVSetting.vue +152 -0
- package/src/components/LegendSetting/LegendSetting.vue +85 -0
- package/src/components/MapDataVSetting/MapDataVSetting.vue +41 -0
- package/src/components/OverlayManagerSetting/OverlayManagerSetting.vue +248 -0
- package/src/components/ParticleEffectsSetting/ParticleEffectsSetting.vue +166 -0
- package/src/components/PlotManagerSetting/EditableCell.vue +103 -0
- package/src/components/PlotManagerSetting/PlotManagerSetting.vue +229 -0
- package/src/components/ThematicMapSetting/BaseConfigSetting.vue +76 -0
- package/src/components/ThematicMapSetting/SubjectConfigSetting.vue +346 -0
- package/src/components/ThematicMapSetting/ThematicMapSetting.vue +44 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/common/AnimationItems.vue +141 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/common/ColorPickerSetting.vue +260 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/common/EditableFieldTable.vue +187 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/BaseItems/index.vue +161 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/AttributeTable.vue +122 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/Common.vue +376 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/Popup.vue +138 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/StatisticGragh.vue +189 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/BaseMapWithGraph.vue +73 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/HeatMap.vue +124 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/HexBin.vue +100 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/Label.vue +139 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/StatisticLabel.vue +43 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/SubSectionMap.vue +42 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/index.vue +56 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/index.less +101 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/index.vue +236 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/index.less +22 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/index.vue +226 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/mixins/subject-styles-mixin.js +138 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/store/dep.js +21 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/store/fields.ts +111 -0
- package/src/components/ThematicMapSetting/ThematicMapSubjectList/index.vue +76 -0
- package/src/components/ThematicMapSetting/store/index.js +19 -0
- package/src/components/ThematicMapSetting/store/module/getters.js +28 -0
- package/src/components/ThematicMapSetting/store/module/index.js +53 -0
- package/src/components/ThematicMapSetting/store/module/mutations.js +272 -0
- package/src/components/ThematicMapSetting/store/module/state.js +36 -0
- package/src/components/ThematicMapSetting/store/types.js +0 -0
- package/src/components/WidgetSetting/WidgetJsonConfig.vue +28 -0
- package/src/components/WidgetSetting/components/JsonEditor/index.vue +77 -0
- package/src/components/WidgetSetting/widget-setting-mixin.js +22 -0
- package/src/components/index.js +17 -0
- package/src/index.js +63 -0
- package/src/shims-tsx.d.ts +13 -0
- package/src/shims-vue.d.ts +4 -0
- package/src/store/index.ts +15 -0
- package/src/utils/auth.js +18 -0
- package/src/utils/normal-request.js +63 -0
- package/src/utils/request.js +92 -0
- package/src/utils/settings.js +50 -0
- package/src/utils/uuid.js +17 -0
- package/src/utils/validate.js +175 -0
- package/tsconfig.json +40 -0
- package/vue.config.js +13 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dialog">
|
|
3
|
+
<mapgis-ui-form layout="horizontal" :labelCol="{span:2}" :wrapperCol="{span:22}">
|
|
4
|
+
<mapgis-ui-form-item label="节点名称">
|
|
5
|
+
<mapgis-ui-input
|
|
6
|
+
v-model="widgetConfig.name"
|
|
7
|
+
/>
|
|
8
|
+
</mapgis-ui-form-item>
|
|
9
|
+
<mapgis-ui-form-item label="图例">
|
|
10
|
+
<mapgis-ui-input
|
|
11
|
+
v-model="widgetConfig.path"
|
|
12
|
+
placeholder="请上传图例"
|
|
13
|
+
disabled
|
|
14
|
+
>
|
|
15
|
+
<mapgis-ui-upload
|
|
16
|
+
slot="suffix"
|
|
17
|
+
:action="imagesUploadApi"
|
|
18
|
+
:showUploadList="false"
|
|
19
|
+
:withCredentials="true"
|
|
20
|
+
accept=".bmp, .dib, .pcp, .dif, .wmf, .gif, .jpg, .tif, .eps, .psd, .cdr, .iff, .tga, .pcd, .mpt, .png, .jpeg"
|
|
21
|
+
@change="imgUploadChange"
|
|
22
|
+
>
|
|
23
|
+
<mapgis-ui-button type="link" icon="cloud-upload">
|
|
24
|
+
<!-- <mapgis-ui-iconfont type="mapgis-tujiatupian"/> -->
|
|
25
|
+
上传图片
|
|
26
|
+
</mapgis-ui-button>
|
|
27
|
+
</mapgis-ui-upload>
|
|
28
|
+
</mapgis-ui-input>
|
|
29
|
+
<img
|
|
30
|
+
class="image"
|
|
31
|
+
:src="baseApi + widgetConfig.path"
|
|
32
|
+
/>
|
|
33
|
+
</mapgis-ui-form-item>
|
|
34
|
+
</mapgis-ui-form>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
const baseUrl =
|
|
40
|
+
process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_BASE_API
|
|
41
|
+
|
|
42
|
+
import WidgetSettingMixin from '../WidgetSetting/widget-setting-mixin'
|
|
43
|
+
export default {
|
|
44
|
+
name: 'LegendSetting',
|
|
45
|
+
mixins: [WidgetSettingMixin],
|
|
46
|
+
data() {
|
|
47
|
+
return {
|
|
48
|
+
baseApi: baseUrl,
|
|
49
|
+
imagesUploadApi: baseUrl + '/api/local-storage/pictures',
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
methods: {
|
|
53
|
+
imgUploadChange (result) {
|
|
54
|
+
if (result.file.status === 'done') {
|
|
55
|
+
this.widgetConfig.path = result.file.response.url
|
|
56
|
+
this.$forceUpdate()
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* 验证当前widgetConfig是否合法,返回false则不合法,不可保存
|
|
61
|
+
*/
|
|
62
|
+
checkConfig() {
|
|
63
|
+
let result = true
|
|
64
|
+
if (this.widgetConfig.name === '' || this.widgetConfig.path === '') {
|
|
65
|
+
result = false
|
|
66
|
+
this.$message.error('表单项不能为空!')
|
|
67
|
+
}
|
|
68
|
+
return result
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style scoped>
|
|
75
|
+
.dialog {
|
|
76
|
+
margin: 16px 0;
|
|
77
|
+
}
|
|
78
|
+
.image {
|
|
79
|
+
height: 250px;
|
|
80
|
+
object-fit: scale-down;
|
|
81
|
+
}
|
|
82
|
+
.mapgis-ui-btn:focus, .mapgis-ui-btn:hover {
|
|
83
|
+
background-color: #fff0;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dialog">
|
|
3
|
+
<mapgis-ui-form layout="horizontal" :labelCol="{span:2}" :wrapperCol="{span:22}">
|
|
4
|
+
<mapgis-ui-form-item label="url">
|
|
5
|
+
<mapgis-ui-input
|
|
6
|
+
v-model="widgetConfig.url"
|
|
7
|
+
/>
|
|
8
|
+
</mapgis-ui-form-item>
|
|
9
|
+
</mapgis-ui-form>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import WidgetSettingMixin from '../WidgetSetting/widget-setting-mixin'
|
|
15
|
+
export default {
|
|
16
|
+
name: 'MapDataVSetting',
|
|
17
|
+
mixins: [WidgetSettingMixin],
|
|
18
|
+
data() {
|
|
19
|
+
return {}
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
/**
|
|
23
|
+
* 验证当前widgetConfig是否合法,返回false则不合法,不可保存
|
|
24
|
+
*/
|
|
25
|
+
checkConfig() {
|
|
26
|
+
let result = true
|
|
27
|
+
if (this.widgetConfig.url === '') {
|
|
28
|
+
result = false
|
|
29
|
+
this.$message.error('表单项不能为空!')
|
|
30
|
+
}
|
|
31
|
+
return result
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
.dialog {
|
|
39
|
+
margin: 16px 0;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dialog">
|
|
3
|
+
<mapgis-ui-button class="button" @click="addCat" :disabled="showDelIcon"
|
|
4
|
+
>添加分类</mapgis-ui-button
|
|
5
|
+
>
|
|
6
|
+
<mapgis-ui-button
|
|
7
|
+
class="button"
|
|
8
|
+
:style="{
|
|
9
|
+
marginLeft: '20px',
|
|
10
|
+
}"
|
|
11
|
+
@click="delCat"
|
|
12
|
+
>{{ showDelIcon ? "删除完成" : "删除分类" }}</mapgis-ui-button
|
|
13
|
+
>
|
|
14
|
+
<mapgis-ui-tabs @change="callback" v-model="currentTag">
|
|
15
|
+
<mapgis-ui-tab-pane v-for="(item, index) in modelConfig" :key="index">
|
|
16
|
+
<span slot="tab" v-if="showDelIcon">
|
|
17
|
+
<mapgis-ui-iconfont type="mapgis-delete" class="editable-cell-icon" />
|
|
18
|
+
{{ index }}
|
|
19
|
+
</span>
|
|
20
|
+
<span slot="tab" v-else>
|
|
21
|
+
{{ index }}
|
|
22
|
+
</span>
|
|
23
|
+
<multi-img-with-form
|
|
24
|
+
ref="multiImgWithForm"
|
|
25
|
+
:config="item"
|
|
26
|
+
TitleLabel="name"
|
|
27
|
+
ImgLabel="img"
|
|
28
|
+
:baseApi="baseApi"
|
|
29
|
+
:imgWidth="120"
|
|
30
|
+
:imgHeight="120"
|
|
31
|
+
@editItem="editItem"
|
|
32
|
+
@addItem="addItem"
|
|
33
|
+
/></mapgis-ui-tab-pane>
|
|
34
|
+
</mapgis-ui-tabs>
|
|
35
|
+
<mapgis-ui-modal
|
|
36
|
+
v-model="showModal"
|
|
37
|
+
:title="modalTitle"
|
|
38
|
+
:width="700"
|
|
39
|
+
:dialog-style="{ top: '192px' }"
|
|
40
|
+
okText="确定"
|
|
41
|
+
cancelText="取消"
|
|
42
|
+
@ok="handleOk"
|
|
43
|
+
>
|
|
44
|
+
<mapgis-ui-form
|
|
45
|
+
layout="horizontal"
|
|
46
|
+
:labelCol="{ span: 4 }"
|
|
47
|
+
:wrapperCol="{ span: 20 }"
|
|
48
|
+
>
|
|
49
|
+
<mapgis-ui-form-item label="名称">
|
|
50
|
+
<mapgis-ui-input v-model="item.name" />
|
|
51
|
+
</mapgis-ui-form-item>
|
|
52
|
+
<mapgis-ui-form-item label="比例">
|
|
53
|
+
<mapgis-ui-input v-model="item.scale" />
|
|
54
|
+
</mapgis-ui-form-item>
|
|
55
|
+
<mapgis-ui-form-item label="模型">
|
|
56
|
+
<mapgis-ui-input v-model="item.model">
|
|
57
|
+
<mapgis-ui-upload
|
|
58
|
+
slot="suffix"
|
|
59
|
+
:headers="headers"
|
|
60
|
+
:before-upload="beforeUpload"
|
|
61
|
+
:action="fileUploadApi"
|
|
62
|
+
:showUploadList="false"
|
|
63
|
+
:withCredentials="true"
|
|
64
|
+
@change="glfUploadChange"
|
|
65
|
+
>
|
|
66
|
+
<mapgis-ui-button type="link" icon="cloud-upload">
|
|
67
|
+
上传模型
|
|
68
|
+
</mapgis-ui-button>
|
|
69
|
+
</mapgis-ui-upload>
|
|
70
|
+
</mapgis-ui-input>
|
|
71
|
+
</mapgis-ui-form-item>
|
|
72
|
+
<mapgis-ui-form-item label="缩略图">
|
|
73
|
+
<mapgis-ui-input
|
|
74
|
+
v-model="item.img"
|
|
75
|
+
placeholder="请上传缩略图"
|
|
76
|
+
disabled
|
|
77
|
+
>
|
|
78
|
+
<mapgis-ui-upload
|
|
79
|
+
slot="suffix"
|
|
80
|
+
:action="imagesUploadApi"
|
|
81
|
+
:showUploadList="false"
|
|
82
|
+
:withCredentials="true"
|
|
83
|
+
accept=".bmp, .dib, .pcp, .dif, .wmf, .gif, .jpg, .tif, .eps, .psd, .cdr, .iff, .tga, .pcd, .mpt, .png, .jpeg"
|
|
84
|
+
@change="imgUploadChange"
|
|
85
|
+
>
|
|
86
|
+
<mapgis-ui-button type="link" icon="cloud-upload">
|
|
87
|
+
<!-- <mapgis-ui-iconfont type="mapgis-tujiatupian"/> -->
|
|
88
|
+
上传图片
|
|
89
|
+
</mapgis-ui-button>
|
|
90
|
+
</mapgis-ui-upload>
|
|
91
|
+
</mapgis-ui-input>
|
|
92
|
+
<img
|
|
93
|
+
v-show="item.image !== ''"
|
|
94
|
+
class="image"
|
|
95
|
+
:src="baseApi + item.img"
|
|
96
|
+
/>
|
|
97
|
+
</mapgis-ui-form-item>
|
|
98
|
+
</mapgis-ui-form>
|
|
99
|
+
</mapgis-ui-modal>
|
|
100
|
+
<mapgis-ui-modal
|
|
101
|
+
v-model="showAddCatModal"
|
|
102
|
+
title="添加分类"
|
|
103
|
+
:width="450"
|
|
104
|
+
:dialog-style="{ top: '100px' }"
|
|
105
|
+
okText="确定"
|
|
106
|
+
cancelText="取消"
|
|
107
|
+
@ok="handleCatOk"
|
|
108
|
+
>
|
|
109
|
+
<mapgis-ui-form
|
|
110
|
+
layout="horizontal"
|
|
111
|
+
:labelCol="{ span: 4 }"
|
|
112
|
+
:wrapperCol="{ span: 20 }"
|
|
113
|
+
>
|
|
114
|
+
<mapgis-ui-form-item label="名称">
|
|
115
|
+
<mapgis-ui-input v-model="addCatName" />
|
|
116
|
+
</mapgis-ui-form-item>
|
|
117
|
+
</mapgis-ui-form>
|
|
118
|
+
</mapgis-ui-modal>
|
|
119
|
+
</div>
|
|
120
|
+
</template>
|
|
121
|
+
<script>
|
|
122
|
+
const baseUrl =
|
|
123
|
+
process.env.VUE_APP_BASE_API === "/" ? "" : process.env.VUE_APP_BASE_API;
|
|
124
|
+
import WidgetSettingMixin from "../WidgetSetting/widget-setting-mixin";
|
|
125
|
+
import MultiImgWithForm from "../CommonComponents/MultiImgWithForm/MultiImgWithForm";
|
|
126
|
+
import reqwest from "reqwest";
|
|
127
|
+
import { getToken } from "@/utils/auth";
|
|
128
|
+
|
|
129
|
+
export default {
|
|
130
|
+
name: "OverlayManagerSetting",
|
|
131
|
+
mixins: [WidgetSettingMixin],
|
|
132
|
+
props: {},
|
|
133
|
+
components: { MultiImgWithForm },
|
|
134
|
+
data() {
|
|
135
|
+
return {
|
|
136
|
+
headers: { Authorization: getToken() },
|
|
137
|
+
baseApi: baseUrl,
|
|
138
|
+
modelConfig: "",
|
|
139
|
+
editIndex: -1,
|
|
140
|
+
modalTitle: "编辑节点",
|
|
141
|
+
showModal: false,
|
|
142
|
+
showDelIcon: false,
|
|
143
|
+
addCatName: "",
|
|
144
|
+
showAddCatModal: false,
|
|
145
|
+
fileList: [],
|
|
146
|
+
currentTag: Object.keys(this.widgetConfig.models)[0],
|
|
147
|
+
imagesUploadApi: baseUrl + "/api/local-storage/pictures",
|
|
148
|
+
fileUploadApi: baseUrl + "/api/local-storage",
|
|
149
|
+
item: {
|
|
150
|
+
name: "",
|
|
151
|
+
model: "",
|
|
152
|
+
scale: "",
|
|
153
|
+
img: "/upload/fire.png",
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
methods: {
|
|
158
|
+
handleRemove() {},
|
|
159
|
+
beforeUpload(file) {
|
|
160
|
+
this.item.model = file.name;
|
|
161
|
+
return true;
|
|
162
|
+
},
|
|
163
|
+
delCat() {
|
|
164
|
+
this.showDelIcon = !this.showDelIcon;
|
|
165
|
+
this.$forceUpdate();
|
|
166
|
+
},
|
|
167
|
+
callback(key) {
|
|
168
|
+
if (this.showDelIcon) {
|
|
169
|
+
this.currentTag = this.recordTag;
|
|
170
|
+
delete this.widgetConfig.models[key];
|
|
171
|
+
this.$forceUpdate();
|
|
172
|
+
}
|
|
173
|
+
if (!this.showDelIcon) {
|
|
174
|
+
this.currentTag = key;
|
|
175
|
+
this.recordTag = `${key}`;
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
getSingleModel() {
|
|
179
|
+
this.modelConfig = this.widgetConfig.models;
|
|
180
|
+
},
|
|
181
|
+
addCat() {
|
|
182
|
+
this.showAddCatModal = true;
|
|
183
|
+
},
|
|
184
|
+
handleCatOk() {
|
|
185
|
+
const name = this.addCatName;
|
|
186
|
+
this.$set(this.widgetConfig.models, name, []);
|
|
187
|
+
this.$forceUpdate();
|
|
188
|
+
this.showAddCatModal = false;
|
|
189
|
+
},
|
|
190
|
+
imgUploadChange(result) {
|
|
191
|
+
if (result.file.status === "done") {
|
|
192
|
+
this.item.img = result.file.response.url;
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
glfUploadChange(result) {
|
|
196
|
+
if (result.file.status === "done") {
|
|
197
|
+
this.item.model = result.file.response.url;
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
addItem() {
|
|
201
|
+
this.showModal = true;
|
|
202
|
+
this.modalTitle = "添加节点";
|
|
203
|
+
this.mode = "add";
|
|
204
|
+
this.item = {
|
|
205
|
+
name: "",
|
|
206
|
+
model: "",
|
|
207
|
+
scale: "",
|
|
208
|
+
img: "/upload/fire.png",
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
editItem(index) {
|
|
212
|
+
this.showModal = true;
|
|
213
|
+
this.modalTitle = "编辑节点";
|
|
214
|
+
this.mode = "edit";
|
|
215
|
+
this.editIndex = index;
|
|
216
|
+
this.item = JSON.parse(
|
|
217
|
+
JSON.stringify(this.modelConfig[this.currentTag][index])
|
|
218
|
+
);
|
|
219
|
+
},
|
|
220
|
+
handleOk() {
|
|
221
|
+
if (this.mode === "edit") {
|
|
222
|
+
this.widgetConfig["models"][this.currentTag][this.editIndex] =
|
|
223
|
+
this.item;
|
|
224
|
+
} else {
|
|
225
|
+
this.widgetConfig["models"][this.currentTag].push(this.item);
|
|
226
|
+
}
|
|
227
|
+
this.$forceUpdate();
|
|
228
|
+
this.showModal = false;
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
created() {
|
|
232
|
+
this.getSingleModel();
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
</script>
|
|
236
|
+
<style scoped>
|
|
237
|
+
.dialog {
|
|
238
|
+
margin: 16px 0;
|
|
239
|
+
}
|
|
240
|
+
.image {
|
|
241
|
+
height: 250px;
|
|
242
|
+
object-fit: scale-down;
|
|
243
|
+
}
|
|
244
|
+
.mapgis-ui-btn:focus,
|
|
245
|
+
.mapgis-ui-btn:hover {
|
|
246
|
+
background-color: #fff0;
|
|
247
|
+
}
|
|
248
|
+
</style>
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dialog">
|
|
3
|
+
<multi-img-with-form
|
|
4
|
+
ref="multiImgWithForm"
|
|
5
|
+
:config="widgetConfig.symbolList"
|
|
6
|
+
TitleLabel="name"
|
|
7
|
+
:baseApi="baseApi"
|
|
8
|
+
:imgWidth="120"
|
|
9
|
+
:imgHeight="120"
|
|
10
|
+
@editItem="editItem"
|
|
11
|
+
@addItem="addItem"
|
|
12
|
+
/>
|
|
13
|
+
<mapgis-ui-modal
|
|
14
|
+
v-model="showModal"
|
|
15
|
+
:title="modalTitle"
|
|
16
|
+
:width="700"
|
|
17
|
+
:dialog-style="{ top: '192px' }"
|
|
18
|
+
okText="确定"
|
|
19
|
+
cancelText="取消"
|
|
20
|
+
@ok="handleOk"
|
|
21
|
+
>
|
|
22
|
+
<mapgis-ui-form
|
|
23
|
+
layout="horizontal"
|
|
24
|
+
:labelCol="{ span: 4 }"
|
|
25
|
+
:wrapperCol="{ span: 20 }"
|
|
26
|
+
>
|
|
27
|
+
<mapgis-ui-form-item label="名称">
|
|
28
|
+
<mapgis-ui-input v-model="item.name" />
|
|
29
|
+
</mapgis-ui-form-item>
|
|
30
|
+
<mapgis-ui-form-item label="数据源">
|
|
31
|
+
<mapgis-ui-input v-model="item.image">
|
|
32
|
+
<mapgis-ui-upload
|
|
33
|
+
slot="suffix"
|
|
34
|
+
:action="imagesUploadApi"
|
|
35
|
+
:showUploadList="false"
|
|
36
|
+
:withCredentials="true"
|
|
37
|
+
accept=".bmp, .dib, .pcp, .dif, .wmf, .gif, .jpg, .tif, .eps, .psd, .cdr, .iff, .tga, .pcd, .mpt, .png, .jpeg"
|
|
38
|
+
@change="imgUploadChange"
|
|
39
|
+
>
|
|
40
|
+
<mapgis-ui-button type="link" icon="cloud-upload">
|
|
41
|
+
<!-- <mapgis-ui-iconfont type="mapgis-tujiatupian"/> -->
|
|
42
|
+
上传图片
|
|
43
|
+
</mapgis-ui-button>
|
|
44
|
+
</mapgis-ui-upload>
|
|
45
|
+
</mapgis-ui-input>
|
|
46
|
+
<img
|
|
47
|
+
v-show="item.image !== ''"
|
|
48
|
+
class="image"
|
|
49
|
+
:src="baseApi + item.image"
|
|
50
|
+
/>
|
|
51
|
+
</mapgis-ui-form-item>
|
|
52
|
+
<mapgis-ui-form-item label="图标">
|
|
53
|
+
<mapgis-ui-input v-model="item.iconUrl"> </mapgis-ui-input>
|
|
54
|
+
<mapgis-ui-iconfont
|
|
55
|
+
v-if="item.iconUrl"
|
|
56
|
+
:type="item.iconUrl"
|
|
57
|
+
:style="{ width: '80px', fontSize: '80px' }"
|
|
58
|
+
/>
|
|
59
|
+
</mapgis-ui-form-item>
|
|
60
|
+
<mapgis-ui-form-item label="基础配置">
|
|
61
|
+
<!-- <mapgis-ui-input v-model="item.iconUrl"> -->
|
|
62
|
+
|
|
63
|
+
<widget-json-config
|
|
64
|
+
:widget-config="item.config"
|
|
65
|
+
ref="widgetJsonConfig"
|
|
66
|
+
></widget-json-config>
|
|
67
|
+
<!-- </mapgis-ui-input> -->
|
|
68
|
+
</mapgis-ui-form-item>
|
|
69
|
+
</mapgis-ui-form>
|
|
70
|
+
</mapgis-ui-modal>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
<script>
|
|
74
|
+
const baseUrl =
|
|
75
|
+
process.env.VUE_APP_BASE_API === "/" ? "" : process.env.VUE_APP_BASE_API;
|
|
76
|
+
import WidgetSettingMixin from "../WidgetSetting/widget-setting-mixin";
|
|
77
|
+
import MultiImgWithForm from "../CommonComponents/MultiImgWithForm/MultiImgWithForm";
|
|
78
|
+
import WidgetJsonConfig from "../WidgetSetting/WidgetJsonConfig";
|
|
79
|
+
|
|
80
|
+
export default {
|
|
81
|
+
name: "ParticleEffectsSetting",
|
|
82
|
+
mixins: [WidgetSettingMixin],
|
|
83
|
+
components: {
|
|
84
|
+
MultiImgWithForm,
|
|
85
|
+
WidgetJsonConfig,
|
|
86
|
+
},
|
|
87
|
+
props: {},
|
|
88
|
+
created() {
|
|
89
|
+
console.log(this.widgetConfig);
|
|
90
|
+
},
|
|
91
|
+
data() {
|
|
92
|
+
return {
|
|
93
|
+
baseApi: baseUrl,
|
|
94
|
+
showModal: false,
|
|
95
|
+
imagesUploadApi: baseUrl + "/api/local-storage/pictures",
|
|
96
|
+
editIndex: -1,
|
|
97
|
+
modalTitle: "编辑节点",
|
|
98
|
+
item: {
|
|
99
|
+
name: "",
|
|
100
|
+
iconUrl: "",
|
|
101
|
+
image: "/upload/fire.png",
|
|
102
|
+
config: {},
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
addItem() {
|
|
108
|
+
this.showModal = true;
|
|
109
|
+
this.modalTitle = "添加节点";
|
|
110
|
+
this.mode = "add";
|
|
111
|
+
this.item = {
|
|
112
|
+
name: "",
|
|
113
|
+
iconUrl: "",
|
|
114
|
+
image: "/upload/fire.png",
|
|
115
|
+
config: {},
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
editItem(index) {
|
|
119
|
+
console.log(index);
|
|
120
|
+
this.showModal = true;
|
|
121
|
+
this.modalTitle = "编辑节点";
|
|
122
|
+
this.mode = "edit";
|
|
123
|
+
this.editIndex = index;
|
|
124
|
+
console.log(this.widgetConfig.symbolList[index]);
|
|
125
|
+
this.item = JSON.parse(
|
|
126
|
+
JSON.stringify(this.widgetConfig.symbolList[index])
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
imgUploadChange(result) {
|
|
130
|
+
if (result.file.status === "done") {
|
|
131
|
+
this.item.image = result.file.response.url;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
handleOk() {
|
|
135
|
+
if (this.mode === "edit") {
|
|
136
|
+
this.widgetConfig.symbolList[this.editIndex] = this.item;
|
|
137
|
+
let config = this.$refs.widgetJsonConfig.getConfig();
|
|
138
|
+
if (typeof config === "string") {
|
|
139
|
+
config = JSON.parse(config);
|
|
140
|
+
}
|
|
141
|
+
this.widgetConfig.symbolList[this.editIndex].config = config;
|
|
142
|
+
|
|
143
|
+
// this.widgetConfig[this.editIndex] = this.item;
|
|
144
|
+
} else {
|
|
145
|
+
this.widgetConfig.symbolList.push(this.item);
|
|
146
|
+
// this.widgetConfig.push(this.item);
|
|
147
|
+
}
|
|
148
|
+
this.showModal = false;
|
|
149
|
+
// this.$refs.multiImgWithForm.forceUpdate();
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
</script>
|
|
154
|
+
<style scoped>
|
|
155
|
+
.dialog {
|
|
156
|
+
margin: 16px 0;
|
|
157
|
+
}
|
|
158
|
+
.image {
|
|
159
|
+
height: 100px;
|
|
160
|
+
object-fit: scale-down;
|
|
161
|
+
}
|
|
162
|
+
.mapgis-ui-btn:focus,
|
|
163
|
+
.mapgis-ui-btn:hover {
|
|
164
|
+
background-color: #fff0;
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="editable-cell">
|
|
3
|
+
<div v-if="editable" class="editable-cell-input-wrapper">
|
|
4
|
+
<mapgis-ui-input size="small" placeholder="请输入数据源url" :value="value" @change="handleChange" @pressEnter="check" />
|
|
5
|
+
<mapgis-ui-iconfont
|
|
6
|
+
type="mapgis-check"
|
|
7
|
+
class="editable-cell-icon-check"
|
|
8
|
+
@click="check"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-else class="editable-cell-text-wrapper">
|
|
12
|
+
{{ value || ' ' }}
|
|
13
|
+
<mapgis-ui-iconfont type="mapgis-bianji" class="editable-cell-icon" @click="edit" />
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'EditableCell',
|
|
21
|
+
props: {
|
|
22
|
+
text: String,
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
value: this.text,
|
|
27
|
+
editable: false,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
watch: {
|
|
31
|
+
text: {
|
|
32
|
+
handler(next) {
|
|
33
|
+
if (next === '') {
|
|
34
|
+
this.editable = true
|
|
35
|
+
this.$emit('changeEdit', this.editable)
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
immediate: true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
methods: {
|
|
42
|
+
handleChange(e) {
|
|
43
|
+
const value = e.target.value
|
|
44
|
+
this.value = value
|
|
45
|
+
},
|
|
46
|
+
check() {
|
|
47
|
+
if (this.value !== '') {
|
|
48
|
+
this.editable = false
|
|
49
|
+
this.$emit('change', this.value)
|
|
50
|
+
this.$emit('changeEdit', this.editable)
|
|
51
|
+
} else {
|
|
52
|
+
this.$message.error('数据源url不能为空!')
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
edit() {
|
|
56
|
+
this.editable = true
|
|
57
|
+
this.$emit('changeEdit', this.editable)
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style scoped>
|
|
64
|
+
.editable-cell {
|
|
65
|
+
position: relative;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.editable-cell-input-wrapper,
|
|
69
|
+
.editable-cell-text-wrapper {
|
|
70
|
+
padding-right: 24px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.editable-cell-text-wrapper {
|
|
74
|
+
padding: 1px 24px 2px 5px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.editable-cell-icon,
|
|
78
|
+
.editable-cell-icon-check {
|
|
79
|
+
position: absolute;
|
|
80
|
+
right: 0;
|
|
81
|
+
width: 20px;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.editable-cell-icon {
|
|
86
|
+
top: 4px;
|
|
87
|
+
line-height: 18px;
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.editable-cell-icon-check {
|
|
92
|
+
line-height: 28px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.editable-cell:hover .editable-cell-icon {
|
|
96
|
+
display: inline-block;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.editable-cell-icon:hover,
|
|
100
|
+
.editable-cell-icon-check:hover {
|
|
101
|
+
color: #108ee9;
|
|
102
|
+
}
|
|
103
|
+
</style>
|