|
@@ -2,7 +2,7 @@
|
|
|
<popup>
|
|
|
<div class="ui-message ui-message-confirm" style="width: 400px">
|
|
|
<div class="ui-message-header">
|
|
|
- <span>{{$i18n.t(`gather.new_folder`)}}</span>
|
|
|
+ <span>{{ $i18n.t(`gather.new_folder`) }}</span>
|
|
|
<span @click="$emit('close')">
|
|
|
<i class="iconfont icon-close"></i>
|
|
|
</span>
|
|
@@ -17,23 +17,27 @@
|
|
|
type="text"
|
|
|
maxlength="15"
|
|
|
:placeholder="$i18n.t(`gather.new_folder_placeholder`)"
|
|
|
- @input="emojistr" v-model="key"
|
|
|
+ @input="emojistr"
|
|
|
+ v-model="key"
|
|
|
/>
|
|
|
<div v-if="!validateRes.isValid" class="invalid-tip">
|
|
|
- {{validateRes.tip}}
|
|
|
+ {{ validateRes.tip }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ui-message-footer">
|
|
|
<div class="btn">
|
|
|
- <button @click="$emit('close')" class="ui-button ui-button-rect cancel">
|
|
|
- {{$i18n.t(`gather.cancel`)}}
|
|
|
+ <button
|
|
|
+ @click="$emit('close')"
|
|
|
+ class="ui-button ui-button-rect cancel"
|
|
|
+ >
|
|
|
+ {{ $i18n.t(`gather.cancel`) }}
|
|
|
</button>
|
|
|
<button
|
|
|
@click="onClickConfirm"
|
|
|
class="ui-button ui-button-rect submit"
|
|
|
- :class="{disable: !key || !validateRes.isValid}"
|
|
|
+ :class="{ disable: !key || !validateRes.isValid }"
|
|
|
>
|
|
|
- {{$i18n.t(`gather.comfirm`)}}
|
|
|
+ {{ $i18n.t(`gather.comfirm`) }}
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -46,61 +50,62 @@ import Popup from "@/components/shared/popup";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- Popup
|
|
|
+ Popup,
|
|
|
},
|
|
|
props: {
|
|
|
validate: {
|
|
|
type: Function,
|
|
|
- default: function() {
|
|
|
+ default: function () {
|
|
|
return {
|
|
|
isValid: true,
|
|
|
- tip: '',
|
|
|
- }
|
|
|
+ tip: "",
|
|
|
+ };
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- key: '',
|
|
|
+ key: "",
|
|
|
validateRes: {
|
|
|
isValid: true,
|
|
|
- tip: '',
|
|
|
- }
|
|
|
- }
|
|
|
+ tip: "",
|
|
|
+ },
|
|
|
+ };
|
|
|
},
|
|
|
watch: {
|
|
|
key: {
|
|
|
handler(v) {
|
|
|
- this.validateRes = this.validate(v)
|
|
|
- }
|
|
|
- }
|
|
|
+ this.validateRes = this.validate(v);
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.$refs.input.focus()
|
|
|
+ this.$refs.input.focus();
|
|
|
},
|
|
|
methods: {
|
|
|
- emojistr() {
|
|
|
- this.key = this.key.replace(/(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f])|(\ud83d[\ude80-\udeff])/g, function (char) {
|
|
|
- if (char.length === 2) {
|
|
|
- return ""
|
|
|
- } else {
|
|
|
- return char
|
|
|
+ emojistr() {
|
|
|
+ this.key = this.key.replace(
|
|
|
+ /(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f])|(\ud83d[\ude80-\udeff])/g,
|
|
|
+ function (char) {
|
|
|
+ if (char.length === 2) {
|
|
|
+ return "";
|
|
|
+ } else {
|
|
|
+ return char;
|
|
|
+ }
|
|
|
}
|
|
|
- }).replace(/\s+/g,'');
|
|
|
+ );
|
|
|
},
|
|
|
onClickConfirm() {
|
|
|
if (!this.key.trim()) {
|
|
|
return this.$alert({ content: "请输入名字" });
|
|
|
}
|
|
|
- this.$emit('submit', this.key)
|
|
|
+ this.$emit("submit", String(this.key).trim());
|
|
|
},
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-
|
|
|
-
|
|
|
.ui-message-confirm {
|
|
|
width: 400px;
|
|
|
height: 230px;
|
|
@@ -118,7 +123,7 @@ export default {
|
|
|
color: #323233;
|
|
|
font-size: 14px;
|
|
|
border-radius: 4px;
|
|
|
- border: 1px solid #EBEDF0;
|
|
|
+ border: 1px solid #ebedf0;
|
|
|
&:focus {
|
|
|
border: 1px solid @color;
|
|
|
}
|
|
@@ -146,18 +151,17 @@ export default {
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
.ui-button {
|
|
|
- max-width: 104px
|
|
|
+ max-width: 104px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-@import '../style.less';
|
|
|
+@import "../style.less";
|
|
|
</style>
|
|
|
|
|
|
<!-- https://ossxiaoan.4dage.com/720yun_fd_manage/image/20230419_170916442.jpg?d=1681895356516 -->
|
|
|
<!-- https://ossxiaoan.4dage.com/720yun_fd_manage/fd720_1ymO1oQ7l/preview.jpg?0.6912560855121661 -->
|
|
|
-<!-- https://ossxiaoan.4dage.com/720yun_fd_manage/fd720_dlq9lADG1/vtour/panos/fd720_dlq9lADG1.tiles/preview.jpg -->
|
|
|
+<!-- https://ossxiaoan.4dage.com/720yun_fd_manage/fd720_dlq9lADG1/vtour/panos/fd720_dlq9lADG1.tiles/preview.jpg -->
|