Merge branch 'dev' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web into dev
Showing
41 changed files
with
1655 additions
and
5939 deletions
| ... | @@ -6,6 +6,11 @@ import afterLeave from 'element-ui/src/utils/after-leave'; | ... | @@ -6,6 +6,11 @@ import afterLeave from 'element-ui/src/utils/after-leave'; |
| 6 | const Mask = Vue.extend(Loading); | 6 | const Mask = Vue.extend(Loading); |
| 7 | 7 | ||
| 8 | const loadingDirective = {}; | 8 | const loadingDirective = {}; |
| 9 | |||
| 10 | /** | ||
| 11 | * @description: install | ||
| 12 | * @author: renchao | ||
| 13 | */ | ||
| 9 | loadingDirective.install = Vue => { | 14 | loadingDirective.install = Vue => { |
| 10 | if (Vue.prototype.$isServer) return; | 15 | if (Vue.prototype.$isServer) return; |
| 11 | const toggleLoading = (el, binding) => { | 16 | const toggleLoading = (el, binding) => { |
| ... | @@ -110,14 +115,24 @@ loadingDirective.install = Vue => { | ... | @@ -110,14 +115,24 @@ loadingDirective.install = Vue => { |
| 110 | 115 | ||
| 111 | binding.value && toggleLoading(el, binding); | 116 | binding.value && toggleLoading(el, binding); |
| 112 | }, | 117 | }, |
| 113 | 118 | /** | |
| 119 | * @description: update | ||
| 120 | * @param {*} el | ||
| 121 | * @param {*} binding | ||
| 122 | * @author: renchao | ||
| 123 | */ | ||
| 114 | update: function (el, binding) { | 124 | update: function (el, binding) { |
| 115 | el.instance.setText(el.getAttribute('element-loading-text')); | 125 | el.instance.setText(el.getAttribute('element-loading-text')); |
| 116 | if (binding.oldValue !== binding.value) { | 126 | if (binding.oldValue !== binding.value) { |
| 117 | toggleLoading(el, binding); | 127 | toggleLoading(el, binding); |
| 118 | } | 128 | } |
| 119 | }, | 129 | }, |
| 120 | 130 | /** | |
| 131 | * @description: unbind | ||
| 132 | * @param {*} el | ||
| 133 | * @param {*} binding | ||
| 134 | * @author: renchao | ||
| 135 | */ | ||
| 121 | unbind: function (el, binding) { | 136 | unbind: function (el, binding) { |
| 122 | if (el.domInserted) { | 137 | if (el.domInserted) { |
| 123 | el.mask && | 138 | el.mask && | ... | ... |
| ... | @@ -20,6 +20,10 @@ let fullscreenLoading; | ... | @@ -20,6 +20,10 @@ let fullscreenLoading; |
| 20 | LoadingConstructor.prototype.originalPosition = ''; | 20 | LoadingConstructor.prototype.originalPosition = ''; |
| 21 | LoadingConstructor.prototype.originalOverflow = ''; | 21 | LoadingConstructor.prototype.originalOverflow = ''; |
| 22 | 22 | ||
| 23 | /** | ||
| 24 | * @description: close | ||
| 25 | * @author: renchao | ||
| 26 | */ | ||
| 23 | LoadingConstructor.prototype.close = function() { | 27 | LoadingConstructor.prototype.close = function() { |
| 24 | if (this.fullscreen) { | 28 | if (this.fullscreen) { |
| 25 | fullscreenLoading = undefined; | 29 | fullscreenLoading = undefined; |
| ... | @@ -38,6 +42,13 @@ LoadingConstructor.prototype.close = function() { | ... | @@ -38,6 +42,13 @@ LoadingConstructor.prototype.close = function() { |
| 38 | this.visible = false; | 42 | this.visible = false; |
| 39 | }; | 43 | }; |
| 40 | 44 | ||
| 45 | /** | ||
| 46 | * @description: addStyle | ||
| 47 | * @param {*} options | ||
| 48 | * @param {*} parent | ||
| 49 | * @param {*} instance | ||
| 50 | * @author: renchao | ||
| 51 | */ | ||
| 41 | const addStyle = (options, parent, instance) => { | 52 | const addStyle = (options, parent, instance) => { |
| 42 | let maskStyle = {}; | 53 | let maskStyle = {}; |
| 43 | if (options.fullscreen) { | 54 | if (options.fullscreen) { |
| ... | @@ -64,6 +75,10 @@ const addStyle = (options, parent, instance) => { | ... | @@ -64,6 +75,10 @@ const addStyle = (options, parent, instance) => { |
| 64 | }); | 75 | }); |
| 65 | }; | 76 | }; |
| 66 | 77 | ||
| 78 | /** | ||
| 79 | * @description: Loading | ||
| 80 | * @author: renchao | ||
| 81 | */ | ||
| 67 | const Loading = (options = {}) => { | 82 | const Loading = (options = {}) => { |
| 68 | if (Vue.prototype.$isServer) return; | 83 | if (Vue.prototype.$isServer) return; |
| 69 | options = merge({}, defaults, options); | 84 | options = merge({}, defaults, options); | ... | ... |
| ... | @@ -43,6 +43,11 @@ const MessageBoxConstructor = Vue.extend(msgboxVue); | ... | @@ -43,6 +43,11 @@ const MessageBoxConstructor = Vue.extend(msgboxVue); |
| 43 | let currentMsg, instance; | 43 | let currentMsg, instance; |
| 44 | let msgQueue = []; | 44 | let msgQueue = []; |
| 45 | 45 | ||
| 46 | |||
| 47 | /** | ||
| 48 | * @description: defaultCallback | ||
| 49 | * @author: renchao | ||
| 50 | */ | ||
| 46 | const defaultCallback = action => { | 51 | const defaultCallback = action => { |
| 47 | if (currentMsg) { | 52 | if (currentMsg) { |
| 48 | let callback = currentMsg.callback; | 53 | let callback = currentMsg.callback; |
| ... | @@ -56,6 +61,10 @@ const defaultCallback = action => { | ... | @@ -56,6 +61,10 @@ const defaultCallback = action => { |
| 56 | } | 61 | } |
| 57 | }; | 62 | }; |
| 58 | 63 | ||
| 64 | /** | ||
| 65 | * @description: initInstance | ||
| 66 | * @author: renchao | ||
| 67 | */ | ||
| 59 | const initInstance = () => { | 68 | const initInstance = () => { |
| 60 | instance = new MessageBoxConstructor({ | 69 | instance = new MessageBoxConstructor({ |
| 61 | el: document.createElement('div') | 70 | el: document.createElement('div') |
| ... | @@ -64,6 +73,10 @@ const initInstance = () => { | ... | @@ -64,6 +73,10 @@ const initInstance = () => { |
| 64 | instance.callback = defaultCallback; | 73 | instance.callback = defaultCallback; |
| 65 | }; | 74 | }; |
| 66 | 75 | ||
| 76 | /** | ||
| 77 | * @description: showNextMsg | ||
| 78 | * @author: renchao | ||
| 79 | */ | ||
| 67 | const showNextMsg = () => { | 80 | const showNextMsg = () => { |
| 68 | if (!instance) { | 81 | if (!instance) { |
| 69 | initInstance(); | 82 | initInstance(); |
| ... | @@ -109,6 +122,10 @@ const showNextMsg = () => { | ... | @@ -109,6 +122,10 @@ const showNextMsg = () => { |
| 109 | } | 122 | } |
| 110 | }; | 123 | }; |
| 111 | 124 | ||
| 125 | /** | ||
| 126 | * @description: MessageBox | ||
| 127 | * @author: renchao | ||
| 128 | */ | ||
| 112 | const MessageBox = function (options, callback) { | 129 | const MessageBox = function (options, callback) { |
| 113 | if (Vue.prototype.$isServer) return; | 130 | if (Vue.prototype.$isServer) return; |
| 114 | if (typeof options === 'string' || isVNode(options)) { | 131 | if (typeof options === 'string' || isVNode(options)) { |
| ... | @@ -143,10 +160,18 @@ const MessageBox = function (options, callback) { | ... | @@ -143,10 +160,18 @@ const MessageBox = function (options, callback) { |
| 143 | } | 160 | } |
| 144 | }; | 161 | }; |
| 145 | 162 | ||
| 163 | /** | ||
| 164 | * @description: setDefaults | ||
| 165 | * @author: renchao | ||
| 166 | */ | ||
| 146 | MessageBox.setDefaults = defaults => { | 167 | MessageBox.setDefaults = defaults => { |
| 147 | MessageBox.defaults = defaults; | 168 | MessageBox.defaults = defaults; |
| 148 | }; | 169 | }; |
| 149 | 170 | ||
| 171 | /** | ||
| 172 | * @description: alert | ||
| 173 | * @author: renchao | ||
| 174 | */ | ||
| 150 | MessageBox.alert = (title, message, options) => { | 175 | MessageBox.alert = (title, message, options) => { |
| 151 | if (typeof title === 'object') { | 176 | if (typeof title === 'object') { |
| 152 | options = title; | 177 | options = title; |
| ... | @@ -163,6 +188,10 @@ MessageBox.alert = (title, message, options) => { | ... | @@ -163,6 +188,10 @@ MessageBox.alert = (title, message, options) => { |
| 163 | }, options)); | 188 | }, options)); |
| 164 | }; | 189 | }; |
| 165 | 190 | ||
| 191 | /** | ||
| 192 | * @description: close | ||
| 193 | * @author: renchao | ||
| 194 | */ | ||
| 166 | MessageBox.close = () => { | 195 | MessageBox.close = () => { |
| 167 | instance.doClose(); | 196 | instance.doClose(); |
| 168 | instance.visible = false; | 197 | instance.visible = false; | ... | ... |
| ... | @@ -97,6 +97,10 @@ export default { | ... | @@ -97,6 +97,10 @@ export default { |
| 97 | }, | 97 | }, |
| 98 | 98 | ||
| 99 | methods: { | 99 | methods: { |
| 100 | /** | ||
| 101 | * @description: getSafeClose | ||
| 102 | * @author: renchao | ||
| 103 | */ | ||
| 100 | getSafeClose () { | 104 | getSafeClose () { |
| 101 | const currentId = this.uid; | 105 | const currentId = this.uid; |
| 102 | return () => { | 106 | return () => { |
| ... | @@ -105,6 +109,10 @@ export default { | ... | @@ -105,6 +109,10 @@ export default { |
| 105 | }); | 109 | }); |
| 106 | }; | 110 | }; |
| 107 | }, | 111 | }, |
| 112 | /** | ||
| 113 | * @description: doClose | ||
| 114 | * @author: renchao | ||
| 115 | */ | ||
| 108 | doClose () { | 116 | doClose () { |
| 109 | if (!this.visible) return; | 117 | if (!this.visible) return; |
| 110 | this.visible = false; | 118 | this.visible = false; |
| ... | @@ -122,18 +130,31 @@ export default { | ... | @@ -122,18 +130,31 @@ export default { |
| 122 | }); | 130 | }); |
| 123 | }, | 131 | }, |
| 124 | 132 | ||
| 133 | /** | ||
| 134 | * @description: handleWrapperClick | ||
| 135 | * @author: renchao | ||
| 136 | */ | ||
| 125 | handleWrapperClick () { | 137 | handleWrapperClick () { |
| 126 | if (this.closeOnClickModal) { | 138 | if (this.closeOnClickModal) { |
| 127 | this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel'); | 139 | this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel'); |
| 128 | } | 140 | } |
| 129 | }, | 141 | }, |
| 130 | 142 | ||
| 143 | /** | ||
| 144 | * @description: handleInputEnter | ||
| 145 | * @author: renchao | ||
| 146 | */ | ||
| 131 | handleInputEnter () { | 147 | handleInputEnter () { |
| 132 | if (this.inputType !== 'textarea') { | 148 | if (this.inputType !== 'textarea') { |
| 133 | return this.handleAction('confirm'); | 149 | return this.handleAction('confirm'); |
| 134 | } | 150 | } |
| 135 | }, | 151 | }, |
| 136 | 152 | ||
| 153 | /** | ||
| 154 | * @description: handleAction | ||
| 155 | * @param {*} action | ||
| 156 | * @author: renchao | ||
| 157 | */ | ||
| 137 | handleAction (action) { | 158 | handleAction (action) { |
| 138 | if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) { | 159 | if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) { |
| 139 | return; | 160 | return; |
| ... | @@ -147,6 +168,10 @@ export default { | ... | @@ -147,6 +168,10 @@ export default { |
| 147 | } | 168 | } |
| 148 | }, | 169 | }, |
| 149 | 170 | ||
| 171 | /** | ||
| 172 | * @description: validate | ||
| 173 | * @author: renchao | ||
| 174 | */ | ||
| 150 | validate () { | 175 | validate () { |
| 151 | if (this.$type === 'prompt') { | 176 | if (this.$type === 'prompt') { |
| 152 | const inputPattern = this.inputPattern; | 177 | const inputPattern = this.inputPattern; |
| ... | @@ -174,15 +199,27 @@ export default { | ... | @@ -174,15 +199,27 @@ export default { |
| 174 | removeClass(this.getInputElement(), 'invalid'); | 199 | removeClass(this.getInputElement(), 'invalid'); |
| 175 | return true; | 200 | return true; |
| 176 | }, | 201 | }, |
| 202 | /** | ||
| 203 | * @description: getFirstFocus | ||
| 204 | * @author: renchao | ||
| 205 | */ | ||
| 177 | getFirstFocus () { | 206 | getFirstFocus () { |
| 178 | const btn = this.$el.querySelector('.el-message-box__btns .el-button'); | 207 | const btn = this.$el.querySelector('.el-message-box__btns .el-button'); |
| 179 | const title = this.$el.querySelector('.el-message-box__btns .el-message-box__title'); | 208 | const title = this.$el.querySelector('.el-message-box__btns .el-message-box__title'); |
| 180 | return btn || title; | 209 | return btn || title; |
| 181 | }, | 210 | }, |
| 211 | /** | ||
| 212 | * @description: getInputElement | ||
| 213 | * @author: renchao | ||
| 214 | */ | ||
| 182 | getInputElement () { | 215 | getInputElement () { |
| 183 | const inputRefs = this.$refs.input.$refs; | 216 | const inputRefs = this.$refs.input.$refs; |
| 184 | return inputRefs.input || inputRefs.textarea; | 217 | return inputRefs.input || inputRefs.textarea; |
| 185 | }, | 218 | }, |
| 219 | /** | ||
| 220 | * @description: handleClose | ||
| 221 | * @author: renchao | ||
| 222 | */ | ||
| 186 | handleClose () { | 223 | handleClose () { |
| 187 | this.handleAction('close'); | 224 | this.handleAction('close'); |
| 188 | } | 225 | } |
| ... | @@ -200,6 +237,11 @@ export default { | ... | @@ -200,6 +237,11 @@ export default { |
| 200 | } | 237 | } |
| 201 | }, | 238 | }, |
| 202 | 239 | ||
| 240 | /** | ||
| 241 | * @description: visible | ||
| 242 | * @param {*} val | ||
| 243 | * @author: renchao | ||
| 244 | */ | ||
| 203 | visible (val) { | 245 | visible (val) { |
| 204 | if (val) { | 246 | if (val) { |
| 205 | this.uid++; | 247 | this.uid++; |
| ... | @@ -222,6 +264,10 @@ export default { | ... | @@ -222,6 +264,10 @@ export default { |
| 222 | } | 264 | } |
| 223 | }, | 265 | }, |
| 224 | 266 | ||
| 267 | /** | ||
| 268 | * @description: mounted | ||
| 269 | * @author: renchao | ||
| 270 | */ | ||
| 225 | mounted () { | 271 | mounted () { |
| 226 | this.$nextTick(() => { | 272 | this.$nextTick(() => { |
| 227 | if (this.closeOnHashChange) { | 273 | if (this.closeOnHashChange) { |
| ... | @@ -230,6 +276,10 @@ export default { | ... | @@ -230,6 +276,10 @@ export default { |
| 230 | }); | 276 | }); |
| 231 | }, | 277 | }, |
| 232 | 278 | ||
| 279 | /** | ||
| 280 | * @description: beforeDestroy | ||
| 281 | * @author: renchao | ||
| 282 | */ | ||
| 233 | beforeDestroy () { | 283 | beforeDestroy () { |
| 234 | if (this.closeOnHashChange) { | 284 | if (this.closeOnHashChange) { |
| 235 | window.removeEventListener('hashchange', this.close); | 285 | window.removeEventListener('hashchange', this.close); |
| ... | @@ -298,4 +348,4 @@ export default { | ... | @@ -298,4 +348,4 @@ export default { |
| 298 | /deep/.el-message-box__content { | 348 | /deep/.el-message-box__content { |
| 299 | padding-top: 0; | 349 | padding-top: 0; |
| 300 | } | 350 | } |
| 301 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 351 | </style> | ... | ... |
| ... | @@ -49,10 +49,18 @@ export default { | ... | @@ -49,10 +49,18 @@ export default { |
| 49 | } | 49 | } |
| 50 | }, | 50 | }, |
| 51 | methods: { | 51 | methods: { |
| 52 | /** | ||
| 53 | * @description: handleNotice | ||
| 54 | * @param {*} item | ||
| 55 | * @author: renchao | ||
| 56 | */ | ||
| 52 | handleNotice (item) { | 57 | handleNotice (item) { |
| 53 | this.$alertMes(item.noticeTitle, item.noticeContent) | 58 | this.$alertMes(item.noticeTitle, item.noticeContent) |
| 54 | }, | 59 | }, |
| 55 | // 获取数据 | 60 | /** |
| 61 | * @description: 获取数据 | ||
| 62 | * @author: renchao | ||
| 63 | */ | ||
| 56 | getData () { | 64 | getData () { |
| 57 | let style = document.styleSheets[0]; | 65 | let style = document.styleSheets[0]; |
| 58 | let text = this.$refs.text; | 66 | let text = this.$refs.text; |
| ... | @@ -72,13 +80,19 @@ export default { | ... | @@ -72,13 +80,19 @@ export default { |
| 72 | this.changeState(); | 80 | this.changeState(); |
| 73 | }, 300); | 81 | }, 300); |
| 74 | }, | 82 | }, |
| 75 | // 用速度计算时间(想要保持速度一样,2种状态时间不同需算出) | 83 | /** |
| 84 | * @description: 用速度计算时间(想要保持速度一样,2种状态时间不同需算出) | ||
| 85 | * @author: renchao | ||
| 86 | */ | ||
| 76 | ComputationTime () { | 87 | ComputationTime () { |
| 77 | this.firstAnimationTime = this.wordLength / this.speed; | 88 | this.firstAnimationTime = this.wordLength / this.speed; |
| 78 | this.secondAnimationTime = | 89 | this.secondAnimationTime = |
| 79 | (this.wordLength + this.backWidth) / this.speed; | 90 | (this.wordLength + this.backWidth) / this.speed; |
| 80 | }, | 91 | }, |
| 81 | // 根据状态切换动画 | 92 | /** |
| 93 | * @description: 根据状态切换动画 | ||
| 94 | * @author: renchao | ||
| 95 | */ | ||
| 82 | changeState () { | 96 | changeState () { |
| 83 | let text = this.$refs.text; | 97 | let text = this.$refs.text; |
| 84 | if (this.state == 1) { | 98 | if (this.state == 1) { |
| ... | @@ -88,6 +102,10 @@ export default { | ... | @@ -88,6 +102,10 @@ export default { |
| 88 | text.style.animation = `secondAnimation ${this.secondAnimationTime}s linear infinite`; | 102 | text.style.animation = `secondAnimation ${this.secondAnimationTime}s linear infinite`; |
| 89 | } | 103 | } |
| 90 | }, | 104 | }, |
| 105 | /** | ||
| 106 | * @description: Listener | ||
| 107 | * @author: renchao | ||
| 108 | */ | ||
| 91 | Listener () { | 109 | Listener () { |
| 92 | let text = this.$refs.text; | 110 | let text = this.$refs.text; |
| 93 | text.addEventListener( | 111 | text.addEventListener( |
| ... | @@ -98,10 +116,18 @@ export default { | ... | @@ -98,10 +116,18 @@ export default { |
| 98 | false | 116 | false |
| 99 | ) | 117 | ) |
| 100 | }, | 118 | }, |
| 119 | /** | ||
| 120 | * @description: mouseOver | ||
| 121 | * @author: renchao | ||
| 122 | */ | ||
| 101 | mouseOver () { | 123 | mouseOver () { |
| 102 | let text = this.$refs.text; | 124 | let text = this.$refs.text; |
| 103 | text.style.animationPlayState = 'paused' | 125 | text.style.animationPlayState = 'paused' |
| 104 | }, | 126 | }, |
| 127 | /** | ||
| 128 | * @description: mouseLeave | ||
| 129 | * @author: renchao | ||
| 130 | */ | ||
| 105 | mouseLeave () { | 131 | mouseLeave () { |
| 106 | let text = this.$refs.text; | 132 | let text = this.$refs.text; |
| 107 | text.style.animationPlayState = '' | 133 | text.style.animationPlayState = '' |
| ... | @@ -151,4 +177,4 @@ export default { | ... | @@ -151,4 +177,4 @@ export default { |
| 151 | } | 177 | } |
| 152 | } | 178 | } |
| 153 | } | 179 | } |
| 154 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 180 | </style> | ... | ... |
| ... | @@ -188,6 +188,10 @@ | ... | @@ -188,6 +188,10 @@ |
| 188 | this.$img = this.$refs["img"]; | 188 | this.$img = this.$refs["img"]; |
| 189 | }, | 189 | }, |
| 190 | methods: { | 190 | methods: { |
| 191 | /** | ||
| 192 | * @description: imgLoaded | ||
| 193 | * @author: renchao | ||
| 194 | */ | ||
| 191 | imgLoaded () { | 195 | imgLoaded () { |
| 192 | let imgInfo = this.$img.getBoundingClientRect(); | 196 | let imgInfo = this.$img.getBoundingClientRect(); |
| 193 | if (JSON.stringify(this.imgInfo) != JSON.stringify(imgInfo)) { | 197 | if (JSON.stringify(this.imgInfo) != JSON.stringify(imgInfo)) { |
| ... | @@ -200,6 +204,10 @@ | ... | @@ -200,6 +204,10 @@ |
| 200 | this.$emit("created", imgInfo); | 204 | this.$emit("created", imgInfo); |
| 201 | } | 205 | } |
| 202 | }, | 206 | }, |
| 207 | /** | ||
| 208 | * @description: mouseMove | ||
| 209 | * @author: renchao | ||
| 210 | */ | ||
| 203 | mouseMove (e) { | 211 | mouseMove (e) { |
| 204 | if (!this.hideZoom && this.imgLoadedFlag) { | 212 | if (!this.hideZoom && this.imgLoadedFlag) { |
| 205 | this.imgLoaded(); | 213 | this.imgLoaded(); |
| ... | @@ -225,6 +233,11 @@ | ... | @@ -225,6 +233,11 @@ |
| 225 | selector.bgTop = addWidth - y * scale; | 233 | selector.bgTop = addWidth - y * scale; |
| 226 | } | 234 | } |
| 227 | }, | 235 | }, |
| 236 | /** | ||
| 237 | * @description: initSelectorProperty | ||
| 238 | * @param {*} selectorWidth | ||
| 239 | * @author: renchao | ||
| 240 | */ | ||
| 228 | initSelectorProperty (selectorWidth) { | 241 | initSelectorProperty (selectorWidth) { |
| 229 | const selectorHalfWidth = selectorWidth / 2; | 242 | const selectorHalfWidth = selectorWidth / 2; |
| 230 | const selector = this.selector; | 243 | const selector = this.selector; |
| ... | @@ -236,12 +249,20 @@ | ... | @@ -236,12 +249,20 @@ |
| 236 | selector.absoluteLeft = left + selectorHalfWidth + scrollLeft; | 249 | selector.absoluteLeft = left + selectorHalfWidth + scrollLeft; |
| 237 | selector.absoluteTop = top + selectorHalfWidth + scrollTop; | 250 | selector.absoluteTop = top + selectorHalfWidth + scrollTop; |
| 238 | }, | 251 | }, |
| 252 | /** | ||
| 253 | * @description: mouseLeave | ||
| 254 | * @author: renchao | ||
| 255 | */ | ||
| 239 | mouseLeave () { | 256 | mouseLeave () { |
| 240 | this.hideSelector = true; | 257 | this.hideSelector = true; |
| 241 | if (this.outShow) { | 258 | if (this.outShow) { |
| 242 | this.hideOutShow = true; | 259 | this.hideOutShow = true; |
| 243 | } | 260 | } |
| 244 | }, | 261 | }, |
| 262 | /** | ||
| 263 | * @description: reset | ||
| 264 | * @author: renchao | ||
| 265 | */ | ||
| 245 | reset () { | 266 | reset () { |
| 246 | Object.assign(this.selector, { | 267 | Object.assign(this.selector, { |
| 247 | top: 0, | 268 | top: 0, |
| ... | @@ -251,9 +272,18 @@ | ... | @@ -251,9 +272,18 @@ |
| 251 | }); | 272 | }); |
| 252 | this.resetOutShowInitPosition(); | 273 | this.resetOutShowInitPosition(); |
| 253 | }, | 274 | }, |
| 275 | /** | ||
| 276 | * @description: resetOutShowInitPosition | ||
| 277 | * @author: renchao | ||
| 278 | */ | ||
| 254 | resetOutShowInitPosition () { | 279 | resetOutShowInitPosition () { |
| 255 | this.outShowInitTop = 0; | 280 | this.outShowInitTop = 0; |
| 256 | }, | 281 | }, |
| 282 | /** | ||
| 283 | * @description: resetOutShowInitPosition | ||
| 284 | * @param {*} e | ||
| 285 | * @author: renchao | ||
| 286 | */ | ||
| 257 | imgerrorfun (e) { | 287 | imgerrorfun (e) { |
| 258 | // let img = require('@/assets/vehicle_img/blank_vehicle.jpg') | 288 | // let img = require('@/assets/vehicle_img/blank_vehicle.jpg') |
| 259 | // this.url = img | 289 | // this.url = img |
| ... | @@ -326,4 +356,4 @@ | ... | @@ -326,4 +356,4 @@ |
| 326 | top: 50%; | 356 | top: 50%; |
| 327 | transform: translateY(-50%); | 357 | transform: translateY(-50%); |
| 328 | } | 358 | } |
| 329 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 359 | </style> | ... | ... |
| ... | @@ -2,6 +2,15 @@ import Vue from 'vue' | ... | @@ -2,6 +2,15 @@ import Vue from 'vue' |
| 2 | import Popup from './index.vue' | 2 | import Popup from './index.vue' |
| 3 | 3 | ||
| 4 | const PopupBox = Vue.extend(Popup) | 4 | const PopupBox = Vue.extend(Popup) |
| 5 | |||
| 6 | /** | ||
| 7 | * @description: install | ||
| 8 | * @param {*} title | ||
| 9 | * @param {*} editItem | ||
| 10 | * @param {*} data | ||
| 11 | * @param {*} formData | ||
| 12 | * @author: renchao | ||
| 13 | */ | ||
| 5 | Popup.install = function (title, editItem, data, formData) { | 14 | Popup.install = function (title, editItem, data, formData) { |
| 6 | data.title = title | 15 | data.title = title |
| 7 | data.editItem = editItem | 16 | data.editItem = editItem | ... | ... |
| ... | @@ -55,7 +55,10 @@ export default { | ... | @@ -55,7 +55,10 @@ export default { |
| 55 | } | 55 | } |
| 56 | }, | 56 | }, |
| 57 | mounted () { | 57 | mounted () { |
| 58 | // 计算滚动条高度 | 58 | /** |
| 59 | * @description: 计算滚动条高度 | ||
| 60 | * @author: renchao | ||
| 61 | */ | ||
| 59 | setTimeout(() => { | 62 | setTimeout(() => { |
| 60 | if (this.btnShow) { | 63 | if (this.btnShow) { |
| 61 | if (this.height == 'auto') { | 64 | if (this.height == 'auto') { |
| ... | @@ -73,10 +76,18 @@ export default { | ... | @@ -73,10 +76,18 @@ export default { |
| 73 | }, 300) | 76 | }, 300) |
| 74 | }, | 77 | }, |
| 75 | methods: { | 78 | methods: { |
| 79 | /** | ||
| 80 | * @description: onCancel | ||
| 81 | * @author: renchao | ||
| 82 | */ | ||
| 76 | onCancel () { | 83 | onCancel () { |
| 77 | this.isShow = false | 84 | this.isShow = false |
| 78 | this.cancel() | 85 | this.cancel() |
| 79 | }, | 86 | }, |
| 87 | /** | ||
| 88 | * @description: onConfirm | ||
| 89 | * @author: renchao | ||
| 90 | */ | ||
| 80 | onConfirm () { | 91 | onConfirm () { |
| 81 | this.loading = true | 92 | this.loading = true |
| 82 | let res = new Promise((resolve, reject) => { | 93 | let res = new Promise((resolve, reject) => { |
| ... | @@ -87,9 +98,19 @@ export default { | ... | @@ -87,9 +98,19 @@ export default { |
| 87 | this.isShow = false | 98 | this.isShow = false |
| 88 | } | 99 | } |
| 89 | }, | 100 | }, |
| 101 | /** | ||
| 102 | * @description: loadingFn | ||
| 103 | * @param {*} e | ||
| 104 | * @author: renchao | ||
| 105 | */ | ||
| 90 | loadingFn (e) { //加载状态 | 106 | loadingFn (e) { //加载状态 |
| 91 | this.loading = e | 107 | this.loading = e |
| 92 | }, | 108 | }, |
| 109 | /** | ||
| 110 | * @description: loadViewFn | ||
| 111 | * @param {*} view | ||
| 112 | * @author: renchao | ||
| 113 | */ | ||
| 93 | loadViewFn (view) { | 114 | loadViewFn (view) { |
| 94 | return (r) => | 115 | return (r) => |
| 95 | require.ensure([], () => | 116 | require.ensure([], () => | ... | ... |
| 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) { |
| ... | @@ -23,7 +27,14 @@ PopupBox.prototype.close = function () { | ... | @@ -23,7 +27,14 @@ PopupBox.prototype.close = function () { |
| 23 | } | 27 | } |
| 24 | }, 300) | 28 | }, 300) |
| 25 | } | 29 | } |
| 26 | 30 | /** | |
| 31 | * @description: Popup1 | ||
| 32 | * @param {*} title | ||
| 33 | * @param {*} editItem | ||
| 34 | * @param {*} data | ||
| 35 | * @param {*} formData | ||
| 36 | * @author: renchao | ||
| 37 | */ | ||
| 27 | const Popup1 = (title, editItem, data, formData) => { | 38 | const Popup1 = (title, editItem, data, formData) => { |
| 28 | // 如果组件已渲染,则返回即可 | 39 | // 如果组件已渲染,则返回即可 |
| 29 | if (popuping) { | 40 | if (popuping) { | ... | ... |
| ... | @@ -56,7 +56,10 @@ | ... | @@ -56,7 +56,10 @@ |
| 56 | } | 56 | } |
| 57 | }, | 57 | }, |
| 58 | mounted () { | 58 | mounted () { |
| 59 | // 计算滚动条高度 | 59 | /** |
| 60 | * @description: 计算滚动条高度 | ||
| 61 | * @author: renchao | ||
| 62 | */ | ||
| 60 | setTimeout(() => { | 63 | setTimeout(() => { |
| 61 | if (this.btnShow) { | 64 | if (this.btnShow) { |
| 62 | if (this.height == 'auto') { | 65 | if (this.height == 'auto') { |
| ... | @@ -74,9 +77,17 @@ | ... | @@ -74,9 +77,17 @@ |
| 74 | }, 300) | 77 | }, 300) |
| 75 | }, | 78 | }, |
| 76 | methods: { | 79 | methods: { |
| 80 | /** | ||
| 81 | * @description: onCancel | ||
| 82 | * @author: renchao | ||
| 83 | */ | ||
| 77 | onCancel () { | 84 | onCancel () { |
| 78 | Popup1().close() | 85 | Popup1().close() |
| 79 | }, | 86 | }, |
| 87 | /** | ||
| 88 | * @description: onConfirm | ||
| 89 | * @author: renchao | ||
| 90 | */ | ||
| 80 | onConfirm () { | 91 | onConfirm () { |
| 81 | let res = new Promise((resolve, reject) => { | 92 | let res = new Promise((resolve, reject) => { |
| 82 | this.confirm() | 93 | this.confirm() |
| ... | @@ -86,6 +97,11 @@ | ... | @@ -86,6 +97,11 @@ |
| 86 | this.isShow = false | 97 | this.isShow = false |
| 87 | } | 98 | } |
| 88 | }, | 99 | }, |
| 100 | /** | ||
| 101 | * @description: loadViewFn | ||
| 102 | * @param {*} view | ||
| 103 | * @author: renchao | ||
| 104 | */ | ||
| 89 | loadViewFn (view) { | 105 | loadViewFn (view) { |
| 90 | return (r) => | 106 | return (r) => |
| 91 | require.ensure([], () => | 107 | require.ensure([], () => |
| ... | @@ -185,4 +201,3 @@ | ... | @@ -185,4 +201,3 @@ |
| 185 | opacity: 0; | 201 | opacity: 0; |
| 186 | } | 202 | } |
| 187 | </style> | 203 | </style> |
| 188 | |||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -84,6 +84,13 @@ export default { | ... | @@ -84,6 +84,13 @@ export default { |
| 84 | }, | 84 | }, |
| 85 | 85 | ||
| 86 | methods: { | 86 | methods: { |
| 87 | /** | ||
| 88 | * @description: updateStyle | ||
| 89 | * @param {*} style | ||
| 90 | * @param {*} oldCluster | ||
| 91 | * @param {*} newCluster | ||
| 92 | * @author: renchao | ||
| 93 | */ | ||
| 87 | updateStyle (style, oldCluster, newCluster) { | 94 | updateStyle (style, oldCluster, newCluster) { |
| 88 | let newStyle = style | 95 | let newStyle = style |
| 89 | oldCluster.forEach((color, index) => { | 96 | oldCluster.forEach((color, index) => { |
| ... | @@ -92,6 +99,12 @@ export default { | ... | @@ -92,6 +99,12 @@ export default { |
| 92 | return newStyle | 99 | return newStyle |
| 93 | }, | 100 | }, |
| 94 | 101 | ||
| 102 | /** | ||
| 103 | * @description: getCSSString | ||
| 104 | * @param {*} url | ||
| 105 | * @param {*} variable | ||
| 106 | * @author: renchao | ||
| 107 | */ | ||
| 95 | getCSSString (url, variable) { | 108 | getCSSString (url, variable) { |
| 96 | return new Promise(resolve => { | 109 | return new Promise(resolve => { |
| 97 | const xhr = new XMLHttpRequest() | 110 | const xhr = new XMLHttpRequest() |
| ... | @@ -106,6 +119,11 @@ export default { | ... | @@ -106,6 +119,11 @@ export default { |
| 106 | }) | 119 | }) |
| 107 | }, | 120 | }, |
| 108 | 121 | ||
| 122 | /** | ||
| 123 | * @description: getThemeCluster | ||
| 124 | * @param {*} theme | ||
| 125 | * @author: renchao | ||
| 126 | */ | ||
| 109 | getThemeCluster (theme) { | 127 | getThemeCluster (theme) { |
| 110 | const tintColor = (color, tint) => { | 128 | const tintColor = (color, tint) => { |
| 111 | let red = parseInt(color.slice(0, 2), 16) | 129 | let red = parseInt(color.slice(0, 2), 16) |
| ... | @@ -169,4 +187,4 @@ export default { | ... | @@ -169,4 +187,4 @@ export default { |
| 169 | .theme-picker-dropdown .el-color-dropdown__link-btn { | 187 | .theme-picker-dropdown .el-color-dropdown__link-btn { |
| 170 | display: none; | 188 | display: none; |
| 171 | } | 189 | } |
| 172 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 190 | </style> | ... | ... |
| ... | @@ -2,6 +2,10 @@ import objectAssign from 'element-ui/src/utils/merge'; | ... | @@ -2,6 +2,10 @@ import objectAssign from 'element-ui/src/utils/merge'; |
| 2 | import { markNodeData, NODE_KEY } from './util'; | 2 | import { markNodeData, NODE_KEY } from './util'; |
| 3 | import { arrayFindIndex } from 'element-ui/src/utils/util'; | 3 | import { arrayFindIndex } from 'element-ui/src/utils/util'; |
| 4 | 4 | ||
| 5 | /** | ||
| 6 | * @description: getChildState | ||
| 7 | * @author: renchao | ||
| 8 | */ | ||
| 5 | export const getChildState = node => { | 9 | export const getChildState = node => { |
| 6 | let all = true; | 10 | let all = true; |
| 7 | let none = true; | 11 | let none = true; |
| ... | @@ -22,6 +26,11 @@ export const getChildState = node => { | ... | @@ -22,6 +26,11 @@ export const getChildState = node => { |
| 22 | return { all, none, allWithoutDisable, half: !all && !none }; | 26 | return { all, none, allWithoutDisable, half: !all && !none }; |
| 23 | }; | 27 | }; |
| 24 | 28 | ||
| 29 | /** | ||
| 30 | * @description: reInitChecked | ||
| 31 | * @param {*} node | ||
| 32 | * @author: renchao | ||
| 33 | */ | ||
| 25 | const reInitChecked = function(node) { | 34 | const reInitChecked = function(node) { |
| 26 | if (node.childNodes.length === 0 || node.loading) return; | 35 | if (node.childNodes.length === 0 || node.loading) return; |
| 27 | 36 | ||
| ... | @@ -45,6 +54,12 @@ const reInitChecked = function(node) { | ... | @@ -45,6 +54,12 @@ const reInitChecked = function(node) { |
| 45 | } | 54 | } |
| 46 | }; | 55 | }; |
| 47 | 56 | ||
| 57 | /** | ||
| 58 | * @description: getPropertyFromData | ||
| 59 | * @param {*} node | ||
| 60 | * @param {*} prop | ||
| 61 | * @author: renchao | ||
| 62 | */ | ||
| 48 | const getPropertyFromData = function(node, prop) { | 63 | const getPropertyFromData = function(node, prop) { |
| 49 | const props = node.store.props; | 64 | const props = node.store.props; |
| 50 | const data = node.data || {}; | 65 | const data = node.data || {}; |
| ... | @@ -63,6 +78,11 @@ const getPropertyFromData = function(node, prop) { | ... | @@ -63,6 +78,11 @@ const getPropertyFromData = function(node, prop) { |
| 63 | let nodeIdSeed = 0; | 78 | let nodeIdSeed = 0; |
| 64 | 79 | ||
| 65 | export default class Node { | 80 | export default class Node { |
| 81 | /** | ||
| 82 | * @description: constructor | ||
| 83 | * @param {*} options | ||
| 84 | * @author: renchao | ||
| 85 | */ | ||
| 66 | constructor(options) { | 86 | constructor(options) { |
| 67 | this.id = nodeIdSeed++; | 87 | this.id = nodeIdSeed++; |
| 68 | this.text = null; | 88 | this.text = null; |
| ... | @@ -135,6 +155,11 @@ export default class Node { | ... | @@ -135,6 +155,11 @@ export default class Node { |
| 135 | this.updateLeafState(); | 155 | this.updateLeafState(); |
| 136 | } | 156 | } |
| 137 | 157 | ||
| 158 | /** | ||
| 159 | * @description: setData | ||
| 160 | * @param {*} data | ||
| 161 | * @author: renchao | ||
| 162 | */ | ||
| 138 | setData(data) { | 163 | setData(data) { |
| 139 | if (!Array.isArray(data)) { | 164 | if (!Array.isArray(data)) { |
| 140 | markNodeData(this, data); | 165 | markNodeData(this, data); |
| ... | @@ -155,20 +180,36 @@ export default class Node { | ... | @@ -155,20 +180,36 @@ export default class Node { |
| 155 | } | 180 | } |
| 156 | } | 181 | } |
| 157 | 182 | ||
| 183 | /** | ||
| 184 | * @description: label | ||
| 185 | * @author: renchao | ||
| 186 | */ | ||
| 158 | get label() { | 187 | get label() { |
| 159 | return getPropertyFromData(this, 'label'); | 188 | return getPropertyFromData(this, 'label'); |
| 160 | } | 189 | } |
| 161 | 190 | ||
| 191 | /** | ||
| 192 | * @description: key | ||
| 193 | * @author: renchao | ||
| 194 | */ | ||
| 162 | get key() { | 195 | get key() { |
| 163 | const nodeKey = this.store.key; | 196 | const nodeKey = this.store.key; |
| 164 | if (this.data) return this.data[nodeKey]; | 197 | if (this.data) return this.data[nodeKey]; |
| 165 | return null; | 198 | return null; |
| 166 | } | 199 | } |
| 167 | 200 | ||
| 201 | /** | ||
| 202 | * @description: disabled | ||
| 203 | * @author: renchao | ||
| 204 | */ | ||
| 168 | get disabled() { | 205 | get disabled() { |
| 169 | return getPropertyFromData(this, 'disabled'); | 206 | return getPropertyFromData(this, 'disabled'); |
| 170 | } | 207 | } |
| 171 | 208 | ||
| 209 | /** | ||
| 210 | * @description: nextSibling | ||
| 211 | * @author: renchao | ||
| 212 | */ | ||
| 172 | get nextSibling() { | 213 | get nextSibling() { |
| 173 | const parent = this.parent; | 214 | const parent = this.parent; |
| 174 | if (parent) { | 215 | if (parent) { |
| ... | @@ -180,6 +221,10 @@ export default class Node { | ... | @@ -180,6 +221,10 @@ export default class Node { |
| 180 | return null; | 221 | return null; |
| 181 | } | 222 | } |
| 182 | 223 | ||
| 224 | /** | ||
| 225 | * @description: previousSibling | ||
| 226 | * @author: renchao | ||
| 227 | */ | ||
| 183 | get previousSibling() { | 228 | get previousSibling() { |
| 184 | const parent = this.parent; | 229 | const parent = this.parent; |
| 185 | if (parent) { | 230 | if (parent) { |
| ... | @@ -191,6 +236,12 @@ export default class Node { | ... | @@ -191,6 +236,12 @@ export default class Node { |
| 191 | return null; | 236 | return null; |
| 192 | } | 237 | } |
| 193 | 238 | ||
| 239 | /** | ||
| 240 | * @description: contains | ||
| 241 | * @param {*} target | ||
| 242 | * @param {*} deep | ||
| 243 | * @author: renchao | ||
| 244 | */ | ||
| 194 | contains(target, deep = true) { | 245 | contains(target, deep = true) { |
| 195 | const walk = function(parent) { | 246 | const walk = function(parent) { |
| 196 | const children = parent.childNodes || []; | 247 | const children = parent.childNodes || []; |
| ... | @@ -208,6 +259,10 @@ export default class Node { | ... | @@ -208,6 +259,10 @@ export default class Node { |
| 208 | return walk(this); | 259 | return walk(this); |
| 209 | } | 260 | } |
| 210 | 261 | ||
| 262 | /** | ||
| 263 | * @description: remove | ||
| 264 | * @author: renchao | ||
| 265 | */ | ||
| 211 | remove() { | 266 | remove() { |
| 212 | const parent = this.parent; | 267 | const parent = this.parent; |
| 213 | if (parent) { | 268 | if (parent) { |
| ... | @@ -215,6 +270,13 @@ export default class Node { | ... | @@ -215,6 +270,13 @@ export default class Node { |
| 215 | } | 270 | } |
| 216 | } | 271 | } |
| 217 | 272 | ||
| 273 | /** | ||
| 274 | * @description: insertChild | ||
| 275 | * @param {*} child | ||
| 276 | * @param {*} index | ||
| 277 | * @param {*} batch | ||
| 278 | * @author: renchao | ||
| 279 | */ | ||
| 218 | insertChild(child, index, batch) { | 280 | insertChild(child, index, batch) { |
| 219 | if (!child) throw new Error('insertChild error: child is required.'); | 281 | if (!child) throw new Error('insertChild error: child is required.'); |
| 220 | 282 | ||
| ... | @@ -247,6 +309,12 @@ export default class Node { | ... | @@ -247,6 +309,12 @@ export default class Node { |
| 247 | this.updateLeafState(); | 309 | this.updateLeafState(); |
| 248 | } | 310 | } |
| 249 | 311 | ||
| 312 | /** | ||
| 313 | * @description: insertBefore | ||
| 314 | * @param {*} child | ||
| 315 | * @param {*} ref | ||
| 316 | * @author: renchao | ||
| 317 | */ | ||
| 250 | insertBefore(child, ref) { | 318 | insertBefore(child, ref) { |
| 251 | let index; | 319 | let index; |
| 252 | if (ref) { | 320 | if (ref) { |
| ... | @@ -255,6 +323,12 @@ export default class Node { | ... | @@ -255,6 +323,12 @@ export default class Node { |
| 255 | this.insertChild(child, index); | 323 | this.insertChild(child, index); |
| 256 | } | 324 | } |
| 257 | 325 | ||
| 326 | /** | ||
| 327 | * @description: insertAfter | ||
| 328 | * @param {*} child | ||
| 329 | * @param {*} ref | ||
| 330 | * @author: renchao | ||
| 331 | */ | ||
| 258 | insertAfter(child, ref) { | 332 | insertAfter(child, ref) { |
| 259 | let index; | 333 | let index; |
| 260 | if (ref) { | 334 | if (ref) { |
| ... | @@ -264,6 +338,11 @@ export default class Node { | ... | @@ -264,6 +338,11 @@ export default class Node { |
| 264 | this.insertChild(child, index); | 338 | this.insertChild(child, index); |
| 265 | } | 339 | } |
| 266 | 340 | ||
| 341 | /** | ||
| 342 | * @description: removeChild | ||
| 343 | * @param {*} child | ||
| 344 | * @author: renchao | ||
| 345 | */ | ||
| 267 | removeChild(child) { | 346 | removeChild(child) { |
| 268 | const children = this.getChildren() || []; | 347 | const children = this.getChildren() || []; |
| 269 | const dataIndex = children.indexOf(child.data); | 348 | const dataIndex = children.indexOf(child.data); |
| ... | @@ -282,6 +361,11 @@ export default class Node { | ... | @@ -282,6 +361,11 @@ export default class Node { |
| 282 | this.updateLeafState(); | 361 | this.updateLeafState(); |
| 283 | } | 362 | } |
| 284 | 363 | ||
| 364 | /** | ||
| 365 | * @description: removeChildByData | ||
| 366 | * @param {*} data | ||
| 367 | * @author: renchao | ||
| 368 | */ | ||
| 285 | removeChildByData(data) { | 369 | removeChildByData(data) { |
| 286 | let targetNode = null; | 370 | let targetNode = null; |
| 287 | 371 | ||
| ... | @@ -297,6 +381,12 @@ export default class Node { | ... | @@ -297,6 +381,12 @@ export default class Node { |
| 297 | } | 381 | } |
| 298 | } | 382 | } |
| 299 | 383 | ||
| 384 | /** | ||
| 385 | * @description: expand | ||
| 386 | * @param {*} callback | ||
| 387 | * @param {*} expandParent | ||
| 388 | * @author: renchao | ||
| 389 | */ | ||
| 300 | expand(callback, expandParent) { | 390 | expand(callback, expandParent) { |
| 301 | const done = () => { | 391 | const done = () => { |
| 302 | if (expandParent) { | 392 | if (expandParent) { |
| ... | @@ -326,20 +416,38 @@ export default class Node { | ... | @@ -326,20 +416,38 @@ export default class Node { |
| 326 | } | 416 | } |
| 327 | } | 417 | } |
| 328 | 418 | ||
| 419 | /** | ||
| 420 | * @description: doCreateChildren | ||
| 421 | * @param {*} array | ||
| 422 | * @param {*} defaultProps | ||
| 423 | * @author: renchao | ||
| 424 | */ | ||
| 329 | doCreateChildren(array, defaultProps = {}) { | 425 | doCreateChildren(array, defaultProps = {}) { |
| 330 | array.forEach((item) => { | 426 | array.forEach((item) => { |
| 331 | this.insertChild(objectAssign({ data: item }, defaultProps), undefined, true); | 427 | this.insertChild(objectAssign({ data: item }, defaultProps), undefined, true); |
| 332 | }); | 428 | }); |
| 333 | } | 429 | } |
| 334 | 430 | ||
| 431 | /** | ||
| 432 | * @description: collapse | ||
| 433 | * @author: renchao | ||
| 434 | */ | ||
| 335 | collapse() { | 435 | collapse() { |
| 336 | this.expanded = false; | 436 | this.expanded = false; |
| 337 | } | 437 | } |
| 338 | 438 | ||
| 439 | /** | ||
| 440 | * @description: shouldLoadData | ||
| 441 | * @author: renchao | ||
| 442 | */ | ||
| 339 | shouldLoadData() { | 443 | shouldLoadData() { |
| 340 | return this.store.lazy === true && this.store.load && !this.loaded; | 444 | return this.store.lazy === true && this.store.load && !this.loaded; |
| 341 | } | 445 | } |
| 342 | 446 | ||
| 447 | /** | ||
| 448 | * @description: updateLeafState | ||
| 449 | * @author: renchao | ||
| 450 | */ | ||
| 343 | updateLeafState() { | 451 | updateLeafState() { |
| 344 | if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') { | 452 | if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') { |
| 345 | this.isLeaf = this.isLeafByUser; | 453 | this.isLeaf = this.isLeafByUser; |
| ... | @@ -353,6 +461,14 @@ export default class Node { | ... | @@ -353,6 +461,14 @@ export default class Node { |
| 353 | this.isLeaf = false; | 461 | this.isLeaf = false; |
| 354 | } | 462 | } |
| 355 | 463 | ||
| 464 | /** | ||
| 465 | * @description: setChecked | ||
| 466 | * @param {*} value | ||
| 467 | * @param {*} deep | ||
| 468 | * @param {*} recursion | ||
| 469 | * @param {*} passValue | ||
| 470 | * @author: renchao | ||
| 471 | */ | ||
| 356 | setChecked(value, deep, recursion, passValue) { | 472 | setChecked(value, deep, recursion, passValue) { |
| 357 | this.indeterminate = value === 'half'; | 473 | this.indeterminate = value === 'half'; |
| 358 | this.checked = value === true; | 474 | this.checked = value === true; |
| ... | @@ -406,6 +522,11 @@ export default class Node { | ... | @@ -406,6 +522,11 @@ export default class Node { |
| 406 | } | 522 | } |
| 407 | } | 523 | } |
| 408 | 524 | ||
| 525 | /** | ||
| 526 | * @description: getChildren | ||
| 527 | * @param {*} forceInit | ||
| 528 | * @author: renchao | ||
| 529 | */ | ||
| 409 | getChildren(forceInit = false) { // this is data | 530 | getChildren(forceInit = false) { // this is data |
| 410 | if (this.level === 0) return this.data; | 531 | if (this.level === 0) return this.data; |
| 411 | const data = this.data; | 532 | const data = this.data; |
| ... | @@ -428,6 +549,10 @@ export default class Node { | ... | @@ -428,6 +549,10 @@ export default class Node { |
| 428 | return data[children]; | 549 | return data[children]; |
| 429 | } | 550 | } |
| 430 | 551 | ||
| 552 | /** | ||
| 553 | * @description: updateChildren | ||
| 554 | * @author: renchao | ||
| 555 | */ | ||
| 431 | updateChildren() { | 556 | updateChildren() { |
| 432 | const newData = this.getChildren() || []; | 557 | const newData = this.getChildren() || []; |
| 433 | const oldData = this.childNodes.map((node) => node.data); | 558 | const oldData = this.childNodes.map((node) => node.data); |
| ... | @@ -458,6 +583,12 @@ export default class Node { | ... | @@ -458,6 +583,12 @@ export default class Node { |
| 458 | this.updateLeafState(); | 583 | this.updateLeafState(); |
| 459 | } | 584 | } |
| 460 | 585 | ||
| 586 | /** | ||
| 587 | * @description: loadData | ||
| 588 | * @param {*} callback | ||
| 589 | * @param {*} defaultProps | ||
| 590 | * @author: renchao | ||
| 591 | */ | ||
| 461 | loadData(callback, defaultProps = {}) { | 592 | loadData(callback, defaultProps = {}) { |
| 462 | if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) { | 593 | if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) { |
| 463 | this.loading = true; | 594 | this.loading = true; | ... | ... |
| ... | @@ -2,6 +2,11 @@ import Node from './node'; | ... | @@ -2,6 +2,11 @@ import Node from './node'; |
| 2 | import { getNodeKey } from './util'; | 2 | import { getNodeKey } from './util'; |
| 3 | 3 | ||
| 4 | export default class TreeStore { | 4 | export default class TreeStore { |
| 5 | /** | ||
| 6 | * @description: constructor | ||
| 7 | * @param {*} options | ||
| 8 | * @author: renchao | ||
| 9 | */ | ||
| 5 | constructor(options) { | 10 | constructor(options) { |
| 6 | this.currentNode = null; | 11 | this.currentNode = null; |
| 7 | this.currentNodeKey = null; | 12 | this.currentNodeKey = null; |
| ... | @@ -30,6 +35,11 @@ export default class TreeStore { | ... | @@ -30,6 +35,11 @@ export default class TreeStore { |
| 30 | } | 35 | } |
| 31 | } | 36 | } |
| 32 | 37 | ||
| 38 | /** | ||
| 39 | * @description: filter | ||
| 40 | * @param {*} value | ||
| 41 | * @author: renchao | ||
| 42 | */ | ||
| 33 | filter(value) { | 43 | filter(value) { |
| 34 | const filterNodeMethod = this.filterNodeMethod; | 44 | const filterNodeMethod = this.filterNodeMethod; |
| 35 | const lazy = this.lazy; | 45 | const lazy = this.lazy; |
| ... | @@ -60,6 +70,11 @@ export default class TreeStore { | ... | @@ -60,6 +70,11 @@ export default class TreeStore { |
| 60 | traverse(this); | 70 | traverse(this); |
| 61 | } | 71 | } |
| 62 | 72 | ||
| 73 | /** | ||
| 74 | * @description: setData | ||
| 75 | * @param {*} newVal | ||
| 76 | * @author: renchao | ||
| 77 | */ | ||
| 63 | setData(newVal) { | 78 | setData(newVal) { |
| 64 | const instanceChanged = newVal !== this.root.data; | 79 | const instanceChanged = newVal !== this.root.data; |
| 65 | if (instanceChanged) { | 80 | if (instanceChanged) { |
| ... | @@ -70,22 +85,44 @@ export default class TreeStore { | ... | @@ -70,22 +85,44 @@ export default class TreeStore { |
| 70 | } | 85 | } |
| 71 | } | 86 | } |
| 72 | 87 | ||
| 88 | /** | ||
| 89 | * @description: getNode | ||
| 90 | * @param {*} data | ||
| 91 | * @author: renchao | ||
| 92 | */ | ||
| 73 | getNode(data) { | 93 | getNode(data) { |
| 74 | if (data instanceof Node) return data; | 94 | if (data instanceof Node) return data; |
| 75 | const key = typeof data !== 'object' ? data : getNodeKey(this.key, data); | 95 | const key = typeof data !== 'object' ? data : getNodeKey(this.key, data); |
| 76 | return this.nodesMap[key] || null; | 96 | return this.nodesMap[key] || null; |
| 77 | } | 97 | } |
| 78 | 98 | ||
| 99 | /** | ||
| 100 | * @description: insertBefore | ||
| 101 | * @param {*} data | ||
| 102 | * @param {*} refData | ||
| 103 | * @author: renchao | ||
| 104 | */ | ||
| 79 | insertBefore(data, refData) { | 105 | insertBefore(data, refData) { |
| 80 | const refNode = this.getNode(refData); | 106 | const refNode = this.getNode(refData); |
| 81 | refNode.parent.insertBefore({ data }, refNode); | 107 | refNode.parent.insertBefore({ data }, refNode); |
| 82 | } | 108 | } |
| 83 | 109 | ||
| 110 | /** | ||
| 111 | * @description: insertAfter | ||
| 112 | * @param {*} data | ||
| 113 | * @param {*} refData | ||
| 114 | * @author: renchao | ||
| 115 | */ | ||
| 84 | insertAfter(data, refData) { | 116 | insertAfter(data, refData) { |
| 85 | const refNode = this.getNode(refData); | 117 | const refNode = this.getNode(refData); |
| 86 | refNode.parent.insertAfter({ data }, refNode); | 118 | refNode.parent.insertAfter({ data }, refNode); |
| 87 | } | 119 | } |
| 88 | 120 | ||
| 121 | /** | ||
| 122 | * @description: remove | ||
| 123 | * @param {*} data | ||
| 124 | * @author: renchao | ||
| 125 | */ | ||
| 89 | remove(data) { | 126 | remove(data) { |
| 90 | const node = this.getNode(data); | 127 | const node = this.getNode(data); |
| 91 | 128 | ||
| ... | @@ -97,6 +134,12 @@ export default class TreeStore { | ... | @@ -97,6 +134,12 @@ export default class TreeStore { |
| 97 | } | 134 | } |
| 98 | } | 135 | } |
| 99 | 136 | ||
| 137 | /** | ||
| 138 | * @description: append | ||
| 139 | * @param {*} data | ||
| 140 | * @param {*} parentData | ||
| 141 | * @author: renchao | ||
| 142 | */ | ||
| 100 | append(data, parentData) { | 143 | append(data, parentData) { |
| 101 | const parentNode = parentData ? this.getNode(parentData) : this.root; | 144 | const parentNode = parentData ? this.getNode(parentData) : this.root; |
| 102 | 145 | ||
| ... | @@ -105,6 +148,10 @@ export default class TreeStore { | ... | @@ -105,6 +148,10 @@ export default class TreeStore { |
| 105 | } | 148 | } |
| 106 | } | 149 | } |
| 107 | 150 | ||
| 151 | /** | ||
| 152 | * @description: _initDefaultCheckedNodes | ||
| 153 | * @author: renchao | ||
| 154 | */ | ||
| 108 | _initDefaultCheckedNodes() { | 155 | _initDefaultCheckedNodes() { |
| 109 | const defaultCheckedKeys = this.defaultCheckedKeys || []; | 156 | const defaultCheckedKeys = this.defaultCheckedKeys || []; |
| 110 | const nodesMap = this.nodesMap; | 157 | const nodesMap = this.nodesMap; |
| ... | @@ -118,6 +165,11 @@ export default class TreeStore { | ... | @@ -118,6 +165,11 @@ export default class TreeStore { |
| 118 | }); | 165 | }); |
| 119 | } | 166 | } |
| 120 | 167 | ||
| 168 | /** | ||
| 169 | * @description: _initDefaultCheckedNode | ||
| 170 | * @param {*} node | ||
| 171 | * @author: renchao | ||
| 172 | */ | ||
| 121 | _initDefaultCheckedNode(node) { | 173 | _initDefaultCheckedNode(node) { |
| 122 | const defaultCheckedKeys = this.defaultCheckedKeys || []; | 174 | const defaultCheckedKeys = this.defaultCheckedKeys || []; |
| 123 | 175 | ||
| ... | @@ -126,6 +178,11 @@ export default class TreeStore { | ... | @@ -126,6 +178,11 @@ export default class TreeStore { |
| 126 | } | 178 | } |
| 127 | } | 179 | } |
| 128 | 180 | ||
| 181 | /** | ||
| 182 | * @description: setDefaultCheckedKey | ||
| 183 | * @param {*} newVal | ||
| 184 | * @author: renchao | ||
| 185 | */ | ||
| 129 | setDefaultCheckedKey(newVal) { | 186 | setDefaultCheckedKey(newVal) { |
| 130 | if (newVal !== this.defaultCheckedKeys) { | 187 | if (newVal !== this.defaultCheckedKeys) { |
| 131 | this.defaultCheckedKeys = newVal; | 188 | this.defaultCheckedKeys = newVal; |
| ... | @@ -133,6 +190,11 @@ export default class TreeStore { | ... | @@ -133,6 +190,11 @@ export default class TreeStore { |
| 133 | } | 190 | } |
| 134 | } | 191 | } |
| 135 | 192 | ||
| 193 | /** | ||
| 194 | * @description: registerNode | ||
| 195 | * @param {*} node | ||
| 196 | * @author: renchao | ||
| 197 | */ | ||
| 136 | registerNode(node) { | 198 | registerNode(node) { |
| 137 | const key = this.key; | 199 | const key = this.key; |
| 138 | if (!key || !node || !node.data) return; | 200 | if (!key || !node || !node.data) return; |
| ... | @@ -141,6 +203,11 @@ export default class TreeStore { | ... | @@ -141,6 +203,11 @@ export default class TreeStore { |
| 141 | if (nodeKey !== undefined) this.nodesMap[node.key] = node; | 203 | if (nodeKey !== undefined) this.nodesMap[node.key] = node; |
| 142 | } | 204 | } |
| 143 | 205 | ||
| 206 | /** | ||
| 207 | * @description: deregisterNode | ||
| 208 | * @param {*} node | ||
| 209 | * @author: renchao | ||
| 210 | */ | ||
| 144 | deregisterNode(node) { | 211 | deregisterNode(node) { |
| 145 | const key = this.key; | 212 | const key = this.key; |
| 146 | if (!key || !node || !node.data) return; | 213 | if (!key || !node || !node.data) return; |
| ... | @@ -152,6 +219,12 @@ export default class TreeStore { | ... | @@ -152,6 +219,12 @@ export default class TreeStore { |
| 152 | delete this.nodesMap[node.key]; | 219 | delete this.nodesMap[node.key]; |
| 153 | } | 220 | } |
| 154 | 221 | ||
| 222 | /** | ||
| 223 | * @description: getCheckedNodes | ||
| 224 | * @param {*} leafOnly | ||
| 225 | * @param {*} includeHalfChecked | ||
| 226 | * @author: renchao | ||
| 227 | */ | ||
| 155 | getCheckedNodes(leafOnly = false, includeHalfChecked = false) { | 228 | getCheckedNodes(leafOnly = false, includeHalfChecked = false) { |
| 156 | const checkedNodes = []; | 229 | const checkedNodes = []; |
| 157 | const traverse = function(node) { | 230 | const traverse = function(node) { |
| ... | @@ -171,10 +244,19 @@ export default class TreeStore { | ... | @@ -171,10 +244,19 @@ export default class TreeStore { |
| 171 | return checkedNodes; | 244 | return checkedNodes; |
| 172 | } | 245 | } |
| 173 | 246 | ||
| 247 | /** | ||
| 248 | * @description: getCheckedKeys | ||
| 249 | * @param {*} leafOnly | ||
| 250 | * @author: renchao | ||
| 251 | */ | ||
| 174 | getCheckedKeys(leafOnly = false) { | 252 | getCheckedKeys(leafOnly = false) { |
| 175 | return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]); | 253 | return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]); |
| 176 | } | 254 | } |
| 177 | 255 | ||
| 256 | /** | ||
| 257 | * @description: getHalfCheckedNodes | ||
| 258 | * @author: renchao | ||
| 259 | */ | ||
| 178 | getHalfCheckedNodes() { | 260 | getHalfCheckedNodes() { |
| 179 | const nodes = []; | 261 | const nodes = []; |
| 180 | const traverse = function(node) { | 262 | const traverse = function(node) { |
| ... | @@ -194,10 +276,18 @@ export default class TreeStore { | ... | @@ -194,10 +276,18 @@ export default class TreeStore { |
| 194 | return nodes; | 276 | return nodes; |
| 195 | } | 277 | } |
| 196 | 278 | ||
| 279 | /** | ||
| 280 | * @description: getHalfCheckedKeys | ||
| 281 | * @author: renchao | ||
| 282 | */ | ||
| 197 | getHalfCheckedKeys() { | 283 | getHalfCheckedKeys() { |
| 198 | return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]); | 284 | return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]); |
| 199 | } | 285 | } |
| 200 | 286 | ||
| 287 | /** | ||
| 288 | * @description: _getAllNodes | ||
| 289 | * @author: renchao | ||
| 290 | */ | ||
| 201 | _getAllNodes() { | 291 | _getAllNodes() { |
| 202 | const allNodes = []; | 292 | const allNodes = []; |
| 203 | const nodesMap = this.nodesMap; | 293 | const nodesMap = this.nodesMap; |
| ... | @@ -210,6 +300,12 @@ export default class TreeStore { | ... | @@ -210,6 +300,12 @@ export default class TreeStore { |
| 210 | return allNodes; | 300 | return allNodes; |
| 211 | } | 301 | } |
| 212 | 302 | ||
| 303 | /** | ||
| 304 | * @description: updateChildren | ||
| 305 | * @param {*} key | ||
| 306 | * @param {*} data | ||
| 307 | * @author: renchao | ||
| 308 | */ | ||
| 213 | updateChildren(key, data) { | 309 | updateChildren(key, data) { |
| 214 | const node = this.nodesMap[key]; | 310 | const node = this.nodesMap[key]; |
| 215 | if (!node) return; | 311 | if (!node) return; |
| ... | @@ -224,6 +320,13 @@ export default class TreeStore { | ... | @@ -224,6 +320,13 @@ export default class TreeStore { |
| 224 | } | 320 | } |
| 225 | } | 321 | } |
| 226 | 322 | ||
| 323 | /** | ||
| 324 | * @description: _setCheckedKeys | ||
| 325 | * @param {*} key | ||
| 326 | * @param {*} leafOnly | ||
| 327 | * @param {*} checkedKeys | ||
| 328 | * @author: renchao | ||
| 329 | */ | ||
| 227 | _setCheckedKeys(key, leafOnly = false, checkedKeys) { | 330 | _setCheckedKeys(key, leafOnly = false, checkedKeys) { |
| 228 | const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level); | 331 | const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level); |
| 229 | const cache = Object.create(null); | 332 | const cache = Object.create(null); |
| ... | @@ -268,6 +371,12 @@ export default class TreeStore { | ... | @@ -268,6 +371,12 @@ export default class TreeStore { |
| 268 | } | 371 | } |
| 269 | } | 372 | } |
| 270 | 373 | ||
| 374 | /** | ||
| 375 | * @description: setCheckedNodes | ||
| 376 | * @param {*} array | ||
| 377 | * @param {*} leafOnly | ||
| 378 | * @author: renchao | ||
| 379 | */ | ||
| 271 | setCheckedNodes(array, leafOnly = false) { | 380 | setCheckedNodes(array, leafOnly = false) { |
| 272 | const key = this.key; | 381 | const key = this.key; |
| 273 | const checkedKeys = {}; | 382 | const checkedKeys = {}; |
| ... | @@ -278,6 +387,12 @@ export default class TreeStore { | ... | @@ -278,6 +387,12 @@ export default class TreeStore { |
| 278 | this._setCheckedKeys(key, leafOnly, checkedKeys); | 387 | this._setCheckedKeys(key, leafOnly, checkedKeys); |
| 279 | } | 388 | } |
| 280 | 389 | ||
| 390 | /** | ||
| 391 | * @description: setCheckedKeys | ||
| 392 | * @param {*} array | ||
| 393 | * @param {*} leafOnly | ||
| 394 | * @author: renchao | ||
| 395 | */ | ||
| 281 | setCheckedKeys(keys, leafOnly = false) { | 396 | setCheckedKeys(keys, leafOnly = false) { |
| 282 | this.defaultCheckedKeys = keys; | 397 | this.defaultCheckedKeys = keys; |
| 283 | const key = this.key; | 398 | const key = this.key; |
| ... | @@ -289,6 +404,11 @@ export default class TreeStore { | ... | @@ -289,6 +404,11 @@ export default class TreeStore { |
| 289 | this._setCheckedKeys(key, leafOnly, checkedKeys); | 404 | this._setCheckedKeys(key, leafOnly, checkedKeys); |
| 290 | } | 405 | } |
| 291 | 406 | ||
| 407 | /** | ||
| 408 | * @description: setDefaultExpandedKeys | ||
| 409 | * @param {*} keys | ||
| 410 | * @author: renchao | ||
| 411 | */ | ||
| 292 | setDefaultExpandedKeys(keys) { | 412 | setDefaultExpandedKeys(keys) { |
| 293 | keys = keys || []; | 413 | keys = keys || []; |
| 294 | this.defaultExpandedKeys = keys; | 414 | this.defaultExpandedKeys = keys; |
| ... | @@ -299,6 +419,13 @@ export default class TreeStore { | ... | @@ -299,6 +419,13 @@ export default class TreeStore { |
| 299 | }); | 419 | }); |
| 300 | } | 420 | } |
| 301 | 421 | ||
| 422 | /** | ||
| 423 | * @description: setChecked | ||
| 424 | * @param {*} data | ||
| 425 | * @param {*} checked | ||
| 426 | * @param {*} deep | ||
| 427 | * @author: renchao | ||
| 428 | */ | ||
| 302 | setChecked(data, checked, deep) { | 429 | setChecked(data, checked, deep) { |
| 303 | const node = this.getNode(data); | 430 | const node = this.getNode(data); |
| 304 | 431 | ||
| ... | @@ -307,10 +434,19 @@ export default class TreeStore { | ... | @@ -307,10 +434,19 @@ export default class TreeStore { |
| 307 | } | 434 | } |
| 308 | } | 435 | } |
| 309 | 436 | ||
| 437 | /** | ||
| 438 | * @description: getCurrentNode | ||
| 439 | * @author: renchao | ||
| 440 | */ | ||
| 310 | getCurrentNode() { | 441 | getCurrentNode() { |
| 311 | return this.currentNode; | 442 | return this.currentNode; |
| 312 | } | 443 | } |
| 313 | 444 | ||
| 445 | /** | ||
| 446 | * @description: setCurrentNode | ||
| 447 | * @param {*} currentNode | ||
| 448 | * @author: renchao | ||
| 449 | */ | ||
| 314 | setCurrentNode(currentNode) { | 450 | setCurrentNode(currentNode) { |
| 315 | const prevCurrentNode = this.currentNode; | 451 | const prevCurrentNode = this.currentNode; |
| 316 | if (prevCurrentNode) { | 452 | if (prevCurrentNode) { |
| ... | @@ -320,12 +456,22 @@ export default class TreeStore { | ... | @@ -320,12 +456,22 @@ export default class TreeStore { |
| 320 | this.currentNode.isCurrent = true; | 456 | this.currentNode.isCurrent = true; |
| 321 | } | 457 | } |
| 322 | 458 | ||
| 459 | /** | ||
| 460 | * @description: setUserCurrentNode | ||
| 461 | * @param {*} node | ||
| 462 | * @author: renchao | ||
| 463 | */ | ||
| 323 | setUserCurrentNode(node) { | 464 | setUserCurrentNode(node) { |
| 324 | const key = node[this.key]; | 465 | const key = node[this.key]; |
| 325 | const currNode = this.nodesMap[key]; | 466 | const currNode = this.nodesMap[key]; |
| 326 | this.setCurrentNode(currNode); | 467 | this.setCurrentNode(currNode); |
| 327 | } | 468 | } |
| 328 | 469 | ||
| 470 | /** | ||
| 471 | * @description: setCurrentNodeKey | ||
| 472 | * @param {*} key | ||
| 473 | * @author: renchao | ||
| 474 | */ | ||
| 329 | setCurrentNodeKey(key) { | 475 | setCurrentNodeKey(key) { |
| 330 | if (key === null || key === undefined) { | 476 | if (key === null || key === undefined) { |
| 331 | this.currentNode && (this.currentNode.isCurrent = false); | 477 | this.currentNode && (this.currentNode.isCurrent = false); | ... | ... |
| 1 | export const NODE_KEY = '$treeNodeId'; | 1 | export const NODE_KEY = '$treeNodeId'; |
| 2 | 2 | ||
| 3 | /** | ||
| 4 | * @description: markNodeData | ||
| 5 | * @param {*} node | ||
| 6 | * @param {*} data | ||
| 7 | * @author: renchao | ||
| 8 | */ | ||
| 3 | export const markNodeData = function(node, data) { | 9 | export const markNodeData = function(node, data) { |
| 4 | if (!data || data[NODE_KEY]) return; | 10 | if (!data || data[NODE_KEY]) return; |
| 5 | Object.defineProperty(data, NODE_KEY, { | 11 | Object.defineProperty(data, NODE_KEY, { |
| ... | @@ -10,11 +16,23 @@ export const markNodeData = function(node, data) { | ... | @@ -10,11 +16,23 @@ export const markNodeData = function(node, data) { |
| 10 | }); | 16 | }); |
| 11 | }; | 17 | }; |
| 12 | 18 | ||
| 19 | /** | ||
| 20 | * @description: getNodeKey | ||
| 21 | * @param {*} key | ||
| 22 | * @param {*} data | ||
| 23 | * @author: renchao | ||
| 24 | */ | ||
| 13 | export const getNodeKey = function(key, data) { | 25 | export const getNodeKey = function(key, data) { |
| 14 | if (!key) return data[NODE_KEY]; | 26 | if (!key) return data[NODE_KEY]; |
| 15 | return data[key]; | 27 | return data[key]; |
| 16 | }; | 28 | }; |
| 17 | 29 | ||
| 30 | /** | ||
| 31 | * @description: findNearestComponent | ||
| 32 | * @param {*} element | ||
| 33 | * @param {*} componentName | ||
| 34 | * @author: renchao | ||
| 35 | */ | ||
| 18 | export const findNearestComponent = (element, componentName) => { | 36 | export const findNearestComponent = (element, componentName) => { |
| 19 | let target = element; | 37 | let target = element; |
| 20 | while (target && target.tagName !== 'BODY') { | 38 | while (target && target.tagName !== 'BODY') { | ... | ... |
| ... | @@ -116,10 +116,21 @@ export default { | ... | @@ -116,10 +116,21 @@ export default { |
| 116 | }, | 116 | }, |
| 117 | 117 | ||
| 118 | methods: { | 118 | methods: { |
| 119 | /** | ||
| 120 | * @description: getNodeKey | ||
| 121 | * @param {*} node | ||
| 122 | * @author: renchao | ||
| 123 | */ | ||
| 119 | getNodeKey (node) { | 124 | getNodeKey (node) { |
| 120 | return getNodeKey(this.tree.nodeKey, node.data); | 125 | return getNodeKey(this.tree.nodeKey, node.data); |
| 121 | }, | 126 | }, |
| 122 | 127 | ||
| 128 | /** | ||
| 129 | * @description: handleSelectChange | ||
| 130 | * @param {*} checked | ||
| 131 | * @param {*} indeterminate | ||
| 132 | * @author: renchao | ||
| 133 | */ | ||
| 123 | handleSelectChange (checked, indeterminate) { | 134 | handleSelectChange (checked, indeterminate) { |
| 124 | if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) { | 135 | if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) { |
| 125 | this.tree.$emit('check-change', this.node.data, checked, indeterminate); | 136 | this.tree.$emit('check-change', this.node.data, checked, indeterminate); |
| ... | @@ -128,6 +139,10 @@ export default { | ... | @@ -128,6 +139,10 @@ export default { |
| 128 | this.indeterminate = indeterminate; | 139 | this.indeterminate = indeterminate; |
| 129 | }, | 140 | }, |
| 130 | 141 | ||
| 142 | /** | ||
| 143 | * @description: handleClick | ||
| 144 | * @author: renchao | ||
| 145 | */ | ||
| 131 | handleClick () { | 146 | handleClick () { |
| 132 | const store = this.tree.store; | 147 | const store = this.tree.store; |
| 133 | store.setCurrentNode(this.node); | 148 | store.setCurrentNode(this.node); |
| ... | @@ -144,6 +159,11 @@ export default { | ... | @@ -144,6 +159,11 @@ export default { |
| 144 | this.tree.$emit('node-click', this.node.data, this.node, this); | 159 | this.tree.$emit('node-click', this.node.data, this.node, this); |
| 145 | }, | 160 | }, |
| 146 | 161 | ||
| 162 | /** | ||
| 163 | * @description: handleContextMenu | ||
| 164 | * @param {*} event | ||
| 165 | * @author: renchao | ||
| 166 | */ | ||
| 147 | handleContextMenu (event) { | 167 | handleContextMenu (event) { |
| 148 | if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) { | 168 | if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) { |
| 149 | event.stopPropagation(); | 169 | event.stopPropagation(); |
| ... | @@ -152,6 +172,10 @@ export default { | ... | @@ -152,6 +172,10 @@ export default { |
| 152 | this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this); | 172 | this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this); |
| 153 | }, | 173 | }, |
| 154 | 174 | ||
| 175 | /** | ||
| 176 | * @description: handleExpandIconClick | ||
| 177 | * @author: renchao | ||
| 178 | */ | ||
| 155 | handleExpandIconClick () { | 179 | handleExpandIconClick () { |
| 156 | if (this.node.isLeaf) return; | 180 | if (this.node.isLeaf) return; |
| 157 | if (this.expanded) { | 181 | if (this.expanded) { |
| ... | @@ -163,6 +187,12 @@ export default { | ... | @@ -163,6 +187,12 @@ export default { |
| 163 | } | 187 | } |
| 164 | }, | 188 | }, |
| 165 | 189 | ||
| 190 | /** | ||
| 191 | * @description: handleCheckChange | ||
| 192 | * @param {*} value | ||
| 193 | * @param {*} ev | ||
| 194 | * @author: renchao | ||
| 195 | */ | ||
| 166 | handleCheckChange (value, ev) { | 196 | handleCheckChange (value, ev) { |
| 167 | this.node.setChecked(ev.target.checked, !this.tree.checkStrictly); | 197 | this.node.setChecked(ev.target.checked, !this.tree.checkStrictly); |
| 168 | this.$nextTick(() => { | 198 | this.$nextTick(() => { |
| ... | @@ -176,26 +206,53 @@ export default { | ... | @@ -176,26 +206,53 @@ export default { |
| 176 | }); | 206 | }); |
| 177 | }, | 207 | }, |
| 178 | 208 | ||
| 209 | /** | ||
| 210 | * @description: handleChildNodeExpand | ||
| 211 | * @param {*} nodeData | ||
| 212 | * @param {*} node | ||
| 213 | * @param {*} instance | ||
| 214 | * @author: renchao | ||
| 215 | */ | ||
| 179 | handleChildNodeExpand (nodeData, node, instance) { | 216 | handleChildNodeExpand (nodeData, node, instance) { |
| 180 | this.broadcast('ElTreeNode', 'tree-node-expand', node); | 217 | this.broadcast('ElTreeNode', 'tree-node-expand', node); |
| 181 | this.tree.$emit('node-expand', nodeData, node, instance); | 218 | this.tree.$emit('node-expand', nodeData, node, instance); |
| 182 | }, | 219 | }, |
| 183 | 220 | ||
| 221 | /** | ||
| 222 | * @description: handleDragStart | ||
| 223 | * @param {*} event | ||
| 224 | * @author: renchao | ||
| 225 | */ | ||
| 184 | handleDragStart (event) { | 226 | handleDragStart (event) { |
| 185 | if (!this.tree.draggable) return; | 227 | if (!this.tree.draggable) return; |
| 186 | this.tree.$emit('tree-node-drag-start', event, this); | 228 | this.tree.$emit('tree-node-drag-start', event, this); |
| 187 | }, | 229 | }, |
| 188 | 230 | ||
| 231 | /** | ||
| 232 | * @description: handleDragOver | ||
| 233 | * @param {*} event | ||
| 234 | * @author: renchao | ||
| 235 | */ | ||
| 189 | handleDragOver (event) { | 236 | handleDragOver (event) { |
| 190 | if (!this.tree.draggable) return; | 237 | if (!this.tree.draggable) return; |
| 191 | this.tree.$emit('tree-node-drag-over', event, this); | 238 | this.tree.$emit('tree-node-drag-over', event, this); |
| 192 | event.preventDefault(); | 239 | event.preventDefault(); |
| 193 | }, | 240 | }, |
| 194 | 241 | ||
| 242 | /** | ||
| 243 | * @description: handleDrop | ||
| 244 | * @param {*} event | ||
| 245 | * @author: renchao | ||
| 246 | */ | ||
| 195 | handleDrop (event) { | 247 | handleDrop (event) { |
| 196 | event.preventDefault(); | 248 | event.preventDefault(); |
| 197 | }, | 249 | }, |
| 198 | 250 | ||
| 251 | /** | ||
| 252 | * @description: handleDragEnd | ||
| 253 | * @param {*} event | ||
| 254 | * @author: renchao | ||
| 255 | */ | ||
| 199 | handleDragEnd (event) { | 256 | handleDragEnd (event) { |
| 200 | if (!this.tree.draggable) return; | 257 | if (!this.tree.draggable) return; |
| 201 | this.tree.$emit('tree-node-drag-end', event, this); | 258 | this.tree.$emit('tree-node-drag-end', event, this); | ... | ... |
| ... | @@ -177,15 +177,30 @@ | ... | @@ -177,15 +177,30 @@ |
| 177 | }, | 177 | }, |
| 178 | 178 | ||
| 179 | methods: { | 179 | methods: { |
| 180 | /** | ||
| 181 | * @description: filter | ||
| 182 | * @param {*} value | ||
| 183 | * @author: renchao | ||
| 184 | */ | ||
| 180 | filter(value) { | 185 | filter(value) { |
| 181 | if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter'); | 186 | if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter'); |
| 182 | this.store.filter(value); | 187 | this.store.filter(value); |
| 183 | }, | 188 | }, |
| 184 | 189 | ||
| 190 | /** | ||
| 191 | * @description: getNodeKey | ||
| 192 | * @param {*} node | ||
| 193 | * @author: renchao | ||
| 194 | */ | ||
| 185 | getNodeKey(node) { | 195 | getNodeKey(node) { |
| 186 | return getNodeKey(this.nodeKey, node.data); | 196 | return getNodeKey(this.nodeKey, node.data); |
| 187 | }, | 197 | }, |
| 188 | 198 | ||
| 199 | /** | ||
| 200 | * @description: getNodePath | ||
| 201 | * @param {*} data | ||
| 202 | * @author: renchao | ||
| 203 | */ | ||
| 189 | getNodePath(data) { | 204 | getNodePath(data) { |
| 190 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath'); | 205 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath'); |
| 191 | const node = this.store.getNode(data); | 206 | const node = this.store.getNode(data); |
| ... | @@ -199,87 +214,188 @@ | ... | @@ -199,87 +214,188 @@ |
| 199 | return path.reverse(); | 214 | return path.reverse(); |
| 200 | }, | 215 | }, |
| 201 | 216 | ||
| 217 | /** | ||
| 218 | * @description: getCheckedNodes | ||
| 219 | * @param {*} leafOnly | ||
| 220 | * @param {*} includeHalfChecked | ||
| 221 | * @author: renchao | ||
| 222 | */ | ||
| 202 | getCheckedNodes(leafOnly, includeHalfChecked) { | 223 | getCheckedNodes(leafOnly, includeHalfChecked) { |
| 203 | return this.store.getCheckedNodes(leafOnly, includeHalfChecked); | 224 | return this.store.getCheckedNodes(leafOnly, includeHalfChecked); |
| 204 | }, | 225 | }, |
| 205 | 226 | ||
| 227 | /** | ||
| 228 | * @description: getCheckedKeys | ||
| 229 | * @param {*} leafOnly | ||
| 230 | * @author: renchao | ||
| 231 | */ | ||
| 206 | getCheckedKeys(leafOnly) { | 232 | getCheckedKeys(leafOnly) { |
| 207 | return this.store.getCheckedKeys(leafOnly); | 233 | return this.store.getCheckedKeys(leafOnly); |
| 208 | }, | 234 | }, |
| 209 | 235 | ||
| 236 | /** | ||
| 237 | * @description: getCurrentNode | ||
| 238 | * @author: renchao | ||
| 239 | */ | ||
| 210 | getCurrentNode() { | 240 | getCurrentNode() { |
| 211 | const currentNode = this.store.getCurrentNode(); | 241 | const currentNode = this.store.getCurrentNode(); |
| 212 | return currentNode ? currentNode.data : null; | 242 | return currentNode ? currentNode.data : null; |
| 213 | }, | 243 | }, |
| 214 | 244 | ||
| 245 | /** | ||
| 246 | * @description: getCurrentKey | ||
| 247 | * @author: renchao | ||
| 248 | */ | ||
| 215 | getCurrentKey() { | 249 | getCurrentKey() { |
| 216 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey'); | 250 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey'); |
| 217 | const currentNode = this.getCurrentNode(); | 251 | const currentNode = this.getCurrentNode(); |
| 218 | return currentNode ? currentNode[this.nodeKey] : null; | 252 | return currentNode ? currentNode[this.nodeKey] : null; |
| 219 | }, | 253 | }, |
| 220 | 254 | ||
| 255 | /** | ||
| 256 | * @description: setCheckedNodes | ||
| 257 | * @param {*} nodes | ||
| 258 | * @param {*} leafOnly | ||
| 259 | * @author: renchao | ||
| 260 | */ | ||
| 221 | setCheckedNodes(nodes, leafOnly) { | 261 | setCheckedNodes(nodes, leafOnly) { |
| 222 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes'); | 262 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes'); |
| 223 | this.store.setCheckedNodes(nodes, leafOnly); | 263 | this.store.setCheckedNodes(nodes, leafOnly); |
| 224 | }, | 264 | }, |
| 225 | 265 | ||
| 266 | /** | ||
| 267 | * @description: setCheckedKeys | ||
| 268 | * @param {*} keys | ||
| 269 | * @param {*} leafOnly | ||
| 270 | * @author: renchao | ||
| 271 | */ | ||
| 226 | setCheckedKeys(keys, leafOnly) { | 272 | setCheckedKeys(keys, leafOnly) { |
| 227 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys'); | 273 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys'); |
| 228 | this.store.setCheckedKeys(keys, leafOnly); | 274 | this.store.setCheckedKeys(keys, leafOnly); |
| 229 | }, | 275 | }, |
| 230 | 276 | ||
| 277 | /** | ||
| 278 | * @description: setChecked | ||
| 279 | * @param {*} data | ||
| 280 | * @param {*} checked | ||
| 281 | * @param {*} deep | ||
| 282 | * @author: renchao | ||
| 283 | */ | ||
| 231 | setChecked(data, checked, deep) { | 284 | setChecked(data, checked, deep) { |
| 232 | this.store.setChecked(data, checked, deep); | 285 | this.store.setChecked(data, checked, deep); |
| 233 | }, | 286 | }, |
| 234 | 287 | ||
| 288 | /** | ||
| 289 | * @description: getHalfCheckedNodes | ||
| 290 | * @author: renchao | ||
| 291 | */ | ||
| 235 | getHalfCheckedNodes() { | 292 | getHalfCheckedNodes() { |
| 236 | return this.store.getHalfCheckedNodes(); | 293 | return this.store.getHalfCheckedNodes(); |
| 237 | }, | 294 | }, |
| 238 | 295 | ||
| 296 | /** | ||
| 297 | * @description: getHalfCheckedKeys | ||
| 298 | * @author: renchao | ||
| 299 | */ | ||
| 239 | getHalfCheckedKeys() { | 300 | getHalfCheckedKeys() { |
| 240 | return this.store.getHalfCheckedKeys(); | 301 | return this.store.getHalfCheckedKeys(); |
| 241 | }, | 302 | }, |
| 242 | 303 | ||
| 304 | /** | ||
| 305 | * @description: setCurrentNode | ||
| 306 | * @param {*} node | ||
| 307 | * @author: renchao | ||
| 308 | */ | ||
| 243 | setCurrentNode(node) { | 309 | setCurrentNode(node) { |
| 244 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode'); | 310 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode'); |
| 245 | this.store.setUserCurrentNode(node); | 311 | this.store.setUserCurrentNode(node); |
| 246 | }, | 312 | }, |
| 247 | 313 | ||
| 314 | /** | ||
| 315 | * @description: setCurrentKey | ||
| 316 | * @param {*} key | ||
| 317 | * @author: renchao | ||
| 318 | */ | ||
| 248 | setCurrentKey(key) { | 319 | setCurrentKey(key) { |
| 249 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey'); | 320 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey'); |
| 250 | this.store.setCurrentNodeKey(key); | 321 | this.store.setCurrentNodeKey(key); |
| 251 | }, | 322 | }, |
| 252 | 323 | ||
| 324 | /** | ||
| 325 | * @description: getNode | ||
| 326 | * @param {*} data | ||
| 327 | * @author: renchao | ||
| 328 | */ | ||
| 253 | getNode(data) { | 329 | getNode(data) { |
| 254 | return this.store.getNode(data); | 330 | return this.store.getNode(data); |
| 255 | }, | 331 | }, |
| 256 | 332 | ||
| 333 | /** | ||
| 334 | * @description: remove | ||
| 335 | * @param {*} data | ||
| 336 | * @author: renchao | ||
| 337 | */ | ||
| 257 | remove(data) { | 338 | remove(data) { |
| 258 | this.store.remove(data); | 339 | this.store.remove(data); |
| 259 | }, | 340 | }, |
| 260 | 341 | ||
| 342 | /** | ||
| 343 | * @description: append | ||
| 344 | * @param {*} data | ||
| 345 | * @param {*} parentNode | ||
| 346 | * @author: renchao | ||
| 347 | */ | ||
| 261 | append(data, parentNode) { | 348 | append(data, parentNode) { |
| 262 | this.store.append(data, parentNode); | 349 | this.store.append(data, parentNode); |
| 263 | }, | 350 | }, |
| 264 | 351 | ||
| 352 | /** | ||
| 353 | * @description: insertBefore | ||
| 354 | * @param {*} data | ||
| 355 | * @param {*} refNode | ||
| 356 | * @author: renchao | ||
| 357 | */ | ||
| 265 | insertBefore(data, refNode) { | 358 | insertBefore(data, refNode) { |
| 266 | this.store.insertBefore(data, refNode); | 359 | this.store.insertBefore(data, refNode); |
| 267 | }, | 360 | }, |
| 268 | 361 | ||
| 362 | /** | ||
| 363 | * @description: insertAfter | ||
| 364 | * @param {*} data | ||
| 365 | * @param {*} refNode | ||
| 366 | * @author: renchao | ||
| 367 | */ | ||
| 269 | insertAfter(data, refNode) { | 368 | insertAfter(data, refNode) { |
| 270 | this.store.insertAfter(data, refNode); | 369 | this.store.insertAfter(data, refNode); |
| 271 | }, | 370 | }, |
| 272 | 371 | ||
| 372 | /** | ||
| 373 | * @description: handleNodeExpand | ||
| 374 | * @param {*} nodeData | ||
| 375 | * @param {*} node | ||
| 376 | * @param {*} instance | ||
| 377 | * @author: renchao | ||
| 378 | */ | ||
| 273 | handleNodeExpand(nodeData, node, instance) { | 379 | handleNodeExpand(nodeData, node, instance) { |
| 274 | this.broadcast('ElTreeNode', 'tree-node-expand', node); | 380 | this.broadcast('ElTreeNode', 'tree-node-expand', node); |
| 275 | this.$emit('node-expand', nodeData, node, instance); | 381 | this.$emit('node-expand', nodeData, node, instance); |
| 276 | }, | 382 | }, |
| 277 | 383 | ||
| 384 | /** | ||
| 385 | * @description: updateKeyChildren | ||
| 386 | * @param {*} key | ||
| 387 | * @param {*} data | ||
| 388 | * @author: renchao | ||
| 389 | */ | ||
| 278 | updateKeyChildren(key, data) { | 390 | updateKeyChildren(key, data) { |
| 279 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild'); | 391 | if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild'); |
| 280 | this.store.updateChildren(key, data); | 392 | this.store.updateChildren(key, data); |
| 281 | }, | 393 | }, |
| 282 | 394 | ||
| 395 | /** | ||
| 396 | * @description: initTabIndex | ||
| 397 | * @author: renchao | ||
| 398 | */ | ||
| 283 | initTabIndex() { | 399 | initTabIndex() { |
| 284 | this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]'); | 400 | this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]'); |
| 285 | this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]'); | 401 | this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]'); |
| ... | @@ -291,6 +407,11 @@ | ... | @@ -291,6 +407,11 @@ |
| 291 | this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0); | 407 | this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0); |
| 292 | }, | 408 | }, |
| 293 | 409 | ||
| 410 | /** | ||
| 411 | * @description: handleKeydown | ||
| 412 | * @param {*} ev | ||
| 413 | * @author: renchao | ||
| 414 | */ | ||
| 294 | handleKeydown(ev) { | 415 | handleKeydown(ev) { |
| 295 | const currentItem = ev.target; | 416 | const currentItem = ev.target; |
| 296 | if (currentItem.className.indexOf('el-tree-node') === -1) return; | 417 | if (currentItem.className.indexOf('el-tree-node') === -1) return; |
| ... | @@ -319,6 +440,10 @@ | ... | @@ -319,6 +440,10 @@ |
| 319 | } | 440 | } |
| 320 | }, | 441 | }, |
| 321 | 442 | ||
| 443 | /** | ||
| 444 | * @description: created | ||
| 445 | * @author: renchao | ||
| 446 | */ | ||
| 322 | created() { | 447 | created() { |
| 323 | this.isTree = true; | 448 | this.isTree = true; |
| 324 | 449 | ... | ... |
src/components/formMenu/qlr.vue
deleted
100644 → 0
| 1 | <template> | ||
| 2 | <div class="temp"> | ||
| 3 | <table class="tempTable" cellspacing="0" cellpadding="0" border="1"> | ||
| 4 | <tr> | ||
| 5 | <template v-if="lq == ''"> | ||
| 6 | <td colspan="2"><span class="table-title">权利人信息</span></td> | ||
| 7 | <td colspan="2">共有方式</td> | ||
| 8 | </template> | ||
| 9 | <template v-else> | ||
| 10 | <td colspan="2">共有方式</td> | ||
| 11 | </template> | ||
| 12 | <td :colspan="lq == '' ? 8 : 10"> | ||
| 13 | <el-row> | ||
| 14 | <el-col :span="14" class="fl" style="line-height:32px"> | ||
| 15 | <el-radio-group v-model="gyfs" @change="updateGyfs"> | ||
| 16 | <el-radio :label="item.bsm" :disabled="+qszt !== 0 || item.disabled" :key="item.bsm" | ||
| 17 | v-for="item in gyfsList">{{ item.mc }}</el-radio> | ||
| 18 | </el-radio-group> | ||
| 19 | </el-col> | ||
| 20 | <el-col :span="10" class="fr"> | ||
| 21 | <!-- <div v-show="qszt=='0'" class="fr" style="margin-right:20px"> | ||
| 22 | <el-button class="qlrBtn" size="mini" @click="addRow"> | ||
| 23 | <i class="iconfont iconxinzeng"></i> 新增 | ||
| 24 | </el-button> | ||
| 25 | <el-button class="qlrBtn" size="mini" @click="changeRow"> | ||
| 26 | <i class="iconfont iconbianji"></i> 编辑 | ||
| 27 | </el-button> | ||
| 28 | <el-button class="qlrBtn" size="mini" @click="delRow"> | ||
| 29 | <i class="iconfont iconshanchu"></i> 删除 | ||
| 30 | </el-button> | ||
| 31 | </div>--> | ||
| 32 | <div v-show="+qszt === 0" class="fr" style="margin-right:20px"> | ||
| 33 | <el-button class="qlrBtn" size="mini" | ||
| 34 | :disabled="+qszt !== 0 || (tableData.length > 0 && gyfs === 'PSHGSBDCQJDC000000000000DC340010')" | ||
| 35 | @click="addRow"> | ||
| 36 | <i class="iconfont iconxinzeng" :disabled="+qszt !== 0"></i> 新增 | ||
| 37 | </el-button> | ||
| 38 | <el-button class="qlrBtn" size="mini" :disabled="+qszt !== 0" @click="changeRow"> | ||
| 39 | <i class="iconfont iconbianji"></i> 编辑 | ||
| 40 | </el-button> | ||
| 41 | <el-button class="qlrBtn" size="mini" :disabled="+qszt !== 0" @click="delRow"> | ||
| 42 | <i class="iconfont iconshanchu"></i> 删除 | ||
| 43 | </el-button> | ||
| 44 | </div> | ||
| 45 | </el-col> | ||
| 46 | </el-row> | ||
| 47 | </td> | ||
| 48 | </tr> | ||
| 49 | </table> | ||
| 50 | |||
| 51 | <el-table class="qlrTable" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" | ||
| 52 | @row-dblclick="rowDbclick" border> | ||
| 53 | <el-table-column type="selection" width="40" align="center"> | ||
| 54 | </el-table-column> | ||
| 55 | <el-table-column prop="qlrmc" label="权利人名称" align="center"> | ||
| 56 | </el-table-column> | ||
| 57 | <el-table-column prop="qlrlxbsm_dictText" label="权利人类型" align="center"> | ||
| 58 | </el-table-column> | ||
| 59 | <el-table-column prop="zjzlbsm_dictText" label="证件种类" align="center"> | ||
| 60 | </el-table-column> | ||
| 61 | <el-table-column prop="zjh" label="证件号" align="center"> | ||
| 62 | </el-table-column> | ||
| 63 | <el-table-column prop="dz" label="通讯地址" align="center"> | ||
| 64 | </el-table-column> | ||
| 65 | <el-table-column prop="dh" label="联系电话" align="center"> | ||
| 66 | </el-table-column> | ||
| 67 | </el-table> | ||
| 68 | <el-dialog :close-on-click-modal="false" title="权利人信息" :visible.sync="dialogVisible" custom-class="insetDialog" | ||
| 69 | append-to-body width="50%"> | ||
| 70 | <el-form :model="formData" class="qlrForm"> | ||
| 71 | <table class="zdjbxxTable" cellspacing="0" cellpadding="0" border="1"> | ||
| 72 | <tr> | ||
| 73 | <td colspan="4" class="tdright"><i class="requisite">*</i>权利人名称</td> | ||
| 74 | <td colspan="6"> | ||
| 75 | <el-input v-model="formData.qlrmc" ref="qlrmc" @blur="inputBlur($event)"></el-input> | ||
| 76 | </td> | ||
| 77 | <td colspan="4" class="tdright"><i class="requisite">*</i>权利人类型</td> | ||
| 78 | <td colspan="6"> | ||
| 79 | <el-select class="formSelect" v-model="formData.qlrlxbsm" ref="qlrlxbsm"> | ||
| 80 | <el-option v-for="item in $store.state.qlrlxList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 81 | </el-option> | ||
| 82 | </el-select> | ||
| 83 | </td> | ||
| 84 | </tr> | ||
| 85 | <tr> | ||
| 86 | <td colspan="4" class="tdright"><i class="requisite">*</i>证件类型</td> | ||
| 87 | <td colspan="6"> | ||
| 88 | <el-select class="formSelect" v-model="formData.zjzlbsm" ref="zjzlbsm"> | ||
| 89 | <el-option v-for="item in $store.state.zjzlList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 90 | </el-option> | ||
| 91 | </el-select> | ||
| 92 | </td> | ||
| 93 | <td colspan="4" class="tdright"><i class="requisite">*</i>证件号</td> | ||
| 94 | <td colspan="6"> | ||
| 95 | <el-input maxlength="18" v-model="formData.zjh" ref="zjh" @blur="inputBlur($event)"></el-input> | ||
| 96 | </td> | ||
| 97 | </tr> | ||
| 98 | <tr> | ||
| 99 | <td colspan="4" class="tdright"><i class="requisite">*</i>电话</td> | ||
| 100 | <td colspan="6"> | ||
| 101 | <!-- @blur="inputBlur($event)"--> | ||
| 102 | <el-input v-model="formData.dh" ref="dh" @blur="inputBlur($event)"></el-input> | ||
| 103 | </td> | ||
| 104 | <td colspan="4" class="tdright"><i class="requisite">*</i>地址</td> | ||
| 105 | <td colspan="6"> | ||
| 106 | <el-input v-model="formData.dz" ref="dz" @blur="inputBlur($event)"></el-input> | ||
| 107 | </td> | ||
| 108 | </tr> | ||
| 109 | <tr> | ||
| 110 | <td colspan="4" class="tdright">国家</td> | ||
| 111 | <td colspan="6"> | ||
| 112 | <el-select class="formSelect" v-model="formData.gjbsm"> | ||
| 113 | <el-option v-for="item in $store.state.gjList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 114 | </el-option> | ||
| 115 | </el-select> | ||
| 116 | </td> | ||
| 117 | <td colspan="4" class="tdright">户籍所在省市</td> | ||
| 118 | <td colspan="6"> | ||
| 119 | <el-select class="formSelect" v-model="formData.hjszssbsm"> | ||
| 120 | <el-option v-for="item in $store.state.ssList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 121 | </el-option> | ||
| 122 | </el-select> | ||
| 123 | </td> | ||
| 124 | </tr> | ||
| 125 | <tr> | ||
| 126 | <td colspan="4" class="tdright">性别</td> | ||
| 127 | <td colspan="6"> | ||
| 128 | <el-select class="formSelect" v-model="formData.xbbsm"> | ||
| 129 | <el-option v-for="item in $store.state.xbList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 130 | </el-option> | ||
| 131 | </el-select> | ||
| 132 | </td> | ||
| 133 | <td colspan="4" class="tdright">邮编</td> | ||
| 134 | <td colspan="6"> | ||
| 135 | <el-input v-model="formData.yb" /> | ||
| 136 | </td> | ||
| 137 | </tr> | ||
| 138 | <tr> | ||
| 139 | <td colspan="4" class="tdright">所属行业</td> | ||
| 140 | <td colspan="6"> | ||
| 141 | <el-select class="formSelect" v-model="formData.sshy"> | ||
| 142 | <el-option v-for="item in $store.state.sshyList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 143 | </el-option> | ||
| 144 | </el-select> | ||
| 145 | </td> | ||
| 146 | <td colspan="4" class="tdright">电子邮件</td> | ||
| 147 | <td colspan="6"> | ||
| 148 | <el-input v-model="formData.dzyj" /> | ||
| 149 | </td> | ||
| 150 | </tr> | ||
| 151 | <tr> | ||
| 152 | <th colspan="20">法人信息</th> | ||
| 153 | </tr> | ||
| 154 | <tr> | ||
| 155 | <td colspan="4" class="tdright">法定代表人或负责人姓名</td> | ||
| 156 | <td colspan="6"> | ||
| 157 | <el-input v-model="formData.fr.dlrfrmc" /> | ||
| 158 | </td> | ||
| 159 | <td colspan="4" class="tdright">证件类型</td> | ||
| 160 | <td colspan="6"> | ||
| 161 | <el-select class="formSelect" v-model="formData.fr.zjzlbsm"> | ||
| 162 | <el-option v-for="item in $store.state.zjzlList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 163 | </el-option> | ||
| 164 | </el-select> | ||
| 165 | </td> | ||
| 166 | </tr> | ||
| 167 | <tr> | ||
| 168 | <td colspan="4" class="tdright">证件号码</td> | ||
| 169 | <td colspan="6"> | ||
| 170 | <el-input v-model="formData.fr.zjh" /> | ||
| 171 | </td> | ||
| 172 | <td colspan="4" class="tdright">电话</td> | ||
| 173 | <td colspan="6"> | ||
| 174 | <el-input v-model="formData.fr.dh" /> | ||
| 175 | </td> | ||
| 176 | </tr> | ||
| 177 | <tr> | ||
| 178 | <th colspan="20">代理人信息</th> | ||
| 179 | </tr> | ||
| 180 | <template v-for="(item, index) in formData.dlrList"> | ||
| 181 | <tr :key="item.index"> | ||
| 182 | <td :rowspan="(formData.dlrList.length - 1) * 2 + 2" v-if="index == 0" class="btnCol"> | ||
| 183 | <span :style="{ 'padding-top': (formData.dlrList.length - 1) * 36 + 20 + 'px' }"> | ||
| 184 | <i v-show="index == 0" class="iconfont iconicon-test2" @click="handleClick(item, index, 'add')"></i> | ||
| 185 | </span> | ||
| 186 | <!-- <div class="line" v-show=" index != formData.dlrList.length-1"></div> --> | ||
| 187 | </td> | ||
| 188 | <td rowspan="2" class="minusBtnCol"> | ||
| 189 | <span> | ||
| 190 | <i class="iconfont icon-" @click="handleClick(item, index, 'minus')"></i> | ||
| 191 | </span> | ||
| 192 | </td> | ||
| 193 | <td class="tdright" colspan="2">代理人姓名</td> | ||
| 194 | <td colspan="6"> | ||
| 195 | <el-input v-model="item.dlrfrmc" /> | ||
| 196 | </td> | ||
| 197 | <td colspan="4" class="tdright">证件类型</td> | ||
| 198 | <td colspan="6"> | ||
| 199 | <el-select class="formSelect" v-model="item.zjzlbsm"> | ||
| 200 | <el-option v-for="item in $store.state.zjzlList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 201 | </el-option> | ||
| 202 | </el-select> | ||
| 203 | </td> | ||
| 204 | </tr> | ||
| 205 | <!-- <tr :key="item.dh">--> | ||
| 206 | <tr :key="'dh' + index"> | ||
| 207 | <td class="tdright" colspan="2">证件号码</td> | ||
| 208 | <td colspan="6"> | ||
| 209 | <el-input v-model="item.zjh" /> | ||
| 210 | </td> | ||
| 211 | <td colspan="4" class="tdright">电话</td> | ||
| 212 | <td colspan="6"> | ||
| 213 | <el-input v-model="item.dh" /> | ||
| 214 | </td> | ||
| 215 | </tr> | ||
| 216 | </template> | ||
| 217 | |||
| 218 | <tr> | ||
| 219 | <th colspan="20">权利信息</th> | ||
| 220 | </tr> | ||
| 221 | <tr> | ||
| 222 | <td colspan="4" class="tdright">共有方式</td> | ||
| 223 | <td colspan="6"> | ||
| 224 | <el-select class="formSelect" v-model="formData.gyfsbsm" disabled> | ||
| 225 | <el-option v-for="item in $store.state.gyfsList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 226 | </el-option> | ||
| 227 | </el-select> | ||
| 228 | </td> | ||
| 229 | <td colspan="4" class="tdright">权利比例(%)</td> | ||
| 230 | <td colspan="6"> | ||
| 231 | <el-input v-model="formData.qlbl"></el-input> | ||
| 232 | </td> | ||
| 233 | </tr> | ||
| 234 | <tr> | ||
| 235 | <td colspan="4" class="tdright">房产证号</td> | ||
| 236 | <td colspan="6"> | ||
| 237 | <el-input v-model="formData.fczh"></el-input> | ||
| 238 | </td> | ||
| 239 | <td colspan="4" class="tdright">土地证号</td> | ||
| 240 | <td colspan="6"> | ||
| 241 | <el-input v-model="formData.tdzh"></el-input> | ||
| 242 | </td> | ||
| 243 | </tr> | ||
| 244 | <tr> | ||
| 245 | <td colspan="4" class="tdright">共有情况</td> | ||
| 246 | <td colspan="12"> | ||
| 247 | <el-input v-model="formData.gyqk"></el-input> | ||
| 248 | </td> | ||
| 249 | </tr> | ||
| 250 | </table> | ||
| 251 | </el-form> | ||
| 252 | <div class="dialog-footer"> | ||
| 253 | <el-button type="primary" @click="addNewQlrInfo">确 定</el-button> | ||
| 254 | <el-button @click="dialogVisible = false">取 消</el-button> | ||
| 255 | </div> | ||
| 256 | </el-dialog> | ||
| 257 | </div> | ||
| 258 | </template> | ||
| 259 | |||
| 260 | <script> | ||
| 261 | // import { getDdicByMC } from "@api/common"; | ||
| 262 | // import { insertQlrDlrFr, getQlrInfoByGlbsm, updateQlrDlrFr, deleteQlrDlrFrByQlrbsm, updateGyGyQlrQk, getQlrByGlbsmAndType } from "@api/qlr"; | ||
| 263 | |||
| 264 | export default { | ||
| 265 | props: { | ||
| 266 | qszt: { | ||
| 267 | type: String, | ||
| 268 | default: "0", | ||
| 269 | }, | ||
| 270 | title: { | ||
| 271 | type: String, | ||
| 272 | default: "", | ||
| 273 | }, | ||
| 274 | topHeight: { | ||
| 275 | type: String, | ||
| 276 | default: "15vh", | ||
| 277 | }, | ||
| 278 | bsm: { | ||
| 279 | type: String, | ||
| 280 | default: "", | ||
| 281 | }, | ||
| 282 | type: { | ||
| 283 | type: String, | ||
| 284 | default: "", | ||
| 285 | }, | ||
| 286 | lq: { | ||
| 287 | type: String, | ||
| 288 | default: "", | ||
| 289 | } | ||
| 290 | }, | ||
| 291 | data () { | ||
| 292 | return { | ||
| 293 | update: false, | ||
| 294 | gyfs: this.$store.state.gyfsList[0].bsm, | ||
| 295 | tableData: [], | ||
| 296 | gyfsList: [], | ||
| 297 | //表格选中项 | ||
| 298 | multipleSelection: [], | ||
| 299 | dialogVisible: false, | ||
| 300 | formData: { | ||
| 301 | addQjDlrFrRequest: [], | ||
| 302 | dlrList: [ | ||
| 303 | { | ||
| 304 | dh: "", | ||
| 305 | dlrfrmc: "", | ||
| 306 | qlrbsm: "", | ||
| 307 | zjh: "", | ||
| 308 | zjzlbsm: "", | ||
| 309 | }, | ||
| 310 | ], | ||
| 311 | fr: { | ||
| 312 | dh: "", | ||
| 313 | dlrfrmc: "", | ||
| 314 | qlrbsm: "", | ||
| 315 | zjh: "", | ||
| 316 | zjzlbsm: "", | ||
| 317 | }, | ||
| 318 | bz: "", | ||
| 319 | dh: "", | ||
| 320 | dz: "", | ||
| 321 | dzyj: "", | ||
| 322 | fczh: "", | ||
| 323 | fzjg: "", | ||
| 324 | gjbsm: "PSHGSBDCQJDC000000000000DC350010", //默认中国 | ||
| 325 | glbsm: "", | ||
| 326 | gyfsbsm: "", | ||
| 327 | gyqk: "", | ||
| 328 | gzdw: "", | ||
| 329 | hjszssbsm: "", | ||
| 330 | isdel: 0, | ||
| 331 | qlbl: "", | ||
| 332 | qlrlxbsm: "", | ||
| 333 | qlrmc: "", | ||
| 334 | sshy: "", | ||
| 335 | sxh: 0, | ||
| 336 | tdzh: "", | ||
| 337 | xbbsm: "", | ||
| 338 | yb: "", | ||
| 339 | zjh: "", | ||
| 340 | zjzlbsm: "", | ||
| 341 | lqqlrtype: "" | ||
| 342 | }, | ||
| 343 | glbsm: '', | ||
| 344 | rules: [], | ||
| 345 | }; | ||
| 346 | }, | ||
| 347 | methods: { | ||
| 348 | /** | ||
| 349 | * @description: inputBlur | ||
| 350 | * @author: renchao | ||
| 351 | */ | ||
| 352 | inputBlur (e) { | ||
| 353 | if (e.target.value != '') { | ||
| 354 | e.target.style.border = "" | ||
| 355 | } else { | ||
| 356 | e.target.style.border = "1px solid red"; | ||
| 357 | e.target.style.boxSizing = 'border-box'; | ||
| 358 | } | ||
| 359 | }, | ||
| 360 | /** | ||
| 361 | * @description: 新增行数据 | ||
| 362 | * @author: renchao | ||
| 363 | */ | ||
| 364 | addRow () { | ||
| 365 | |||
| 366 | console.log(this.gyfs, '共有方式') | ||
| 367 | |||
| 368 | this.update = false; | ||
| 369 | let flag = false; | ||
| 370 | for (let i = 0; i < this.$store.state.gyfsList.length; i++) { | ||
| 371 | let item = this.$store.state.gyfsList[i]; | ||
| 372 | if (item.mc === "单独所有" && item.bsm === this.gyfs) { | ||
| 373 | flag = true; | ||
| 374 | } | ||
| 375 | } | ||
| 376 | if (flag) { | ||
| 377 | if (this.tableData.length > 0) { | ||
| 378 | this.$message({ | ||
| 379 | message: "当前方式不可再新增权利人", | ||
| 380 | type: "warning", | ||
| 381 | }); | ||
| 382 | } else { | ||
| 383 | this.formData.gyfsbsm = this.gyfs; | ||
| 384 | this.dialogVisible = true; | ||
| 385 | } | ||
| 386 | } else { | ||
| 387 | this.formData.gyfsbsm = this.gyfs; | ||
| 388 | this.dialogVisible = true; | ||
| 389 | } | ||
| 390 | }, | ||
| 391 | /** | ||
| 392 | * @description: 确认权利人信息按钮;可以进行新增;可以进行更新; | ||
| 393 | * @author: renchao | ||
| 394 | */ | ||
| 395 | addNewQlrInfo () { | ||
| 396 | |||
| 397 | this.rules = [ | ||
| 398 | { | ||
| 399 | data: this.formData.qlrmc, | ||
| 400 | name: '权利人名称', | ||
| 401 | dom: this.$refs.qlrmc, | ||
| 402 | rule: /^\s*$/g, //非空 | ||
| 403 | }, | ||
| 404 | { | ||
| 405 | data: this.formData.qlrlxbsm, | ||
| 406 | name: '权利人类型', | ||
| 407 | dom: this.$refs.qlrlxbsm, | ||
| 408 | rule: /^\s*$/g, //非空 | ||
| 409 | }, | ||
| 410 | { | ||
| 411 | data: this.formData.zjzlbsm, | ||
| 412 | name: '证件类型', | ||
| 413 | dom: this.$refs.zjzlbsm, | ||
| 414 | rule: /^\s*$/g, //非空 | ||
| 415 | }, | ||
| 416 | { | ||
| 417 | data: this.formData.zjh, | ||
| 418 | name: '证件号', | ||
| 419 | dom: this.$refs.zjh, | ||
| 420 | rule: /^\s*$/g, //非空 | ||
| 421 | }, | ||
| 422 | { | ||
| 423 | data: this.formData.dh, | ||
| 424 | name: '电话', | ||
| 425 | dom: this.$refs.dh, | ||
| 426 | rule: /^\s*$/g, //非空 | ||
| 427 | }, | ||
| 428 | { | ||
| 429 | data: this.formData.dz, | ||
| 430 | name: '地址', | ||
| 431 | dom: this.$refs.dz, | ||
| 432 | rule: /^\s*$/g, //非空 | ||
| 433 | }, | ||
| 434 | ] | ||
| 435 | let flag = true; | ||
| 436 | this.rules.forEach(item => { | ||
| 437 | if (item.rule.test(item.data) || item.data == null) { | ||
| 438 | if (item.dom.$el) { | ||
| 439 | item.dom.$el.style.border = '1px solid red'; | ||
| 440 | item.dom.$el.style.boxSizing = 'border-box'; | ||
| 441 | } else { | ||
| 442 | item.dom.style.border = '1px solid red'; | ||
| 443 | item.dom.style.boxSizing = 'border-box'; | ||
| 444 | } | ||
| 445 | flag = false; | ||
| 446 | return false | ||
| 447 | } | ||
| 448 | console.log(this.tableData, '权利人信息') | ||
| 449 | console.log(this.$store.state.gyfsList[0].bsm, '确定之后共有方式') | ||
| 450 | }) | ||
| 451 | this.$nextTick(() => { | ||
| 452 | if (flag) { | ||
| 453 | //todo 权利人页面调整 | ||
| 454 | this.formData.addQjDlrFrRequest = []; | ||
| 455 | this.formData.glbsm = this.bsm; | ||
| 456 | //将代理人,法人数据合在一起,名称为addQjDlrFrRequest; | ||
| 457 | //法人的type字段类型为0, | ||
| 458 | this.formData.fr.type = 0; | ||
| 459 | this.formData.addQjDlrFrRequest.push(this.formData.fr); | ||
| 460 | for (let k = 0; k < this.formData.dlrList.length; k++) { | ||
| 461 | //代理人的type字段类型为1, | ||
| 462 | this.formData.dlrList[k].type = 1; | ||
| 463 | this.formData.addQjDlrFrRequest.push(this.formData.dlrList[k]); | ||
| 464 | } | ||
| 465 | //林权权利人类型判断 | ||
| 466 | this.formData.lqqlrtype = this.lq; | ||
| 467 | //如果是从更新按钮点击确定的则进行更新操作,如果不是,则进行添加操作 | ||
| 468 | if (this.update) { | ||
| 469 | console.log(this.formData) | ||
| 470 | updateQlrDlrFr(this.formData).then((res) => { | ||
| 471 | if (res.code === 200) { | ||
| 472 | this.dialogVisible = false; | ||
| 473 | this.$message.success("修改完成!"); | ||
| 474 | this.getQlrInfo(this.bsm); | ||
| 475 | this.update = false; | ||
| 476 | } | ||
| 477 | }) | ||
| 478 | } else { | ||
| 479 | insertQlrDlrFr(this.formData).then((res) => { | ||
| 480 | if (res.code === 200) { | ||
| 481 | this.dialogVisible = false; | ||
| 482 | this.tableData.push(this.formData); | ||
| 483 | this.getQlrInfo(this.bsm); | ||
| 484 | Object.assign(this.$data, this.$options.data()) | ||
| 485 | |||
| 486 | } | ||
| 487 | }) | ||
| 488 | } | ||
| 489 | } | ||
| 490 | }) | ||
| 491 | |||
| 492 | |||
| 493 | }, | ||
| 494 | /** | ||
| 495 | * @description: 修改行数据 | ||
| 496 | * @author: renchao | ||
| 497 | */ | ||
| 498 | changeRow () { | ||
| 499 | if (this.multipleSelection.length === 1) { | ||
| 500 | this.dialogVisible = true; | ||
| 501 | this.update = true; | ||
| 502 | this.formData = this.multipleSelection[0]; | ||
| 503 | if (this.multipleSelection[0].frList.length > 0) { | ||
| 504 | this.formData.fr = this.multipleSelection[0].frList[0]; | ||
| 505 | } | ||
| 506 | } else { | ||
| 507 | this.$message({ | ||
| 508 | message: "请选择一条信息后继续操作", | ||
| 509 | type: "warning", | ||
| 510 | }); | ||
| 511 | } | ||
| 512 | }, | ||
| 513 | /** | ||
| 514 | * @description: updateGyfs | ||
| 515 | * @author: renchao | ||
| 516 | */ | ||
| 517 | updateGyfs (val) { | ||
| 518 | console.log(val, this.type) | ||
| 519 | updateGyGyQlrQk(this.bsm, this.type, val).then((res) => { | ||
| 520 | if (res.code === 200) { | ||
| 521 | console.log("修改完成!") | ||
| 522 | //todo 修改该建筑物的所有权利人的相关共有方式 | ||
| 523 | } | ||
| 524 | }) | ||
| 525 | }, | ||
| 526 | |||
| 527 | /** | ||
| 528 | * @description: 父组件改变子组件的共有方式 | ||
| 529 | * @author: renchao | ||
| 530 | */ | ||
| 531 | changeGyfs (val) { | ||
| 532 | this.gyfs = val; | ||
| 533 | }, | ||
| 534 | |||
| 535 | /** | ||
| 536 | * @description: 行双击事件 | ||
| 537 | * @author: renchao | ||
| 538 | */ | ||
| 539 | rowDbclick (row) { | ||
| 540 | if (+this.qszt == 0) { | ||
| 541 | this.dialogVisible = true; | ||
| 542 | this.update = true; | ||
| 543 | this.formData = row; | ||
| 544 | if (row.frList.length > 0) { | ||
| 545 | this.formData.fr = row.frList[0]; | ||
| 546 | } | ||
| 547 | } | ||
| 548 | }, | ||
| 549 | |||
| 550 | // inputBlur(e){ | ||
| 551 | // if(e.target.value!=''){ | ||
| 552 | // console.log(e.target.value) | ||
| 553 | // console.log(!(/^1(3|4|5|6|7|8|9)d{9}$/.test(e.target.value))) | ||
| 554 | // if(!(/^1(3|4|5|6|7|8|9)d{9}$/.test(e.target.value))){ | ||
| 555 | // e.target.style.border="1px solid red"; | ||
| 556 | // e.target.style.boxSizing = 'border-box'; | ||
| 557 | // }else { | ||
| 558 | // e.target.style.border="" | ||
| 559 | // } | ||
| 560 | // }else{ | ||
| 561 | // e.target.style.border="1px solid red"; | ||
| 562 | // e.target.style.boxSizing = 'border-box'; | ||
| 563 | // } | ||
| 564 | // }, | ||
| 565 | |||
| 566 | /** | ||
| 567 | * @description: 删除行数据 | ||
| 568 | * @author: renchao | ||
| 569 | */ | ||
| 570 | delRow () { | ||
| 571 | if (this.multipleSelection.length > 0) { | ||
| 572 | let qlrbsms = []; | ||
| 573 | for (let i = 0; i < this.multipleSelection.length; i++) { | ||
| 574 | qlrbsms.push(this.multipleSelection[i].qlrbsm) | ||
| 575 | } | ||
| 576 | console.log(qlrbsms) | ||
| 577 | deleteQlrDlrFrByQlrbsm(qlrbsms).then((res) => { | ||
| 578 | if (res.code === 200) { | ||
| 579 | this.$message.success("删除完成!") | ||
| 580 | this.getQlrInfo(this.bsm); | ||
| 581 | } | ||
| 582 | }) | ||
| 583 | } else { | ||
| 584 | this.$message({ | ||
| 585 | message: "请至少选择一条信息后继续操作", | ||
| 586 | type: "warning", | ||
| 587 | }); | ||
| 588 | } | ||
| 589 | }, | ||
| 590 | /** | ||
| 591 | * @description: 选中表格某一项 | ||
| 592 | * @author: renchao | ||
| 593 | */ | ||
| 594 | handleSelectionChange (val) { | ||
| 595 | this.multipleSelection = val; | ||
| 596 | }, | ||
| 597 | |||
| 598 | /** | ||
| 599 | * @description: 供父组件调用来获取共有方式 | ||
| 600 | * @author: renchao | ||
| 601 | */ | ||
| 602 | getQlgyfsData () { | ||
| 603 | return this.gyfs; | ||
| 604 | }, | ||
| 605 | /** | ||
| 606 | * @description: 供父组件调用来获取权利人表格数据 | ||
| 607 | * @author: renchao | ||
| 608 | */ | ||
| 609 | getQlrxxData () { | ||
| 610 | return this.tableData; | ||
| 611 | }, | ||
| 612 | /** | ||
| 613 | * @description: 增删代理人 | ||
| 614 | * @param {*} obj | ||
| 615 | * @param {*} ind | ||
| 616 | * @param {*} type | ||
| 617 | * @author: renchao | ||
| 618 | */ | ||
| 619 | handleClick (obj, ind, type) { | ||
| 620 | if (type === "add") { | ||
| 621 | this.formData.dlrList.push({ | ||
| 622 | id: Math.random(), | ||
| 623 | dh: "", | ||
| 624 | dlrfrmc: "", | ||
| 625 | qlrbsm: "", | ||
| 626 | zjh: "", | ||
| 627 | zjzlbsm: "", | ||
| 628 | }); | ||
| 629 | } else { | ||
| 630 | this.formData.dlrList.forEach((item, index) => { | ||
| 631 | if (index == ind && this.formData.dlrList.length > 1) { | ||
| 632 | this.formData.dlrList.splice(ind, 1); | ||
| 633 | } | ||
| 634 | }); | ||
| 635 | } | ||
| 636 | }, | ||
| 637 | /** | ||
| 638 | * @description: getQlrInfo | ||
| 639 | * @param {*} bsm | ||
| 640 | * @author: renchao | ||
| 641 | */ | ||
| 642 | getQlrInfo (bsm) { | ||
| 643 | if (this.lq == "") { | ||
| 644 | getQlrInfoByGlbsm(bsm).then((res) => { | ||
| 645 | if (res.code) { | ||
| 646 | if (res.result != null) { | ||
| 647 | this.tableData = res.result; | ||
| 648 | if (this.tableData.length === 0) { | ||
| 649 | this.gyfs = this.$store.state.gyfsList[0].bsm; | ||
| 650 | } else { | ||
| 651 | this.gyfs = res.result[0].gyfsbsm; | ||
| 652 | } | ||
| 653 | } | ||
| 654 | } | ||
| 655 | }) | ||
| 656 | } else { | ||
| 657 | let params = { | ||
| 658 | bsm: bsm, | ||
| 659 | type: this.lq | ||
| 660 | } | ||
| 661 | getQlrByGlbsmAndType(params).then((res) => { | ||
| 662 | if (res.code) { | ||
| 663 | if (res.result != null) { | ||
| 664 | this.tableData = res.result; | ||
| 665 | if (this.tableData.length === 0) { | ||
| 666 | this.gyfs = this.$store.state.gyfsList[0].bsm; | ||
| 667 | } else { | ||
| 668 | this.gyfs = res.result[0].gyfsbsm; | ||
| 669 | } | ||
| 670 | } | ||
| 671 | } | ||
| 672 | }) | ||
| 673 | } | ||
| 674 | } | ||
| 675 | }, | ||
| 676 | created () { | ||
| 677 | this.gyfsList = this.$store.state.gyfsList; | ||
| 678 | }, | ||
| 679 | mounted () { | ||
| 680 | this.getQlrInfo(this.bsm); | ||
| 681 | }, | ||
| 682 | watch: { | ||
| 683 | tableData: { | ||
| 684 | handler: function (v) { | ||
| 685 | this.gyfsList[0].disabled = v.length > 1; | ||
| 686 | }, | ||
| 687 | deep: true | ||
| 688 | }, | ||
| 689 | dialogVisible (n) { | ||
| 690 | if (n === false) { | ||
| 691 | this.formData = { | ||
| 692 | addQjDlrFrRequest: [], | ||
| 693 | dlrList: [ | ||
| 694 | { | ||
| 695 | dh: "", | ||
| 696 | dlrfrmc: "", | ||
| 697 | qlrbsm: "", | ||
| 698 | zjh: "", | ||
| 699 | zjzlbsm: "", | ||
| 700 | }, | ||
| 701 | ], | ||
| 702 | fr: { | ||
| 703 | dh: "", | ||
| 704 | dlrfrmc: "", | ||
| 705 | qlrbsm: "", | ||
| 706 | zjh: "", | ||
| 707 | zjzlbsm: "", | ||
| 708 | }, | ||
| 709 | bz: "", | ||
| 710 | dh: "", | ||
| 711 | dz: "", | ||
| 712 | dzyj: "", | ||
| 713 | fczh: "", | ||
| 714 | fzjg: "", | ||
| 715 | gjbsm: "PSHGSBDCQJDC000000000000DC350010", //默认中国 | ||
| 716 | glbsm: "", | ||
| 717 | gyfsbsm: "", | ||
| 718 | gyqk: "", | ||
| 719 | gzdw: "", | ||
| 720 | hjszssbsm: "", | ||
| 721 | isdel: 0, | ||
| 722 | qlbl: "", | ||
| 723 | qlrlxbsm: "", | ||
| 724 | qlrmc: "", | ||
| 725 | sshy: "", | ||
| 726 | sxh: 0, | ||
| 727 | tdzh: "", | ||
| 728 | xbbsm: "", | ||
| 729 | yb: "", | ||
| 730 | zjh: "", | ||
| 731 | zjzlbsm: "", | ||
| 732 | } | ||
| 733 | } | ||
| 734 | }, | ||
| 735 | |||
| 736 | "formData.qlrlxbsm": function (val) { | ||
| 737 | if (val != '') { | ||
| 738 | this.$refs.qlrlxbsm.$el.style.border = ''; | ||
| 739 | } | ||
| 740 | }, | ||
| 741 | } | ||
| 742 | }; | ||
| 743 | </script> | ||
| 744 | <style lang="scss"> | ||
| 745 | .temp { | ||
| 746 | width: 100%; | ||
| 747 | |||
| 748 | table { | ||
| 749 | border-bottom: 0; | ||
| 750 | background-color: #fff; | ||
| 751 | font-size: 14px; | ||
| 752 | width: 100%; | ||
| 753 | table-layout: fixed; | ||
| 754 | |||
| 755 | .qlrBtn { | ||
| 756 | border: 0; | ||
| 757 | font-size: 14px; | ||
| 758 | } | ||
| 759 | |||
| 760 | .qlrBtn:hover { | ||
| 761 | background-color: none !important; | ||
| 762 | } | ||
| 763 | |||
| 764 | .iconfont { | ||
| 765 | font-size: 14px !important; | ||
| 766 | } | ||
| 767 | |||
| 768 | .span { | ||
| 769 | color: #409eff; | ||
| 770 | margin-right: 10px; | ||
| 771 | cursor: pointer; | ||
| 772 | } | ||
| 773 | |||
| 774 | .noEdit { | ||
| 775 | color: #606266; | ||
| 776 | margin-right: 10px; | ||
| 777 | cursor: not-allowed; | ||
| 778 | } | ||
| 779 | |||
| 780 | .el-radio { | ||
| 781 | margin-right: 20px !important; | ||
| 782 | } | ||
| 783 | |||
| 784 | td { | ||
| 785 | text-align: center; | ||
| 786 | padding: 8px 0; | ||
| 787 | } | ||
| 788 | } | ||
| 789 | |||
| 790 | .table-title { | ||
| 791 | font-weight: 700; | ||
| 792 | font-size: 15px; | ||
| 793 | } | ||
| 794 | |||
| 795 | .el-table th { | ||
| 796 | background-color: #fff !important; | ||
| 797 | } | ||
| 798 | |||
| 799 | el-table td, | ||
| 800 | .el-table th.is-leaf, | ||
| 801 | .el-table--border, | ||
| 802 | .el-table--group { | ||
| 803 | border-color: black; | ||
| 804 | } | ||
| 805 | |||
| 806 | .el-table--border::after, | ||
| 807 | .el-table--group::after, | ||
| 808 | .el-table::before { | ||
| 809 | background-color: rgba(0, 0, 0, 0); | ||
| 810 | } | ||
| 811 | |||
| 812 | .el-table--border td, | ||
| 813 | .el-table--border th, | ||
| 814 | .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed { | ||
| 815 | border-right: 1px solid#E6E6E6; | ||
| 816 | } | ||
| 817 | |||
| 818 | .el-table td, | ||
| 819 | .el-table th { | ||
| 820 | padding: 12px 0; | ||
| 821 | color: #333 !important; | ||
| 822 | font-weight: normal; | ||
| 823 | } | ||
| 824 | |||
| 825 | .el-table td, | ||
| 826 | .el-table th.is-leaf { | ||
| 827 | border-bottom: 1px solid#E6E6E6; | ||
| 828 | border-color: #E6E6E6 !important; | ||
| 829 | } | ||
| 830 | |||
| 831 | .qlrTable { | ||
| 832 | border-color: #E6E6E6 !important; | ||
| 833 | border-bottom: 0; | ||
| 834 | border-right: 0; | ||
| 835 | position: relative; | ||
| 836 | top: -1px; | ||
| 837 | |||
| 838 | .el-input__inner { | ||
| 839 | height: 20px; | ||
| 840 | margin: 0; | ||
| 841 | line-height: 20px; | ||
| 842 | outline: none; | ||
| 843 | border: none; | ||
| 844 | color: #606764; | ||
| 845 | overflow: visible; | ||
| 846 | cursor: text; | ||
| 847 | text-align: center; | ||
| 848 | } | ||
| 849 | } | ||
| 850 | } | ||
| 851 | |||
| 852 | .insetDialog { | ||
| 853 | .qlrForm { | ||
| 854 | height: 500px; | ||
| 855 | overflow-y: scroll; | ||
| 856 | } | ||
| 857 | |||
| 858 | .zdjbxxTable { | ||
| 859 | margin: 10px 0; | ||
| 860 | background-color: #fff; | ||
| 861 | font-size: 14px; | ||
| 862 | width: 100%; | ||
| 863 | border-bottom: 1px solid #000; | ||
| 864 | |||
| 865 | .btnCol, | ||
| 866 | .minusBtnCol { | ||
| 867 | position: relative; | ||
| 868 | padding-right: 0; | ||
| 869 | |||
| 870 | span { | ||
| 871 | display: inline-block; | ||
| 872 | width: 100%; | ||
| 873 | height: 100%; | ||
| 874 | position: relative; | ||
| 875 | box-sizing: border-box; | ||
| 876 | padding-right: 10px; | ||
| 877 | padding-top: 20px; | ||
| 878 | } | ||
| 879 | |||
| 880 | .line { | ||
| 881 | width: 100%; | ||
| 882 | height: 2px; | ||
| 883 | background: #fff; | ||
| 884 | } | ||
| 885 | |||
| 886 | i { | ||
| 887 | color: #66b1ff; | ||
| 888 | font-size: 30px; | ||
| 889 | cursor: pointer; | ||
| 890 | z-index: 1; | ||
| 891 | } | ||
| 892 | } | ||
| 893 | |||
| 894 | .minusBtnCol { | ||
| 895 | i { | ||
| 896 | color: #FA6400; | ||
| 897 | } | ||
| 898 | } | ||
| 899 | |||
| 900 | th { | ||
| 901 | height: 36px; | ||
| 902 | line-height: 36px; | ||
| 903 | } | ||
| 904 | |||
| 905 | td { | ||
| 906 | text-align: right; | ||
| 907 | height: 36px; | ||
| 908 | } | ||
| 909 | |||
| 910 | /deep/.el-input__inner { | ||
| 911 | margin: 0; | ||
| 912 | height: 36px; | ||
| 913 | outline: none; | ||
| 914 | border: none; | ||
| 915 | color: #606764; | ||
| 916 | overflow: visible; | ||
| 917 | text-align: left; | ||
| 918 | cursor: text; | ||
| 919 | } | ||
| 920 | |||
| 921 | .percent68 { | ||
| 922 | width: 68% !important; | ||
| 923 | float: left; | ||
| 924 | position: relative; | ||
| 925 | top: 7px; | ||
| 926 | } | ||
| 927 | |||
| 928 | .percent30 { | ||
| 929 | width: 30% !important; | ||
| 930 | float: left; | ||
| 931 | } | ||
| 932 | |||
| 933 | .el-input__icon { | ||
| 934 | line-height: 37px; | ||
| 935 | } | ||
| 936 | |||
| 937 | .el-select { | ||
| 938 | width: 100%; | ||
| 939 | } | ||
| 940 | } | ||
| 941 | |||
| 942 | .dialog-footer { | ||
| 943 | width: 160px; | ||
| 944 | margin: 20px auto 0; | ||
| 945 | } | ||
| 946 | } | ||
| 947 | </style> |
src/components/formMenu/qlxz.vue
deleted
100644 → 0
| 1 | <template> | ||
| 2 | <div class="temp"> | ||
| 3 | <div class="qlxzAdd fl"> | ||
| 4 | <span>权利性质</span> | ||
| 5 | <i class="iconfont iconicon-test2" v-if="formData.qszt == '0'" @click="handleClick(0, 'add')"></i> | ||
| 6 | <i class="iconfont iconicon-test2" v-if="formData.qszt != '0'" style="cursor: not-allowed;"></i> | ||
| 7 | </div> | ||
| 8 | <el-row class="qlxzModule fl" v-for="(items, index) in countList" :key="items.id"> | ||
| 9 | <template v-for="(childItem, childIndex) in items.list"> | ||
| 10 | <el-col :span="1" class="btnCol " :key="childIndex + '1'" :class="childIndex > 0 ? 'childYT noTopBorder' : ''"> | ||
| 11 | <i v-show="childIndex == 0 && formData.qszt == '0'" | ||
| 12 | :style="{ 'margin-top': (items.list.length - 1) * 57 - 18 + 'px' }" class="iconfont icon- qlxzMinus" | ||
| 13 | @click="handleClick(index, 'minus')"></i> | ||
| 14 | <i v-show="childIndex == 0 && formData.qszt != '0'" | ||
| 15 | :style="{ 'margin-top': (items.list.length - 1) * 57 - 18 + 'px' }" class="iconfont icon- qlxzMinus" | ||
| 16 | style="cursor: not-allowed;"></i> | ||
| 17 | <div :class="items.hasNotBorder ? 'itemShow whiteItem' : 'whiteItem'" v-if="items.isInside"></div> | ||
| 18 | </el-col> | ||
| 19 | <el-col :span="2" class="btnCol tdytAdd" :key="childIndex + '17'" | ||
| 20 | :class="childIndex > 0 ? 'childYT noTopBorder' : ''"> | ||
| 21 | <template> | ||
| 22 | <span v-show="childIndex == 0" | ||
| 23 | :style="{ 'margin-top': (items.list.length - 1) * 57 - 40 + 'px' }">土地用途</span> | ||
| 24 | <i class="iconfont iconicon-test1" v-show="childIndex == 0 && formData.qszt == '0'" | ||
| 25 | :style="{ 'margin-top': (items.list.length - 1) * 57 + 'px' }" | ||
| 26 | @click="handleInClick(index, childIndex, 'add')"></i> | ||
| 27 | <i class="iconfont iconicon-test1" v-show="childIndex == 0 && formData.qszt != '0'" | ||
| 28 | :style="{ 'margin-top': (items.list.length - 1) * 57 + 'px' }" style="cursor: not-allowed;"></i> | ||
| 29 | </template> | ||
| 30 | </el-col> | ||
| 31 | <el-col :span="1" class="btnCol tdytMinus pr10" :key="childIndex + '18'" | ||
| 32 | :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 33 | <i class="iconfont iconicon-test" v-if="formData.qszt == '0'" | ||
| 34 | @click="handleInClick(index, childIndex, 'minus')"></i> | ||
| 35 | <i class="iconfont iconicon-test" v-if="formData.qszt != '0'" style="cursor: not-allowed;"></i> | ||
| 36 | </el-col> | ||
| 37 | <template v-if="hasSyqx"> | ||
| 38 | <el-col :span="3" :key="childIndex + '7'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 39 | <ul> | ||
| 40 | <li class="pr10"><i class="requisite">*</i>批准用途</li> | ||
| 41 | <li class="pr10"><i class="requisite">*</i>实际用途</li> | ||
| 42 | <li class="pr10"><i class="requisite">*</i>土地使用起始时间</li> | ||
| 43 | </ul> | ||
| 44 | </el-col> | ||
| 45 | <el-col :span="4" :key="childIndex + '6'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 46 | <ul> | ||
| 47 | <li> | ||
| 48 | <el-select-tree class="formSelect percent30" v-if="show" :default-expand-all="defaultExpandAll" | ||
| 49 | ref="pzytdm" :multiple="multiple" :placeholder="placeholder" :disabled="formData.qszt != '0'" | ||
| 50 | :data="$store.state.tdytList" :props="treeProps" :check-strictly="checkStrictly" | ||
| 51 | :clearable="clearable" v-model="childItem.pzytdm"></el-select-tree> | ||
| 52 | </li> | ||
| 53 | <li> | ||
| 54 | <el-select-tree class="formSelect percent30" v-if="show" :default-expand-all="defaultExpandAll" | ||
| 55 | ref="sjytdm" :multiple="multiple" :placeholder="placeholder" :disabled="formData.qszt != '0'" | ||
| 56 | :data="$store.state.tdytList" :props="treeProps" :check-strictly="checkStrictly" | ||
| 57 | :clearable="clearable" v-model="childItem.sjytdm"></el-select-tree> | ||
| 58 | </li> | ||
| 59 | <li> | ||
| 60 | <el-date-picker :disabled="formData.qszt != '0'" v-model="childItem.tdsyqssj" type="date" ref="tdsyqssj" | ||
| 61 | :picker-options="childItem.pickerStart" value-format="yyyy-MM-dd" placeholder="选择日期" | ||
| 62 | @blur="inputBlur($event, true)" @input="startTime(index, childIndex)"> | ||
| 63 | </el-date-picker> | ||
| 64 | </li> | ||
| 65 | </ul> | ||
| 66 | </el-col> | ||
| 67 | <el-col :span="3" :key="childIndex + '5'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 68 | <ul> | ||
| 69 | <li class="pr10">地类编码</li> | ||
| 70 | <li class="pr10">地类编码</li> | ||
| 71 | <li class="pr10"><i class="requisite">*</i>年限</li> | ||
| 72 | </ul> | ||
| 73 | </el-col> | ||
| 74 | <el-col :span="3" :key="childIndex + '4'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 75 | <ul> | ||
| 76 | <li> | ||
| 77 | <input type="text" style="top: -1px;" :disabled="formData.qszt != '0'" v-model="childItem.pzytdm" | ||
| 78 | class="formInput" /> | ||
| 79 | </li> | ||
| 80 | <li> | ||
| 81 | <input type="text" :disabled="formData.qszt != '0'" v-model="childItem.sjytdm" class="formInput" /> | ||
| 82 | </li> | ||
| 83 | <li> | ||
| 84 | <input type="text" ref="syqx" @blur="inputBlur($event, false)" maxlength="3" | ||
| 85 | onkeyup="value=value.replace(/[^\d]/g,'')" | ||
| 86 | @input="sumTime(index, childIndex, childItem.syqx, childItem.syqx)" :disabled="formData.qszt != '0'" | ||
| 87 | v-model="childItem.syqx" class="formInput" /> | ||
| 88 | </li> | ||
| 89 | </ul> | ||
| 90 | </el-col> | ||
| 91 | <el-col class="pr10" :span="3" :key="childIndex + '2'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 92 | <ul> | ||
| 93 | <li>等级</li> | ||
| 94 | <li>等级</li> | ||
| 95 | <li><i class="requisite">*</i>土地使用结束时间</li> | ||
| 96 | </ul> | ||
| 97 | </el-col> | ||
| 98 | <el-col :span="4" :key="childIndex + '3'" class="noRightBorder" :class="childIndex > 0 ? 'childYT ' : ''"> | ||
| 99 | <ul> | ||
| 100 | <li> | ||
| 101 | <el-select :disabled="formData.qszt != '0'" class="formSelect percent30" v-model="childItem.pzdjbsm"> | ||
| 102 | <el-option v-for="item in $store.state.tddjList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 103 | </el-option> | ||
| 104 | </el-select> | ||
| 105 | </li> | ||
| 106 | <li> | ||
| 107 | <el-select :disabled="formData.qszt != '0'" class="formSelect percent30" v-model="childItem.sjdjbsm"> | ||
| 108 | <el-option v-for="item in $store.state.tddjList" :key="item.bsm" :label="item.mc" :value="item.bsm"> | ||
| 109 | </el-option> | ||
| 110 | </el-select> | ||
| 111 | </li> | ||
| 112 | <li> | ||
| 113 | <el-date-picker :disabled="formData.qszt != '0'" v-model="childItem.tdsyjssj" type="date" ref="tdsyjssj" | ||
| 114 | @blur="inputBlur($event, true)" :picker-options="childItem.pickerEnd" | ||
| 115 | @input="endTime(index, childIndex, $event)" value-format="yyyy-MM-dd" placeholder="选择日期"> | ||
| 116 | </el-date-picker> | ||
| 117 | </li> | ||
| 118 | </ul> | ||
| 119 | </el-col> | ||
| 120 | </template> | ||
| 121 | <template v-if="!hasSyqx"> | ||
| 122 | <el-col :span="5" :key="childIndex + '7'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 123 | <ul> | ||
| 124 | <li class="pr10"><i class="requisite">*</i>批准用途</li> | ||
| 125 | <li class="pr10"><i class="requisite">*</i>实际用途</li> | ||
| 126 | <li class="pr10"><i class="requisite">*</i>土地使用起始时间</li> | ||
| 127 | </ul> | ||
| 128 | </el-col> | ||
| 129 | <el-col :span="5" :key="childIndex + '6'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 130 | <ul> | ||
| 131 | <li> | ||
| 132 | <el-select-tree v-if="show" class="formSelect percent30" :default-expand-all="defaultExpandAll" | ||
| 133 | ref="pzytdm" :multiple="multiple" :placeholder="placeholder" :disabled="formData.qszt != '0'" | ||
| 134 | :data="$store.state.tdytList" :props="treeProps" :check-strictly="checkStrictly" | ||
| 135 | :clearable="clearable" v-model="childItem.pzytdm"></el-select-tree> | ||
| 136 | </li> | ||
| 137 | <li> | ||
| 138 | <el-select-tree v-if="show" class="formSelect percent30" :default-expand-all="defaultExpandAll" | ||
| 139 | ref="sjytdm" :multiple="multiple" :placeholder="placeholder" :disabled="formData.qszt != '0'" | ||
| 140 | :data="$store.state.tdytList" :props="treeProps" :check-strictly="checkStrictly" | ||
| 141 | :clearable="clearable" v-model="childItem.sjytdm"></el-select-tree> | ||
| 142 | </li> | ||
| 143 | <li> | ||
| 144 | <el-date-picker v-model="childItem.tdsyqssj" ref="tdsyqssj" :disabled="formData.qszt != '0'" | ||
| 145 | :picker-options="childItem.pickerStart" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" | ||
| 146 | @blur="inputBlur($event, true)" @input="startTime(index, childIndex)"> | ||
| 147 | </el-date-picker> | ||
| 148 | </li> | ||
| 149 | </ul> | ||
| 150 | </el-col> | ||
| 151 | <el-col :span="5" :key="childIndex + '5'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 152 | <ul> | ||
| 153 | <li class="pr10">地类编码</li> | ||
| 154 | <li class="pr10">地类编码</li> | ||
| 155 | <li class="pr10"><i class="requisite">*</i>土地使用结束时间</li> | ||
| 156 | </ul> | ||
| 157 | </el-col> | ||
| 158 | <el-col :span="5" :key="childIndex + '4'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 159 | <ul> | ||
| 160 | <li> | ||
| 161 | <input type="text" style="top: -1px;" :disabled="formData.qszt != '0'" v-model="childItem.pzytdm" | ||
| 162 | class="formInput" /> | ||
| 163 | </li> | ||
| 164 | <li> | ||
| 165 | <input type="text" :disabled="formData.qszt != '0'" v-model="childItem.sjytdm" class="formInput" /> | ||
| 166 | </li> | ||
| 167 | <li> | ||
| 168 | <el-date-picker v-model="childItem.tdsyjssj" :disabled="formData.qszt != '0'" ref="tdsyjssj" type="date" | ||
| 169 | value-format="yyyy-MM-dd" :picker-options="childItem.pickerEnd" placeholder="选择日期" | ||
| 170 | @blur="inputBlur($event, true)" @input="endTime(index, childIndex)"> | ||
| 171 | </el-date-picker> | ||
| 172 | </li> | ||
| 173 | </ul> | ||
| 174 | </el-col> | ||
| 175 | </template> | ||
| 176 | </template> | ||
| 177 | |||
| 178 | <div class="title"> | ||
| 179 | <el-select-tree v-if="show" class="formSelect" :disabled="formData.qszt != '0'" | ||
| 180 | :default-expand-all="defaultExpandAll" :multiple="multiple" :placeholder="placeholder" | ||
| 181 | :data="$store.state.qlxzList" :props="treeProps" :check-strictly="checkStrictly" :clearable="clearable" | ||
| 182 | ref="qlxzdm" v-model="items.qlxzdm"></el-select-tree> | ||
| 183 | </div> | ||
| 184 | </el-row> | ||
| 185 | </div> | ||
| 186 | </template> | ||
| 187 | |||
| 188 | <script> | ||
| 189 | // import { getDdicByMC } from "@api/common"; | ||
| 190 | export default { | ||
| 191 | props: { | ||
| 192 | formData: { | ||
| 193 | type: Object, | ||
| 194 | default: () => { | ||
| 195 | return {}; | ||
| 196 | }, | ||
| 197 | }, | ||
| 198 | hasSyqx: { | ||
| 199 | type: Boolean, | ||
| 200 | default: false | ||
| 201 | } | ||
| 202 | }, | ||
| 203 | data () { | ||
| 204 | return { | ||
| 205 | //树型结构 | ||
| 206 | show: true, | ||
| 207 | clearable: true, | ||
| 208 | defaultExpandAll: true, | ||
| 209 | multiple: false, | ||
| 210 | placeholder: "请选择", | ||
| 211 | disabled: false, | ||
| 212 | checkStrictly: true, | ||
| 213 | treeProps: { | ||
| 214 | value: "dm", | ||
| 215 | children: "children", | ||
| 216 | label: "mc", | ||
| 217 | }, | ||
| 218 | |||
| 219 | countList: [ | ||
| 220 | { | ||
| 221 | id: Math.random(), | ||
| 222 | isInside: false, | ||
| 223 | hasNotBorder: false, | ||
| 224 | bsm: "", //权利性质标识码 | ||
| 225 | glbsm: "", //宗地BSM、自然幢BSM、户BSM、多幢BSM、宗海BSM | ||
| 226 | qlxzdm: "", | ||
| 227 | qlxzmc: "", | ||
| 228 | zhqlxzlx: "", //除宗海数据外,默认都是空;0:用海类型权利性质;2:海岛用途权利性质 | ||
| 229 | list: [ | ||
| 230 | { | ||
| 231 | pzdjbsm: "", | ||
| 232 | pzdjmc: "", | ||
| 233 | pzytdm: "", | ||
| 234 | pzytmc: "", | ||
| 235 | pzytmj: 0, | ||
| 236 | qlxzbsm: "", | ||
| 237 | sjdjbsm: "", | ||
| 238 | sjdjmc: "", | ||
| 239 | sjytdm: "", | ||
| 240 | sjytmc: "", | ||
| 241 | sjytmj: 0, | ||
| 242 | syqx: "", | ||
| 243 | tdsyjssj: "", | ||
| 244 | pickerStart: {}, | ||
| 245 | pickerEnd: {}, | ||
| 246 | tdsyqssj: "", | ||
| 247 | tdzh: "", | ||
| 248 | }, | ||
| 249 | ], | ||
| 250 | }, | ||
| 251 | ], | ||
| 252 | outNum: 0, | ||
| 253 | rulesResult: true,//权利性质表单校验结果 | ||
| 254 | }; | ||
| 255 | }, | ||
| 256 | created () { }, | ||
| 257 | mounted () { | ||
| 258 | }, | ||
| 259 | methods: { | ||
| 260 | /** | ||
| 261 | * @description: startTime | ||
| 262 | * @param {*} index | ||
| 263 | * @param {*} childIndex | ||
| 264 | * @author: renchao | ||
| 265 | */ | ||
| 266 | startTime (index, childIndex) { | ||
| 267 | let startTime = this.countList[index].list[childIndex].tdsyqssj; | ||
| 268 | let endTime = this.countList[index].list[childIndex].tdsyjssj; | ||
| 269 | this.countList[index].list[childIndex].pickerEnd = { | ||
| 270 | disabledDate: (time) => { | ||
| 271 | if (Object.keys(startTime).length > 0) { | ||
| 272 | return new Date(startTime).getTime() > time.getTime(); | ||
| 273 | } else { | ||
| 274 | return time.getTime() < Date.now(); | ||
| 275 | } | ||
| 276 | } | ||
| 277 | } | ||
| 278 | if (Object.keys(startTime).length > 0 && Object.keys(endTime).length > 0) { | ||
| 279 | let startYear = new Date(startTime).getFullYear(); | ||
| 280 | let endYear = new Date(endTime).getFullYear(); | ||
| 281 | //年限暂时不算 | ||
| 282 | // this.countList[index].list[childIndex].syqx=endYear-startYear; | ||
| 283 | } | ||
| 284 | }, | ||
| 285 | /** | ||
| 286 | * @description: sumTime | ||
| 287 | * @param {*} index | ||
| 288 | * @param {*} childIndex | ||
| 289 | * @param {*} syqx | ||
| 290 | * @author: renchao | ||
| 291 | */ | ||
| 292 | sumTime (index, childIndex, syqx, e) { | ||
| 293 | this.$refs.syqx.forEach((item, index) => { | ||
| 294 | if (item.value == syqx) { | ||
| 295 | this.$refs.tdsyjssj[index].$el.style.border = "" | ||
| 296 | } | ||
| 297 | }) | ||
| 298 | let startTime = this.countList[index].list[childIndex].tdsyqssj; | ||
| 299 | this.countList[index].list[childIndex].tdsyjssj = Number(startTime.substring(0, 4)) + Number(syqx) + startTime.slice(4, 10); | ||
| 300 | }, | ||
| 301 | /** | ||
| 302 | * @description: endTime | ||
| 303 | * @param {*} index | ||
| 304 | * @param {*} childIndex | ||
| 305 | * @author: renchao | ||
| 306 | */ | ||
| 307 | endTime (index, childIndex, e) { | ||
| 308 | let startTime = this.countList[index].list[childIndex].tdsyqssj; | ||
| 309 | let endTime = this.countList[index].list[childIndex].tdsyjssj; | ||
| 310 | this.countList[index].list[childIndex].pickerStart = { | ||
| 311 | disabledDate: (time) => { | ||
| 312 | if (Object.keys(endTime).length > 0) { | ||
| 313 | return new Date(endTime).getTime() < time.getTime(); | ||
| 314 | } else { | ||
| 315 | return time.getTime() > Date.now(); | ||
| 316 | } | ||
| 317 | } | ||
| 318 | } | ||
| 319 | if (Object.keys(startTime).length > 0 && Object.keys(endTime).length > 0) { | ||
| 320 | let startYear = new Date(startTime).getFullYear(); | ||
| 321 | let endYear = new Date(endTime).getFullYear(); | ||
| 322 | // this.countList[index].list[childIndex].syqx=endYear-startYear; | ||
| 323 | } | ||
| 324 | }, | ||
| 325 | /** | ||
| 326 | * @description: 外层操作 | ||
| 327 | * @param {*} ind | ||
| 328 | * @param {*} type | ||
| 329 | * @author: renchao | ||
| 330 | */ | ||
| 331 | handleClick (ind, type) { | ||
| 332 | let outsideObj = { | ||
| 333 | id: Math.random(), | ||
| 334 | isInside: false, | ||
| 335 | hasNotBorder: false, | ||
| 336 | bsm: "", //权利性质标识码 | ||
| 337 | glbsm: "", //宗地BSM、自然幢BSM、户BSM、多幢BSM、宗海BSM | ||
| 338 | qlxzdm: "", | ||
| 339 | qlxzmc: "", | ||
| 340 | zhqlxzlx: "", //除宗海数据外,默认都是空;0:用海类型权利性质;2:海岛用途权利性质 | ||
| 341 | list: [ | ||
| 342 | { | ||
| 343 | pzdjbsm: "", | ||
| 344 | pzdjmc: "", | ||
| 345 | pzytdm: "", | ||
| 346 | pzytmc: "", | ||
| 347 | pzytmj: 0, | ||
| 348 | qlxzbsm: "", | ||
| 349 | sjdjbsm: "", | ||
| 350 | sjdjmc: "", | ||
| 351 | sjytdm: "", | ||
| 352 | pickerStart: {}, | ||
| 353 | pickerEnd: {}, | ||
| 354 | sjytmc: "", | ||
| 355 | sjytmj: 0, | ||
| 356 | syqx: "", | ||
| 357 | tdsyjssj: "", | ||
| 358 | tdsyqssj: "", | ||
| 359 | tdzh: "", | ||
| 360 | }, | ||
| 361 | ], | ||
| 362 | }; | ||
| 363 | if (type === "add") { | ||
| 364 | this.countList.push(outsideObj); | ||
| 365 | this.outNum++; | ||
| 366 | } else { | ||
| 367 | this.countList.forEach((item, index) => { | ||
| 368 | if (index == ind && this.countList.length > 1) { | ||
| 369 | this.countList.splice(index, 1); | ||
| 370 | } | ||
| 371 | }); | ||
| 372 | this.outNum--; | ||
| 373 | } | ||
| 374 | }, | ||
| 375 | /** | ||
| 376 | * @description: reset | ||
| 377 | * @author: renchao | ||
| 378 | */ | ||
| 379 | reset () { | ||
| 380 | this.countList = [ | ||
| 381 | { | ||
| 382 | id: Math.random(), | ||
| 383 | isInside: false, | ||
| 384 | hasNotBorder: false, | ||
| 385 | bsm: "", //权利性质标识码 | ||
| 386 | glbsm: "", //宗地BSM、自然幢BSM、户BSM、多幢BSM、宗海BSM | ||
| 387 | qlxzdm: "", | ||
| 388 | qlxzmc: "", | ||
| 389 | zhqlxzlx: "", //除宗海数据外,默认都是空;0:用海类型权利性质;2:海岛用途权利性质 | ||
| 390 | list: [ | ||
| 391 | { | ||
| 392 | pzdjbsm: "", | ||
| 393 | pzdjmc: "", | ||
| 394 | pzytdm: "", | ||
| 395 | pzytmc: "", | ||
| 396 | pzytmj: 0, | ||
| 397 | qlxzbsm: "", | ||
| 398 | sjdjbsm: "", | ||
| 399 | sjdjmc: "", | ||
| 400 | sjytdm: "", | ||
| 401 | sjytmc: "", | ||
| 402 | sjytmj: 0, | ||
| 403 | syqx: "", | ||
| 404 | tdsyjssj: "", | ||
| 405 | pickerStart: {}, | ||
| 406 | pickerEnd: {}, | ||
| 407 | tdsyqssj: "", | ||
| 408 | tdzh: "", | ||
| 409 | }, | ||
| 410 | ], | ||
| 411 | }, | ||
| 412 | ]; | ||
| 413 | }, | ||
| 414 | /** | ||
| 415 | * @description: 内层操作 | ||
| 416 | * @param {*} index | ||
| 417 | * @param {*} childIndex | ||
| 418 | * @param {*} type | ||
| 419 | * @author: renchao | ||
| 420 | */ | ||
| 421 | handleInClick (index, childIndex, type) { | ||
| 422 | let insideObj = { | ||
| 423 | pzdjbsm: "", | ||
| 424 | pzdjmc: "", | ||
| 425 | pzytdm: "", | ||
| 426 | pzytmc: "", | ||
| 427 | pzytmj: 0, | ||
| 428 | qlxzbsm: "", | ||
| 429 | sjdjbsm: "", | ||
| 430 | sjdjmc: "", | ||
| 431 | sjytdm: "", | ||
| 432 | sjytmc: "", | ||
| 433 | sjytmj: 0, | ||
| 434 | pickerStart: {}, | ||
| 435 | pickerEnd: {}, | ||
| 436 | syqx: "", | ||
| 437 | tdsyjssj: "", | ||
| 438 | tdsyqssj: "", | ||
| 439 | tdzh: "", | ||
| 440 | }; | ||
| 441 | if (type === "add") { | ||
| 442 | this.countList[index].list.splice(childIndex + 1, 0, insideObj); | ||
| 443 | } else { | ||
| 444 | this.countList[index].list.forEach((item, childInd) => { | ||
| 445 | if (childIndex == childInd && this.countList[index].list.length > 1) { | ||
| 446 | this.countList[index].list.splice(childIndex, 1); | ||
| 447 | } | ||
| 448 | }); | ||
| 449 | } | ||
| 450 | this.hasBorderOrNot(); | ||
| 451 | }, | ||
| 452 | /** | ||
| 453 | * @description: 判断是否显示边框 | ||
| 454 | * @author: renchao | ||
| 455 | */ | ||
| 456 | hasBorderOrNot () { | ||
| 457 | this.countList.forEach((item, index) => { | ||
| 458 | if (index == this.countList.length - 1) { | ||
| 459 | item.hasNotBorder = true; | ||
| 460 | } else { | ||
| 461 | item.hasNotBorder = | ||
| 462 | item.isInside && !this.countList[index + 1].isInside ? true : false; | ||
| 463 | } | ||
| 464 | }); | ||
| 465 | }, | ||
| 466 | /** | ||
| 467 | * @description: getQlxzDataList | ||
| 468 | * @author: renchao | ||
| 469 | */ | ||
| 470 | getQlxzDataList () { | ||
| 471 | return this.countList; | ||
| 472 | }, | ||
| 473 | /** | ||
| 474 | * @description: getRules | ||
| 475 | * @author: renchao | ||
| 476 | */ | ||
| 477 | getRules () { | ||
| 478 | let rules = []; | ||
| 479 | let temp = 0; | ||
| 480 | this.countList.forEach((item, index) => { | ||
| 481 | rules.push({ | ||
| 482 | data: this.countList[index].qlxzdm, | ||
| 483 | name: '权利性质', | ||
| 484 | dom: this.$refs.qlxzdm[index], | ||
| 485 | rule: /^\s*$/g, //非空 | ||
| 486 | }) | ||
| 487 | item.list.forEach((j, ind) => { | ||
| 488 | rules.push( | ||
| 489 | { | ||
| 490 | data: item.list[ind].tdsyqssj, | ||
| 491 | name: '土地使用起始时间', | ||
| 492 | dom: this.$refs.tdsyqssj[temp + ind], | ||
| 493 | // val:this.$refs.tdsyqssj[temp+ind].value, | ||
| 494 | rule: /^\s*$/g, //非空 | ||
| 495 | }, | ||
| 496 | { | ||
| 497 | data: item.list[ind].tdsyjssj, | ||
| 498 | name: '土地使用结束时间', | ||
| 499 | dom: this.$refs.tdsyjssj[temp + ind], | ||
| 500 | // val:this.$refs.tdsyjssj[temp+ind].value, | ||
| 501 | rule: /^\s*$/g, //非空 | ||
| 502 | }, | ||
| 503 | { | ||
| 504 | data: item.list[ind].pzytdm, | ||
| 505 | name: '批准用途', | ||
| 506 | dom: this.$refs.pzytdm[temp + ind], | ||
| 507 | // val:this.$refs.tdsyjssj[temp+ind].value, | ||
| 508 | rule: /^\s*$/g, //非空 | ||
| 509 | }, | ||
| 510 | { | ||
| 511 | data: item.list[ind].sjytdm, | ||
| 512 | name: '实际用途', | ||
| 513 | dom: this.$refs.sjytdm[temp + ind], | ||
| 514 | // val:this.$refs.tdsyjssj[temp+ind].value, | ||
| 515 | rule: /^\s*$/g, //非空 | ||
| 516 | }, | ||
| 517 | ) | ||
| 518 | if (this.hasSyqx) { | ||
| 519 | rules.push( | ||
| 520 | { | ||
| 521 | data: item.list[ind].syqx, | ||
| 522 | name: '使用期限', | ||
| 523 | dom: this.$refs.syqx[temp + ind], | ||
| 524 | // val:this.$refs.syqx[temp+ind].value, | ||
| 525 | rule: /^\s*$/g, //非空 | ||
| 526 | } | ||
| 527 | ) | ||
| 528 | } | ||
| 529 | if (ind == item.list.length - 1) { | ||
| 530 | temp += item.list.length; | ||
| 531 | } | ||
| 532 | }) | ||
| 533 | }) | ||
| 534 | this.rulesResult = true; | ||
| 535 | rules.forEach(item => { | ||
| 536 | if (item.rule.test(item.data) || item.data == null) { | ||
| 537 | if (item.dom.$el) { | ||
| 538 | item.dom.$el.style.border = '1px solid red'; | ||
| 539 | item.dom.$el.style.boxSizing = 'border-box'; | ||
| 540 | } else { | ||
| 541 | item.dom.style.border = '1px solid red'; | ||
| 542 | item.dom.style.boxSizing = 'border-box'; | ||
| 543 | } | ||
| 544 | // this.$message({ | ||
| 545 | // // message: item.name+'不能为空', | ||
| 546 | // message: '不能为空', | ||
| 547 | // type: "warning", | ||
| 548 | // }); | ||
| 549 | this.rulesResult = false; | ||
| 550 | return false | ||
| 551 | } | ||
| 552 | }) | ||
| 553 | // console.log(rules,'rules'); | ||
| 554 | }, | ||
| 555 | /** | ||
| 556 | * @description: getRulesResult | ||
| 557 | * @author: renchao | ||
| 558 | */ | ||
| 559 | getRulesResult () { | ||
| 560 | return this.rulesResult | ||
| 561 | }, | ||
| 562 | /** | ||
| 563 | * @description: inputBlur | ||
| 564 | * @author: renchao | ||
| 565 | */ | ||
| 566 | inputBlur (e, flag) { | ||
| 567 | if (flag) { | ||
| 568 | if (e.value != '') { | ||
| 569 | e.$el.style.border = "" | ||
| 570 | } else { | ||
| 571 | e.$el.style.border = "1px solid red" | ||
| 572 | e.$el.style.boxSizing = 'border-box'; | ||
| 573 | } | ||
| 574 | } else { | ||
| 575 | if (e.target.value != '') { | ||
| 576 | e.target.style.border = "" | ||
| 577 | } else { | ||
| 578 | e.target.style.border = "1px solid red" | ||
| 579 | e.target.style.boxSizing = 'border-box'; | ||
| 580 | } | ||
| 581 | } | ||
| 582 | }, | ||
| 583 | //后续考虑在点击加减号时操作校验规则 | ||
| 584 | // addRules(){ | ||
| 585 | // this.tempQssj.push() | ||
| 586 | // }, | ||
| 587 | // minusRules(){ | ||
| 588 | |||
| 589 | // }, | ||
| 590 | }, | ||
| 591 | watch: { | ||
| 592 | countList: { | ||
| 593 | handler: function (newVal, oldVal) { | ||
| 594 | newVal.forEach((i, ind) => { | ||
| 595 | if (i.qlxzdm != '' && i.qlxzdm != null) { | ||
| 596 | console.log(this.$refs.qlxzdm, 'this.$refs.qlxzdm[ind]'); | ||
| 597 | i.qlxzmc = this.$refs.qlxzdm[ind].name; | ||
| 598 | this.$refs.qlxzdm[ind].$el.style.border = "" | ||
| 599 | } | ||
| 600 | i.list.forEach((item, index) => { | ||
| 601 | if (item.sjytdm != '' && item.sjytdm != null) { | ||
| 602 | this.$refs.sjytdm[ind].$el.style.border = "" | ||
| 603 | } | ||
| 604 | if (item.pzytdm != '' && item.pzytdm != null) { | ||
| 605 | this.$refs.pzytdm[ind].$el.style.border = "" | ||
| 606 | } | ||
| 607 | }) | ||
| 608 | }) | ||
| 609 | }, | ||
| 610 | deep: true | ||
| 611 | }, | ||
| 612 | } | ||
| 613 | }; | ||
| 614 | </script> | ||
| 615 | <style lang="scss"> | ||
| 616 | .temp { | ||
| 617 | width: 100%; | ||
| 618 | height: 100%; | ||
| 619 | |||
| 620 | .iconfont { | ||
| 621 | cursor: pointer; | ||
| 622 | } | ||
| 623 | |||
| 624 | .qlxzAdd { | ||
| 625 | width: 100px; | ||
| 626 | height: 100%; | ||
| 627 | border-right: 1px solid #E6E6E6; | ||
| 628 | position: relative; | ||
| 629 | |||
| 630 | span { | ||
| 631 | font-size: 14px; | ||
| 632 | height: 140px; | ||
| 633 | text-align: center; | ||
| 634 | -webkit-writing-mode: vertical-rl; | ||
| 635 | writing-mode: vertical-rl; | ||
| 636 | position: absolute; | ||
| 637 | top: 50%; | ||
| 638 | margin-top: -70px; | ||
| 639 | left: 30%; | ||
| 640 | } | ||
| 641 | |||
| 642 | i { | ||
| 643 | color: #66b1ff; | ||
| 644 | font-size: 30px; | ||
| 645 | position: absolute; | ||
| 646 | top: 50%; | ||
| 647 | margin-top: -18px; | ||
| 648 | left: 55%; | ||
| 649 | z-index: 1; | ||
| 650 | } | ||
| 651 | } | ||
| 652 | |||
| 653 | .qlxzModule { | ||
| 654 | width: calc(100% - 102px); | ||
| 655 | height: auto; | ||
| 656 | position: relative; | ||
| 657 | border-bottom: 1px solid #E6E6E6; | ||
| 658 | |||
| 659 | .pr10 { | ||
| 660 | padding-right: 10px !important; | ||
| 661 | } | ||
| 662 | |||
| 663 | .el-col { | ||
| 664 | // height: 100%; | ||
| 665 | border-right: 1px solid #E6E6E6; | ||
| 666 | position: relative; | ||
| 667 | text-align: right; | ||
| 668 | |||
| 669 | .qlxz { | ||
| 670 | line-height: 34px; | ||
| 671 | } | ||
| 672 | |||
| 673 | .qlxzMinus { | ||
| 674 | color: #FA6400; | ||
| 675 | font-size: 30px; | ||
| 676 | position: absolute; | ||
| 677 | top: 50%; | ||
| 678 | left: 50%; | ||
| 679 | margin: -18px 0 0 -18px; | ||
| 680 | z-index: 1; | ||
| 681 | } | ||
| 682 | |||
| 683 | ul { | ||
| 684 | margin-top: 34px; | ||
| 685 | |||
| 686 | li { | ||
| 687 | height: 37px; | ||
| 688 | line-height: 37px; | ||
| 689 | text-decoration: none; | ||
| 690 | border-bottom: 1px solid #e6e6e6; | ||
| 691 | |||
| 692 | .el-select { | ||
| 693 | width: 100%; | ||
| 694 | } | ||
| 695 | |||
| 696 | .el-input { | ||
| 697 | width: 100%; | ||
| 698 | } | ||
| 699 | |||
| 700 | input { | ||
| 701 | position: relative; | ||
| 702 | top: -2px; | ||
| 703 | height: 35px; | ||
| 704 | width: calc(100% - 1px) !important; | ||
| 705 | } | ||
| 706 | |||
| 707 | .el-input__inner { | ||
| 708 | height: 34px; | ||
| 709 | } | ||
| 710 | } | ||
| 711 | |||
| 712 | li:last-child { | ||
| 713 | border-bottom: none; | ||
| 714 | } | ||
| 715 | } | ||
| 716 | |||
| 717 | .whiteItem { | ||
| 718 | background-color: #fff; | ||
| 719 | position: absolute; | ||
| 720 | width: 100%; | ||
| 721 | height: 2px; | ||
| 722 | bottom: -1px; | ||
| 723 | left: 0; | ||
| 724 | } | ||
| 725 | |||
| 726 | .itemShow { | ||
| 727 | bottom: 2px; | ||
| 728 | } | ||
| 729 | } | ||
| 730 | |||
| 731 | .childYT { | ||
| 732 | height: 114px; | ||
| 733 | border-top: 1px solid #E6E6E6; | ||
| 734 | |||
| 735 | ul { | ||
| 736 | margin-top: 0; | ||
| 737 | |||
| 738 | li { | ||
| 739 | .el-input__inner { | ||
| 740 | height: 29px; | ||
| 741 | } | ||
| 742 | } | ||
| 743 | } | ||
| 744 | |||
| 745 | .changeBtn { | ||
| 746 | margin-top: -48px; | ||
| 747 | } | ||
| 748 | |||
| 749 | .el-button+.el-button { | ||
| 750 | margin-top: 4px; | ||
| 751 | } | ||
| 752 | } | ||
| 753 | |||
| 754 | .noTopBorder { | ||
| 755 | border-top: 0; | ||
| 756 | } | ||
| 757 | |||
| 758 | .noRightBorder { | ||
| 759 | border-right: 0; | ||
| 760 | } | ||
| 761 | |||
| 762 | .el-col:nth-last-child(2) { | ||
| 763 | border-right: none; | ||
| 764 | } | ||
| 765 | |||
| 766 | .title { | ||
| 767 | width: 95.83333%; | ||
| 768 | height: 34px; | ||
| 769 | line-height: 34px; | ||
| 770 | background-color: #fff; | ||
| 771 | border-bottom: 1px solid #E6E6E6; | ||
| 772 | position: absolute; | ||
| 773 | right: 0; | ||
| 774 | top: 0; | ||
| 775 | |||
| 776 | .formSelect { | ||
| 777 | top: -1px; | ||
| 778 | width: 100%; | ||
| 779 | |||
| 780 | .el-input__inner { | ||
| 781 | height: 32px; | ||
| 782 | } | ||
| 783 | } | ||
| 784 | } | ||
| 785 | } | ||
| 786 | |||
| 787 | .btnCol { | ||
| 788 | position: relative; | ||
| 789 | height: 146px; | ||
| 790 | |||
| 791 | .changeBtn { | ||
| 792 | width: 46px; | ||
| 793 | height: 46px; | ||
| 794 | font-size: 30px; | ||
| 795 | padding: 4px 6px; | ||
| 796 | position: absolute; | ||
| 797 | top: 50%; | ||
| 798 | left: 50%; | ||
| 799 | margin-top: -38px; | ||
| 800 | margin-left: -23px; | ||
| 801 | } | ||
| 802 | |||
| 803 | .el-button+.el-button { | ||
| 804 | margin-left: -23px; | ||
| 805 | margin-top: 16px; | ||
| 806 | } | ||
| 807 | } | ||
| 808 | |||
| 809 | .tdytAdd { | ||
| 810 | width: 100px; | ||
| 811 | } | ||
| 812 | |||
| 813 | .tdytAdd, | ||
| 814 | .tdytMinus { | ||
| 815 | span { | ||
| 816 | font-size: 14px; | ||
| 817 | height: 114px; | ||
| 818 | text-align: center; | ||
| 819 | -webkit-writing-mode: vertical-rl; | ||
| 820 | writing-mode: vertical-rl; | ||
| 821 | position: absolute; | ||
| 822 | top: 50%; | ||
| 823 | left: 30%; | ||
| 824 | } | ||
| 825 | |||
| 826 | i { | ||
| 827 | color: #66b1ff; | ||
| 828 | font-size: 30px; | ||
| 829 | position: absolute; | ||
| 830 | top: 50%; | ||
| 831 | margin-top: 0px; | ||
| 832 | left: 55%; | ||
| 833 | z-index: 1; | ||
| 834 | } | ||
| 835 | } | ||
| 836 | |||
| 837 | .tdytMinus { | ||
| 838 | i { | ||
| 839 | color: #FA6400; | ||
| 840 | left: 50%; | ||
| 841 | margin-left: -18px; | ||
| 842 | } | ||
| 843 | } | ||
| 844 | |||
| 845 | .childYT { | ||
| 846 | i { | ||
| 847 | top: 50%; | ||
| 848 | margin-top: -18px; | ||
| 849 | } | ||
| 850 | } | ||
| 851 | |||
| 852 | .el-row:nth-last-child(1) { | ||
| 853 | border-bottom: none; | ||
| 854 | } | ||
| 855 | |||
| 856 | /deep/.el-select-tree { | ||
| 857 | width: 100%; | ||
| 858 | |||
| 859 | .el-input__inner { | ||
| 860 | height: 34px !important; | ||
| 861 | position: relative; | ||
| 862 | top: -1px; | ||
| 863 | } | ||
| 864 | } | ||
| 865 | } | ||
| 866 | </style> |
| 1 | <template> | ||
| 2 | <div class="temp"> | ||
| 3 | <el-row class="qlxzModule" v-for="(items, index) in countList" :key="items.id"> | ||
| 4 | <template v-for="(childItem, childIndex) in items.list"> | ||
| 5 | <el-col :span="2" class="btnCol" :key="childIndex + '1'" :class="childIndex > 0 ? 'childYT noTopBorder' : ''"> | ||
| 6 | <el-button v-show="childIndex < 1" type="primary" class="changeBtn addMinus outAdd" | ||
| 7 | @click="handleClick(index, 'add')">+</el-button> | ||
| 8 | <el-button v-show="childIndex < 1" type="primary" class="changeBtn addMinus outMinus" | ||
| 9 | @click="handleClick(index, 'minus')">-</el-button> | ||
| 10 | <div :class="items.hasNotBorder ? 'itemShow whiteItem' : 'whiteItem'" v-if="items.isInside"></div> | ||
| 11 | </el-col> | ||
| 12 | <el-col :span="2" class="btnCol" :key="childIndex + '8'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 13 | <!-- <template v-if="childIndex>0"> --> | ||
| 14 | <span class="qlxz" v-show="childIndex < 1">权利性质</span><br /> | ||
| 15 | <el-button type="primary" class="changeBtn addMinus inAdd" @click="handleInClick(index, childIndex, 'add')">+ | ||
| 16 | </el-button> | ||
| 17 | <el-button type="primary" class="changeBtn addMinus inMinus" | ||
| 18 | @click="handleInClick(index, childIndex, 'minus')">-</el-button> | ||
| 19 | <!-- </template> --> | ||
| 20 | </el-col> | ||
| 21 | <el-col :span="5" :key="childIndex + '7'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 22 | <ul> | ||
| 23 | <li>批准用途</li> | ||
| 24 | <li>实际用途</li> | ||
| 25 | <li>土地使用起始时间<i class="requisite">*</i></li> | ||
| 26 | </ul> | ||
| 27 | </el-col> | ||
| 28 | <el-col :span="5" :key="childIndex + '6'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 29 | <ul> | ||
| 30 | <li> | ||
| 31 | <el-select-tree v-if="show" :default-expand-all="defaultExpandAll" :multiple="multiple" | ||
| 32 | :placeholder="placeholder" :disabled="disabled" :data="$store.state.tdytList" :props="treeProps" | ||
| 33 | :check-strictly="checkStrictly" :clearable="clearable" v-model="childItem.pzytdm"></el-select-tree> | ||
| 34 | </li> | ||
| 35 | <li> | ||
| 36 | <el-select-tree v-if="show" :default-expand-all="defaultExpandAll" :multiple="multiple" | ||
| 37 | :placeholder="placeholder" :disabled="disabled" :data="$store.state.tdytList" :props="treeProps" | ||
| 38 | :check-strictly="checkStrictly" :clearable="clearable" v-model="childItem.sjytdm"></el-select-tree> | ||
| 39 | </li> | ||
| 40 | <li> | ||
| 41 | <el-date-picker v-model="childItem.tdsyqssj" :picker-options="childItem.pickerStart" type="date" | ||
| 42 | value-format="yyyy-MM-dd" placeholder="选择日期" @input="startTime(index, childIndex)"> | ||
| 43 | </el-date-picker> | ||
| 44 | </li> | ||
| 45 | </ul> | ||
| 46 | </el-col> | ||
| 47 | <el-col :span="5" :key="childIndex + '5'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 48 | <ul> | ||
| 49 | <li>地类编码</li> | ||
| 50 | <li>地类编码</li> | ||
| 51 | <li>土地使用结束时间<i class="requisite">*</i></li> | ||
| 52 | </ul> | ||
| 53 | </el-col> | ||
| 54 | <el-col :span="5" :key="childIndex + '4'" :class="childIndex > 0 ? 'childYT' : ''"> | ||
| 55 | <ul> | ||
| 56 | <li> | ||
| 57 | <input type="text" style="top: -1px;" v-model="childItem.pzytdm" class="formInput" /> | ||
| 58 | </li> | ||
| 59 | <li> | ||
| 60 | <input type="text" v-model="childItem.sjytdm" class="formInput" /> | ||
| 61 | </li> | ||
| 62 | <li> | ||
| 63 | <el-date-picker v-model="childItem.tdsyjssj" type="date" value-format="yyyy-MM-dd" | ||
| 64 | :picker-options="childItem.pickerEnd" placeholder="选择日期" @input="endTime(index, childIndex)"> | ||
| 65 | </el-date-picker> | ||
| 66 | </li> | ||
| 67 | </ul> | ||
| 68 | </el-col> | ||
| 69 | </template> | ||
| 70 | |||
| 71 | <div class="title"> | ||
| 72 | <el-select class="formSelect" v-model="items.qlxzdm"> | ||
| 73 | <el-option v-for="item in $store.state.qlxzList" :key="item.dm" :label="item.mc" :value="item.dm"> | ||
| 74 | </el-option> | ||
| 75 | </el-select> | ||
| 76 | </div> | ||
| 77 | </el-row> | ||
| 78 | </div> | ||
| 79 | </template> | ||
| 80 | |||
| 81 | <script> | ||
| 82 | // import { getDdicByMC } from "@api/common"; | ||
| 83 | export default { | ||
| 84 | props: { | ||
| 85 | // widtd: { | ||
| 86 | // type: String, | ||
| 87 | default: "70%", | ||
| 88 | , | ||
| 89 | a () { | ||
| 90 | return { | ||
| 91 | //树型结构 | ||
| 92 | how: true, | ||
| 93 | arable: true, | ||
| 94 | aultExpandAll: true, | ||
| 95 | tiple: false, | ||
| 96 | ceholder: "请选择", | ||
| 97 | abled: false, | ||
| 98 | ckStrictly: true, | ||
| 99 | eProps: { | ||
| 100 | lue: "dm", | ||
| 101 | ildren: "children", | ||
| 102 | bel: "mc", | ||
| 103 | |||
| 104 | ntList: [ | ||
| 105 | |||
| 106 | id: Math.random(), | ||
| 107 | isInside: false, | ||
| 108 | hasNotBorder: false, | ||
| 109 | bsm: "", //权利性质标识码 | ||
| 110 | lbsm: "", //宗地BSM、自然幢BSM、户BSM、多幢BSM、宗海BSM | ||
| 111 | lxzdm: "", | ||
| 112 | zhqlxzlx: "", //除宗海数据外,默认都是空;0:用海类型权利性质;2:海岛用途权利性质 | ||
| 113 | list: [ | ||
| 114 | { | ||
| 115 | pzdjbsm: "", | ||
| 116 | pzdjmc: "", | ||
| 117 | pzytdm: "", | ||
| 118 | pzytmc: "", | ||
| 119 | pzytmj: 0, | ||
| 120 | qlxzbsm: "", | ||
| 121 | sjdjbsm: "", | ||
| 122 | sjdjmc: "", | ||
| 123 | sjytdm: "", | ||
| 124 | sjytmc: "", | ||
| 125 | jytmj: 0, | ||
| 126 | syqx: "", | ||
| 127 | tdsyjssj: "", | ||
| 128 | tdsyqssj: "", | ||
| 129 | pickerStart: {}, | ||
| 130 | pickerEnd: {}, | ||
| 131 | tdzh: "", | ||
| 132 | }, | ||
| 133 | |||
| 134 | |||
| 135 | |||
| 136 | Num: 0, | ||
| 137 | |||
| 138 | |||
| 139 | ed () { }, | ||
| 140 | hods: { | ||
| 141 | 外层操作 | ||
| 142 | ndleClick (ind, type) { | ||
| 143 | outsideObj = { | ||
| 144 | Math.random(), | ||
| 145 | Inside: false, | ||
| 146 | sNotBorder: false, | ||
| 147 | "", //权利性质标识码 | ||
| 148 | bsm: "", //宗地BSM、自然幢BSM、户BSM、多幢BSM、宗海BSM | ||
| 149 | xzdm: "", | ||
| 150 | zhqlxzlx: "", //除宗海数据外,默认都是空;0:用海类型权利性质;2:海岛用途权利性质 | ||
| 151 | list: [ | ||
| 152 | { | ||
| 153 | pzdjbsm: "", | ||
| 154 | pzdjmc: "", | ||
| 155 | pzytdm: "", | ||
| 156 | pzytmc: "", | ||
| 157 | pzytmj: 0, | ||
| 158 | qlxzbsm: "", | ||
| 159 | sjdjbsm: "", | ||
| 160 | sjdjmc: "", | ||
| 161 | sjytdm: "", | ||
| 162 | sjytmc: "", | ||
| 163 | sjytmj: 0, | ||
| 164 | syqx: "", | ||
| 165 | tdsyjssj: "", | ||
| 166 | tdsyqssj: "", | ||
| 167 | tdzh: "", | ||
| 168 | |||
| 169 | |||
| 170 | }; | ||
| 171 | (type === "add") { | ||
| 172 | is.countList.push(outsideObj); | ||
| 173 | is.outNum++; | ||
| 174 | lse { | ||
| 175 | .countList.forEach((item, index) => { | ||
| 176 | f (index == ind && this.countList.length > 1) { | ||
| 177 | this.countList.splice(index, 1); | ||
| 178 | } | ||
| 179 | }); | ||
| 180 | this.outNum--; | ||
| 181 | |||
| 182 | Click (index, childIndex, type) { | ||
| 183 | eObj = { | ||
| 184 | ", | ||
| 185 | , | ||
| 186 | "", | ||
| 187 | "", | ||
| 188 | : 0, | ||
| 189 | m: "", | ||
| 190 | m: "", | ||
| 191 | "", | ||
| 192 | : "", | ||
| 193 | : "", | ||
| 194 | : 0, | ||
| 195 | "", | ||
| 196 | jssj: "", | ||
| 197 | sj: "", | ||
| 198 | : "", | ||
| 199 | e === "add") { | ||
| 200 | ountList[index].list.splice(childIndex + 1, 0, insideObj); | ||
| 201 | |||
| 202 | ountList[index].list.forEach((item, childInd) => { | ||
| 203 | (childIndex == childInd && this.countList[index].list.length > 1) { | ||
| 204 | this.countList[index].list.splice(childIndex, 1); | ||
| 205 | } | ||
| 206 | }); | ||
| 207 | |||
| 208 | s.hasBorderOrNot(); | ||
| 209 | 是否显示边框 | ||
| 210 | orderOrNot () { | ||
| 211 | s.countList.forEach((item, index) => { | ||
| 212 | (index == this.countList.length - 1) { | ||
| 213 | m.hasNotBorder = true; | ||
| 214 | { | ||
| 215 | sNotBorder = | ||
| 216 | sInside && !this.countList[index + 1].isInside ? true : false; | ||
| 217 | aList () { | ||
| 218 | this.countList; | ||
| 219 | 时间判断 | ||
| 220 | tTime (index, childIndex) { | ||
| 221 | tartTime = this.countList[index].list[childIndex].tdsyqssj; | ||
| 222 | endTime = this.countList[index].list[childIndex].tdsyjssj; | ||
| 223 | s.countList[index].list[childIndex].pickerEnd = { | ||
| 224 | bledDate: (time) => { | ||
| 225 | f (Object.keys(startTime).length > 0) { | ||
| 226 | return new Date(startTime).getTime() > time.getTime(); | ||
| 227 | lse { | ||
| 228 | rn time.getTime() < Date.now(); | ||
| 229 | t.keys(startTime).length > 0 && Object.keys(endTime).length > 0) { | ||
| 230 | ear = new Date(startTime).getFullYear(); | ||
| 231 | ear = new Date(endTime).getFullYear(); | ||
| 232 | ime (index, childIndex, e) { | ||
| 233 | onsole.log(e, 'eeeeee'); | ||
| 234 | let startTime = this.countList[index].list[childIndex].tdsyqssj; | ||
| 235 | let endTime = this.countList[index].list[childIndex].tdsyjssj; | ||
| 236 | this.countList[index].list[childIndex].pickerStart = { | ||
| 237 | disabledDate: (time) => { | ||
| 238 | if (Object.keys(endTime).length > 0) { | ||
| 239 | return new Date(endTime).getTime() < time.getTime(); | ||
| 240 | } else { | ||
| 241 | return time.getTime() > Date.now(); | ||
| 242 | } | ||
| 243 | } | ||
| 244 | } | ||
| 245 | if (Object.keys(startTime).length > 0 && Object.keys(endTime).length > 0) { | ||
| 246 | let startYear = new Date(startTime).getFullYear(); | ||
| 247 | let endYear = new Date(endTime).getFullYear(); | ||
| 248 | } | ||
| 249 | }, | ||
| 250 | }, | ||
| 251 | }; | ||
| 252 | </script> | ||
| 253 | <style lang="scss"> | ||
| 254 | .temp { | ||
| 255 | width: 100%; | ||
| 256 | |||
| 257 | .qlxzModule { | ||
| 258 | height: auto; | ||
| 259 | position: relative; | ||
| 260 | border-bottom: 1px solid #e6e6e6; | ||
| 261 | |||
| 262 | .el-col { | ||
| 263 | // height: 100%; | ||
| 264 | border-right: 1px solid #E6E6E6; | ||
| 265 | position: relative; | ||
| 266 | text-align: right; | ||
| 267 | padding-right: 10px; | ||
| 268 | |||
| 269 | .qlxz { | ||
| 270 | line-height: 34px; | ||
| 271 | } | ||
| 272 | |||
| 273 | ul { | ||
| 274 | margin-top: 34px; | ||
| 275 | |||
| 276 | li { | ||
| 277 | height: 37px; | ||
| 278 | line-height: 37px; | ||
| 279 | text-decoration: none; | ||
| 280 | border-bottom: 1px solid #e6e6e6; | ||
| 281 | |||
| 282 | .el-select { | ||
| 283 | width: 100%; | ||
| 284 | } | ||
| 285 | |||
| 286 | .el-input { | ||
| 287 | width: 100%; | ||
| 288 | } | ||
| 289 | |||
| 290 | .el-input__inner { | ||
| 291 | height: 34px; | ||
| 292 | } | ||
| 293 | |||
| 294 | input { | ||
| 295 | position: relative; | ||
| 296 | top: -2px; | ||
| 297 | height: 35px; | ||
| 298 | width: calc(100% - 1px) !important; | ||
| 299 | } | ||
| 300 | } | ||
| 301 | |||
| 302 | li:last-child { | ||
| 303 | border-bottom: none; | ||
| 304 | } | ||
| 305 | } | ||
| 306 | |||
| 307 | .whiteItem { | ||
| 308 | background-color: #fff; | ||
| 309 | position: absolute; | ||
| 310 | width: 100%; | ||
| 311 | height: 2px; | ||
| 312 | bottom: -1px; | ||
| 313 | left: 0; | ||
| 314 | } | ||
| 315 | |||
| 316 | .itemShow { | ||
| 317 | bottom: 2px; | ||
| 318 | } | ||
| 319 | } | ||
| 320 | |||
| 321 | .childYT { | ||
| 322 | height: 114px; | ||
| 323 | border-top: 1px solid #E6E6E6; | ||
| 324 | |||
| 325 | ul { | ||
| 326 | margin-top: 0; | ||
| 327 | |||
| 328 | li { | ||
| 329 | .el-input__inner { | ||
| 330 | height: 29px; | ||
| 331 | } | ||
| 332 | } | ||
| 333 | } | ||
| 334 | |||
| 335 | .changeBtn { | ||
| 336 | margin-top: -48px; | ||
| 337 | } | ||
| 338 | |||
| 339 | .el-button+.el-button { | ||
| 340 | margin-top: 4px; | ||
| 341 | } | ||
| 342 | } | ||
| 343 | |||
| 344 | .noTopBorder { | ||
| 345 | border-top: 0; | ||
| 346 | } | ||
| 347 | |||
| 348 | .noRightBorder { | ||
| 349 | border-right: 0; | ||
| 350 | } | ||
| 351 | |||
| 352 | .el-col:nth-last-child(2) { | ||
| 353 | border-right: none; | ||
| 354 | } | ||
| 355 | |||
| 356 | .title { | ||
| 357 | width: 83.33333%; | ||
| 358 | height: 34px; | ||
| 359 | line-height: 34px; | ||
| 360 | background-color: #fff; | ||
| 361 | border-bottom: 1px solid #E6E6E6; | ||
| 362 | position: absolute; | ||
| 363 | right: 0; | ||
| 364 | top: 0; | ||
| 365 | |||
| 366 | .formSelect { | ||
| 367 | top: -1px; | ||
| 368 | width: 100%; | ||
| 369 | |||
| 370 | .el-input__inner { | ||
| 371 | height: 32px; | ||
| 372 | } | ||
| 373 | } | ||
| 374 | } | ||
| 375 | } | ||
| 376 | |||
| 377 | .btnCol { | ||
| 378 | position: relative; | ||
| 379 | height: 146px; | ||
| 380 | |||
| 381 | .changeBtn { | ||
| 382 | width: 46px; | ||
| 383 | height: 46px; | ||
| 384 | font-size: 30px; | ||
| 385 | padding: 4px 6px; | ||
| 386 | position: absolute; | ||
| 387 | top: 50%; | ||
| 388 | left: 50%; | ||
| 389 | margin-top: -38px; | ||
| 390 | margin-left: -23px; | ||
| 391 | } | ||
| 392 | |||
| 393 | .el-button+.el-button { | ||
| 394 | margin-left: -23px; | ||
| 395 | margin-top: 16px; | ||
| 396 | } | ||
| 397 | } | ||
| 398 | |||
| 399 | .el-row:nth-last-child(1) { | ||
| 400 | border-bottom: none; | ||
| 401 | } | ||
| 402 | |||
| 403 | /deep/.el-select-tree { | ||
| 404 | width: 100%; | ||
| 405 | |||
| 406 | .el-input__inner { | ||
| 407 | height: 30px !important; | ||
| 408 | } | ||
| 409 | } | ||
| 410 | } | ||
| 411 | </style> |
src/components/lineTree/lineItem.vue
deleted
100644 → 0
| 1 | <template> | ||
| 2 | <div class="tree_item_box"> | ||
| 3 | <div class="column-start-start linkLine_default" v-for="(item, s_index) in list" :key="s_index" :class="{ | ||
| 4 | linkLine_first: (s_index === 0) & (list.length > 1), | ||
| 5 | linkLine_half_top: s_index === 0 && list.length === 1, | ||
| 6 | linkLine_last: s_index === list.length - 1 && s_index !== 0, | ||
| 7 | third_layer: !item.children, | ||
| 8 | second_layer: item.children, | ||
| 9 | curNode: $route.query.bsm && $route.query.bsm == item.bsm, | ||
| 10 | zxxNode: item.qszt, | ||
| 11 | iszd: item.qszt && item.type == 'zd', | ||
| 12 | isdz: item.qszt && item.type == 'dz', | ||
| 13 | iszrz: item.qszt && item.type == 'zrz', | ||
| 14 | isgzw: item.qszt && item.type == 'gzw' | ||
| 15 | }"> | ||
| 16 | <div class="row-flex-start basic_banner" @click="itemClick(item)" @dblclick="dbclick(item, item.zdbsm)" :class="{ | ||
| 17 | active_color: item.expand, | ||
| 18 | }"> | ||
| 19 | <div class="layer_text nowrap" @contextmenu.prevent="openMenu($event, item, list)" :class="{ | ||
| 20 | active_color: item.expand | ||
| 21 | }" :ref="($route.query.bsm && $route.query.bsm == item.bsm) ? 'curZxx' : ''" :data-zdbsm="item.zdbsm" | ||
| 22 | :title=item.mc> | ||
| 23 | <i v-show="!islpb && !item.qszt && !item.type" class="iconfont iconguoyou" style="margin-right:6px"></i> | ||
| 24 | <template v-if="islpb && item.type == 'ljz' && item.children.length > 0"> | ||
| 25 | <i v-if="!item.expand" class="iconfont iconxiala lpbTree-node"></i> | ||
| 26 | <i v-if="item.expand" class="iconfont iconxialazhankai lpbTree-node"></i> | ||
| 27 | </template> | ||
| 28 | <!-- <i v-show="islpb && item.expand && item.children.length > 0" class="iconfont iconxiala" style="margin-right:6px"></i> | ||
| 29 | <i v-show="islpb && !item.expand && item.children.length > 0" class="iconfont iconxialazhankai" style="margin-right:6px"></i> --> | ||
| 30 | <span class="qsztImg" v-if="item.bblx == 1 || (item.bhqkbsm != '' && item.bhqkbsm != null)"> | ||
| 31 | <!-- <span class="qsztFont" style="color: #9e9b9b">变</span> --> | ||
| 32 | <i | ||
| 33 | :class="$route.query.bsm && $route.query.bsm == item.bsm ? 'iconfont iconbianing' : 'iconfont iconbian'"></i> | ||
| 34 | </span> | ||
| 35 | <template v-else> | ||
| 36 | <span class="qsztImg" v-if="item.qszt == '0'"> | ||
| 37 | <!-- <span class="qsztFont" style="color: #2FA3FA; ">临</span> --> | ||
| 38 | <i :class="$route.query.bsm && $route.query.bsm == item.bsm ? 'iconfont iconlining' : 'iconfont iconlin'" | ||
| 39 | style="color: #F7B500;"></i> | ||
| 40 | </span> | ||
| 41 | <span class="qsztImg" v-if="item.qszt == '1'"> | ||
| 42 | <!-- <span class="qsztFont" style="color: #1AD6E1; ">正</span> --> | ||
| 43 | <i :class="$route.query.bsm && $route.query.bsm == item.bsm ? 'iconfont iconzhenging' : 'iconfont iconzheng'" | ||
| 44 | style="color: #15D7E2;"></i> | ||
| 45 | </span> | ||
| 46 | <span class="qsztImg" v-if="item.qszt == '2'"> | ||
| 47 | <!-- <span class="qsztFont" style="color: #45AEFD; ">现</span> --> | ||
| 48 | <i :class="$route.query.bsm && $route.query.bsm == item.bsm ? 'iconfont iconxianing' : 'iconfont iconxian'" | ||
| 49 | style="color: #2FA3FA;"></i> | ||
| 50 | </span> | ||
| 51 | </template> | ||
| 52 | <i class="iconfont iconziranchuang1 mr4" v-if="item.type == 'zrz'"></i> | ||
| 53 | <i class="iconfont iconduochuang1 mr4" v-if="item.type == 'dz'"></i> | ||
| 54 | <i class="iconfont icongouzhuwu mr4" v-if="item.type == 'gzw'"></i> | ||
| 55 | <span v-if="islpb">({{ item.type | bdcLxFilter }})</span> | ||
| 56 | <span>{{ item.mc }}</span> | ||
| 57 | |||
| 58 | </div> | ||
| 59 | <div v-if="item.children" class="reTree_icon" :style="{ | ||
| 60 | height: 10 + 'px', | ||
| 61 | width: 10 + 'px', | ||
| 62 | }" :class="{ | ||
| 63 | reTree_default_icon: item.children.length === 0, | ||
| 64 | reTree_collapse_icon: !islpb && item.expand && item.children.length > 0, | ||
| 65 | reTree_expand_icon: !islpb && !item.expand && item.children.length > 0, | ||
| 66 | }"></div> | ||
| 67 | <div v-if="item.children == null" class="reTree_icon" :class="{ | ||
| 68 | reTree_default_icon: item.dm != 'G' && item.dm != 'J' && item.dm != 'Z', | ||
| 69 | reTree_expand_icon: item.dm == 'G' || item.dm == 'J' || item.dm == 'Z', | ||
| 70 | }" :style="{ | ||
| 71 | height: 10 + 'px', | ||
| 72 | width: 10 + 'px', | ||
| 73 | }"></div> | ||
| 74 | </div> | ||
| 75 | <line-item :list="item.children" v-on="$listeners" :islpb="islpb" :size="size" | ||
| 76 | v-if="item.expand && item.children && item.children.length > 0"></line-item> | ||
| 77 | </div> | ||
| 78 | </div> | ||
| 79 | </template> | ||
| 80 | <script> | ||
| 81 | // import { getZdDetailList } from "@api/common" | ||
| 82 | export default { | ||
| 83 | name: "line-item", | ||
| 84 | props: { | ||
| 85 | list: { | ||
| 86 | ype: Array, | ||
| 87 | ault: () => { | ||
| 88 | turn []; | ||
| 89 | , | ||
| 90 | }, | ||
| 91 | formatData: { | ||
| 92 | ype: Array, | ||
| 93 | ault: () => { | ||
| 94 | turn []; | ||
| 95 | |||
| 96 | : { | ||
| 97 | e: Number, | ||
| 98 | ault: 16, | ||
| 99 | ble: { | ||
| 100 | e: Boolean, | ||
| 101 | ault: false, | ||
| 102 | b: { | ||
| 103 | e: Boolean, | ||
| 104 | efault: false, | ||
| 105 | } | ||
| 106 | , | ||
| 107 | a () { | ||
| 108 | rn { | ||
| 109 | e: null, | ||
| 110 | reeXzqHeight: 0, | ||
| 111 | linshi: require("@/image/lpb/lin.png"), | ||
| 112 | zhengshi: require("@/image/lpb/zheng.png"), | ||
| 113 | ianshi: require("@/image/lpb/xian.png"), | ||
| 114 | } | ||
| 115 | , | ||
| 116 | nted () { | ||
| 117 | onsole.log(this.$refs.curZxx,'this.$refs.curZxx'); | ||
| 118 | this.$refs.curZxx) { | ||
| 119 | onsole.log(this.$refs.curZxx[0].dataset.zdbsm); | ||
| 120 | his.$store.state.oldZdbsm = this.$refs.curZxx[0].dataset.zdbsm; | ||
| 121 | : { | ||
| 122 | Click (item) { | ||
| 123 | self = this; | ||
| 124 | 开启延时器,300ms的间隔区分单击和双击,解决双击时执行两次单击事件 | ||
| 125 | learTimeout(self.time); | ||
| 126 | elf.time = setTimeout(() => { | ||
| 127 | em.expand = item.expand == undefined ? true : !item.expand; | ||
| 128 | self.$emit("itemClick", item); | ||
| 129 | source = '' | ||
| 130 | itch (this.$route.path) { | ||
| 131 | ase '/add': | ||
| 132 | source = '1,2' | ||
| 133 | break; | ||
| 134 | case '/change': | ||
| 135 | source = '2' | ||
| 136 | break; | ||
| 137 | case '/panel': | ||
| 138 | source = '0,1,2' | ||
| 139 | break; | ||
| 140 | e '/modify': | ||
| 141 | source = '1' | ||
| 142 | break; | ||
| 143 | e '/search': | ||
| 144 | source = '0,1,2' | ||
| 145 | break; | ||
| 146 | default: | ||
| 147 | break; | ||
| 148 | |||
| 149 | 目录树的所有权类型单击时加载子节点 | ||
| 150 | (!item.children && !item.type) { | ||
| 151 | et data = { | ||
| 152 | xzqbsm: item.xzq, | ||
| 153 | djqbsm: item.djq, | ||
| 154 | djzqbsm: item.djzq, | ||
| 155 | syqlx: item.dm, | ||
| 156 | source: source | ||
| 157 | |||
| 158 | / getZdDetailList(data).then((res) => { | ||
| 159 | // if (res.result.length > 0) { | ||
| 160 | / res.result.forEach(i => { | ||
| 161 | // if (i.children.length > 0) { | ||
| 162 | / i.expand = false; | ||
| 163 | } | ||
| 164 | / }) | ||
| 165 | // self.$emit("ownerMethod", item, res.result); | ||
| 166 | / } | ||
| 167 | / }).catch((error) => { | ||
| 168 | / }); | ||
| 169 | |||
| 170 | 0); | ||
| 171 | 键点击事件 | ||
| 172 | enMenu (e, item, list) { | ||
| 173 | onsole.log(item, '右键list'); | ||
| 174 | his.$emit("changeTop", e.pageY); | ||
| 175 | s.$emit("changeLeft", e.pageX); | ||
| 176 | s.$emit("changeZdData", item); | ||
| 177 | $emit("changeVisible", false); | ||
| 178 | 所有权类型 | ||
| 179 | e.log(item.dm,'item.dm '); | ||
| 180 | dm == 'G' || item.dm == 'J' ||item.dm == 'Z'){ | ||
| 181 | mit("changeCreateVisible", true); | ||
| 182 | |||
| 183 | (item.type) { | ||
| 184 | zd': | ||
| 185 | $emit("changeIsZD", true); | ||
| 186 | mit("changeVisible", true); | ||
| 187 | ; | ||
| 188 | dz': | ||
| 189 | $emit("changeDzVisible", true); | ||
| 190 | ; | ||
| 191 | 'zrz': | ||
| 192 | $emit("changeIsZD", false); | ||
| 193 | s.$emit("changeVisible", true); | ||
| 194 | ; | ||
| 195 | zdy': | ||
| 196 | $emit("changeLpbVisible", true); | ||
| 197 | |||
| 198 | ljz': | ||
| 199 | s.$emit("changeLpbVisible", true); | ||
| 200 | reak; | ||
| 201 | case 'gzw': | ||
| 202 | this.$emit("changeGzwVisible", true); | ||
| 203 | break; | ||
| 204 | fault: | ||
| 205 | reak; | ||
| 206 | 键双击事件 | ||
| 207 | ick (item, bsm) { | ||
| 208 | Timeout(this.time); | ||
| 209 | tore.state.newZdbsm = bsm; | ||
| 210 | tem.type) { | ||
| 211 | ': | ||
| 212 | tore.state.zdbsm = item.bsm; | ||
| 213 | |||
| 214 | : | ||
| 215 | tore.state.zrzbsm = item.bsm; | ||
| 216 | ; | ||
| 217 | 'dz': | ||
| 218 | his.$store.state.dzbsm = item.bsm; | ||
| 219 | reak; | ||
| 220 | 'gzw': | ||
| 221 | his.$store.state.gzwbsm = item.bsm; | ||
| 222 | reak; | ||
| 223 | fault: | ||
| 224 | reak; | ||
| 225 | m.type == 'zd' || item.type == 'dz' || item.type == 'zrz' || item.type == 'gzw') { | ||
| 226 | = { | ||
| 227 | 2, | ||
| 228 | .bsm, | ||
| 229 | his.$route.query.auth ? this.$route.query.auth : '0,1,2' | ||
| 230 | .$route.query.workitemInstanceId) { | ||
| 231 | workitemInstanceId = this.$route.query.workitemInstanceId; | ||
| 232 | (this.$route.query.ywbsm) { | ||
| 233 | data.ywbsm = this.$route.query.ywbsm; | ||
| 234 | } | ||
| 235 | this.$router.push({ | ||
| 236 | path: '/' + item.type, | ||
| 237 | query: data | ||
| 238 | }); | ||
| 239 | } | ||
| 240 | }, | ||
| 241 | closeMenu () { | ||
| 242 | this.$emit("changeVisible", false); | ||
| 243 | }, | ||
| 244 | }, | ||
| 245 | watch: { | ||
| 246 | visible (value) { | ||
| 247 | if (value) { | ||
| 248 | document.body.addEventListener("click", this.closeMenu); | ||
| 249 | } else { | ||
| 250 | document.body.removeEventListener("click", this.closeMenu); | ||
| 251 | } | ||
| 252 | }, | ||
| 253 | }, | ||
| 254 | }; | ||
| 255 | </script> | ||
| 256 | <style lang="scss"> | ||
| 257 | .content { | ||
| 258 | height: 100%; | ||
| 259 | width: 100%; | ||
| 260 | } | ||
| 261 | |||
| 262 | .column-start-center { | ||
| 263 | display: flex; | ||
| 264 | display: -webkit-flex; | ||
| 265 | flex-direction: column; | ||
| 266 | justify-content: flex-start; | ||
| 267 | align-items: center; | ||
| 268 | } | ||
| 269 | |||
| 270 | .row-flex-start { | ||
| 271 | display: flex; | ||
| 272 | display: -webkit-flex; | ||
| 273 | flex-direction: row; | ||
| 274 | justify-content: flex-start; | ||
| 275 | align-items: center; | ||
| 276 | } | ||
| 277 | |||
| 278 | .nowrap { | ||
| 279 | overflow: hidden; | ||
| 280 | text-overflow: ellipsis; | ||
| 281 | white-space: nowrap; | ||
| 282 | } | ||
| 283 | |||
| 284 | // .active_color { | ||
| 285 | // color: #ffffff; | ||
| 286 | // } | ||
| 287 | .reTree_icon { | ||
| 288 | width: 17px; | ||
| 289 | height: 17px; | ||
| 290 | margin-right: 16px; | ||
| 291 | } | ||
| 292 | |||
| 293 | .no_icon { | ||
| 294 | width: 17px; | ||
| 295 | height: 17px; | ||
| 296 | } | ||
| 297 | |||
| 298 | .tree_item_box { | ||
| 299 | position: relative; | ||
| 300 | width: 100%; | ||
| 301 | cursor: pointer; | ||
| 302 | } | ||
| 303 | |||
| 304 | // .ofy_scroll{ | ||
| 305 | // overflow-y: scroll; | ||
| 306 | // overflow-x: hidden; | ||
| 307 | // } | ||
| 308 | .basic_layer { | ||
| 309 | width: 100%; | ||
| 310 | position: relative; | ||
| 311 | color: #4a4a4a; | ||
| 312 | cursor: pointer; | ||
| 313 | |||
| 314 | .layer_text { | ||
| 315 | flex: 1; | ||
| 316 | line-height: 40px; | ||
| 317 | } | ||
| 318 | } | ||
| 319 | |||
| 320 | .first_vertical_line { | ||
| 321 | content: ""; | ||
| 322 | position: absolute; | ||
| 323 | width: 1px; | ||
| 324 | left: 6px; | ||
| 325 | top: 17px; | ||
| 326 | background: #c3c5c8; | ||
| 327 | } | ||
| 328 | |||
| 329 | .basic_banner { | ||
| 330 | position: relative; | ||
| 331 | width: 279px; | ||
| 332 | height: 40px; | ||
| 333 | box-sizing: border-box; | ||
| 334 | padding-left: 20px; | ||
| 335 | } | ||
| 336 | |||
| 337 | .lpb_basic_banner { | ||
| 338 | padding-left: 42px; | ||
| 339 | } | ||
| 340 | |||
| 341 | .second_layer { | ||
| 342 | position: relative; | ||
| 343 | width: calc(100% - 20px); | ||
| 344 | cursor: pointer; | ||
| 345 | padding-left: 20px; | ||
| 346 | |||
| 347 | .basic_banner { | ||
| 348 | width: 100%; | ||
| 349 | } | ||
| 350 | } | ||
| 351 | |||
| 352 | .zxxNode { | ||
| 353 | width: 279px !important; | ||
| 354 | position: relative; | ||
| 355 | left: -80px; | ||
| 356 | text-indent: 80px; | ||
| 357 | } | ||
| 358 | |||
| 359 | .iszd { | ||
| 360 | .tree_item_box { | ||
| 361 | .zxxNode { | ||
| 362 | padding-left: 0; | ||
| 363 | left: 0; | ||
| 364 | } | ||
| 365 | } | ||
| 366 | } | ||
| 367 | |||
| 368 | .iszrz, | ||
| 369 | .isgzw { | ||
| 370 | left: 0px !important; | ||
| 371 | text-indent: 96px; | ||
| 372 | } | ||
| 373 | |||
| 374 | .isdz { | ||
| 375 | text-indent: 96px !important; | ||
| 376 | |||
| 377 | .iszrz { | ||
| 378 | left: 0 !important; | ||
| 379 | text-indent: 112px !important; | ||
| 380 | } | ||
| 381 | } | ||
| 382 | |||
| 383 | .third_layer { | ||
| 384 | position: relative; | ||
| 385 | width: calc(100% - 20px); | ||
| 386 | cursor: pointer; | ||
| 387 | padding-left: 20px; | ||
| 388 | } | ||
| 389 | |||
| 390 | .white_layer { | ||
| 391 | color: black !important; | ||
| 392 | } | ||
| 393 | |||
| 394 | .lpbTree-node { | ||
| 395 | position: absolute; | ||
| 396 | top: 1px; | ||
| 397 | left: 0; | ||
| 398 | } | ||
| 399 | |||
| 400 | // .second_layer::before { | ||
| 401 | // content: ""; | ||
| 402 | // position: absolute; | ||
| 403 | // height: 1px; | ||
| 404 | // width: 16px; | ||
| 405 | // left: 8px; | ||
| 406 | // top: 8px; | ||
| 407 | // opacity: .5; | ||
| 408 | // background: url('../../assets/images/rowline1.png'); | ||
| 409 | // background-position-y: center; | ||
| 410 | // } | ||
| 411 | // .third_layer::before { | ||
| 412 | // content: ""; | ||
| 413 | // position: absolute; | ||
| 414 | // height: 1px; | ||
| 415 | // width: 16px; | ||
| 416 | // left: 8px; | ||
| 417 | // top: 8px; | ||
| 418 | // opacity: .5; | ||
| 419 | // background: url('../../assets/images/rowline1.png'); | ||
| 420 | // background-position-y: center; | ||
| 421 | // } | ||
| 422 | |||
| 423 | // .linkLine_default::after { | ||
| 424 | // content: ""; | ||
| 425 | // position: absolute; | ||
| 426 | // height: 100%; | ||
| 427 | // width: 1px; | ||
| 428 | // left: 7px; | ||
| 429 | // top: 0px; | ||
| 430 | // opacity: .5; | ||
| 431 | // background: url('../../assets/images/colline1.png'); | ||
| 432 | // background-position-x: center; | ||
| 433 | // } | ||
| 434 | // .linkLine_first::after { | ||
| 435 | // content: ""; | ||
| 436 | // position: absolute; | ||
| 437 | // /* 为了触顶 */ | ||
| 438 | // top: -16px; | ||
| 439 | // height: calc(100% + 16px); | ||
| 440 | // width: 1px; | ||
| 441 | // left: 7px; | ||
| 442 | // opacity: .5; | ||
| 443 | // background: url('../../assets/images/colline1.png'); | ||
| 444 | // background-position-x: center; | ||
| 445 | // } | ||
| 446 | // // 上半截 | ||
| 447 | // .linkLine_half_top::after { | ||
| 448 | // content: ""; | ||
| 449 | // position: absolute; | ||
| 450 | // height: 23px; | ||
| 451 | // top: -14px; | ||
| 452 | // width: 1px; | ||
| 453 | // left: 7px; | ||
| 454 | // opacity: .5; | ||
| 455 | // background: url('../../assets/images/colline1.png'); | ||
| 456 | // background-position-x: center; | ||
| 457 | // } | ||
| 458 | // .linkLine_last::after { | ||
| 459 | // content: ""; | ||
| 460 | // position: absolute; | ||
| 461 | // height: 9px; | ||
| 462 | // width: 1px; | ||
| 463 | // left: 7px; | ||
| 464 | // top: 0px; | ||
| 465 | // opacity: .5; | ||
| 466 | // background: url('../../assets/images/colline1.png'); | ||
| 467 | // background-position-x: center; | ||
| 468 | // } | ||
| 469 | |||
| 470 | .reTree_default_icon { | ||
| 471 | // opacity: .5; | ||
| 472 | background-size: contain; | ||
| 473 | } | ||
| 474 | |||
| 475 | .reTree_collapse_icon { | ||
| 476 | // opacity: .5; | ||
| 477 | background: url("../../assets/images/arrow-down-bold.svg") no-repeat center center; | ||
| 478 | background-size: contain; | ||
| 479 | } | ||
| 480 | |||
| 481 | .reTree_expand_icon { | ||
| 482 | // opacity: .5; | ||
| 483 | background: url("../../assets/images/arrow-left-bold.svg") no-repeat center center; | ||
| 484 | background-size: contain; | ||
| 485 | } | ||
| 486 | |||
| 487 | .lpbTree_collapse_icon { | ||
| 488 | // opacity: .5; | ||
| 489 | background-size: contain; | ||
| 490 | } | ||
| 491 | |||
| 492 | .lpbTree_expand_icon { | ||
| 493 | // opacity: .5; | ||
| 494 | background: url("../../assets/images/arrow-left-bold.svg") no-repeat center center; | ||
| 495 | background-size: contain; | ||
| 496 | } | ||
| 497 | |||
| 498 | |||
| 499 | .reTree_focus_icon { | ||
| 500 | // opacity: .5; | ||
| 501 | background: url("../../assets/images/reTree_focus_.svg") no-repeat center center; | ||
| 502 | background-size: contain; | ||
| 503 | } | ||
| 504 | |||
| 505 | .qsztImg { | ||
| 506 | width: 16px; | ||
| 507 | margin-right: 6px; | ||
| 508 | // border-radius: 50%; height: 20px; width: 20px; display: inline-block; | ||
| 509 | } | ||
| 510 | |||
| 511 | .curNode { | ||
| 512 | >.basic_banner { | ||
| 513 | background: #E9F5FF; | ||
| 514 | box-shadow: inset 2px 0 0 0 #0C71FB; | ||
| 515 | color: #0C71FB; | ||
| 516 | } | ||
| 517 | } | ||
| 518 | |||
| 519 | .qsztFont { | ||
| 520 | text-align: center; | ||
| 521 | |||
| 522 | display: inline-block; | ||
| 523 | width: 16px; | ||
| 524 | height: 16px; | ||
| 525 | font-size: 12px; | ||
| 526 | line-height: 16px; | ||
| 527 | border: 1px solid; | ||
| 528 | border-radius: 8px; | ||
| 529 | } | ||
| 530 | |||
| 531 | .mr4 { | ||
| 532 | margin-right: 4px; | ||
| 533 | } | ||
| 534 | </style> |
src/components/lineTree/lineTree.vue
deleted
100644 → 0
| 1 | <template> | ||
| 2 | <div class="content column-start-center reTree_box" | ||
| 3 | :style="{ fontSize: (size || 16) + 'px', lineHeight: (size || 16) + 'px', width: (islpb ? '200' : '286') + 'px' }"> | ||
| 4 | <div class="column-start-center basic_layer" :class="islpb ? 'white_layer' : ''" v-for="(item, index) in formatData" | ||
| 5 | :key="index"> | ||
| 6 | <div class="row-flex-start basic_banner" :class="{ | ||
| 7 | active_color: item.expand && item.children.length > 0, | ||
| 8 | }" @click="itemClick(item)"> | ||
| 9 | |||
| 10 | <div class="layer_text nowrap" @contextmenu.prevent="openMenu($event, item)"><i class="iconfont iconguoyou"></i> | ||
| 11 | {{ item.mc }}</div> | ||
| 12 | <div class="reTree_icon" :style="{ | ||
| 13 | height: 10 + 'px', | ||
| 14 | width: 10 + 'px', | ||
| 15 | }" :class="{ | ||
| 16 | reTree_default_icon: item.children.length === 0, | ||
| 17 | reTree_collapse_icon: !islpb && item.expand && item.children.length > 0, | ||
| 18 | reTree_expand_icon: !islpb && !item.expand && item.children.length > 0, | ||
| 19 | lpbTree_collapse_icon: islpb && item.expand && item.children.length > 0, | ||
| 20 | lpbTree_expand_icon: islpb && !item.expand && item.children.length > 0, | ||
| 21 | }"></div> | ||
| 22 | </div> | ||
| 23 | |||
| 24 | <lineItem v-if="item.expand && item.children.length > 0" v-on="$listeners" @ownerMethod="ownerMethod(arguments)" | ||
| 25 | @changeTop="changeTop" @changeZdData="changeZdData" @changeLeft="changeLeft" @changeVisible="changeVisible" | ||
| 26 | @changeLpbVisible="changeLpbVisible" @changeIsZD="changeIsZD" @changeCreateVisible="changeCreateVisible" | ||
| 27 | @changeDzVisible="changeDzVisible" @changeGzwVisible="changeGzwVisible" :list="item.children" | ||
| 28 | :visible="zrzVisible" :size="size" :islpb="islpb" :formatData="formatData"></lineItem> | ||
| 29 | </div> | ||
| 30 | |||
| 31 | <ul v-show="zrzVisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu"> | ||
| 32 | <li @click="postionToMap">定位</li> | ||
| 33 | <li @click="importGeo">导入图形</li> | ||
| 34 | <li> | ||
| 35 | 导出图形 | ||
| 36 | <ul class="contextmenu childUl"> | ||
| 37 | <li @click="exportText">文本</li> | ||
| 38 | <li @click="exportCad">CAD</li> | ||
| 39 | <li @click="exportExcel">Excel</li> | ||
| 40 | <li @click="exportToShp">ESRI Shape</li> | ||
| 41 | </ul> | ||
| 42 | </li> | ||
| 43 | <li @click="drsx" :class="zdQszt == '0' ? '' : 'noEdit'">导入属性</li> | ||
| 44 | <li @click="dcsx">导出属性</li> | ||
| 45 | <li v-show="!isZD">导入楼盘</li> | ||
| 46 | <!-- <li>重叠分析</li> --> | ||
| 47 | <li v-show="isZD && (zdQszt == '1' || zdQszt == '2')" @click="openCreateDialog('dzw')">添加定着物</li> | ||
| 48 | <li v-show="isZD && (zdQszt != '1' && zdQszt != '2')" class="noEdit">添加定着物</li> | ||
| 49 | <li @click="deleteByBsm()">删除</li> | ||
| 50 | <li @click="deleteGeoByBsm()">删除图形</li> | ||
| 51 | </ul> | ||
| 52 | <ul v-show="dzVisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu"> | ||
| 53 | <li @click="openCreateDialog('zrz')">新建自然幢</li> | ||
| 54 | <li @click="deleteByBsm()">删除</li> | ||
| 55 | </ul> | ||
| 56 | <ul v-show="createVisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu"> | ||
| 57 | <li @click="openCreateDialog">新建宗地</li> | ||
| 58 | </ul> | ||
| 59 | <!-- 构筑物删除 --> | ||
| 60 | <ul v-show="gzwVisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu"> | ||
| 61 | <li @click="deleteByBsm">删除</li> | ||
| 62 | </ul> | ||
| 63 | <ul v-show="lpbvisible" :style="{ left: lpbleft + 'px', top: lpbtop + 'px' }" class="contextmenu"> | ||
| 64 | <li v-show="zdData.type == 'zrz'" @click="openLpbDialog('ljz')">添加逻辑幢</li> | ||
| 65 | <li v-show="zdData.type == 'zrz' || zdData.type == 'ljz'" @click="openLpbDialog('zdy')">添加幢单元</li> | ||
| 66 | <li v-show="zdData.type == 'zrz' || zdData.type == 'ljz' || zdData.type == 'zdy'" @click="openLpbDialog('ch')"> | ||
| 67 | 添加层户</li> | ||
| 68 | <li v-show="zdData.type == 'ljz'" @click="deleteLjz">删除</li> | ||
| 69 | <li v-show="zdData.type == 'zdy'" @click="deleteZdy">删除</li> | ||
| 70 | </ul> | ||
| 71 | |||
| 72 | <!--@close="closeImportDialog"--> | ||
| 73 | <el-dialog :close-on-click-modal="false" title="导入图形" :modal="false" custom-class="importDialog" | ||
| 74 | :visible.sync="improtDialog" width="30%" @close="closeImportDialog"> | ||
| 75 | <import-geo :property-info="zdData" :timeLine="new Date().getTime()" :geo-info="currentClickZdGeo" | ||
| 76 | @closeImportDialog="closeImportDialog"></import-geo> | ||
| 77 | </el-dialog> | ||
| 78 | <!-- 添加定着物弹框 --> | ||
| 79 | <el-dialog :close-on-click-modal="false" title="新建" :modal="false" :visible.sync="dialogVisible" width="48%"> | ||
| 80 | <!-- <Create @closeDialog="closeDialog" :auth="true" :createZrz="createZrz" ></Create> --> | ||
| 81 | </el-dialog> | ||
| 82 | <!-- <sxdr :sxdr-visible="sxdrVisible" @close="sxdrClose" :dylx="zdData.type" :bsm="zdData.bsm"></sxdr> --> | ||
| 83 | </div> | ||
| 84 | </template> | ||
| 85 | <script> | ||
| 86 | import lineItem from "./lineItem.vue"; | ||
| 87 | // import { deleteZdInfoByBsm, exportShp, exportExcel, delJzdByBsm, delJzxByBsm } from "@api/zd"; | ||
| 88 | // import Create from "../../views/panel/create/index"; | ||
| 89 | import ImportGeo from './tx/importGeo' | ||
| 90 | port geoUtils from "@/components/lineTree/tx/js/geoUtils"; | ||
| 91 | rt featureUpdate from "@/libs/map/featureUpdate"; | ||
| 92 | ort { deleteLjz, deleteZdy } from "@api/lpcx.js" | ||
| 93 | exportTemJson from '@/api/json/exportTemplate.json' | ||
| 94 | mport sxdr from '@/components/sxdr/sxdr' | ||
| 95 | port default { | ||
| 96 | nheritAttrs: false, | ||
| 97 | ps: { | ||
| 98 | { | ||
| 99 | e: Array, | ||
| 100 | ault: () => { | ||
| 101 | turn[]; | ||
| 102 | |||
| 103 | : { | ||
| 104 | e: Number, | ||
| 105 | ault: 16, | ||
| 106 | b: { | ||
| 107 | e: Boolean, | ||
| 108 | ault: false, | ||
| 109 | |||
| 110 | omponents: { lineItem, Create, ImportGeo, sxdr }, | ||
| 111 | ixins: [geoUtils, featureUpdate], | ||
| 112 | a() { | ||
| 113 | rn { | ||
| 114 | rVisible: false, | ||
| 115 | electedDetail: { }, | ||
| 116 | timer: { }, | ||
| 117 | formatData: this.$store.state.treeData, | ||
| 118 | isible: false, | ||
| 119 | top: 0, | ||
| 120 | left: 0, | ||
| 121 | sZD: true, | ||
| 122 | ata: { }, | ||
| 123 | rentClickZdGeo: "", | ||
| 124 | mprotDialog: false, | ||
| 125 | ialogVisible: false, | ||
| 126 | 制自然幢右键菜单 | ||
| 127 | Visible: false, | ||
| 128 | 盘表 | ||
| 129 | visible: false, | ||
| 130 | top: 0, | ||
| 131 | left: 0, | ||
| 132 | /控制新建宗地菜单 | ||
| 133 | reateVisible: false, | ||
| 134 | 幢 | ||
| 135 | isible: false, | ||
| 136 | 属状态 | ||
| 137 | szt: null, | ||
| 138 | : "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]", | ||
| 139 | ateZrz: false, | ||
| 140 | /构筑物 | ||
| 141 | zwVisible: false | ||
| 142 | |||
| 143 | ch: { | ||
| 144 | (n, o) { | ||
| 145 | s.formatData = this.preDealData(n); | ||
| 146 | isible(value) { | ||
| 147 | (value) { | ||
| 148 | ment.body.addEventListener("click", this.closeMenu); | ||
| 149 | lse { | ||
| 150 | cument.body.removeEventListener("click", this.closeMenu); | ||
| 151 | |||
| 152 | |||
| 153 | Visible(value) { | ||
| 154 | (value) { | ||
| 155 | cument.body.addEventListener("click", this.closeMenu); | ||
| 156 | lse { | ||
| 157 | cument.body.removeEventListener("click", this.closeMenu); | ||
| 158 | wVisible(value) { | ||
| 159 | f(value) { | ||
| 160 | document.body.addEventListener("click", this.closeMenu); | ||
| 161 | lse { | ||
| 162 | cument.body.removeEventListener("click", this.closeMenu); | ||
| 163 | } | ||
| 164 | zrzVisible(value) { | ||
| 165 | (value) { | ||
| 166 | ment.body.addEventListener("click", this.closeMenu); | ||
| 167 | lse { | ||
| 168 | document.body.removeEventListener("click", this.closeMenu); | ||
| 169 | reateVisible(value) { | ||
| 170 | (value) { | ||
| 171 | document.body.addEventListener("click", this.closeMenu); | ||
| 172 | } else { | ||
| 173 | document.body.removeEventListener("click", this.closeMenu); | ||
| 174 | } | ||
| 175 | } | ||
| 176 | ed() { | ||
| 177 | nextTick(() => { | ||
| 178 | eDealData(this.pd); | ||
| 179 | ndTreeItemById(["6b5af49d803f97baf06afb897de257f5"]); | ||
| 180 | |||
| 181 | { | ||
| 182 | .log(this.zdData, 'zdData') | ||
| 183 | ow.open(`api/tx/excelGeo/export?bsm=${this.zdData.bsm}&type=${this.zdData.type}`) | ||
| 184 | `api/tx/excelGeo/export?bsm=${this.zdData.bsm}&type=${this.zdData.type}` | ||
| 185 | mIF = document.createElement("iframe"); | ||
| 186 | src = url; | ||
| 187 | style.display = "none"; | ||
| 188 | t.body.appendChild(elemIF) | ||
| 189 | { | ||
| 190 | his.zdQszt != '0') { | ||
| 191 | |||
| 192 | drVisible = true; | ||
| 193 | e() { | ||
| 194 | sxdrVisible = false; | ||
| 195 | ading() { | ||
| 196 | his.$emit("loading") | ||
| 197 | |||
| 198 | eleteLjz() { | ||
| 199 | console.log("删除逻辑幢") | ||
| 200 | console.log(this.zdData, "zdData") | ||
| 201 | deleteLjz(this.zdData.bsm).then(res => { | ||
| 202 | if (res.success) { | ||
| 203 | this.loading() | ||
| 204 | else { | ||
| 205 | dy() { | ||
| 206 | log("删除幢单元") | ||
| 207 | e.log(this.zdData, "zdData") | ||
| 208 | teZdy(this.zdData.bsm).then(res => { | ||
| 209 | f(res.success) { | ||
| 210 | this.loading() | ||
| 211 | } | ||
| 212 | |||
| 213 | , | ||
| 214 | 变菜单数据 | ||
| 215 | Visible(data) { | ||
| 216 | s.zrzVisible = data; | ||
| 217 | s.lpbvisible = false; | ||
| 218 | dzVisible = false; | ||
| 219 | wVisible = false; | ||
| 220 | ta(data) { | ||
| 221 | = data; | ||
| 222 | zt = data.qszt; | ||
| 223 | (data) { | ||
| 224 | p = data; | ||
| 225 | lpbtop = data; | ||
| 226 | angeLeft(data) { | ||
| 227 | this.left = data; | ||
| 228 | this.lpbleft = data; | ||
| 229 | }, | ||
| 230 | changeIsZD(data) { | ||
| 231 | this.isZD = data; | ||
| 232 | }, | ||
| 233 | changeLpbVisible(data) { | ||
| 234 | this.lpbvisible = data; | ||
| 235 | this.zrzVisible = false; | ||
| 236 | this.dzVisible = false; | ||
| 237 | this.gzwVisible = false; | ||
| 238 | }, | ||
| 239 | changeCreateVisible(data) { | ||
| 240 | this.createVisible = true; | ||
| 241 | }, | ||
| 242 | //多幢 | ||
| 243 | changeDzVisible(data) { | ||
| 244 | this.dzVisible = data; | ||
| 245 | this.zrzVisible = false; | ||
| 246 | this.lpbvisible = false; | ||
| 247 | this.gzwVisible = false; | ||
| 248 | }, | ||
| 249 | //构筑物 | ||
| 250 | changeGzwVisible(data) { | ||
| 251 | this.gzwVisible = data; | ||
| 252 | this.zrzVisible = false; | ||
| 253 | this.lpbvisible = false; | ||
| 254 | this.dzVisible = false; | ||
| 255 | }, | ||
| 256 | //添加定着物 | ||
| 257 | openCreateDialog(type) { | ||
| 258 | if (type == 'zrz') { | ||
| 259 | this.createZrz = true; | ||
| 260 | } | ||
| 261 | console.log(this.zdData, 'this.zdData'); | ||
| 262 | this.dialogVisible = true; | ||
| 263 | this.$store.state.zdbsm = this.zdData.zdbsm; | ||
| 264 | if (this.zdData.type == 'dz') { | ||
| 265 | this.$store.state.dzbsm = this.zdData.bsm; | ||
| 266 | } else { | ||
| 267 | this.$store.state.dzbsm = ''; | ||
| 268 | } | ||
| 269 | }, | ||
| 270 | //关闭添加定着物弹框 | ||
| 271 | closeDialog() { | ||
| 272 | this.dialogVisible = false; | ||
| 273 | this.createZrz = false; | ||
| 274 | }, | ||
| 275 | preDealData(list) { | ||
| 276 | //楼盘表目录树没有expand属性 | ||
| 277 | // if(list == null){ | ||
| 278 | // return list | ||
| 279 | // }else{ | ||
| 280 | list.forEach((x) => { | ||
| 281 | if (x.expand == undefined) this.$set(x, "expand", true); | ||
| 282 | if (x.children && x.children.length > 0) { | ||
| 283 | this.preDealData(x.children); | ||
| 284 | } | ||
| 285 | }); | ||
| 286 | return list; | ||
| 287 | // } | ||
| 288 | }, | ||
| 289 | // 根据id展开树的具体项 | ||
| 290 | expandTreeItemById(idList) { | ||
| 291 | let _this = this; | ||
| 292 | function loopTree (list) { | ||
| 293 | list.forEach((x) => { | ||
| 294 | if (idList.includes(x.zdbsm)) { | ||
| 295 | _this.$set(x, "expand", true); | ||
| 296 | } else { | ||
| 297 | _this.$set(x, "expand", false); | ||
| 298 | } | ||
| 299 | if (x.children && x.children.length > 0) loopTree(x.children); | ||
| 300 | }); | ||
| 301 | return list; | ||
| 302 | } | ||
| 303 | this.formatData = loopTree(this.pd); | ||
| 304 | console.log(this.formatData, "this.formatData"); | ||
| 305 | }, | ||
| 306 | itemClick(item) { | ||
| 307 | // item.expand = item.expand == undefined? true:!item.expand; | ||
| 308 | this.formatData.forEach(i => { | ||
| 309 | if (i.bsm != item.bsm) { | ||
| 310 | i.expand = false | ||
| 311 | } else { | ||
| 312 | // i.expand = !item.expand | ||
| 313 | } | ||
| 314 | }) | ||
| 315 | item.expand = !item.expand; | ||
| 316 | // this.$emit("itemClick", item); | ||
| 317 | }, | ||
| 318 | //给所有权类型添加子节点 | ||
| 319 | ownerMethod(arr) { | ||
| 320 | let item = arr[0]; | ||
| 321 | let list = arr[1] | ||
| 322 | this.formatData.forEach(i => { | ||
| 323 | if (i.bsm == item.xzq) { | ||
| 324 | i.children.forEach(j => { | ||
| 325 | if (j.bsm == item.djq) { | ||
| 326 | j.children.forEach(k => { | ||
| 327 | if (k.bsm == item.djzq) { | ||
| 328 | k.children.forEach(n => { | ||
| 329 | if (n.dm == item.dm) { | ||
| 330 | this.$nextTick(() => { | ||
| 331 | n.children = list; | ||
| 332 | }) | ||
| 333 | } | ||
| 334 | }) | ||
| 335 | } | ||
| 336 | }) | ||
| 337 | } | ||
| 338 | }) | ||
| 339 | } | ||
| 340 | }); | ||
| 341 | this.$store.state.treeData = this.formatData; | ||
| 342 | }, | ||
| 343 | //自然幢右键点击事件 | ||
| 344 | openMenu(e, item) { | ||
| 345 | this.lpbleft = e.pageX; | ||
| 346 | this.lpbtop = e.pageY; | ||
| 347 | this.zdData = item; | ||
| 348 | this.changeLpbVisible(true); | ||
| 349 | }, | ||
| 350 | //关闭右键菜单 | ||
| 351 | closeMenu() { | ||
| 352 | this.zrzVisible = false; | ||
| 353 | this.lpbvisible = false; | ||
| 354 | this.dzVisible = false; | ||
| 355 | this.gzwVisible = false; | ||
| 356 | }, | ||
| 357 | //楼盘表右键菜单项打开父组件弹框 | ||
| 358 | openLpbDialog(type) { | ||
| 359 | this.$parent.openLpbDialog(this.zdData, type); | ||
| 360 | }, | ||
| 361 | detailDoubleClick(data) { | ||
| 362 | clearTimeout(this.timer); | ||
| 363 | this.selectedDetail = data; | ||
| 364 | this.$emit("detailDoubleClick", data); | ||
| 365 | }, | ||
| 366 | //右键菜单的删除 | ||
| 367 | deleteByBsm() { | ||
| 368 | let name = ''; | ||
| 369 | switch (this.zdData.type) { | ||
| 370 | case 'zd': | ||
| 371 | name = '宗地' | ||
| 372 | break; | ||
| 373 | case 'dz': | ||
| 374 | name = '多幢' | ||
| 375 | break; | ||
| 376 | case 'zrz': | ||
| 377 | name = '自然幢' | ||
| 378 | break; | ||
| 379 | case 'gzw': | ||
| 380 | name = '构筑物' | ||
| 381 | break; | ||
| 382 | |||
| 383 | default: | ||
| 384 | break; | ||
| 385 | } | ||
| 386 | this.$confirm('是否确定删除该' + name + '?', '提示', { | ||
| 387 | confirmButtonText: '确定', | ||
| 388 | cancelButtonText: '取消', | ||
| 389 | type: 'warning' | ||
| 390 | }).then(() => { | ||
| 391 | let params = { "bsm": this.zdData.bsm, "type": this.zdData.type }; | ||
| 392 | deleteZdInfoByBsm(params) | ||
| 393 | .then((res) => { | ||
| 394 | console.log(res); | ||
| 395 | if (res.success) { | ||
| 396 | this.$message({ | ||
| 397 | type: 'success', | ||
| 398 | message: '删除成功!' | ||
| 399 | }); | ||
| 400 | this.$router.push("/panel"); | ||
| 401 | } else { | ||
| 402 | this.$message({ | ||
| 403 | message: res.message, | ||
| 404 | type: "warning", | ||
| 405 | }); | ||
| 406 | } | ||
| 407 | }) | ||
| 408 | .catch((error) => { }); | ||
| 409 | }).catch(() => { | ||
| 410 | |||
| 411 | }); | ||
| 412 | var self = this; | ||
| 413 | var BSM = ""; | ||
| 414 | var type = this.zdData.type; | ||
| 415 | if (type == "zd") { | ||
| 416 | BSM = this.zdData.zdbsm; | ||
| 417 | } else { | ||
| 418 | BSM = this.zdData.bsm; | ||
| 419 | } | ||
| 420 | //删除图形相关信息 | ||
| 421 | var type = this.zdData.type; | ||
| 422 | this.queryGeoByBsm(BSM, type, function (features) { | ||
| 423 | if (features && features.length > 0) { | ||
| 424 | var layer = null; | ||
| 425 | if (type == 'zd') { | ||
| 426 | layer = self.getLayerByName("ZDJBXX"); | ||
| 427 | } else { | ||
| 428 | layer = self.getLayerByName("ZRZ"); | ||
| 429 | |||
| 430 | } | ||
| 431 | var featureUrl = layer.layerUrl.replace("MapServer", "FeatureServer"); | ||
| 432 | featureUrl += "/" + layer.id; | ||
| 433 | self.delGraphic(featureUrl, features[0], null); | ||
| 434 | } | ||
| 435 | }); | ||
| 436 | }, | ||
| 437 | //删除图形 | ||
| 438 | deleteGeoByBsm() { | ||
| 439 | var self = this; | ||
| 440 | var BSM = ""; | ||
| 441 | var type = this.zdData.type; | ||
| 442 | if (type == "zd") { | ||
| 443 | BSM = this.zdData.zdbsm; | ||
| 444 | } else { | ||
| 445 | BSM = this.zdData.bsm; | ||
| 446 | } | ||
| 447 | //删除图形相关信息 | ||
| 448 | var type = this.zdData.type; | ||
| 449 | this.queryGeoByBsm(BSM, type, function (features) { | ||
| 450 | if (features && features.length > 0 && features[0].geometry.rings.length > 0) { | ||
| 451 | var layer = null; | ||
| 452 | if (type == 'zd') { | ||
| 453 | layer = self.getLayerByName("ZDJBXX"); | ||
| 454 | } else { | ||
| 455 | layer = self.getLayerByName("ZRZ"); | ||
| 456 | } | ||
| 457 | var featureUrl = layer.layerUrl.replace("MapServer", "FeatureServer"); | ||
| 458 | featureUrl += "/" + layer.id; | ||
| 459 | features[0].geometry = null; | ||
| 460 | self.updateGraphic(featureUrl, features, function (res) { | ||
| 461 | if (!res.updateFeatureResults[0].error) { | ||
| 462 | self.$message.warning("删除成功!!!") | ||
| 463 | //清除图层 | ||
| 464 | self.clearHighlightLayer("testMap"); | ||
| 465 | //self.addGeoByBsm(BSM,type,"testMap"); | ||
| 466 | //删除界址点 界址线 | ||
| 467 | if (type == 'zd') { | ||
| 468 | self.delJzdAndJzx(BSM); | ||
| 469 | } | ||
| 470 | } | ||
| 471 | |||
| 472 | }); | ||
| 473 | } else { | ||
| 474 | self.$message.warning("暂无图形信息!!!") | ||
| 475 | } | ||
| 476 | }); | ||
| 477 | }, | ||
| 478 | //删除宗地界址点 界址线 | ||
| 479 | delJzdAndJzx(bsm) { | ||
| 480 | delJzdByBsm({ zdbsm: bsm }).then(res => { | ||
| 481 | if (res.success) { | ||
| 482 | console.log("删除界址点成功!!!"); | ||
| 483 | } | ||
| 484 | }); | ||
| 485 | delJzxByBsm({ zdbsm: bsm }).then(res => { | ||
| 486 | if (res.success) { | ||
| 487 | console.log("删除界址线成功!!!"); | ||
| 488 | } | ||
| 489 | }) | ||
| 490 | }, | ||
| 491 | /* | ||
| 492 | * 导入图形 | ||
| 493 | * */ | ||
| 494 | importGeo() { | ||
| 495 | var self = this; | ||
| 496 | var BSM = ""; | ||
| 497 | if (this.zdData.qszt != '0') { | ||
| 498 | this.$message.warning("不是临时数据,不能导入图形!!!"); | ||
| 499 | return; | ||
| 500 | } | ||
| 501 | var type = this.zdData.type; | ||
| 502 | if (type == "zd") { | ||
| 503 | BSM = this.zdData.zdbsm; | ||
| 504 | } else { | ||
| 505 | BSM = this.zdData.bsm; | ||
| 506 | } | ||
| 507 | //当确定导入图形是 跳转到图形界面 | ||
| 508 | this.queryGeoByBsm(BSM, type, function (features) { | ||
| 509 | if (features && features.length > 0) { | ||
| 510 | if (features[0].geometry && features[0].geometry.rings.length > 0) { | ||
| 511 | self.$confirm('该条数据有地块信息,是否继续导入?', '提示', { | ||
| 512 | confirmButtonText: '继续', | ||
| 513 | cancelButtonText: '取消', | ||
| 514 | type: 'warning' | ||
| 515 | }).then(() => { | ||
| 516 | self.postionToMap(); | ||
| 517 | self.improtDialog = true; | ||
| 518 | self.currentClickZdGeo = features[0]; | ||
| 519 | }).catch(() => { | ||
| 520 | self.$message({ | ||
| 521 | type: 'info', | ||
| 522 | message: '已取消' | ||
| 523 | }); | ||
| 524 | }); | ||
| 525 | } else { | ||
| 526 | self.postionToMap(); | ||
| 527 | self.currentClickZdGeo = features[0]; | ||
| 528 | self.improtDialog = true; | ||
| 529 | } | ||
| 530 | |||
| 531 | } else { | ||
| 532 | self.postionToMap(); | ||
| 533 | self.currentClickZdGeo = null; | ||
| 534 | self.improtDialog = true; | ||
| 535 | } | ||
| 536 | }); | ||
| 537 | }, | ||
| 538 | //导出文本文件 | ||
| 539 | exportText() { | ||
| 540 | var self = this; | ||
| 541 | var type = this.zdData.type; | ||
| 542 | var BSM = type == 'zd' ? this.zdData.zdbsm : this.zdData.bsm; | ||
| 543 | this.queryGeoByBsm(BSM, type, function (features) { | ||
| 544 | if (features && features.length > 0 && features[0].geometry.rings.length > 0) { | ||
| 545 | var data = features[0]; | ||
| 546 | var jzdInfo = self.craetJZPoint(data); | ||
| 547 | var textCotent = ""; | ||
| 548 | textCotent += exportTemJson.exprotTextAttr; | ||
| 549 | textCotent += "[地块坐标]\n"; | ||
| 550 | var dkMc = "", dkYt = ""; | ||
| 551 | if (type == 'zd') { | ||
| 552 | dkMc = data.attributes.ZL; | ||
| 553 | dkYt = data.attributes.YT; | ||
| 554 | } else { | ||
| 555 | dkMc = data.attributes.XMMC + data.attributes.JZWMC; | ||
| 556 | dkYt = "建设用地"; | ||
| 557 | } | ||
| 558 | textCotent += ",,," + dkMc + ",面,," + dkYt + ",,@\n"; | ||
| 559 | for (var i = 0; i < jzdInfo.length; i++) { | ||
| 560 | textCotent += jzdInfo[i].jzdh + "," + jzdInfo[i].sxh + "," + | ||
| 561 | jzdInfo[i].x + "," + jzdInfo[i].y + "\n" | ||
| 562 | } | ||
| 563 | self.downloadTxt(textCotent, "outPut.txt"); | ||
| 564 | } | ||
| 565 | }, { wkt: this.wkt }); | ||
| 566 | }, | ||
| 567 | //导出shp文件 | ||
| 568 | exportToShp() { | ||
| 569 | var self = this; | ||
| 570 | var type = this.zdData.type; | ||
| 571 | var BSM = type == 'zd' ? this.zdData.zdbsm : this.zdData.bsm; | ||
| 572 | this.queryGeoByBsm(BSM, type, function (features) { | ||
| 573 | if (features && features.length > 0 && features[0].geometry.rings.length > 0) { | ||
| 574 | var data = JSON.stringify(features[0]); | ||
| 575 | window.location.href = "/api/tx/shpUtils/writeShp?strObj=" + encodeURI(data) | ||
| 576 | /* exportShp({ | ||
| 577 | "strObj":encodeURI(data) | ||
| 578 | }).then(res => { | ||
| 579 | debugger | ||
| 580 | });*/ | ||
| 581 | } else { | ||
| 582 | self.$message.warning("暂无空间信息!!!!"); | ||
| 583 | } | ||
| 584 | }, { wkt: this.wkt }); | ||
| 585 | }, | ||
| 586 | //导出excel | ||
| 587 | exportExcel() { | ||
| 588 | var self = this; | ||
| 589 | var type = this.zdData.type; | ||
| 590 | var BSM = type == 'zd' ? this.zdData.zdbsm : this.zdData.bsm; | ||
| 591 | this.queryGeoByBsm(BSM, type, function (features) { | ||
| 592 | if (features && features.length > 0 && features[0].geometry.rings.length > 0) { | ||
| 593 | var data = features[0]; | ||
| 594 | var jzdInfo = self.craetJZPoint(data); | ||
| 595 | var submitData = []; | ||
| 596 | for (var i = 0; i < jzdInfo.length; i++) { | ||
| 597 | var obj = { | ||
| 598 | jzdHao: jzdInfo[i].jzdh, | ||
| 599 | x: jzdInfo[i].x, | ||
| 600 | y: jzdInfo[i].y, | ||
| 601 | diKuaiQuanHao: jzdInfo.sxh | ||
| 602 | } | ||
| 603 | submitData.push(obj); | ||
| 604 | } | ||
| 605 | exportExcel(submitData).then((res) => { | ||
| 606 | if (res.code == 200) { | ||
| 607 | var path = res.result; | ||
| 608 | window.location.href = "/api/tx/excelGeo/download?filePath=" + encodeURI(path); | ||
| 609 | } | ||
| 610 | }); | ||
| 611 | } else { | ||
| 612 | self.$message.warning("还没有空间信息!!!!") | ||
| 613 | } | ||
| 614 | }, { wkt: this.wkt }) | ||
| 615 | }, | ||
| 616 | //导出CAD | ||
| 617 | exportCad() { | ||
| 618 | //TODO | ||
| 619 | }, | ||
| 620 | downloadTxt(text, fileName) { | ||
| 621 | let element = document.createElement('a') | ||
| 622 | element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)) | ||
| 623 | element.setAttribute('download', fileName) | ||
| 624 | element.style.display = 'none' | ||
| 625 | element.click() | ||
| 626 | }, | ||
| 627 | //图形定位 | ||
| 628 | postionToMap() { | ||
| 629 | var type = this.zdData.type; | ||
| 630 | var BSM = type == 'zd' ? this.zdData.zdbsm : this.zdData.bsm; | ||
| 631 | if (this.$route.path == "/viewMap") { | ||
| 632 | //定位到当前空间位置 | ||
| 633 | // TODO 这个方法只是为了支撑功能 | ||
| 634 | this.postionToThisGeo(BSM, type); | ||
| 635 | return; | ||
| 636 | } | ||
| 637 | var curretRouterInfo = { | ||
| 638 | path: this.$route.path, | ||
| 639 | query: this.$route.query | ||
| 640 | } | ||
| 641 | sessionStorage.setItem("curretRouterInfo", JSON.stringify(curretRouterInfo)); | ||
| 642 | this.$router.push({ | ||
| 643 | path: "/viewMap", | ||
| 644 | query: { | ||
| 645 | bsm: BSM, | ||
| 646 | type: type | ||
| 647 | } | ||
| 648 | }); | ||
| 649 | }, | ||
| 650 | |||
| 651 | //关闭图形弹框 | ||
| 652 | closeImportDialog() { | ||
| 653 | this.improtDialog = false; | ||
| 654 | this.clearOverLayer(); | ||
| 655 | } | ||
| 656 | |||
| 657 | }, | ||
| 658 | }; | ||
| 659 | </script> | ||
| 660 | <style lang="scss" scoped> | ||
| 661 | .content { | ||
| 662 | height: 100%; | ||
| 663 | width: 100%; | ||
| 664 | overflow-y: scroll; | ||
| 665 | overflow-x: hidden; | ||
| 666 | } | ||
| 667 | |||
| 668 | .column-start-center { | ||
| 669 | display: flex; | ||
| 670 | display: -webkit-flex; | ||
| 671 | flex-direction: column; | ||
| 672 | justify-content: flex-start; | ||
| 673 | align-items: center; | ||
| 674 | |||
| 675 | } | ||
| 676 | |||
| 677 | .row-flex-start { | ||
| 678 | display: flex; | ||
| 679 | display: -webkit-flex; | ||
| 680 | flex-direction: row; | ||
| 681 | justify-content: flex-start; | ||
| 682 | align-items: center; | ||
| 683 | } | ||
| 684 | |||
| 685 | .nowrap { | ||
| 686 | overflow: hidden; | ||
| 687 | text-overflow: ellipsis; | ||
| 688 | white-space: nowrap; | ||
| 689 | } | ||
| 690 | |||
| 691 | .reTree_icon { | ||
| 692 | width: 17px; | ||
| 693 | height: 17px; | ||
| 694 | margin-right: 16px; | ||
| 695 | } | ||
| 696 | |||
| 697 | .basic_layer { | ||
| 698 | width: 100%; | ||
| 699 | position: relative; | ||
| 700 | color: #4a4a4a; | ||
| 701 | cursor: pointer; | ||
| 702 | -moz-user-select: none; | ||
| 703 | -o-user-select: none; | ||
| 704 | -khtml-user-select: none; | ||
| 705 | -webkit-user-select: none; | ||
| 706 | -ms-user-select: none; | ||
| 707 | user-select: none; | ||
| 708 | |||
| 709 | .layer_text { | ||
| 710 | flex: 1; | ||
| 711 | } | ||
| 712 | } | ||
| 713 | |||
| 714 | .white_layer { | ||
| 715 | color: black !important; | ||
| 716 | } | ||
| 717 | |||
| 718 | .first_vertical_line { | ||
| 719 | content: ""; | ||
| 720 | position: absolute; | ||
| 721 | width: 1px; | ||
| 722 | left: 6px; | ||
| 723 | top: 17px; | ||
| 724 | background: #c3c5c8; | ||
| 725 | } | ||
| 726 | |||
| 727 | .basic_banner { | ||
| 728 | position: relative; | ||
| 729 | width: 280px; | ||
| 730 | height: 40px; | ||
| 731 | } | ||
| 732 | |||
| 733 | .second_layer { | ||
| 734 | position: relative; | ||
| 735 | width: 100%; | ||
| 736 | cursor: pointer; | ||
| 737 | padding-left: 25px; | ||
| 738 | } | ||
| 739 | |||
| 740 | .second_layer::before { | ||
| 741 | content: ""; | ||
| 742 | position: absolute; | ||
| 743 | height: 1px; | ||
| 744 | width: 16px; | ||
| 745 | left: 9px; | ||
| 746 | top: 9px; | ||
| 747 | background: #c3c5c8; | ||
| 748 | } | ||
| 749 | |||
| 750 | .linkLine_default::after { | ||
| 751 | content: ""; | ||
| 752 | position: absolute; | ||
| 753 | height: 100%; | ||
| 754 | width: 1px; | ||
| 755 | left: 9px; | ||
| 756 | top: 0px; | ||
| 757 | background: #c3c5c8; | ||
| 758 | } | ||
| 759 | |||
| 760 | .linkLine_first::after { | ||
| 761 | content: ""; | ||
| 762 | position: absolute; | ||
| 763 | /* 为了触顶 */ | ||
| 764 | top: -16px; | ||
| 765 | height: calc(100% + 16px); | ||
| 766 | width: 1px; | ||
| 767 | left: 9px; | ||
| 768 | background: #c3c5c8; | ||
| 769 | } | ||
| 770 | |||
| 771 | // 上半截 | ||
| 772 | .linkLine_half_top::after { | ||
| 773 | content: ""; | ||
| 774 | position: absolute; | ||
| 775 | height: 23px; | ||
| 776 | top: -14px; | ||
| 777 | width: 1px; | ||
| 778 | left: 9px; | ||
| 779 | background: #c3c5c8; | ||
| 780 | } | ||
| 781 | |||
| 782 | .linkLine_last::after { | ||
| 783 | content: ""; | ||
| 784 | position: absolute; | ||
| 785 | height: 9px; | ||
| 786 | width: 1px; | ||
| 787 | left: 9px; | ||
| 788 | top: 0px; | ||
| 789 | background: #c3c5c8; | ||
| 790 | } | ||
| 791 | |||
| 792 | .reTree_collapse_icon { | ||
| 793 | background: url("../../assets/images/arrow-down-bold.svg") no-repeat center center; | ||
| 794 | background-size: contain; | ||
| 795 | } | ||
| 796 | |||
| 797 | .reTree_default_icon { | ||
| 798 | background: url("../../assets/images/reTree_default_.svg") no-repeat center center; | ||
| 799 | background-size: contain; | ||
| 800 | } | ||
| 801 | |||
| 802 | .reTree_expand_icon { | ||
| 803 | background: url("../../assets/images/arrow-left-bold.svg") no-repeat center center; | ||
| 804 | background-size: contain; | ||
| 805 | } | ||
| 806 | |||
| 807 | .lpbTree_collapse_icon { | ||
| 808 | // opacity: .5; | ||
| 809 | background: url("../../assets/images/lpbTree_expand_.svg") no-repeat center center; | ||
| 810 | background-size: contain; | ||
| 811 | } | ||
| 812 | |||
| 813 | .lpbTree_expand_icon { | ||
| 814 | // opacity: .5; | ||
| 815 | background: url("../../assets/images/lpbTree_collapse_.svg") no-repeat center center; | ||
| 816 | background-size: contain; | ||
| 817 | } | ||
| 818 | |||
| 819 | .reTree_focus_icon { | ||
| 820 | background: url("../../assets/images/reTree_focus_.svg") no-repeat center center; | ||
| 821 | background-size: contain; | ||
| 822 | } | ||
| 823 | |||
| 824 | /* /deep/ .importDialog{ | ||
| 825 | margin-top: 120px!important; | ||
| 826 | margin-left: 291px; | ||
| 827 | } */ | ||
| 828 | </style> |
| 1 | <template> | ||
| 2 | <div> | ||
| 3 | <ul class="importDiv" v-if="!resultDialog && !txtResultDialog && !dealDialog"> | ||
| 4 | <li> | ||
| 5 | <el-upload class="avatar-uploader" action="#" accept=".txt" :auto-upload="false" :show-file-list="false" | ||
| 6 | :on-change="txtFileChange"> | ||
| 7 | <!-- <el-button size="small" type="primary">点击上传</el-button>--> | ||
| 8 | <i class="iconfont iconshangchuan"></i> | ||
| 9 | <div class="title">TXT文本格式</div> | ||
| 10 | <div class="templateDowload"> | ||
| 11 | <a href="#" @click.stop="downloadFile('./fileTemplate/txttemplet.txt', 'txttemplet.txt')">TXT模板下载</a> | ||
| 12 | </div> | ||
| 13 | </el-upload> | ||
| 14 | </li> | ||
| 15 | <li> | ||
| 16 | <el-upload class="avatar-uploader" action="/api/tx/shpUtils/readShp" accept=".zip" :show-file-list="false" | ||
| 17 | :on-success="shpFileSuccess"> | ||
| 18 | <!--<el-button size="small" type="primary">点击上传</el-button>--> | ||
| 19 | <i class="iconfont iconshangchuan"></i> | ||
| 20 | <div class="title">ESRI Shape文件格式</div> | ||
| 21 | </el-upload> | ||
| 22 | </li> | ||
| 23 | <li> | ||
| 24 | <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/" accept=".dwg,.dxf" | ||
| 25 | :show-file-list="false" :on-success="cadFileSuccess"> | ||
| 26 | <!-- <el-button size="small" type="primary">点击上传</el-button>--> | ||
| 27 | <i class="iconfont iconshangchuan"></i> | ||
| 28 | <div class="title">CAD文件</div> | ||
| 29 | </el-upload> | ||
| 30 | </li> | ||
| 31 | <li> | ||
| 32 | <el-upload class="avatar-uploader" action="/api/tx/excelGeo/readExcel" accept=".xls,.xlsx" | ||
| 33 | :show-file-list="false" :on-success="excelFileSuccess"> | ||
| 34 | <!--<el-button size="small" type="primary">点击上传</el-button>--> | ||
| 35 | <i class="iconfont iconshangchuan"></i> | ||
| 36 | <div class="title">Excel文件格式</div> | ||
| 37 | <div class="templateDowload"> | ||
| 38 | <a href="#" | ||
| 39 | @click.stop="downloadFile('./fileTemplate/exceltemplet.xlsx', 'exceltemplet.xlsx')">Excel模板下载</a> | ||
| 40 | </div> | ||
| 41 | </el-upload> | ||
| 42 | </li> | ||
| 43 | </ul> | ||
| 44 | <div v-if="resultDialog"> | ||
| 45 | <el-form :model="zdForm" ref="zdCheckForm" label-width="100px" size="small" @submit.native.prevent | ||
| 46 | class="demo-ruleForm"> | ||
| 47 | <el-form-item label="宗地" prop="zdBsm" :rules="[ | ||
| 48 | { required: true, message: '请选择宗地', trigger: 'change' }, | ||
| 49 | ]"> | ||
| 50 | <el-select v-model="zdForm.zdBsm" filterable placeholder="请选择" @change="zdChange"> | ||
| 51 | <el-option v-for="item in resultData" :key="item.objectid" :label="item.XMMC" :value="item"> | ||
| 52 | </el-option> | ||
| 53 | </el-select> | ||
| 54 | </el-form-item> | ||
| 55 | <el-form-item> | ||
| 56 | <el-button type="primary" @click="submitForm('zdCheckForm')">导入</el-button> | ||
| 57 | <el-button @click="cancel('zdCheckForm')">取消</el-button> | ||
| 58 | </el-form-item> | ||
| 59 | </el-form> | ||
| 60 | </div> | ||
| 61 | <div v-if="txtResultDialog"> | ||
| 62 | <el-form :model="txtZd" ref="txtZdForm" label-width="100px" size="small" @submit.native.prevent | ||
| 63 | class="demo-ruleForm"> | ||
| 64 | <el-form-item label="地块名称" prop="name" :rules="[ | ||
| 65 | { required: true, message: '请选择地块', trigger: 'change' }, | ||
| 66 | ]"> | ||
| 67 | <el-select v-model="txtZd.name" filterable placeholder="请选择" @change="txtChange"> | ||
| 68 | <el-option v-for="(item, index) in txtResult" :key="index" :label="item.attributes.name" | ||
| 69 | :value="item.attributes.name"> | ||
| 70 | </el-option> | ||
| 71 | </el-select> | ||
| 72 | </el-form-item> | ||
| 73 | <el-form-item> | ||
| 74 | <el-button type="primary" @click="submitTxtForm('txtZdForm')">导入</el-button> | ||
| 75 | <el-button @click="cancelTxtForm('txtZdForm')">取消</el-button> | ||
| 76 | </el-form-item> | ||
| 77 | </el-form> | ||
| 78 | </div> | ||
| 79 | <div v-if="dealDialog"> | ||
| 80 | <el-form :model="dealForm" ref="dealForm" label-width="100px" size="small" @submit.native.prevent | ||
| 81 | class="demo-ruleForm"> | ||
| 82 | <el-form-item label="处理方法" prop="method" :rules="[ | ||
| 83 | { required: true, message: '请选择', trigger: 'change' }, | ||
| 84 | ]"> | ||
| 85 | <el-select v-model="dealForm.method" filterable placeholder="请选择"> | ||
| 86 | <el-option v-for="(item, index) in dealMethods" :key="index" :label="item.label" :value="item.value"> | ||
| 87 | </el-option> | ||
| 88 | </el-select> | ||
| 89 | </el-form-item> | ||
| 90 | <el-form-item> | ||
| 91 | <el-button type="primary" @click="submitDealForm('dealForm')">确定</el-button> | ||
| 92 | <el-button @click="cancelDealForm('dealForm')">取消</el-button> | ||
| 93 | </el-form-item> | ||
| 94 | </el-form> | ||
| 95 | </div> | ||
| 96 | </div> | ||
| 97 | </template> | ||
| 98 | <script> | ||
| 99 | import geoUtils from "@components/lineTree/tx/js/geoUtils"; | ||
| 100 | import featureUpdate from "@libs/map/featureUpdate"; | ||
| 101 | // import { addjzd, addjzx } from "@/api/zd" | ||
| 102 | export default { | ||
| 103 | props: { | ||
| 104 | propertyInfo: { | ||
| 105 | type: Object, | ||
| 106 | default: null | ||
| 107 | }, | ||
| 108 | geoInfo: { | ||
| 109 | type: Object, | ||
| 110 | default: null | ||
| 111 | }, | ||
| 112 | timeLine: { | ||
| 113 | type: Number, | ||
| 114 | default: null | ||
| 115 | } | ||
| 116 | }, | ||
| 117 | mixins: [geoUtils, featureUpdate], | ||
| 118 | data () { | ||
| 119 | return { | ||
| 120 | resultData: [], | ||
| 121 | resultDialog: false, | ||
| 122 | zdForm: { | ||
| 123 | zdBsm: "" | ||
| 124 | }, | ||
| 125 | currentClickZd: null, | ||
| 126 | txtResult: [], | ||
| 127 | txtResultDialog: null, | ||
| 128 | txtZd: { | ||
| 129 | name: "" | ||
| 130 | }, | ||
| 131 | overResults: [],//与导入宗地重叠的地块 | ||
| 132 | currntDealGraphic: null, | ||
| 133 | dealMethods: [{ | ||
| 134 | label: "不做处理", | ||
| 135 | value: "1" | ||
| 136 | }, { | ||
| 137 | label: "删除叠加部分", | ||
| 138 | value: "2" | ||
| 139 | }, { | ||
| 140 | label: "删除已重叠部分", | ||
| 141 | value: "3" | ||
| 142 | }, { | ||
| 143 | label: "删除原图形", | ||
| 144 | value: "4" | ||
| 145 | }], | ||
| 146 | dealDialog: false, | ||
| 147 | dealForm: { | ||
| 148 | method: "" | ||
| 149 | } | ||
| 150 | } | ||
| 151 | }, | ||
| 152 | watch: { | ||
| 153 | timeLine (newValue, oldValue) { | ||
| 154 | this.resultDialog = false; | ||
| 155 | this.txtResultDialog = false; | ||
| 156 | this.dealDialog = false; | ||
| 157 | } | ||
| 158 | }, | ||
| 159 | methods: { | ||
| 160 | /** | ||
| 161 | * @description: txtFileChange | ||
| 162 | * @param {*} file | ||
| 163 | * @param {*} fileList | ||
| 164 | * @author: renchao | ||
| 165 | */ | ||
| 166 | txtFileChange (file, fileList) { | ||
| 167 | var self = this; | ||
| 168 | var fileReader = new FileReader(); | ||
| 169 | fileReader.readAsText(file.raw); | ||
| 170 | fileReader.onload = function (res) { | ||
| 171 | var content = this.result; | ||
| 172 | if (!content || content.length == 0) { | ||
| 173 | self.$message.warning("文件内容为空!!!"); | ||
| 174 | return; | ||
| 175 | } | ||
| 176 | self.analysisTextFile(content); | ||
| 177 | } | ||
| 178 | }, | ||
| 179 | /** | ||
| 180 | * @description: analysisTextFile | ||
| 181 | * @param {*} content | ||
| 182 | * @author: renchao | ||
| 183 | */ | ||
| 184 | analysisTextFile (content) { | ||
| 185 | var index = content.indexOf("[地块坐标]"), | ||
| 186 | geoInfos = content.substr(index), | ||
| 187 | geoList = geoInfos.split("\n"); | ||
| 188 | if (geoList.length < 1) { | ||
| 189 | this.$message.warning("文本内容格式有误,请效验文本内容格式!!!"); | ||
| 190 | return; | ||
| 191 | } | ||
| 192 | //this.$emit("closeImportDialog"); | ||
| 193 | var features = [], attributes = {}, points = [], j = 1; | ||
| 194 | for (var i = 1; i < geoList.length; i++) { | ||
| 195 | var rowData = geoList[i]; | ||
| 196 | if ((rowData.indexOf("J") != -1 && rowData.indexOf("J") == 0) || (rowData.indexOf("j") != -1 && rowData.indexOf("j") == 0)) { | ||
| 197 | //解析坐标点信息 | ||
| 198 | var pointInfo = rowData.split(","); | ||
| 199 | var point = [parseFloat(pointInfo[2]), parseFloat(pointInfo[3])]; | ||
| 200 | points.push(point); | ||
| 201 | } else { | ||
| 202 | if (points.length > 0) { | ||
| 203 | var graphic = { | ||
| 204 | attributes: JSON.parse(JSON.stringify(attributes)), | ||
| 205 | geometry: { | ||
| 206 | rings: [points] | ||
| 207 | } | ||
| 208 | } | ||
| 209 | features.push(graphic); | ||
| 210 | } | ||
| 211 | //新建一个信息 坐标名称 类型 | ||
| 212 | attributes = {}; | ||
| 213 | points = [] | ||
| 214 | var info = rowData.split(","); | ||
| 215 | if (info[3] || info[3] == 'null') { | ||
| 216 | attributes.name = '地块' + j; | ||
| 217 | j++ | ||
| 218 | } else { | ||
| 219 | attributes.name = info[3]; | ||
| 220 | } | ||
| 221 | } | ||
| 222 | } | ||
| 223 | if (points.length > 0) { | ||
| 224 | var graphic = { | ||
| 225 | attributes: JSON.parse(JSON.stringify(attributes)), | ||
| 226 | geometry: { | ||
| 227 | rings: [[points.concat()]] | ||
| 228 | } | ||
| 229 | } | ||
| 230 | features.push(graphic); | ||
| 231 | } | ||
| 232 | //新建一个信息 坐标名称 类型 | ||
| 233 | attributes = {}; | ||
| 234 | points = [] | ||
| 235 | this.txtResult = features; | ||
| 236 | this.txtZd.name = ""; | ||
| 237 | this.txtResultDialog = true; | ||
| 238 | }, | ||
| 239 | /** | ||
| 240 | * @description: shpFileSuccess | ||
| 241 | * @param {*} response | ||
| 242 | * @param {*} file | ||
| 243 | * @param {*} fileList | ||
| 244 | * @author: renchao | ||
| 245 | */ | ||
| 246 | shpFileSuccess (response, file, fileList) { | ||
| 247 | var self = this; | ||
| 248 | if (response.success) { | ||
| 249 | this.resultData = response.result; | ||
| 250 | this.resultDialog = true; | ||
| 251 | } else { | ||
| 252 | this.$message.warning(response.message); | ||
| 253 | } | ||
| 254 | }, | ||
| 255 | /** | ||
| 256 | * @description: cadFileSuccess | ||
| 257 | * @param {*} response | ||
| 258 | * @param {*} file | ||
| 259 | * @param {*} fileList | ||
| 260 | * @author: renchao | ||
| 261 | */ | ||
| 262 | cadFileSuccess (response, file, fileList) { | ||
| 263 | |||
| 264 | }, | ||
| 265 | /** | ||
| 266 | * @description: excelFileSuccess | ||
| 267 | * @param {*} response | ||
| 268 | * @param {*} file | ||
| 269 | * @param {*} fileList | ||
| 270 | * @author: renchao | ||
| 271 | */ | ||
| 272 | excelFileSuccess (response, file, fileList) { | ||
| 273 | var self = this; | ||
| 274 | if (response.success) { | ||
| 275 | var result = response.result; | ||
| 276 | var points = []; | ||
| 277 | for (var i = 0; i < result.length; i++) { | ||
| 278 | var point = []; | ||
| 279 | point[0] = parseFloat(result[i].x); | ||
| 280 | point[1] = parseFloat(result[i].y); | ||
| 281 | points.push(point); | ||
| 282 | } | ||
| 283 | var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"; | ||
| 284 | var geometry = { | ||
| 285 | rings: [points], | ||
| 286 | spatialReference: { | ||
| 287 | wkt: wkt | ||
| 288 | }, | ||
| 289 | type: "polygon" | ||
| 290 | } | ||
| 291 | var graphic = { | ||
| 292 | attributes: null, | ||
| 293 | geometry: geometry | ||
| 294 | } | ||
| 295 | self.checkGeo(graphic); | ||
| 296 | } else { | ||
| 297 | this.$message.warning(response.message); | ||
| 298 | } | ||
| 299 | }, | ||
| 300 | /** | ||
| 301 | * @description: 文本文档导入 | ||
| 302 | * @param {*} formName | ||
| 303 | * @author: renchao | ||
| 304 | */ | ||
| 305 | submitTxtForm (formName) { | ||
| 306 | var self = this; | ||
| 307 | this.$refs[formName].validate((valid) => { | ||
| 308 | if (valid) { | ||
| 309 | var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"; | ||
| 310 | var graphics = self.txtResult.filter(item => { | ||
| 311 | return item.attributes.name == self.txtZd.name; | ||
| 312 | }) | ||
| 313 | var graphic = graphics[0]; | ||
| 314 | graphic.geometry.type = "polygon"; | ||
| 315 | graphic.geometry.spatialReference = { | ||
| 316 | wkt: wkt | ||
| 317 | } | ||
| 318 | self.checkGeo(graphic); | ||
| 319 | } else { | ||
| 320 | console.log('error submit!!'); | ||
| 321 | return false; | ||
| 322 | } | ||
| 323 | }) | ||
| 324 | }, | ||
| 325 | /** | ||
| 326 | * @description: txtChange | ||
| 327 | * @param {*} value | ||
| 328 | * @author: renchao | ||
| 329 | */ | ||
| 330 | txtChange (value) { | ||
| 331 | var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"; | ||
| 332 | var graphics = this.txtResult.filter(item => { | ||
| 333 | return item.attributes.name == value; | ||
| 334 | }) | ||
| 335 | var graphic = graphics[0]; | ||
| 336 | graphic.geometry.type = "polygon"; | ||
| 337 | graphic.geometry.spatialReference = { | ||
| 338 | wkt: wkt | ||
| 339 | } | ||
| 340 | this.addOverLayer(graphic.geometry, []); | ||
| 341 | }, | ||
| 342 | /** | ||
| 343 | * @description: 校验空间完整性 | ||
| 344 | * @param {*} graphic | ||
| 345 | * @author: renchao | ||
| 346 | */ | ||
| 347 | checkGeo (graphic) { | ||
| 348 | var self = this; | ||
| 349 | //校验完整性 直接调用空间方法 提交空间表 | ||
| 350 | self.geoJoint(graphic.geometry, function (isJoint, message) { | ||
| 351 | if (isJoint) { | ||
| 352 | self.$message.warning(message) | ||
| 353 | return; | ||
| 354 | } else { | ||
| 355 | var type = self.propertyInfo.type; | ||
| 356 | if (type == 'zd') { | ||
| 357 | //重叠分析 | ||
| 358 | self.zdOverAnalys(self.propertyInfo.zdbsm, graphic, function (flag, results) { | ||
| 359 | if (flag) { | ||
| 360 | self.$message.warning("导入的宗地与其他宗地有重叠,请处理!!"); | ||
| 361 | self.dealOverData(results, graphic); | ||
| 362 | } else { | ||
| 363 | self.saveZd(graphic); | ||
| 364 | } | ||
| 365 | }); | ||
| 366 | } else { | ||
| 367 | self.zrzOverAnalys(self.propertyInfo.bsm, graphic, function (flag, mes) { | ||
| 368 | if (flag) { | ||
| 369 | self.$message.warning(mes); | ||
| 370 | return; | ||
| 371 | } else { | ||
| 372 | self.saveZRZ(graphic); | ||
| 373 | } | ||
| 374 | }); | ||
| 375 | } | ||
| 376 | } | ||
| 377 | }); | ||
| 378 | }, | ||
| 379 | /** | ||
| 380 | * @description: 选择处理方式 | ||
| 381 | * @param {*} formName | ||
| 382 | * @author: renchao | ||
| 383 | */ | ||
| 384 | submitDealForm (formName) { | ||
| 385 | var self = this; | ||
| 386 | this.$refs[formName].validate((valid) => { | ||
| 387 | if (valid) { | ||
| 388 | //选择处理方式 | ||
| 389 | var value = self.dealForm.method; | ||
| 390 | self.currntDealGraphic.attributes = {}; | ||
| 391 | switch (value) { | ||
| 392 | case '1': self.currntDealGraphic.attributes.BGZT = 1; self.saveZd(self.currntDealGraphic); break; | ||
| 393 | case "2": self.getDifference(self.currntDealGraphic, self.overResults, self.delOverGeo); break; | ||
| 394 | case "3": self.getResultsDif(self.overResults, self.currntDealGraphic, self.delOtherGeo, true); break; | ||
| 395 | case "4": self.getResultsDif(self.overResults, self.currntDealGraphic, self.delOtherGeo, false); break; | ||
| 396 | } | ||
| 397 | } else { | ||
| 398 | console.log('error submit!!'); | ||
| 399 | return false; | ||
| 400 | } | ||
| 401 | }) | ||
| 402 | }, | ||
| 403 | /** | ||
| 404 | * @description: 裁剪自己在保存 | ||
| 405 | * @param {*} geometry | ||
| 406 | * @author: renchao | ||
| 407 | */ | ||
| 408 | delOverGeo (geometry) { | ||
| 409 | if (!this.currntDealGraphic.attributes) { | ||
| 410 | this.currntDealGraphic.attributes = {}; | ||
| 411 | } | ||
| 412 | this.currntDealGraphic.attributes.BGZT = 2; | ||
| 413 | if (geometry == null) { | ||
| 414 | this.$message.warning("完全重叠,已删除图形信息!!!") | ||
| 415 | this.currntDealGraphic.geometry = geometry; | ||
| 416 | } | ||
| 417 | this.saveZd(this.currntDealGraphic); | ||
| 418 | }, | ||
| 419 | /** | ||
| 420 | * @description: 裁剪别的在保存 | ||
| 421 | * @param {*} results | ||
| 422 | * @author: renchao | ||
| 423 | */ | ||
| 424 | delOtherGeo (results) { | ||
| 425 | //执行编辑操作 | ||
| 426 | var layer = this.getLayerByName("ZDJBXX"); | ||
| 427 | var featureUrl = layer.layerUrl.replace("MapServer", "FeatureServer"); | ||
| 428 | featureUrl += "/" + layer.id; | ||
| 429 | this.updateGraphic(featureUrl, results); | ||
| 430 | this.saveZd(this.currntDealGraphic); | ||
| 431 | }, | ||
| 432 | /** | ||
| 433 | * @description: 下载文档模板 | ||
| 434 | * @param {*} url | ||
| 435 | * @param {*} fileName | ||
| 436 | * @author: renchao | ||
| 437 | */ | ||
| 438 | downloadFile (url, fileName) { | ||
| 439 | let link = document.createElement("a"); | ||
| 440 | link.style.display = "none"; | ||
| 441 | link.href = url; | ||
| 442 | link.setAttribute("download", fileName); | ||
| 443 | document.body.appendChild(link); | ||
| 444 | link.click(); | ||
| 445 | document.body.removeChild(link); | ||
| 446 | }, | ||
| 447 | /** | ||
| 448 | * @description: 导入 | ||
| 449 | * @param {*} fileName | ||
| 450 | * @author: renchao | ||
| 451 | */ | ||
| 452 | submitForm (formName) { | ||
| 453 | //校验完整性 直接调用空间方法 提交空间表 | ||
| 454 | var self = this; | ||
| 455 | this.$refs[formName].validate((valid) => { | ||
| 456 | if (valid) { | ||
| 457 | var geometry = self.parseWktToArc(self.currentClickZd.wkt); | ||
| 458 | geometry.type = "polygon"; | ||
| 459 | var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"; | ||
| 460 | geometry.spatialReference = { | ||
| 461 | wkt: wkt | ||
| 462 | } | ||
| 463 | var graphic = { | ||
| 464 | attributes: self.currentClickZd, | ||
| 465 | geometry: geometry | ||
| 466 | } | ||
| 467 | self.checkGeo(graphic); | ||
| 468 | } else { | ||
| 469 | console.log('error submit!!'); | ||
| 470 | return false; | ||
| 471 | } | ||
| 472 | }); | ||
| 473 | }, | ||
| 474 | /** | ||
| 475 | * @description: dealOverData | ||
| 476 | * @param {*} results | ||
| 477 | * @param {*} graphic | ||
| 478 | * @author: renchao | ||
| 479 | */ | ||
| 480 | dealOverData (results, graphic) { | ||
| 481 | this.overResults = results; | ||
| 482 | this.currntDealGraphic = graphic; | ||
| 483 | this.resultDialog = false; | ||
| 484 | this.txtResultDialog = false; | ||
| 485 | this.dealDialog = true; | ||
| 486 | }, | ||
| 487 | /** | ||
| 488 | * @description: saveZd | ||
| 489 | * @param {*} graphic | ||
| 490 | * @author: renchao | ||
| 491 | */ | ||
| 492 | saveZd (graphic) { | ||
| 493 | var self = this; | ||
| 494 | var points = null, lines = null, | ||
| 495 | layer = self.getLayerByName("ZDJBXX"); | ||
| 496 | var featureUrl = layer.layerUrl.replace("MapServer", "FeatureServer"); | ||
| 497 | featureUrl += "/" + layer.id; | ||
| 498 | if (self.geoInfo) { | ||
| 499 | //替换 生成图像 高亮 | ||
| 500 | if (graphic.attributes && graphic.attributes.BGZT) { | ||
| 501 | self.geoInfo.attributes.BGZT = graphic.attributes.BGZT; | ||
| 502 | } | ||
| 503 | self.geoInfo.attributes.BSM = this.propertyInfo.zdbsm; | ||
| 504 | self.geoInfo.attributes.ZDDM = this.propertyInfo.zddm; | ||
| 505 | self.geoInfo.attributes.XMMC = this.propertyInfo.mc; | ||
| 506 | graphic.attributes = self.geoInfo.attributes; | ||
| 507 | self.updateGraphic(featureUrl, graphic, function (res) { | ||
| 508 | //保存成功之后生成界址点 界址线 | ||
| 509 | //生成坐标点 | ||
| 510 | //跳转至map界面updateResults | ||
| 511 | var updResult = res.updateFeatureResults[0]; | ||
| 512 | if (updResult.objectId) { | ||
| 513 | var OBJECTID = updResult.objectId; | ||
| 514 | if (graphic.geometry) { | ||
| 515 | points = self.craetJZPoint(graphic); | ||
| 516 | self.savejzd(points) | ||
| 517 | //生成边框线 | ||
| 518 | self.createJZLine(graphic, function (res) { | ||
| 519 | lines = res; | ||
| 520 | self.saveJzx(lines); | ||
| 521 | }); | ||
| 522 | } | ||
| 523 | self.$message.success("保存成功!!!"); | ||
| 524 | self.goMap(); | ||
| 525 | } | ||
| 526 | }); | ||
| 527 | } else { | ||
| 528 | //生成图像 保存 | ||
| 529 | var attributes = { | ||
| 530 | BSM: this.propertyInfo.zdbsm, | ||
| 531 | ZDDM: this.propertyInfo.zddm, | ||
| 532 | XMMC: this.propertyInfo.mc | ||
| 533 | }; | ||
| 534 | if (graphic.attributes && graphic.attributes.BGZT) { | ||
| 535 | attributes.BGZT = graphic.attributes.BGZT; | ||
| 536 | } | ||
| 537 | graphic.attributes = attributes; | ||
| 538 | self.addGraphic(featureUrl, graphic, function (res) { | ||
| 539 | var addRresult = res.addFeatureResults[0]; | ||
| 540 | if (addRresult.objectId) { | ||
| 541 | var OBJECTID = addRresult.objectId; | ||
| 542 | if (graphic.geometry) { | ||
| 543 | points = self.craetJZPoint(graphic); | ||
| 544 | self.savejzd(points) | ||
| 545 | //生成边框线 | ||
| 546 | self.createJZLine(graphic, function (res) { | ||
| 547 | lines = res; | ||
| 548 | self.saveJzx(lines); | ||
| 549 | }); | ||
| 550 | } | ||
| 551 | self.$message.success("保存成功!!!"); | ||
| 552 | self.goMap(); | ||
| 553 | } | ||
| 554 | }); | ||
| 555 | } | ||
| 556 | }, | ||
| 557 | /** | ||
| 558 | * @description: savejzd | ||
| 559 | * @param {*} points | ||
| 560 | * @author: renchao | ||
| 561 | */ | ||
| 562 | savejzd (points) { | ||
| 563 | var savePoints = [] | ||
| 564 | for (var i = 0; i < points.length; i++) { | ||
| 565 | var obj = { | ||
| 566 | glbsm: this.propertyInfo.zdbsm, | ||
| 567 | jzdh: points[i].jzdh, | ||
| 568 | sxh: points[i].sxh, | ||
| 569 | xzbz: points[i].x, | ||
| 570 | yzbz: points[i].y, | ||
| 571 | jblx: "", | ||
| 572 | jzdlx: "" | ||
| 573 | } | ||
| 574 | savePoints.push(obj); | ||
| 575 | } | ||
| 576 | //保存矢量数据表 | ||
| 577 | // addjzd(savePoints).then(res => { | ||
| 578 | // if (res.succcess) { | ||
| 579 | // console.log("界址点保存成成功!!!"); | ||
| 580 | // } | ||
| 581 | // }); | ||
| 582 | //保存空间数据 | ||
| 583 | |||
| 584 | }, | ||
| 585 | /** | ||
| 586 | * @description: saveJzx | ||
| 587 | * @param {*} lines | ||
| 588 | * @author: renchao | ||
| 589 | */ | ||
| 590 | saveJzx (lines) { | ||
| 591 | var jzxLines = []; | ||
| 592 | for (var i = 0; i < lines.length; i++) { | ||
| 593 | var obj = { | ||
| 594 | glbsm: this.propertyInfo.zdbsm, | ||
| 595 | qsd: lines[i].startPoint, | ||
| 596 | zzd: lines[i].endPoint, | ||
| 597 | jzjj: lines[i].distance, | ||
| 598 | qdh: lines[i].qdh, | ||
| 599 | zdh: lines[i].zdh, | ||
| 600 | jzxlx: "", | ||
| 601 | jzxwz: "", | ||
| 602 | jxxz: "", | ||
| 603 | sm: "" | ||
| 604 | } | ||
| 605 | jzxLines.push(obj); | ||
| 606 | } | ||
| 607 | //保存矢量数据表 | ||
| 608 | // addjzx(jzxLines).then(res => { | ||
| 609 | // if (res.success) { | ||
| 610 | // //触发查询界址线 | ||
| 611 | // console.log("界址线保存成功!!!!!"); | ||
| 612 | // } | ||
| 613 | // }); | ||
| 614 | //保存空间数据表 | ||
| 615 | }, | ||
| 616 | /** | ||
| 617 | * @description: saveZRZ | ||
| 618 | * @param {*} graphic | ||
| 619 | * @author: renchao | ||
| 620 | */ | ||
| 621 | saveZRZ (graphic) { | ||
| 622 | var self = this; | ||
| 623 | var layer = null; | ||
| 624 | layer = self.getLayerByName("ZRZ"); | ||
| 625 | var featureUrl = layer.layerUrl.replace("MapServer", "FeatureServer"); | ||
| 626 | featureUrl += "/" + layer.id; | ||
| 627 | if (self.geoInfo) { | ||
| 628 | self.geoInfo.BSM = self.propertyInfo.bsm; | ||
| 629 | graphic.attributes = self.geoInfo.attributes; | ||
| 630 | //替换 生成图像 高亮 | ||
| 631 | self.updateGraphic(featureUrl, graphic, function (res) { | ||
| 632 | var addRresult = res.updateFeatureResults[0]; | ||
| 633 | if (addRresult.objectId) { | ||
| 634 | self.$message.success("保存成功!!!"); | ||
| 635 | self.goMap(); | ||
| 636 | } | ||
| 637 | }); | ||
| 638 | } else { | ||
| 639 | var attributes = { | ||
| 640 | BSM: this.propertyInfo.bsm, | ||
| 641 | XMMC: this.propertyInfo.xmmc | ||
| 642 | } | ||
| 643 | graphic.attributes = attributes; | ||
| 644 | //生成图像 保存 | ||
| 645 | self.addGraphic(featureUrl, graphic, function (res) { | ||
| 646 | var addRresult = res.addFeatureResults[0]; | ||
| 647 | if (addRresult.objectId) { | ||
| 648 | self.$message.success("保存成功!!!"); | ||
| 649 | self.goMap(); | ||
| 650 | } | ||
| 651 | }); | ||
| 652 | } | ||
| 653 | }, | ||
| 654 | /** | ||
| 655 | * @description: 操作成功不需要跳转地图 (直接定位新导入的图形) | ||
| 656 | * @author: renchao | ||
| 657 | */ | ||
| 658 | goMap () { | ||
| 659 | var bsm = "", type = this.propertyInfo.type; | ||
| 660 | if (type == "zd") { | ||
| 661 | bsm = this.propertyInfo.zdbsm; | ||
| 662 | } else { | ||
| 663 | bsm = this.propertyInfo.bsm; | ||
| 664 | } | ||
| 665 | this.resultDialog = false; | ||
| 666 | this.txtResultDialog = false; | ||
| 667 | this.dealDialog = false; | ||
| 668 | this.$emit("closeImportDialog"); | ||
| 669 | //TODO 定位当前新导入的图形 | ||
| 670 | this.addGeoByBsm(bsm, type, "testMap"); | ||
| 671 | }, | ||
| 672 | /** | ||
| 673 | * @description: 取消 | ||
| 674 | * @author: renchao | ||
| 675 | */ | ||
| 676 | cancel () { | ||
| 677 | this.zdForm.zdBsm = ""; | ||
| 678 | this.currentClickZd = null; | ||
| 679 | this.resultDialog = false; | ||
| 680 | // 清空当前图层上显示的图形 | ||
| 681 | this.clearOverLayer(); | ||
| 682 | }, | ||
| 683 | /** | ||
| 684 | * @description: 取消文本选择的弹出框 | ||
| 685 | * @author: renchao | ||
| 686 | */ | ||
| 687 | cancelTxtForm () { | ||
| 688 | this.txtZd.name = ""; | ||
| 689 | this.txtResultDialog = false; | ||
| 690 | // 清空当前图层上显示的图形 | ||
| 691 | this.clearOverLayer(); | ||
| 692 | }, | ||
| 693 | /** | ||
| 694 | * @description: 取消导入处理的结果 | ||
| 695 | * @author: renchao | ||
| 696 | */ | ||
| 697 | cancelDealForm () { | ||
| 698 | this.dealForm.method = ""; | ||
| 699 | this.dealDialog = false; | ||
| 700 | this.overResults = []; | ||
| 701 | // 清空当前图层上显示的图形 | ||
| 702 | this.clearOverLayer(); | ||
| 703 | }, | ||
| 704 | /** | ||
| 705 | * @description: 宗地选择发生改变 | ||
| 706 | * @author: renchao | ||
| 707 | */ | ||
| 708 | zdChange (value) { | ||
| 709 | this.zdForm.zdBsm = value.XMMC; | ||
| 710 | this.currentClickZd = value; | ||
| 711 | var geometry = this.parseWktToArc(this.currentClickZd.wkt); | ||
| 712 | geometry.type = "polygon"; | ||
| 713 | var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"; | ||
| 714 | geometry.spatialReference = { | ||
| 715 | wkt: wkt | ||
| 716 | } | ||
| 717 | this.addOverLayer(geometry, []); | ||
| 718 | } | ||
| 719 | } | ||
| 720 | } | ||
| 721 | </script> | ||
| 722 | <style scoped lang="scss"> | ||
| 723 | .importDiv { | ||
| 724 | display: flex; | ||
| 725 | justify-content: center; | ||
| 726 | align-content: center; | ||
| 727 | |||
| 728 | li { | ||
| 729 | margin: 5px; | ||
| 730 | width: 50%; | ||
| 731 | |||
| 732 | .title { | ||
| 733 | line-height: 1; | ||
| 734 | margin-top: -57px; | ||
| 735 | font-size: 14px; | ||
| 736 | } | ||
| 737 | |||
| 738 | .templateDowload { | ||
| 739 | line-height: 1; | ||
| 740 | margin-top: 7px; | ||
| 741 | |||
| 742 | a { | ||
| 743 | color: #409eff; | ||
| 744 | } | ||
| 745 | } | ||
| 746 | } | ||
| 747 | } | ||
| 748 | |||
| 749 | /deep/ .avatar-uploader .el-upload { | ||
| 750 | border: 1px dashed #d9d9d9; | ||
| 751 | border-radius: 6px; | ||
| 752 | cursor: pointer; | ||
| 753 | position: relative; | ||
| 754 | overflow: hidden; | ||
| 755 | width: 100%; | ||
| 756 | height: 178px; | ||
| 757 | line-height: 178px; | ||
| 758 | } | ||
| 759 | |||
| 760 | /deep/ .avatar-uploader .el-upload:hover { | ||
| 761 | border-color: #409EFF; | ||
| 762 | } | ||
| 763 | |||
| 764 | /deep/ .iconfont { | ||
| 765 | font-size: 20px; | ||
| 766 | color: #8c939d; | ||
| 767 | width: 100%; | ||
| 768 | text-align: center; | ||
| 769 | } | ||
| 770 | </style> |
| 1 | /* | ||
| 2 | * @Description: | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-05-17 10:24:24 | ||
| 5 | */ | ||
| 6 | export default { | ||
| 7 | methods:{ | ||
| 8 | /** | ||
| 9 | * @description: downloadTxt | ||
| 10 | * @param {*} text | ||
| 11 | * @param {*} fileName | ||
| 12 | * @author: renchao | ||
| 13 | */ | ||
| 14 | downloadTxt(text, fileName){ | ||
| 15 | let element = document.createElement('a') | ||
| 16 | element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)) | ||
| 17 | element.setAttribute('download', fileName) | ||
| 18 | element.style.display = 'none' | ||
| 19 | element.click() | ||
| 20 | }, | ||
| 21 | /** | ||
| 22 | * @description: createTextContent | ||
| 23 | * @param {*} jzdInfo | ||
| 24 | * @author: renchao | ||
| 25 | */ | ||
| 26 | createTextContent(jzdInfo){ | ||
| 27 | var textContent = ""; | ||
| 28 | for(var i = 0;i < jzdInfo.length;i++){ | ||
| 29 | textContent += jzdInfo[i].jzdh +","+jzdInfo[i].sxh+"," + | ||
| 30 | jzdInfo[i].x+","+jzdInfo[i].y+"\n" | ||
| 31 | } | ||
| 32 | return textContent; | ||
| 33 | }, | ||
| 34 | |||
| 35 | } | ||
| 36 | } |
| 1 | /* | ||
| 2 | * @Description: 图形相关的操作 js | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-05-17 10:24:24 | ||
| 5 | */ | ||
| 6 | import layers from '@/api/json/layers.json' | ||
| 7 | import queryUtils from "@/utils/map/queryUtils"; | ||
| 8 | import identifyUtils from '@/utils/map/IdentifyUtils' | ||
| 9 | import { loadModules } from "esri-loader" | ||
| 10 | import featureUpdate from "@/utils/map/featureUpdate"; | ||
| 11 | import arcgisParser from 'terraformer-arcgis-parser' | ||
| 12 | import wktParse from 'terraformer-wkt-parser' | ||
| 13 | import { maps } from '@/utils/map/mapUtils' | ||
| 14 | import graphicSymbol from '@/api/json/graphicSymbol.json' | ||
| 15 | |||
| 16 | export default { | ||
| 17 | data () { | ||
| 18 | return { | ||
| 19 | |||
| 20 | } | ||
| 21 | }, | ||
| 22 | methods: { | ||
| 23 | /** | ||
| 24 | * @description: getLayerByName | ||
| 25 | * @param {*} name | ||
| 26 | * @author: renchao | ||
| 27 | */ | ||
| 28 | getLayerByName (name) { | ||
| 29 | for (var i = 0; i < layers.length; i++) { | ||
| 30 | if (layers[i].layerName == name) { | ||
| 31 | return layers[i]; | ||
| 32 | } | ||
| 33 | } | ||
| 34 | return null; | ||
| 35 | }, | ||
| 36 | /** | ||
| 37 | * @description: queryGeoByBsm | ||
| 38 | * @param {*} name | ||
| 39 | * @param {*} type | ||
| 40 | * @param {*} callBackFunction | ||
| 41 | * @param {*} outSpatialReference | ||
| 42 | * @author: renchao | ||
| 43 | */ | ||
| 44 | queryGeoByBsm (bsm, type, callBackFunction, outSpatialReference) { | ||
| 45 | var layer = null; | ||
| 46 | if (type == 'zd') { | ||
| 47 | layer = this.getLayerByName("ZDJBXX"); | ||
| 48 | } else if (type == 'zrz') { | ||
| 49 | layer = this.getLayerByName("ZRZ"); | ||
| 50 | } else { | ||
| 51 | console.log("未定义类型!!"); | ||
| 52 | return; | ||
| 53 | } | ||
| 54 | if (!layer) { | ||
| 55 | console.log("没有找到图层,不能查询"); | ||
| 56 | return; | ||
| 57 | } | ||
| 58 | queryUtils.methods.queryByWhere(layer.layerUrl + "/" + layer.id, { "BSM": bsm }, null, true, null, outSpatialReference, function (res) { | ||
| 59 | var features = res.features; | ||
| 60 | if (callBackFunction && typeof callBackFunction == 'function') { | ||
| 61 | callBackFunction(features); | ||
| 62 | } | ||
| 63 | }); | ||
| 64 | }, | ||
| 65 | /** | ||
| 66 | * @description: 生成介质点 | ||
| 67 | * @param {*} graphic | ||
| 68 | * @author: renchao | ||
| 69 | */ | ||
| 70 | craetJZPoint (graphic) { | ||
| 71 | var geomtry = graphic.geometry, rings = geomtry.rings[0]; | ||
| 72 | var pointInfos = []; | ||
| 73 | this.getPointByRings(rings, pointInfos); | ||
| 74 | return pointInfos; | ||
| 75 | }, | ||
| 76 | /** | ||
| 77 | * @description: getPointByRings | ||
| 78 | * @param {*} rings | ||
| 79 | * @param {*} pointInfos | ||
| 80 | * @author: renchao | ||
| 81 | */ | ||
| 82 | getPointByRings (rings, pointInfos) { | ||
| 83 | for (var i = 0; i < rings.length; i++) { | ||
| 84 | var children = rings[i]; | ||
| 85 | if (children.length == 2 && typeof children[0] == 'number') { | ||
| 86 | var obj = {}; | ||
| 87 | obj.jzdh = "j" + pointInfos.length; | ||
| 88 | obj.sxh = pointInfos.length; | ||
| 89 | obj.x = children[0]; | ||
| 90 | obj.y = children[1]; | ||
| 91 | pointInfos.push(obj); | ||
| 92 | } else { | ||
| 93 | this.getPointByRings(children, pointInfos); | ||
| 94 | } | ||
| 95 | } | ||
| 96 | }, | ||
| 97 | /** | ||
| 98 | * @description: 生成介质线 | ||
| 99 | * @param {*} graphic | ||
| 100 | * @param {*} callBackFunction | ||
| 101 | * @author: renchao | ||
| 102 | */ | ||
| 103 | createJZLine (graphic, callBackFunction) { | ||
| 104 | var self = this; | ||
| 105 | loadModules([ | ||
| 106 | "esri/geometry/support/geodesicUtils", | ||
| 107 | "esri/geometry/Point", | ||
| 108 | "esri/geometry/Polyline" | ||
| 109 | |||
| 110 | ]).then(([ | ||
| 111 | geodesicUtils, | ||
| 112 | Point, | ||
| 113 | Polyline | ||
| 114 | ]) => { | ||
| 115 | //取得各个坐标点 然后生成外围坐标线 | ||
| 116 | var geometry = graphic.geometry, | ||
| 117 | rings = geometry.rings, | ||
| 118 | points = []; | ||
| 119 | if (rings.length > 0) { | ||
| 120 | for (var i = 0; i < rings.length; i++) { | ||
| 121 | var danPoints = []; | ||
| 122 | self.getPointByRings(rings[i], danPoints); | ||
| 123 | points.push(danPoints); | ||
| 124 | } | ||
| 125 | } else { | ||
| 126 | var danPoints = []; | ||
| 127 | self.getPointByRings(rings, danPoints); | ||
| 128 | points.push(danPoints); | ||
| 129 | } | ||
| 130 | var lines = []; | ||
| 131 | //meters | ||
| 132 | for (var i = 0; i < points.length; i++) { | ||
| 133 | for (var j = 0; j < points[i].length; j++) { | ||
| 134 | if (j < (points[i].length - 1)) { | ||
| 135 | const join = geodesicUtils.geodesicDistance( | ||
| 136 | new Point({ x: points[i][j].x, y: points[i][j].y }), | ||
| 137 | new Point({ x: points[i][j + 1].x, y: points[i][j + 1].y }), | ||
| 138 | "meters" | ||
| 139 | ); | ||
| 140 | const { distance, azimuth } = join; | ||
| 141 | |||
| 142 | var obj = { | ||
| 143 | startPoint: points[i][j].x + "," + points[i][j].y, | ||
| 144 | endPoint: points[i][j + 1].x + "," + points[i][j + 1].y, | ||
| 145 | qdh: points[i][j].sxh, | ||
| 146 | zdh: points[i][j + 1].sxh, | ||
| 147 | distance: distance, | ||
| 148 | jzxlx: "", | ||
| 149 | jzxwz: "", | ||
| 150 | jzxxz: "", | ||
| 151 | remark: "" | ||
| 152 | } | ||
| 153 | lines.push(obj); | ||
| 154 | } else { | ||
| 155 | const join = geodesicUtils.geodesicDistance( | ||
| 156 | new Point({ x: points[i][j].x, y: points[i][j].y }), | ||
| 157 | new Point({ x: points[i][0].x, y: points[i][0].y }), | ||
| 158 | "meters" | ||
| 159 | ); | ||
| 160 | const { distance, azimuth } = join; | ||
| 161 | var obj = { | ||
| 162 | startPoint: points[i][j].x + "," + points[i][j].y, | ||
| 163 | endPoint: points[i][0].x + "," + points[i][0].y, | ||
| 164 | qdh: points[i][j].sxh, | ||
| 165 | zdh: points[i][0].sxh, | ||
| 166 | distance: distance, | ||
| 167 | jzxlx: "", | ||
| 168 | jzxwz: "", | ||
| 169 | jzxxz: "", | ||
| 170 | remark: "" | ||
| 171 | } | ||
| 172 | lines.push(obj); | ||
| 173 | } | ||
| 174 | } | ||
| 175 | } | ||
| 176 | if (callBackFunction && typeof callBackFunction == "function") { | ||
| 177 | callBackFunction(lines); | ||
| 178 | } | ||
| 179 | }).catch(err => { | ||
| 180 | throw (err); | ||
| 181 | }) | ||
| 182 | }, | ||
| 183 | /** | ||
| 184 | * @description: wkt转换成arcgis | ||
| 185 | * @param {*} wkt | ||
| 186 | * @author: renchao | ||
| 187 | */ | ||
| 188 | parseWktToArc (wkt) { | ||
| 189 | var primitive = wktParse.parse(wkt); | ||
| 190 | /*if(primitive.type == "MultiPolygon"){ | ||
| 191 | primitive.type = "Polygon" | ||
| 192 | }*/ | ||
| 193 | return arcgisParser.convert(primitive) | ||
| 194 | }, | ||
| 195 | /** | ||
| 196 | * @description: postionToThisGeo | ||
| 197 | * @param {*} bsm | ||
| 198 | * @param {*} type | ||
| 199 | * @author: renchao | ||
| 200 | */ | ||
| 201 | postionToThisGeo (bsm, type) { | ||
| 202 | var view = maps["testMap"]; | ||
| 203 | var layer = view.map.findLayerById("highlightLayer"); | ||
| 204 | if (layer) { | ||
| 205 | var graphics = layer.graphics; | ||
| 206 | if (graphics.length > 0 && graphics.items[0].attributes.BSM == bsm) { | ||
| 207 | // view.extent = graphics.items[0].geometry.extent; | ||
| 208 | view.center = graphics.items[0].geometry.extent.center; | ||
| 209 | view.zoom = 15; | ||
| 210 | } | ||
| 211 | } else { | ||
| 212 | this.$message.success("暂无图形信息!!!"); | ||
| 213 | } | ||
| 214 | }, | ||
| 215 | /** | ||
| 216 | * @description: 导入空间图形是 先判断数据是否跨界 | ||
| 217 | * @param {*} geometry | ||
| 218 | * @param {*} callBacFunction | ||
| 219 | * @author: renchao | ||
| 220 | */ | ||
| 221 | geoJoint (geometry, callBacFunction) { | ||
| 222 | var self = this; | ||
| 223 | loadModules([ | ||
| 224 | "esri/geometry/geometryEngine", | ||
| 225 | "esri/geometry/Polygon" | ||
| 226 | ]).then(([ | ||
| 227 | geometryEngine, | ||
| 228 | Polygon | ||
| 229 | ]) => { | ||
| 230 | var djqLayer = null, djzqLayer = null, xjzqLayer = null; | ||
| 231 | djqLayer = self.getLayerByName("DJQ"); | ||
| 232 | djzqLayer = self.getLayerByName("DJZQ"); | ||
| 233 | xjzqLayer = self.getLayerByName("XJZQ"); | ||
| 234 | var layerIds = []; | ||
| 235 | layerIds.push(djqLayer.id); | ||
| 236 | layerIds.push(djzqLayer.id); | ||
| 237 | layerIds.push(xjzqLayer.id); | ||
| 238 | var polygon = new Polygon(geometry); | ||
| 239 | identifyUtils.methods.identify(djqLayer.layerUrl, layerIds, polygon, function (res) { | ||
| 240 | var results = res.results; | ||
| 241 | var isJoint = false, layerName = "", message = ""; | ||
| 242 | if (!results || results.length == 0) { | ||
| 243 | callBacFunction(true, "不在行政区内,请检查空间位置信息!!!"); | ||
| 244 | } | ||
| 245 | for (var i = 0; i < results.length; i++) { | ||
| 246 | var feature = results[i].feature; | ||
| 247 | var flag = geometryEngine.intersects(polygon, feature.geometry); | ||
| 248 | var withinFlag = geometryEngine.within(polygon, feature.geometry); | ||
| 249 | if (!withinFlag && flag) { | ||
| 250 | isJoint = true; | ||
| 251 | layerName = results[i].layerName; | ||
| 252 | switch (layerName) { | ||
| 253 | case 'DJQ': message = "地块跨越地籍区,数据不合法!!!"; break; | ||
| 254 | case 'DJZQ': message = "地块跨越地籍子区,数据不合法!!!"; break; | ||
| 255 | case 'XJZQ': message = "地块跨越行政区,数据不合法!!!"; break; | ||
| 256 | } | ||
| 257 | break | ||
| 258 | } | ||
| 259 | } | ||
| 260 | if (callBacFunction && typeof callBacFunction == "function") { | ||
| 261 | callBacFunction(isJoint, message); | ||
| 262 | } | ||
| 263 | }, true) | ||
| 264 | }).catch(err => { | ||
| 265 | console.log(err); | ||
| 266 | throw (err); | ||
| 267 | }) | ||
| 268 | }, | ||
| 269 | /** | ||
| 270 | * @description: 保存或者编辑属性信息 | ||
| 271 | * @param {*} bsm | ||
| 272 | * @param {*} type | ||
| 273 | * @param {*} attributes | ||
| 274 | * @param {*} callBackFunction | ||
| 275 | * @param {*} ydybsm | ||
| 276 | * @author: renchao | ||
| 277 | */ | ||
| 278 | updAttributes (bsm, type, attributes, callBackFunction, ydybsm) { | ||
| 279 | var layer = null; | ||
| 280 | if (type == 'zd') { | ||
| 281 | layer = this.getLayerByName("ZDJBXX"); | ||
| 282 | } else { | ||
| 283 | layer = this.getLayerByName("ZRZ"); | ||
| 284 | } | ||
| 285 | var featureUrl = layer.layerUrl.replace("MapServer", "FeatureServer"); | ||
| 286 | featureUrl += "/" + layer.id; | ||
| 287 | this.queryGeoByBsm(ydybsm ? ydybsm : bsm, type, function (features) { | ||
| 288 | if (features && features.length > 0) { | ||
| 289 | attributes.OBJECTID = features[0].attributes.OBJECTID; | ||
| 290 | features[0].attributes = attributes; | ||
| 291 | /* var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"; | ||
| 292 | features[0].geometry.spatialReference = { | ||
| 293 | wkt:wkt | ||
| 294 | }*/ | ||
| 295 | if (ydybsm) { | ||
| 296 | features[0].attributes.BSM = ydybsm; | ||
| 297 | } | ||
| 298 | featureUpdate.methods.updateGraphic(featureUrl, features[0], callBackFunction); | ||
| 299 | } else { | ||
| 300 | var graphic = { | ||
| 301 | attributes: attributes | ||
| 302 | } | ||
| 303 | featureUpdate.methods.addGraphic(featureUrl, graphic, callBackFunction); | ||
| 304 | } | ||
| 305 | }); | ||
| 306 | }, | ||
| 307 | /** | ||
| 308 | * @description: 叠加分析 同一个图层的叠加分析 | ||
| 309 | * @param {*} bsm | ||
| 310 | * @param {*} graphic | ||
| 311 | * @param {*} callBacFunction | ||
| 312 | * @author: renchao | ||
| 313 | */ | ||
| 314 | zdOverAnalys (bsm, graphic, callBacFunction) { | ||
| 315 | var self = this; | ||
| 316 | loadModules([ | ||
| 317 | "esri/geometry/Polygon" | ||
| 318 | ]).then(([ | ||
| 319 | Polygon | ||
| 320 | ]) => { | ||
| 321 | var zdLayer = null; | ||
| 322 | zdLayer = self.getLayerByName("ZDJBXX"); | ||
| 323 | var layerIds = []; | ||
| 324 | layerIds.push(zdLayer.id); | ||
| 325 | var polygon = new Polygon(graphic.geometry); | ||
| 326 | identifyUtils.methods.identify(zdLayer.layerUrl, layerIds, polygon, function (res) { | ||
| 327 | var results = res.results; | ||
| 328 | //判断数据是否与其他数据有重叠 | ||
| 329 | var flag = false; | ||
| 330 | if (results && results.length > 0) { | ||
| 331 | flag = true; | ||
| 332 | //加载在图层上 原本的要导入的数据 和重叠数据 | ||
| 333 | self.addOverLayer(polygon, results); | ||
| 334 | } | ||
| 335 | callBacFunction(flag, results); | ||
| 336 | }, true) | ||
| 337 | }).catch(err => { | ||
| 338 | console.log(err); | ||
| 339 | throw (err); | ||
| 340 | }) | ||
| 341 | }, | ||
| 342 | /** | ||
| 343 | * @description: addOverLayer | ||
| 344 | * @param {*} geometry | ||
| 345 | * @param {*} results | ||
| 346 | * @author: renchao | ||
| 347 | */ | ||
| 348 | addOverLayer (geometry, results) { | ||
| 349 | var view = maps["testMap"]; | ||
| 350 | loadModules([ | ||
| 351 | "esri/Graphic", | ||
| 352 | "esri/geometry/Polygon", | ||
| 353 | "esri/layers/GraphicsLayer", | ||
| 354 | "esri/geometry/geometryEngineAsync", | ||
| 355 | "esri/geometry/Extent" | ||
| 356 | ]).then(([ | ||
| 357 | Graphic, | ||
| 358 | Polygon, | ||
| 359 | GraphicsLayer, | ||
| 360 | geometryEngineAsync, | ||
| 361 | Extent | ||
| 362 | ]) => { | ||
| 363 | var graphic = new Graphic({ | ||
| 364 | geometry: geometry | ||
| 365 | }) | ||
| 366 | var layer = view.map.findLayerById("overLayer"); | ||
| 367 | if (layer) { | ||
| 368 | layer.removeAll(); | ||
| 369 | } else { | ||
| 370 | layer = new GraphicsLayer({ | ||
| 371 | id: "overLayer" | ||
| 372 | }) | ||
| 373 | view.map.add(layer); | ||
| 374 | } | ||
| 375 | var impotSymbol = graphicSymbol.fillSymbol.importSymbol, | ||
| 376 | defaultSymbol = graphicSymbol.fillSymbol.defaultSymbol; | ||
| 377 | for (var i = 0; i < results.length; i++) { | ||
| 378 | var feature = results[i].feature; | ||
| 379 | feature.symbol = defaultSymbol; | ||
| 380 | layer.add(feature); | ||
| 381 | var geo = geometryEngineAsync.intersect(feature.geometry, geometry); | ||
| 382 | geo.then(function (res) { | ||
| 383 | var interGra = new Graphic({ | ||
| 384 | geometry: res, | ||
| 385 | symbol: graphicSymbol.fillSymbol.highlightSymbol | ||
| 386 | }) | ||
| 387 | layer.add(interGra); | ||
| 388 | }) | ||
| 389 | } | ||
| 390 | graphic.symbol = impotSymbol | ||
| 391 | layer.add(graphic); | ||
| 392 | var extent = new Extent(JSON.parse(JSON.stringify(graphic.geometry.extent))) | ||
| 393 | extent.spatialReference = view.spatialReference; | ||
| 394 | // view.extent = extent; | ||
| 395 | view.center = extent.center; | ||
| 396 | view.zoom = 15; | ||
| 397 | }).catch(err => { | ||
| 398 | console.log(err); | ||
| 399 | |||
| 400 | }) | ||
| 401 | }, | ||
| 402 | /** | ||
| 403 | * @description: clearOverLayer | ||
| 404 | * @author: renchao | ||
| 405 | */ | ||
| 406 | clearOverLayer () { | ||
| 407 | var view = maps["testMap"]; | ||
| 408 | var layer = view.map.findLayerById("overLayer"); | ||
| 409 | if (layer) { | ||
| 410 | layer.removeAll(); | ||
| 411 | } | ||
| 412 | }, | ||
| 413 | /** | ||
| 414 | * @description: 自然幢叠加分析 不能跨宗地 图层本身的叠加分析 | ||
| 415 | * @param {*} bsm | ||
| 416 | * @param {*} graphic | ||
| 417 | * @param {*} callBacFunction | ||
| 418 | * @author: renchao | ||
| 419 | */ | ||
| 420 | zrzOverAnalys (bsm, graphic, callBacFunction) { | ||
| 421 | var self = this; | ||
| 422 | loadModules([ | ||
| 423 | "esri/geometry/Polygon", | ||
| 424 | "esri/geometry/geometryEngine" | ||
| 425 | ]).then(([ | ||
| 426 | Polygon, | ||
| 427 | geometryEngine | ||
| 428 | ]) => { | ||
| 429 | var polygon = new Polygon(graphic.geometry); | ||
| 430 | var zdLayer = null, | ||
| 431 | zrzLayer = null; | ||
| 432 | zdLayer = self.getLayerByName("ZDJBXX"); | ||
| 433 | zrzLayer = self.getLayerByName("ZRZ"); | ||
| 434 | var layerIds = []; | ||
| 435 | layerIds.push(zdLayer.id); | ||
| 436 | layerIds.push(zrzLayer.id); | ||
| 437 | identifyUtils.methods.identify(zdLayer.layerUrl, layerIds, polygon, function (res) { | ||
| 438 | var results = res.results; | ||
| 439 | //判断数据是否与其他数据有重叠 | ||
| 440 | var flag = false, | ||
| 441 | mesge = ""; | ||
| 442 | if (results && results.length > 0) { | ||
| 443 | for (var i = 0; i < results.length; i++) { | ||
| 444 | var feature = results[i].feature, | ||
| 445 | layerName = results[i].layerName; | ||
| 446 | if (layerName == 'ZRZ') { | ||
| 447 | if (!feature.attributes['标识码'] || feature.attributes['标识码'] != bsm) { | ||
| 448 | var interFlag = geometryEngine.intersects(polygon, feature.geometry); | ||
| 449 | if (interFlag) { | ||
| 450 | flag = true; | ||
| 451 | mesge = "导入的自然幢与其他自然幢重叠,不能导入!!!"; | ||
| 452 | break; | ||
| 453 | } | ||
| 454 | } | ||
| 455 | } else if (layerName == 'ZDJBXX') { | ||
| 456 | var interFlag = geometryEngine.intersects(polygon, feature.geometry); | ||
| 457 | var withinFlag = geometryEngine.within(polygon, feature.geometry); | ||
| 458 | if (!withinFlag && interFlag) { | ||
| 459 | flag = true; | ||
| 460 | mesge = "导入的自然幢与其跨宗地,不能导入!!!"; | ||
| 461 | break; | ||
| 462 | } | ||
| 463 | } | ||
| 464 | } | ||
| 465 | } | ||
| 466 | callBacFunction(flag, mesge); | ||
| 467 | }, true) | ||
| 468 | }).catch(err => { | ||
| 469 | console.log(err); | ||
| 470 | }) | ||
| 471 | }, | ||
| 472 | /** | ||
| 473 | * @description: 去除重叠部分 | ||
| 474 | * @param {*} inputGraphic | ||
| 475 | * @param {*} subGraphic | ||
| 476 | * @param {*} callBackFuncton | ||
| 477 | * @author: renchao | ||
| 478 | */ | ||
| 479 | getDifference (inputGraphic, subGraphic, callBackFuncton) { | ||
| 480 | loadModules([ | ||
| 481 | "esri/geometry/Polygon", | ||
| 482 | "esri/geometry/geometryEngine", | ||
| 483 | "esri/Graphic" | ||
| 484 | ]).then(([ | ||
| 485 | Polygon, | ||
| 486 | geometryEngine, | ||
| 487 | Graphic | ||
| 488 | ]) => { | ||
| 489 | var inputGeometry = new Polygon(inputGraphic.geometry); | ||
| 490 | var outGeometry = null; | ||
| 491 | for (var i = 0; i < subGraphic.length; i++) { | ||
| 492 | var feature = subGraphic[i].feature; | ||
| 493 | outGeometry = geometryEngine.difference(inputGeometry, feature.geometry); | ||
| 494 | } | ||
| 495 | if (callBackFuncton && typeof callBackFuncton == 'function') { | ||
| 496 | callBackFuncton(outGeometry); | ||
| 497 | } | ||
| 498 | }).catch(err => { | ||
| 499 | console.log(err); | ||
| 500 | }) | ||
| 501 | }, | ||
| 502 | /** | ||
| 503 | * @description: 业务处理 先用query方法 查询将所有属性查询 在做空间裁剪 | ||
| 504 | * @param {*} subGraphics | ||
| 505 | * @param {*} currntGraphic | ||
| 506 | * @param {*} callBackFunction | ||
| 507 | * @param {*} flag | ||
| 508 | * @author: renchao | ||
| 509 | */ | ||
| 510 | getResultsDif (subGraphics, currntGraphic, callBackFunction, flag) { | ||
| 511 | var self = this; | ||
| 512 | loadModules([ | ||
| 513 | "esri/geometry/geometryEngine", | ||
| 514 | "esri/geometry/Polygon" | ||
| 515 | ]).then(([ | ||
| 516 | geometryEngine, | ||
| 517 | Polygon | ||
| 518 | ]) => { | ||
| 519 | var objectIds = []; | ||
| 520 | subGraphics.filter(item => { | ||
| 521 | objectIds.push(item.feature.attributes.OBJECTID); | ||
| 522 | }) | ||
| 523 | var inputGeometry = new Polygon(currntGraphic.geometry); | ||
| 524 | var zdLayer = self.getLayerByName("ZDJBXX"); | ||
| 525 | queryUtils.methods.queryByWhere(zdLayer.layerUrl + "/" + zdLayer.id, { OBJECTID: objectIds }, null, true, "", subGraphics[0].feature.geometry.spatialReference, function (result) { | ||
| 526 | var features = result.features; | ||
| 527 | if (flag) { | ||
| 528 | for (var i = 0; i < features.length; i++) { | ||
| 529 | features[i].geometry = geometryEngine.difference(features[i].geometry, inputGeometry); | ||
| 530 | features[i].attributes.BGZT = 3; | ||
| 531 | } | ||
| 532 | } else { | ||
| 533 | for (var i = 0; i < features.length; i++) { | ||
| 534 | features[i].geometry = null; | ||
| 535 | features[i].attributes.BGZT = 4; | ||
| 536 | } | ||
| 537 | } | ||
| 538 | if (callBackFunction && typeof callBackFunction == 'function') { | ||
| 539 | callBackFunction(features); | ||
| 540 | } | ||
| 541 | }) | ||
| 542 | |||
| 543 | }).catch(err => { | ||
| 544 | console.log(err); | ||
| 545 | }) | ||
| 546 | |||
| 547 | }, | ||
| 548 | /** | ||
| 549 | * @description: addGeoByBsm | ||
| 550 | * @param {*} bsm | ||
| 551 | * @param {*} type | ||
| 552 | * @param {*} viewId | ||
| 553 | * @author: renchao | ||
| 554 | */ | ||
| 555 | addGeoByBsm (bsm, type, viewId) { | ||
| 556 | var self = this; | ||
| 557 | var layer = null; | ||
| 558 | if (type == 'zd') { | ||
| 559 | layer = this.getLayerByName("ZDJBXX"); | ||
| 560 | } else if (type == 'zrz') { | ||
| 561 | layer = this.getLayerByName("ZRZ"); | ||
| 562 | } else { | ||
| 563 | console.log("未定义类型!!"); | ||
| 564 | return; | ||
| 565 | } | ||
| 566 | if (!layer) { | ||
| 567 | console.log("没有找到图层,不能查询"); | ||
| 568 | return; | ||
| 569 | } | ||
| 570 | queryUtils.methods.queryByWhere(layer.layerUrl + "/" + layer.id, { "BSM": bsm }, null, true, null, null, function (res) { | ||
| 571 | var features = res.features; | ||
| 572 | if (features && features.length > 0) { | ||
| 573 | if (!features[0].geometry || features[0].geometry.rings.length == 0) { | ||
| 574 | self.$message.success("暂无图形信息!!"); | ||
| 575 | return; | ||
| 576 | } | ||
| 577 | loadModules([ | ||
| 578 | "esri/layers/GraphicsLayer" | ||
| 579 | ]).then(([ | ||
| 580 | GraphicsLayer | ||
| 581 | ]) => { | ||
| 582 | var view = maps[viewId]; | ||
| 583 | var layer = view.map.findLayerById("highlightLayer"); | ||
| 584 | if (layer) { | ||
| 585 | layer.removeAll(); | ||
| 586 | } else { | ||
| 587 | layer = new GraphicsLayer({ | ||
| 588 | id: "highlightLayer" | ||
| 589 | }) | ||
| 590 | view.map.add(layer, 5); | ||
| 591 | } | ||
| 592 | var symbol = graphicSymbol.fillSymbol.highlightSymbol; | ||
| 593 | var graphic = features[0]; | ||
| 594 | graphic.symbol = symbol; | ||
| 595 | layer.add(graphic); | ||
| 596 | // view.extent = graphic.geometry.extent; | ||
| 597 | view.center = graphic.geometry.extent.center; | ||
| 598 | view.zoom = 15; | ||
| 599 | }).catch(err => { | ||
| 600 | thow(err); | ||
| 601 | }) | ||
| 602 | } else { | ||
| 603 | self.$message.success("暂无图形信息!!"); | ||
| 604 | return; | ||
| 605 | } | ||
| 606 | }); | ||
| 607 | }, | ||
| 608 | /** | ||
| 609 | * @description: 清空当前图层 | ||
| 610 | * @param {*} viewId | ||
| 611 | * @author: renchao | ||
| 612 | */ | ||
| 613 | clearHighlightLayer (viewId) { | ||
| 614 | var view = maps[viewId]; | ||
| 615 | var layer = view.map.findLayerById("highlightLayer"); | ||
| 616 | if (layer) { | ||
| 617 | layer.removeAll(); | ||
| 618 | } | ||
| 619 | } | ||
| 620 | } | ||
| 621 | } |
| ... | @@ -36,9 +36,18 @@ export default { | ... | @@ -36,9 +36,18 @@ export default { |
| 36 | }) | 36 | }) |
| 37 | }, | 37 | }, |
| 38 | methods: { | 38 | methods: { |
| 39 | /** | ||
| 40 | * @description: closeViewer | ||
| 41 | * @author: renchao | ||
| 42 | */ | ||
| 39 | closeViewer () { | 43 | closeViewer () { |
| 40 | this.$emit('close-viewer') | 44 | this.$emit('close-viewer') |
| 41 | }, | 45 | }, |
| 46 | /** | ||
| 47 | * @description: hideCusBtn | ||
| 48 | * @param {*} e | ||
| 49 | * @author: renchao | ||
| 50 | */ | ||
| 42 | hideCusBtn (e) { | 51 | hideCusBtn (e) { |
| 43 | let className = e.target.className | 52 | let className = e.target.className |
| 44 | if (className === 'el-icon-download') { | 53 | if (className === 'el-icon-download') { |
| ... | @@ -48,6 +57,11 @@ export default { | ... | @@ -48,6 +57,11 @@ export default { |
| 48 | this.downloadImage(imgUrl) | 57 | this.downloadImage(imgUrl) |
| 49 | } | 58 | } |
| 50 | }, | 59 | }, |
| 60 | /** | ||
| 61 | * @description: downloadImage | ||
| 62 | * @param {*} imgUrl | ||
| 63 | * @author: renchao | ||
| 64 | */ | ||
| 51 | downloadImage (imgUrl) { | 65 | downloadImage (imgUrl) { |
| 52 | let tmpArr = imgUrl.split('/') | 66 | let tmpArr = imgUrl.split('/') |
| 53 | let fileName = tmpArr[tmpArr.length - 1] | 67 | let fileName = tmpArr[tmpArr.length - 1] |
| ... | @@ -83,4 +97,4 @@ export default { | ... | @@ -83,4 +97,4 @@ export default { |
| 83 | /deep/ .el-image-viewer__close { | 97 | /deep/ .el-image-viewer__close { |
| 84 | color: #ffffff; | 98 | color: #ffffff; |
| 85 | } | 99 | } |
| 86 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 100 | </style> | ... | ... |
| ... | @@ -77,7 +77,11 @@ | ... | @@ -77,7 +77,11 @@ |
| 77 | this.autoCurrentLabel() | 77 | this.autoCurrentLabel() |
| 78 | }, | 78 | }, |
| 79 | methods: { | 79 | methods: { |
| 80 | //表格显示隐藏回调 | 80 | /** |
| 81 | * @description: 表格显示隐藏回调 | ||
| 82 | * @param {*} visible | ||
| 83 | * @author: renchao | ||
| 84 | */ | ||
| 81 | visibleChange (visible) { | 85 | visibleChange (visible) { |
| 82 | if (visible) { | 86 | if (visible) { |
| 83 | this.formData = {} | 87 | this.formData = {} |
| ... | @@ -86,7 +90,10 @@ | ... | @@ -86,7 +90,10 @@ |
| 86 | this.autoCurrentLabel() | 90 | this.autoCurrentLabel() |
| 87 | } | 91 | } |
| 88 | }, | 92 | }, |
| 89 | //获取表格数据 | 93 | /** |
| 94 | * @description: 获取表格数据 | ||
| 95 | * @author: renchao | ||
| 96 | */ | ||
| 90 | async getData () { | 97 | async getData () { |
| 91 | //表格默认赋值 | 98 | //表格默认赋值 |
| 92 | if (this.multiple) { | 99 | if (this.multiple) { |
| ... | @@ -104,11 +111,17 @@ | ... | @@ -104,11 +111,17 @@ |
| 104 | } | 111 | } |
| 105 | // this.$refs.table.setScrollTop(0) | 112 | // this.$refs.table.setScrollTop(0) |
| 106 | }, | 113 | }, |
| 107 | //插糟表单提交 | 114 | /** |
| 115 | * @description: 插糟表单提交 | ||
| 116 | * @author: renchao | ||
| 117 | */ | ||
| 108 | formSubmit () { | 118 | formSubmit () { |
| 109 | this.getData() | 119 | this.getData() |
| 110 | }, | 120 | }, |
| 111 | //自动模拟options赋值 | 121 | /** |
| 122 | * @description: 自动模拟options赋值 | ||
| 123 | * @author: renchao | ||
| 124 | */ | ||
| 112 | autoCurrentLabel () { | 125 | autoCurrentLabel () { |
| 113 | this.$nextTick(() => { | 126 | this.$nextTick(() => { |
| 114 | if (this.multiple) { | 127 | if (this.multiple) { |
| ... | @@ -122,7 +135,12 @@ | ... | @@ -122,7 +135,12 @@ |
| 122 | } | 135 | } |
| 123 | }) | 136 | }) |
| 124 | }, | 137 | }, |
| 125 | //表格勾选事件 | 138 | /** |
| 139 | * @description: 表格勾选事件 | ||
| 140 | * @param {*} rows | ||
| 141 | * @param {*} row | ||
| 142 | * @author: renchao | ||
| 143 | */ | ||
| 126 | select (rows, row) { | 144 | select (rows, row) { |
| 127 | var isSelect = rows.length && rows.indexOf(row) !== -1 | 145 | var isSelect = rows.length && rows.indexOf(row) !== -1 |
| 128 | if (isSelect) { | 146 | if (isSelect) { |
| ... | @@ -134,7 +152,11 @@ | ... | @@ -134,7 +152,11 @@ |
| 134 | this.$emit('update:modelValue', this.defaultValue); | 152 | this.$emit('update:modelValue', this.defaultValue); |
| 135 | this.$emit('change', this.defaultValue); | 153 | this.$emit('change', this.defaultValue); |
| 136 | }, | 154 | }, |
| 137 | //表格全选事件 | 155 | /** |
| 156 | * @description: 表格全选事件 | ||
| 157 | * @param {*} rows | ||
| 158 | * @author: renchao | ||
| 159 | */ | ||
| 138 | selectAll (rows) { | 160 | selectAll (rows) { |
| 139 | var isAllSelect = rows.length > 0 | 161 | var isAllSelect = rows.length > 0 |
| 140 | if (isAllSelect) { | 162 | if (isAllSelect) { |
| ... | @@ -156,6 +178,11 @@ | ... | @@ -156,6 +178,11 @@ |
| 156 | this.$emit('update:modelValue', this.defaultValue); | 178 | this.$emit('update:modelValue', this.defaultValue); |
| 157 | this.$emit('change', this.defaultValue); | 179 | this.$emit('change', this.defaultValue); |
| 158 | }, | 180 | }, |
| 181 | /** | ||
| 182 | * @description: click | ||
| 183 | * @param {*} row | ||
| 184 | * @author: renchao | ||
| 185 | */ | ||
| 159 | click (row) { | 186 | click (row) { |
| 160 | if (this.multiple) { | 187 | if (this.multiple) { |
| 161 | //处理多选点击行 | 188 | //处理多选点击行 |
| ... | @@ -168,25 +195,42 @@ | ... | @@ -168,25 +195,42 @@ |
| 168 | this.$emit('change', this.defaultValue); | 195 | this.$emit('change', this.defaultValue); |
| 169 | } | 196 | } |
| 170 | }, | 197 | }, |
| 171 | //tags删除后回调 | 198 | /** |
| 199 | * @description: tags删除后回调 | ||
| 200 | * @param {*} tag | ||
| 201 | * @author: renchao | ||
| 202 | */ | ||
| 172 | removeTag (tag) { | 203 | removeTag (tag) { |
| 173 | var row = this.findRowByKey(tag[this.defaultProps.value]) | 204 | var row = this.findRowByKey(tag[this.defaultProps.value]) |
| 174 | this.$refs.table.toggleRowSelection(row, false); | 205 | this.$refs.table.toggleRowSelection(row, false); |
| 175 | this.$emit('update:modelValue', this.defaultValue); | 206 | this.$emit('update:modelValue', this.defaultValue); |
| 176 | }, | 207 | }, |
| 177 | //清空后的回调 | 208 | /** |
| 209 | * @description: 清空后的回调 | ||
| 210 | * @author: renchao | ||
| 211 | */ | ||
| 178 | clear () { | 212 | clear () { |
| 179 | this.$emit('update:modelValue', this.defaultValue); | 213 | this.$emit('update:modelValue', this.defaultValue); |
| 180 | }, | 214 | }, |
| 181 | // 关键值查询表格数据行 | 215 | /** |
| 216 | * @description: 关键值查询表格数据行 | ||
| 217 | * @param {*} value | ||
| 218 | * @author: renchao | ||
| 219 | */ | ||
| 182 | findRowByKey (value) { | 220 | findRowByKey (value) { |
| 183 | return this.tableData.find(item => item[this.defaultProps.value] === value) | 221 | return this.tableData.find(item => item[this.defaultProps.value] === value) |
| 184 | }, | 222 | }, |
| 185 | // 触发select隐藏 | 223 | /** |
| 224 | * @description: 触发select隐藏 | ||
| 225 | * @author: renchao | ||
| 226 | */ | ||
| 186 | blur () { | 227 | blur () { |
| 187 | this.$refs.select.blur(); | 228 | this.$refs.select.blur(); |
| 188 | }, | 229 | }, |
| 189 | // 触发select显示 | 230 | /** |
| 231 | * @description: 触发select显示 | ||
| 232 | * @author: renchao | ||
| 233 | */ | ||
| 190 | focus () { | 234 | focus () { |
| 191 | this.$refs.select.focus(); | 235 | this.$refs.select.focus(); |
| 192 | } | 236 | } | ... | ... |
| ... | @@ -16,8 +16,7 @@ | ... | @@ -16,8 +16,7 @@ |
| 16 | :inline="flag" | 16 | :inline="flag" |
| 17 | :show-message="false" | 17 | :show-message="false" |
| 18 | inline-message | 18 | inline-message |
| 19 | label-width="145px" | 19 | label-width="145px"> |
| 20 | > | ||
| 21 | <div class="slxx_con" v-if="isShow" :class="flag ? 'formMarginBot0' : ''"> | 20 | <div class="slxx_con" v-if="isShow" :class="flag ? 'formMarginBot0' : ''"> |
| 22 | <div class="slxx_title title-block"> | 21 | <div class="slxx_title title-block"> |
| 23 | 补录信息 | 22 | 补录信息 |
| ... | @@ -44,7 +43,7 @@ | ... | @@ -44,7 +43,7 @@ |
| 44 | 房地产权(独幢、层、套、间房屋) | 43 | 房地产权(独幢、层、套、间房屋) |
| 45 | <div class="triangle"></div> | 44 | <div class="triangle"></div> |
| 46 | </div> | 45 | </div> |
| 47 | <el-row :gutter="10" class="ssqlxx"> | 46 | <el-row :gutter="10" class="ssqlxx"> |
| 48 | <el-col :span="24" v-if="ssqlxxshow"> | 47 | <el-col :span="24" v-if="ssqlxxshow"> |
| 49 | <el-form-item label="上手权利信息:"> | 48 | <el-form-item label="上手权利信息:"> |
| 50 | <select-table | 49 | <select-table |
| ... | @@ -52,18 +51,15 @@ | ... | @@ -52,18 +51,15 @@ |
| 52 | :table-width="550" | 51 | :table-width="550" |
| 53 | :tableData="ssQlxxList" | 52 | :tableData="ssQlxxList" |
| 54 | :props="props" | 53 | :props="props" |
| 55 | @change="ssQlxxchange" | 54 | @change="ssQlxxchange"> |
| 56 | > | ||
| 57 | <el-table-column | 55 | <el-table-column |
| 58 | prop="qllxmc" | 56 | prop="qllxmc" |
| 59 | width="130" | 57 | width="130" |
| 60 | label="权利类型" | 58 | label="权利类型"></el-table-column> |
| 61 | ></el-table-column> | ||
| 62 | <el-table-column | 59 | <el-table-column |
| 63 | prop="bdcqzh" | 60 | prop="bdcqzh" |
| 64 | width="160" | 61 | width="160" |
| 65 | label="不动产权证书" | 62 | label="不动产权证书"></el-table-column> |
| 66 | ></el-table-column> | ||
| 67 | <el-table-column prop="qlrmc" label="权利人"></el-table-column> | 63 | <el-table-column prop="qlrmc" label="权利人"></el-table-column> |
| 68 | <el-table-column prop="mjmc" label="面积"></el-table-column> | 64 | <el-table-column prop="mjmc" label="面积"></el-table-column> |
| 69 | <el-table-column prop="ytmc" label="用途"></el-table-column> | 65 | <el-table-column prop="ytmc" label="用途"></el-table-column> |
| ... | @@ -102,8 +98,7 @@ | ... | @@ -102,8 +98,7 @@ |
| 102 | v-for="item in djlxlist" | 98 | v-for="item in djlxlist" |
| 103 | :key="item.dcode" | 99 | :key="item.dcode" |
| 104 | :label="item.dname" | 100 | :label="item.dname" |
| 105 | :value="item.dcode" | 101 | :value="item.dcode"> |
| 106 | > | ||
| 107 | </el-option> | 102 | </el-option> |
| 108 | </el-select> | 103 | </el-select> |
| 109 | </el-form-item> | 104 | </el-form-item> |
| ... | @@ -137,8 +132,7 @@ | ... | @@ -137,8 +132,7 @@ |
| 137 | placeholder="" | 132 | placeholder="" |
| 138 | :normalizer="normalizer" | 133 | :normalizer="normalizer" |
| 139 | :show-count="true" | 134 | :show-count="true" |
| 140 | :options="dictData['A9']" | 135 | :options="dictData['A9']" /> |
| 141 | /> | ||
| 142 | </el-form-item> | 136 | </el-form-item> |
| 143 | </el-col> | 137 | </el-col> |
| 144 | <el-col :span="8"> | 138 | <el-col :span="8"> |
| ... | @@ -146,15 +140,13 @@ | ... | @@ -146,15 +140,13 @@ |
| 146 | <div style="display: flex"> | 140 | <div style="display: flex"> |
| 147 | <el-input | 141 | <el-input |
| 148 | v-model="ruleForm.fdcq2.qjjg" | 142 | v-model="ruleForm.fdcq2.qjjg" |
| 149 | style="width: 500%" | 143 | style="width: 500%"></el-input> |
| 150 | ></el-input> | ||
| 151 | <el-select v-model="ruleForm.fdcq2.jedw"> | 144 | <el-select v-model="ruleForm.fdcq2.jedw"> |
| 152 | <el-option | 145 | <el-option |
| 153 | v-for="item in dictData['A57']" | 146 | v-for="item in dictData['A57']" |
| 154 | :key="item.dcode" | 147 | :key="item.dcode" |
| 155 | :label="item.dname" | 148 | :label="item.dname" |
| 156 | :value="item.dcode" | 149 | :value="item.dcode"> |
| 157 | > | ||
| 158 | </el-option> | 150 | </el-option> |
| 159 | </el-select> | 151 | </el-select> |
| 160 | </div> | 152 | </div> |
| ... | @@ -167,8 +159,7 @@ | ... | @@ -167,8 +159,7 @@ |
| 167 | v-for="item in qsztlist" | 159 | v-for="item in qsztlist" |
| 168 | :key="item.dcode" | 160 | :key="item.dcode" |
| 169 | :label="item.dname" | 161 | :label="item.dname" |
| 170 | :value="item.dcode" | 162 | :value="item.dcode"> |
| 171 | > | ||
| 172 | </el-option> | 163 | </el-option> |
| 173 | </el-select> | 164 | </el-select> |
| 174 | </el-form-item> | 165 | </el-form-item> |
| ... | @@ -180,8 +171,7 @@ | ... | @@ -180,8 +171,7 @@ |
| 180 | v-for="item in dictData['A17']" | 171 | v-for="item in dictData['A17']" |
| 181 | :key="item.dcode" | 172 | :key="item.dcode" |
| 182 | :label="item.dname" | 173 | :label="item.dname" |
| 183 | :value="item.dcode" | 174 | :value="item.dcode"> |
| 184 | > | ||
| 185 | </el-option> | 175 | </el-option> |
| 186 | </el-select> | 176 | </el-select> |
| 187 | </el-form-item> | 177 | </el-form-item> |
| ... | @@ -203,8 +193,7 @@ | ... | @@ -203,8 +193,7 @@ |
| 203 | v-for="item in dictData['A19']" | 193 | v-for="item in dictData['A19']" |
| 204 | :key="item.dcode" | 194 | :key="item.dcode" |
| 205 | :label="item.dname" | 195 | :label="item.dname" |
| 206 | :value="item.dcode" | 196 | :value="item.dcode"> |
| 207 | > | ||
| 208 | </el-option> | 197 | </el-option> |
| 209 | </el-select> | 198 | </el-select> |
| 210 | </el-form-item> | 199 | </el-form-item> |
| ... | @@ -213,15 +202,13 @@ | ... | @@ -213,15 +202,13 @@ |
| 213 | <el-form-item | 202 | <el-form-item |
| 214 | label="房屋结构:" | 203 | label="房屋结构:" |
| 215 | prop="fdcq2.fwjg" | 204 | prop="fdcq2.fwjg" |
| 216 | :rules="rules.fwjgrules" | 205 | :rules="rules.fwjgrules"> |
| 217 | > | ||
| 218 | <el-select v-model="ruleForm.fdcq2.fwjg"> | 206 | <el-select v-model="ruleForm.fdcq2.fwjg"> |
| 219 | <el-option | 207 | <el-option |
| 220 | v-for="item in dictData['A46']" | 208 | v-for="item in dictData['A46']" |
| 221 | :key="item.dcode" | 209 | :key="item.dcode" |
| 222 | :label="item.dname" | 210 | :label="item.dname" |
| 223 | :value="item.dcode" | 211 | :value="item.dcode"> |
| 224 | > | ||
| 225 | </el-option> | 212 | </el-option> |
| 226 | </el-select> | 213 | </el-select> |
| 227 | </el-form-item> | 214 | </el-form-item> |
| ... | @@ -261,8 +248,7 @@ | ... | @@ -261,8 +248,7 @@ |
| 261 | <el-form-item | 248 | <el-form-item |
| 262 | label="不动产权证号:" | 249 | label="不动产权证号:" |
| 263 | prop="qlxx.bdcqzh" | 250 | prop="qlxx.bdcqzh" |
| 264 | :rules="rules.bdcqzhrules" | 251 | :rules="rules.bdcqzhrules"> |
| 265 | > | ||
| 266 | <el-input v-model="ruleForm.qlxx.bdcqzh"></el-input> | 252 | <el-input v-model="ruleForm.qlxx.bdcqzh"></el-input> |
| 267 | </el-form-item> | 253 | </el-form-item> |
| 268 | </el-col> | 254 | </el-col> |
| ... | @@ -279,8 +265,7 @@ | ... | @@ -279,8 +265,7 @@ |
| 279 | <el-form-item | 265 | <el-form-item |
| 280 | label="登记机构:" | 266 | label="登记机构:" |
| 281 | prop="qlxx.djjg" | 267 | prop="qlxx.djjg" |
| 282 | :rules="rules.djjgrules" | 268 | :rules="rules.djjgrules"> |
| 283 | > | ||
| 284 | <el-input v-model="ruleForm.qlxx.djjg"></el-input> | 269 | <el-input v-model="ruleForm.qlxx.djjg"></el-input> |
| 285 | </el-form-item> | 270 | </el-form-item> |
| 286 | </el-col> | 271 | </el-col> |
| ... | @@ -288,8 +273,7 @@ | ... | @@ -288,8 +273,7 @@ |
| 288 | <el-form-item | 273 | <el-form-item |
| 289 | label="登簿人:" | 274 | label="登簿人:" |
| 290 | prop="qlxx.dbr" | 275 | prop="qlxx.dbr" |
| 291 | :rules="rules.dbrrules" | 276 | :rules="rules.dbrrules"> |
| 292 | > | ||
| 293 | <el-input v-model="ruleForm.qlxx.dbr"></el-input> | 277 | <el-input v-model="ruleForm.qlxx.dbr"></el-input> |
| 294 | </el-form-item> | 278 | </el-form-item> |
| 295 | </el-col> | 279 | </el-col> |
| ... | @@ -297,15 +281,13 @@ | ... | @@ -297,15 +281,13 @@ |
| 297 | <el-form-item | 281 | <el-form-item |
| 298 | label="登记时间:" | 282 | label="登记时间:" |
| 299 | prop="qlxx.djsj" | 283 | prop="qlxx.djsj" |
| 300 | :rules="rules.djsjrules" | 284 | :rules="rules.djsjrules"> |
| 301 | > | ||
| 302 | <el-date-picker | 285 | <el-date-picker |
| 303 | v-model="ruleForm.qlxx.djsj" | 286 | v-model="ruleForm.qlxx.djsj" |
| 304 | type="date" | 287 | type="date" |
| 305 | placeholder="选择日期" | 288 | placeholder="选择日期" |
| 306 | value-format="yyyy-MM-dd HH:mm:ss" | 289 | value-format="yyyy-MM-dd HH:mm:ss" |
| 307 | format="yyyy-MM-dd" | 290 | format="yyyy-MM-dd"> |
| 308 | > | ||
| 309 | </el-date-picker> | 291 | </el-date-picker> |
| 310 | </el-form-item> | 292 | </el-form-item> |
| 311 | </el-col> | 293 | </el-col> |
| ... | @@ -331,8 +313,7 @@ | ... | @@ -331,8 +313,7 @@ |
| 331 | <tdytTable | 313 | <tdytTable |
| 332 | :tableData="ruleForm.tdytqxList" | 314 | :tableData="ruleForm.tdytqxList" |
| 333 | @upDateTdytxxList="upDateTdytxxList" | 315 | @upDateTdytxxList="upDateTdytxxList" |
| 334 | :ableOperation="ableOperation" | 316 | :ableOperation="ableOperation" /> |
| 335 | /> | ||
| 336 | <div class="slxx_title title-block"> | 317 | <div class="slxx_title title-block"> |
| 337 | 权利人信息 | 318 | 权利人信息 |
| 338 | <div class="triangle"></div> | 319 | <div class="triangle"></div> |
| ... | @@ -340,10 +321,9 @@ | ... | @@ -340,10 +321,9 @@ |
| 340 | <el-row :gutter="10"> | 321 | <el-row :gutter="10"> |
| 341 | <el-col :span="12"> | 322 | <el-col :span="12"> |
| 342 | <el-form-item label="共有方式:"> | 323 | <el-form-item label="共有方式:"> |
| 343 | <el-radio-group | 324 | <el-radio-group |
| 344 | :disabled="!ableOperation" | 325 | :disabled="!ableOperation" |
| 345 | v-model="ruleForm.qlxx.gyfs" | 326 | v-model="ruleForm.qlxx.gyfs"> |
| 346 | > | ||
| 347 | <el-radio label="0">单独所有</el-radio> | 327 | <el-radio label="0">单独所有</el-radio> |
| 348 | <el-radio label="1">共同共有</el-radio> | 328 | <el-radio label="1">共同共有</el-radio> |
| 349 | <el-radio label="2">按份所有</el-radio> | 329 | <el-radio label="2">按份所有</el-radio> |
| ... | @@ -357,8 +337,7 @@ | ... | @@ -357,8 +337,7 @@ |
| 357 | @upDateQlrxxList="upDateQlrxxList" | 337 | @upDateQlrxxList="upDateQlrxxList" |
| 358 | :ableOperation="ableOperation" | 338 | :ableOperation="ableOperation" |
| 359 | :key="key" | 339 | :key="key" |
| 360 | :gyfs="ruleForm.qlxx.gyfs" | 340 | :gyfs="ruleForm.qlxx.gyfs" /> |
| 361 | /> | ||
| 362 | </div> | 341 | </div> |
| 363 | <el-row class="btn" v-if="ableOperation"> | 342 | <el-row class="btn" v-if="ableOperation"> |
| 364 | <el-form-item> | 343 | <el-form-item> |
| ... | @@ -369,261 +348,261 @@ | ... | @@ -369,261 +348,261 @@ |
| 369 | </div> | 348 | </div> |
| 370 | </template> | 349 | </template> |
| 371 | <script> | 350 | <script> |
| 372 | import { mapGetters } from "vuex"; | 351 | import { mapGetters } from "vuex"; |
| 373 | import { init,getSsQlxx, save } from "@/api/djbRepair.js"; | 352 | import { init, getSsQlxx, save } from "@/api/djbRepair.js"; |
| 374 | import qlrCommonTable from "@/views/djbworkflow/components/qlrCommonTable"; | 353 | import qlrCommonTable from "@/views/djbworkflow/components/qlrCommonTable"; |
| 375 | import selectTable from "@/components/selectTable/index.vue"; | 354 | import selectTable from "@/components/selectTable/index.vue"; |
| 376 | import tdytTable from "@/views/workflow/components/tdytTable"; | 355 | import tdytTable from "@/views/workflow/components/tdytTable"; |
| 377 | // import the component | 356 | // import the component |
| 378 | // import Treeselect from '@riophae/vue-treeselect' | 357 | // import Treeselect from '@riophae/vue-treeselect' |
| 379 | // // import the styles | 358 | // // import the styles |
| 380 | // import '@riophae/vue-treeselect/dist/vue-treeselect.css' | 359 | // import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
| 381 | export default { | 360 | export default { |
| 382 | components: { qlrCommonTable, tdytTable,selectTable}, | 361 | components: { qlrCommonTable, tdytTable, selectTable }, |
| 383 | computed: { | 362 | computed: { |
| 384 | ...mapGetters(["dictData", "flag"]), | 363 | ...mapGetters(["dictData", "flag"]), |
| 385 | // 根据流程判断表单是否为只读 | 364 | // 根据流程判断表单是否为只读 |
| 386 | editDisabled() { | 365 | editDisabled () { |
| 387 | if (!this.ableOperation) { | 366 | if (!this.ableOperation) { |
| 388 | //只读状态 | 367 | //只读状态 |
| 389 | return true; | 368 | return true; |
| 390 | } | ||
| 391 | return false; | ||
| 392 | }, | ||
| 393 | }, | ||
| 394 | data() { | ||
| 395 | return { | ||
| 396 | ssqlxxshow:true, | ||
| 397 | props: { | ||
| 398 | label: "bdcqzh", | ||
| 399 | value: "bdcdyid", | ||
| 400 | }, | ||
| 401 | // 键名转换,方法默认是label和children进行树状渲染 | ||
| 402 | normalizer(node) { | ||
| 403 | //方法 | ||
| 404 | if (node.children == null || node.children == "null") { | ||
| 405 | delete node.children; | ||
| 406 | } | 369 | } |
| 407 | return { | 370 | return false; |
| 408 | id: node.dcode, | ||
| 409 | label: node.dname, | ||
| 410 | }; | ||
| 411 | }, | 371 | }, |
| 412 | 372 | }, | |
| 413 | //表单是否可操作 | 373 | data () { |
| 414 | propsParam: this.$attrs, | 374 | return { |
| 415 | // 登记类型 | 375 | ssqlxxshow: true, |
| 416 | djlxlist: [ | 376 | props: { |
| 417 | { | 377 | label: "bdcqzh", |
| 418 | dcode: "100", | 378 | value: "bdcdyid", |
| 419 | dname: "首次登记", | ||
| 420 | }, | ||
| 421 | { | ||
| 422 | dcode: "200", | ||
| 423 | dname: "转移登记", | ||
| 424 | }, | ||
| 425 | { | ||
| 426 | dcode: "300", | ||
| 427 | dname: "变更登记", | ||
| 428 | }, | 379 | }, |
| 429 | { | 380 | // 键名转换,方法默认是label和children进行树状渲染 |
| 430 | dcode: "500", | 381 | normalizer (node) { |
| 431 | dname: "更正登记", | 382 | //方法 |
| 383 | if (node.children == null || node.children == "null") { | ||
| 384 | delete node.children; | ||
| 385 | } | ||
| 386 | return { | ||
| 387 | id: node.dcode, | ||
| 388 | label: node.dname, | ||
| 389 | }; | ||
| 432 | }, | 390 | }, |
| 433 | 391 | ||
| 434 | { | 392 | //表单是否可操作 |
| 435 | dcode: "901", | 393 | propsParam: this.$attrs, |
| 436 | dname: "补证", | 394 | // 登记类型 |
| 437 | }, | 395 | djlxlist: [ |
| 438 | { | 396 | { |
| 439 | dcode: "902", | 397 | dcode: "100", |
| 440 | dname: "换证", | 398 | dname: "首次登记", |
| 441 | }, | 399 | }, |
| 442 | ], | 400 | { |
| 443 | // 权属状态 | 401 | dcode: "200", |
| 444 | qsztlist: [ | 402 | dname: "转移登记", |
| 445 | { | 403 | }, |
| 446 | dcode: "1", | 404 | { |
| 447 | dname: "现势", | 405 | dcode: "300", |
| 448 | }, | 406 | dname: "变更登记", |
| 449 | { | 407 | }, |
| 450 | dcode: "2", | 408 | { |
| 451 | dname: "历史", | 409 | dcode: "500", |
| 452 | }, | 410 | dname: "更正登记", |
| 453 | ], | 411 | }, |
| 454 | key: 0, | 412 | |
| 455 | tdxz: null, | 413 | { |
| 456 | isShow: false, | 414 | dcode: "901", |
| 457 | disabled: true, | 415 | dname: "补证", |
| 458 | czrOptions: [], | 416 | }, |
| 459 | ssQlxxList: [], | 417 | { |
| 460 | ruleForm: {}, | 418 | dcode: "902", |
| 461 | ableOperation: false, | 419 | dname: "换证", |
| 462 | //传递参数\ | 420 | }, |
| 463 | rules: { | ||
| 464 | bdcqzhrules: [ | ||
| 465 | { required: true, message: "不动产权证号:", trigger: "blur" }, | ||
| 466 | ], | 421 | ], |
| 467 | // qxdmrules: [{ required: true, message: "区县代码", trigger: "blur" }], | 422 | // 权属状态 |
| 468 | djjgrules: [{ required: true, message: "登记机构", trigger: "blur" }], | 423 | qsztlist: [ |
| 469 | dbrrules: [{ required: true, message: "登簿人", trigger: "blur" }], | 424 | { |
| 470 | djsjrules: [{ required: true, message: "登记时间", trigger: "blur" }], | 425 | dcode: "1", |
| 471 | fwjgrules: [{ required: true, message: "房屋结构", trigger: "change" }], | 426 | dname: "现势", |
| 472 | djlxrules: [{ required: true, message: "登记类型", trigger: "change" }], | 427 | }, |
| 473 | }, | 428 | { |
| 474 | }; | 429 | dcode: "2", |
| 475 | }, | 430 | dname: "历史", |
| 476 | created() {}, | 431 | }, |
| 477 | mounted() { | 432 | ], |
| 478 | this.loadData(); | 433 | key: 0, |
| 479 | this.ableOperation = this.$parent.ableOperation; | 434 | tdxz: null, |
| 480 | }, | 435 | isShow: false, |
| 481 | methods: { | 436 | disabled: true, |
| 482 | ssQlxxchange(val) { | 437 | czrOptions: [], |
| 483 | this.ruleForm.ssQlxx = val; | 438 | ssQlxxList: [], |
| 484 | this.ruleForm.qlxx.ssywh = val.ssywh; | 439 | ruleForm: {}, |
| 440 | ableOperation: false, | ||
| 441 | //传递参数\ | ||
| 442 | rules: { | ||
| 443 | bdcqzhrules: [ | ||
| 444 | { required: true, message: "不动产权证号:", trigger: "blur" }, | ||
| 445 | ], | ||
| 446 | // qxdmrules: [{ required: true, message: "区县代码", trigger: "blur" }], | ||
| 447 | djjgrules: [{ required: true, message: "登记机构", trigger: "blur" }], | ||
| 448 | dbrrules: [{ required: true, message: "登簿人", trigger: "blur" }], | ||
| 449 | djsjrules: [{ required: true, message: "登记时间", trigger: "blur" }], | ||
| 450 | fwjgrules: [{ required: true, message: "房屋结构", trigger: "change" }], | ||
| 451 | djlxrules: [{ required: true, message: "登记类型", trigger: "change" }], | ||
| 452 | }, | ||
| 453 | }; | ||
| 485 | }, | 454 | }, |
| 486 | djlxchange(val) { | 455 | created () { }, |
| 487 | console.log("val",val); | 456 | mounted () { |
| 488 | if (val == null || val == 100) { | 457 | this.loadData(); |
| 489 | this.ssqlxxshow = false; | 458 | this.ableOperation = this.$parent.ableOperation; |
| 490 | } else { | ||
| 491 | this.ssqlxxshow = true; | ||
| 492 | } | ||
| 493 | }, | 459 | }, |
| 460 | methods: { | ||
| 461 | ssQlxxchange (val) { | ||
| 462 | this.ruleForm.ssQlxx = val; | ||
| 463 | this.ruleForm.qlxx.ssywh = val.ssywh; | ||
| 464 | }, | ||
| 465 | djlxchange (val) { | ||
| 466 | console.log("val", val); | ||
| 467 | if (val == null || val == 100) { | ||
| 468 | this.ssqlxxshow = false; | ||
| 469 | } else { | ||
| 470 | this.ssqlxxshow = true; | ||
| 471 | } | ||
| 472 | }, | ||
| 494 | 473 | ||
| 495 | loadData() { | 474 | loadData () { |
| 496 | this.$startLoading(); | 475 | this.$startLoading(); |
| 497 | this.propsParam.isEdit = this.$parent.isEdit; | 476 | this.propsParam.isEdit = this.$parent.isEdit; |
| 498 | init(this.propsParam).then((res) => { | 477 | init(this.propsParam).then((res) => { |
| 499 | if (res.code == 200) { | 478 | if (res.code == 200) { |
| 500 | this.ruleForm = res.result; | 479 | this.ruleForm = res.result; |
| 501 | let djlx = this.ruleForm.qlxx.djlx; | 480 | let djlx = this.ruleForm.qlxx.djlx; |
| 502 | if (djlx == null || djlx == 100) { | 481 | if (djlx == null || djlx == 100) { |
| 503 | this.ssqlxxshow = false; | 482 | this.ssqlxxshow = false; |
| 504 | } | 483 | } |
| 505 | this.$endLoading(); | 484 | this.$endLoading(); |
| 506 | if (this.ruleForm.tdytqxList.length > 0) { | 485 | if (this.ruleForm.tdytqxList.length > 0) { |
| 507 | this.tdxz = this.ruleForm.tdytqxList[0].qlxzbm; | 486 | this.tdxz = this.ruleForm.tdytqxList[0].qlxzbm; |
| 508 | 487 | ||
| 509 | } else { | 488 | } else { |
| 510 | this.tdxz = null; | 489 | this.tdxz = null; |
| 490 | } | ||
| 491 | this.isShow = true; | ||
| 511 | } | 492 | } |
| 512 | this.isShow = true; | 493 | }); |
| 513 | } | ||
| 514 | }); | ||
| 515 | //获取主体信息 | 494 | //获取主体信息 |
| 516 | getSsQlxx({ | 495 | getSsQlxx({ |
| 517 | bdcdyid: this.propsParam.bdcdyid, | 496 | bdcdyid: this.propsParam.bdcdyid, |
| 518 | qllx: this.propsParam.qllx, | 497 | qllx: this.propsParam.qllx, |
| 519 | }).then((res) => { | 498 | }).then((res) => { |
| 520 | if (res.code == 200) { | 499 | if (res.code == 200) { |
| 521 | this.ssQlxxList = res.result; | 500 | this.ssQlxxList = res.result; |
| 522 | } | ||
| 523 | }); | ||
| 524 | }, | ||
| 525 | // 更新土地用途信息 | ||
| 526 | upDateTdytxxList(val) { | ||
| 527 | this.ruleForm.tdytqxList && (this.ruleForm.tdytqxList = _.cloneDeep(val)); | ||
| 528 | this.key++; | ||
| 529 | }, | ||
| 530 | // 更新权利人信息 | ||
| 531 | upDateQlrxxList(val) { | ||
| 532 | this.ruleForm.qlrData && (this.ruleForm.qlrData = _.cloneDeep(val)); | ||
| 533 | this.czrOptions = this.ruleForm.qlrData; | ||
| 534 | this.key++; | ||
| 535 | }, | ||
| 536 | // 更新义务人信息 | ||
| 537 | upDateYwrxxList(val) { | ||
| 538 | this.ruleForm.ywrData && (this.ruleForm.ywrData = _.cloneDeep(val)); | ||
| 539 | this.key++; | ||
| 540 | }, | ||
| 541 | onSubmit() { | ||
| 542 | this.$refs.ruleForm.validate((valid) => { | ||
| 543 | if (valid) { | ||
| 544 | if (this.ruleForm.qlrData.length == 0) { | ||
| 545 | this.$message({ | ||
| 546 | showClose: true, | ||
| 547 | message: "请确认权利人信息", | ||
| 548 | type: "error", | ||
| 549 | }); | ||
| 550 | return false; | ||
| 551 | } | ||
| 552 | if (this.ruleForm.tdytqxList.length == 0 && !this.tdxz) { | ||
| 553 | this.$message({ | ||
| 554 | showClose: true, | ||
| 555 | message: "请补充土地用途信息", | ||
| 556 | type: "error", | ||
| 557 | }); | ||
| 558 | return false; | ||
| 559 | } | ||
| 560 | if (!this.tdxz) { | ||
| 561 | this.$message({ | ||
| 562 | showClose: true, | ||
| 563 | message: "请补充土地性质", | ||
| 564 | type: "error", | ||
| 565 | }); | ||
| 566 | return false; | ||
| 567 | } | 501 | } |
| 568 | this.ruleForm.tdytqxList = this.ruleForm.tdytqxList.map((item) => { | 502 | }); |
| 569 | return { | 503 | }, |
| 570 | ...item, | 504 | // 更新土地用途信息 |
| 571 | qlxzbm: this.tdxz, | 505 | upDateTdytxxList (val) { |
| 572 | }; | 506 | this.ruleForm.tdytqxList && (this.ruleForm.tdytqxList = _.cloneDeep(val)); |
| 573 | }); | 507 | this.key++; |
| 574 | if (this.ruleForm.qlxx.gyfs == "0") { | 508 | }, |
| 575 | if (this.ruleForm.qlrData.length > 1) { | 509 | // 更新权利人信息 |
| 510 | upDateQlrxxList (val) { | ||
| 511 | this.ruleForm.qlrData && (this.ruleForm.qlrData = _.cloneDeep(val)); | ||
| 512 | this.czrOptions = this.ruleForm.qlrData; | ||
| 513 | this.key++; | ||
| 514 | }, | ||
| 515 | // 更新义务人信息 | ||
| 516 | upDateYwrxxList (val) { | ||
| 517 | this.ruleForm.ywrData && (this.ruleForm.ywrData = _.cloneDeep(val)); | ||
| 518 | this.key++; | ||
| 519 | }, | ||
| 520 | onSubmit () { | ||
| 521 | this.$refs.ruleForm.validate((valid) => { | ||
| 522 | if (valid) { | ||
| 523 | if (this.ruleForm.qlrData.length == 0) { | ||
| 576 | this.$message({ | 524 | this.$message({ |
| 577 | showClose: true, | 525 | showClose: true, |
| 578 | message: "共有方式:单独所有,权利人只能是一个人", | 526 | message: "请确认权利人信息", |
| 579 | type: "error", | 527 | type: "error", |
| 580 | }); | 528 | }); |
| 581 | return false; | 529 | return false; |
| 582 | } | 530 | } |
| 583 | this.ruleForm.qlrData[0].sfczr = "1"; | 531 | if (this.ruleForm.tdytqxList.length == 0 && !this.tdxz) { |
| 584 | } | ||
| 585 | // if (this.ruleForm.qlxx.gyfs == "1") { | ||
| 586 | // //是否分别持证 | ||
| 587 | // if (this.ruleForm.qlxx.sqfbcz == "1") { | ||
| 588 | // //是 | ||
| 589 | // this.ruleForm.qlrData.forEach((item, index) => { | ||
| 590 | // item.sfczr = "1"; | ||
| 591 | // }); | ||
| 592 | // } else { | ||
| 593 | // this.ruleForm.qlrData.forEach((item, index) => { | ||
| 594 | // if (item.zjh == this.ruleForm.czr) { | ||
| 595 | // item.sfczr = "1"; | ||
| 596 | // } else { | ||
| 597 | // item.sfczr = "0"; | ||
| 598 | // } | ||
| 599 | // }); | ||
| 600 | // } | ||
| 601 | // } | ||
| 602 | save(this.ruleForm).then((res) => { | ||
| 603 | if (res.code === 200) { | ||
| 604 | this.$message({ | 532 | this.$message({ |
| 605 | showClose: true, | 533 | showClose: true, |
| 606 | message: "保存成功!", | 534 | message: "请补充土地用途信息", |
| 607 | type: "success", | 535 | type: "error", |
| 608 | }); | 536 | }); |
| 609 | this.$store.dispatch("user/refreshPage", true); | 537 | return false; |
| 610 | } else { | 538 | } |
| 539 | if (!this.tdxz) { | ||
| 611 | this.$message({ | 540 | this.$message({ |
| 612 | showClose: true, | 541 | showClose: true, |
| 613 | message: res.message, | 542 | message: "请补充土地性质", |
| 614 | type: "error", | 543 | type: "error", |
| 615 | }); | 544 | }); |
| 545 | return false; | ||
| 616 | } | 546 | } |
| 617 | }); | 547 | this.ruleForm.tdytqxList = this.ruleForm.tdytqxList.map((item) => { |
| 618 | } else { | 548 | return { |
| 619 | return false; | 549 | ...item, |
| 620 | } | 550 | qlxzbm: this.tdxz, |
| 621 | }); | 551 | }; |
| 552 | }); | ||
| 553 | if (this.ruleForm.qlxx.gyfs == "0") { | ||
| 554 | if (this.ruleForm.qlrData.length > 1) { | ||
| 555 | this.$message({ | ||
| 556 | showClose: true, | ||
| 557 | message: "共有方式:单独所有,权利人只能是一个人", | ||
| 558 | type: "error", | ||
| 559 | }); | ||
| 560 | return false; | ||
| 561 | } | ||
| 562 | this.ruleForm.qlrData[0].sfczr = "1"; | ||
| 563 | } | ||
| 564 | // if (this.ruleForm.qlxx.gyfs == "1") { | ||
| 565 | // //是否分别持证 | ||
| 566 | // if (this.ruleForm.qlxx.sqfbcz == "1") { | ||
| 567 | // //是 | ||
| 568 | // this.ruleForm.qlrData.forEach((item, index) => { | ||
| 569 | // item.sfczr = "1"; | ||
| 570 | // }); | ||
| 571 | // } else { | ||
| 572 | // this.ruleForm.qlrData.forEach((item, index) => { | ||
| 573 | // if (item.zjh == this.ruleForm.czr) { | ||
| 574 | // item.sfczr = "1"; | ||
| 575 | // } else { | ||
| 576 | // item.sfczr = "0"; | ||
| 577 | // } | ||
| 578 | // }); | ||
| 579 | // } | ||
| 580 | // } | ||
| 581 | save(this.ruleForm).then((res) => { | ||
| 582 | if (res.code === 200) { | ||
| 583 | this.$message({ | ||
| 584 | showClose: true, | ||
| 585 | message: "保存成功!", | ||
| 586 | type: "success", | ||
| 587 | }); | ||
| 588 | this.$store.dispatch("user/refreshPage", true); | ||
| 589 | } else { | ||
| 590 | this.$message({ | ||
| 591 | showClose: true, | ||
| 592 | message: res.message, | ||
| 593 | type: "error", | ||
| 594 | }); | ||
| 595 | } | ||
| 596 | }); | ||
| 597 | } else { | ||
| 598 | return false; | ||
| 599 | } | ||
| 600 | }); | ||
| 601 | }, | ||
| 622 | }, | 602 | }, |
| 623 | }, | 603 | }; |
| 624 | }; | ||
| 625 | </script> | 604 | </script> |
| 626 | <style scoped lang="scss"> | 605 | <style scoped lang="scss"> |
| 627 | @import "~@/styles/public.scss"; | 606 | @import "~@/styles/public.scss"; |
| 628 | @import "~@/styles/slxx/slxx.scss"; | 607 | @import "~@/styles/slxx/slxx.scss"; |
| 629 | </style> | 608 | </style> | ... | ... |
| 1 | <!-- | ||
| 2 | * @Description: | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-07-19 16:04:43 | ||
| 5 | --> | ||
| 1 | <template> | 6 | <template> |
| 2 | <dialogBox title="新增法律法规" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="50%" | 7 | <dialogBox title="新增法律法规" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="50%" |
| 3 | @closeDialog="closeDialog" v-model="value"> | 8 | @closeDialog="closeDialog" v-model="value"> |
| ... | @@ -25,72 +30,71 @@ | ... | @@ -25,72 +30,71 @@ |
| 25 | </template> | 30 | </template> |
| 26 | 31 | ||
| 27 | <script> | 32 | <script> |
| 28 | import { addSysNotice } from "@/api/sysNotice.js" | 33 | import { addSysNotice } from "@/api/sysNotice.js" |
| 29 | import { upload } from "@/api/file.js" | 34 | import { upload } from "@/api/file.js" |
| 30 | export default { | 35 | export default { |
| 31 | props: { | 36 | props: { |
| 32 | value: { type: Boolean, default: false }, | 37 | value: { type: Boolean, default: false }, |
| 33 | }, | 38 | }, |
| 34 | data () { | 39 | data () { |
| 35 | return { | 40 | return { |
| 36 | ruleForm: { | 41 | ruleForm: { |
| 37 | noticeTitle: '', | 42 | noticeTitle: '', |
| 38 | noticeContent: '', | 43 | noticeContent: '', |
| 39 | noticeFileUrl: '', | 44 | noticeFileUrl: '', |
| 40 | noticeType: '2' | 45 | noticeType: '2' |
| 46 | }, | ||
| 47 | rules: { | ||
| 48 | noticeTitle: [ | ||
| 49 | { required: true, message: '请输入法律法规标题', trigger: 'blur' } | ||
| 50 | ] | ||
| 51 | }, | ||
| 52 | } | ||
| 53 | }, | ||
| 54 | |||
| 55 | methods: { | ||
| 56 | submitForm () { | ||
| 57 | let that = this; | ||
| 58 | that.$refs.ruleForm.validate(valid => { | ||
| 59 | if (valid) { | ||
| 60 | addSysNotice(this.ruleForm).then(res => { | ||
| 61 | if (res.code == 200) { | ||
| 62 | this.$message.success('保存成功') | ||
| 63 | this.$emit("input", false); | ||
| 64 | this.resetRuleForm(); | ||
| 65 | this.$parent.queryClick(); | ||
| 66 | } else { | ||
| 67 | this.$message.error(res.message) | ||
| 68 | } | ||
| 69 | }) | ||
| 70 | } else { | ||
| 71 | // console.log('error submit!!'); | ||
| 72 | return false; | ||
| 73 | } | ||
| 74 | }); | ||
| 75 | }, | ||
| 76 | //关闭窗口 | ||
| 77 | closeDialog () { | ||
| 78 | this.$emit("input", false); | ||
| 79 | this.resetRuleForm(); | ||
| 41 | }, | 80 | }, |
| 42 | rules: { | 81 | // |
| 43 | noticeTitle: [ | 82 | resetRuleForm () { |
| 44 | { required: true, message: '请输入法律法规标题', trigger: 'blur' } | 83 | this.$refs['ruleForm'].resetFields(); |
| 45 | ] | 84 | this.ruleForm.noticeType = '2' |
| 85 | }, | ||
| 86 | beforeUpload (file) { | ||
| 87 | return true; | ||
| 88 | }, | ||
| 89 | async handleChange (file) { | ||
| 90 | var formdata = new FormData(); | ||
| 91 | formdata.append("file", file.raw); | ||
| 92 | upload(formdata).then(res => { | ||
| 93 | this.ruleForm.noticeFileUrl = res.message | ||
| 94 | }) | ||
| 46 | }, | 95 | }, |
| 47 | } | 96 | } |
| 48 | }, | ||
| 49 | |||
| 50 | methods: { | ||
| 51 | submitForm () { | ||
| 52 | let that = this; | ||
| 53 | that.$refs.ruleForm.validate(valid => { | ||
| 54 | if (valid) { | ||
| 55 | addSysNotice(this.ruleForm).then(res => { | ||
| 56 | if (res.code == 200) { | ||
| 57 | this.$message.success('保存成功') | ||
| 58 | this.$emit("input", false); | ||
| 59 | this.resetRuleForm(); | ||
| 60 | this.$parent.queryClick(); | ||
| 61 | } else { | ||
| 62 | this.$message.error(res.message) | ||
| 63 | } | ||
| 64 | }) | ||
| 65 | } else { | ||
| 66 | // console.log('error submit!!'); | ||
| 67 | return false; | ||
| 68 | } | ||
| 69 | }); | ||
| 70 | }, | ||
| 71 | //关闭窗口 | ||
| 72 | closeDialog () { | ||
| 73 | this.$emit("input", false); | ||
| 74 | this.resetRuleForm(); | ||
| 75 | }, | ||
| 76 | // | ||
| 77 | resetRuleForm () { | ||
| 78 | this.$refs['ruleForm'].resetFields(); | ||
| 79 | this.ruleForm.noticeType = '2' | ||
| 80 | }, | ||
| 81 | beforeUpload (file) { | ||
| 82 | return true; | ||
| 83 | }, | ||
| 84 | async handleChange (file) { | ||
| 85 | var formdata = new FormData(); | ||
| 86 | formdata.append("file", file.raw); | ||
| 87 | upload(formdata).then(res => { | ||
| 88 | this.ruleForm.noticeFileUrl = res.message | ||
| 89 | }) | ||
| 90 | }, | ||
| 91 | } | 97 | } |
| 92 | } | ||
| 93 | </script> | 98 | </script> |
| 94 | <style scoped lang="scss"> | 99 | <style scoped lang="scss"> |
| 95 | |||
| 96 | </style> | 100 | </style> | ... | ... |
| 1 | <!-- | ||
| 2 | * @Description: | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-07-19 16:04:47 | ||
| 5 | --> | ||
| 1 | <template> | 6 | <template> |
| 2 | <div class="from-clues"> | 7 | <div class="from-clues"> |
| 3 | <!-- 表单部分 --> | 8 | <!-- 表单部分 --> |
| ... | @@ -11,7 +16,7 @@ | ... | @@ -11,7 +16,7 @@ |
| 11 | </el-col> | 16 | </el-col> |
| 12 | <el-col :span="19" class="btnColRight"> | 17 | <el-col :span="19" class="btnColRight"> |
| 13 | <el-form-item> | 18 | <el-form-item> |
| 14 | <el-button type="primary" native-type="submit" @click="handleSearch">查询1</el-button> | 19 | <el-button type="primary" native-type="submit" @click="handleSearch">查询1</el-button> |
| 15 | <el-button type="primary" @click="openDialog()">新增</el-button> | 20 | <el-button type="primary" @click="openDialog()">新增</el-button> |
| 16 | </el-form-item> | 21 | </el-form-item> |
| 17 | </el-col> | 22 | </el-col> |
| ... | @@ -29,79 +34,79 @@ | ... | @@ -29,79 +34,79 @@ |
| 29 | </div> | 34 | </div> |
| 30 | </template> | 35 | </template> |
| 31 | <script> | 36 | <script> |
| 32 | import table from "@/utils/mixin/table"; | 37 | import table from "@/utils/mixin/table"; |
| 33 | import { datas, sendThis } from "./flfgdata"; | 38 | import { datas, sendThis } from "./flfgdata"; |
| 34 | import { getSysPolicyList, deleteSysNotice } from "@/api/sysNotice.js" | 39 | import { getSysPolicyList, deleteSysNotice } from "@/api/sysNotice.js" |
| 35 | import addDialog from "./components/addDialog.vue"; | 40 | import addDialog from "./components/addDialog.vue"; |
| 36 | export default { | 41 | export default { |
| 37 | name: "flfg", | 42 | name: "flfg", |
| 38 | components: { addDialog }, | 43 | components: { addDialog }, |
| 39 | mixins: [table], | 44 | mixins: [table], |
| 40 | mounted () { | 45 | mounted () { |
| 41 | sendThis(this); | 46 | sendThis(this); |
| 42 | this.queryClick() | 47 | this.queryClick() |
| 43 | }, | ||
| 44 | data () { | ||
| 45 | return { | ||
| 46 | isDialog: false, | ||
| 47 | viewDialog: false, | ||
| 48 | ruleForm: { | ||
| 49 | noticeTitle: '' | ||
| 50 | }, | ||
| 51 | tableData: { | ||
| 52 | total: 0, | ||
| 53 | columns: datas.columns(), | ||
| 54 | data: [], | ||
| 55 | }, | ||
| 56 | isDiglog: false | ||
| 57 | } | ||
| 58 | }, | ||
| 59 | methods: { | ||
| 60 | // 列表渲染接口 | ||
| 61 | queryClick () { | ||
| 62 | this.$startLoading() | ||
| 63 | getSysPolicyList({ ...this.ruleForm, ...this.pageData }, { 'target': '#flfgLoading' }).then(res => { | ||
| 64 | if (res.code === 200) { | ||
| 65 | this.$endLoading() | ||
| 66 | let { total, records } = res.result | ||
| 67 | this.tableData.total = total; | ||
| 68 | this.tableData.data = records | ||
| 69 | } | ||
| 70 | }) | ||
| 71 | }, | 48 | }, |
| 72 | //打开新增弹窗 | 49 | data () { |
| 73 | openDialog () { | 50 | return { |
| 74 | this.isDialog = true; | 51 | isDialog: false, |
| 52 | viewDialog: false, | ||
| 53 | ruleForm: { | ||
| 54 | noticeTitle: '' | ||
| 55 | }, | ||
| 56 | tableData: { | ||
| 57 | total: 0, | ||
| 58 | columns: datas.columns(), | ||
| 59 | data: [], | ||
| 60 | }, | ||
| 61 | isDiglog: false | ||
| 62 | } | ||
| 75 | }, | 63 | }, |
| 76 | downloadFile (item) { | 64 | methods: { |
| 77 | const href = item.noticeFileUrl | 65 | // 列表渲染接口 |
| 78 | window.open(href, '_blank'); | 66 | queryClick () { |
| 79 | }, | 67 | this.$startLoading() |
| 80 | //删除 | 68 | getSysPolicyList({ ...this.ruleForm, ...this.pageData }, { 'target': '#flfgLoading' }).then(res => { |
| 81 | delNotice (item) { | 69 | if (res.code === 200) { |
| 82 | this.$confirm('是否确定删除', '提示', { | 70 | this.$endLoading() |
| 83 | confirmButtonText: '确定', | 71 | let { total, records } = res.result |
| 84 | cancelButtonText: '取消', | 72 | this.tableData.total = total; |
| 85 | type: 'warning' | 73 | this.tableData.data = records |
| 86 | }).then(() => { | ||
| 87 | deleteSysNotice({ "bsmNotice": item.bsmNotice }).then(res => { | ||
| 88 | if (res.code == 200) { | ||
| 89 | this.$message.success('删除成功') | ||
| 90 | this.queryClick(); | ||
| 91 | } else { | ||
| 92 | this.$message.error(res.message) | ||
| 93 | } | 74 | } |
| 94 | }) | 75 | }) |
| 95 | }).catch(() => { | 76 | }, |
| 96 | this.$message({ | 77 | //打开新增弹窗 |
| 97 | type: 'info', | 78 | openDialog () { |
| 98 | message: '已取消删除' | 79 | this.isDialog = true; |
| 80 | }, | ||
| 81 | downloadFile (item) { | ||
| 82 | const href = item.noticeFileUrl | ||
| 83 | window.open(href, '_blank'); | ||
| 84 | }, | ||
| 85 | //删除 | ||
| 86 | delNotice (item) { | ||
| 87 | this.$confirm('是否确定删除', '提示', { | ||
| 88 | confirmButtonText: '确定', | ||
| 89 | cancelButtonText: '取消', | ||
| 90 | type: 'warning' | ||
| 91 | }).then(() => { | ||
| 92 | deleteSysNotice({ "bsmNotice": item.bsmNotice }).then(res => { | ||
| 93 | if (res.code == 200) { | ||
| 94 | this.$message.success('删除成功') | ||
| 95 | this.queryClick(); | ||
| 96 | } else { | ||
| 97 | this.$message.error(res.message) | ||
| 98 | } | ||
| 99 | }) | ||
| 100 | }).catch(() => { | ||
| 101 | this.$message({ | ||
| 102 | type: 'info', | ||
| 103 | message: '已取消删除' | ||
| 104 | }); | ||
| 99 | }); | 105 | }); |
| 100 | }); | 106 | }, |
| 101 | }, | 107 | }, |
| 102 | }, | 108 | }; |
| 103 | }; | ||
| 104 | </script> | 109 | </script> |
| 105 | <style scoped lang="scss"> | 110 | <style scoped lang="scss"> |
| 106 | @import "~@/styles/public.scss"; | 111 | @import "~@/styles/public.scss"; |
| 107 | </style> | 112 | </style> | ... | ... |
| 1 | <!-- | ||
| 2 | * @Description: | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-07-19 16:04:58 | ||
| 5 | --> | ||
| 1 | <template> | 6 | <template> |
| 2 | <div> | 7 | <div> |
| 3 | <div class="qtjfjmb-edit-title"> | 8 | <div class="qtjfjmb-edit-title"> |
| ... | @@ -117,140 +122,140 @@ | ... | @@ -117,140 +122,140 @@ |
| 117 | </template> | 122 | </template> |
| 118 | 123 | ||
| 119 | <script> | 124 | <script> |
| 120 | import { updateSysSqywmbsz, getSysSqywmbszDetailById } from '@/api/sysSqywmbsz' | 125 | import { updateSysSqywmbsz, getSysSqywmbszDetailById } from '@/api/sysSqywmbsz' |
| 121 | export default { | 126 | export default { |
| 122 | props: { | 127 | props: { |
| 123 | formData: { | 128 | formData: { |
| 124 | type: Object, | 129 | type: Object, |
| 125 | default: () => { } | 130 | default: () => { } |
| 126 | } | 131 | } |
| 127 | }, | 132 | }, |
| 128 | mounted () { | 133 | mounted () { |
| 129 | if (this.formData.bsmMb) { | 134 | if (this.formData.bsmMb) { |
| 130 | this.$startLoading() | 135 | this.$startLoading() |
| 131 | getSysSqywmbszDetailById(this.formData.bsmMb).then(res => { | 136 | getSysSqywmbszDetailById(this.formData.bsmMb).then(res => { |
| 132 | this.$endLoading() | 137 | this.$endLoading() |
| 133 | let { result } = res | 138 | let { result } = res |
| 134 | this.ruleForm = result ? result : {} | 139 | this.ruleForm = result ? result : {} |
| 135 | }) | 140 | }) |
| 136 | } | 141 | } |
| 137 | }, | 142 | }, |
| 138 | data () { | 143 | data () { |
| 139 | return { | 144 | return { |
| 140 | n: 0, | 145 | n: 0, |
| 141 | ruleForm: { | 146 | ruleForm: { |
| 142 | qllx: '', | 147 | qllx: '', |
| 143 | qllxmc: '', | 148 | qllxmc: '', |
| 144 | bdcqzlx: '', | 149 | bdcqzlx: '', |
| 145 | dymbbs: '', | 150 | dymbbs: '', |
| 146 | qlqtzk: '', | 151 | qlqtzk: '', |
| 147 | firstreg: '', | 152 | firstreg: '', |
| 148 | }, | ||
| 149 | options: [ | ||
| 150 | { | ||
| 151 | value: '1', | ||
| 152 | label: '不动产权证书' | ||
| 153 | }, | 153 | }, |
| 154 | { | 154 | options: [ |
| 155 | value: '2', | 155 | { |
| 156 | label: '不动产登记证明' | 156 | value: '1', |
| 157 | } | 157 | label: '不动产权证书' |
| 158 | ], | 158 | }, |
| 159 | options1: [], | 159 | { |
| 160 | rules: { | 160 | value: '2', |
| 161 | qllx: [ | 161 | label: '不动产登记证明' |
| 162 | { required: true, message: '请输入权利类型编码', trigger: 'blur' } | 162 | } |
| 163 | ], | 163 | ], |
| 164 | qllxmc: [ | 164 | options1: [], |
| 165 | { required: true, message: '请输入权利类型名称', trigger: 'blur' } | 165 | rules: { |
| 166 | ], | 166 | qllx: [ |
| 167 | bdcqzlx: [ | 167 | { required: true, message: '请输入权利类型编码', trigger: 'blur' } |
| 168 | { required: true, message: '请选择不动产权类型', trigger: 'change' } | 168 | ], |
| 169 | ], | 169 | qllxmc: [ |
| 170 | dymbbs: [ | 170 | { required: true, message: '请输入权利类型名称', trigger: 'blur' } |
| 171 | { required: true, message: '请输入打印模板', trigger: 'blur' } | 171 | ], |
| 172 | ], | 172 | bdcqzlx: [ |
| 173 | qlqtztmb: [ | 173 | { required: true, message: '请选择不动产权类型', trigger: 'change' } |
| 174 | { required: true, message: '请输入权利其他状况模板', trigger: 'blur' } | 174 | ], |
| 175 | ], | 175 | dymbbs: [ |
| 176 | }, | 176 | { required: true, message: '请输入打印模板', trigger: 'blur' } |
| 177 | titleList: [ | 177 | ], |
| 178 | { | 178 | qlqtztmb: [ |
| 179 | name: '首次登记' | 179 | { required: true, message: '请输入权利其他状况模板', trigger: 'blur' } |
| 180 | ], | ||
| 180 | }, | 181 | }, |
| 181 | { | 182 | titleList: [ |
| 182 | name: '转移登记' | 183 | { |
| 183 | }, | 184 | name: '首次登记' |
| 184 | { | 185 | }, |
| 185 | name: '变更登记' | 186 | { |
| 186 | }, | 187 | name: '转移登记' |
| 187 | { | 188 | }, |
| 188 | name: '注销登记' | 189 | { |
| 189 | }, | 190 | name: '变更登记' |
| 190 | { | 191 | }, |
| 191 | name: '更正登记' | 192 | { |
| 192 | }, | 193 | name: '注销登记' |
| 193 | { | 194 | }, |
| 194 | name: '补证登记' | 195 | { |
| 195 | }, | 196 | name: '更正登记' |
| 196 | { | 197 | }, |
| 197 | name: '换证登记' | 198 | { |
| 198 | } | 199 | name: '补证登记' |
| 199 | ] | 200 | }, |
| 200 | } | 201 | { |
| 201 | }, | 202 | name: '换证登记' |
| 202 | methods: { | 203 | } |
| 203 | handleSelect (index) { | 204 | ] |
| 204 | this.n = index | 205 | } |
| 205 | }, | 206 | }, |
| 206 | submitForm () { | 207 | methods: { |
| 207 | let that = this | 208 | handleSelect (index) { |
| 208 | updateSysSqywmbsz(this.ruleForm).then(res => { | 209 | this.n = index |
| 209 | if (res.code === 200) { | 210 | }, |
| 210 | this.$popupCacel() | 211 | submitForm () { |
| 211 | that.$message({ | 212 | let that = this |
| 212 | message: '修改成功', | 213 | updateSysSqywmbsz(this.ruleForm).then(res => { |
| 213 | type: 'success' | 214 | if (res.code === 200) { |
| 214 | }) | 215 | this.$popupCacel() |
| 215 | } | 216 | that.$message({ |
| 216 | }) | 217 | message: '修改成功', |
| 218 | type: 'success' | ||
| 219 | }) | ||
| 220 | } | ||
| 221 | }) | ||
| 222 | } | ||
| 217 | } | 223 | } |
| 218 | } | 224 | } |
| 219 | } | ||
| 220 | </script> | 225 | </script> |
| 221 | <style scoped lang="scss"> | 226 | <style scoped lang="scss"> |
| 222 | @import "~@/styles/mixin.scss"; | 227 | @import "~@/styles/mixin.scss"; |
| 223 | @import "~@/styles/dialogBoxheader.scss"; | 228 | @import "~@/styles/dialogBoxheader.scss"; |
| 224 | 229 | ||
| 225 | .qtjfjmb-edit-title { | 230 | .qtjfjmb-edit-title { |
| 226 | padding-bottom: 10px; | 231 | padding-bottom: 10px; |
| 227 | border-bottom: 1px solid $borderColor; | 232 | border-bottom: 1px solid $borderColor; |
| 228 | margin-bottom: 10px; | 233 | margin-bottom: 10px; |
| 229 | } | 234 | } |
| 230 | 235 | ||
| 231 | ul { | 236 | ul { |
| 232 | @include flex; | 237 | @include flex; |
| 233 | border-radius: 5px; | 238 | border-radius: 5px; |
| 234 | overflow: hidden; | 239 | overflow: hidden; |
| 235 | margin-bottom: 20px; | 240 | margin-bottom: 20px; |
| 236 | 241 | ||
| 237 | .active { | 242 | .active { |
| 238 | background: $light-blue; | 243 | background: $light-blue; |
| 239 | color: #fff; | 244 | color: #fff; |
| 240 | } | 245 | } |
| 241 | 246 | ||
| 242 | li { | 247 | li { |
| 243 | flex: 1; | 248 | flex: 1; |
| 244 | line-height: 36px; | 249 | line-height: 36px; |
| 245 | @include flex-center; | 250 | @include flex-center; |
| 246 | border: 1px solid $borderColor; | 251 | border: 1px solid $borderColor; |
| 247 | margin-left: -1px; | 252 | margin-left: -1px; |
| 248 | cursor: pointer; | 253 | cursor: pointer; |
| 249 | transition: all 0.3s; | 254 | transition: all 0.3s; |
| 250 | 255 | ||
| 251 | &:hover { | 256 | &:hover { |
| 252 | @extend .active; | 257 | @extend .active; |
| 258 | } | ||
| 253 | } | 259 | } |
| 254 | } | 260 | } |
| 255 | } | ||
| 256 | </style> | 261 | </style> | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Description: 功能:审批意见 | 2 | * @Description: 功能:审批意见 |
| 3 | * @Autor: renchao | 3 | * @Autor: renchao |
| 4 | * @LastEditTime: 2023-05-17 10:41:24 | 4 | * @LastEditTime: 2023-07-20 09:52:48 |
| 5 | --> | 5 | --> |
| 6 | <template> | 6 | <template> |
| 7 | <div class='spyj loadingtext'> | 7 | <div class='spyj loadingtext'> |
| ... | @@ -83,7 +83,7 @@ | ... | @@ -83,7 +83,7 @@ |
| 83 | }, | 83 | }, |
| 84 | }, | 84 | }, |
| 85 | mounted () { | 85 | mounted () { |
| 86 | this.ableOperation = this.$parent.ableOperation; | 86 | this.ableOperation = this.$parent.currentSelectTab.ableOperation |
| 87 | this.list(); | 87 | this.list(); |
| 88 | }, | 88 | }, |
| 89 | methods: { | 89 | methods: { |
| ... | @@ -94,7 +94,6 @@ | ... | @@ -94,7 +94,6 @@ |
| 94 | var formdata = new FormData(); | 94 | var formdata = new FormData(); |
| 95 | formdata.append("bsmBusiness", this.propsParam.bsmBusiness); | 95 | formdata.append("bsmBusiness", this.propsParam.bsmBusiness); |
| 96 | formdata.append("bestepid", this.$route.query.bestepid); | 96 | formdata.append("bestepid", this.$route.query.bestepid); |
| 97 | // formdata.append("ableOperation", this.ableOperation) | ||
| 98 | getSpyjList(formdata).then((res) => { | 97 | getSpyjList(formdata).then((res) => { |
| 99 | this.$endLoading() | 98 | this.$endLoading() |
| 100 | if (res.code === 200 && res.result) { | 99 | if (res.code === 200 && res.result) { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Description: 受理信息 | 2 | * @Description: 受理信息 |
| 3 | * @Autor: renchao | 3 | * @Autor: renchao |
| 4 | * @LastEditTime: 2023-05-25 08:41:40 | 4 | * @LastEditTime: 2023-07-20 09:30:21 |
| 5 | --> | 5 | --> |
| 6 | <template> | 6 | <template> |
| 7 | <div class="slxx"> | 7 | <div class="slxx"> |
| 8 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-position="flag ? 'top' : ''" :inline="flag" | 8 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-position="flag ? 'top' : ''" :inline="flag" |
| 9 | label-width="120px"> | 9 | label-width="120px"> |
| 10 | <div class="slxx_con" :class="flag ? 'formMarginBot0' : ''"> | 10 | <div class="slxx_con" :class="flag ? 'formMarginBot0' : ''"> |
| 11 | <div class="slxx_title title-block"> | 11 | <div class="slxx_title title-block"> |
| 12 | 受理信息 | 12 | 受理信息 |
| ... | @@ -102,7 +102,7 @@ | ... | @@ -102,7 +102,7 @@ |
| 102 | <el-col :span="14"> | 102 | <el-col :span="14"> |
| 103 | <el-form-item label="共有方式:"> | 103 | <el-form-item label="共有方式:"> |
| 104 | <el-radio-group :disabled="!ableOperation" @change="showCZInfo" | 104 | <el-radio-group :disabled="!ableOperation" @change="showCZInfo" |
| 105 | v-model="ruleForm.sldyList[0].gyfs"> | 105 | v-model="ruleForm.sldyList[0].gyfs"> |
| 106 | <el-radio label="0">单独所有</el-radio> | 106 | <el-radio label="0">单独所有</el-radio> |
| 107 | <el-radio label="1">共同共有</el-radio> | 107 | <el-radio label="1">共同共有</el-radio> |
| 108 | <el-radio label="2">按份所有</el-radio> | 108 | <el-radio label="2">按份所有</el-radio> |
| ... | @@ -111,7 +111,6 @@ | ... | @@ -111,7 +111,6 @@ |
| 111 | </el-form-item> | 111 | </el-form-item> |
| 112 | </el-col> | 112 | </el-col> |
| 113 | 113 | ||
| 114 | |||
| 115 | <el-col :span="5" v-show=" ruleForm.slsq.gyfs == '2'"> | 114 | <el-col :span="5" v-show=" ruleForm.slsq.gyfs == '2'"> |
| 116 | <el-form-item label="是否分别持证:"> | 115 | <el-form-item label="是否分别持证:"> |
| 117 | <el-radio-group v-model="ruleForm.sldyList[0].sqfbcz"> | 116 | <el-radio-group v-model="ruleForm.sldyList[0].sqfbcz"> |
| ... | @@ -130,7 +129,7 @@ | ... | @@ -130,7 +129,7 @@ |
| 130 | </el-col> | 129 | </el-col> |
| 131 | </el-row> | 130 | </el-row> |
| 132 | <qlrCommonTable @upDateQlrxxList="upDateQlrxxList" :tableData="ruleForm.qlrList" | 131 | <qlrCommonTable @upDateQlrxxList="upDateQlrxxList" :tableData="ruleForm.qlrList" |
| 133 | :gyfs="ruleForm.slsq.gyfs" /> | 132 | :gyfs="ruleForm.slsq.gyfs" /> |
| 134 | <div class="slxx_title title-block"> | 133 | <div class="slxx_title title-block"> |
| 135 | 登记原因 | 134 | 登记原因 |
| 136 | <div class="triangle"></div> | 135 | <div class="triangle"></div> |
| ... | @@ -139,7 +138,7 @@ | ... | @@ -139,7 +138,7 @@ |
| 139 | <el-col> | 138 | <el-col> |
| 140 | <el-form-item v-if="ruleForm.slsq" label="登记原因:" prop="djyy"> | 139 | <el-form-item v-if="ruleForm.slsq" label="登记原因:" prop="djyy"> |
| 141 | <el-input class="textArea" type="textarea" :disabled="!ableOperation" | 140 | <el-input class="textArea" type="textarea" :disabled="!ableOperation" |
| 142 | v-model="ruleForm.fdcq2List[0].djyy"> | 141 | v-model="ruleForm.fdcq2List[0].djyy"> |
| 143 | </el-input> | 142 | </el-input> |
| 144 | </el-form-item> | 143 | </el-form-item> |
| 145 | </el-col> | 144 | </el-col> |
| ... | @@ -154,192 +153,192 @@ | ... | @@ -154,192 +153,192 @@ |
| 154 | </div> | 153 | </div> |
| 155 | </template> | 154 | </template> |
| 156 | <script> | 155 | <script> |
| 157 | import qlrCommonTable from "@/views/workflow/components/qlrCommonTable"; | 156 | import qlrCommonTable from "@/views/workflow/components/qlrCommonTable"; |
| 158 | import {BatchInit, Init, saveBatchData, saveData} from "@/api/workflow/fwsyqFlow.js"; | 157 | import { BatchInit, Init, saveBatchData, saveData } from "@/api/workflow/fwsyqFlow.js"; |
| 159 | import { mapGetters } from "vuex"; | 158 | import { mapGetters } from "vuex"; |
| 160 | export default { | 159 | export default { |
| 161 | created(callbackfn, thisArg) { | 160 | created (callbackfn, thisArg) { |
| 162 | this.ableOperation = this.$parent.currentSelectTab.ableOperation | 161 | this.ableOperation = this.$parent.currentSelectTab.ableOperation |
| 163 | this.propsParam = this.$attrs; | 162 | this.propsParam = this.$attrs; |
| 164 | var formdata = new FormData(); | 163 | var formdata = new FormData(); |
| 165 | formdata.append("bsmSldy", this.propsParam.bsmSldy); | 164 | formdata.append("bsmSldy", this.propsParam.bsmSldy); |
| 166 | formdata.append("djlx", this.propsParam.djlx); | 165 | formdata.append("djlx", this.propsParam.djlx); |
| 167 | formdata.append("bsmSlsq", this.bsmSlsq); | 166 | formdata.append("bsmSlsq", this.bsmSlsq); |
| 168 | formdata.append("isEdit", this.ableOperation); | 167 | formdata.append("isEdit", this.ableOperation); |
| 169 | BatchInit(formdata).then((res) => { | 168 | BatchInit(formdata).then((res) => { |
| 170 | if (res.code === 200 && res.result) { | 169 | if (res.code === 200 && res.result) { |
| 171 | this.ruleForm = res.result; | 170 | this.ruleForm = res.result; |
| 172 | this.splicingFdcq2Info(); | 171 | this.splicingFdcq2Info(); |
| 173 | } | 172 | } |
| 174 | }); | 173 | }); |
| 175 | |||
| 176 | }, | ||
| 177 | components: { qlrCommonTable }, | ||
| 178 | computed: { | ||
| 179 | ...mapGetters(["dictData", "flag"]), | ||
| 180 | }, | ||
| 181 | data () { | ||
| 182 | return { | ||
| 183 | disabled: true, | ||
| 184 | tdytOption: [], | ||
| 185 | czrOptions: [], | ||
| 186 | ruleForm: { | ||
| 187 | cfdjList:[]//查封登记 | ||
| 188 | ,diyaqList:[]//抵押权 | ||
| 189 | ,fdcq2List:[]//房屋信息集合 | ||
| 190 | ,qlrList:[]//权利人 | ||
| 191 | ,ywrList:[]//义务人 | ||
| 192 | ,qlxxList:[]//权利信息集合 | ||
| 193 | ,sldyList:[]//受理不动产单元集合 | ||
| 194 | ,slsq: {}//受理申请流程明细 | ||
| 195 | ,flow: {}//受理申请流程明细 | ||
| 196 | ,sqrList:[]//申请人 | ||
| 197 | ,ssQlxxList:[]//上手权利信息 | ||
| 198 | ,user:{}//用户 | ||
| 199 | ,zdjbxx: {}//宗地基本信息 | ||
| 200 | }, | ||
| 201 | //传递参数 | ||
| 202 | propsParam: this.$attrs, | ||
| 203 | //表单是否可操作 | ||
| 204 | ableOperation: true, | ||
| 205 | rules: {}, | ||
| 206 | bsmSlsq: this.$route.query.bsmSlsq,//受理申请标识码 | ||
| 207 | splicingFdcq2:{//前端根据后台数组组装展示内容 | ||
| 208 | fwxz:{}//房屋性质 | ||
| 209 | ,fwjg:{}//房屋结构 | ||
| 210 | ,jzmj:{} //建筑面积 | ||
| 211 | ,zts:{}//房屋总套数 | ||
| 212 | } | ||
| 213 | } | ||
| 214 | }, | ||
| 215 | methods: { | ||
| 216 | //组装房地产权通用信息 | ||
| 217 | splicingFdcq2Info(){ | ||
| 218 | let fdcq2List = this.ruleForm.fdcq2List; | ||
| 219 | let fwxzArr = []; | ||
| 220 | let fwjgArr = []; | ||
| 221 | let jzmj = 0; | ||
| 222 | fdcq2List.forEach(fdcq2 => { | ||
| 223 | fwxzArr.push(fdcq2.fwxzmc); | ||
| 224 | fwjgArr.push(fdcq2.fwjgmc); | ||
| 225 | jzmj += parseFloat(fdcq2.jzmj); | ||
| 226 | }) | ||
| 227 | //将数据转为字符串 | ||
| 228 | //房屋性质 | ||
| 229 | let fwxz = Array.from(new Set(fwxzArr)).join(","); | ||
| 230 | //房屋结构 | ||
| 231 | let fwjg = Array.from(new Set(fwjgArr)).join(","); | ||
| 232 | this.splicingFdcq2.fwxz = fwxz; | ||
| 233 | this.splicingFdcq2.fwjg = fwjg; | ||
| 234 | this.splicingFdcq2.jzmj = jzmj==null ? 0 : jzmj; | ||
| 235 | this.splicingFdcq2.zts = fdcq2List.length; | ||
| 236 | |||
| 237 | }, | ||
| 238 | 174 | ||
| 239 | // 更新权利人信息 | ||
| 240 | upDateQlrxxList (val) { | ||
| 241 | this.ruleForm.qlrList = _.cloneDeep(val); | ||
| 242 | }, | ||
| 243 | showCZInfo () { | ||
| 244 | console.log(this.ruleForm.slsq.gyfs); | ||
| 245 | }, | 175 | }, |
| 246 | // 更新义务人信息 | 176 | components: { qlrCommonTable }, |
| 247 | upDateYwrxxList (val) { | 177 | computed: { |
| 248 | this.ruleForm.ywrList = _.cloneDeep(val); | 178 | ...mapGetters(["dictData", "flag"]), |
| 249 | }, | 179 | }, |
| 250 | onSubmit () { | 180 | data () { |
| 251 | saveBatchData(this.ruleForm).then((res) => { | 181 | return { |
| 252 | if (res.code === 200) { | 182 | disabled: true, |
| 253 | this.$message({ | 183 | tdytOption: [], |
| 254 | showClose: true, | 184 | czrOptions: [], |
| 255 | message: "保存成功!", | 185 | ruleForm: { |
| 256 | type: "success", | 186 | cfdjList: []//查封登记 |
| 257 | }); | 187 | , diyaqList: []//抵押权 |
| 258 | this.$store.dispatch('user/refreshPage', true); | 188 | , fdcq2List: []//房屋信息集合 |
| 259 | } else { | 189 | , qlrList: []//权利人 |
| 260 | this.$message({ | 190 | , ywrList: []//义务人 |
| 261 | showClose: true, | 191 | , qlxxList: []//权利信息集合 |
| 262 | message: res.message, | 192 | , sldyList: []//受理不动产单元集合 |
| 263 | type: "error" | 193 | , slsq: {}//受理申请流程明细 |
| 264 | }) | 194 | , flow: {}//受理申请流程明细 |
| 195 | , sqrList: []//申请人 | ||
| 196 | , ssQlxxList: []//上手权利信息 | ||
| 197 | , user: {}//用户 | ||
| 198 | , zdjbxx: {}//宗地基本信息 | ||
| 199 | }, | ||
| 200 | //传递参数 | ||
| 201 | propsParam: this.$attrs, | ||
| 202 | //表单是否可操作 | ||
| 203 | ableOperation: true, | ||
| 204 | rules: {}, | ||
| 205 | bsmSlsq: this.$route.query.bsmSlsq,//受理申请标识码 | ||
| 206 | splicingFdcq2: {//前端根据后台数组组装展示内容 | ||
| 207 | fwxz: {}//房屋性质 | ||
| 208 | , fwjg: {}//房屋结构 | ||
| 209 | , jzmj: {} //建筑面积 | ||
| 210 | , zts: {}//房屋总套数 | ||
| 265 | } | 211 | } |
| 266 | }) | 212 | } |
| 213 | }, | ||
| 214 | methods: { | ||
| 215 | //组装房地产权通用信息 | ||
| 216 | splicingFdcq2Info () { | ||
| 217 | let fdcq2List = this.ruleForm.fdcq2List; | ||
| 218 | let fwxzArr = []; | ||
| 219 | let fwjgArr = []; | ||
| 220 | let jzmj = 0; | ||
| 221 | fdcq2List.forEach(fdcq2 => { | ||
| 222 | fwxzArr.push(fdcq2.fwxzmc); | ||
| 223 | fwjgArr.push(fdcq2.fwjgmc); | ||
| 224 | jzmj += parseFloat(fdcq2.jzmj); | ||
| 225 | }) | ||
| 226 | //将数据转为字符串 | ||
| 227 | //房屋性质 | ||
| 228 | let fwxz = Array.from(new Set(fwxzArr)).join(","); | ||
| 229 | //房屋结构 | ||
| 230 | let fwjg = Array.from(new Set(fwjgArr)).join(","); | ||
| 231 | this.splicingFdcq2.fwxz = fwxz; | ||
| 232 | this.splicingFdcq2.fwjg = fwjg; | ||
| 233 | this.splicingFdcq2.jzmj = jzmj == null ? 0 : jzmj; | ||
| 234 | this.splicingFdcq2.zts = fdcq2List.length; | ||
| 235 | |||
| 236 | }, | ||
| 237 | |||
| 238 | // 更新权利人信息 | ||
| 239 | upDateQlrxxList (val) { | ||
| 240 | this.ruleForm.qlrList = _.cloneDeep(val); | ||
| 241 | }, | ||
| 242 | showCZInfo () { | ||
| 243 | console.log(this.ruleForm.slsq.gyfs); | ||
| 244 | }, | ||
| 245 | // 更新义务人信息 | ||
| 246 | upDateYwrxxList (val) { | ||
| 247 | this.ruleForm.ywrList = _.cloneDeep(val); | ||
| 248 | }, | ||
| 249 | onSubmit () { | ||
| 250 | saveBatchData(this.ruleForm).then((res) => { | ||
| 251 | if (res.code === 200) { | ||
| 252 | this.$message({ | ||
| 253 | showClose: true, | ||
| 254 | message: "保存成功!", | ||
| 255 | type: "success", | ||
| 256 | }); | ||
| 257 | this.$store.dispatch('user/refreshPage', true); | ||
| 258 | } else { | ||
| 259 | this.$message({ | ||
| 260 | showClose: true, | ||
| 261 | message: res.message, | ||
| 262 | type: "error" | ||
| 263 | }) | ||
| 264 | } | ||
| 265 | }) | ||
| 266 | } | ||
| 267 | } | 267 | } |
| 268 | } | 268 | } |
| 269 | } | ||
| 270 | </script> | 269 | </script> |
| 271 | <style scoped lang='scss'> | 270 | <style scoped lang='scss'> |
| 272 | @import "~@/styles/public.scss"; | 271 | @import "~@/styles/public.scss"; |
| 273 | 272 | ||
| 274 | /deep/.el-form { | 273 | /deep/.el-form { |
| 275 | display: flex; | 274 | display: flex; |
| 276 | flex-direction: column; | 275 | flex-direction: column; |
| 277 | height: calc(100vh - 130px); | 276 | height: calc(100vh - 130px); |
| 278 | } | 277 | } |
| 279 | 278 | ||
| 280 | /deep/.el-form-item__label { | 279 | /deep/.el-form-item__label { |
| 281 | padding: 0; | 280 | padding: 0; |
| 282 | } | 281 | } |
| 283 | 282 | ||
| 284 | /deep/.el-radio { | 283 | /deep/.el-radio { |
| 285 | margin-right: 10px; | 284 | margin-right: 10px; |
| 286 | } | 285 | } |
| 287 | 286 | ||
| 288 | /deep/.el-select { | 287 | /deep/.el-select { |
| 289 | width: 100%; | 288 | width: 100%; |
| 290 | } | 289 | } |
| 291 | 290 | ||
| 292 | /deep/.el-form-item { | 291 | /deep/.el-form-item { |
| 293 | margin-bottom: 8px; | 292 | margin-bottom: 8px; |
| 294 | } | 293 | } |
| 295 | 294 | ||
| 296 | .marginBot0 { | 295 | .marginBot0 { |
| 297 | margin-bottom: 0 !important; | 296 | margin-bottom: 0 !important; |
| 298 | } | 297 | } |
| 299 | 298 | ||
| 300 | .slxx { | 299 | .slxx { |
| 301 | box-sizing: border-box; | 300 | box-sizing: border-box; |
| 302 | } | 301 | } |
| 303 | 302 | ||
| 304 | .slxx_con { | 303 | .slxx_con { |
| 305 | flex: 1; | 304 | flex: 1; |
| 306 | height: 100%; | 305 | height: 100%; |
| 307 | background-color: #ffffff; | 306 | background-color: #ffffff; |
| 308 | overflow-y: auto; | 307 | overflow-y: auto; |
| 309 | padding-right: 3px; | 308 | padding-right: 3px; |
| 310 | overflow-x: hidden; | 309 | overflow-x: hidden; |
| 311 | } | 310 | } |
| 312 | 311 | ||
| 313 | .submit_btn { | 312 | .submit_btn { |
| 314 | height: 50px; | 313 | height: 50px; |
| 315 | } | 314 | } |
| 316 | 315 | ||
| 317 | .slxx_title { | 316 | .slxx_title { |
| 318 | border-bottom: 1px solid $borderColor; | 317 | border-bottom: 1px solid $borderColor; |
| 319 | padding-left: 10px; | 318 | padding-left: 10px; |
| 320 | padding-bottom: 5px; | 319 | padding-bottom: 5px; |
| 321 | margin-bottom: 10px; | 320 | margin-bottom: 10px; |
| 322 | margin-top: 5px; | 321 | margin-top: 5px; |
| 323 | font-size: 16px; | 322 | font-size: 16px; |
| 324 | font-weight: 500; | 323 | font-weight: 500; |
| 325 | color: #4a4a4a; | 324 | color: #4a4a4a; |
| 326 | } | 325 | } |
| 327 | 326 | ||
| 328 | .btn { | 327 | .btn { |
| 329 | text-align: center; | 328 | text-align: center; |
| 330 | padding-top: 10px; | 329 | padding-top: 10px; |
| 331 | height: 36px; | 330 | height: 36px; |
| 332 | background-color: #ffffff; | 331 | background-color: #ffffff; |
| 333 | padding: 5px 0; | 332 | padding: 5px 0; |
| 334 | } | 333 | } |
| 335 | 334 | ||
| 336 | .textArea { | 335 | .textArea { |
| 337 | /deep/.el-textarea__inner { | 336 | /deep/.el-textarea__inner { |
| 338 | min-height: 90px !important; | 337 | min-height: 90px !important; |
| 338 | } | ||
| 339 | } | 339 | } |
| 340 | } | ||
| 341 | 340 | ||
| 342 | /deep/.el-form-item__label { | 341 | /deep/.el-form-item__label { |
| 343 | padding-bottom: 0px; | 342 | padding-bottom: 0px; |
| 344 | } | 343 | } |
| 345 | </style> | 344 | </style> | ... | ... |
| ... | @@ -7,7 +7,7 @@ | ... | @@ -7,7 +7,7 @@ |
| 7 | <!-- 受理信息 --> | 7 | <!-- 受理信息 --> |
| 8 | <div class="slxx"> | 8 | <div class="slxx"> |
| 9 | <el-form :model="ruleForm" :rules="rules" :class="{readonly: editDisabled }" | 9 | <el-form :model="ruleForm" :rules="rules" :class="{readonly: editDisabled }" |
| 10 | class="loadingtext" ref="ruleForm" :label-position="flag ? 'top' : ''" | 10 | class="loadingtext" ref="ruleForm" :label-position="flag ? 'top' : ''" |
| 11 | :inline="flag" label-width="120px"> | 11 | :inline="flag" label-width="120px"> |
| 12 | <div class="slxx_con" v-if="isShow" :class="flag ? 'formMarginBot0' : ''"> | 12 | <div class="slxx_con" v-if="isShow" :class="flag ? 'formMarginBot0' : ''"> |
| 13 | <div class="slxx_title title-block"> | 13 | <div class="slxx_title title-block"> |
| ... | @@ -128,7 +128,7 @@ | ... | @@ -128,7 +128,7 @@ |
| 128 | <div class="triangle"></div> | 128 | <div class="triangle"></div> |
| 129 | </div> | 129 | </div> |
| 130 | <tdytTable | 130 | <tdytTable |
| 131 | :ableOperation="ableOperation" | 131 | :ableOperation="ableOperation" |
| 132 | :tableData="ruleForm.tdytqxList" | 132 | :tableData="ruleForm.tdytqxList" |
| 133 | @upDateTdytxxList="upDateTdytxxList" /> | 133 | @upDateTdytxxList="upDateTdytxxList" /> |
| 134 | <div class="slxx_title title-block"> | 134 | <div class="slxx_title title-block"> |
| ... | @@ -224,14 +224,14 @@ | ... | @@ -224,14 +224,14 @@ |
| 224 | components: { qlrCommonTable, tdytTable }, | 224 | components: { qlrCommonTable, tdytTable }, |
| 225 | computed: { | 225 | computed: { |
| 226 | ...mapGetters(["dictData", "flag"]), | 226 | ...mapGetters(["dictData", "flag"]), |
| 227 | // 根据流程判断表单是否为只读 | 227 | // 根据流程判断表单是否为只读 |
| 228 | editDisabled() { | 228 | editDisabled () { |
| 229 | if (!this.ableOperation) { | 229 | if (!this.ableOperation) { |
| 230 | //只读状态 | 230 | //只读状态 |
| 231 | return true; | 231 | return true; |
| 232 | } | 232 | } |
| 233 | return false; | 233 | return false; |
| 234 | }, | 234 | }, |
| 235 | }, | 235 | }, |
| 236 | data () { | 236 | data () { |
| 237 | return { | 237 | return { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Description: | 2 | * @Description: |
| 3 | * @Autor: renchao | 3 | * @Autor: renchao |
| 4 | * @LastEditTime: 2023-07-14 11:06:27 | 4 | * @LastEditTime: 2023-07-20 09:30:51 |
| 5 | --> | 5 | --> |
| 6 | <template> | 6 | <template> |
| 7 | <!-- 受理信息 --> | 7 | <!-- 受理信息 --> |
| ... | @@ -13,8 +13,7 @@ | ... | @@ -13,8 +13,7 @@ |
| 13 | ref="ruleForm" | 13 | ref="ruleForm" |
| 14 | :label-position="flag ? 'top' : ''" | 14 | :label-position="flag ? 'top' : ''" |
| 15 | :inline="flag" | 15 | :inline="flag" |
| 16 | label-width="120px" | 16 | label-width="120px"> |
| 17 | > | ||
| 18 | <div class="slxx_con" v-if="isShow" :class="flag ? 'formMarginBot0' : ''"> | 17 | <div class="slxx_con" v-if="isShow" :class="flag ? 'formMarginBot0' : ''"> |
| 19 | <div class="slxx_title title-block"> | 18 | <div class="slxx_title title-block"> |
| 20 | 受理信息 | 19 | 受理信息 |
| ... | @@ -90,8 +89,7 @@ | ... | @@ -90,8 +89,7 @@ |
| 90 | <el-form-item label="面积单位:"> | 89 | <el-form-item label="面积单位:"> |
| 91 | <el-input | 90 | <el-input |
| 92 | v-model="ruleForm.tdsyq.mjdw" | 91 | v-model="ruleForm.tdsyq.mjdw" |
| 93 | :disabled="!ableOperation" | 92 | :disabled="!ableOperation"></el-input> |
| 94 | ></el-input> | ||
| 95 | </el-form-item> | 93 | </el-form-item> |
| 96 | </el-col> | 94 | </el-col> |
| 97 | </el-row> | 95 | </el-row> |
| ... | @@ -102,19 +100,16 @@ | ... | @@ -102,19 +100,16 @@ |
| 102 | <el-input | 100 | <el-input |
| 103 | v-model="ruleForm.tdsyq.nydmj" | 101 | v-model="ruleForm.tdsyq.nydmj" |
| 104 | :disabled="!ableOperation" | 102 | :disabled="!ableOperation" |
| 105 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" | 103 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input> |
| 106 | ></el-input> | ||
| 107 | <el-select | 104 | <el-select |
| 108 | v-model="mjdw" | 105 | v-model="mjdw" |
| 109 | :disabled="!ableOperation" | 106 | :disabled="!ableOperation" |
| 110 | style="width: 20%" | 107 | style="width: 20%"> |
| 111 | > | ||
| 112 | <el-option | 108 | <el-option |
| 113 | v-for="item in dictData['A7']" | 109 | v-for="item in dictData['A7']" |
| 114 | :key="item.dcode" | 110 | :key="item.dcode" |
| 115 | :label="item.dname" | 111 | :label="item.dname" |
| 116 | :value="item.dcode" | 112 | :value="item.dcode"> |
| 117 | > | ||
| 118 | </el-option> | 113 | </el-option> |
| 119 | </el-select> | 114 | </el-select> |
| 120 | </div> | 115 | </div> |
| ... | @@ -126,19 +121,16 @@ | ... | @@ -126,19 +121,16 @@ |
| 126 | <el-input | 121 | <el-input |
| 127 | v-model="ruleForm.tdsyq.gdmj" | 122 | v-model="ruleForm.tdsyq.gdmj" |
| 128 | :disabled="!ableOperation" | 123 | :disabled="!ableOperation" |
| 129 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" | 124 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input> |
| 130 | ></el-input> | ||
| 131 | <el-select | 125 | <el-select |
| 132 | v-model="mjdw" | 126 | v-model="mjdw" |
| 133 | :disabled="!ableOperation" | 127 | :disabled="!ableOperation" |
| 134 | style="width: 20%" | 128 | style="width: 20%"> |
| 135 | > | ||
| 136 | <el-option | 129 | <el-option |
| 137 | v-for="item in dictData['A7']" | 130 | v-for="item in dictData['A7']" |
| 138 | :key="item.dcode" | 131 | :key="item.dcode" |
| 139 | :label="item.dname" | 132 | :label="item.dname" |
| 140 | :value="item.dcode" | 133 | :value="item.dcode"> |
| 141 | > | ||
| 142 | </el-option> | 134 | </el-option> |
| 143 | </el-select> | 135 | </el-select> |
| 144 | </div> | 136 | </div> |
| ... | @@ -150,19 +142,16 @@ | ... | @@ -150,19 +142,16 @@ |
| 150 | <el-input | 142 | <el-input |
| 151 | v-model="ruleForm.tdsyq.ldmj" | 143 | v-model="ruleForm.tdsyq.ldmj" |
| 152 | :disabled="!ableOperation" | 144 | :disabled="!ableOperation" |
| 153 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" | 145 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input> |
| 154 | ></el-input> | ||
| 155 | <el-select | 146 | <el-select |
| 156 | v-model="mjdw" | 147 | v-model="mjdw" |
| 157 | :disabled="!ableOperation" | 148 | :disabled="!ableOperation" |
| 158 | style="width: 20%" | 149 | style="width: 20%"> |
| 159 | > | ||
| 160 | <el-option | 150 | <el-option |
| 161 | v-for="item in dictData['A7']" | 151 | v-for="item in dictData['A7']" |
| 162 | :key="item.dcode" | 152 | :key="item.dcode" |
| 163 | :label="item.dname" | 153 | :label="item.dname" |
| 164 | :value="item.dcode" | 154 | :value="item.dcode"> |
| 165 | > | ||
| 166 | </el-option> | 155 | </el-option> |
| 167 | </el-select> | 156 | </el-select> |
| 168 | </div> | 157 | </div> |
| ... | @@ -176,19 +165,16 @@ | ... | @@ -176,19 +165,16 @@ |
| 176 | <el-input | 165 | <el-input |
| 177 | v-model="ruleForm.tdsyq.cdmj" | 166 | v-model="ruleForm.tdsyq.cdmj" |
| 178 | :disabled="!ableOperation" | 167 | :disabled="!ableOperation" |
| 179 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" | 168 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input> |
| 180 | ></el-input> | ||
| 181 | <el-select | 169 | <el-select |
| 182 | v-model="mjdw" | 170 | v-model="mjdw" |
| 183 | :disabled="!ableOperation" | 171 | :disabled="!ableOperation" |
| 184 | style="width: 20%" | 172 | style="width: 20%"> |
| 185 | > | ||
| 186 | <el-option | 173 | <el-option |
| 187 | v-for="item in dictData['A7']" | 174 | v-for="item in dictData['A7']" |
| 188 | :key="item.dcode" | 175 | :key="item.dcode" |
| 189 | :label="item.dname" | 176 | :label="item.dname" |
| 190 | :value="item.dcode" | 177 | :value="item.dcode"> |
| 191 | > | ||
| 192 | </el-option> | 178 | </el-option> |
| 193 | </el-select> | 179 | </el-select> |
| 194 | </div> | 180 | </div> |
| ... | @@ -200,19 +186,16 @@ | ... | @@ -200,19 +186,16 @@ |
| 200 | <el-input | 186 | <el-input |
| 201 | v-model="ruleForm.tdsyq.qtnydmj" | 187 | v-model="ruleForm.tdsyq.qtnydmj" |
| 202 | :disabled="!ableOperation" | 188 | :disabled="!ableOperation" |
| 203 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" | 189 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input> |
| 204 | ></el-input> | ||
| 205 | <el-select | 190 | <el-select |
| 206 | v-model="mjdw" | 191 | v-model="mjdw" |
| 207 | :disabled="!ableOperation" | 192 | :disabled="!ableOperation" |
| 208 | style="width: 20%" | 193 | style="width: 20%"> |
| 209 | > | ||
| 210 | <el-option | 194 | <el-option |
| 211 | v-for="item in dictData['A7']" | 195 | v-for="item in dictData['A7']" |
| 212 | :key="item.dcode" | 196 | :key="item.dcode" |
| 213 | :label="item.dname" | 197 | :label="item.dname" |
| 214 | :value="item.dcode" | 198 | :value="item.dcode"> |
| 215 | > | ||
| 216 | </el-option> | 199 | </el-option> |
| 217 | </el-select> | 200 | </el-select> |
| 218 | </div> | 201 | </div> |
| ... | @@ -224,19 +207,16 @@ | ... | @@ -224,19 +207,16 @@ |
| 224 | <el-input | 207 | <el-input |
| 225 | v-model="ruleForm.tdsyq.jsydmj" | 208 | v-model="ruleForm.tdsyq.jsydmj" |
| 226 | :disabled="!ableOperation" | 209 | :disabled="!ableOperation" |
| 227 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" | 210 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input> |
| 228 | ></el-input> | ||
| 229 | <el-select | 211 | <el-select |
| 230 | v-model="mjdw" | 212 | v-model="mjdw" |
| 231 | :disabled="!ableOperation" | 213 | :disabled="!ableOperation" |
| 232 | style="width: 20%" | 214 | style="width: 20%"> |
| 233 | > | ||
| 234 | <el-option | 215 | <el-option |
| 235 | v-for="item in dictData['A7']" | 216 | v-for="item in dictData['A7']" |
| 236 | :key="item.dcode" | 217 | :key="item.dcode" |
| 237 | :label="item.dname" | 218 | :label="item.dname" |
| 238 | :value="item.dcode" | 219 | :value="item.dcode"> |
| 239 | > | ||
| 240 | </el-option> | 220 | </el-option> |
| 241 | </el-select> | 221 | </el-select> |
| 242 | </div> | 222 | </div> |
| ... | @@ -250,19 +230,16 @@ | ... | @@ -250,19 +230,16 @@ |
| 250 | <el-input | 230 | <el-input |
| 251 | v-model="ruleForm.tdsyq.wlydmj" | 231 | v-model="ruleForm.tdsyq.wlydmj" |
| 252 | :disabled="!ableOperation" | 232 | :disabled="!ableOperation" |
| 253 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" | 233 | oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input> |
| 254 | ></el-input> | ||
| 255 | <el-select | 234 | <el-select |
| 256 | v-model="mjdw" | 235 | v-model="mjdw" |
| 257 | :disabled="!ableOperation" | 236 | :disabled="!ableOperation" |
| 258 | style="width: 20%" | 237 | style="width: 20%"> |
| 259 | > | ||
| 260 | <el-option | 238 | <el-option |
| 261 | v-for="item in dictData['A7']" | 239 | v-for="item in dictData['A7']" |
| 262 | :key="item.dcode" | 240 | :key="item.dcode" |
| 263 | :label="item.dname" | 241 | :label="item.dname" |
| 264 | :value="item.dcode" | 242 | :value="item.dcode"> |
| 265 | > | ||
| 266 | </el-option> | 243 | </el-option> |
| 267 | </el-select> | 244 | </el-select> |
| 268 | </div> | 245 | </div> |
| ... | @@ -276,8 +253,7 @@ | ... | @@ -276,8 +253,7 @@ |
| 276 | <tdytTable | 253 | <tdytTable |
| 277 | :tableData="ruleForm.tdytqxList" | 254 | :tableData="ruleForm.tdytqxList" |
| 278 | :ableOperation="ableOperation" | 255 | :ableOperation="ableOperation" |
| 279 | @upDateTdytxxList="upDateTdytxxList" | 256 | @upDateTdytxxList="upDateTdytxxList" /> |
| 280 | /> | ||
| 281 | <div class="slxx_title title-block"> | 257 | <div class="slxx_title title-block"> |
| 282 | 权利人信息 | 258 | 权利人信息 |
| 283 | <div class="triangle"></div> | 259 | <div class="triangle"></div> |
| ... | @@ -287,8 +263,7 @@ | ... | @@ -287,8 +263,7 @@ |
| 287 | <el-form-item label="共有方式:"> | 263 | <el-form-item label="共有方式:"> |
| 288 | <el-radio-group | 264 | <el-radio-group |
| 289 | :disabled="!ableOperation" | 265 | :disabled="!ableOperation" |
| 290 | v-model="ruleForm.sldy.gyfs" | 266 | v-model="ruleForm.sldy.gyfs"> |
| 291 | > | ||
| 292 | <el-radio label="0">单独所有</el-radio> | 267 | <el-radio label="0">单独所有</el-radio> |
| 293 | <el-radio label="1">共同共有</el-radio> | 268 | <el-radio label="1">共同共有</el-radio> |
| 294 | <el-radio label="2">按份所有</el-radio> | 269 | <el-radio label="2">按份所有</el-radio> |
| ... | @@ -300,8 +275,7 @@ | ... | @@ -300,8 +275,7 @@ |
| 300 | <el-form-item label="是否分别持证:"> | 275 | <el-form-item label="是否分别持证:"> |
| 301 | <el-radio-group | 276 | <el-radio-group |
| 302 | v-model="ruleForm.sldy.sqfbcz" | 277 | v-model="ruleForm.sldy.sqfbcz" |
| 303 | :disabled="!ableOperation" | 278 | :disabled="!ableOperation"> |
| 304 | > | ||
| 305 | <el-radio :label="1">是</el-radio> | 279 | <el-radio :label="1">是</el-radio> |
| 306 | <el-radio :label="0">否</el-radio> | 280 | <el-radio :label="0">否</el-radio> |
| 307 | </el-radio-group> | 281 | </el-radio-group> |
| ... | @@ -309,20 +283,17 @@ | ... | @@ -309,20 +283,17 @@ |
| 309 | </el-col> | 283 | </el-col> |
| 310 | <el-col | 284 | <el-col |
| 311 | :span="6" | 285 | :span="6" |
| 312 | v-show="ruleForm.sldy.sqfbcz == '0' && ruleForm.sldy.gyfs == '1'" | 286 | v-show="ruleForm.sldy.sqfbcz == '0' && ruleForm.sldy.gyfs == '1'"> |
| 313 | > | ||
| 314 | <el-form-item label="持证人:"> | 287 | <el-form-item label="持证人:"> |
| 315 | <el-select | 288 | <el-select |
| 316 | v-model="ruleForm.czr" | 289 | v-model="ruleForm.czr" |
| 317 | placeholder="持证人" | 290 | placeholder="持证人" |
| 318 | :disabled="!ableOperation" | 291 | :disabled="!ableOperation"> |
| 319 | > | ||
| 320 | <el-option | 292 | <el-option |
| 321 | v-for="item in czrOptions" | 293 | v-for="item in czrOptions" |
| 322 | :key="item.zjh" | 294 | :key="item.zjh" |
| 323 | :label="item.sqrmc" | 295 | :label="item.sqrmc" |
| 324 | :value="item.zjh" | 296 | :value="item.zjh"> |
| 325 | > | ||
| 326 | </el-option> | 297 | </el-option> |
| 327 | </el-select> | 298 | </el-select> |
| 328 | </el-form-item> | 299 | </el-form-item> |
| ... | @@ -333,8 +304,7 @@ | ... | @@ -333,8 +304,7 @@ |
| 333 | :disabled="!ableOperation" | 304 | :disabled="!ableOperation" |
| 334 | @upDateQlrxxList="upDateQlrxxList" | 305 | @upDateQlrxxList="upDateQlrxxList" |
| 335 | :key="key" | 306 | :key="key" |
| 336 | :gyfs="ruleForm.sldy.gyfs" | 307 | :gyfs="ruleForm.sldy.gyfs" /> |
| 337 | /> | ||
| 338 | 308 | ||
| 339 | <div v-if="ruleForm.ywrList && ruleForm.ywrList.length > 0"> | 309 | <div v-if="ruleForm.ywrList && ruleForm.ywrList.length > 0"> |
| 340 | <div class="slxx_title title-block"> | 310 | <div class="slxx_title title-block"> |
| ... | @@ -346,8 +316,7 @@ | ... | @@ -346,8 +316,7 @@ |
| 346 | :disabled="!ableOperation" | 316 | :disabled="!ableOperation" |
| 347 | :tableData="ruleForm.ywrList" | 317 | :tableData="ruleForm.ywrList" |
| 348 | :key="key" | 318 | :key="key" |
| 349 | @upDateQlrxxList="upDateYwrxxList" | 319 | @upDateQlrxxList="upDateYwrxxList" /> |
| 350 | /> | ||
| 351 | </div> | 320 | </div> |
| 352 | 321 | ||
| 353 | <div class="slxx_title title-block"> | 322 | <div class="slxx_title title-block"> |
| ... | @@ -361,8 +330,7 @@ | ... | @@ -361,8 +330,7 @@ |
| 361 | class="textArea" | 330 | class="textArea" |
| 362 | type="textarea" | 331 | type="textarea" |
| 363 | :disabled="!ableOperation" | 332 | :disabled="!ableOperation" |
| 364 | v-model="ruleForm.tdsyq.djyy" | 333 | v-model="ruleForm.tdsyq.djyy"> |
| 365 | > | ||
| 366 | </el-input> | 334 | </el-input> |
| 367 | </el-form-item> | 335 | </el-form-item> |
| 368 | </el-col> | 336 | </el-col> |
| ... | @@ -377,135 +345,135 @@ | ... | @@ -377,135 +345,135 @@ |
| 377 | </div> | 345 | </div> |
| 378 | </template> | 346 | </template> |
| 379 | <script> | 347 | <script> |
| 380 | import { mapGetters } from "vuex"; | 348 | import { mapGetters } from "vuex"; |
| 381 | import { Init, saveData } from "@/api/workflow/tdsyqFlow.js"; | 349 | import { Init, saveData } from "@/api/workflow/tdsyqFlow.js"; |
| 382 | import tdytTable from "@/views/workflow/components/tdytTable"; | 350 | import tdytTable from "@/views/workflow/components/tdytTable"; |
| 383 | import qlrCommonTable from "@/views/workflow/components/qlrCommonTable"; | 351 | import qlrCommonTable from "@/views/workflow/components/qlrCommonTable"; |
| 384 | export default { | 352 | export default { |
| 385 | components: { qlrCommonTable, tdytTable }, | 353 | components: { qlrCommonTable, tdytTable }, |
| 386 | mounted() { | 354 | mounted () { |
| 387 | this.ableOperation = this.$parent.currentSelectTab.ableOperation; | 355 | this.ableOperation = this.$parent.currentSelectTab.ableOperation; |
| 388 | this.propsParam = this.$attrs; | 356 | this.propsParam = this.$attrs; |
| 389 | var formdata = new FormData(); | 357 | var formdata = new FormData(); |
| 390 | let that = this; | 358 | let that = this; |
| 391 | this.$startLoading(); | 359 | this.$startLoading(); |
| 392 | formdata.append("bsmSldy", this.propsParam.bsmSldy); | 360 | formdata.append("bsmSldy", this.propsParam.bsmSldy); |
| 393 | formdata.append("djlx", this.propsParam.djlx); | 361 | formdata.append("djlx", this.propsParam.djlx); |
| 394 | formdata.append("isEdit", this.ableOperation); | 362 | formdata.append("isEdit", this.ableOperation); |
| 395 | Init(formdata).then((res) => { | 363 | Init(formdata).then((res) => { |
| 396 | this.$nextTick(() => { | 364 | this.$nextTick(() => { |
| 397 | that.ruleForm = res.result; | 365 | that.ruleForm = res.result; |
| 398 | that.$endLoading(); | 366 | that.$endLoading(); |
| 399 | that.isShow = true; | 367 | that.isShow = true; |
| 400 | this.czrOptions = this.ruleForm.qlrList; | 368 | this.czrOptions = this.ruleForm.qlrList; |
| 369 | }); | ||
| 401 | }); | 370 | }); |
| 402 | }); | ||
| 403 | }, | ||
| 404 | |||
| 405 | computed: { | ||
| 406 | ...mapGetters(["dictData", "flag"]), | ||
| 407 | }, | ||
| 408 | data() { | ||
| 409 | return { | ||
| 410 | mjdw: "1", | ||
| 411 | value2: { | ||
| 412 | id: "520000198407304275", | ||
| 413 | user: "史平", | ||
| 414 | }, | ||
| 415 | props: { | ||
| 416 | label: "user", | ||
| 417 | value: "id", | ||
| 418 | keyword: "keyword", | ||
| 419 | }, | ||
| 420 | |||
| 421 | //表单是否可操作 | ||
| 422 | ableOperation: true, | ||
| 423 | key: 0, | ||
| 424 | isShow: false, | ||
| 425 | disabled: true, | ||
| 426 | czrOptions: [], | ||
| 427 | ruleForm: {}, | ||
| 428 | //传递参数 | ||
| 429 | propsParam: {}, | ||
| 430 | rules: {}, | ||
| 431 | }; | ||
| 432 | }, | ||
| 433 | methods: { | ||
| 434 | // 更新土地用途信息 | ||
| 435 | upDateTdytxxList(val) { | ||
| 436 | this.ruleForm.tdytqxList && (this.ruleForm.tdytqxList = _.cloneDeep(val)); | ||
| 437 | this.key++; | ||
| 438 | }, | ||
| 439 | // 更新权利人信息 | ||
| 440 | upDateQlrxxList(val) { | ||
| 441 | this.ruleForm.qlrList && (this.ruleForm.qlrList = _.cloneDeep(val)); | ||
| 442 | this.czrOptions = this.ruleForm.qlrList; | ||
| 443 | this.key++; | ||
| 444 | }, | 371 | }, |
| 445 | // 更新义务人信息 | 372 | |
| 446 | upDateYwrxxList(val) { | 373 | computed: { |
| 447 | this.ruleForm.ywrList && (this.ruleForm.ywrList = _.cloneDeep(val)); | 374 | ...mapGetters(["dictData", "flag"]), |
| 448 | this.key++; | ||
| 449 | }, | 375 | }, |
| 450 | onSubmit() { | 376 | data () { |
| 451 | if (this.ruleForm.qlrList.length == 0) { | 377 | return { |
| 452 | this.$message({ | 378 | mjdw: "1", |
| 453 | showClose: true, | 379 | value2: { |
| 454 | message: "请确认权利人信息", | 380 | id: "520000198407304275", |
| 455 | type: "error", | 381 | user: "史平", |
| 456 | }); | 382 | }, |
| 457 | return false; | 383 | props: { |
| 458 | } | 384 | label: "user", |
| 385 | value: "id", | ||
| 386 | keyword: "keyword", | ||
| 387 | }, | ||
| 459 | 388 | ||
| 460 | if (this.ruleForm.sldy.gyfs == "0") { | 389 | //表单是否可操作 |
| 461 | if (this.ruleForm.qlrList.length > 1) { | 390 | ableOperation: true, |
| 391 | key: 0, | ||
| 392 | isShow: false, | ||
| 393 | disabled: true, | ||
| 394 | czrOptions: [], | ||
| 395 | ruleForm: {}, | ||
| 396 | //传递参数 | ||
| 397 | propsParam: {}, | ||
| 398 | rules: {}, | ||
| 399 | }; | ||
| 400 | }, | ||
| 401 | methods: { | ||
| 402 | // 更新土地用途信息 | ||
| 403 | upDateTdytxxList (val) { | ||
| 404 | this.ruleForm.tdytqxList && (this.ruleForm.tdytqxList = _.cloneDeep(val)); | ||
| 405 | this.key++; | ||
| 406 | }, | ||
| 407 | // 更新权利人信息 | ||
| 408 | upDateQlrxxList (val) { | ||
| 409 | this.ruleForm.qlrList && (this.ruleForm.qlrList = _.cloneDeep(val)); | ||
| 410 | this.czrOptions = this.ruleForm.qlrList; | ||
| 411 | this.key++; | ||
| 412 | }, | ||
| 413 | // 更新义务人信息 | ||
| 414 | upDateYwrxxList (val) { | ||
| 415 | this.ruleForm.ywrList && (this.ruleForm.ywrList = _.cloneDeep(val)); | ||
| 416 | this.key++; | ||
| 417 | }, | ||
| 418 | onSubmit () { | ||
| 419 | if (this.ruleForm.qlrList.length == 0) { | ||
| 462 | this.$message({ | 420 | this.$message({ |
| 463 | showClose: true, | 421 | showClose: true, |
| 464 | message: "共有方式:单独所有,权利人只能是一个人", | 422 | message: "请确认权利人信息", |
| 465 | type: "error", | 423 | type: "error", |
| 466 | }); | 424 | }); |
| 467 | return false; | 425 | return false; |
| 468 | } | 426 | } |
| 469 | this.ruleForm.qlrList[0].sfczr = "1"; | 427 | |
| 470 | } | 428 | if (this.ruleForm.sldy.gyfs == "0") { |
| 471 | if (this.ruleForm.sldy.gyfs == "1") { | 429 | if (this.ruleForm.qlrList.length > 1) { |
| 472 | //是否分别持证 | 430 | this.$message({ |
| 473 | if (this.ruleForm.sldy.sqfbcz == "1") { | 431 | showClose: true, |
| 474 | //是 | 432 | message: "共有方式:单独所有,权利人只能是一个人", |
| 475 | this.ruleForm.qlrList.forEach((item, index) => { | 433 | type: "error", |
| 476 | item.sfczr = "1"; | 434 | }); |
| 477 | }); | 435 | return false; |
| 478 | } else { | 436 | } |
| 479 | this.ruleForm.qlrList.forEach((item, index) => { | 437 | this.ruleForm.qlrList[0].sfczr = "1"; |
| 480 | if (item.zjh == this.ruleForm.czr) { | ||
| 481 | item.sfczr = "1"; | ||
| 482 | } else { | ||
| 483 | item.sfczr = "0"; | ||
| 484 | } | ||
| 485 | }); | ||
| 486 | } | 438 | } |
| 487 | } | 439 | if (this.ruleForm.sldy.gyfs == "1") { |
| 488 | saveData(this.ruleForm).then((res) => { | 440 | //是否分别持证 |
| 489 | if (res.code === 200) { | 441 | if (this.ruleForm.sldy.sqfbcz == "1") { |
| 490 | this.$message({ | 442 | //是 |
| 491 | showClose: true, | 443 | this.ruleForm.qlrList.forEach((item, index) => { |
| 492 | message: "保存成功!", | 444 | item.sfczr = "1"; |
| 493 | type: "success", | 445 | }); |
| 494 | }); | 446 | } else { |
| 495 | this.$store.dispatch("user/refreshPage", true); | 447 | this.ruleForm.qlrList.forEach((item, index) => { |
| 496 | } else { | 448 | if (item.zjh == this.ruleForm.czr) { |
| 497 | this.$message({ | 449 | item.sfczr = "1"; |
| 498 | showClose: true, | 450 | } else { |
| 499 | message: res.message, | 451 | item.sfczr = "0"; |
| 500 | type: "error", | 452 | } |
| 501 | }); | 453 | }); |
| 454 | } | ||
| 502 | } | 455 | } |
| 503 | }); | 456 | saveData(this.ruleForm).then((res) => { |
| 457 | if (res.code === 200) { | ||
| 458 | this.$message({ | ||
| 459 | showClose: true, | ||
| 460 | message: "保存成功!", | ||
| 461 | type: "success", | ||
| 462 | }); | ||
| 463 | this.$store.dispatch("user/refreshPage", true); | ||
| 464 | } else { | ||
| 465 | this.$message({ | ||
| 466 | showClose: true, | ||
| 467 | message: res.message, | ||
| 468 | type: "error", | ||
| 469 | }); | ||
| 470 | } | ||
| 471 | }); | ||
| 472 | }, | ||
| 504 | }, | 473 | }, |
| 505 | }, | 474 | }; |
| 506 | }; | ||
| 507 | </script> | 475 | </script> |
| 508 | <style scoped lang="scss"> | 476 | <style scoped lang="scss"> |
| 509 | @import "~@/styles/public.scss"; | 477 | @import "~@/styles/public.scss"; |
| 510 | @import "~@/styles/slxx/slxx.scss"; | 478 | @import "~@/styles/slxx/slxx.scss"; |
| 511 | </style> | 479 | </style> | ... | ... |
| ... | @@ -174,7 +174,7 @@ | ... | @@ -174,7 +174,7 @@ |
| 174 | 抵押人信息 | 174 | 抵押人信息 |
| 175 | <div class="triangle"></div> | 175 | <div class="triangle"></div> |
| 176 | </div> | 176 | </div> |
| 177 | <qlrCommonTable :tableData="ruleForm.ywrList" @upDateQlrxxList="upDateYwrxxList" :disabled="!ableOperation"/> | 177 | <qlrCommonTable :tableData="ruleForm.ywrList" @upDateQlrxxList="upDateYwrxxList" :disabled="!ableOperation" /> |
| 178 | 178 | ||
| 179 | <div class="slxx_title title-block"> | 179 | <div class="slxx_title title-block"> |
| 180 | 登记原因 | 180 | 登记原因 |
| ... | @@ -194,7 +194,6 @@ | ... | @@ -194,7 +194,6 @@ |
| 194 | </el-form-item> | 194 | </el-form-item> |
| 195 | </el-col> | 195 | </el-col> |
| 196 | </el-row> | 196 | </el-row> |
| 197 | |||
| 198 | </div> | 197 | </div> |
| 199 | <el-row class="btn" v-if="ableOperation"> | 198 | <el-row class="btn" v-if="ableOperation"> |
| 200 | <el-form-item> | 199 | <el-form-item> | ... | ... |
| ... | @@ -218,7 +218,7 @@ | ... | @@ -218,7 +218,7 @@ |
| 218 | 抵押人信息 | 218 | 抵押人信息 |
| 219 | <div class="triangle"></div> | 219 | <div class="triangle"></div> |
| 220 | </div> | 220 | </div> |
| 221 | <qlrCommonTable :tableData="ruleForm.ywrList" @upDateQlrxxList="upDateYwrxxList" :disabled="!ableOperation"/> | 221 | <qlrCommonTable :tableData="ruleForm.ywrList" @upDateQlrxxList="upDateYwrxxList" :disabled="!ableOperation" /> |
| 222 | 222 | ||
| 223 | <div class="slxx_title title-block"> | 223 | <div class="slxx_title title-block"> |
| 224 | 登记原因 | 224 | 登记原因 |
| ... | @@ -238,7 +238,6 @@ | ... | @@ -238,7 +238,6 @@ |
| 238 | </el-form-item> | 238 | </el-form-item> |
| 239 | </el-col> | 239 | </el-col> |
| 240 | </el-row> | 240 | </el-row> |
| 241 | |||
| 242 | </div> | 241 | </div> |
| 243 | <el-row class="btn" v-if="ableOperation"> | 242 | <el-row class="btn" v-if="ableOperation"> |
| 244 | <el-form-item> | 243 | <el-form-item> | ... | ... |
| ... | @@ -3,9 +3,7 @@ const path = require('path') | ... | @@ -3,9 +3,7 @@ const path = require('path') |
| 3 | function resolve (dir) { | 3 | function resolve (dir) { |
| 4 | return path.join(__dirname, dir) | 4 | return path.join(__dirname, dir) |
| 5 | } | 5 | } |
| 6 | |||
| 7 | const port = process.env.port || process.env.npm_config_port || 8888 // dev port | 6 | const port = process.env.port || process.env.npm_config_port || 8888 // dev port |
| 8 | |||
| 9 | // All configuration item explanations can be find in https://cli.vuejs.org/config/ | 7 | // All configuration item explanations can be find in https://cli.vuejs.org/config/ |
| 10 | module.exports = { | 8 | module.exports = { |
| 11 | /** | 9 | /** | ... | ... |
-
Please register or sign in to post a comment