fix: 新增编辑接口同步修改所有组件功能
This commit is contained in:
parent
6de7c26b6e
commit
92ff8c7c25
@ -131,6 +131,19 @@ const editSaveHandle = (newData: RequestDataPondItemType) => {
|
||||
const targetIndex = requestDataPond.value.findIndex(item => item.dataPondId === newData.dataPondId)
|
||||
if (targetIndex !== -1) {
|
||||
requestDataPond.value.splice(targetIndex, 1, newData)
|
||||
// 修改数据池后, 修改所有关联的组件
|
||||
chartEditStore.getComponentList.forEach(item => {
|
||||
if (
|
||||
item.request.requestDataType === RequestDataTypeEnum.Pond &&
|
||||
item.request.requestDataPondId === newData.dataPondId
|
||||
) {
|
||||
item.request = {
|
||||
...toRaw(newData.dataPondRequestConfig),
|
||||
requestDataPondId: newData.dataPondId
|
||||
}
|
||||
}
|
||||
})
|
||||
window.$message.success('保存成功!')
|
||||
} else {
|
||||
window.$message.error('编辑失败,请稍后重试!')
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ const closeAndSendHandle = () => {
|
||||
return
|
||||
}
|
||||
goDialog({
|
||||
message: '是否保存内容?',
|
||||
message: '保存内容将同步修改所有使用此接口的组件, 是否继续?',
|
||||
isMaskClosable: true,
|
||||
transformOrigin: 'center',
|
||||
onPositiveCallback: () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user