|
|
@@ -842,6 +842,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'
|
|
|
+
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
|
datas: {
|
|
|
@@ -927,6 +928,7 @@ const isTemplateType = ref(useAppState.contractInfo?.templateType === 2)
|
|
|
const formDataList = ref([])
|
|
|
const formKeyIds = ref('')
|
|
|
const formparentId = ref('')
|
|
|
+const primaryKeyId = ref(props.primaryKeyId)
|
|
|
|
|
|
//处理ref
|
|
|
const itemRefs = ref([])
|
|
|
@@ -1136,24 +1138,44 @@ const isOpen = infos['isOpenRandomNumber'] ?? 0
|
|
|
newArr.push({ label: '关联试验文件', key: 'file' })
|
|
|
newArr.push({ label: '公式参数', key: 'formula' })
|
|
|
newArr.push({ label: '含水率', key: 'water' })
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
if (isStatus.value !== 3) {
|
|
|
newArr.push({ label: '清除所有数据', key: 'clear' }),
|
|
|
newArr.push({ label: '清除字段数据', key: 'clearcur' })
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ // newArr.push({ label: '取消公式引用', key: 'cancelGs' })
|
|
|
+ // newArr.push({ label: '恢复公式引用', key: 'addGs' })
|
|
|
tableFormMenu.value = newArr
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//鼠标右键事件
|
|
|
+
|
|
|
const tableFormRightTap = (
|
|
|
- { event, KeyName, startPos, endPos, pkeyId },
|
|
|
+ ele,
|
|
|
index,
|
|
|
) => {
|
|
|
+ console.log(ele, 'ele')
|
|
|
+
|
|
|
+ const { event, KeyName, startPos, endPos, pkeyId, clearFormula } = ele
|
|
|
+ const item = listDatas.value[index]
|
|
|
+ console.log(item, 'item')
|
|
|
//存储临时信息
|
|
|
- tableFormItemNode.value = { KeyName, index, startPos, endPos, pkeyId }
|
|
|
+ tableFormItemNode.value = { KeyName, index, startPos, endPos, pkeyId, initTableName:item.fullName }
|
|
|
+ console.log(clearFormula, 'clearFormula1111111')
|
|
|
+ if (clearFormula == 0) {
|
|
|
+ tableFormMenu.value.push({
|
|
|
+ label: '取消公式引用', key: 'cancelGs',
|
|
|
+ })
|
|
|
+ } else if (clearFormula == 1) {
|
|
|
+ tableFormMenu.value.push({
|
|
|
+ label: '恢复公式引用', key: 'addGs',
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
contextMenuRef.value?.showMenu(event, false) //展开菜单
|
|
|
}
|
|
|
const checkKeys = ref([])
|
|
|
@@ -1237,6 +1259,16 @@ const handleMenuSelect = async ({ key }) => {
|
|
|
} else if (key === 'deviation') {
|
|
|
deviationShow.value = true
|
|
|
getDeviationData()
|
|
|
+ } else if (key === 'cancelGs') {
|
|
|
+ console.log(tableFormItemNode.value, 'tableFormItemNode.value')
|
|
|
+ tableFormItemNode.value.status = 0
|
|
|
+ //取消公式引用
|
|
|
+ handleGsClick(tableFormItemNode.value)
|
|
|
+
|
|
|
+
|
|
|
+ } else if (key === 'addGs') {
|
|
|
+ tableFormItemNode.value.status = 1
|
|
|
+ handleGsClick(tableFormItemNode.value)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -2573,6 +2605,21 @@ const clearSaveClick = async (type)=>{
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+//公式引用
|
|
|
+const handleGsClick = async (item) => {
|
|
|
+ const { error, code, msg } = await wbsApi.setFormulaReference({
|
|
|
+ key:item.KeyName,
|
|
|
+ initTableName:item.initTableName,
|
|
|
+ pkeyId:item.pkeyId,
|
|
|
+ status:item.status,
|
|
|
+ pid:treenodeDataInfo.value.primaryKeyId,
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(msg)
|
|
|
+ }
|
|
|
+}
|
|
|
// 暴露出去
|
|
|
defineExpose({
|
|
|
getFormData,
|