|
|
@@ -32,20 +32,22 @@
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="600px"
|
|
|
:modal="false"
|
|
|
- class="text-center"
|
|
|
>
|
|
|
|
|
|
<p>{{$t('item_page_address')}} : <code >{{share_page_link}}</code>
|
|
|
</p>
|
|
|
- <p><a href="javascript:;" class="home-phone-butt" v-clipboard:copyhttplist="copyText1" v-clipboard:success="onCopy">{{$t('copy_link')}}</a></p>
|
|
|
- <p style="border-bottom: 1px solid #eee;"><img id="qr-page-link" style="width:114px;height:114px;" :src="qr_page_link"> </p>
|
|
|
-
|
|
|
- <p >{{$t('single_page_address')}} : <code id="share-single-link">{{share_single_link}}</code>
|
|
|
- </p>
|
|
|
- <p><a href="javascript:;" class="home-phone-butt" v-clipboard:copyhttplist="copyText2" v-clipboard:success="onCopy">{{$t('copy_link')}}</a></p>
|
|
|
- <p style="border-bottom: 1px solid #eee;"><img id="qr-single-link" style="width:114px;height:114px;" :src="qr_single_link"> </p>
|
|
|
- <p><a href="https://www.showdoc.cc/page/63882" target="_blank">{{$t('page_diff_tips')}}</a></p><p>
|
|
|
- </p>
|
|
|
+ <p v-if="false" style="border-bottom: 1px solid #eee;"><img id="qr-page-link" style="width:114px;height:114px;" :src="qr_page_link"> </p>
|
|
|
+
|
|
|
+ <div v-show="item_info.ItemPermn">
|
|
|
+ <el-checkbox v-model="isCreateSiglePage" @change="CreateSiglePage">{{$t('create_sigle_page')}}</el-checkbox>
|
|
|
+
|
|
|
+ <p v-if="isCreateSiglePage">{{$t('single_page_address')}} : <code >{{share_single_link}}</code> <p>
|
|
|
+
|
|
|
+ <p>
|
|
|
+ {{$t('create_sigle_page_tips')}}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
@@ -86,6 +88,7 @@
|
|
|
share_single_link:"",
|
|
|
copyText1:'',
|
|
|
copyText2:'',
|
|
|
+ isCreateSiglePage:false
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
|
@@ -100,9 +103,9 @@
|
|
|
share_page(){
|
|
|
var page_id = this.page_id > 0 ? this.page_id : 0 ;
|
|
|
this.share_page_link = this.getRootPath()+"#/"+this.item_id +'?page_id='+page_id ;
|
|
|
- this.share_single_link= this.getRootPath()+"#/page/"+page_id ;
|
|
|
+ //this.share_single_link= this.getRootPath()+"#/page/"+page_id ;
|
|
|
this.qr_page_link = DocConfig.server +'/api/common/qrcode&size=3&url='+encodeURIComponent(this.share_page_link);
|
|
|
- this.qr_single_link = DocConfig.server +'/api/common/qrcode&size=3&url='+encodeURIComponent(this.share_single_link);
|
|
|
+ //this.qr_single_link = DocConfig.server +'/api/common/qrcode&size=3&url='+encodeURIComponent(this.share_single_link);
|
|
|
this.dialogVisible = true;
|
|
|
this.copyText1 = this.item_info.item_name+' - '+this.page_info.page_title+"\r\n"+ this.share_page_link;
|
|
|
this.copyText2 = this.page_info.page_title+"\r\n"+ this.share_single_link;
|
|
|
@@ -148,9 +151,39 @@
|
|
|
onCopy(){
|
|
|
this.$message(this.$t("copy_success"));
|
|
|
},
|
|
|
+ CreateSiglePage(){
|
|
|
+ var page_id = this.page_id > 0 ? this.page_id : 0 ;
|
|
|
+ var that = this ;
|
|
|
+ var url = DocConfig.server+'/api/page/createSinglePage';
|
|
|
+ var params = new URLSearchParams();
|
|
|
+ params.append('page_id', page_id);
|
|
|
+ params.append('isCreateSiglePage', this.isCreateSiglePage);
|
|
|
+
|
|
|
+ that.axios.post(url, params)
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.error_code === 0 ) {
|
|
|
+ var unique_key = response.data.data.unique_key ;
|
|
|
+ if (unique_key) {
|
|
|
+ that.share_single_link = that.getRootPath()+"#/p/"+unique_key ;
|
|
|
+ }else{
|
|
|
+ that.share_single_link = '';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ that.$alert(response.data.error_message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
mounted () {
|
|
|
var that = this ;
|
|
|
+ if (this.page_info.unique_key) {
|
|
|
+ this.isCreateSiglePage = true ;
|
|
|
+ this.share_single_link = this.getRootPath()+"#/p/"+this.page_info.unique_key ;
|
|
|
+ };
|
|
|
document.onkeydown=function(e){ //对整个页面文档监听 其键盘快捷键
|
|
|
var keyNum=window.event ? e.keyCode :e.which; //获取被按下的键值
|
|
|
if (keyNum == 69 && e.ctrlKey) { //Ctrl +e 为编辑
|