@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,229 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dialog" style="height: 516px;">
|
|
3
|
+
<div>
|
|
4
|
+
<div class="mapgis-ui-svg-manager-file">
|
|
5
|
+
<mapgis-ui-plot-symbol
|
|
6
|
+
style="height: 516px;max-height: 516px;"
|
|
7
|
+
:format="true"
|
|
8
|
+
:data="widgetConfig.symbolUrl"
|
|
9
|
+
:baseUrl="baseUrl"
|
|
10
|
+
@click="clickIcon"
|
|
11
|
+
@chooseFolder="chooseFolder"
|
|
12
|
+
></mapgis-ui-plot-symbol>
|
|
13
|
+
<div class="mapgis-ui-svg-manager-file-right">
|
|
14
|
+
<mapgis-ui-row class="mapgis-ui-svg-manager-file-right-row">
|
|
15
|
+
<input style="display: none" type="file" accept=".svg"/>
|
|
16
|
+
<mapgis-ui-button @click="importSVG">新增符号</mapgis-ui-button>
|
|
17
|
+
</mapgis-ui-row>
|
|
18
|
+
<mapgis-ui-row class="mapgis-ui-svg-manager-file-right-row">
|
|
19
|
+
<mapgis-ui-button @click="changeSVG">覆盖符号</mapgis-ui-button>
|
|
20
|
+
</mapgis-ui-row>
|
|
21
|
+
<mapgis-ui-row class="mapgis-ui-svg-manager-file-right-row">
|
|
22
|
+
<mapgis-ui-button @click="editSVG">编辑本地符号</mapgis-ui-button>
|
|
23
|
+
</mapgis-ui-row>
|
|
24
|
+
<mapgis-ui-row class="mapgis-ui-svg-manager-file-right-row">
|
|
25
|
+
<mapgis-ui-button @click="deleteSVG">删除符号</mapgis-ui-button>
|
|
26
|
+
</mapgis-ui-row>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<input style="display: none;" type="file" id="testFile"/>
|
|
30
|
+
<mapgis-ui-svg-setting-panel
|
|
31
|
+
style="position: absolute;right: 20px;top: 66px;"
|
|
32
|
+
:url="svgUrl"
|
|
33
|
+
:svgXML="svgXML"
|
|
34
|
+
:baseUrl="baseUrl"
|
|
35
|
+
:name="SVGName"
|
|
36
|
+
></mapgis-ui-svg-setting-panel>
|
|
37
|
+
</div>
|
|
38
|
+
<mapgis-ui-modal
|
|
39
|
+
v-model="showModal"
|
|
40
|
+
:title="title"
|
|
41
|
+
:width="700"
|
|
42
|
+
:dialog-style="{ top: '192px' }"
|
|
43
|
+
okText="确定"
|
|
44
|
+
cancelText="取消"
|
|
45
|
+
@ok="handleOk"
|
|
46
|
+
>
|
|
47
|
+
<mapgis-ui-input
|
|
48
|
+
placeholder="请上传缩略图"
|
|
49
|
+
disabled
|
|
50
|
+
>
|
|
51
|
+
<mapgis-ui-upload
|
|
52
|
+
slot="suffix"
|
|
53
|
+
:action="imagesUploadApi"
|
|
54
|
+
:showUploadList="false"
|
|
55
|
+
:withCredentials="true"
|
|
56
|
+
@change="imgUploadChange"
|
|
57
|
+
>
|
|
58
|
+
<mapgis-ui-button type="link" icon="cloud-upload">
|
|
59
|
+
上传图片
|
|
60
|
+
</mapgis-ui-button>
|
|
61
|
+
</mapgis-ui-upload>
|
|
62
|
+
</mapgis-ui-input>
|
|
63
|
+
</mapgis-ui-modal>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
const baseUrl =
|
|
69
|
+
process.env.VUE_APP_BASE_API === "" ? "" : process.env.VUE_APP_BASE_API + "/";
|
|
70
|
+
import WidgetSettingMixin from '../WidgetSetting/widget-setting-mixin'
|
|
71
|
+
import normalRequest from '../../utils/normal-request'
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: 'PlotManagerSetting',
|
|
75
|
+
mixins: [WidgetSettingMixin],
|
|
76
|
+
data() {
|
|
77
|
+
return {
|
|
78
|
+
imagesUploadApi: baseUrl + "/api/local-storage" + "?name=",
|
|
79
|
+
showModal: false,
|
|
80
|
+
svgUrl: undefined,
|
|
81
|
+
currentFolderId: undefined,
|
|
82
|
+
baseUrl: baseUrl,
|
|
83
|
+
title: "上传SVG",
|
|
84
|
+
currentIconID: undefined,
|
|
85
|
+
operationType: "add",
|
|
86
|
+
svgXML: undefined,
|
|
87
|
+
SVGName: undefined
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
deleteSVG() {
|
|
92
|
+
const that = this;
|
|
93
|
+
normalRequest
|
|
94
|
+
.delete(this.baseUrl + "/api/local-storage", {
|
|
95
|
+
data: [this.currentIconID],
|
|
96
|
+
headers: {
|
|
97
|
+
'Content-Type': 'application/json'
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
.then(function() {
|
|
101
|
+
const {symbolUrl} = that.widgetConfig;
|
|
102
|
+
const {symbols} = symbolUrl;
|
|
103
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
104
|
+
const {items} = symbols[i];
|
|
105
|
+
for (let j = 0; j < items.length; j++) {
|
|
106
|
+
for (let k = 0; k < items[j].items.length; k++) {
|
|
107
|
+
if (items[j].items[k].id === that.currentIconID) {
|
|
108
|
+
items[j].items.splice(k, 1);
|
|
109
|
+
that.$message.success("SVG删除完成!");
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
},
|
|
117
|
+
editSVG() {
|
|
118
|
+
const that = this;
|
|
119
|
+
const ipt = document.getElementById("testFile");
|
|
120
|
+
ipt.click();
|
|
121
|
+
ipt.onchange = function () {
|
|
122
|
+
const File = ipt.files[0];
|
|
123
|
+
that.SVGName = File.name;
|
|
124
|
+
that.SVGName = that.SVGName.split(".")[0];
|
|
125
|
+
const reader = new FileReader();
|
|
126
|
+
reader.readAsText(File, "UTF-8");
|
|
127
|
+
reader.onload = function (evt) {
|
|
128
|
+
const fileString = evt.target.result;
|
|
129
|
+
that.svgXML = fileString;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
handleOk() {
|
|
134
|
+
this.showModal = false;
|
|
135
|
+
},
|
|
136
|
+
clickIcon(data) {
|
|
137
|
+
this.currentIconID = data.icon.id;
|
|
138
|
+
this.svgUrl = data.icon.src;
|
|
139
|
+
this.SVGName = data.icon.name;
|
|
140
|
+
},
|
|
141
|
+
chooseFolder(id) {
|
|
142
|
+
this.currentFolderId = id;
|
|
143
|
+
},
|
|
144
|
+
imgUploadChange(result) {
|
|
145
|
+
if (result.file.status === "done") {
|
|
146
|
+
let name = result.file.name;
|
|
147
|
+
if(name.indexOf(".") > -1) {
|
|
148
|
+
name = name.split(".")[0];
|
|
149
|
+
}
|
|
150
|
+
const {symbolUrl} = this.widgetConfig;
|
|
151
|
+
const {symbols} = symbolUrl;
|
|
152
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
153
|
+
const {items} = symbols[i];
|
|
154
|
+
for (let j = 0; j < items.length; j++) {
|
|
155
|
+
if (this.operationType === "add") {
|
|
156
|
+
if (items[j].id === this.currentFolderId) {
|
|
157
|
+
items[j].items.push({
|
|
158
|
+
"id": Number(parseInt(Math.random() * 1000000)),
|
|
159
|
+
//名称
|
|
160
|
+
"name": name,
|
|
161
|
+
//类型
|
|
162
|
+
"type": "simplepoint",
|
|
163
|
+
//相对路径
|
|
164
|
+
"path": result.file.response.url.substring(1, result.file.response.url.length)
|
|
165
|
+
});
|
|
166
|
+
this.$message.success("SVG上传完成!");
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
for (let k = 0; k < items[j].items.length; k++) {
|
|
171
|
+
if (items[j].items[k].id === this.currentIconID) {
|
|
172
|
+
items[j].items[k].path = result.file.response.url;
|
|
173
|
+
this.$message.success("SVG覆盖完成!");
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
this.showModal = false;
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
importSVG() {
|
|
184
|
+
if(!this.currentFolderId){
|
|
185
|
+
this.$message.error("请选择一个上传文件夹!");
|
|
186
|
+
}else {
|
|
187
|
+
this.showModal = true;
|
|
188
|
+
this.operationType = "add";
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
changeSVG() {
|
|
192
|
+
if (this.currentIconID) {
|
|
193
|
+
this.operationType = "change";
|
|
194
|
+
this.showModal = true;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
}
|
|
199
|
+
</script>
|
|
200
|
+
|
|
201
|
+
<style scoped>
|
|
202
|
+
.dialog {
|
|
203
|
+
margin: 16px 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.editable-add-btn {
|
|
207
|
+
margin-bottom: 8px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.mapgis-ui-svg-manager-file {
|
|
211
|
+
position: relative;
|
|
212
|
+
width: 450px;
|
|
213
|
+
height: 510px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.mapgis-ui-svg-manager-file-right {
|
|
217
|
+
position: absolute;
|
|
218
|
+
right: 0;
|
|
219
|
+
top: 0;
|
|
220
|
+
width: 130px;
|
|
221
|
+
height: 510px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.mapgis-ui-svg-manager-file-right-row {
|
|
225
|
+
height: 50px;
|
|
226
|
+
text-align: center;
|
|
227
|
+
line-height: 50px;
|
|
228
|
+
}
|
|
229
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<multi-type-form
|
|
3
|
+
class="main-config"
|
|
4
|
+
:layout="layout"
|
|
5
|
+
:labelCol="labelCol"
|
|
6
|
+
:wrapperCol="wrapperCol"
|
|
7
|
+
:DataModel="baseConfigModel"
|
|
8
|
+
:DataSource="widgetConfig.baseConfig"
|
|
9
|
+
/>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import MultiTypeForm from '../CommonComponents/MultiTypeForm/MultiTypeForm'
|
|
14
|
+
|
|
15
|
+
const baseConfigModel = [
|
|
16
|
+
{
|
|
17
|
+
name: 'baseIp',
|
|
18
|
+
label: '服务IP',
|
|
19
|
+
paramType: 'STRING', // ENUM、NUMBER、STRING、BOOLEAN
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'basePort',
|
|
23
|
+
label: '端口',
|
|
24
|
+
paramType: 'STRING',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'isOverlay',
|
|
28
|
+
label: '图层是否叠加',
|
|
29
|
+
paramType: 'BOOLEAN',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'isLocation',
|
|
33
|
+
label: '图层是否定位',
|
|
34
|
+
paramType: 'BOOLEAN',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'startZindex',
|
|
38
|
+
label: '初始 index 级别',
|
|
39
|
+
paramType: 'NUMBER',
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: 'BaseConfigSetting',
|
|
45
|
+
components: {
|
|
46
|
+
MultiTypeForm,
|
|
47
|
+
},
|
|
48
|
+
props: {
|
|
49
|
+
widgetConfig: {
|
|
50
|
+
type: [Object, Array]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
layout: 'horizontal',
|
|
56
|
+
labelCol: { span: 3 },
|
|
57
|
+
wrapperCol: { span: 21 },
|
|
58
|
+
baseConfigModel,
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
watch: {
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style scoped>
|
|
72
|
+
.main-config {
|
|
73
|
+
height: calc(75vh - 186px);
|
|
74
|
+
overflow-y: auto;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<mapgis-ui-row>
|
|
3
|
+
<mapgis-ui-col :span="8" class="main-config">
|
|
4
|
+
<mapgis-ui-button class="editable-add-btn" icon="plus" @click="modifySubjectList('add')" size="small">
|
|
5
|
+
新建专题分类
|
|
6
|
+
</mapgis-ui-button>
|
|
7
|
+
<mapgis-ui-tree
|
|
8
|
+
defaultExpandAll
|
|
9
|
+
:selectedKeys="selectedKeys"
|
|
10
|
+
:tree-data="widgetConfig.subjectConfig"
|
|
11
|
+
:replace-fields="{ key: 'id' }"
|
|
12
|
+
>
|
|
13
|
+
<template #title="node">
|
|
14
|
+
<mapgis-ui-dropdown :trigger="['contextmenu']">
|
|
15
|
+
<span>
|
|
16
|
+
<mapgis-ui-iconfont type="mapgis-image" v-if="node.nodeType==='subject'"/>
|
|
17
|
+
<mapgis-ui-iconfont type="mapgis-unorderedlist" v-else/>
|
|
18
|
+
{{ node.title }}
|
|
19
|
+
<mapgis-ui-iconfont title="编辑" type="mapgis-edit-square" class="node-btn" @click="onTreeNodeEditBtnClick($event, node)"/>
|
|
20
|
+
<mapgis-ui-iconfont title="删除" type="mapgis-shanchu_dianji" class="node-btn" @click="onTreeNodeDeleteBtnClick($event, node)"/>
|
|
21
|
+
</span>
|
|
22
|
+
<mapgis-ui-menu slot="overlay" @click="onTreeNodeMenuClick($event, node)">
|
|
23
|
+
<mapgis-ui-menu-item
|
|
24
|
+
v-show="node.nodeType==='panel'||node.nodeType==='list'"
|
|
25
|
+
key='CREATELIST'
|
|
26
|
+
>新建专题分类</mapgis-ui-menu-item
|
|
27
|
+
>
|
|
28
|
+
<mapgis-ui-menu-item
|
|
29
|
+
v-show="node.nodeType==='panel'||node.nodeType==='list'"
|
|
30
|
+
key='CREATESUBJECT'
|
|
31
|
+
>新建专题图</mapgis-ui-menu-item
|
|
32
|
+
>
|
|
33
|
+
<mapgis-ui-menu-item
|
|
34
|
+
key='EDIT'
|
|
35
|
+
>编辑</mapgis-ui-menu-item
|
|
36
|
+
>
|
|
37
|
+
<mapgis-ui-menu-item
|
|
38
|
+
key='REMOVE'
|
|
39
|
+
>删除</mapgis-ui-menu-item
|
|
40
|
+
>
|
|
41
|
+
</mapgis-ui-menu>
|
|
42
|
+
</mapgis-ui-dropdown>
|
|
43
|
+
</template>
|
|
44
|
+
</mapgis-ui-tree>
|
|
45
|
+
</mapgis-ui-col>
|
|
46
|
+
<mapgis-ui-col :span="16">
|
|
47
|
+
<mapgis-ui-divider type="vertical" class="main-divider"/>
|
|
48
|
+
<div style="paddingLeft:17px">
|
|
49
|
+
<thematic-map-subject-list
|
|
50
|
+
v-if="showSubjectList"
|
|
51
|
+
:nodeTitle="nodeTitle"
|
|
52
|
+
:modifyType="modifyType"
|
|
53
|
+
:subjectClassify="subjectClassify"
|
|
54
|
+
@changeSubjectListTitle="changeSubjectListTitle"
|
|
55
|
+
@closeSubjectList="closeSubjectList"
|
|
56
|
+
/>
|
|
57
|
+
<thematic-map-subject-add
|
|
58
|
+
v-if="showSubjectAdd"
|
|
59
|
+
:node="currentThematicMapNode"
|
|
60
|
+
:subjectClassify="subjectClassify" />
|
|
61
|
+
</div>
|
|
62
|
+
</mapgis-ui-col>
|
|
63
|
+
</mapgis-ui-row>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script lang="ts">
|
|
67
|
+
import ThematicMapSubjectAdd from './ThematicMapSubjectAdd'
|
|
68
|
+
import ThematicMapSubjectList from './ThematicMapSubjectList'
|
|
69
|
+
import { uuid } from '../../utils/uuid'
|
|
70
|
+
import _cloneDeep from 'lodash/cloneDeep'
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: 'SubjectConfigSetting',
|
|
75
|
+
components: {
|
|
76
|
+
ThematicMapSubjectAdd,
|
|
77
|
+
ThematicMapSubjectList,
|
|
78
|
+
},
|
|
79
|
+
props: {
|
|
80
|
+
widgetConfig: {
|
|
81
|
+
type: [Object, Array]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
data() {
|
|
85
|
+
return {
|
|
86
|
+
thematicMapTree: [],
|
|
87
|
+
showSubjectList: false,
|
|
88
|
+
showSubjectAdd: false,
|
|
89
|
+
nodeTitle: '',
|
|
90
|
+
nodeData: {},
|
|
91
|
+
mode: '',
|
|
92
|
+
checkedThematicMapNodes: [],
|
|
93
|
+
currentThematicMapNode: {},
|
|
94
|
+
modifyType: 'SubjectList',
|
|
95
|
+
subjectClassify: '',
|
|
96
|
+
selectedKeys: [],
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
// ...mapGetters(['subjectConfig']),
|
|
101
|
+
checkedThematicMapKeys() {
|
|
102
|
+
return this.checkedThematicMapNodes.map(({ id }) => id)
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
watch: {
|
|
106
|
+
// subjectConfig: {
|
|
107
|
+
// handler(nV) {
|
|
108
|
+
// this.thematicMapTree = _cloneDeep(nV)
|
|
109
|
+
// },
|
|
110
|
+
// deep: true,
|
|
111
|
+
// immediate: true,
|
|
112
|
+
// },
|
|
113
|
+
},
|
|
114
|
+
methods: {
|
|
115
|
+
// ...mapMutations([
|
|
116
|
+
// 'updateSubjectConfig',
|
|
117
|
+
// ]),
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 编辑/添加 专题分类/专题图
|
|
121
|
+
* @mode 'add'/'edit'
|
|
122
|
+
* @nodeData 当前节点
|
|
123
|
+
* @type 'SubjectList'/'ThematicMap'
|
|
124
|
+
*/
|
|
125
|
+
modifySubjectList(mode, nodeData, type = 'SubjectList') {
|
|
126
|
+
this.showSubjectAdd = false
|
|
127
|
+
this.showSubjectList = false
|
|
128
|
+
this.$nextTick(() => {
|
|
129
|
+
this.showSubjectList = true
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
this.modifyType = type
|
|
133
|
+
this.subjectClassify = this.getSubjectClassify(mode, nodeData) // 获取所属类别
|
|
134
|
+
this.nodeData = nodeData
|
|
135
|
+
this.mode = mode
|
|
136
|
+
if (mode === 'add') {
|
|
137
|
+
this.nodeTitle = ''
|
|
138
|
+
if (!nodeData) this.selectedKeys = []
|
|
139
|
+
} else if (mode === 'edit') {
|
|
140
|
+
this.nodeTitle = nodeData.title
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 编辑/添加专题图
|
|
146
|
+
*/
|
|
147
|
+
modifyThematicMap(nodeData) {
|
|
148
|
+
this.showSubjectList = false
|
|
149
|
+
this.showSubjectAdd = false
|
|
150
|
+
this.$nextTick(() => {
|
|
151
|
+
this.showSubjectAdd = true
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
this.subjectClassify = this.getSubjectClassify('edit', nodeData)
|
|
155
|
+
if (nodeData.nodeType === 'subject') {
|
|
156
|
+
this.currentThematicMapNode = nodeData
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
onTreeNodeEditBtnClick(evene, { dataRef }) {
|
|
161
|
+
event.stopPropagation()
|
|
162
|
+
this.selectedKeys = [dataRef.id]
|
|
163
|
+
this.onTreeNodeEdit(dataRef)
|
|
164
|
+
},
|
|
165
|
+
onTreeNodeDeleteBtnClick(evene, { dataRef }) {
|
|
166
|
+
event.stopPropagation()
|
|
167
|
+
this.selectedKeys = [dataRef.id]
|
|
168
|
+
this.onTreeNodeRemove(dataRef)
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 节点下拉菜单点击
|
|
173
|
+
* @param key ThematicMapNodeHandles
|
|
174
|
+
* @param dataRef 节点数据
|
|
175
|
+
*/
|
|
176
|
+
onTreeNodeMenuClick({ key }, { dataRef }) {
|
|
177
|
+
this.selectedKeys = [dataRef.id]
|
|
178
|
+
switch (key) {
|
|
179
|
+
case 'CREATELIST':
|
|
180
|
+
this.modifySubjectList('add', dataRef)
|
|
181
|
+
break
|
|
182
|
+
case 'CREATESUBJECT':
|
|
183
|
+
// this.modifyThematicMap(dataRef)
|
|
184
|
+
this.modifySubjectList('add', dataRef, 'ThematicMap')
|
|
185
|
+
break
|
|
186
|
+
case 'EDIT':
|
|
187
|
+
this.onTreeNodeEdit(dataRef)
|
|
188
|
+
break
|
|
189
|
+
case 'REMOVE':
|
|
190
|
+
this.onTreeNodeRemove(dataRef)
|
|
191
|
+
break
|
|
192
|
+
default:
|
|
193
|
+
break
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* todo 编辑节点
|
|
199
|
+
*/
|
|
200
|
+
onTreeNodeEdit(nodeData) {
|
|
201
|
+
if (nodeData.nodeType === 'panel' || nodeData.nodeType === 'list') {
|
|
202
|
+
// 编辑专题分类
|
|
203
|
+
this.modifySubjectList('edit', nodeData)
|
|
204
|
+
} else {
|
|
205
|
+
// 编辑专题图
|
|
206
|
+
this.modifyThematicMap(nodeData)
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* 修改专题分类名称
|
|
212
|
+
*/
|
|
213
|
+
changeSubjectListTitle(title) {
|
|
214
|
+
if (!title) {
|
|
215
|
+
this.$message.warn('请输入名称')
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
this.closeSubjectList()
|
|
219
|
+
if (this.mode === 'edit') {
|
|
220
|
+
this.nodeData.title = title
|
|
221
|
+
return
|
|
222
|
+
}
|
|
223
|
+
if (this.mode === 'add') {
|
|
224
|
+
if (this.modifyType === 'ThematicMap') {
|
|
225
|
+
const subject = {
|
|
226
|
+
id: `subject-${uuid()}`,
|
|
227
|
+
title: title,
|
|
228
|
+
visible: true,
|
|
229
|
+
nodeType: 'subject',
|
|
230
|
+
type: "SubSectionMap", // 默认分段专题图
|
|
231
|
+
config: []
|
|
232
|
+
}
|
|
233
|
+
this.nodeData.children.push(subject)
|
|
234
|
+
this.selectedKeys = [subject.id]
|
|
235
|
+
this.modifyThematicMap(subject)
|
|
236
|
+
} else {
|
|
237
|
+
if (this.nodeData) {
|
|
238
|
+
const list = {
|
|
239
|
+
id: uuid(),
|
|
240
|
+
title: title,
|
|
241
|
+
visible: true,
|
|
242
|
+
nodeType: 'list',
|
|
243
|
+
children: []
|
|
244
|
+
}
|
|
245
|
+
this.nodeData.children.unshift(list)
|
|
246
|
+
} else {
|
|
247
|
+
const panel = {
|
|
248
|
+
id: uuid(),
|
|
249
|
+
title: title,
|
|
250
|
+
visible: true,
|
|
251
|
+
nodeType: 'panel',
|
|
252
|
+
children: []
|
|
253
|
+
}
|
|
254
|
+
this.widgetConfig.subjectConfig.push(panel)
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* 关闭编辑专题分类界面
|
|
264
|
+
*/
|
|
265
|
+
closeSubjectList() {
|
|
266
|
+
this.showSubjectList = false
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* 移除节点
|
|
271
|
+
*/
|
|
272
|
+
onTreeNodeRemove(nodeData) {
|
|
273
|
+
this.showSubjectList = false
|
|
274
|
+
this.showSubjectAdd = false
|
|
275
|
+
|
|
276
|
+
const vm = this
|
|
277
|
+
const recursion = (tree, node) => {
|
|
278
|
+
for (let i = 0; i < tree.length; i++) {
|
|
279
|
+
const n = tree[i]
|
|
280
|
+
if (n.id === node.id) {
|
|
281
|
+
tree.splice(
|
|
282
|
+
tree.findIndex(({ id }) => id === node.id),
|
|
283
|
+
1
|
|
284
|
+
)
|
|
285
|
+
i--
|
|
286
|
+
} else if (n.children && n.children.length) {
|
|
287
|
+
recursion(n.children, node)
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return tree
|
|
291
|
+
}
|
|
292
|
+
this.$confirm({
|
|
293
|
+
title: "提示",
|
|
294
|
+
content: "是否删除该节点?",
|
|
295
|
+
okText: "确认",
|
|
296
|
+
cancelText: "取消",
|
|
297
|
+
onOk() {
|
|
298
|
+
recursion(vm.widgetConfig.subjectConfig, nodeData)
|
|
299
|
+
|
|
300
|
+
},
|
|
301
|
+
})
|
|
302
|
+
},
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* 获取当前节点所属类别
|
|
306
|
+
*/
|
|
307
|
+
getSubjectClassify(mode, nodeData) {
|
|
308
|
+
if (!nodeData) return ''
|
|
309
|
+
if (mode === 'add') {
|
|
310
|
+
return nodeData.title
|
|
311
|
+
} else if (mode === 'edit') {
|
|
312
|
+
// debugger
|
|
313
|
+
const recursion = (tree, node, result) => {
|
|
314
|
+
for (let i = 0; i < tree.length; i++) {
|
|
315
|
+
const n = tree[i]
|
|
316
|
+
if (n.id === node.id) {
|
|
317
|
+
return result
|
|
318
|
+
} else if (n.children && n.children.length) {
|
|
319
|
+
const res = recursion(n.children, node, n.title)
|
|
320
|
+
if (res) {
|
|
321
|
+
return res
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return recursion(this.widgetConfig.subjectConfig, nodeData, '')
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
</script>
|
|
332
|
+
|
|
333
|
+
<style scoped>
|
|
334
|
+
.main-config {
|
|
335
|
+
height: calc(75vh - 186px);
|
|
336
|
+
overflow-y: auto;
|
|
337
|
+
}
|
|
338
|
+
.main-divider {
|
|
339
|
+
height: calc(75vh - 186px);
|
|
340
|
+
position: absolute;
|
|
341
|
+
}
|
|
342
|
+
.node-btn {
|
|
343
|
+
margin: 0px 4px;
|
|
344
|
+
padding-top: 5px;
|
|
345
|
+
}
|
|
346
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dialog">
|
|
3
|
+
<mapgis-ui-tabs>
|
|
4
|
+
<mapgis-ui-tab-pane key="1" tab="基础配置">
|
|
5
|
+
<base-config-setting :widgetConfig="widgetConfig"/>
|
|
6
|
+
</mapgis-ui-tab-pane>
|
|
7
|
+
<mapgis-ui-tab-pane key="2" tab="专题配置" force-render>
|
|
8
|
+
<subject-config-setting :widgetConfig="widgetConfig"/>
|
|
9
|
+
</mapgis-ui-tab-pane>
|
|
10
|
+
</mapgis-ui-tabs>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import WidgetSettingMixin from '../WidgetSetting/widget-setting-mixin'
|
|
16
|
+
import BaseConfigSetting from './BaseConfigSetting'
|
|
17
|
+
import SubjectConfigSetting from './SubjectConfigSetting'
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'ThematicMapSetting',
|
|
21
|
+
mixins: [WidgetSettingMixin],
|
|
22
|
+
components: {
|
|
23
|
+
BaseConfigSetting,
|
|
24
|
+
SubjectConfigSetting,
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
watch: {
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style scoped>
|
|
41
|
+
.dialog {
|
|
42
|
+
margin: 16px 0;
|
|
43
|
+
}
|
|
44
|
+
</style>
|