@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.
Files changed (118) hide show
  1. package/.browserslistrc +3 -0
  2. package/.env.production +5 -0
  3. package/.eslintignore +5 -0
  4. package/.eslintrc.js +18 -0
  5. package/README.md +24 -0
  6. package/babel.config.js +5 -0
  7. package/dist-libs/demo.html +10 -0
  8. package/dist-libs/fonts/ionicons.99ac3308.woff +0 -0
  9. package/dist-libs/fonts/ionicons.d535a25a.ttf +0 -0
  10. package/dist-libs/img/iconfont.573255ce.svg +36 -0
  11. package/dist-libs/img/image-icon.dd06d30b.dd06d30b.png +0 -0
  12. package/dist-libs/img/ionicons.17bf2ac0.svg +870 -0
  13. package/dist-libs/img/jsoneditor-icons.2b9b4872.2b9b4872.svg +749 -0
  14. package/dist-libs/img/plus.bdc6b5b1.bdc6b5b1.svg +1 -0
  15. package/dist-libs/img/text-icon.dd1b3d87.dd1b3d87.png +0 -0
  16. package/dist-libs/img/video-icon.499ddeb4.499ddeb4.png +0 -0
  17. package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.common.js +33467 -0
  18. package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.css +6 -0
  19. package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.umd.js +33477 -0
  20. package/dist-libs/mapgis-pan-spatial-map-widgets-config-ui.umd.min.js +1183 -0
  21. package/docs/.vuepress/config.js +81 -0
  22. package/docs/.vuepress/public/favicon.ico +0 -0
  23. package/docs/.vuepress/public/logo.svg +7 -0
  24. package/docs/.vuepress/styles/palette.styl +1 -0
  25. package/docs/README.md +35 -0
  26. package/docs/api/common/MultiImgWithForm.md +87 -0
  27. package/docs/api/common/MultiTypeForm.md +113 -0
  28. package/docs/api/images/basemapConfigUI.png +0 -0
  29. package/docs/api/images/comprehensiveQueryConfigUI.png +0 -0
  30. package/docs/guide/README.md +42 -0
  31. package/docs/guide/publish.md +84 -0
  32. package/docs/guide/yarn/mapgis.png +0 -0
  33. package/docs/guide/yarn/use_mapgis.png +0 -0
  34. package/package.json +58 -0
  35. package/postcss.config.js +5 -0
  36. package/public/favicon.ico +0 -0
  37. package/public/index.html +17 -0
  38. package/src/api/app/config.js +10 -0
  39. package/src/assets/iviewIcon/fonts/ionicons.svg +870 -0
  40. package/src/assets/iviewIcon/fonts/ionicons.ttf +0 -0
  41. package/src/assets/iviewIcon/fonts/ionicons.woff +0 -0
  42. package/src/assets/iviewIcon/iview.css +3461 -0
  43. package/src/assets/logo.png +0 -0
  44. package/src/components/BasemapManagerSetting/BasemapManagerSetting.vue +461 -0
  45. package/src/components/CityGrowSetting/CityGrowSetting.vue +145 -0
  46. package/src/components/CityGrowSetting/EditableCell.vue +103 -0
  47. package/src/components/CommonComponents/MultiImgWithForm/MultiImgWithForm.scss +106 -0
  48. package/src/components/CommonComponents/MultiImgWithForm/MultiImgWithForm.vue +128 -0
  49. package/src/components/CommonComponents/MultiTypeForm/MultiTypeForm.vue +78 -0
  50. package/src/components/CommonComponents/ServiceSelect/index.vue +325 -0
  51. package/src/components/ComprehensiveQuerySetting/ComprehensiveQuerySetting.vue +745 -0
  52. package/src/components/ComprehensiveQuerySetting/EditAttrs.vue +254 -0
  53. package/src/components/DataCatalogSetting/DataCatalogSetting.vue +71 -0
  54. package/src/components/DataCatalogSetting/components/DataSetting.vue +126 -0
  55. package/src/components/DataCatalogSetting/components/IconSetting.vue +160 -0
  56. package/src/components/DataCatalogSetting/components/NoSpatialSetting.vue +37 -0
  57. package/src/components/DataCatalogSetting/components/OtherSetting.vue +54 -0
  58. package/src/components/DataCatalogSetting/components/ParamSetting.vue +95 -0
  59. package/src/components/DataCatalogSetting/components/component/DataSourceSetting.vue +929 -0
  60. package/src/components/DataCatalogSetting/components/component/NodeDataSetting.vue +644 -0
  61. package/src/components/DataCatalogSetting/components/component/ServiceSelectWithData.vue +413 -0
  62. package/src/components/DataCatalogSetting/index.js +29 -0
  63. package/src/components/FeatureQuerySetting/FeatureQuerySetting.vue +121 -0
  64. package/src/components/KibanaVSetting/KibanaVSetting.vue +152 -0
  65. package/src/components/LegendSetting/LegendSetting.vue +85 -0
  66. package/src/components/MapDataVSetting/MapDataVSetting.vue +41 -0
  67. package/src/components/OverlayManagerSetting/OverlayManagerSetting.vue +248 -0
  68. package/src/components/ParticleEffectsSetting/ParticleEffectsSetting.vue +166 -0
  69. package/src/components/PlotManagerSetting/EditableCell.vue +103 -0
  70. package/src/components/PlotManagerSetting/PlotManagerSetting.vue +229 -0
  71. package/src/components/ThematicMapSetting/BaseConfigSetting.vue +76 -0
  72. package/src/components/ThematicMapSetting/SubjectConfigSetting.vue +346 -0
  73. package/src/components/ThematicMapSetting/ThematicMapSetting.vue +44 -0
  74. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/common/AnimationItems.vue +141 -0
  75. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/common/ColorPickerSetting.vue +260 -0
  76. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/common/EditableFieldTable.vue +187 -0
  77. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/BaseItems/index.vue +161 -0
  78. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/AttributeTable.vue +122 -0
  79. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/Common.vue +376 -0
  80. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/Popup.vue +138 -0
  81. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/StatisticGragh.vue +189 -0
  82. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/BaseMapWithGraph.vue +73 -0
  83. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/HeatMap.vue +124 -0
  84. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/HexBin.vue +100 -0
  85. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/Label.vue +139 -0
  86. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/StatisticLabel.vue +43 -0
  87. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/SubSectionMap.vue +42 -0
  88. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/components/SubjectStyles/index.vue +56 -0
  89. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/index.less +101 -0
  90. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/components/SubjectItems/index.vue +236 -0
  91. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/index.less +22 -0
  92. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/index.vue +226 -0
  93. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/mixins/subject-styles-mixin.js +138 -0
  94. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/store/dep.js +21 -0
  95. package/src/components/ThematicMapSetting/ThematicMapSubjectAdd/store/fields.ts +111 -0
  96. package/src/components/ThematicMapSetting/ThematicMapSubjectList/index.vue +76 -0
  97. package/src/components/ThematicMapSetting/store/index.js +19 -0
  98. package/src/components/ThematicMapSetting/store/module/getters.js +28 -0
  99. package/src/components/ThematicMapSetting/store/module/index.js +53 -0
  100. package/src/components/ThematicMapSetting/store/module/mutations.js +272 -0
  101. package/src/components/ThematicMapSetting/store/module/state.js +36 -0
  102. package/src/components/ThematicMapSetting/store/types.js +0 -0
  103. package/src/components/WidgetSetting/WidgetJsonConfig.vue +28 -0
  104. package/src/components/WidgetSetting/components/JsonEditor/index.vue +77 -0
  105. package/src/components/WidgetSetting/widget-setting-mixin.js +22 -0
  106. package/src/components/index.js +17 -0
  107. package/src/index.js +63 -0
  108. package/src/shims-tsx.d.ts +13 -0
  109. package/src/shims-vue.d.ts +4 -0
  110. package/src/store/index.ts +15 -0
  111. package/src/utils/auth.js +18 -0
  112. package/src/utils/normal-request.js +63 -0
  113. package/src/utils/request.js +92 -0
  114. package/src/utils/settings.js +50 -0
  115. package/src/utils/uuid.js +17 -0
  116. package/src/utils/validate.js +175 -0
  117. package/tsconfig.json +40 -0
  118. 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>