|
@@ -52,22 +52,21 @@ const props = defineProps({
|
|
|
type: Object,
|
|
|
default: () => ({}),
|
|
|
},
|
|
|
- nodeName: { // 表单名称
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
- },
|
|
|
+
|
|
|
pid: { // 折叠ID
|
|
|
type: String,
|
|
|
default: '',
|
|
|
},
|
|
|
- nodeType:{
|
|
|
- type:[String, Number],
|
|
|
- default: '', //表单节点类型
|
|
|
- },
|
|
|
+
|
|
|
tableId:{
|
|
|
type: [String, Number],
|
|
|
default: '', //表单initTableId
|
|
|
},
|
|
|
+ agreementId:{
|
|
|
+ type: [String, Number],
|
|
|
+ default: '', //协议ID
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
})
|
|
|
|
|
@@ -79,17 +78,18 @@ const projectId = ref(useAppState.getProjectId)
|
|
|
const contractId = ref(useAppState.getContractId)
|
|
|
const keyId = ref(props.kid ? props.kid + '' : '')
|
|
|
const areaId = ref(props.areaId)
|
|
|
+const agreementId = ref(props.agreementId)
|
|
|
const classify = ref(props.classify)
|
|
|
const loading = ref(false)
|
|
|
const changeData = ref(props.datas)
|
|
|
-const nodeNames = ref(props.nodeName)
|
|
|
+
|
|
|
|
|
|
const heights = ref(props.height)
|
|
|
const widths = ref(props.width)
|
|
|
const activeKey = ref(props.pid)
|
|
|
|
|
|
const tableFormRef = ref(null)
|
|
|
-const nodeType = ref(props.nodeType)
|
|
|
+
|
|
|
const tableId = ref(props.tableId)
|
|
|
|
|
|
//监听
|
|
@@ -103,22 +103,24 @@ watch(() => [
|
|
|
props.height,
|
|
|
props.width,
|
|
|
props.pid,
|
|
|
- props.nodeType,
|
|
|
+
|
|
|
props.tableId,
|
|
|
+ props.agreementId,
|
|
|
], (
|
|
|
- [project_id, contract_id, area_id, key_id, cid, nodeName, height, width, pid, node_type, table_id],
|
|
|
+ [project_id, contract_id, area_id, key_id, cid, height, width, pid, , table_id, aeement_id],
|
|
|
) => {
|
|
|
projectId.value = project_id
|
|
|
contractId.value = contract_id
|
|
|
areaId.value = area_id
|
|
|
keyId.value = key_id ? key_id + '' : ''
|
|
|
classify.value = cid
|
|
|
- nodeNames.value = nodeName
|
|
|
+
|
|
|
heights.value = height
|
|
|
widths.value = width
|
|
|
activeKey.value = pid
|
|
|
- nodeType.value = node_type
|
|
|
+
|
|
|
tableId.value = table_id
|
|
|
+ agreementId.value = aeement_id
|
|
|
})
|
|
|
|
|
|
//深度监听变动的对象数据
|
|
@@ -156,14 +158,14 @@ const getFormDataInit = () => {
|
|
|
// pkeyId: keyId.value,
|
|
|
// nodeId: treeId.value,
|
|
|
// isRenderForm: false,
|
|
|
- pkeyId: keyId.value,
|
|
|
- agreementId:'', // 协议的id,新增协议为null
|
|
|
+
|
|
|
+ agreementId: agreementId.value, // 协议的id,新增协议为null
|
|
|
areaId:areaId.value, //当前树节点id
|
|
|
- linkId:'', //当前表单的id,
|
|
|
projectId: projectId.value,
|
|
|
tableId:tableId.value, //表单的tableId
|
|
|
isRenderForm: false,
|
|
|
- nodeType:nodeType.value,
|
|
|
+ linkId: keyId.value,
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -172,7 +174,7 @@ const tableFormInfo = ref({})
|
|
|
const getTableFormInfo = async (pkeyId) => {
|
|
|
if (pkeyId) {
|
|
|
const { error, code, data } = await landApi.getBussInfo({
|
|
|
- linkId: pkeyId,
|
|
|
+ id: pkeyId,
|
|
|
}, false)
|
|
|
const resData = getObjVal(data)
|
|
|
if (!error && code === 200 && resData) {
|
|
@@ -198,8 +200,8 @@ const colsKeys = ref([])
|
|
|
const getHtmlBussColsApi = async (pkeyId) => {
|
|
|
if (pkeyId) {
|
|
|
const { error, code, data } = await landApi.getBussCols({
|
|
|
- pkeyId: pkeyId,
|
|
|
- type:classify.value,
|
|
|
+ id: pkeyId,
|
|
|
+
|
|
|
}, false)
|
|
|
if (!error && code === 200) {
|
|
|
let keys = getArrValue(data)
|
|
@@ -222,8 +224,7 @@ const excelHtml = ref('')
|
|
|
const getExcelHtml = async (pkeyId) => {
|
|
|
if (pkeyId) {
|
|
|
const { error, code, data } = await landApi.getExcelHtml({
|
|
|
- pkeyId: pkeyId,
|
|
|
- type:classify.value,
|
|
|
+ id: pkeyId,
|
|
|
}, false)
|
|
|
const resData = isString(data) ? data || '' : ''
|
|
|
if (!error && code === 200 && resData) {
|
|
@@ -255,7 +256,6 @@ const tableFormRightTap = (item) => {
|
|
|
const setFormChangeData = (data) => {
|
|
|
const form = deepClone(tableFormInfo.value)
|
|
|
tableFormInfo.value = { ...form, ...data }
|
|
|
- //console.log('设置数据', {...form, ...data})
|
|
|
}
|
|
|
|
|
|
const getFormData = () => {
|
|
@@ -276,10 +276,7 @@ const isFormRegExp = async () => {
|
|
|
return await tableFormRef.value?.isFormRegExp()
|
|
|
}
|
|
|
|
|
|
-//获取表单名称
|
|
|
-const getNodeName = () => {
|
|
|
- return nodeNames.value
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
//按下ctrl键
|
|
|
const setIsCtrlKey = (data) => {
|
|
@@ -302,7 +299,7 @@ defineExpose({
|
|
|
setFormData,
|
|
|
getRegExpJson,
|
|
|
isFormRegExp,
|
|
|
- getNodeName,
|
|
|
+
|
|
|
setIsCtrlKey,
|
|
|
setCopyKeyList,
|
|
|
setPasteKeyList,
|