|
@@ -65,7 +65,7 @@
|
|
|
|
|
|
<!-- 插入单元格禁止编辑 -->
|
|
<!-- 插入单元格禁止编辑 -->
|
|
<template
|
|
<template
|
|
- v-if="([4,5,6,7].includes(cell.DataType)&&!cell.CanEdit)
|
|
|
|
|
|
+ v-if="([4,5,6,7,8].includes(cell.DataType)&&!cell.CanEdit)
|
|
||disabled
|
|
||disabled
|
|
||(cell.DataType===1&&[1,2].includes(cell.DataTimeType))"
|
|
||(cell.DataType===1&&[1,2].includes(cell.DataTimeType))"
|
|
>
|
|
>
|
|
@@ -188,6 +188,14 @@
|
|
:info="insertCalculateInfo"
|
|
:info="insertCalculateInfo"
|
|
@insert="insertCalculateData"
|
|
@insert="insertCalculateData"
|
|
/>
|
|
/>
|
|
|
|
+
|
|
|
|
+ <!-- 日期计算弹窗 -->
|
|
|
|
+ <calculateDateDia
|
|
|
|
+ ref="calculateDateDiaRef"
|
|
|
|
+ :isShow.sync="isInsertCalculateDate"
|
|
|
|
+ :info="insertCalculateDateInfo"
|
|
|
|
+ @insert="insertCalculateDateValue"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -215,6 +223,7 @@ import md5 from '@/utils/md5.js';
|
|
import selectTargetValueDia from './selectTargetValueDia.vue';
|
|
import selectTargetValueDia from './selectTargetValueDia.vue';
|
|
import insertDateDia from './insertDateDia.vue';
|
|
import insertDateDia from './insertDateDia.vue';
|
|
import calculateEdbDia from './calculateEdbDia.vue';
|
|
import calculateEdbDia from './calculateEdbDia.vue';
|
|
|
|
+import calculateDateDia from './calculateDateDia.vue';
|
|
import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
|
|
import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
@@ -223,7 +232,7 @@ export default {
|
|
default: false,
|
|
default: false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- components: { selectTargetValueDia,insertDateDia,calculateEdbDia },
|
|
|
|
|
|
+ components: { selectTargetValueDia,insertDateDia,calculateEdbDia,calculateDateDia },
|
|
computed: {
|
|
computed: {
|
|
//列头
|
|
//列头
|
|
columnHeader() {
|
|
columnHeader() {
|
|
@@ -260,13 +269,14 @@ export default {
|
|
return {
|
|
return {
|
|
config: {
|
|
config: {
|
|
/* 单元格类型
|
|
/* 单元格类型
|
|
- 1手动日期格 DataTimeType 0 系统日期导入格 DataTimeType 1 指标日期导入格 DataTimeType 2
|
|
|
|
|
|
+ 1手动日期格 DataTimeType 0 /系统日期导入格 DataTimeType 1 /指标日期导入格 DataTimeType 2
|
|
2指标格 //eta1.5.6又弃用了
|
|
2指标格 //eta1.5.6又弃用了
|
|
3自定义输入
|
|
3自定义输入
|
|
4插入值 表格里有关联的日期和指标格 // eta1.1.6弃用了
|
|
4插入值 表格里有关联的日期和指标格 // eta1.1.6弃用了
|
|
5弹窗里的插入值 有关联日期格
|
|
5弹窗里的插入值 有关联日期格
|
|
6公式计算单元格
|
|
6公式计算单元格
|
|
7指标计算的插入值单元格
|
|
7指标计算的插入值单元格
|
|
|
|
+ 8日期计算值单元格
|
|
*/
|
|
*/
|
|
data: [],
|
|
data: [],
|
|
contextMenuOption: [],
|
|
contextMenuOption: [],
|
|
@@ -289,9 +299,7 @@ export default {
|
|
calculateClickCell: null,//双击公式单元格时的单元格信息 用于之后选其他单元格拼接公式
|
|
calculateClickCell: null,//双击公式单元格时的单元格信息 用于之后选其他单元格拼接公式
|
|
|
|
|
|
isInsertDateDialog: false,//导入日期弹窗
|
|
isInsertDateDialog: false,//导入日期弹窗
|
|
- insertDateInfo: {
|
|
|
|
- key: '',
|
|
|
|
- },
|
|
|
|
|
|
+ insertDateInfo: {},
|
|
|
|
|
|
calculateChainList: [],//公式链 key数组 后端需要
|
|
calculateChainList: [],//公式链 key数组 后端需要
|
|
|
|
|
|
@@ -302,6 +310,9 @@ export default {
|
|
|
|
|
|
hasInit:false,
|
|
hasInit:false,
|
|
|
|
|
|
|
|
+ isInsertCalculateDate: false,//日期计算弹窗
|
|
|
|
+ insertCalculateDateInfo: {},//日期计算info
|
|
|
|
+
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -360,6 +371,9 @@ export default {
|
|
|
|
|
|
//计算指标弹窗打开时选择日期更新弹窗数据
|
|
//计算指标弹窗打开时选择日期更新弹窗数据
|
|
this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.showResult&&this.$refs.calculateEdbDiaRef.calculateHandle()
|
|
this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.showResult&&this.$refs.calculateEdbDiaRef.calculateHandle()
|
|
|
|
+
|
|
|
|
+ //日期计算弹窗打开选中日期框时且有选中item时更新选中值
|
|
|
|
+ cell.DataType===1&&this.isInsertCalculateDate&&this.$refs.calculateDateDiaRef.selectIndex&&this.$refs.calculateDateDiaRef.setSelectItemValue(this.selectCell)
|
|
},
|
|
},
|
|
|
|
|
|
/* 插入值 往左往上寻找同行同列是否有符合条件的一指标一日期 */
|
|
/* 插入值 往左往上寻找同行同列是否有符合条件的一指标一日期 */
|
|
@@ -509,6 +523,7 @@ export default {
|
|
cell.DataType = 1;
|
|
cell.DataType = 1;
|
|
cell.Extra='';
|
|
cell.Extra='';
|
|
cell.ShowValue = dateFormat;
|
|
cell.ShowValue = dateFormat;
|
|
|
|
+ cell.DataTime = dateFormat;
|
|
cell.Value = dateFormat;
|
|
cell.Value = dateFormat;
|
|
}else if(value.startsWith('=')) { //公式单元格
|
|
}else if(value.startsWith('=')) { //公式单元格
|
|
cell.DataType = 6;
|
|
cell.DataType = 6;
|
|
@@ -667,7 +682,7 @@ export default {
|
|
pos = 'cell'
|
|
pos = 'cell'
|
|
}
|
|
}
|
|
this.config.contextMenuOption = pos === 'cell'
|
|
this.config.contextMenuOption = pos === 'cell'
|
|
- ? getRightClickMenu(pos,(cell.DataType===1&&[1,2].includes(cell.DataTimeType))||cell.DataType===7)
|
|
|
|
|
|
+ ? getRightClickMenu(pos,(cell.DataType===1&&[1,2].includes(cell.DataTimeType))||[5,7,8].includes(cell.DataType))
|
|
: getRightClickMenu(pos)
|
|
: getRightClickMenu(pos)
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -700,7 +715,8 @@ export default {
|
|
|
|
|
|
let editHandlesMap = {
|
|
let editHandlesMap = {
|
|
1: this.insertDateOpen,
|
|
1: this.insertDateOpen,
|
|
- 7: this.edbCalculateInsertOpen
|
|
|
|
|
|
+ 7: this.edbCalculateInsertOpen,
|
|
|
|
+ 8: this.insertDateCalculateOpen
|
|
}
|
|
}
|
|
|
|
|
|
const keyMap = {
|
|
const keyMap = {
|
|
@@ -713,6 +729,7 @@ export default {
|
|
'choose-target': this.selectTargetOpen,//选择指标插入值
|
|
'choose-target': this.selectTargetOpen,//选择指标插入值
|
|
'insert-date': this.insertDateOpen,//导入系统日期
|
|
'insert-date': this.insertDateOpen,//导入系统日期
|
|
// 'insert-edb-date': this.insertDateOpen,//导入指标日期
|
|
// 'insert-edb-date': this.insertDateOpen,//导入指标日期
|
|
|
|
+ 'insert-date-calculate': this.insertDateCalculateOpen,//日期计算弹窗
|
|
'reset': this.clearCell, //清空
|
|
'reset': this.clearCell, //清空
|
|
'cell-edit': this.selectCell ? editHandlesMap[this.selectCell.DataType] : null
|
|
'cell-edit': this.selectCell ? editHandlesMap[this.selectCell.DataType] : null
|
|
}
|
|
}
|
|
@@ -725,12 +742,10 @@ export default {
|
|
打开弹窗后仍可以在页面上点击 多存一个选择指标时的当前单元格信息 */
|
|
打开弹窗后仍可以在页面上点击 多存一个选择指标时的当前单元格信息 */
|
|
selectTargetOpen() {
|
|
selectTargetOpen() {
|
|
this.insertTargetCell = this.selectCell;
|
|
this.insertTargetCell = this.selectCell;
|
|
- resetDialogCellStyle();
|
|
|
|
setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
|
|
setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
|
|
this.isSelectTargetValueDialog = true;
|
|
this.isSelectTargetValueDialog = true;
|
|
|
|
|
|
- this.isInsertCalculate = false;
|
|
|
|
- this.$refs.calculateEdbDiaRef.initData();
|
|
|
|
|
|
+ this.resetDialogStatus('insertEdbVal')
|
|
},
|
|
},
|
|
|
|
|
|
/* 插入选择指标的值 */
|
|
/* 插入选择指标的值 */
|
|
@@ -878,25 +893,36 @@ export default {
|
|
/* 导入系统/指标日期弹窗 */
|
|
/* 导入系统/指标日期弹窗 */
|
|
insertDateOpen(type) {
|
|
insertDateOpen(type) {
|
|
this.insertTargetCell = this.selectCell;
|
|
this.insertTargetCell = this.selectCell;
|
|
- resetDialogCellStyle();
|
|
|
|
|
|
|
|
if(type === 'cell-edit') { //编辑日期
|
|
if(type === 'cell-edit') { //编辑日期
|
|
- const { DataTimeType } = this.insertTargetCell;
|
|
|
|
|
|
+ // const { DataTimeType } = this.insertTargetCell;
|
|
this.insertDateInfo = {
|
|
this.insertDateInfo = {
|
|
- key: DataTimeType===1? 'insert-sys-date' : 'insert-edb-date',
|
|
|
|
|
|
+ // key: DataTimeType===1? 'insert-sys-date' : 'insert-edb-date',
|
|
...this.insertTargetCell
|
|
...this.insertTargetCell
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
this.insertDateInfo = {
|
|
this.insertDateInfo = {
|
|
- key:type
|
|
|
|
|
|
+ // key:type
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.isInsertDateDialog = true;
|
|
this.isInsertDateDialog = true;
|
|
|
|
+ this.resetDialogStatus();
|
|
|
|
+ },
|
|
|
|
|
|
- this.isSelectTargetValueDialog = false;
|
|
|
|
- this.$refs.selectTargetValueRef.initData();
|
|
|
|
- this.isInsertCalculate = false;
|
|
|
|
- this.$refs.calculateEdbDiaRef.initData();
|
|
|
|
|
|
+ /* 弹窗都是无遮罩的 弹一个就重置其他的 */
|
|
|
|
+ resetDialogStatus(type='init') {
|
|
|
|
+ if(type!=='insertEdbVal') {
|
|
|
|
+ this.isSelectTargetValueDialog = false;
|
|
|
|
+ this.$refs.selectTargetValueRef.initData();
|
|
|
|
+ }
|
|
|
|
+ if(type!=='insertEdbCalculateVal') {
|
|
|
|
+ this.isInsertCalculate = false;
|
|
|
|
+ this.$refs.calculateEdbDiaRef.initData();
|
|
|
|
+ }
|
|
|
|
+ if(type!=='insertDateCalculateVal') {
|
|
|
|
+ this.isInsertCalculateDate = false;
|
|
|
|
+ this.$refs.calculateDateDiaRef.initData();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
/* 插入系统/指标日期 */
|
|
/* 插入系统/指标日期 */
|
|
@@ -913,7 +939,6 @@ export default {
|
|
/* 指标计算弹窗 */
|
|
/* 指标计算弹窗 */
|
|
edbCalculateInsertOpen(item) {
|
|
edbCalculateInsertOpen(item) {
|
|
this.insertTargetCell = this.selectCell;
|
|
this.insertTargetCell = this.selectCell;
|
|
- resetDialogCellStyle();
|
|
|
|
setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target');
|
|
setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target');
|
|
|
|
|
|
if(item === 'cell-edit') { //编辑
|
|
if(item === 'cell-edit') { //编辑
|
|
@@ -934,8 +959,7 @@ export default {
|
|
}
|
|
}
|
|
this.isInsertCalculate = true;
|
|
this.isInsertCalculate = true;
|
|
|
|
|
|
- this.isSelectTargetValueDialog = false;
|
|
|
|
- this.$refs.selectTargetValueRef.initData();
|
|
|
|
|
|
+ this.resetDialogStatus('insertEdbCalculateVal')
|
|
},
|
|
},
|
|
|
|
|
|
/* 导入指标计算值 */
|
|
/* 导入指标计算值 */
|
|
@@ -964,6 +988,34 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /* 日期计算弹窗 */
|
|
|
|
+ insertDateCalculateOpen(type) {
|
|
|
|
+ this.insertTargetCell = this.selectCell;
|
|
|
|
+ setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
|
|
|
|
+
|
|
|
|
+ if(type === 'cell-edit') { //编辑
|
|
|
|
+ this.insertCalculateDateInfo = {
|
|
|
|
+ ...this.insertTargetCell
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ this.insertCalculateDateInfo = {}
|
|
|
|
+ }
|
|
|
|
+ this.isInsertCalculateDate = true;
|
|
|
|
+ this.resetDialogStatus('insertDateCalculateVal');
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 插入日期计算值 */
|
|
|
|
+ insertCalculateDateValue(data) {
|
|
|
|
+ const { insertValue,str } = data;
|
|
|
|
+ this.insertTargetCell.DataType = 8;
|
|
|
|
+ this.insertTargetCell.ShowValue = insertValue;
|
|
|
|
+ this.insertTargetCell.Value = str;
|
|
|
|
+ this.insertTargetCell.EdbInfoId = 0;
|
|
|
|
+ this.insertTargetCell.DataTime = '';
|
|
|
|
+
|
|
|
|
+ this.$message.success('插入成功')
|
|
|
|
+ },
|
|
|
|
+
|
|
/* 初始化8行5列 */
|
|
/* 初始化8行5列 */
|
|
initData(initData=null) {
|
|
initData(initData=null) {
|
|
console.log('initData');
|
|
console.log('initData');
|