Skip to content

Commit

Permalink
[Fix][UI Next][V1.0.0-Beta] Fix the startup parameter display error. (#…
Browse files Browse the repository at this point in the history
…9692)

* [Fix][UI Next][V1.0.0-Beta] Fix the startup parameter display error.

* [Fix][UI Next][V1.0.0-Beta] Change the key of the startup parameter item.
  • Loading branch information
Amy0104 authored Apr 24, 2022
1 parent 86bdb82 commit 3e85194
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,12 @@ export default defineComponent({
})

watch(
() => props.row,
() => getStartParamsList(props.row.code)
() => props.show,
() => {
if (props.show) {
getStartParamsList(props.row.code)
}
}
)

return {
Expand Down Expand Up @@ -381,7 +385,7 @@ export default defineComponent({
) : (
<NSpace vertical>
{this.startParamsList.map((item, index) => (
<NSpace class={styles.startup} key={index}>
<NSpace class={styles.startup} key={Date.now() + index}>
<NInput
pair
separator=':'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import _ from 'lodash'
import _, { cloneDeep } from 'lodash'
import { reactive, SetupContext } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRoute, useRouter } from 'vue-router'
Expand Down Expand Up @@ -56,6 +56,10 @@ export function useModal(
schedulePreviewList: []
})

const cachedStartParams = {} as {
[key: string]: { prop: string; value: string }[]
}

const resetImportForm = () => {
state.importForm.name = ''
state.importForm.file = ''
Expand Down Expand Up @@ -237,9 +241,14 @@ export function useModal(
}

const getStartParamsList = (code: number) => {
if (cachedStartParams[code]) {
variables.startParamsList = cloneDeep(cachedStartParams[code])
return
}
queryProcessDefinitionByCode(code, variables.projectCode).then(
(res: any) => {
variables.startParamsList = res.processDefinition.globalParamList
cachedStartParams[code] = cloneDeep(variables.startParamsList)
}
)
}
Expand Down

0 comments on commit 3e85194

Please sign in to comment.