@ -32,7 +32,7 @@
< div slot = "text" > { { $t ( 'Resources' ) } } < / div >
< div slot = "text" > { { $t ( 'Resources' ) } } < / div >
< div slot = "content" >
< div slot = "content" >
< treeselect v-model ="resourceList" :multiple="true" maxHeight="200" :options="resourceOptions" :normalizer="normalizer" :value-consists-of="valueConsistsOf" :disabled="isDetails" :placeholder="$t('Please select resources')" >
< treeselect v-model ="resourceList" :multiple="true" maxHeight="200" :options="resourceOptions" :normalizer="normalizer" :value-consists-of="valueConsistsOf" :disabled="isDetails" :placeholder="$t('Please select resources')" >
< div slot = "value-label" slot -scope = " { node } " > { { node . raw . fullName } } < / div >
< div slot = "value-label" slot -scope = " { node } " > { { node . raw . fullName } } < span class = "copy-path" @ mousedown = "_copyPath($event, node)" > & nbsp ; < em class = "el-icon-copy-document" data -container = " body " data -toggle = " tooltip " : title = "$t('Copy path')" > < / em > & nbsp ; < / span > < / div >
< / treeselect >
< / treeselect >
< / div >
< / div >
< / m - l i s t - b o x >
< / m - l i s t - b o x >
@ -65,7 +65,7 @@
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import disabledState from '@/module/mixin/disabledState'
import disabledState from '@/module/mixin/disabledState'
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror'
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror'
import Clipboard from 'clipboard'
let editor
let editor
export default {
export default {
@ -98,6 +98,25 @@
backfillItem : Object
backfillItem : Object
} ,
} ,
methods : {
methods : {
_copyPath ( e , node ) {
e . stopPropagation ( )
let clipboard = new Clipboard ( '.copy-path' , {
text : function ( ) {
return node . raw . fullName
}
} )
clipboard . on ( 'success' , handler => {
this . $message . success ( ` ${ i18n . $t ( 'Copy success' ) } ` )
/ / F r e e m e m o r y
clipboard . destroy ( )
} )
clipboard . on ( 'error' , handler => {
/ / C o p y i s n o t s u p p o r t e d
this . $message . warning ( ` ${ i18n . $t ( 'The browser does not support automatic copying' ) } ` )
/ / F r e e m e m o r y
clipboard . destroy ( )
} )
} ,
/ * *
/ * *
* return localParams
* return localParams
* /
* /