perf : onCopy 方法提取到 mainMixinFun.js文件
This commit is contained in:
@@ -90,6 +90,11 @@ export default {
|
|||||||
const format = fmt || localStorage.getItem('nz-default-dateFormat')
|
const format = fmt || localStorage.getItem('nz-default-dateFormat')
|
||||||
const date = moment.tz(str, format, offset).valueOf()
|
const date = moment.tz(str, format, offset).valueOf()
|
||||||
return date
|
return date
|
||||||
|
},
|
||||||
|
onCopy (txt) {
|
||||||
|
this.$copyText(txt).then(() => {
|
||||||
|
this.$message.success({ message: this.$t('overall.copySuccess') })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,11 +134,6 @@ export default {
|
|||||||
},
|
},
|
||||||
rowKey (row) { // ping trace的 唯一key
|
rowKey (row) { // ping trace的 唯一key
|
||||||
return row.ip + '-' + row.dc.id
|
return row.ip + '-' + row.dc.id
|
||||||
},
|
|
||||||
onCopy (txt) {
|
|
||||||
this.$copyText(txt).then(() => {
|
|
||||||
this.$message.success({ message: this.$t('overall.copySuccess') })
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -185,6 +185,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import mainMixinFun from '@/components/common/mixin/mainMixinFun'
|
||||||
import table from '@/components/common/mixin/table'
|
import table from '@/components/common/mixin/table'
|
||||||
import { showTableTooltip, hideTableTooltip } from '@/components/common/js/tools'
|
import { showTableTooltip, hideTableTooltip } from '@/components/common/js/tools'
|
||||||
// import bus from '@/libs/bus'
|
// import bus from '@/libs/bus'
|
||||||
@@ -193,7 +194,7 @@ import alertDaysInfo from '@/components/common/alert/alertDaysInfo'
|
|||||||
import alertLabelMixin from '@/components/common/mixin/alertLabelMixin'
|
import alertLabelMixin from '@/components/common/mixin/alertLabelMixin'
|
||||||
export default {
|
export default {
|
||||||
name: 'assetTable',
|
name: 'assetTable',
|
||||||
mixins: [table, alertLabelMixin],
|
mixins: [table, alertLabelMixin, mainMixinFun],
|
||||||
components: {
|
components: {
|
||||||
alertLabel: alertLabel,
|
alertLabel: alertLabel,
|
||||||
alertDaysInfo
|
alertDaysInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user