|
@@ -1,6 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<div class="table-wrapper" @keydown="handlekeyDownKeys">
|
|
<div class="table-wrapper" @keydown="handlekeyDownKeys">
|
|
<template v-if="config.data.length">
|
|
<template v-if="config.data.length">
|
|
|
|
+
|
|
|
|
+ <!-- 工具栏 -->
|
|
|
|
+ <toolBarSection v-if="!disabled" :cell="selectCell" @updateCell="updateCellStyle"/>
|
|
|
|
|
|
<!-- 公式显示区 -->
|
|
<!-- 公式显示区 -->
|
|
<div class="formula-wrapper" v-if="!disabled">
|
|
<div class="formula-wrapper" v-if="!disabled">
|
|
@@ -64,8 +67,9 @@
|
|
>
|
|
>
|
|
|
|
|
|
<!-- 插入单元格禁止编辑 -->
|
|
<!-- 插入单元格禁止编辑 -->
|
|
|
|
+ <!-- [4,5,6,7,8].includes(cell.DataType)&&!cell.CanEdit -->
|
|
<template
|
|
<template
|
|
- v-if="([4,5,6,7].includes(cell.DataType)&&!cell.CanEdit)
|
|
|
|
|
|
+ v-if="!cell.CanEdit
|
|
||disabled
|
|
||disabled
|
|
||(cell.DataType===1&&[1,2].includes(cell.DataTimeType))"
|
|
||(cell.DataType===1&&[1,2].includes(cell.DataTimeType))"
|
|
>
|
|
>
|
|
@@ -96,9 +100,19 @@
|
|
:data-rindex="rowHeader[index]"
|
|
:data-rindex="rowHeader[index]"
|
|
:data-cindex="columnHeader[cell_index]"
|
|
:data-cindex="columnHeader[cell_index]"
|
|
:data-key="cell.Uid"
|
|
:data-key="cell.Uid"
|
|
- >{{ cell.ShowValue }}</span>
|
|
|
|
|
|
+ >{{ cell.ShowStyle?cell.ShowFormatValue:cell.ShowValue }}</span>
|
|
</el-popover>
|
|
</el-popover>
|
|
|
|
|
|
|
|
+ <!-- 数字格式化显示 -->
|
|
|
|
+ <span
|
|
|
|
+ v-else-if="cell.ShowStyle"
|
|
|
|
+ :data-rindex="rowHeader[index]"
|
|
|
|
+ :data-cindex="columnHeader[cell_index]"
|
|
|
|
+ :data-key="cell.Uid"
|
|
|
|
+ >
|
|
|
|
+ {{cell.ShowFormatValue}}
|
|
|
|
+ </span>
|
|
|
|
+
|
|
<span
|
|
<span
|
|
:data-rindex="rowHeader[index]"
|
|
:data-rindex="rowHeader[index]"
|
|
:data-cindex="columnHeader[cell_index]"
|
|
:data-cindex="columnHeader[cell_index]"
|
|
@@ -111,17 +125,19 @@
|
|
v-else
|
|
v-else
|
|
v-model="cell.Value"
|
|
v-model="cell.Value"
|
|
:ref="`inputRef${cell.Uid}`"
|
|
:ref="`inputRef${cell.Uid}`"
|
|
- :fetch-suggestions="searchTarget"
|
|
|
|
popper-class="edb-select-popover"
|
|
popper-class="edb-select-popover"
|
|
:data-key="cell.Uid"
|
|
:data-key="cell.Uid"
|
|
:data-rindex="rowHeader[index]"
|
|
:data-rindex="rowHeader[index]"
|
|
:data-cindex="columnHeader[cell_index]"
|
|
:data-cindex="columnHeader[cell_index]"
|
|
- :highlight-first-item="cell.DataType===2"
|
|
|
|
- @select="selectTarget($event,cell)"
|
|
|
|
- @click="clickCell($event, cell)"
|
|
|
|
|
|
+ :fetch-suggestions="searchTarget"
|
|
@change.native="changeVal($event, cell)"
|
|
@change.native="changeVal($event, cell)"
|
|
@keydown.native="keyEnterHandle($event,cell)"
|
|
@keydown.native="keyEnterHandle($event,cell)"
|
|
|
|
+ @blur="() => {$set(cell,'CanEdit',false)}"
|
|
>
|
|
>
|
|
|
|
+ <!-- @select="selectTarget($event,cell)"
|
|
|
|
+ @click="clickCell($event, cell)"
|
|
|
|
+ :highlight-first-item="cell.DataType===2"
|
|
|
|
+ -->
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<edbDetailPopover :info="scope.item">
|
|
<edbDetailPopover :info="scope.item">
|
|
<div slot="reference" v-if="cell.DataType===2" class="edb-item">
|
|
<div slot="reference" v-if="cell.DataType===2" class="edb-item">
|
|
@@ -139,14 +155,33 @@
|
|
</table>
|
|
</table>
|
|
|
|
|
|
<!-- 右键菜单 -->
|
|
<!-- 右键菜单 -->
|
|
- <div class="contextMenu-wrapper" id="contextMenu-wrapper" @mouseleave="hideContextMenu">
|
|
|
|
|
|
+ <div class="contextMenu-wrapper" id="contextMenu-wrapper" @mouseleave="()=>{activeNames=[];hideContextMenu()}">
|
|
<div :class="['item',{'deletesty': menu.key==='reset'}]" v-for="menu in config.contextMenuOption" :key="menu.key" @click="handleContext(menu.key)">
|
|
<div :class="['item',{'deletesty': menu.key==='reset'}]" v-for="menu in config.contextMenuOption" :key="menu.key" @click="handleContext(menu.key)">
|
|
- {{menu.label}}
|
|
|
|
|
|
+ <span v-if="!menu.children">{{menu.label}}</span>
|
|
|
|
|
|
- <i class="el-icon-arrow-right" v-if="menu.children"></i>
|
|
|
|
|
|
+ <el-collapse v-model="activeNames" @change="handleChange" v-if="menu.children">
|
|
|
|
+ <el-collapse-item name="1">
|
|
|
|
+ <template slot="title">
|
|
|
|
+ {{menu.label}}
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <div class="subMenu-wrapper">
|
|
|
|
+ <div slot="reference" class="item" v-for="submenu in menu.children" :key="submenu.key" @click="edbCalculateInsertOpen(submenu)">
|
|
|
|
+ <el-popover
|
|
|
|
+ width="300"
|
|
|
|
+ trigger="hover"
|
|
|
|
+ placement="right"
|
|
|
|
+ >
|
|
|
|
+ <div v-html="formulaTip.get(submenu.fromEdbKey)"></div>
|
|
|
|
+ <div slot="reference" style="width:100%">{{submenu.label}}</div>
|
|
|
|
+ </el-popover>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-collapse-item>
|
|
|
|
+ </el-collapse>
|
|
|
|
|
|
<!-- 二级菜单 -->
|
|
<!-- 二级菜单 -->
|
|
- <div class="subMenu-wrapper" v-if="menu.children">
|
|
|
|
|
|
+ <!-- <div class="subMenu-wrapper" v-if="menu.children">
|
|
<div slot="reference" class="item" v-for="submenu in menu.children" :key="submenu.key" @click="edbCalculateInsertOpen(submenu)">
|
|
<div slot="reference" class="item" v-for="submenu in menu.children" :key="submenu.key" @click="edbCalculateInsertOpen(submenu)">
|
|
<el-popover
|
|
<el-popover
|
|
width="300"
|
|
width="300"
|
|
@@ -157,7 +192,7 @@
|
|
<div slot="reference" style="width:100%">{{submenu.label}}</div>
|
|
<div slot="reference" style="width:100%">{{submenu.label}}</div>
|
|
</el-popover>
|
|
</el-popover>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -169,6 +204,7 @@
|
|
<!-- 选择指标 -->
|
|
<!-- 选择指标 -->
|
|
<selectTargetValueDia
|
|
<selectTargetValueDia
|
|
:isShow.sync="isSelectTargetValueDialog"
|
|
:isShow.sync="isSelectTargetValueDialog"
|
|
|
|
+ :info="insertTargetValueInfo"
|
|
@insert="insertSelectData"
|
|
@insert="insertSelectData"
|
|
ref="selectTargetValueRef"
|
|
ref="selectTargetValueRef"
|
|
/>
|
|
/>
|
|
@@ -187,6 +223,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>
|
|
@@ -206,7 +250,9 @@ import {
|
|
findCellByFactor,
|
|
findCellByFactor,
|
|
splitString,
|
|
splitString,
|
|
toUpperCase,
|
|
toUpperCase,
|
|
- findCellKeyByFactor
|
|
|
|
|
|
+ findCellKeyByFactor,
|
|
|
|
+ isNumberVal,
|
|
|
|
+ transDecimalPlace
|
|
} from "../common/customTable";
|
|
} from "../common/customTable";
|
|
import * as sheetInterface from "@/api/modules/sheetApi.js";
|
|
import * as sheetInterface from "@/api/modules/sheetApi.js";
|
|
import { dataBaseInterface } from '@/api/api.js';
|
|
import { dataBaseInterface } from '@/api/api.js';
|
|
@@ -214,6 +260,8 @@ 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 toolBarSection from './toolBarSection.vue';
|
|
import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
|
|
import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
@@ -222,7 +270,13 @@ export default {
|
|
default: false,
|
|
default: false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- components: { selectTargetValueDia,insertDateDia,calculateEdbDia },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ selectTargetValueDia,
|
|
|
|
+ insertDateDia,
|
|
|
|
+ calculateEdbDia,
|
|
|
|
+ calculateDateDia,
|
|
|
|
+ toolBarSection
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
//列头
|
|
//列头
|
|
columnHeader() {
|
|
columnHeader() {
|
|
@@ -259,15 +313,14 @@ export default {
|
|
return {
|
|
return {
|
|
config: {
|
|
config: {
|
|
/* 单元格类型
|
|
/* 单元格类型
|
|
- 1手动日期格 DataTimeType 0
|
|
|
|
- 2指标格
|
|
|
|
|
|
+ 1手动日期格 DataTimeType 0 /系统日期导入格 DataTimeType 1 /指标日期导入格 DataTimeType 2
|
|
|
|
+ 2指标格 //eta1.5.6又弃用了
|
|
3自定义输入
|
|
3自定义输入
|
|
- 4插入值 表格里有关联的日期和指标格 //隐藏 又不要这个功能了
|
|
|
|
|
|
+ 4插入值 表格里有关联的日期和指标格 // eta1.1.6弃用了
|
|
5弹窗里的插入值 有关联日期格
|
|
5弹窗里的插入值 有关联日期格
|
|
6公式计算单元格
|
|
6公式计算单元格
|
|
- 1系统日期导入格 DataTimeType 1
|
|
|
|
- 1指标日期导入格 DataTimeType 2
|
|
|
|
7指标计算的插入值单元格
|
|
7指标计算的插入值单元格
|
|
|
|
+ 8日期计算值单元格
|
|
*/
|
|
*/
|
|
data: [],
|
|
data: [],
|
|
contextMenuOption: [],
|
|
contextMenuOption: [],
|
|
@@ -281,7 +334,8 @@ export default {
|
|
|
|
|
|
insertRelationArr: [], //表格单元格依赖关系数组
|
|
insertRelationArr: [], //表格单元格依赖关系数组
|
|
|
|
|
|
- isSelectTargetValueDialog: false,
|
|
|
|
|
|
+ isSelectTargetValueDialog: false,//选择指标插入值弹窗
|
|
|
|
+ insertTargetValueInfo: {},//编辑 关联info
|
|
|
|
|
|
cellrelationEdbInfo: {}, //指标浮窗信息
|
|
cellrelationEdbInfo: {}, //指标浮窗信息
|
|
|
|
|
|
@@ -290,11 +344,7 @@ export default {
|
|
calculateClickCell: null,//双击公式单元格时的单元格信息 用于之后选其他单元格拼接公式
|
|
calculateClickCell: null,//双击公式单元格时的单元格信息 用于之后选其他单元格拼接公式
|
|
|
|
|
|
isInsertDateDialog: false,//导入日期弹窗
|
|
isInsertDateDialog: false,//导入日期弹窗
|
|
- insertDateInfo: {
|
|
|
|
- key: '',
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- calculateChainList: [],//公式链 key数组 后端需要
|
|
|
|
|
|
+ insertDateInfo: {},
|
|
|
|
|
|
isInsertCalculate: false,//插入指标计算值
|
|
isInsertCalculate: false,//插入指标计算值
|
|
insertCalculateInfo: {},//指标计算单元格info
|
|
insertCalculateInfo: {},//指标计算单元格info
|
|
@@ -303,6 +353,11 @@ export default {
|
|
|
|
|
|
hasInit:false,
|
|
hasInit:false,
|
|
|
|
|
|
|
|
+ isInsertCalculateDate: false,//日期计算弹窗
|
|
|
|
+ insertCalculateDateInfo: {},//日期计算info
|
|
|
|
+
|
|
|
|
+ activeNames: []
|
|
|
|
+
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -310,8 +365,10 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
- /* 输入时实时搜索 满足日期格式不搜索 有=视为输入公式不搜索 */
|
|
|
|
|
|
+ /* 输入时实时搜索 满足日期格式不搜索 有=视为输入公式不搜索 eta1.5.6弃用了*/
|
|
async searchTarget(query,cb) {
|
|
async searchTarget(query,cb) {
|
|
|
|
+ return cb([])
|
|
|
|
+
|
|
//又要过滤掉2020-05-这样的奇葩其他格式 不让检索
|
|
//又要过滤掉2020-05-这样的奇葩其他格式 不让检索
|
|
let dateOtherRegex = /^(?:(?:19|20)\d\d)([-])(0[1-9]|1[0-2])(-?)$/
|
|
let dateOtherRegex = /^(?:(?:19|20)\d\d)([-])(0[1-9]|1[0-2])(-?)$/
|
|
if(!query
|
|
if(!query
|
|
@@ -344,13 +401,6 @@ export default {
|
|
|
|
|
|
setFocus(e);
|
|
setFocus(e);
|
|
|
|
|
|
- /* 如果当前有公式单元格在编辑就拼接当前单元格进公式 */
|
|
|
|
- // if(this.calculateClickCell && this.calculateClickCell.Uid!==cell.Uid) {
|
|
|
|
- // console.log(this.calculateClickCell)
|
|
|
|
- // const { cindex,rindex } = e.target.dataset;
|
|
|
|
- // this.calculateClickCell.Value += `${cindex}${rindex}`
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
//是插值单元格时寻找关联依赖的单元格 设置选框
|
|
//是插值单元格时寻找关联依赖的单元格 设置选框
|
|
if([4,5,7].includes(cell.DataType)) {
|
|
if([4,5,7].includes(cell.DataType)) {
|
|
const { key } = e.target.dataset;
|
|
const { key } = e.target.dataset;
|
|
@@ -362,10 +412,13 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
//选择指标弹窗打开时选择日期更新弹窗数据
|
|
//选择指标弹窗打开时选择日期更新弹窗数据
|
|
- this.isSelectTargetValueDialog&&this.$refs.selectTargetValueRef.chooseEdb(this.$refs.selectTargetValueRef.edbInfo)
|
|
|
|
|
|
+ this.isSelectTargetValueDialog&&this.$refs.selectTargetValueRef.changeRleationDate(this.selectCell)
|
|
|
|
|
|
//计算指标弹窗打开时选择日期更新弹窗数据
|
|
//计算指标弹窗打开时选择日期更新弹窗数据
|
|
- this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.showResult&&this.$refs.calculateEdbDiaRef.calculateHandle()
|
|
|
|
|
|
+ this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.changeRleationDate(this.selectCell)
|
|
|
|
+
|
|
|
|
+ //日期计算弹窗打开选中日期框时且有选中item时更新选中值
|
|
|
|
+ cell.DataType===1&&this.isInsertCalculateDate&&this.$refs.calculateDateDiaRef.selectIndex&&this.$refs.calculateDateDiaRef.setSelectItemValue(this.selectCell)
|
|
},
|
|
},
|
|
|
|
|
|
/* 插入值 往左往上寻找同行同列是否有符合条件的一指标一日期 */
|
|
/* 插入值 往左往上寻找同行同列是否有符合条件的一指标一日期 */
|
|
@@ -389,17 +442,6 @@ export default {
|
|
const res = await sheetInterface.insertData({EdbInfoId,Date})
|
|
const res = await sheetInterface.insertData({EdbInfoId,Date})
|
|
if(res.Ret !==200) return
|
|
if(res.Ret !==200) return
|
|
|
|
|
|
- //日期无值也要建立关联关系
|
|
|
|
- // if(!res.Data&&!DataTimeType){
|
|
|
|
- // this.selectCell.DataType = 3;
|
|
|
|
- // this.selectCell.DataTimeType = 0;
|
|
|
|
- // this.selectCell.ShowValue = '';
|
|
|
|
- // this.selectCell.Value = '';
|
|
|
|
- // this.selectCell.DataTime = '';
|
|
|
|
- // this.selectCell.EdbInfoId = 0;
|
|
|
|
- // this.$message.warning('所选指标的所选日期无值')
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
|
|
|
|
res.Data ? this.$message.success('插入成功') : this.$message.warning('当前日期暂无值')
|
|
res.Data ? this.$message.success('插入成功') : this.$message.warning('当前日期暂无值')
|
|
|
|
|
|
@@ -507,7 +549,6 @@ export default {
|
|
// 是日期格式 DataType为1
|
|
// 是日期格式 DataType为1
|
|
// 自定义内容 DataType 3
|
|
// 自定义内容 DataType 3
|
|
//有=号为输入公式 DataType 6
|
|
//有=号为输入公式 DataType 6
|
|
-
|
|
|
|
const {value} = e.target;
|
|
const {value} = e.target;
|
|
if(!value){ //无值重置单元格
|
|
if(!value){ //无值重置单元格
|
|
cell.DataType = 3;
|
|
cell.DataType = 3;
|
|
@@ -526,6 +567,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;
|
|
@@ -546,6 +588,12 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* 不是数字类型,清除原来设置的格式 */
|
|
|
|
+ if(!isNumberVal(value)){
|
|
|
|
+ cell.ShowStyle = '';
|
|
|
|
+ cell.ShowStyle = '';
|
|
|
|
+ } ;
|
|
|
|
+
|
|
//判断是否是有插入值的依赖单元格 更新值或重置关系
|
|
//判断是否是有插入值的依赖单元格 更新值或重置关系
|
|
this.checkCellRelation(cell)
|
|
this.checkCellRelation(cell)
|
|
},
|
|
},
|
|
@@ -625,6 +673,7 @@ export default {
|
|
cell.DataTime = '';
|
|
cell.DataTime = '';
|
|
cell.ShowValue = '';
|
|
cell.ShowValue = '';
|
|
cell.Value = '';
|
|
cell.Value = '';
|
|
|
|
+ cell.ShowStyle = ''
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -689,7 +738,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(() => {
|
|
@@ -720,9 +769,12 @@ export default {
|
|
/* 右键事件 */
|
|
/* 右键事件 */
|
|
async handleContext(key) {
|
|
async handleContext(key) {
|
|
|
|
|
|
|
|
+ //可右键编辑的单元格类型
|
|
let editHandlesMap = {
|
|
let editHandlesMap = {
|
|
1: this.insertDateOpen,
|
|
1: this.insertDateOpen,
|
|
- 7: this.edbCalculateInsertOpen
|
|
|
|
|
|
+ 5: this.selectTargetOpen,
|
|
|
|
+ 7: this.edbCalculateInsertOpen,
|
|
|
|
+ 8: this.insertDateCalculateOpen
|
|
}
|
|
}
|
|
|
|
|
|
const keyMap = {
|
|
const keyMap = {
|
|
@@ -733,8 +785,9 @@ export default {
|
|
'insert-row-down': this.insertRow,//向下插入行
|
|
'insert-row-down': this.insertRow,//向下插入行
|
|
'insert-value': this.insertValue,//插入值
|
|
'insert-value': this.insertValue,//插入值
|
|
'choose-target': this.selectTargetOpen,//选择指标插入值
|
|
'choose-target': this.selectTargetOpen,//选择指标插入值
|
|
- 'insert-sys-date': this.insertDateOpen,//导入系统日期
|
|
|
|
- 'insert-edb-date': this.insertDateOpen,//导入指标日期
|
|
|
|
|
|
+ 'insert-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
|
|
}
|
|
}
|
|
@@ -745,38 +798,49 @@ export default {
|
|
|
|
|
|
/* 打开选择指标弹窗
|
|
/* 打开选择指标弹窗
|
|
打开弹窗后仍可以在页面上点击 多存一个选择指标时的当前单元格信息 */
|
|
打开弹窗后仍可以在页面上点击 多存一个选择指标时的当前单元格信息 */
|
|
- selectTargetOpen() {
|
|
|
|
|
|
+ selectTargetOpen(type) {
|
|
this.insertTargetCell = this.selectCell;
|
|
this.insertTargetCell = this.selectCell;
|
|
resetDialogCellStyle();
|
|
resetDialogCellStyle();
|
|
setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
|
|
setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
|
|
|
|
+ if(type === 'cell-edit') {
|
|
|
|
+ this.insertTargetValueInfo = {
|
|
|
|
+ ...this.insertTargetCell
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ this.insertTargetValueInfo = {}
|
|
|
|
+ }
|
|
this.isSelectTargetValueDialog = true;
|
|
this.isSelectTargetValueDialog = true;
|
|
|
|
|
|
- this.isInsertCalculate = false;
|
|
|
|
- this.$refs.calculateEdbDiaRef.initData();
|
|
|
|
|
|
+ this.resetDialogStatus('insertEdbVal')
|
|
},
|
|
},
|
|
|
|
|
|
/* 插入选择指标的值 */
|
|
/* 插入选择指标的值 */
|
|
- insertSelectData({ edbId,value,date }) {
|
|
|
|
|
|
+ insertSelectData({ edbId,value,relationDate,relationUid,str }) {
|
|
|
|
|
|
this.insertTargetCell.DataType = 5;
|
|
this.insertTargetCell.DataType = 5;
|
|
this.insertTargetCell.ShowValue = value;
|
|
this.insertTargetCell.ShowValue = value;
|
|
- this.insertTargetCell.Value = value;
|
|
|
|
|
|
+ this.insertTargetCell.Value = str;
|
|
this.insertTargetCell.EdbInfoId = edbId;
|
|
this.insertTargetCell.EdbInfoId = edbId;
|
|
- this.insertTargetCell.DataTime = date;
|
|
|
|
|
|
+ this.insertTargetCell.DataTime = relationDate;
|
|
|
|
+ this.insertTargetCell.ShowFormatValue = this.insertTargetCell.ShowStyle ? transDecimalPlace(value,JSON.parse(this.insertTargetCell.ShowStyle)) : '';
|
|
|
|
|
|
- this.$message.success('插入成功')
|
|
|
|
|
|
+ value ? this.$message.success('插入成功') : this.$message.warning('该日期当前无值')
|
|
|
|
|
|
//如果有关联表格日期就建立新的关联关系
|
|
//如果有关联表格日期就建立新的关联关系
|
|
- if(date) {
|
|
|
|
|
|
+ if(relationDate&&relationUid) {
|
|
let relation = {
|
|
let relation = {
|
|
insert_cell: {
|
|
insert_cell: {
|
|
key: this.insertTargetCell.Uid,
|
|
key: this.insertTargetCell.Uid,
|
|
- relation_date: this.selectCell.Uid,
|
|
|
|
|
|
+ relation_date: relationUid,
|
|
relation_edb: '',
|
|
relation_edb: '',
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
this.setRelation(relation,5);
|
|
this.setRelation(relation,5);
|
|
|
|
+ }else { //重新插值后之后原来有关联的清除关系
|
|
|
|
+ let haveIndex = this.insertRelationArr.findIndex(_ => _.key===this.insertTargetCell.Uid);
|
|
|
|
+ haveIndex!==-1 && this.insertRelationArr.splice(haveIndex,1)
|
|
|
|
+ resetRelationStyle();
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
@@ -791,6 +855,8 @@ export default {
|
|
this.selectCell.DataTime = '';
|
|
this.selectCell.DataTime = '';
|
|
this.selectCell.DataTimeType = 0;
|
|
this.selectCell.DataTimeType = 0;
|
|
this.selectCell.EdbInfoId = 0;
|
|
this.selectCell.EdbInfoId = 0;
|
|
|
|
+ this.selectCell.ShowStyle = '';
|
|
|
|
+ this.selectCell.ShowFormatValue = '';
|
|
|
|
|
|
this.checkCellRelation(this.selectCell)
|
|
this.checkCellRelation(this.selectCell)
|
|
},
|
|
},
|
|
@@ -903,22 +969,32 @@ export default {
|
|
resetDialogCellStyle();
|
|
resetDialogCellStyle();
|
|
|
|
|
|
if(type === 'cell-edit') { //编辑日期
|
|
if(type === 'cell-edit') { //编辑日期
|
|
- const { DataTimeType } = this.insertTargetCell;
|
|
|
|
this.insertDateInfo = {
|
|
this.insertDateInfo = {
|
|
- 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.$refs.selectTargetValueRef&&this.$refs.selectTargetValueRef.initData();
|
|
|
|
+ this.isSelectTargetValueDialog = false;
|
|
|
|
+ }
|
|
|
|
+ if(type!=='insertEdbCalculateVal') {
|
|
|
|
+ this.$refs.calculateEdbDiaRef&&this.$refs.calculateEdbDiaRef.initData();
|
|
|
|
+ this.isInsertCalculate = false;
|
|
|
|
+ }
|
|
|
|
+ if(type!=='insertDateCalculateVal') {
|
|
|
|
+ this.$refs.calculateDateDiaRef&&this.$refs.calculateDateDiaRef.initData();
|
|
|
|
+ this.isInsertCalculateDate = false;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
/* 插入系统/指标日期 */
|
|
/* 插入系统/指标日期 */
|
|
@@ -947,7 +1023,7 @@ export default {
|
|
|
|
|
|
this.insertCalculateInfo = {
|
|
this.insertCalculateInfo = {
|
|
...menuInfo,
|
|
...menuInfo,
|
|
- formStr: Value,
|
|
|
|
|
|
+ ...this.insertTargetCell
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
this.insertCalculateInfo = {
|
|
this.insertCalculateInfo = {
|
|
@@ -956,34 +1032,68 @@ export default {
|
|
}
|
|
}
|
|
this.isInsertCalculate = true;
|
|
this.isInsertCalculate = true;
|
|
|
|
|
|
- this.isSelectTargetValueDialog = false;
|
|
|
|
- this.$refs.selectTargetValueRef.initData();
|
|
|
|
|
|
+ this.resetDialogStatus('insertEdbCalculateVal')
|
|
},
|
|
},
|
|
|
|
|
|
/* 导入指标计算值 */
|
|
/* 导入指标计算值 */
|
|
insertCalculateData(item) {
|
|
insertCalculateData(item) {
|
|
- console.log(item)
|
|
|
|
- const { InsertValue,EdbInfoId,Str,Date } = item;
|
|
|
|
|
|
+ // console.log(item)
|
|
|
|
+ const { InsertValue,EdbInfoId,Str,relationDate,relationUid } = item;
|
|
this.insertTargetCell.DataType = 7;
|
|
this.insertTargetCell.DataType = 7;
|
|
this.insertTargetCell.ShowValue = InsertValue;
|
|
this.insertTargetCell.ShowValue = InsertValue;
|
|
this.insertTargetCell.Value = Str;
|
|
this.insertTargetCell.Value = Str;
|
|
this.insertTargetCell.EdbInfoId = EdbInfoId;
|
|
this.insertTargetCell.EdbInfoId = EdbInfoId;
|
|
- this.insertTargetCell.DataTime = Date;
|
|
|
|
|
|
+ this.insertTargetCell.DataTime = relationDate;
|
|
|
|
+ this.insertTargetCell.ShowFormatValue = this.insertTargetCell.ShowStyle ? transDecimalPlace(InsertValue,JSON.parse(this.insertTargetCell.ShowStyle)) : '';
|
|
|
|
|
|
- this.$message.success('插入成功')
|
|
|
|
|
|
+ InsertValue ? this.$message.success('插入成功') : this.$message.warning('该日期当前无值')
|
|
|
|
|
|
//如果有关联表格日期就建立新的关联关系
|
|
//如果有关联表格日期就建立新的关联关系
|
|
- if(Date) {
|
|
|
|
|
|
+ if(relationDate&&relationUid) {
|
|
let relation = {
|
|
let relation = {
|
|
insert_cell: {
|
|
insert_cell: {
|
|
key: this.insertTargetCell.Uid,
|
|
key: this.insertTargetCell.Uid,
|
|
- relation_date: this.selectCell.Uid,
|
|
|
|
|
|
+ relation_date: relationUid,
|
|
relation_edb: '',
|
|
relation_edb: '',
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
this.setRelation(relation,7);
|
|
this.setRelation(relation,7);
|
|
|
|
+ }else { //重新插值后之后原来有关联的清除关系
|
|
|
|
+ let haveIndex = this.insertRelationArr.findIndex(_ => _.key===this.insertTargetCell.Uid);
|
|
|
|
+ haveIndex!==-1 && this.insertRelationArr.splice(haveIndex,1)
|
|
|
|
+ resetRelationStyle();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 日期计算弹窗 */
|
|
|
|
+ insertDateCalculateOpen(type) {
|
|
|
|
+ this.insertTargetCell = this.selectCell;
|
|
|
|
+ resetDialogCellStyle()
|
|
|
|
+ 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.insertTargetCell.ShowFormatValue = this.insertTargetCell.ShowStyle ? transDecimalPlace(insertValue,JSON.parse(this.insertTargetCell.ShowStyle)) : '';
|
|
|
|
+
|
|
|
|
+ this.$message.success('插入成功')
|
|
},
|
|
},
|
|
|
|
|
|
/* 初始化8行5列 */
|
|
/* 初始化8行5列 */
|
|
@@ -999,6 +1109,8 @@ export default {
|
|
this.config.data = new Array(8).fill("").map((_,_rindex) => {
|
|
this.config.data = new Array(8).fill("").map((_,_rindex) => {
|
|
return new Array(5).fill("").map((cell,_cindex) => ({
|
|
return new Array(5).fill("").map((cell,_cindex) => ({
|
|
ShowValue: "",
|
|
ShowValue: "",
|
|
|
|
+ ShowStyle: '',
|
|
|
|
+ ShowFormatValue: '',
|
|
Value: "",
|
|
Value: "",
|
|
DataType: 3,
|
|
DataType: 3,
|
|
DataTimeType: 0,
|
|
DataTimeType: 0,
|
|
@@ -1041,10 +1153,14 @@ export default {
|
|
cell.Value = this.copyCellItem.Value;
|
|
cell.Value = this.copyCellItem.Value;
|
|
cell.DataTime = this.copyCellItem.DataTime;
|
|
cell.DataTime = this.copyCellItem.DataTime;
|
|
cell.EdbInfoId = this.copyCellItem.EdbInfoId;
|
|
cell.EdbInfoId = this.copyCellItem.EdbInfoId;
|
|
|
|
+ cell.ShowStyle = this.copyCellItem.ShowStyle;
|
|
|
|
+ cell.ShowFormatValue = this.copyCellItem.ShowFormatValue;
|
|
}else {
|
|
}else {
|
|
cell.DataType = 3;
|
|
cell.DataType = 3;
|
|
cell.ShowValue = this.copyCellItem.ShowValue;
|
|
cell.ShowValue = this.copyCellItem.ShowValue;
|
|
cell.Value = this.copyCellItem.ShowValue;
|
|
cell.Value = this.copyCellItem.ShowValue;
|
|
|
|
+ cell.ShowStyle = this.copyCellItem.ShowStyle;
|
|
|
|
+ cell.ShowFormatValue = this.copyCellItem.ShowFormatValue;
|
|
cell.DataTime = '';
|
|
cell.DataTime = '';
|
|
cell.EdbInfoId = 0;
|
|
cell.EdbInfoId = 0;
|
|
}
|
|
}
|
|
@@ -1053,26 +1169,24 @@ export default {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
},
|
|
},
|
|
|
|
|
|
- /* 单元格enter时切换编辑状态 */
|
|
|
|
|
|
+ /* 单元格enter失焦 */
|
|
keyEnterHandle(e,cell) {
|
|
keyEnterHandle(e,cell) {
|
|
if(e.keyCode===13) {
|
|
if(e.keyCode===13) {
|
|
//非得搞个要回车失焦
|
|
//非得搞个要回车失焦
|
|
e.target.nodeName && e.target.blur();
|
|
e.target.nodeName && e.target.blur();
|
|
this.$refs[`inputRef${e.target.dataset.key}`]&&this.$refs[`inputRef${e.target.dataset.key}`][0].close()
|
|
this.$refs[`inputRef${e.target.dataset.key}`]&&this.$refs[`inputRef${e.target.dataset.key}`][0].close()
|
|
|
|
|
|
- cell.DataType===6 && this.$set(cell,'CanEdit',false)
|
|
|
|
- // this.calculateClickCell = null
|
|
|
|
|
|
+ // cell.DataType===6 && this.$set(cell,'CanEdit',false)
|
|
|
|
+ // this.$set(cell,'CanEdit',false)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- /* 支持公式单元格双击切换状态 */
|
|
|
|
|
|
+ /* 双击切换状态 插值单元格不允许切换 可切换类型1,2,3,6*/
|
|
dblClickCellHandle(e,cell) {
|
|
dblClickCellHandle(e,cell) {
|
|
- if(this.disabled || cell.DataType!==6) return
|
|
|
|
|
|
+ if(this.disabled || ![1,2,3,6].includes(cell.DataType) || [1,2].includes(cell.DataTimeType)) return
|
|
|
|
|
|
this.$set(cell,'CanEdit',true)
|
|
this.$set(cell,'CanEdit',true)
|
|
-
|
|
|
|
- // this.calculateClickCell = cell;
|
|
|
|
- // setRelationStyle({ key:cell.Uid },'td-choose-insert-target')
|
|
|
|
|
|
+ console.log(cell)
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if(e.target.childNodes[0].childNodes[0].childNodes[1].nodeName==='INPUT') e.target.childNodes[0].childNodes[0].childNodes[1].focus();
|
|
if(e.target.childNodes[0].childNodes[0].childNodes[1].nodeName==='INPUT') e.target.childNodes[0].childNodes[0].childNodes[1].focus();
|
|
@@ -1096,6 +1210,13 @@ export default {
|
|
if(e.keyCode === 9) {
|
|
if(e.keyCode === 9) {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 改变单元格显示文本 */
|
|
|
|
+ updateCellStyle({ShowStyle,ShowFormatValue}) {
|
|
|
|
+
|
|
|
|
+ this.$set(this.selectCell,'ShowStyle',ShowStyle)
|
|
|
|
+ this.$set(this.selectCell,'ShowFormatValue',ShowFormatValue)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -1237,6 +1358,9 @@ export default {
|
|
left: -9999px;
|
|
left: -9999px;
|
|
background: #fff;
|
|
background: #fff;
|
|
padding: 10px 0;
|
|
padding: 10px 0;
|
|
|
|
+ min-width: 180px;
|
|
|
|
+ max-height: 400px;
|
|
|
|
+ overflow-y: auto;
|
|
/* border: 1px solid #999; */
|
|
/* border: 1px solid #999; */
|
|
box-shadow: 0 1px 4px #999;
|
|
box-shadow: 0 1px 4px #999;
|
|
.item {
|
|
.item {
|
|
@@ -1251,15 +1375,21 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.subMenu-wrapper {
|
|
.subMenu-wrapper {
|
|
- display: none;
|
|
|
|
|
|
+ width: 180px;
|
|
|
|
+ /* display: none; */
|
|
padding: 10px 0;
|
|
padding: 10px 0;
|
|
- box-shadow: 0 1px 4px #999;
|
|
|
|
- background: #fff;
|
|
|
|
- position: absolute;
|
|
|
|
- right: -172px;
|
|
|
|
|
|
+ /* box-shadow: 0 1px 4px #999; */
|
|
|
|
+ /* background: #fff; */
|
|
|
|
+ /* position: absolute;
|
|
|
|
+ right: -178px;
|
|
top:-205px;
|
|
top:-205px;
|
|
max-height: 400px;
|
|
max-height: 400px;
|
|
- overflow-y: auto;
|
|
|
|
|
|
+ overflow-y: auto; */
|
|
|
|
+ .item {
|
|
|
|
+ &:hover {
|
|
|
|
+ background: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1291,4 +1421,21 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.el-collapse {
|
|
|
|
+ border: none !important;
|
|
|
|
+ .el-collapse-item__header {
|
|
|
|
+ padding: 0;
|
|
|
|
+ height: auto;
|
|
|
|
+ line-height: normal;
|
|
|
|
+ margin-bottom: 0 !important;
|
|
|
|
+ background: transparent !important;
|
|
|
|
+ }
|
|
|
|
+ .el-collapse-item__wrap {
|
|
|
|
+ background: transparent !important;
|
|
|
|
+ border: none !important;
|
|
|
|
+ }
|
|
|
|
+ .el-collapse-item__content {
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|