|
@@ -1,6 +1,7 @@
|
|
<script setup name="FlowDesign">
|
|
<script setup name="FlowDesign">
|
|
-import { onMounted, ref, watch } from 'vue'
|
|
|
|
|
|
+import { onMounted, ref } from 'vue'
|
|
import CodeMirrorEditor from '@/components/CodeMirrorEditor/index.vue'
|
|
import CodeMirrorEditor from '@/components/CodeMirrorEditor/index.vue'
|
|
|
|
+import { ElMessageBox } from 'element-plus'
|
|
|
|
|
|
import ScWorkflow from '@/components/scWorkflow'
|
|
import ScWorkflow from '@/components/scWorkflow'
|
|
import useFlowStore from '@/store/modules/flow'
|
|
import useFlowStore from '@/store/modules/flow'
|
|
@@ -61,17 +62,23 @@ const validate = () => {
|
|
resolve()
|
|
resolve()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+const sureImportJson = () => {
|
|
|
|
+ ElMessageBox.confirm('确定应用JSON模型吗?', '提示', {
|
|
|
|
+ callback: async action => {
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
+ form.value.processConfig = JSON.parse(jsonFormat.value || {})
|
|
|
|
+ drawer.value = !drawer.value
|
|
|
|
+ } else {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {})
|
|
|
|
+}
|
|
|
|
|
|
const openDrawerEv = () => {
|
|
const openDrawerEv = () => {
|
|
jsonFormat.value = JSON.stringify(form.value.processConfig, null, ' ')
|
|
jsonFormat.value = JSON.stringify(form.value.processConfig, null, ' ')
|
|
drawer.value = !drawer.value
|
|
drawer.value = !drawer.value
|
|
}
|
|
}
|
|
|
|
|
|
-const sureImportJson = () => {
|
|
|
|
- form.value.processConfig = JSON.parse(jsonFormat.value || {})
|
|
|
|
- drawer.value = !drawer.value
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
updateCompInfo()
|
|
updateCompInfo()
|
|
})
|
|
})
|
|
@@ -96,11 +103,7 @@ defineExpose({
|
|
<code-mirror-editor v-model="jsonFormat"></code-mirror-editor>
|
|
<code-mirror-editor v-model="jsonFormat"></code-mirror-editor>
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button type="primary" @click="copyJson">复制 JSON</el-button>
|
|
<el-button type="primary" @click="copyJson">复制 JSON</el-button>
|
|
- <el-popconfirm title="确定应用JSON模型吗?" @confirm="sureImportJson">
|
|
|
|
- <template #reference>
|
|
|
|
- <el-button>导入JSON</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-popconfirm>
|
|
|
|
|
|
+ <el-button @click="sureImportJson">导入JSON</el-button>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|