Commit c1329ae4 authored by xiaoman's avatar xiaoman

Merge branch 'feature/develop_0713' of...

Merge branch 'feature/develop_0713' of http://gitlab.wanwudezhi.work/quanku/qk_admin into feature/develop_0713
parents e5a93ec1 49cce47f
module.exports = {
NODE_ENV: '"production"',
ENV_CONFIG: '"dep"',
BASE_API: '"http://quanku-system-dev.wanwudezhi.com/"'
BASE_API: '"http://quanku-system-dev.wanwudezhi.com/admin"'
}
......@@ -163,8 +163,8 @@ export const asyncRouterMap = [
name: 'category',
meta: {
perms: ['GET /admin/category/list', 'POST /admin/category/create', 'GET /admin/category/read', 'POST /admin/category/update', 'POST /admin/category/delete', 'POST /admin/category/getSubCategory', 'POST /admin/bidrecord/list'],
title: '信息设置',
icon: 'list',
title: '钱币设置',
icon: 'setting',
noCache: true
},
hidden: true
......
......@@ -19,8 +19,9 @@
</el-dialog>
<LamaImageDialog
v-if="showLamaImageDialog"
:show-lama-dialog="showLamaImageDialog"
@imageBase64="handleGetImageBase64"/>
@imageBase64="handleGetImageBase64" />
</div>
</template>
......@@ -67,8 +68,13 @@ export default {
this.$message.error('请选择图片')
return
}
debugger
if (this.selectType === 1) { // 去水印
const result = this.copyContent(this.imageList[this.currentPosition])
if (result) {
this.$message.info('复制链接成功,粘贴去链接去水印吧')
} else {
this.$message.error('复制链接失败,请重试')
}
this.showLamaImageDialog = true
} else {
this.$emit('selectSuccess', this.imageList[this.currentPosition])
......@@ -79,6 +85,53 @@ export default {
this.$emit('imageBase64Str', imgUrlBase64)
this.showLamaImageDialog = false
this.$emit('closeDialog')
},
copyContent(content) {
// 复制结果
let copyResult = true
// 设置想要复制的文本内容
const text = content || ''
// 判断是否支持clipboard方式
if (window.navigator.clipboard) {
// 利用clipboard将文本写入剪贴板(这是一个异步promise)
window.navigator.clipboard.writeText(text).then((res) => {
console.log('复制成功')
// 返回复制操作的最终结果
return copyResult
}).catch((err) => {
copyResult = false
console.log('复制失败', err)
// 返回复制操作的最终结果
return copyResult
})
} else {
// 不支持clipboard方式 则采用document.execCommand()方式
// 创建一个input元素
const inputDom = document.createElement('textarea')
// 设置为只读 防止移动端手机上弹出软键盘
inputDom.setAttribute('readonly', 'readonly')
// 给input元素赋值
inputDom.value = text
// 将创建的input添加到body
document.body.appendChild(inputDom)
// 选中input元素的内容
inputDom.select()
// 执行浏览器复制命令
// 复制命令会将当前选中的内容复制到剪切板中(这里就是创建的input标签中的内容)
// Input要在正常的编辑状态下原生复制方法才会生效
const result = document.execCommand('copy')
// 判断是否复制成功
if (result) {
console.log('复制成功')
} else {
console.log('复制失败')
copyResult = false
}
// 复制操作后再将构造的标签 移除
document.body.removeChild(inputDom)
// 返回复制操作的最终结果
return copyResult
}
}
}
}
......@@ -87,6 +140,7 @@ export default {
<style lang="scss" scoped>
.list {
width: 720px;
.select_item {
width: 100px;
height: 100px;
......@@ -98,7 +152,9 @@ export default {
.gallery {
width: 100px;
height: 100px;
object-fit: contain;
}
.check_img {
position: absolute;
top: 10px;
......
......@@ -117,7 +117,7 @@ export default {
page: 1,
limit: 20,
name: undefined,
sort: 'created',
sort: 'update_time',
order: 'desc'
},
goodsDetail: '',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment