|
@@ -262,9 +262,11 @@ import FormulaEdit from '@/views/formula/edit.vue'
|
|
import FormulaEditone from '@/views/formula/edit1.vue'
|
|
import FormulaEditone from '@/views/formula/edit1.vue'
|
|
|
|
|
|
import { getExcelHtml } from '@/api/exctab/excelmodel'
|
|
import { getExcelHtml } from '@/api/exctab/excelmodel'
|
|
-import { getElementInfoByTabId, submit, dictionarydataType, submitBatch,getUnMatchField } from '@/api/exctab/editelement'
|
|
|
|
|
|
+import { getElementInfoByTabId, submit,submit2, dictionarydataType, submitBatch,getUnMatchField } from '@/api/exctab/editelement'
|
|
import Vue from 'vue'
|
|
import Vue from 'vue'
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
components:{
|
|
components:{
|
|
FormulaEdit,
|
|
FormulaEdit,
|
|
@@ -366,6 +368,7 @@ export default {
|
|
unMatchItems:[
|
|
unMatchItems:[
|
|
|
|
|
|
],
|
|
],
|
|
|
|
+ checkList:[]//需要替换的数组
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -503,6 +506,9 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ LeftClick(tr, td, x1, x2, y1, y2){
|
|
|
|
+ console.log('点击左');
|
|
|
|
+ },
|
|
|
|
|
|
getTd(ele){
|
|
getTd(ele){
|
|
|
|
|
|
@@ -584,10 +590,23 @@ export default {
|
|
checkboxGroupChange(){},
|
|
checkboxGroupChange(){},
|
|
keyupShiftUp() {},
|
|
keyupShiftUp() {},
|
|
keyupShiftDown() {},
|
|
keyupShiftDown() {},
|
|
- keyupShiftLeft() {},
|
|
|
|
- keyupShiftRight() {},
|
|
|
|
- inputLeftClick() {},
|
|
|
|
- }
|
|
|
|
|
|
+ keyupShiftLeft() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ keyupShiftRight() {
|
|
|
|
+ },
|
|
|
|
+ inputLeftClick() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ KeyDown(e) {
|
|
|
|
+ if (e.ctrlKey|| e.metaKey) {
|
|
|
|
+ console.log("检测到按下了control键");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ window.addEventListener("keydown", this.KeyDown, true);
|
|
|
|
+ },
|
|
})
|
|
})
|
|
var component = new MyComponent().$mount()
|
|
var component = new MyComponent().$mount()
|
|
|
|
|
|
@@ -629,10 +648,16 @@ export default {
|
|
checkboxGroupChange(){},
|
|
checkboxGroupChange(){},
|
|
keyupShiftUp() {},
|
|
keyupShiftUp() {},
|
|
keyupShiftDown() {},
|
|
keyupShiftDown() {},
|
|
- keyupShiftLeft() {},
|
|
|
|
|
|
+ keyupShiftLeft() {
|
|
|
|
+
|
|
|
|
+ },
|
|
keyupShiftRight() {},
|
|
keyupShiftRight() {},
|
|
- inputLeftClick() {},
|
|
|
|
- }
|
|
|
|
|
|
+ inputLeftClick() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
})
|
|
})
|
|
var component = new MyComponent().$mount()
|
|
var component = new MyComponent().$mount()
|
|
let na = document.getElementById('parent')
|
|
let na = document.getElementById('parent')
|
|
@@ -664,16 +689,41 @@ export default {
|
|
this.$refs.cascader.clearCheckedNodes()//调用方法无效
|
|
this.$refs.cascader.clearCheckedNodes()//调用方法无效
|
|
},
|
|
},
|
|
saveReplace () {//保存按钮
|
|
saveReplace () {//保存按钮
|
|
- if (this.value&& this.table) {
|
|
|
|
|
|
+ console.log(this.checkList,'checkList');
|
|
|
|
+
|
|
|
|
+ // if (this.value&& this.table) {
|
|
|
|
+ // this.tag = true
|
|
|
|
+ // this.submit({
|
|
|
|
+ // tabId: this.pkeyId,
|
|
|
|
+ // tdIndex: this.table.td,
|
|
|
|
+ // trIndex: this.table.tr,
|
|
|
|
+ // colName: "",
|
|
|
|
+ // htmlType: this.value
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ if (this.value&&this.table&&this.checkList.length===0) {
|
|
this.tag = true
|
|
this.tag = true
|
|
- this.submit({
|
|
|
|
|
|
+ this.submit2([{
|
|
tabId: this.pkeyId,
|
|
tabId: this.pkeyId,
|
|
tdIndex: this.table.td,
|
|
tdIndex: this.table.td,
|
|
trIndex: this.table.tr,
|
|
trIndex: this.table.tr,
|
|
colName: "",
|
|
colName: "",
|
|
htmlType: this.value
|
|
htmlType: this.value
|
|
- })
|
|
|
|
- } else {
|
|
|
|
|
|
+ }])
|
|
|
|
+ } else if(this.value&&this.checkList.length>0){
|
|
|
|
+ let arr=[]
|
|
|
|
+ this.checkList.forEach((ele)=>{
|
|
|
|
+ arr.push({
|
|
|
|
+ tabId: this.pkeyId,
|
|
|
|
+ tdIndex: ele.td,
|
|
|
|
+ trIndex: ele.tr,
|
|
|
|
+ colName: "",
|
|
|
|
+ htmlType: this.value
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ this.submit2(arr)
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
this.$message({
|
|
this.$message({
|
|
type: "error",
|
|
type: "error",
|
|
message: "请右键选择要替换的元素"
|
|
message: "请右键选择要替换的元素"
|
|
@@ -704,6 +754,23 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async submit2 (da) {//批量保存替换元素
|
|
|
|
+ const { data: res } = await submit2(da)
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ const { data: res } = await getExcelHtml({ pkeyId: this.pkeyId })
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.tag = false
|
|
|
|
+ // this.value = ''
|
|
|
|
+ this.options = []
|
|
|
|
+ localStorage.setItem('editElement', res.data)
|
|
|
|
+ this.getElementInfoByTabId()
|
|
|
|
+ this.copss()
|
|
|
|
+ this.getUnMatchFieldData()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//#endregion
|
|
//#endregion
|
|
|
|
|
|
//#region 弹框事件
|
|
//#region 弹框事件
|
|
@@ -831,8 +898,23 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ noRepeat(tempArr) {
|
|
|
|
+ for (let i = 0; i < tempArr.length; i++) {
|
|
|
|
+ for (let j = i + 1; j < tempArr.length; j++) {
|
|
|
|
+ if (tempArr[i].tr == tempArr[j].tr&&tempArr[i].td == tempArr[j].td) {
|
|
|
|
+ tempArr.splice(j, 1);
|
|
|
|
+ j--;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return tempArr;
|
|
|
|
+ },
|
|
|
|
+
|
|
//excel父节点点击检测
|
|
//excel父节点点击检测
|
|
parentClick(e){
|
|
parentClick(e){
|
|
|
|
+ const{metaKey,ctrlKey}=e
|
|
let target = e.target;
|
|
let target = e.target;
|
|
console.log(target,'target');
|
|
console.log(target,'target');
|
|
let bgs = document.querySelectorAll("#parent .oldlace-bg")
|
|
let bgs = document.querySelectorAll("#parent .oldlace-bg")
|
|
@@ -845,8 +927,26 @@ export default {
|
|
let tdEle = this.getParentTD(target);
|
|
let tdEle = this.getParentTD(target);
|
|
if(tdEle){
|
|
if(tdEle){
|
|
target.classList.add("oldlace-bg");
|
|
target.classList.add("oldlace-bg");
|
|
|
|
+ if(metaKey||ctrlKey){
|
|
|
|
+ target.classList.add("select-td");
|
|
|
|
+ this.checkList.push({
|
|
|
|
+ tr:target.getAttribute('trindex'),
|
|
|
|
+ td:target.getAttribute('tdindex'),
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ target.classList.remove("select-td");
|
|
|
|
+ this.checkList.forEach((ele,index)=>{
|
|
|
|
+ if(ele.tr===target.getAttribute('trindex')){
|
|
|
|
+ this.checkList.splice(index,1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ this.noRepeat(this.checkList)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -860,6 +960,7 @@ export default {
|
|
}
|
|
}
|
|
return targetParent;
|
|
return targetParent;
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
@@ -956,8 +1057,9 @@ export default {
|
|
/deep/ .warnstyle .el-textarea__inner{
|
|
/deep/ .warnstyle .el-textarea__inner{
|
|
background-image: url('/img/login/warn.png') !important;
|
|
background-image: url('/img/login/warn.png') !important;
|
|
background-repeat: no-repeat;
|
|
background-repeat: no-repeat;
|
|
- background-size:cover;
|
|
|
|
- background-position: center
|
|
|
|
|
|
+ // background-size:cover;
|
|
|
|
+ background-position-x: 45%;
|
|
|
|
+ background-position-y: 46%;
|
|
}
|
|
}
|
|
|
|
|
|
.full-dialog{
|
|
.full-dialog{
|