mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 优化复制链接
This commit is contained in:
parent
f0d4aa324e
commit
e176600a5a
@ -92,23 +92,25 @@
|
|||||||
<div>
|
<div>
|
||||||
<div style="margin:-10px 0 8px">{{$L('文件名称')}}: {{linkData.name}}</div>
|
<div style="margin:-10px 0 8px">{{$L('文件名称')}}: {{linkData.name}}</div>
|
||||||
<Input ref="linkInput" v-model="linkData.url" type="textarea" :rows="3" @on-focus="linkFocus" readonly/>
|
<Input ref="linkInput" v-model="linkData.url" type="textarea" :rows="3" @on-focus="linkFocus" readonly/>
|
||||||
<div class="form-tip" style="padding-top:6px">{{$L('可通过此链接浏览文件。')}}<a href="javascript:void(0)" @click="linkCopy">{{$L('点击复制链接')}}</a></div>
|
<div class="form-tip" style="padding-top:6px">
|
||||||
|
{{$L('可通过此链接浏览文件。')}}
|
||||||
|
<Poptip
|
||||||
|
confirm
|
||||||
|
placement="bottom"
|
||||||
|
:ok-text="$L('确定')"
|
||||||
|
:cancel-text="$L('取消')"
|
||||||
|
@on-ok="linkGet(true)"
|
||||||
|
transfer>
|
||||||
|
<div slot="title">
|
||||||
|
<p><strong>{{$L('注意:刷新将导致原来的链接失效!')}}</strong></p>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0)">{{$L('刷新链接')}}</a>
|
||||||
|
</Poptip>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="adaption">
|
<div slot="footer" class="adaption">
|
||||||
<Button type="default" @click="linkShow=false">{{$L('取消')}}</Button>
|
<Button type="default" @click="linkShow=false">{{$L('取消')}}</Button>
|
||||||
<Poptip
|
<Button type="primary" :loading="linkLoad > 0" @click="linkCopy">{{$L('复制')}}</Button>
|
||||||
confirm
|
|
||||||
placement="bottom"
|
|
||||||
style="margin-left:8px"
|
|
||||||
:ok-text="$L('确定')"
|
|
||||||
:cancel-text="$L('取消')"
|
|
||||||
@on-ok="linkGet(true)"
|
|
||||||
transfer>
|
|
||||||
<div slot="title">
|
|
||||||
<p><strong>{{$L('注意:刷新将导致原来的链接失效!')}}</strong></p>
|
|
||||||
</div>
|
|
||||||
<Button type="primary" :loading="linkLoad > 0">{{$L('刷新')}}</Button>
|
|
||||||
</Poptip>
|
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
@ -458,7 +460,7 @@ export default {
|
|||||||
id: this.linkData.id,
|
id: this.linkData.id,
|
||||||
name: this.linkData.name,
|
name: this.linkData.name,
|
||||||
});
|
});
|
||||||
this.linkFocus();
|
this.linkCopy();
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
this.linkShow = false
|
this.linkShow = false
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
|
|||||||
@ -387,24 +387,26 @@
|
|||||||
<Form :model="inviteData" label-width="auto" @submit.native.prevent>
|
<Form :model="inviteData" label-width="auto" @submit.native.prevent>
|
||||||
<FormItem :label="$L('链接地址')">
|
<FormItem :label="$L('链接地址')">
|
||||||
<Input ref="inviteInput" v-model="inviteData.url" type="textarea" :rows="3" @on-focus="inviteFocus" readonly/>
|
<Input ref="inviteInput" v-model="inviteData.url" type="textarea" :rows="3" @on-focus="inviteFocus" readonly/>
|
||||||
<div class="form-tip">{{$L('可通过此链接直接加入项目。')}}</div>
|
<div class="form-tip">
|
||||||
|
{{$L('可通过此链接直接加入项目。')}}
|
||||||
|
<Poptip
|
||||||
|
confirm
|
||||||
|
placement="bottom"
|
||||||
|
:ok-text="$L('确定')"
|
||||||
|
:cancel-text="$L('取消')"
|
||||||
|
@on-ok="inviteGet(true)"
|
||||||
|
transfer>
|
||||||
|
<div slot="title">
|
||||||
|
<p><strong>{{$L('注意:刷新将导致原来的邀请链接失效!')}}</strong></p>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0)">{{$L('刷新链接')}}</a>
|
||||||
|
</Poptip>
|
||||||
|
</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div slot="footer" class="adaption">
|
<div slot="footer" class="adaption">
|
||||||
<Button type="default" @click="inviteShow=false">{{$L('取消')}}</Button>
|
<Button type="default" @click="inviteShow=false">{{$L('取消')}}</Button>
|
||||||
<Poptip
|
<Button type="primary" :loading="inviteLoad > 0" @click="inviteCopy">{{$L('复制')}}</Button>
|
||||||
confirm
|
|
||||||
placement="bottom"
|
|
||||||
style="margin-left:8px"
|
|
||||||
:ok-text="$L('确定')"
|
|
||||||
:cancel-text="$L('取消')"
|
|
||||||
@on-ok="inviteGet(true)"
|
|
||||||
transfer>
|
|
||||||
<div slot="title">
|
|
||||||
<p><strong>{{$L('注意:刷新将导致原来的邀请链接失效!')}}</strong></p>
|
|
||||||
</div>
|
|
||||||
<Button type="primary" :loading="inviteLoad > 0">{{$L('刷新')}}</Button>
|
|
||||||
</Poptip>
|
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
@ -1369,6 +1371,7 @@ export default {
|
|||||||
if (!this.inviteData.url) {
|
if (!this.inviteData.url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.inviteFocus();
|
||||||
this.$copyText(this.inviteData.url).then(_ => {
|
this.$copyText(this.inviteData.url).then(_ => {
|
||||||
$A.messageSuccess('复制成功');
|
$A.messageSuccess('复制成功');
|
||||||
}).catch(_ => {
|
}).catch(_ => {
|
||||||
@ -1377,7 +1380,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
inviteFocus() {
|
inviteFocus() {
|
||||||
this.$refs.inviteInput.focus({cursor:'all'});
|
this.$nextTick(_ => {
|
||||||
|
this.$refs.inviteInput.focus({cursor:'all'});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleCompleted() {
|
toggleCompleted() {
|
||||||
|
|||||||
@ -340,23 +340,25 @@
|
|||||||
<div>
|
<div>
|
||||||
<div style="margin:-10px 0 8px">{{$L('文件名称')}}: {{linkData.name}}</div>
|
<div style="margin:-10px 0 8px">{{$L('文件名称')}}: {{linkData.name}}</div>
|
||||||
<Input ref="linkInput" v-model="linkData.url" type="textarea" :rows="3" @on-focus="linkFocus" readonly/>
|
<Input ref="linkInput" v-model="linkData.url" type="textarea" :rows="3" @on-focus="linkFocus" readonly/>
|
||||||
<div class="form-tip" style="padding-top:6px">{{$L('可通过此链接浏览文件。')}}<a href="javascript:void(0)" @click="linkCopy">{{$L('点击复制链接')}}</a></div>
|
<div class="form-tip" style="padding-top:6px">
|
||||||
|
{{$L('可通过此链接浏览文件。')}}
|
||||||
|
<Poptip
|
||||||
|
confirm
|
||||||
|
placement="bottom"
|
||||||
|
:ok-text="$L('确定')"
|
||||||
|
:cancel-text="$L('取消')"
|
||||||
|
@on-ok="linkGet(true)"
|
||||||
|
transfer>
|
||||||
|
<div slot="title">
|
||||||
|
<p><strong>{{$L('注意:刷新将导致原来的链接失效!')}}</strong></p>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0)">{{$L('刷新链接')}}</a>
|
||||||
|
</Poptip>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="adaption">
|
<div slot="footer" class="adaption">
|
||||||
<Button type="default" @click="linkShow=false">{{$L('取消')}}</Button>
|
<Button type="default" @click="linkShow=false">{{$L('取消')}}</Button>
|
||||||
<Poptip
|
<Button type="primary" :loading="linkLoad > 0" @click="linkCopy">{{$L('复制')}}</Button>
|
||||||
confirm
|
|
||||||
placement="bottom"
|
|
||||||
style="margin-left:8px"
|
|
||||||
:ok-text="$L('确定')"
|
|
||||||
:cancel-text="$L('取消')"
|
|
||||||
@on-ok="linkGet(true)"
|
|
||||||
transfer>
|
|
||||||
<div slot="title">
|
|
||||||
<p><strong>{{$L('注意:刷新将导致原来的链接失效!')}}</strong></p>
|
|
||||||
</div>
|
|
||||||
<Button type="primary" :loading="linkLoad > 0">{{$L('刷新')}}</Button>
|
|
||||||
</Poptip>
|
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
@ -1300,7 +1302,7 @@ export default {
|
|||||||
id: this.linkData.id,
|
id: this.linkData.id,
|
||||||
name: this.linkData.name
|
name: this.linkData.name
|
||||||
});
|
});
|
||||||
this.linkFocus();
|
this.linkCopy();
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
this.linkShow = false
|
this.linkShow = false
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user