frontend/src/components/flow/modules/TestModal.vue

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<template>
	<div>
		<a-drawer
			title="JSON"
			placement="right"
			:width="600"
			:visible="testVisible"
			@close="onClose">
			
			<div>当前的flowData:</div>
			<json-view 
				:value="flowData"
				:expand-depth=3
				boxed
				copyable/>
			
			<div style="margin-top: 12px;">暂存:</div>
			<a-textarea :autosize="{ minRows: 10, maxRows: 100 }" :value="flowDataJson" @change="editFlowDataJson" />
			
			<a-divider />
			<a-button @click="onLoad">加载</a-button>
			<a-button @click="tempSave" :style="{ marginRight: '8px' }" type="primary">暂存</a-button>
		</a-drawer>
	</div>
</template>

<script>
	import JsonView from 'vue-json-viewer'
	import { flowConfig } from '../config/args-config.js'
	
	export default {
		components: {
			JsonView
		},
		data () {
			return {
				testVisible: false,
				flowData: null,
				flowDataJson: ''
			}
		},
		methods: {
			onClose () {
				this.testVisible = false;
			},
			editFlowDataJson (e) {
				this.flowDataJson = e.target.value;
			},
			tempSave () {
				let tempObj = Object.assign({}, this.flowData);
				tempObj.status = flowConfig.flowStatus.SAVE;
				this.flowDataJson = JSON.stringify(tempObj);
			},		
			clearData () {
				this.$emit('clear123',this.flowDataJson);
			},
			onLoad () {
				this.clearData();
				setTimeout(() => {
					this.$emit('loadFlow', this.flowDataJson);
后面还有 9 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。