|
@@ -183,6 +183,18 @@ const props = defineProps({
|
|
type: String,
|
|
type: String,
|
|
default: "",
|
|
default: "",
|
|
},
|
|
},
|
|
|
|
+ porjectId: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: "",
|
|
|
|
+ },
|
|
|
|
+ scopeType: {
|
|
|
|
+ type: [String, Number],
|
|
|
|
+ default: "",
|
|
|
|
+ },
|
|
|
|
+ nodeInfo: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: () => {},
|
|
|
|
+ },
|
|
});
|
|
});
|
|
//事件
|
|
//事件
|
|
const emit = defineEmits(["close"]);
|
|
const emit = defineEmits(["close"]);
|
|
@@ -201,12 +213,18 @@ watch(isShow, (val) => {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const nodeId = ref(props.nodeId);
|
|
const nodeId = ref(props.nodeId);
|
|
|
|
+const porjectId = ref(props.porjectId);
|
|
|
|
+const scopeType = ref(props.scopeType);
|
|
|
|
+const nodeInfo = ref(props.nodeInfo);
|
|
const delIds = ref([]);
|
|
const delIds = ref([]);
|
|
//监听数据
|
|
//监听数据
|
|
watch(
|
|
watch(
|
|
- () => [props.nodeId],
|
|
|
|
- ([tid]) => {
|
|
|
|
|
|
+ () => [props.nodeId, props.porjectId, props.scopeType, props.nodeInfo],
|
|
|
|
+ ([tid, pid, stype, ninfo]) => {
|
|
nodeId.value = tid;
|
|
nodeId.value = tid;
|
|
|
|
+ porjectId.value = pid;
|
|
|
|
+ scopeType.value = stype;
|
|
|
|
+ nodeInfo.value = ninfo;
|
|
},
|
|
},
|
|
{ deep: true }
|
|
{ deep: true }
|
|
);
|
|
);
|
|
@@ -232,8 +250,8 @@ const saveElementHandle = async () => {
|
|
if (tag) {
|
|
if (tag) {
|
|
submitLoading.value = true;
|
|
submitLoading.value = true;
|
|
const { error, code, data } = await mainApi.saveOrUpdateBatch({
|
|
const { error, code, data } = await mainApi.saveOrUpdateBatch({
|
|
- scopeType: 1,
|
|
|
|
-
|
|
|
|
|
|
+ scopeType: scopeType.value,
|
|
|
|
+ porjectId: porjectId.value,
|
|
nodeId: nodeId.value,
|
|
nodeId: nodeId.value,
|
|
wps: tableData.value,
|
|
wps: tableData.value,
|
|
type: 1,
|
|
type: 1,
|
|
@@ -260,9 +278,12 @@ const tableLoading = ref(false);
|
|
const tableData = ref([]);
|
|
const tableData = ref([]);
|
|
|
|
|
|
const getTableData = async () => {
|
|
const getTableData = async () => {
|
|
|
|
+ let pid = nodeInfo.value.primaryKeyId
|
|
|
|
+ ? nodeInfo.value.primaryKeyId
|
|
|
|
+ : nodeInfo.value.pKeyId;
|
|
tableLoading.value = true;
|
|
tableLoading.value = true;
|
|
const { data } = await mainApi.parameters({
|
|
const { data } = await mainApi.parameters({
|
|
- wbsId: nodeId.value,
|
|
|
|
|
|
+ wbsId: porjectId.value ? pid : nodeId.value,
|
|
});
|
|
});
|
|
|
|
|
|
tableData.value = getArrValue(data);
|
|
tableData.value = getArrValue(data);
|
|
@@ -310,8 +331,9 @@ const saveNameHandle = async () => {
|
|
if (tag) {
|
|
if (tag) {
|
|
setNameLoading.value = true;
|
|
setNameLoading.value = true;
|
|
const { error, code, data } = await mainApi.saveOrUpdateBatch({
|
|
const { error, code, data } = await mainApi.saveOrUpdateBatch({
|
|
- scopeType: 1,
|
|
|
|
|
|
+ scopeType: scopeType.value,
|
|
nodeId: nodeId.value,
|
|
nodeId: nodeId.value,
|
|
|
|
+ porjectId: porjectId.value,
|
|
wps: nameTableData.value,
|
|
wps: nameTableData.value,
|
|
type: 0,
|
|
type: 0,
|
|
delIds: delIds.value,
|
|
delIds: delIds.value,
|
|
@@ -368,8 +390,9 @@ const linkParamShow = ref(false);
|
|
const getLinkTableData = async () => {
|
|
const getLinkTableData = async () => {
|
|
const { error, code, data } = await mainApi.getParamElements({
|
|
const { error, code, data } = await mainApi.getParamElements({
|
|
nodeId: nodeId.value,
|
|
nodeId: nodeId.value,
|
|
|
|
+ porjectId: porjectId.value,
|
|
paramId: curParam.value.id,
|
|
paramId: curParam.value.id,
|
|
- scopeType: 1,
|
|
|
|
|
|
+ scopeType: scopeType.value,
|
|
});
|
|
});
|
|
|
|
|
|
//判断状态
|
|
//判断状态
|
|
@@ -394,11 +417,14 @@ const chooseLinkShow = ref(false);
|
|
const chooseLinkTableData = ref([]);
|
|
const chooseLinkTableData = ref([]);
|
|
const chooselinkTableLoading = ref(false);
|
|
const chooselinkTableLoading = ref(false);
|
|
const getChooseData = async (id) => {
|
|
const getChooseData = async (id) => {
|
|
|
|
+ let pid = nodeInfo.value.primaryKeyId
|
|
|
|
+ ? nodeInfo.value.primaryKeyId
|
|
|
|
+ : nodeInfo.value.pKeyId;
|
|
chooselinkTableLoading.value = true;
|
|
chooselinkTableLoading.value = true;
|
|
const { error, code, data } = await mainApi.selectFormElements({
|
|
const { error, code, data } = await mainApi.selectFormElements({
|
|
- nodeId: nodeId.value,
|
|
|
|
|
|
+ nodeId: porjectId.value ? pid : nodeId.value,
|
|
id: id,
|
|
id: id,
|
|
- type: 5,
|
|
|
|
|
|
+ type: porjectId.value ? 3 : 5,
|
|
});
|
|
});
|
|
chooselinkTableLoading.value = false;
|
|
chooselinkTableLoading.value = false;
|
|
//判断状态
|
|
//判断状态
|
|
@@ -475,14 +501,14 @@ const refreshLoad = ref(false);
|
|
const refreshNode = async () => {
|
|
const refreshNode = async () => {
|
|
refreshLoad.value = true;
|
|
refreshLoad.value = true;
|
|
const { error, code, data, msg } = await mainApi.refrehPram({
|
|
const { error, code, data, msg } = await mainApi.refrehPram({
|
|
- type: 0,
|
|
|
|
|
|
+ type: porjectId.value ? 1 : 0,
|
|
nodeId: nodeId.value,
|
|
nodeId: nodeId.value,
|
|
|
|
+ porjectId: porjectId.value,
|
|
});
|
|
});
|
|
refreshLoad.value = false;
|
|
refreshLoad.value = false;
|
|
//判断状态
|
|
//判断状态
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
window.$message.success(msg);
|
|
window.$message.success(msg);
|
|
- getLinkTableData();
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|