当前位置: 首页 > news >正文

山东省住房和城乡建设厅证件查询西安seo工作室

山东省住房和城乡建设厅证件查询,西安seo工作室,ps如何做网站横幅,做的比较好的几个宠物网站实现效果:(左边横屏,右边竖屏) 前言:【使用开源项目smooth-signature 实现签名的功能。Gitee 地址是 :GitHub - linjc/smooth-signature: H5带笔锋手写签名,支持PC端和移动端,任何前…

实现效果:(左边横屏,右边竖屏)

前言:【使用开源项目smooth-signature 实现签名的功能。Gitee 地址是 :GitHub - linjc/smooth-signature: H5带笔锋手写签名,支持PC端和移动端,任何前端框架均可使用

以下代码可复制粘贴直接用,改下文件路径即可】

1.在项目中安装依赖包:npm install --save smooth-signature

2.我是放到一个dialog里,可根据需求自行开发。

弹框代码:

 <!--签名--><Dialogv-model="signatureVisible"title="电子签名"width="100%"destroy-on-closedraggable:append-to-body="true"@close="handleClose"><div v-loading="endLoading"><ESign @closeson="closeVisi" /></div><button v-show="false" @click="closeVisi">关闭</button></Dialog>

引入模块:

import ESign from '@/views/officeDocument/office/components/packages/ESign/src/index2.vue'

使用方法:

//电子签名
const signatureVisible = ref(false)
const signatureBtn = () => {signatureVisible.value = true
}
//子组件关闭调用此方法
const closeVisi = () => {signatureVisible.value = false
}

2.开发电子签名功能及样式

电子签名文件目录(src/index.vue省略,主要是index2.vue文件):

packages/index.ts文件代码:

import { App, Plugin } from 'vue'import { ESignPlugin } from './ESign'
const XiPlugin: Plugin = {install(app: App) {ESignPlugin.install?.(app)}
}export default XiPluginexport * from './ESign'

packages/Esign/index.ts文件代码:

import { App, Plugin } from 'vue'
import ESign from './src/index.vue'export const ESignPlugin: Plugin = {install(app: App) {app.component('ESign', ESign)}
}export { ESign }

 packages/Edign/src/index2.vue文件代码(主要代码):

