|
@@ -182,7 +182,16 @@ import dataApi1 from "~api/tentative/parameter/container"
|
|
|
import dataApi2 from "~api/tentative/device/approach"
|
|
|
import {getClassList} from "~api/tentative";
|
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
|
-import {isString, getObjVal, getArrValue, formValidate, deepClone, setPosInsert, setPosRange} from "js-fast-way"
|
|
|
+import {
|
|
|
+ isString,
|
|
|
+ getObjVal,
|
|
|
+ getArrValue,
|
|
|
+ formValidate,
|
|
|
+ deepClone,
|
|
|
+ setPosInsert,
|
|
|
+ setPosRange,
|
|
|
+ getObjValue
|
|
|
+} from "js-fast-way"
|
|
|
|
|
|
const router = useRouter()
|
|
|
const useRoutes = useRoute()
|
|
@@ -231,8 +240,6 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
default: () => ('')
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
const listDatas = ref(props.datas)
|
|
|
const isStatus = ref(props.status)
|
|
@@ -325,8 +332,6 @@ const CollapseChange = async (name) => {
|
|
|
changeitem.isCollapseLoad = true
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
if (names.length > 0) {
|
|
|
getOffsetTop(name)
|
|
|
const index = names[1]
|
|
@@ -343,17 +348,15 @@ const CollapseChange = async (name) => {
|
|
|
item.pKeyId = item1.pkeyId
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
if (!item.isTableFormRender) {
|
|
|
await getBussDataInfo(item, index)
|
|
|
} else {
|
|
|
await getBussDataInfo1(item, index)
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
//渲染表单
|
|
|
await getExcelHtml(item, index)
|
|
|
+ await getChartConfig()
|
|
|
} else {
|
|
|
// await getExcelHtml(item,index)
|
|
|
getOffsetTop()
|
|
@@ -385,8 +388,11 @@ const getExcelHtml = async (item, index) => {
|
|
|
onRightClick(event, KeyName, index)
|
|
|
},
|
|
|
//表单正则效验
|
|
|
- onBlur: (event, key, reg, val, msg) => {
|
|
|
+ onBlur: (event, key, reg, val, msg, type, c, d) => {
|
|
|
setTableFormBlurReg(pkeyIds, event, key, reg, val, msg, item, index)
|
|
|
+ if (type === 'chart') {
|
|
|
+ getChartConfig(formData.value[index])
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
item.isTableFormRender = true
|
|
@@ -403,6 +409,24 @@ const getExcelHtml = async (item, index) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//图表信息
|
|
|
+const chartKey = ref('key_41__27_0')
|
|
|
+const getChartConfig = async (formData = {}) => {
|
|
|
+ let {formChartKey} = formData, {id} = baseData.value, formKeys = {}
|
|
|
+ const chartKeys = formChartKey ? formChartKey.split(',') : []
|
|
|
+ chartKeys.forEach((item) => {
|
|
|
+ formKeys[item] = formData[item] ?? ''
|
|
|
+ })
|
|
|
+ console.log('formKeys', formKeys)
|
|
|
+ const {data} = await dataApi.getChartInit({
|
|
|
+ id: id || nodeIdvaluedata.value || newaddId.value,
|
|
|
+ pkeyId: formKeyIds.value,
|
|
|
+ data: formKeys
|
|
|
+ })
|
|
|
+ //更新图表配置
|
|
|
+ formData[chartKey.value] = getObjValue(data)
|
|
|
+}
|
|
|
+
|
|
|
//正则效验
|
|
|
const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index) => {
|
|
|
const dom = document.getElementById(key)?.parentElement ?? ''
|
|
@@ -472,7 +496,6 @@ const changePositionInput = (infodata) => {
|
|
|
getPositionData()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//获取已填写的数据
|
|
|
const getBussDataInfo = async (item, index) => {
|
|
|
const pkeyIds = getValString(item.pKeyId)
|
|
@@ -654,7 +677,7 @@ const saveExcelBussData = async (item, index, showTip = true) => {
|
|
|
const InitObj = getFormDataInit(item)
|
|
|
baseData.value.tableType = tabTypeKeyInfo.value
|
|
|
console.log(baseData.value.tableType, ' baseData.value.tableType');
|
|
|
-
|
|
|
+
|
|
|
if(newaddId.value.length>0){
|
|
|
baseData.value.id=newaddId.value
|
|
|
}
|