<div>
<div>
<div style="height:33px;font-size:22px;">
{{$t('逻辑')}}
<div style="float:right">
<Dropdown transfer trigger="click" @on-click="toggleUI" placement="bottom-start">
<i-button size="small" type="text">
<Icon type="ios-list"></Icon>
</i-button>
<template #list>
<DropdownMenu>
<DropdownItem name="stateGroup">
<Icon type="md-checkmark" :color="UICheckColor('stateGroup')" />{{$t('状态组')}}
</DropdownItem>
<DropdownItem name="actionGroup">
<Icon type="md-checkmark" :color="UICheckColor('actionGroup')" />{{$t('行为组')}}
</DropdownItem>
<DropdownItem name="structGroup">
<Icon type="md-checkmark" :color="UICheckColor('structGroup')" />{{$t('数据结构组')}}
</DropdownItem>
<DropdownItem name="functionGroup">
<Icon type="md-checkmark" :color="UICheckColor('functionGroup')" />{{$t('函数组')}}
</DropdownItem>
</DropdownMenu>
</template>
</Dropdown>
</div>
<Dropdown trigger="click" @on-click="changeEnv" placement="bottom-start">
<a href="javascript:void(0)" style="font-size:15px;margin-left:15px;">
<SceneIcon v-if="isScene" :name="currentSceneName()" nameOf="sceneName"></SceneIcon>
{{currentSceneName()}}
<Icon type="ios-arrow-down"></Icon>
</a>
<template #list>
<DropdownMenu style="width:200px">
<DropdownItem name="">{{$t('全部')}}<span
style="float:right;color:black">{{allDisplayableSrcCnt()}}</span>
</DropdownItem>
<template v-for="(s,j) of SceneManager.scenes" :key="s.id">
<DropdownItem v-if="!isHiddenScene(s)" :divided="j==0" :style="{backgroundColor:s.color}"
:name="'scene/'+s.id">
<span :style="{color:$toFontColor(s.color)}">
{{s.name}}
</span>
<span :style="{float:'right',color:$toFontColor(s.color)}">
{{srcCntOfScene(s)}}
</span>
</DropdownItem>
</template>
<template v-for="(e,j) of env" :key="e.name">
<DropdownItem v-if="notEmptyEnv(e) && !isHiddenEnv(e.name)" :name="e.name?'env/'+e.name:' '"
:divided="j==0">
{{$t(e.name
||
'通用')}}<span style="float:right;color:black">{{e.srcCnt}}</span>
</DropdownItem>
</template>
</DropdownMenu>
</template>
</Dropdown>
<Dropdown v-if="currentScene && currentScene.startsWith('scene/')" trigger="click" @on-click="setEntry"
placement="bottom-start">
<a href="javascript:void(0)" style="font-size:15px;margin-left:15px;">
{{getEntry() || $t('未设定入口')}}
<Icon type="ios-arrow-down"></Icon>
</a>
<template #list>
<DropdownMenu style="max-height:300px;overflow-y:auto;">
<DropdownItem v-for="name of FSMNamesInScene(currentScene)" :name="name">{{name}}</DropdownItem>
</DropdownMenu>
</template>
</Dropdown>
<tooltip :content="$t('新建模块')" :delay="1000" theme="light">
<i-button size="small" style="margin-left:15px;" @click="newModule">
<icon type="md-add"></icon>
</i-button>
</tooltip>
<tooltip :content="$t('导入模块')" :delay="1000" theme="light">
<i-button size="small" style="margin-left:15px;" @click="loadFiles">
<icon type="ios-cloud-upload-outline"></icon>
</i-button>
</tooltip>
</div>
<collapse>
<TransitionGroup name="block">
<template v-for="f in filteredSrc(currentScene)" :key="f.name">
<panel class="ns">
<span>
{{f.name}}<SceneIcon :name="f.name" size="20" nameOf="moduleName"></SceneIcon>
<span style="float:right;margin-right:20px;">
<tooltip v-if="$root.editorSettings.checkUIEnabled('exportModule')"
:content="$t('导出模块源码')" :delay="1000" theme="light">
<icon type="ios-cloud-download-outline" @click.stop="saveSrcFile(f)"></icon>
</tooltip>
<tooltip :content="$t('模块属性')" :delay="1000" theme="light">
<icon size="20" type="ios-create-outline" @click.stop="editSrc(f)"></icon>
</tooltip>
<tooltip :content="$t('删除模块')" :delay="1000" theme="light">
<Poptip trigger="click" @on-ok="unloadFile(f)" confirm transfer :title="$t('删除')">
<a class="delete">
<Icon size="20" type="ios-trash-outline" />
</a>
</Poptip>
</tooltip>
</span>
</span>
<template #content>
<div style="display:inline-block;margin-top:-5px;">
<div style="display: block;float:left;">
<TransitionGroup name="block">
<card class="logicCard" v-for="fsm in f.fsms" :key="fsm.name">
<template #title>
<p class="ns">
<icon type="ios-body"></icon>
{{fsm.name}}
</p>
</template>
<template #extra>
<span>
<tooltip :content="$t('状态机构建关系')" :delay="1000" theme="light">
<icon size="20" type="ios-color-filter-outline"
@click="showFSMCreateTree(f.name,fsm.name)"></icon>
</tooltip>
<tooltip :content="$t('状态转换概览')" :delay="1000" theme="light">
<icon size="20" type="md-git-compare"
@click="showStateTransition(f,fsm)">
</icon>
</tooltip>