增加注释
Showing
20 changed files
with
328 additions
and
21 deletions
1 | /* | 1 | /* |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-06-14 15:05:38 | 4 | * @LastEditTime: 2023-06-14 15:05:38 |
5 | */ | 5 | */ |
... | @@ -8,6 +8,10 @@ import Popup from './index.vue' | ... | @@ -8,6 +8,10 @@ import Popup from './index.vue' |
8 | const PopupBox = Vue.extend(Popup) | 8 | const PopupBox = Vue.extend(Popup) |
9 | let popuping = undefined | 9 | let popuping = undefined |
10 | 10 | ||
11 | /** | ||
12 | * @description: close | ||
13 | * @author: renchao | ||
14 | */ | ||
11 | PopupBox.prototype.close = function () { | 15 | PopupBox.prototype.close = function () { |
12 | // 如果Popup 有引用,则去掉引用 | 16 | // 如果Popup 有引用,则去掉引用 |
13 | if (popuping) { | 17 | if (popuping) { |
... | @@ -24,6 +28,14 @@ PopupBox.prototype.close = function () { | ... | @@ -24,6 +28,14 @@ PopupBox.prototype.close = function () { |
24 | }, 300) | 28 | }, 300) |
25 | } | 29 | } |
26 | 30 | ||
31 | /** | ||
32 | * @description: Popup1 | ||
33 | * @param {*} title | ||
34 | * @param {*} editItem | ||
35 | * @param {*} data | ||
36 | * @param {*} formData | ||
37 | * @author: renchao | ||
38 | */ | ||
27 | const Popup1 = (title, editItem, data, formData) => { | 39 | const Popup1 = (title, editItem, data, formData) => { |
28 | // 如果组件已渲染,则返回即可 | 40 | // 如果组件已渲染,则返回即可 |
29 | if (popuping) { | 41 | if (popuping) { | ... | ... |
... | @@ -73,9 +73,17 @@ | ... | @@ -73,9 +73,17 @@ |
73 | }, 300) | 73 | }, 300) |
74 | }, | 74 | }, |
75 | methods: { | 75 | methods: { |
76 | /** | ||
77 | * @description: onCancel | ||
78 | * @author: renchao | ||
79 | */ | ||
76 | onCancel () { | 80 | onCancel () { |
77 | Popup1().close() | 81 | Popup1().close() |
78 | }, | 82 | }, |
83 | /** | ||
84 | * @description: onConfirm | ||
85 | * @author: renchao | ||
86 | */ | ||
79 | onConfirm () { | 87 | onConfirm () { |
80 | let res = new Promise((resolve, reject) => { | 88 | let res = new Promise((resolve, reject) => { |
81 | this.confirm() | 89 | this.confirm() |
... | @@ -85,6 +93,11 @@ | ... | @@ -85,6 +93,11 @@ |
85 | this.isShow = false | 93 | this.isShow = false |
86 | } | 94 | } |
87 | }, | 95 | }, |
96 | /** | ||
97 | * @description: loadViewFn | ||
98 | * @param {*} view | ||
99 | * @author: renchao | ||
100 | */ | ||
88 | loadViewFn (view) { | 101 | loadViewFn (view) { |
89 | return (r) => | 102 | return (r) => |
90 | require.ensure([], () => | 103 | require.ensure([], () => |
... | @@ -184,4 +197,3 @@ | ... | @@ -184,4 +197,3 @@ |
184 | opacity: 0; | 197 | opacity: 0; |
185 | } | 198 | } |
186 | </style> | 199 | </style> |
187 | |||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | export const theme = { | 1 | export const theme = { |
2 | /** | ||
3 | * @description: bind | ||
4 | * @param {*} el | ||
5 | * @param {*} binding | ||
6 | * @param {*} vnode | ||
7 | * @author: renchao | ||
8 | */ | ||
2 | bind: function (el, binding, vnode) { | 9 | bind: function (el, binding, vnode) { |
3 | setEleStyleColorAttribute(el, binding); | 10 | setEleStyleColorAttribute(el, binding); |
4 | }, | 11 | }, |
12 | /** | ||
13 | * @description: update | ||
14 | * @param {*} el | ||
15 | * @param {*} binding | ||
16 | * @param {*} vnode | ||
17 | * @author: renchao | ||
18 | */ | ||
5 | update: function (el, binding, vnode) { | 19 | update: function (el, binding, vnode) { |
6 | setEleStyleColorAttribute(el, binding); | 20 | setEleStyleColorAttribute(el, binding); |
7 | }, | 21 | }, |
22 | /** | ||
23 | * @description: componentUpdated | ||
24 | * @param {*} el | ||
25 | * @param {*} binding | ||
26 | * @param {*} vnode | ||
27 | * @author: renchao | ||
28 | */ | ||
8 | componentUpdated: function (el, binding, vnode) { | 29 | componentUpdated: function (el, binding, vnode) { |
9 | setEleStyleColorAttribute(el, binding); | 30 | setEleStyleColorAttribute(el, binding); |
10 | } | 31 | } |
... | @@ -16,4 +37,4 @@ function setEleStyleColorAttribute (el, binding) { | ... | @@ -16,4 +37,4 @@ function setEleStyleColorAttribute (el, binding) { |
16 | if (background) el.style['background-color'] = value; | 37 | if (background) el.style['background-color'] = value; |
17 | if (font) el.style.color = value; | 38 | if (font) el.style.color = value; |
18 | if (border) el.style['border-color'] = value; | 39 | if (border) el.style['border-color'] = value; |
19 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
40 | } | ... | ... |
... | @@ -57,6 +57,10 @@ | ... | @@ -57,6 +57,10 @@ |
57 | window.removeEventListener('message') | 57 | window.removeEventListener('message') |
58 | }, | 58 | }, |
59 | methods: { | 59 | methods: { |
60 | /** | ||
61 | * @description: queryNoticeList | ||
62 | * @author: renchao | ||
63 | */ | ||
60 | queryNoticeList () { | 64 | queryNoticeList () { |
61 | getHomeNoticeList().then(res => { | 65 | getHomeNoticeList().then(res => { |
62 | if (res.result) { | 66 | if (res.result) { |
... | @@ -64,6 +68,10 @@ | ... | @@ -64,6 +68,10 @@ |
64 | } | 68 | } |
65 | }) | 69 | }) |
66 | }, | 70 | }, |
71 | /** | ||
72 | * @description: logout | ||
73 | * @author: renchao | ||
74 | */ | ||
67 | logout () { | 75 | logout () { |
68 | axios.post(window._config.services.management + "/management/logout").then(() => { | 76 | axios.post(window._config.services.management + "/management/logout").then(() => { |
69 | setToken(undefined) | 77 | setToken(undefined) |
... | @@ -73,12 +81,22 @@ | ... | @@ -73,12 +81,22 @@ |
73 | }) | 81 | }) |
74 | }, | 82 | }, |
75 | 83 | ||
84 | /** | ||
85 | * @description: themeChange | ||
86 | * @param {*} val | ||
87 | * @author: renchao | ||
88 | */ | ||
76 | themeChange (val) { | 89 | themeChange (val) { |
77 | this.$store.dispatch('app/updateTheme', val) | 90 | this.$store.dispatch('app/updateTheme', val) |
78 | }, | 91 | }, |
79 | searchMessageCenter () { | 92 | searchMessageCenter () { |
80 | this.$router.push({ name: 'messagecenter' }) | 93 | this.$router.push({ name: 'messagecenter' }) |
81 | }, | 94 | }, |
95 | /** | ||
96 | * @description: handleCommand | ||
97 | * @param {*} command | ||
98 | * @author: renchao | ||
99 | */ | ||
82 | handleCommand (command) { | 100 | handleCommand (command) { |
83 | if (command == 'a') { | 101 | if (command == 'a') { |
84 | //个人中心 | 102 | //个人中心 | ... | ... |
... | @@ -10,6 +10,10 @@ export default { | ... | @@ -10,6 +10,10 @@ export default { |
10 | this.fixBugIniOS() | 10 | this.fixBugIniOS() |
11 | }, | 11 | }, |
12 | methods: { | 12 | methods: { |
13 | /** | ||
14 | * @description: fixBugIniOS | ||
15 | * @author: renchao | ||
16 | */ | ||
13 | fixBugIniOS() { | 17 | fixBugIniOS() { |
14 | const $subMenu = this.$refs.subMenu | 18 | const $subMenu = this.$refs.subMenu |
15 | if ($subMenu) { | 19 | if ($subMenu) { | ... | ... |
... | @@ -26,6 +26,11 @@ export default { | ... | @@ -26,6 +26,11 @@ export default { |
26 | } | 26 | } |
27 | }, | 27 | }, |
28 | methods: { | 28 | methods: { |
29 | /** | ||
30 | * @description: linkProps | ||
31 | * @param {*} to | ||
32 | * @author: renchao | ||
33 | */ | ||
29 | linkProps(to) { | 34 | linkProps(to) { |
30 | if (this.isExternal) { | 35 | if (this.isExternal) { |
31 | return { | 36 | return { | ... | ... |
... | @@ -53,6 +53,12 @@ export default { | ... | @@ -53,6 +53,12 @@ export default { |
53 | return {} | 53 | return {} |
54 | }, | 54 | }, |
55 | methods: { | 55 | methods: { |
56 | /** | ||
57 | * @description: hasOneShowingChild | ||
58 | * @param {*} children | ||
59 | * @param {*} parent | ||
60 | * @author: renchao | ||
61 | */ | ||
56 | hasOneShowingChild (children = [], parent) { | 62 | hasOneShowingChild (children = [], parent) { |
57 | const showingChildren = children.filter(item => { | 63 | const showingChildren = children.filter(item => { |
58 | if (item.hidden) { | 64 | if (item.hidden) { |
... | @@ -75,6 +81,11 @@ export default { | ... | @@ -75,6 +81,11 @@ export default { |
75 | } | 81 | } |
76 | return false | 82 | return false |
77 | }, | 83 | }, |
84 | /** | ||
85 | * @description: resolvePath | ||
86 | * @param {*} routePath | ||
87 | * @author: renchao | ||
88 | */ | ||
78 | resolvePath (routePath) { | 89 | resolvePath (routePath) { |
79 | if (isExternal(routePath)) { | 90 | if (isExternal(routePath)) { |
80 | return routePath | 91 | return routePath |
... | @@ -86,4 +97,4 @@ export default { | ... | @@ -86,4 +97,4 @@ export default { |
86 | } | 97 | } |
87 | } | 98 | } |
88 | } | 99 | } |
89 | </script> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
100 | </script> | ... | ... |
... | @@ -26,14 +26,28 @@ export default { | ... | @@ -26,14 +26,28 @@ export default { |
26 | this.scrollWrapper.removeEventListener('scroll', this.emitScroll) | 26 | this.scrollWrapper.removeEventListener('scroll', this.emitScroll) |
27 | }, | 27 | }, |
28 | methods: { | 28 | methods: { |
29 | /** | ||
30 | * @description: handleScroll | ||
31 | * @param {*} e | ||
32 | * @author: renchao | ||
33 | */ | ||
29 | handleScroll (e) { | 34 | handleScroll (e) { |
30 | const eventDelta = e.wheelDelta || -e.deltaY * 40 | 35 | const eventDelta = e.wheelDelta || -e.deltaY * 40 |
31 | const $scrollWrapper = this.scrollWrapper | 36 | const $scrollWrapper = this.scrollWrapper |
32 | $scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4 | 37 | $scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4 |
33 | }, | 38 | }, |
39 | /** | ||
40 | * @description: emitScroll | ||
41 | * @author: renchao | ||
42 | */ | ||
34 | emitScroll () { | 43 | emitScroll () { |
35 | this.$emit('scroll') | 44 | this.$emit('scroll') |
36 | }, | 45 | }, |
46 | /** | ||
47 | * @description: moveToTarget | ||
48 | * @param {*} currentTag | ||
49 | * @author: renchao | ||
50 | */ | ||
37 | moveToTarget (currentTag) { | 51 | moveToTarget (currentTag) { |
38 | const $container = this.$refs.scrollContainer.$el | 52 | const $container = this.$refs.scrollContainer.$el |
39 | const $containerWidth = $container.offsetWidth | 53 | const $containerWidth = $container.offsetWidth | ... | ... |
... | @@ -59,12 +59,28 @@ | ... | @@ -59,12 +59,28 @@ |
59 | this.addTags() | 59 | this.addTags() |
60 | }, | 60 | }, |
61 | methods: { | 61 | methods: { |
62 | /** | ||
63 | * @description: isActive | ||
64 | * @param {*} route | ||
65 | * @author: renchao | ||
66 | */ | ||
62 | isActive (route) { | 67 | isActive (route) { |
63 | return route.path === this.$route.path | 68 | return route.path === this.$route.path |
64 | }, | 69 | }, |
70 | /** | ||
71 | * @description: isAffix | ||
72 | * @param {*} tag | ||
73 | * @author: renchao | ||
74 | */ | ||
65 | isAffix (tag) { | 75 | isAffix (tag) { |
66 | return tag.meta && tag.meta.affix | 76 | return tag.meta && tag.meta.affix |
67 | }, | 77 | }, |
78 | /** | ||
79 | * @description: filterAffixTags | ||
80 | * @param {*} routes | ||
81 | * @param {*} basePath | ||
82 | * @author: renchao | ||
83 | */ | ||
68 | filterAffixTags (routes, basePath = '/') { | 84 | filterAffixTags (routes, basePath = '/') { |
69 | let tags = [] | 85 | let tags = [] |
70 | routes.forEach(route => { | 86 | routes.forEach(route => { |
... | @@ -86,6 +102,10 @@ | ... | @@ -86,6 +102,10 @@ |
86 | }) | 102 | }) |
87 | return tags | 103 | return tags |
88 | }, | 104 | }, |
105 | /** | ||
106 | * @description: initTags | ||
107 | * @author: renchao | ||
108 | */ | ||
89 | initTags () { | 109 | initTags () { |
90 | const affixTags = this.affixTags = this.filterAffixTags(this.routes) | 110 | const affixTags = this.affixTags = this.filterAffixTags(this.routes) |
91 | for (const tag of affixTags) { | 111 | for (const tag of affixTags) { |
... | @@ -95,6 +115,10 @@ | ... | @@ -95,6 +115,10 @@ |
95 | } | 115 | } |
96 | } | 116 | } |
97 | }, | 117 | }, |
118 | /** | ||
119 | * @description: addTags | ||
120 | * @author: renchao | ||
121 | */ | ||
98 | addTags () { | 122 | addTags () { |
99 | const { name } = this.$route | 123 | const { name } = this.$route |
100 | if (name) { | 124 | if (name) { |
... | @@ -102,6 +126,10 @@ | ... | @@ -102,6 +126,10 @@ |
102 | } | 126 | } |
103 | return false | 127 | return false |
104 | }, | 128 | }, |
129 | /** | ||
130 | * @description: moveToCurrentTag | ||
131 | * @author: renchao | ||
132 | */ | ||
105 | moveToCurrentTag () { | 133 | moveToCurrentTag () { |
106 | const tags = this.$refs.tag | 134 | const tags = this.$refs.tag |
107 | this.$nextTick(() => { | 135 | this.$nextTick(() => { |
... | @@ -117,6 +145,11 @@ | ... | @@ -117,6 +145,11 @@ |
117 | } | 145 | } |
118 | }) | 146 | }) |
119 | }, | 147 | }, |
148 | /** | ||
149 | * @description: refreshSelectedTag | ||
150 | * @param {*} view | ||
151 | * @author: renchao | ||
152 | */ | ||
120 | refreshSelectedTag (view) { | 153 | refreshSelectedTag (view) { |
121 | this.$store.dispatch('tagsView/delCachedView', view).then(() => { | 154 | this.$store.dispatch('tagsView/delCachedView', view).then(() => { |
122 | const { fullPath } = view | 155 | const { fullPath } = view |
... | @@ -127,6 +160,11 @@ | ... | @@ -127,6 +160,11 @@ |
127 | }) | 160 | }) |
128 | }) | 161 | }) |
129 | }, | 162 | }, |
163 | /** | ||
164 | * @description: closeSelectedTag | ||
165 | * @param {*} view | ||
166 | * @author: renchao | ||
167 | */ | ||
130 | closeSelectedTag (view) { | 168 | closeSelectedTag (view) { |
131 | this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { | 169 | this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { |
132 | if (this.isActive(view)) { | 170 | if (this.isActive(view)) { |
... | @@ -134,12 +172,21 @@ | ... | @@ -134,12 +172,21 @@ |
134 | } | 172 | } |
135 | }) | 173 | }) |
136 | }, | 174 | }, |
175 | /** | ||
176 | * @description: closeOthersTags | ||
177 | * @author: renchao | ||
178 | */ | ||
137 | closeOthersTags () { | 179 | closeOthersTags () { |
138 | this.$router.push(this.selectedTag) | 180 | this.$router.push(this.selectedTag) |
139 | this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => { | 181 | this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => { |
140 | this.moveToCurrentTag() | 182 | this.moveToCurrentTag() |
141 | }) | 183 | }) |
142 | }, | 184 | }, |
185 | /** | ||
186 | * @description: closeAllTags | ||
187 | * @param {*} view | ||
188 | * @author: renchao | ||
189 | */ | ||
143 | closeAllTags (view) { | 190 | closeAllTags (view) { |
144 | this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => { | 191 | this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => { |
145 | if (this.affixTags.some(tag => tag.path === view.path)) { | 192 | if (this.affixTags.some(tag => tag.path === view.path)) { |
... | @@ -148,6 +195,12 @@ | ... | @@ -148,6 +195,12 @@ |
148 | this.toLastView(visitedViews, view) | 195 | this.toLastView(visitedViews, view) |
149 | }) | 196 | }) |
150 | }, | 197 | }, |
198 | /** | ||
199 | * @description: toLastView | ||
200 | * @param {*} visitedViews | ||
201 | * @param {*} view | ||
202 | * @author: renchao | ||
203 | */ | ||
151 | toLastView (visitedViews, view) { | 204 | toLastView (visitedViews, view) { |
152 | const latestView = visitedViews.slice(-1)[0] | 205 | const latestView = visitedViews.slice(-1)[0] |
153 | if (latestView) { | 206 | if (latestView) { |
... | @@ -163,6 +216,12 @@ | ... | @@ -163,6 +216,12 @@ |
163 | } | 216 | } |
164 | } | 217 | } |
165 | }, | 218 | }, |
219 | /** | ||
220 | * @description: openMenu | ||
221 | * @param {*} tag | ||
222 | * @param {*} e | ||
223 | * @author: renchao | ||
224 | */ | ||
166 | openMenu (tag, e) { | 225 | openMenu (tag, e) { |
167 | // const menuMinWidth = 105 | 226 | // const menuMinWidth = 105 |
168 | // const offsetLeft = this.$el.getBoundingClientRect().left // container margin left | 227 | // const offsetLeft = this.$el.getBoundingClientRect().left // container margin left |
... | @@ -179,9 +238,17 @@ | ... | @@ -179,9 +238,17 @@ |
179 | this.visible = true | 238 | this.visible = true |
180 | this.selectedTag = tag | 239 | this.selectedTag = tag |
181 | }, | 240 | }, |
241 | /** | ||
242 | * @description: closeMenu | ||
243 | * @author: renchao | ||
244 | */ | ||
182 | closeMenu () { | 245 | closeMenu () { |
183 | this.visible = false | 246 | this.visible = false |
184 | }, | 247 | }, |
248 | /** | ||
249 | * @description: handleScroll | ||
250 | * @author: renchao | ||
251 | */ | ||
185 | handleScroll () { | 252 | handleScroll () { |
186 | this.closeMenu() | 253 | this.closeMenu() |
187 | } | 254 | } | ... | ... |
... | @@ -27,10 +27,18 @@ export default { | ... | @@ -27,10 +27,18 @@ export default { |
27 | methods: { | 27 | methods: { |
28 | // use $_ for mixins properties | 28 | // use $_ for mixins properties |
29 | // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential | 29 | // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential |
30 | /** | ||
31 | * @description: $_isMobile | ||
32 | * @author: renchao | ||
33 | */ | ||
30 | $_isMobile() { | 34 | $_isMobile() { |
31 | const rect = body.getBoundingClientRect() | 35 | const rect = body.getBoundingClientRect() |
32 | return rect.width - 1 < WIDTH | 36 | return rect.width - 1 < WIDTH |
33 | }, | 37 | }, |
38 | /** | ||
39 | * @description: $_resizeHandler | ||
40 | * @author: renchao | ||
41 | */ | ||
34 | $_resizeHandler() { | 42 | $_resizeHandler() { |
35 | if (!document.hidden) { | 43 | if (!document.hidden) { |
36 | const isMobile = this.$_isMobile() | 44 | const isMobile = this.$_isMobile() | ... | ... |
... | @@ -20,6 +20,10 @@ const mutations = { | ... | @@ -20,6 +20,10 @@ const mutations = { |
20 | } | 20 | } |
21 | 21 | ||
22 | const actions = { | 22 | const actions = { |
23 | /** | ||
24 | * @description: generateDic | ||
25 | * @author: renchao | ||
26 | */ | ||
23 | generateDic ({ commit }) { | 27 | generateDic ({ commit }) { |
24 | return new Promise(async (resolve) => { | 28 | return new Promise(async (resolve) => { |
25 | let { result: res } = await getAllDict() | 29 | let { result: res } = await getAllDict() |
... | @@ -27,6 +31,10 @@ const actions = { | ... | @@ -27,6 +31,10 @@ const actions = { |
27 | resolve(true) | 31 | resolve(true) |
28 | }) | 32 | }) |
29 | }, | 33 | }, |
34 | /** | ||
35 | * @description: resetdict | ||
36 | * @author: renchao | ||
37 | */ | ||
30 | resetdict ({ commit }) { | 38 | resetdict ({ commit }) { |
31 | commit('RESET_DICT') | 39 | commit('RESET_DICT') |
32 | } | 40 | } | ... | ... |
... | @@ -6,7 +6,7 @@ | ... | @@ -6,7 +6,7 @@ |
6 | 6 | ||
7 | import Layout from '@/layout' | 7 | import Layout from '@/layout' |
8 | /** | 8 | /** |
9 | * @description: | 9 | * @description: |
10 | * @param {*} routers | 10 | * @param {*} routers |
11 | * @author: renchao | 11 | * @author: renchao |
12 | */ | 12 | */ |
... | @@ -30,6 +30,11 @@ export default function filterAsyncRouter (routers) { | ... | @@ -30,6 +30,11 @@ export default function filterAsyncRouter (routers) { |
30 | }) | 30 | }) |
31 | return routers | 31 | return routers |
32 | } | 32 | } |
33 | /** | ||
34 | * @description: loadView | ||
35 | * @param {*} view | ||
36 | * @author: renchao | ||
37 | */ | ||
33 | function loadView (view) { | 38 | function loadView (view) { |
34 | return r => require.ensure([], () => r(require(`@/views${view}.vue`))) | 39 | return r => require.ensure([], () => r(require(`@/views${view}.vue`))) |
35 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
40 | } | ... | ... |
... | @@ -2,7 +2,18 @@ import {loadModules} from 'esri-loader' | ... | @@ -2,7 +2,18 @@ import {loadModules} from 'esri-loader' |
2 | 2 | ||
3 | export default { | 3 | export default { |
4 | methods: { | 4 | methods: { |
5 | 5 | /** | |
6 | * @description: identify | ||
7 | * @param {*} url | ||
8 | * @param {*} layerIds | ||
9 | * @param {*} geometry | ||
10 | * @param {*} callBackFunction | ||
11 | * @param {*} returnGeometry | ||
12 | * @param {*} layerOption | ||
13 | * @param {*} tolerance | ||
14 | * @param {*} mapExtent | ||
15 | * @author: renchao | ||
16 | */ | ||
6 | identify(url,layerIds,geometry,callBackFunction,returnGeometry,layerOption,tolerance,mapExtent){ | 17 | identify(url,layerIds,geometry,callBackFunction,returnGeometry,layerOption,tolerance,mapExtent){ |
7 | var self = this; | 18 | var self = this; |
8 | loadModules([ | 19 | loadModules([ |
... | @@ -19,7 +30,7 @@ export default { | ... | @@ -19,7 +30,7 @@ export default { |
19 | identifyParameters.geometry = geometry; | 30 | identifyParameters.geometry = geometry; |
20 | if(layerIds){ | 31 | if(layerIds){ |
21 | identifyParameters.layerIds = layerIds; | 32 | identifyParameters.layerIds = layerIds; |
22 | } | 33 | } |
23 | identifyParameters.layerOption = layerOption ? layerOption : "all"; | 34 | identifyParameters.layerOption = layerOption ? layerOption : "all"; |
24 | identifyParameters.tolerance = tolerance ? tolerance : 3; | 35 | identifyParameters.tolerance = tolerance ? tolerance : 3; |
25 | identifyParameters.mapExtent = mapExtent ? mapExtent : geometry.extent; | 36 | identifyParameters.mapExtent = mapExtent ? mapExtent : geometry.extent; |
... | @@ -34,7 +45,7 @@ export default { | ... | @@ -34,7 +45,7 @@ export default { |
34 | }).catch(err => { | 45 | }).catch(err => { |
35 | throw(err); | 46 | throw(err); |
36 | }); | 47 | }); |
37 | 48 | ||
38 | } | 49 | } |
39 | } | 50 | } |
40 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
51 | } | ... | ... |
1 | import {maps} from '@/libs/map/mapUtils' | 1 | import {maps} from '@/libs/map/mapUtils' |
2 | import {loadModules} from 'esri-loader' | 2 | import {loadModules} from 'esri-loader' |
3 | 3 | ||
4 | export default { | 4 | export default { |
... | @@ -10,6 +10,14 @@ export default { | ... | @@ -10,6 +10,14 @@ export default { |
10 | } | 10 | } |
11 | }, | 11 | }, |
12 | methods: { | 12 | methods: { |
13 | /** | ||
14 | * @description: initDraw | ||
15 | * @param {*} type | ||
16 | * @param {*} viewId | ||
17 | * @param {*} creationMode | ||
18 | * @param {*} callBackFunction | ||
19 | * @author: renchao | ||
20 | */ | ||
13 | initDraw(type,viewId,creationMode,callBackFunction){ | 21 | initDraw(type,viewId,creationMode,callBackFunction){ |
14 | var self = this; | 22 | var self = this; |
15 | loadModules([ | 23 | loadModules([ |
... | @@ -46,17 +54,21 @@ export default { | ... | @@ -46,17 +54,21 @@ export default { |
46 | if(callBackFunction && typeof callBackFunction == 'function'){ | 54 | if(callBackFunction && typeof callBackFunction == 'function'){ |
47 | callBackFunction(event.graphic.geometry); | 55 | callBackFunction(event.graphic.geometry); |
48 | } | 56 | } |
49 | 57 | ||
50 | } | 58 | } |
51 | }) | 59 | }) |
52 | }).catch(err=>{ | 60 | }).catch(err=>{ |
53 | throw(err); | 61 | throw(err); |
54 | }); | 62 | }); |
55 | }, | 63 | }, |
64 | /** | ||
65 | * @description: destroyeDraw | ||
66 | * @author: renchao | ||
67 | */ | ||
56 | destroyeDraw() { | 68 | destroyeDraw() { |
57 | if(this.drawAction){ | 69 | if(this.drawAction){ |
58 | this.drawAction.cancel(); | 70 | this.drawAction.cancel(); |
59 | } | 71 | } |
60 | } | 72 | } |
61 | } | 73 | } |
62 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
74 | } | ... | ... |
... | @@ -5,6 +5,13 @@ import {loadModules} from "esri-loader" | ... | @@ -5,6 +5,13 @@ import {loadModules} from "esri-loader" |
5 | 5 | ||
6 | export default { | 6 | export default { |
7 | methods:{ | 7 | methods:{ |
8 | /** | ||
9 | * @description: addGraphic | ||
10 | * @param {*} url | ||
11 | * @param {*} graphic | ||
12 | * @param {*} callBackFunction | ||
13 | * @author: renchao | ||
14 | */ | ||
8 | addGraphic(url,graphic,callBackFunction){ | 15 | addGraphic(url,graphic,callBackFunction){ |
9 | loadModules([ | 16 | loadModules([ |
10 | "esri/layers/FeatureLayer", | 17 | "esri/layers/FeatureLayer", |
... | @@ -57,6 +64,13 @@ export default { | ... | @@ -57,6 +64,13 @@ export default { |
57 | throw (err); | 64 | throw (err); |
58 | }) | 65 | }) |
59 | }, | 66 | }, |
67 | /** | ||
68 | * @description: updateGraphic | ||
69 | * @param {*} url | ||
70 | * @param {*} graphic | ||
71 | * @param {*} callBackFunction | ||
72 | * @author: renchao | ||
73 | */ | ||
60 | updateGraphic(url,graphic,callBackFunction){ | 74 | updateGraphic(url,graphic,callBackFunction){ |
61 | loadModules([ | 75 | loadModules([ |
62 | "esri/layers/FeatureLayer", | 76 | "esri/layers/FeatureLayer", |
... | @@ -107,6 +121,13 @@ export default { | ... | @@ -107,6 +121,13 @@ export default { |
107 | throw (err); | 121 | throw (err); |
108 | }) | 122 | }) |
109 | }, | 123 | }, |
124 | /** | ||
125 | * @description: delGraphic | ||
126 | * @param {*} url | ||
127 | * @param {*} graphic | ||
128 | * @param {*} callBackFunction | ||
129 | * @author: renchao | ||
130 | */ | ||
110 | delGraphic(url,graphic,callBackFunction){ | 131 | delGraphic(url,graphic,callBackFunction){ |
111 | loadModules([ | 132 | loadModules([ |
112 | "esri/layers/FeatureLayer", | 133 | "esri/layers/FeatureLayer", |
... | @@ -160,4 +181,4 @@ export default { | ... | @@ -160,4 +181,4 @@ export default { |
160 | }) | 181 | }) |
161 | } | 182 | } |
162 | } | 183 | } |
163 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
184 | } | ... | ... |
... | @@ -3,6 +3,16 @@ import {loadModules} from 'esri-loader' | ... | @@ -3,6 +3,16 @@ import {loadModules} from 'esri-loader' |
3 | export default { | 3 | export default { |
4 | 4 | ||
5 | methods:{ | 5 | methods:{ |
6 | /** | ||
7 | * @description: findByPro | ||
8 | * @param {*} url | ||
9 | * @param {*} layerIds | ||
10 | * @param {*} searchFields | ||
11 | * @param {*} searchText | ||
12 | * @param {*} returnGeometry | ||
13 | * @param {*} callBackFunction | ||
14 | * @author: renchao | ||
15 | */ | ||
6 | findByPro(url,layerIds,searchFields,searchText,returnGeometry,callBackFunction){ | 16 | findByPro(url,layerIds,searchFields,searchText,returnGeometry,callBackFunction){ |
7 | loadModules([ | 17 | loadModules([ |
8 | "esri/tasks/FindTask", | 18 | "esri/tasks/FindTask", |
... | @@ -32,4 +42,4 @@ export default { | ... | @@ -32,4 +42,4 @@ export default { |
32 | } | 42 | } |
33 | 43 | ||
34 | } | 44 | } |
35 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
45 | } | ... | ... |
... | @@ -9,6 +9,12 @@ | ... | @@ -9,6 +9,12 @@ |
9 | } | 9 | } |
10 | }, | 10 | }, |
11 | methods: { | 11 | methods: { |
12 | /** | ||
13 | * @description: measure | ||
14 | * @param {*} viewId | ||
15 | * @param {*} type | ||
16 | * @author: renchao | ||
17 | */ | ||
12 | measure(viewId,type){ | 18 | measure(viewId,type){ |
13 | var view = maps[viewId]; | 19 | var view = maps[viewId]; |
14 | var self = this; | 20 | var self = this; |
... | @@ -35,8 +41,8 @@ | ... | @@ -35,8 +41,8 @@ |
35 | view: view | 41 | view: view |
36 | }); | 42 | }); |
37 | } | 43 | } |
38 | 44 | ||
39 | 45 | ||
40 | // skip the initial 'new measurement' button | 46 | // skip the initial 'new measurement' button |
41 | self.areaActive.viewModel.start(); | 47 | self.areaActive.viewModel.start(); |
42 | break; | 48 | break; |
... | @@ -59,4 +65,4 @@ | ... | @@ -59,4 +65,4 @@ |
59 | } | 65 | } |
60 | 66 | ||
61 | } | 67 | } |
62 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
68 | } | ... | ... |
... | @@ -4,6 +4,17 @@ import {loadModules} from 'esri-loader' | ... | @@ -4,6 +4,17 @@ import {loadModules} from 'esri-loader' |
4 | export default{ | 4 | export default{ |
5 | 5 | ||
6 | methods: { | 6 | methods: { |
7 | /** | ||
8 | * @description: queryByWhere | ||
9 | * @param {*} url | ||
10 | * @param {*} queryWhere | ||
11 | * @param {*} geometry | ||
12 | * @param {*} returnGeometry | ||
13 | * @param {*} outFields | ||
14 | * @param {*} outSpatialReference | ||
15 | * @param {*} callBackFunction | ||
16 | * @author: renchao | ||
17 | */ | ||
7 | queryByWhere(url,queryWhere,geometry,returnGeometry,outFields ,outSpatialReference ,callBackFunction){ | 18 | queryByWhere(url,queryWhere,geometry,returnGeometry,outFields ,outSpatialReference ,callBackFunction){ |
8 | var self = this; | 19 | var self = this; |
9 | loadModules([ | 20 | loadModules([ |
... | @@ -55,6 +66,11 @@ export default{ | ... | @@ -55,6 +66,11 @@ export default{ |
55 | throw(err); | 66 | throw(err); |
56 | }) | 67 | }) |
57 | }, | 68 | }, |
69 | /** | ||
70 | * @description: parseObj2Arr | ||
71 | * @param {*} object | ||
72 | * @author: renchao | ||
73 | */ | ||
58 | parseObj2Arr(object){ | 74 | parseObj2Arr(object){ |
59 | var arr = []; | 75 | var arr = []; |
60 | for(var key in object){ | 76 | for(var key in object){ |
... | @@ -64,6 +80,6 @@ export default{ | ... | @@ -64,6 +80,6 @@ export default{ |
64 | arr.push(obj); | 80 | arr.push(obj); |
65 | } | 81 | } |
66 | return arr; | 82 | return arr; |
67 | } | 83 | } |
68 | }, | 84 | }, |
69 | } | 85 | } | ... | ... |
... | @@ -4,8 +4,14 @@ export default{ | ... | @@ -4,8 +4,14 @@ export default{ |
4 | 4 | ||
5 | methods: { | 5 | methods: { |
6 | 6 | ||
7 | /** | ||
8 | * @description: readShpByFile | ||
9 | * @param {*} file | ||
10 | * @param {*} callBackFunction | ||
11 | * @author: renchao | ||
12 | */ | ||
7 | readShpByFile(file,callBackFunction){ | 13 | readShpByFile(file,callBackFunction){ |
8 | var reader = new FileReader(); | 14 | var reader = new FileReader(); |
9 | reader.readAsBinaryString(file); | 15 | reader.readAsBinaryString(file); |
10 | reader.οnlοad=function(){ | 16 | reader.οnlοad=function(){ |
11 | var fileData = this.result ; //fileData就是读取到的文件的二进制数据 | 17 | var fileData = this.result ; //fileData就是读取到的文件的二进制数据 |
... | @@ -20,6 +26,12 @@ export default{ | ... | @@ -20,6 +26,12 @@ export default{ |
20 | .catch(error => console.error(error.stack)); | 26 | .catch(error => console.error(error.stack)); |
21 | } | 27 | } |
22 | }, | 28 | }, |
29 | /** | ||
30 | * @description: readShpByFile | ||
31 | * @param {*} url | ||
32 | * @param {*} callBackFunction | ||
33 | * @author: renchao | ||
34 | */ | ||
23 | readShpByUrl(url,callBackFunction){ | 35 | readShpByUrl(url,callBackFunction){ |
24 | open(url).then(source => source.read() | 36 | open(url).then(source => source.read() |
25 | .then(function log(result) { | 37 | .then(function log(result) { |
... | @@ -32,8 +44,14 @@ export default{ | ... | @@ -32,8 +44,14 @@ export default{ |
32 | .catch(error => console.error(error.stack)); | 44 | .catch(error => console.error(error.stack)); |
33 | } | 45 | } |
34 | }, | 46 | }, |
47 | /** | ||
48 | * @description: readShpByZip | ||
49 | * @param {*} zipUrl | ||
50 | * @param {*} callBackFunction | ||
51 | * @author: renchao | ||
52 | */ | ||
35 | readShpByZip(zipUrl,callBackFunction){ | 53 | readShpByZip(zipUrl,callBackFunction){ |
36 | 54 | ||
37 | } | 55 | } |
38 | 56 | ||
39 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
57 | } | ... | ... |
... | @@ -21,12 +21,21 @@ export default { | ... | @@ -21,12 +21,21 @@ export default { |
21 | this.handleSearch() | 21 | this.handleSearch() |
22 | }, | 22 | }, |
23 | methods: { | 23 | methods: { |
24 | /** | ||
25 | * @description: handkeyCode | ||
26 | * @param {*} e | ||
27 | * @author: renchao | ||
28 | */ | ||
24 | handkeyCode(e) { | 29 | handkeyCode(e) { |
25 | if(e.keyCode === 13){ | 30 | if(e.keyCode === 13){ |
26 | console.log("安"); | 31 | console.log("安"); |
27 | this.handleSearch() | 32 | this.handleSearch() |
28 | } | 33 | } |
29 | }, | 34 | }, |
35 | /** | ||
36 | * @description: handleSearch | ||
37 | * @author: renchao | ||
38 | */ | ||
30 | handleSearch(){ | 39 | handleSearch(){ |
31 | this.pageData.currentPage = 1 | 40 | this.pageData.currentPage = 1 |
32 | if (this.fetchData) { | 41 | if (this.fetchData) { |
... | @@ -36,22 +45,41 @@ export default { | ... | @@ -36,22 +45,41 @@ export default { |
36 | this.queryClick() | 45 | this.queryClick() |
37 | } | 46 | } |
38 | }, | 47 | }, |
48 | /** | ||
49 | * @description: handleSizeChange | ||
50 | * @param {*} val | ||
51 | * @author: renchao | ||
52 | */ | ||
39 | handleSizeChange (val) { | 53 | handleSizeChange (val) { |
40 | this.pageData.currentPage = 1 | 54 | this.pageData.currentPage = 1 |
41 | this.pageData.pageSize = val | 55 | this.pageData.pageSize = val |
42 | this.queryClick() | 56 | this.queryClick() |
43 | }, | 57 | }, |
58 | /** | ||
59 | * @description: handleCurrentChange | ||
60 | * @param {*} val | ||
61 | * @author: renchao | ||
62 | */ | ||
44 | handleCurrentChange (val) { | 63 | handleCurrentChange (val) { |
45 | this.pageData.currentPage = val | 64 | this.pageData.currentPage = val |
46 | if (this.queryClick) { | 65 | if (this.queryClick) { |
47 | this.queryClick() | 66 | this.queryClick() |
48 | } | 67 | } |
49 | }, | 68 | }, |
69 | /** | ||
70 | * @description: handleDel | ||
71 | * @author: renchao | ||
72 | */ | ||
50 | handleDel () { | 73 | handleDel () { |
51 | let deleteAfterPage = Math.ceil((this.tableData.total - 1) / this.pageData.pageSize) | 74 | let deleteAfterPage = Math.ceil((this.tableData.total - 1) / this.pageData.pageSize) |
52 | let currentPage = this.pageData.currentPage > deleteAfterPage ? deleteAfterPage : this.pageData.currentPage | 75 | let currentPage = this.pageData.currentPage > deleteAfterPage ? deleteAfterPage : this.pageData.currentPage |
53 | this.pageData.currentPage = currentPage < 1 ? 1 : currentPage | 76 | this.pageData.currentPage = currentPage < 1 ? 1 : currentPage |
54 | }, | 77 | }, |
78 | /** | ||
79 | * @description: resetForm | ||
80 | * @param {*} isYwbl | ||
81 | * @author: renchao | ||
82 | */ | ||
55 | resetForm(isYwbl){ | 83 | resetForm(isYwbl){ |
56 | if (isYwbl) { | 84 | if (isYwbl) { |
57 | this.queryForm = defaultParameters.defaultParameters(); | 85 | this.queryForm = defaultParameters.defaultParameters(); | ... | ... |
-
Please register or sign in to post a comment