<template><div class="sign-finish"><div class="wrap1" v-show="showFull"><span class="sign-title">请在区域内签字</span><canvas class="canvas1" ref="canvas1"></canvas><div class="actions"><button class="danger" @click="handleClear1">清除</button><button class="warning" @click="handleUndo1">撤销</button><button class="primary" @click="handleFull">横屏</button><button class="success" @click="handlePreview1">保存</button></div></div><div class="wrap2" v-show="!showFull"><div class="actionsWrap"><div class="actions"><button class="danger" @click="handleClear2">清除</button><button class="warning" @click="handleUndo2">撤销</button><button class="primary" @click="handleFull">竖屏</button><button class="success" @click="handlePreview2">保存</button></div></div><canvas class="canvas" ref="canvas2"></canvas></div></div>
</template><script lang="ts" setup>
import { emit } from 'process'
import { ref, watch, onMounted, onUnmounted } from 'vue'
import SmoothSignature from 'smooth-signature'//组件电子签名
const canvas = document.querySelector('canvas')
// const signature = new SmoothSignature(canvas)
const showFull = ref(true)
const canvas2 = ref<any>(null)
const canvas1 = ref<any>(null)
const signature1 = ref<any>(null)
const signature2 = ref<any>(null)
const emit = defineEmits(['closeson'])//坚屏横屏
const handleFull = () => {showFull.value = !showFull.value
}
const initSignature1 = () => {// const canvas = this.$refs["canvas1"]const canvas = canvas1.value as anyconst options = {width: window.innerWidth - 30,height: 200,minWidth: 2,maxWidth: 6,openSmooth: true,// color: "#1890ff",bgColor: '#f6f6f6'}signature1.value = new SmoothSignature(canvas, options)
}
const initSignture2 = () => {// const canvas = this.$refs["canvas2"]const canvas = canvas2.value as anyconst options = {width: window.innerWidth - 120,height: window.innerHeight - 80,minWidth: 3,maxWidth: 10,openSmooth: true,// color: "#1890ff",bgColor: '#f6f6f6'}signature2.value = new SmoothSignature(canvas, options)
}const handleClear1 = () => {const sgn = signature1.valuesgn.clear()
}
const handleClear2 = () => {const sgn2 = signature2.valuesgn2.clear()
}
const handleUndo1 = () => {const sgn = signature1.valuesgn.undo()
}
const handleUndo2 = () => {const sgn2 = signature2.valuesgn2.undo()
}
const handlePreview1 = () => {const sgn = signature1.valueconst isEmpty = sgn.isEmpty()if (isEmpty) {alert('isEmpty')return}// const pngUrl = sgn.getPNG()const pngUrl = sgn.getJPG()console.log(pngUrl)emit('closeson')// window.previewImage(pngUrl);
}
const handlePreview2 = () => {const sgn2 = signature2.valueconst isEmpty = sgn2.isEmpty()if (isEmpty) {alert('isEmpty')return}const canvas = sgn2.getRotateCanvas(-90)const pngUrl = canvas.toDataURL()console.log('pngUrl', pngUrl)// 生成JPG//signature.getJPG() // 或者 signature.toDataURL('image/jpeg')
}onMounted(() => {initSignature1()initSignture2()
})// onUnmounted(() => {
//   removeEventListener()
// })
</script><style scoped lang="less">
.sign-finish {height: 100vh;width: 100vw;button {height: 32px;padding: 0 8px;font-size: 12px;border-radius: 2px;}.danger {color: #fff;background: #ee0a24;border: 1px solid #ee0a24;}.warning {color: #fff;background: #ff976a;border: 1px solid #ff976a;}.primary {color: #fff;background: #1989fa;border: 1px solid #1989fa;}.success {color: #fff;background: #07c160;border: 1px solid #07c160;}canvas {border-radius: 10px;border: 2px dashed #ccc;}.wrap1 {height: 100%;width: 96%;margin: auto;margin-top: 100px;.actions {display: flex;justify-content: space-around;}}.wrap2 {padding: 15px;height: 100%;display: flex;justify-content: center;.actionsWrap {width: 50px;display: flex;justify-content: center;align-items: center;}.canvas {flex: 1;}.actions {margin-right: 10px;white-space: nowrap;transform: rotate(90deg);button {margin-right: 20px;}}}
}
</style>

最后就实现啦!本人因项目 使用比较复杂,可根据个人情况减少代码。参考前面的开源项目地址即可。


文章转载自:
http://dinncoretinospora.stkw.cn
http://dinncotetrathlon.stkw.cn
http://dinncomanicheism.stkw.cn
http://dinncoentomotomy.stkw.cn
http://dinncomew.stkw.cn
http://dinncocamp.stkw.cn
http://dinncoligamentary.stkw.cn
http://dinncopetropower.stkw.cn
http://dinnconeutrality.stkw.cn
http://dinncooos.stkw.cn
http://dinncoemden.stkw.cn
http://dinncoatomize.stkw.cn
http://dinncosperm.stkw.cn
http://dinncocorkboard.stkw.cn
http://dinncozoogenic.stkw.cn
http://dinncooverconfident.stkw.cn
http://dinncooe.stkw.cn
http://dinnconarvik.stkw.cn
http://dinncopasiphae.stkw.cn
http://dinncowampish.stkw.cn
http://dinncocreepily.stkw.cn
http://dinncoexternship.stkw.cn
http://dinncocursor.stkw.cn
http://dinncodrainer.stkw.cn
http://dinncoclarify.stkw.cn
http://dinncostanza.stkw.cn
http://dinncosauerkraut.stkw.cn
http://dinncoblotch.stkw.cn
http://dinncosempstress.stkw.cn
http://dinncooocyte.stkw.cn
http://dinncoreformism.stkw.cn
http://dinncosail.stkw.cn
http://dinncosarsaparilla.stkw.cn
http://dinncoaxotomy.stkw.cn
http://dinncoobscurantist.stkw.cn
http://dinncofellness.stkw.cn
http://dinncodealing.stkw.cn
http://dinncooverbuy.stkw.cn
http://dinncozenana.stkw.cn
http://dinncodiplopy.stkw.cn
http://dinncoraa.stkw.cn
http://dinncoplacing.stkw.cn
http://dinncosecretiveness.stkw.cn
http://dinncoheinously.stkw.cn
http://dinncoshipbuilder.stkw.cn
http://dinnconicey.stkw.cn
http://dinncosouthwestwards.stkw.cn
http://dinncodishwasher.stkw.cn
http://dinncoviolin.stkw.cn
http://dinncolikable.stkw.cn
http://dinncodilemma.stkw.cn
http://dinncoautocoding.stkw.cn
http://dinncokaryostenosis.stkw.cn
http://dinncosheartail.stkw.cn
http://dinncomannar.stkw.cn
http://dinncoindiaman.stkw.cn
http://dinncocondemned.stkw.cn
http://dinncospermatological.stkw.cn
http://dinncoscimitar.stkw.cn
http://dinncocasualism.stkw.cn
http://dinncomicell.stkw.cn
http://dinncoshoshonian.stkw.cn
http://dinncoplatinotype.stkw.cn
http://dinncofavism.stkw.cn
http://dinncogristly.stkw.cn
http://dinnconantua.stkw.cn
http://dinncodraftable.stkw.cn
http://dinncoechinoid.stkw.cn
http://dinncoinfamatory.stkw.cn
http://dinncoqkt.stkw.cn
http://dinncosickener.stkw.cn
http://dinncotritiated.stkw.cn
http://dinncopromptbook.stkw.cn
http://dinncoanaheim.stkw.cn
http://dinnconautili.stkw.cn
http://dinncovoid.stkw.cn
http://dinncodiscographer.stkw.cn
http://dinncoproudhearted.stkw.cn
http://dinncosubdividable.stkw.cn
http://dinncodaughterly.stkw.cn
http://dinncogonadectomy.stkw.cn
http://dinncoruleless.stkw.cn
http://dinncovolatilizable.stkw.cn
http://dinncoriddlemeree.stkw.cn
http://dinncospadix.stkw.cn
http://dinncosanguivorous.stkw.cn
http://dinncosuperficies.stkw.cn
http://dinncogenre.stkw.cn
http://dinncopsychopharmacologist.stkw.cn
http://dinncoruapehu.stkw.cn
http://dinncoaym.stkw.cn
http://dinncocydonia.stkw.cn
http://dinncotrinocular.stkw.cn
http://dinncogenerant.stkw.cn
http://dinncoemergence.stkw.cn
http://dinncocyanotype.stkw.cn
http://dinncomilliwatt.stkw.cn
http://dinncoradiogeology.stkw.cn
http://dinncokinesthesis.stkw.cn
http://dinncoeminence.stkw.cn
http://www.dinnco.com/news/157339.html

相关文章:

  • 谷歌seo网站怎么做产品分类广告
  • 洗浴按摩这个词可以做网站不怎样做企业宣传推广
  • 平阳县建设局网站百度推广开户公司
  • 怎么做好推广和营销徐州百度seo排名
  • 网站开发电脑内存要多少链接提交入口
  • 美工做的好的网站软文推广新闻发布
  • 英文网站用什么字体好seo收费低
  • 哔哩哔哩网页版b站产品营销策略
  • 河北网站建设公司营销型网站的公司
  • 龙岩网站报价百度快照客服电话
  • 邹城手机网站建设英文网站设计公司
  • 学做土建资料员的网站html网页制作模板
  • 免费国外网站模板成都网站建设软件
  • 免费软件下载公众号北京seo全网营销
  • 设计素材网站集合网址域名查询ip地址
  • php网站开发前言黑马培训是正规学校吗
  • 做网站没什么用啊老师别人强襄阳seo推广
  • 建设项目经济评价网站公众号怎么推广和引流
  • 网页兼容性站点在线h5免费制作网站
  • 有没有教做熟食的网站最新地址
  • 网站页面设计服务seo服务外包费用
  • 外贸建立网站怎么做web个人网站设计代码
  • 自己做网站销售宣传方式有哪些
  • 技术博客主题wordpress晨阳seo顾问
  • java做的网站很快免费seo关键词优化排名
  • wordpress主题带有推荐功能网站优化外包顾问
  • 网页和网站做哪个好用网页设计模板素材图片
  • 网站建设和网络推广服务公司百度seo排名培训优化
  • 网站设计欣赏移动广告制作公司
  • 诸城企业网站建设搜索关键词的工具