|
|
@@ -32,7 +32,9 @@
|
|
|
@change="change"
|
|
|
/>
|
|
|
</span>
|
|
|
- <span v-else-if="type.prop==='tab2'"> <electronicSignature :pkeyId1='pkeyId' :htmlData1="htmlData" :excelId="excelId" @edit="signatureEdit"/> </span>
|
|
|
+ <span v-else-if="type.prop==='tab2'">
|
|
|
+ <electronicSignature :pkeyId1='pkeyId' :htmlData1="htmlData" :excelId="excelId" :times="timesTimeElement" @edit="signatureEdit" @timeFocus="timeElementFocus"/>
|
|
|
+ </span>
|
|
|
<span v-else-if="type.prop==='tab3'"> <setFormula :pkeyId1='pkeyId' :htmlData1="htmlData"/> </span>
|
|
|
<span v-else-if="type.prop==='tab4'"> <editDefault :pkeyId1='pkeyId' :htmlData1="htmlData"/> </span>
|
|
|
<span v-else-if="type.prop==='tab5'"> <promptSettings :pkeyId1='pkeyId' :htmlData1="htmlData"/> </span>
|
|
|
@@ -50,7 +52,6 @@ import promptSettings from './template/promptSettings.vue'
|
|
|
import Vue from 'vue'
|
|
|
import {getExcelHtml} from '@/api/exctab/excelmodel'
|
|
|
import {getSignDetail} from "@/api/manager/AdjustForm";
|
|
|
-import {f} from "vuedraggable/dist/vuedraggable.common";
|
|
|
|
|
|
export default {
|
|
|
props: ['pkeyId', 'excelId'],
|
|
|
@@ -88,7 +89,9 @@ export default {
|
|
|
},
|
|
|
checkList: [],
|
|
|
checkNameList: [],
|
|
|
- isSignatureEdit: false
|
|
|
+ isSignatureEdit: false,
|
|
|
+ isTimeElement: false,
|
|
|
+ timesTimeElement: {}
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -237,97 +240,119 @@ export default {
|
|
|
},
|
|
|
|
|
|
getInformation(name, tr, td) {//鼠标点击事件
|
|
|
- console.log(name, 'name')
|
|
|
- let tdEle = null;
|
|
|
- //获取TD元素
|
|
|
- if (event.target.nodeName == "TD") {
|
|
|
- tdEle = event.target
|
|
|
+ if (!this.isTimeElement) {
|
|
|
+ let tdEle = null;
|
|
|
+ //获取TD元素
|
|
|
+ if (event.target.nodeName === "TD") {
|
|
|
+ tdEle = event.target
|
|
|
+ } else {
|
|
|
+ tdEle = this.getParentTD(event.target);
|
|
|
+ }
|
|
|
+ let moreObj = {};
|
|
|
+ if (tdEle) {
|
|
|
+ moreObj = this.getWidget(tdEle);
|
|
|
+ }
|
|
|
+ this.htmlData = Object.assign({
|
|
|
+ name,
|
|
|
+ tr,
|
|
|
+ td
|
|
|
+ }, moreObj)
|
|
|
} else {
|
|
|
- tdEle = this.getParentTD(event.target);
|
|
|
- }
|
|
|
- let moreObj = {};
|
|
|
- if (tdEle) {
|
|
|
- moreObj = this.getWidget(tdEle);
|
|
|
+ this.$set(this.timesTimeElement, 'colName', name)
|
|
|
}
|
|
|
-
|
|
|
- this.htmlData = Object.assign({
|
|
|
- name,
|
|
|
- tr,
|
|
|
- td
|
|
|
- }, moreObj)
|
|
|
-
|
|
|
},
|
|
|
signatureEdit(data) {
|
|
|
this.isSignatureEdit = data
|
|
|
},
|
|
|
//excel父节点点击检测
|
|
|
async parentClick(e) {
|
|
|
- let target = e.target;
|
|
|
- const {metaKey, ctrlKey} = e
|
|
|
- let bgs = document.querySelectorAll("#parent .oldlace-bg")
|
|
|
- //console.log(bgs)
|
|
|
- for (let i = 0; i < bgs.length; i++) {
|
|
|
- bgs[i].classList.remove("oldlace-bg");
|
|
|
- }
|
|
|
- //console.log(target.getAttribute('trindex'))
|
|
|
- let tdEle = this.getParentTD(target);
|
|
|
- this.htmlData.dqid = tdEle ? tdEle.getAttribute('dqid') : ''
|
|
|
- // const {data: res} = await getSignDetail({id: this.htmlData.dqid})
|
|
|
- // console.log(res,'res');
|
|
|
- if (this.htmlData.dqid) {
|
|
|
- if (this.type.prop === 'tab2' && this.isSignatureEdit) {
|
|
|
+ if (!this.isTimeElement) {
|
|
|
+ let target = e.target;
|
|
|
+ const {metaKey, ctrlKey} = e
|
|
|
+ let bgs = document.querySelectorAll("#parent .oldlace-bg")
|
|
|
+ //console.log(bgs)
|
|
|
+ for (let i = 0; i < bgs.length; i++) {
|
|
|
+ bgs[i].classList.remove("oldlace-bg");
|
|
|
+ }
|
|
|
+ //console.log(target.getAttribute('trindex'))
|
|
|
+ let tdEle = this.getParentTD(target);
|
|
|
+ this.htmlData.dqid = tdEle ? tdEle.getAttribute('dqid') : ''
|
|
|
+ // const {data: res} = await getSignDetail({id: this.htmlData.dqid})
|
|
|
+ // console.log(res,'res');
|
|
|
+ if (this.htmlData.dqid) {
|
|
|
+ if (this.type.prop === 'tab2' && this.isSignatureEdit) {
|
|
|
+ this.htmlData.obj = null
|
|
|
+ } else {
|
|
|
+ const {data: res} = await getSignDetail({id: this.htmlData.dqid, tabId: this.pkeyId})
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.htmlData.obj = res.data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
this.htmlData.obj = null
|
|
|
+ }
|
|
|
+ let target1
|
|
|
+ if (tdEle) {
|
|
|
+ let mydiv = tdEle.getElementsByTagName('div')
|
|
|
+ target1 = mydiv[0]
|
|
|
} else {
|
|
|
- const {data: res} = await getSignDetail({id: this.htmlData.dqid, tabId: this.pkeyId})
|
|
|
- if (res.code === 200) {
|
|
|
- this.htmlData.obj = res.data
|
|
|
+ tdEle = target
|
|
|
+ let mydiv = tdEle.getElementsByTagName('div')
|
|
|
+ target = mydiv[0]
|
|
|
+ }
|
|
|
+ let keyname = ''
|
|
|
+ try {
|
|
|
+ keyname = target.getAttribute('keyname') || target1.getAttribute('keyname')
|
|
|
+ // eslint-disable-next-line no-empty
|
|
|
+ } catch {
|
|
|
+ }
|
|
|
+ console.log('keyname', keyname)
|
|
|
+ this.htmlData.keyname = keyname
|
|
|
+ if (target.getAttribute('trindex') !== null && target.getAttribute('tdindex') || target1.getAttribute('trindex') !== null && target1.getAttribute('tdindex')) {
|
|
|
+ let tdEle = this.getParentTD(target);
|
|
|
+ if (tdEle) {
|
|
|
+ //橙色背景
|
|
|
+ target.classList.add("oldlace-bg");
|
|
|
+ if (metaKey || ctrlKey) {
|
|
|
+ target.classList.add("select-td");
|
|
|
+ this.checkNameList.push(this.htmlData)
|
|
|
+ this.checkList.push({
|
|
|
+ tr: target.getAttribute('trindex') || target1.getAttribute('trindex'),
|
|
|
+ td: target.getAttribute('tdindex') || target1.getAttribute('tdindex'),
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ target.classList.remove("select-td");
|
|
|
+ this.checkList.forEach((ele, index) => {
|
|
|
+ if (ele.tr === target.getAttribute('trindex') || ele.tr === target1.getAttribute('trindex')) {
|
|
|
+ this.checkList.splice(index, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.checkNameList.forEach((ele, index) => {
|
|
|
+ if (this.htmlData.tr === ele.tr) {
|
|
|
+ this.checkNameList.splice(index, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- this.htmlData.obj = null
|
|
|
- }
|
|
|
- let target1
|
|
|
- if (tdEle) {
|
|
|
- let mydiv = tdEle.getElementsByTagName('div')
|
|
|
- target1 = mydiv[0]
|
|
|
- } else {
|
|
|
- tdEle = target
|
|
|
- let mydiv = tdEle.getElementsByTagName('div')
|
|
|
- target = mydiv[0]
|
|
|
- }
|
|
|
- let keyname = ''
|
|
|
- try {
|
|
|
- keyname = target.getAttribute('keyname') || target1.getAttribute('keyname')
|
|
|
- // eslint-disable-next-line no-empty
|
|
|
- } catch { }
|
|
|
- console.log('keyname', keyname)
|
|
|
- this.htmlData.keyname = keyname
|
|
|
- if (target.getAttribute('trindex') !== null && target.getAttribute('tdindex') || target1.getAttribute('trindex') !== null && target1.getAttribute('tdindex')) {
|
|
|
+ let target = e.target;
|
|
|
let tdEle = this.getParentTD(target);
|
|
|
+ let target1
|
|
|
if (tdEle) {
|
|
|
- //橙色背景
|
|
|
- target.classList.add("oldlace-bg");
|
|
|
- if (metaKey || ctrlKey) {
|
|
|
- target.classList.add("select-td");
|
|
|
- this.checkNameList.push(this.htmlData)
|
|
|
- this.checkList.push({
|
|
|
- tr: target.getAttribute('trindex') || target1.getAttribute('trindex'),
|
|
|
- td: target.getAttribute('tdindex') || target1.getAttribute('tdindex'),
|
|
|
- })
|
|
|
- } else {
|
|
|
- target.classList.remove("select-td");
|
|
|
- this.checkList.forEach((ele, index) => {
|
|
|
- if (ele.tr === target.getAttribute('trindex') || ele.tr === target1.getAttribute('trindex')) {
|
|
|
- this.checkList.splice(index, 1)
|
|
|
- }
|
|
|
- })
|
|
|
- this.checkNameList.forEach((ele, index) => {
|
|
|
- if (this.htmlData.tr === ele.tr) {
|
|
|
- this.checkNameList.splice(index, 1)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ let mydiv = tdEle.getElementsByTagName('div')
|
|
|
+ target1 = mydiv[0]
|
|
|
+ } else {
|
|
|
+ tdEle = target
|
|
|
+ let mydiv = tdEle.getElementsByTagName('div')
|
|
|
+ target = mydiv[0]
|
|
|
}
|
|
|
+ let keyname = ''
|
|
|
+ try {
|
|
|
+ keyname = target.getAttribute('keyname') || target1.getAttribute('keyname')
|
|
|
+ } catch {}
|
|
|
+ this.$set(this.timesTimeElement, 'keyname', keyname)
|
|
|
+ console.log(this.timesTimeElement)
|
|
|
}
|
|
|
},
|
|
|
getParentTD(ele) {
|
|
|
@@ -418,8 +443,10 @@ export default {
|
|
|
|
|
|
return {};
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
+ //是否为时间元素选择模式
|
|
|
+ timeElementFocus(val) {
|
|
|
+ this.isTimeElement = val
|
|
|
+ },
|
|
|
},
|
|
|
components: {
|
|
|
setInputTPT,
|