|
@@ -138,12 +138,7 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
hook:{},
|
|
|
- showsheetbar:false,
|
|
|
- // cellRightClickConfig:{
|
|
|
- // insertColumn:false,
|
|
|
- // deleteRow:false,
|
|
|
- // deleteColumn:false
|
|
|
- // }
|
|
|
+ showsheetbar:false
|
|
|
}
|
|
|
|
|
|
return {
|
|
@@ -220,7 +215,6 @@ created() {
|
|
|
})
|
|
|
if(res.Ret == 200){
|
|
|
dataList = res.Data.List || []
|
|
|
- // if(res.Data.FrequencyList) this.dataForm.frequency = res.Data.FrequencyList[0]
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -228,7 +222,6 @@ created() {
|
|
|
// 处理复制粘贴造成的漏洞 - 记录数据
|
|
|
this.options.hook.cellAllRenderBefore=(data,sheet)=>{
|
|
|
if(this.haveSaveProtected) return
|
|
|
- // console.log("全部刷新");
|
|
|
if(!this.protectedData.length>0){
|
|
|
for (let i = 0; i < 5; i++) {
|
|
|
if([0,1,2].includes(i)){
|
|
@@ -256,7 +249,6 @@ created() {
|
|
|
}
|
|
|
|
|
|
this.options.hook.cellMousedownBefore=(e,position)=>{
|
|
|
- // console.log(e,position);
|
|
|
// 禁止鼠标选中的单元格
|
|
|
if([0,1,2].includes(position.r) || ([3,4].includes(position.r) && position.c<=dataList.length)){
|
|
|
return false
|
|
@@ -285,7 +277,6 @@ created() {
|
|
|
if([3,4].includes(position.r) && position.c>=0 && position.c<=dataList.length){
|
|
|
if(!cell) return
|
|
|
Object.keys(this.protectedData[position.r][position.c]).forEach(key => {
|
|
|
- // console.log(_.isEqual(cell[key], this.protectedData[position.r][position.c][key]),'lodash');
|
|
|
if(!_.isEqual(cell[key], this.protectedData[position.r][position.c][key])){
|
|
|
haveUpdatedProtectedData=true
|
|
|
cell[key] = this.protectedData[position.r][position.c][key]
|
|
@@ -293,7 +284,6 @@ created() {
|
|
|
});
|
|
|
}else if([0,1,2].includes(position.r)){
|
|
|
let cindex = position.c>1?1:position.c
|
|
|
- // console.log(position.c,position.r,cell);
|
|
|
if(!cell){
|
|
|
if(cindex<1){
|
|
|
return
|
|
@@ -325,13 +315,33 @@ created() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // console.log(cindex,position.r,'cindex,position.r',this.protectedData[position.r][cindex]);
|
|
|
}
|
|
|
if(haveUpdatedProtectedData){
|
|
|
// 还原数据后的手动刷新
|
|
|
this.refreshManual()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ this.options.hook.updated=(operation)=>{
|
|
|
+ // console.log(operation);
|
|
|
+ if(operation.type == 'delRC'){
|
|
|
+ // 删除行或者列
|
|
|
+ if(operation.ctrlValue.rc == 'c'){
|
|
|
+ console.log('删除列',`第${operation.ctrlValue.index+1}列开始`,`删除了${operation.ctrlValue.len}列`);
|
|
|
+ let deleteColIndexs = []
|
|
|
+ for (let i = operation.ctrlValue.index; i < operation.ctrlValue.index+operation.ctrlValue.len; i++) {
|
|
|
+ if(i > dataList.length){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.protectedData[3].splice(i,1)
|
|
|
+ this.protectedData[4].splice(i,1)
|
|
|
+ deleteColIndexs.push(i-1)
|
|
|
+ }
|
|
|
+ dataList = dataList.filter((item,index) => !deleteColIndexs.includes(index))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 拿出所有数组
|
|
|
let arr = dataList.map((item => item.DataList)).flat()
|
|
|
// 拿出所有数组的日期并展平排序
|
|
@@ -471,8 +481,6 @@ created() {
|
|
|
"value1": this.unitList.join(','),
|
|
|
"value2": "",
|
|
|
"prohibitInput": false,
|
|
|
- // "hintShow": false,
|
|
|
- // "hintText": ""
|
|
|
}
|
|
|
}
|
|
|
this.$nextTick(()=>{
|