ccc-devtools/index.html

218 lines
11 KiB
HTML
Raw Normal View History

2019-04-18 06:28:04 +00:00
<link rel="stylesheet" type="text/css" href="app/editor/static/preview-templates/ccc-devtools/libs/vue-beauty/css/vue-beauty.min.css">
<link rel="stylesheet" type="text/css" href="app/editor/static/preview-templates/ccc-devtools/libs/element/css/element-ui.css">
<link rel="stylesheet" type="text/css" href="app/editor/static/preview-templates/ccc-devtools/libs/iview/css/iview.css">
<link rel="stylesheet" type="text/css" href="app/editor/static/preview-templates/ccc-devtools/css/style.css">
2018-12-26 12:21:22 +00:00
<div id="app">
<div class="demo-split">
2018-12-28 01:18:49 +00:00
<Split v-model="splitLeft" v-if="isDevMode">
2019-04-10 03:07:15 +00:00
<!-- 左边游戏预览区域 -->
<div slot="left" class="demo-split-pane" id="game_panel"
style="display:flex;justify-content:left;align-items:center;height: 100vh;">
2018-12-26 12:21:22 +00:00
<div id="top" style="position: absolute;top:0;"></div>
</div>
2019-04-10 03:07:15 +00:00
<!-- 右边节点树和属性区域 -->
<div slot="right" class="demo-split-pane no-padding">
2018-12-26 12:21:22 +00:00
<Split v-model="splitRight" mode="vertical">
2019-04-10 03:07:15 +00:00
<!-- 节点树面板 -->
2018-12-26 12:21:22 +00:00
<div slot="top" class="demo-split-pane" style="padding-left: 5px;">
2019-04-10 03:07:15 +00:00
<el-input v-if="!isAutoRefreshTree" placeholder="搜索节点" v-model="filterText" size="mini"
id="searchInput"></el-input>
<v-tree v-if="isDevMode&&isAutoRefreshTree" :data="sceneTreeData" ref="sceneTree"
@select="handleNodesSelect"
style="min-width: 250px;height: 100%;overflow-x:hidden;overflow-y:auto;background: white;">
</v-tree>
<el-tree v-if="isDevMode&&!isAutoRefreshTree" :data="sceneTreeData" :draggable="true"
:props="nodeProps" :default-expanded-keys="defaultExpandedKeys" empty-text="暂无数据..."
:node-key="'_id'" :expand-on-click-node="false" :filter-node-method="filterNode"
ref="sceneTree" @node-click="handleNodeClick"
style="min-width: 250px;height: 100%;overflow-x:hidden;overflow-y:auto;">
2018-12-26 12:21:22 +00:00
<span class="custom-tree-node" slot-scope="{ node, data }">
2019-04-10 03:07:15 +00:00
<span
v-bind:style="{color: data.activeInHierarchy?'#606266':'#C0C4CC'}">{{ node.label }}</span>
2018-12-26 12:21:22 +00:00
</span>
</el-tree>
2019-04-10 03:07:15 +00:00
<el-button v-if="!isAutoRefreshTree" @click="handleRefreshTree" icon="el-icon-refresh"
size="mini" style="position: absolute;right:0;top:0;"></el-button>
<div style="position: absolute;right:0;bottom:0;width: 100px;height:20px;">
<span style="line-height:20px;">自动刷新</span>
2019-04-10 03:07:15 +00:00
<el-switch v-model="isAutoRefreshTree" active-color="#0099ff" inactive-color="gray">
</el-switch>
</div>
<!-- <el-button @click="handleSwitchTreeMode" icon="el-icon-refresh" size="mini" style="position: absolute;right:0;bottom:0;"></el-button> -->
2018-12-26 12:21:22 +00:00
</div>
2019-04-10 03:07:15 +00:00
<!-- 节点属性面板 -->
<div slot="bottom" class="demo-split-pane"
style="background: white;min-width: 250px;height: 100%;padding:5px 0;overflow-x:hidden;overflow-y:auto;">
2018-12-26 12:21:22 +00:00
<div v-if="node">
<el-row style="margin:5px 0;">
<el-col :span="2" style="text-align:center;padding-top:7px;padding-left:5px;">
<el-checkbox v-model="node.active"></el-checkbox>
</el-col>
<el-col :span="18">
2018-12-26 12:21:22 +00:00
<el-input v-model="node.name" size="mini"></el-input>
</el-col>
<el-col :span="4">
<div style="width: 100%;height:28px;border: solid 1px rgb(220, 223, 230);border-radius: 4px;text-align: center;"
2019-04-10 03:07:15 +00:00
@click="handleChangeNodeSchema"><span style="line-height: 28px;"
:style="{color: is3DNode?'#409EFF':'#606266'}">2.5d</span></div>
2018-12-28 02:20:31 +00:00
</el-col>
2018-12-26 12:21:22 +00:00
</el-row>
<el-card v-if="nodeSchema">
<div>
<span>{{ nodeSchema.title }}</span>
2019-04-10 03:07:15 +00:00
<el-button style="float: right; padding: 3px 0;" type="text"
@click="outputNodeHandler">输出引用</el-button>
<el-button style="float: right; padding: 3px 0;margin-right: 10px;" type="text"
@click="drawNodeRect">标记位置</el-button>
</div>
<hr style="margin: 10px 0;" />
<div>
2019-04-10 03:07:15 +00:00
<el-row style="height: 28px;margin-bottom:3px;" v-for="(row, ri) in nodeSchema.rows"
:key="ri">
<el-col v-for="(col, ci) in row" :key="ci" :span="col.span"
style="text-align: left;line-height: 28px;">
<span v-if="col.type == 'label'">{{col.field}}</span>
2019-04-10 03:07:15 +00:00
<el-input-number v-if="col.type == 'number'" v-model="node[col.field]"
controls-position="right" size="mini" style="width: 100%;">
</el-input-number>
<el-input-number v-if="col.type == '3DAngle'"
v-model="node.eulerAngles[col.field]" controls-position="right"
size="mini" style="width: 100%;"></el-input-number>
<el-input v-if="col.type == 'input'" v-model="node[col.field]" size="mini">
</el-input>
<el-color-picker v-if="col.type == 'color'" :ref="col.key" size="mini"
v-model="node[col.field]"></el-color-picker>
</el-col>
</el-row>
</div>
</el-card>
2019-04-10 03:07:15 +00:00
<el-card v-for="(section,index) in componentsSchema" :key="section.key"
style="margin: 10px 0;">
<div>
<el-checkbox v-model="node[section.key].enabled">{{ section.title }}</el-checkbox>
2019-04-10 03:07:15 +00:00
<el-button style="float: right; padding: 3px 0" type="text"
@click="outputComponentHandler(section.key)">输出引用</el-button>
</div>
<hr v-if="section.rows" style="margin: 10px 0;" />
<div>
2019-04-10 03:07:15 +00:00
<el-row style="height: 28px;margin-bottom:3px;" v-for="(row,ri) in section.rows"
:key="ri">
<el-col v-for="(col,ci) in row" :key="ci" :span="col.span"
style="text-align: left;line-height: 28px;">
<span v-if="col.type == 'label'">{{col.field}}</span>
2019-04-10 03:07:15 +00:00
<el-input-number v-if="col.type == 'number'"
v-model="node[section.key][col.field]" controls-position="right"
size="mini" style="width: 100%;"></el-input-number>
<el-input v-if="col.type == 'input'" v-model="node[section.key][col.field]"
size="mini"></el-input>
<el-input v-if="col.type == 'textarea'" type="textarea" :rows="1"
v-model="node[section.key][col.field]" size="mini">
</el-input>
2019-04-10 03:07:15 +00:00
<el-color-picker v-if="col.type == 'color'" :ref="col.key" size="mini"
v-model="node[section.key][col.field]"></el-color-picker>
<el-checkbox v-if="col.type == 'bool'"
v-model="node[section.key][col.field]"></el-checkbox>
<el-select v-if="col.type == 'select'"
v-model="node[section.key][col.field]" size="mini">
<el-option v-for="item in col.options" :key="item.value"
:label="item.label" :value="item.value">
</el-option>
</el-select>
</el-col>
</el-row>
</div>
</el-card>
2018-12-26 12:21:22 +00:00
</div>
</div>
</Split>
</div>
</Split>
2019-04-10 03:07:15 +00:00
<!-- 控制按钮 -->
<div id="panelCtl" style="position:absolute;left:5px;top:50px;height: 50px;display: flex;align-items: center;">
<el-popover width="150" placement="top-start" trigger="click">
<el-button type="info" icon="el-icon-setting" circle slot="reference" size="mini"></el-button>
<div>
<el-row style="margin:5px 0;">
<el-col :span="12" style="text-align:left;padding-top:7px;padding-left:5px;">
节点树
</el-col>
<el-col :span="12">
2019-04-10 03:07:15 +00:00
<el-switch style="margin: 5px;" v-model="isDevMode" @change="handleChangeMode"
active-color="#0099ff" inactive-color="gray">
</el-switch>
</el-col>
</el-row>
<el-row style="margin:5px 0;">
<el-col :span="12" style="text-align:left;padding-top:7px;padding-left:5px;">
调试信息
</el-col>
<el-col :span="12">
<el-switch style="margin: 5px;" v-model="isShowProfile" @change="handleChangeStats"
2019-04-10 03:07:15 +00:00
active-color="#0099ff" inactive-color="gray">
</el-switch>
</el-col>
</el-row>
<el-row style="margin:5px 0;">
2019-04-10 03:07:15 +00:00
<el-col :span="12" style="text-align:left;padding-top:7px;padding-left:5px;">
缓存
</el-col>
<el-col :span="12">
<el-switch style="margin: 5px;" v-model="isShowCache" @change="handleChangeCachePanel"
active-color="#0099ff" inactive-color="gray">
</el-switch>
</el-col>
</el-row>
2019-04-10 03:07:15 +00:00
<el-row style="margin:5px 0;">
<el-col :span="12" style="text-align:left;padding-top:7px;padding-left:5px;">
暗黑主题
</el-col>
<el-col :span="12">
<el-switch style="margin: 5px;" v-model="isDarkTheme" @change="handleChangeTheme"
active-color="#0099ff" inactive-color="gray">
</el-switch>
</el-col>
</el-row>
<el-row style="margin:5px 0;">
<el-col :span="12" style="text-align:left;padding-top:7px;padding-left:5px;">
源码
</el-col>
<el-col :span="12">
<el-badge value="new" :hidden="!needUpdate">
<Icon style="margin: 5px;" type="logo-github" size="24" @click="openGithub" />
</el-badge>
</el-col>
</el-row>
</div>
</el-popover>
</div>
2018-12-26 12:21:22 +00:00
</div>
2019-04-10 03:07:15 +00:00
<!-- 缓存面板弹窗 -->
<Modal v-model="isShowCache" width="800" :mask-closable="false" :mask="false" scrollable @on-cancel="closeCachePanel()" :title="cacheTitle" footer-hide="true">
<i-table border :columns="cacheColumns" height="600" size="small" :data="cacheData" :loading="cacheDataLoading">
<template slot-scope="{ row, index }" slot="cache_preview">
<img :src="window.location.protocol + '//' + window.location.host + '/' + row.preview" style="max-height: 40px;max-width: 120px;" v-if="row.preview">
<div v-if="!row.preview" style="max-height: 40px;">_</div>
2019-04-10 03:07:15 +00:00
</template>
<template slot-scope="{ row, index }" slot="cache_action">
<i-button type="primary" size="small" @click="showCacheItem(row.id)">Detail</i-button>
<i-button type="error" size="small" @click="releaseCacheItem(row.id)">Release</i-button>
</template>
<template slot-scope="{ row, index }" slot="cache_size">
{{row.size !== -1 ? row.size + 'MB' : '_'}}
</template>
2019-04-10 03:07:15 +00:00
</i-table>
</Modal>
2018-12-26 12:21:22 +00:00
</div>
2019-04-10 03:07:15 +00:00
<script type="text/javascript" charset="utf-8" src="app/editor/static/preview-templates/ccc-devtools/libs/vue/vue.min.js"></script>
<script type="text/javascript" charset="utf-8" src="app/editor/static/preview-templates/ccc-devtools/libs/vue-beauty/js/vue-beauty.min.js"></script>
<script type="text/javascript" charset="utf-8" src="app/editor/static/preview-templates/ccc-devtools/libs/element/js/element-ui.js"></script>
<script type="text/javascript" charset="utf-8" src="app/editor/static/preview-templates/ccc-devtools/libs/iview/js/iview.js"></script>
<script type="text/javascript" charset="utf-8" src="app/editor/static/preview-templates/ccc-devtools/libs/stats/Stats.js"></script>
2019-04-10 03:07:15 +00:00
<script type="text/javascript" charset="utf-8" src="app/editor/static/preview-templates/ccc-devtools/config.js"></script>
<script type="text/javascript" charset="utf-8" src="app/editor/static/preview-templates/ccc-devtools/js/app.js"></script>
2019-03-08 12:24:17 +00:00