|
|
@@ -160,7 +160,7 @@
|
|
|
:classify="classifys" :datas="changeFormDatas(item?.pkeyId, 'collapse')" :kid="item?.pkeyId"
|
|
|
:node-name="item.nodeName" :pid="`table-form-${item?.pkeyId}`" :tid="treeId"
|
|
|
@excel-body-tap="excelTableFormClick($event)" @render="tableFormRender($event, item, index)"
|
|
|
- @right-tap="tableFormRightTap($event, index)"
|
|
|
+ @right-tap="tableFormRightTap($event, index)" @focus-tap="tableFromLeftTap($event)"
|
|
|
/>
|
|
|
<el-tooltip
|
|
|
:content="item.isWindow
|
|
|
@@ -195,6 +195,18 @@
|
|
|
</HcTooltip>
|
|
|
</div>
|
|
|
<div class="btn-action">
|
|
|
+ <el-button
|
|
|
+ v-if="!isOpenFormulaDescription" size="small" hc-btn color="#2550A2"
|
|
|
+ style="color:#fff;border-radius: 3px;" @click="enableFormulaDescription"
|
|
|
+ >
|
|
|
+ 开启公式说明
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-else size="small" hc-btn color="#FF7D43"
|
|
|
+ style="color:#F3F3F3;border-radius: 3px;" @click="enableFormulaDescription"
|
|
|
+ >
|
|
|
+ 关闭公式说明
|
|
|
+ </el-button>
|
|
|
<el-button v-if="isEnableBulk" type="warning" size="small" @click="enableBulkReplication">
|
|
|
关闭批量复制
|
|
|
</el-button>
|
|
|
@@ -524,7 +536,6 @@
|
|
|
</div>
|
|
|
</hc-new-dialog>
|
|
|
<!-- 导入表格数据 -->
|
|
|
-
|
|
|
<hc-dialog v-model="uploadFileDialog" title="导入表格数据" @save="uploadFileClickSave">
|
|
|
<div class="dialog-content">
|
|
|
<!-- 提示文本 -->
|
|
|
@@ -551,6 +562,43 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</hc-dialog>
|
|
|
+
|
|
|
+ <!-- 公式说明弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ v-model="formulaDescriptionVisible" modal-class="formula-dialog" width="350px" title="公式说明"
|
|
|
+ :modal="false" modal-penetrable :close-on-press-escape="false" transition="scale"
|
|
|
+ :close-icon="CircleCloseFilled" append-to-body
|
|
|
+ >
|
|
|
+ <div class="data-item">
|
|
|
+ <span class="label">源节点</span>
|
|
|
+ <span class="value">{{ formulaDescriptionData.nodeName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="data-item">
|
|
|
+ <span class="label">源表</span>
|
|
|
+ <span class="value">{{ formulaDescriptionData.tableName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="data-item">
|
|
|
+ <span class="label">源位置</span>
|
|
|
+ <span class="value">{{ formulaDescriptionData.elementName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="data-item">
|
|
|
+ <span class="label">获取方式</span>
|
|
|
+ <span class="value">{{ formulaDescriptionData.type }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="data-item">
|
|
|
+ <span class="label">源数据</span>
|
|
|
+ <span class="value">{{ formulaDescriptionData.data }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="divider" />
|
|
|
+ <div class="data-item">
|
|
|
+ <span class="label">获取结果</span>
|
|
|
+ <span class="value">{{ formulaDescriptionData.result }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="view-btn">
|
|
|
+ 查看详情
|
|
|
+ <HcIcon name="arrow-right" class="pl-1" />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -596,6 +644,7 @@ import nodeBaseApi from '~api/data-fill/nodebaseinfo'
|
|
|
import thirdApi from '~api/tentative/detect/third'
|
|
|
import { formValidate } from 'js-fast-way'
|
|
|
import { getDictionaryData } from '~uti/tools'
|
|
|
+import { CircleCloseFilled } from '@element-plus/icons-vue'
|
|
|
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
|
@@ -675,7 +724,10 @@ const tree_AutoExpandKeys = ref(props.treeAutoExpandKeys)
|
|
|
const treenodeDataInfo = ref(props.treenodeDataInfo)
|
|
|
const newlistdata = ref(props.newlistdata)
|
|
|
const isEnableBulk = ref(true)
|
|
|
-// const isEnableBulk = ref(false)
|
|
|
+const isOpenFormulaDescription = ref(false) //是否可以打开公式说明弹窗
|
|
|
+const formulaDescriptionVisible = ref(false) //公式说明弹窗是否显示
|
|
|
+const formulaDescriptionData = ref({}) //公式说明数据
|
|
|
+
|
|
|
const contractInfo = ref(props.contractInfo)
|
|
|
const isTemplateType = ref(useAppState.contractInfo?.templateType === 2)
|
|
|
//表单变量
|
|
|
@@ -791,12 +843,26 @@ onMounted(() => {
|
|
|
setTableFormMenu(useAppState.projectInfo)
|
|
|
const { offsetHeight } = document.body
|
|
|
DragModalHeight.value = offsetHeight - 200
|
|
|
+
|
|
|
+ const enableFormulaDescription = getStoreValue('enableFormulaDescription')
|
|
|
+ isOpenFormulaDescription.value = enableFormulaDescription ?? false
|
|
|
+
|
|
|
+ document.getElementById('app').addEventListener('click', e => {
|
|
|
+ if (!(e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') || !e.target.id.includes('key')) {
|
|
|
+ formulaDescriptionVisible.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
const isBulk = getStoreValue('isEnableBulk')
|
|
|
isEnableBulk.value = isBulk ?? true
|
|
|
HTableForm.setEnableBulk(isBulk)
|
|
|
if (isBulk) setMountOnEventKey()
|
|
|
})
|
|
|
|
|
|
+onUnmounted(() => {
|
|
|
+ document.getElementById('app').removeEventListener('click')
|
|
|
+})
|
|
|
+
|
|
|
//处理变动的数据
|
|
|
const changeFormData = ref({
|
|
|
window: [],
|
|
|
@@ -1863,6 +1929,33 @@ const excelTableFormClick = (key) => {
|
|
|
presentId.value = key
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+const tableFromLeftTap = async ({ key, clearFormula, pkeyId }) => {
|
|
|
+ if (isOpenFormulaDescription.value && clearFormula === '0') {
|
|
|
+ const refs = await getFormRef(pkeyId)
|
|
|
+ const isRegExp = await refs?.isFormRegExp()
|
|
|
+ if (isRegExp) {
|
|
|
+ const formData = refs?.getFormData()
|
|
|
+ const { error, code, data } = await wbsApi.getFormulaData({ ...formData, keyname: key })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ formulaDescriptionData.value = data
|
|
|
+ formulaDescriptionVisible.value = true
|
|
|
+ } else {
|
|
|
+ formulaDescriptionVisible.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ formulaDescriptionVisible.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// isOpenFormulaDescription: 是否开启公式说明
|
|
|
+//开启/关闭 公式说明
|
|
|
+const enableFormulaDescription = async () => {
|
|
|
+ isOpenFormulaDescription.value = !isOpenFormulaDescription.value
|
|
|
+ setStoreValue('enableFormulaDescription', isOpenFormulaDescription.value)
|
|
|
+}
|
|
|
+
|
|
|
//缓存被激活时
|
|
|
onActivated(() => {
|
|
|
if (isEnableBulk.value) {
|
|
|
@@ -2434,4 +2527,66 @@ defineExpose({
|
|
|
|
|
|
<style lang="scss">
|
|
|
@import "./style.scss";
|
|
|
+
|
|
|
+.el-modal-dialog.formula-dialog {
|
|
|
+ pointer-events: none !important;
|
|
|
+
|
|
|
+ .el-dialog {
|
|
|
+ pointer-events: all !important;
|
|
|
+ margin: 0 !important;
|
|
|
+ top: 60px;
|
|
|
+ left: calc(100vw - 360px);
|
|
|
+
|
|
|
+ .el-dialog__title {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-dialog__close {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #DB3737 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .divider {
|
|
|
+ height: 3px;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #E7E7E7;
|
|
|
+ margin: 15px 0 5px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .data-item {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: flex-start;
|
|
|
+ padding-top: 10px;
|
|
|
+
|
|
|
+ .label {
|
|
|
+ width: 80px;
|
|
|
+ text-align: left;
|
|
|
+ color: #949494;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
+ flex: 1;
|
|
|
+ overflow: hidden;
|
|
|
+ color: #000000;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .result {
|
|
|
+ color: #3F9EFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .view-btn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 10px;
|
|
|
+ color: #2550A2;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|