|
@@ -50,7 +50,7 @@
|
|
|
</div>
|
|
|
<div class="ui-between footer" app-border dir-top>
|
|
|
<button class="ui-button deepcancel" :class="{ disable: false }" @click="cancel">{{$i18n.t('hotspot.cancel')}}</button>
|
|
|
- <button class="ui-button submit" :class="{ disable: false }" @click="save">{{$i18n.t('hotspot.finish')}}</button>
|
|
|
+ <button class="ui-button submit" :class="{ disable: !canSubmit }" @click="save">{{$i18n.t('hotspot.finish')}}</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</transition>
|
|
@@ -235,6 +235,33 @@ export default {
|
|
|
let tmp = this.hotspot.hotspotType
|
|
|
return () => import(`./hotspotType/${tmp}.vue`);
|
|
|
},
|
|
|
+ canSubmit() {
|
|
|
+ let { img, hotspotTitle, hotspotType } = this.hotspot
|
|
|
+ let item = HTMap[hotspotType]
|
|
|
+
|
|
|
+ if (!img) {
|
|
|
+ // return this.$alert({
|
|
|
+ // content: this.$i18n.t('hotspot.select_hotspot_icon'),
|
|
|
+ // });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!(hotspotTitle.trim()/* && (hotspotTitle.trim() != this.$i18n.t('hotspot.click_to_comfirm'))*/)) {
|
|
|
+ // return this.$alert({
|
|
|
+ // content: this.$i18n.t('hotspot.input_hotspot_title'),
|
|
|
+ // });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.hotspot[item.key] || (item.type == 'Array' && this.hotspot[item.key].length <= 0)) {
|
|
|
+ // return this.$alert({
|
|
|
+ // content: `${item.errortxt}`,
|
|
|
+ // });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ return true
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.selectItem = {
|
|
@@ -339,26 +366,6 @@ export default {
|
|
|
this.$getKrpano().set(`hotspot[${data.name}].url`, data.img)
|
|
|
},
|
|
|
save() {
|
|
|
- let { img, hotspotTitle, hotspotType } = this.hotspot
|
|
|
- let item = HTMap[hotspotType]
|
|
|
-
|
|
|
- if (!img) {
|
|
|
- return this.$alert({
|
|
|
- content: this.$i18n.t('hotspot.select_hotspot_icon'),
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- if (!(hotspotTitle.trim() && (hotspotTitle.trim() != '单击确定热点位置'&&hotspotTitle.trim() != this.$i18n.t('hotspot.click_to_comfirm')))) {
|
|
|
- return this.$alert({
|
|
|
- content: this.$i18n.t('hotspot.input_hotspot_title'),
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- if (!this.hotspot[item.key] || (item.type == 'Array' && this.hotspot[item.key].length <= 0)) {
|
|
|
- return this.$alert({
|
|
|
- content: `${item.errortxt}`,
|
|
|
- });
|
|
|
- }
|
|
|
this.$store.commit("SetHotspot", this.hotspot);
|
|
|
this.$emit("close");
|
|
|
this.$emit("save", this.hotspot);
|