Commit a067b144 authored by rockyl's avatar rockyl

完成资源分组加载功能

parent ef9e00da
......@@ -6,7 +6,7 @@ export let API_HOST;
if (process.env.NODE_ENV === 'development') {
//API_HOST = '//10.10.95.74:7777';
//API_HOST = '//192.168.1.16:7777';
API_HOST = '//10.10.94.107:3000';
API_HOST = '//0.0.0.0:3000';
//API_HOST = '//192.168.0.105:7777';
//API_HOST = '//localhost:3002';
//API_HOST = window.__data.apiHost;
......
......@@ -104,6 +104,7 @@
"Loading view": "加载视图",
"Page title": "页面标题",
"Container ID": "容器ID",
"Lazy Load Delay": "懒加载延时",
"Design width": "设计宽度",
"Design height": "设计高度",
"Frame Rate": "帧率",
......
......@@ -34,6 +34,7 @@ const defaultOptions = {
pageTitle: 'no title',
entrySceneView: '',
loadingView: '',
lazyLoadWait: 1000,
containerId: 'game-container',
designWidth: 750,
designHeight: 1334,
......@@ -147,7 +148,7 @@ export const projectStore = {
}
if (view.explicitDepAssets) {
view.explicitDepAssets.splice(0);
}else{
} else {
Vue.set(view, 'explicitDepAssets', []);
}
explicitDepAssets = view.explicitDepAssets;
......@@ -162,7 +163,7 @@ export const projectStore = {
let uuid = prop.replace(assetScheme, '');
let asset = assets.find(asset => asset.uuid === uuid);
if (asset) {
if (!explicitDepAssets.includes(asset.uuid)){
if (!explicitDepAssets.includes(asset.uuid)) {
explicitDepAssets.push(asset.uuid);
}
}
......@@ -402,7 +403,7 @@ export const projectStore = {
let _node1 = node;
console.log(_node1)
copyNodeCatch = clonePureObj(_node1)
console.log("copyNodeCatch",copyNodeCatch)
console.log("copyNodeCatch", copyNodeCatch)
if (copyState == 1) {
//复制行为
copyNodeCatch.events
......@@ -411,19 +412,20 @@ export const projectStore = {
console.log(this)
deleteChildEvent(copyNodeCatch)
}
//copy(JSON.stringify(copyNodeCatch))
function deleteChildEvent(copyNodeCatch){
function deleteChildEvent(copyNodeCatch) {
console.log(123)
delete copyNodeCatch.events;
if(copyNodeCatch.children){
for(let item of copyNodeCatch.children){
deleteChildEvent(item)
}
if (copyNodeCatch.children) {
for (let item of copyNodeCatch.children) {
deleteChildEvent(item)
}
}
}
},
pasteNode(state, {node, parentNode, pasteState}) {
let _node1 = copyNodeCatch;
console.log(copyNodeCatch);
......@@ -529,9 +531,10 @@ export const projectStore = {
this.commit('makeProjectDirty');
},
modifyViewDepAssets(state, {view, explicitDepAssets, implicitDepAssets}){
modifyViewDepAssets(state, {view, explicitDepAssets, implicitDepAssets, depCustoms}) {
view.explicitDepAssets = explicitDepAssets;
view.implicitDepAssets = implicitDepAssets;
view.depCustoms = depCustoms;
this.commit('makeProjectDirty');
}
......@@ -614,11 +617,14 @@ export const projectStore = {
assets(state) {
return state.data.assets;
},
assetDepFlag: state=> uuid => {
return state.data.views.filter(view=>
assetDepFlag: state => uuid => {
return state.data.views.filter(view =>
view.explicitDepAssets.includes(uuid) || view.implicitDepAssets.includes(uuid)
).length > 0 ? 0 : -1;
},
customs(state) {
return state.data.customs;
},
getProcess: state => behavior => {
return arrayFind(state.data.processes, process => process.id === behavior.meta);
},
......
......@@ -179,35 +179,54 @@
flex-direction: column;
height: 50vh;
.explicit-tags{
.assets-dep {
flex: 1;
height: 0;
display: flex;
flex-direction: column;
margin-bottom: 5px;
div+div{
margin-left: 5px;
}
div{
.explicit-tags {
display: flex;
align-items: center;
div{
width: 10px;
height: 10px;
div + div {
margin-left: 10px;
}
.explicit{
background-color: $--color-danger;
}
.implicit{
background-color: $--color-success;
div {
display: flex;
align-items: center;
div {
width: 10px;
height: 10px;
margin-right: 2px;
}
.explicit {
background-color: $--color-danger;
}
.implicit {
background-color: $--color-success;
}
}
}
.assets-scrollbar {
flex: 1;
border: 1px solid $--border-color-light;
}
}
.assets-scrollbar {
flex: 1;
border: 1px solid $--border-color-light;
.custom-dep {
display: flex;
align-items: center;
.select{
flex: 1;
}
}
}
}
......@@ -80,7 +80,7 @@ async function packAssets(key, assets) {
return new Promise(async (resolve, reject) => {
try {
if (asset.file) {
uploadSheet(asset).catch(e => {
await uploadSheet(asset).catch(e => {
failedList.push(asset);
});
}
......
......@@ -10,35 +10,45 @@
custom-class="asset-dependence-dialog flex-dialog"
>
<div class="wrapper">
<div class="explicit-tags">
<div>
<div class="explicit"></div>
显式依赖
</div>
<div>
<div class="implicit"></div>
隐式依赖
<div class="assets-dep">
<div class="explicit-tags">
<div>
<div class="explicit"></div>
显式依赖
</div>
<div>
<div class="implicit"></div>
隐式依赖
</div>
</div>
<el-scrollbar class="assets-scrollbar" wrap-class="wrap-x-hidden"
view-class="scrollbar-view">
<asset-list ref="depAssetList" :editable="false" :selectable="false"
:assets-source="assetsSource"
v-if="view"
@click-item="onClickItem"
:target-view="view"
:explicit-dep-assets="explicitDepAssets"
:implicit-dep-assets="implicitDepAssets"
/>
</el-scrollbar>
</div>
<div class="custom-dep">
<span>自定义模块依赖</span>
<el-select class="select" multiple v-model="depCustoms" size="mini">
<el-option v-for="custom in customs"
:key="custom.id"
:value="custom.id"
:label="custom.name"
>
</el-option>
</el-select>
</div>
<el-scrollbar class="assets-scrollbar" wrap-class="wrap-x-hidden"
view-class="scrollbar-view">
<asset-list ref="depAssetList" :editable="false" :selectable="false"
:assets-source="assetsSource"
v-if="view"
@click-item="onClickItem"
:target-view="view"
:explicit-dep-assets="explicitDepAssets"
:implicit-dep-assets="implicitDepAssets"
/>
</el-scrollbar>
</div>
<div slot="footer" class="dialog-footer">
<div></div>
<div>
<el-popconfirm @onConfirm="clickClose" placement="top"
:title="$t('Are you sure to close?')">
<el-button slot="reference" size="mini">{{ $t("Close") }}</el-button>
</el-popconfirm>
<el-button slot="reference" size="mini" @click="clickClose">{{ $t("Close") }}</el-button>
<el-button class="save-button" type="primary" size="mini" @click="clickSave">{{ $t("Save") }}
</el-button>
</div>
......@@ -47,7 +57,7 @@
</template>
<script>
import {mapMutations} from 'vuex';
import {mapMutations, mapGetters} from 'vuex';
import MonacoEditor from "vue-monaco";
import {clonePureObj, monacoEditorOptions} from "../../../../utils";
import AssetList from "../../Assets/AssetList";
......@@ -67,15 +77,19 @@
view: null,
explicitDepAssets: [],
implicitDepAssets: [],
depCustoms: [],
}
},
computed: {},
computed: {
...mapGetters(['customs']),
},
methods: {
async edit(view) {
this.view = view;
this.explicitDepAssets = view.explicitDepAssets.concat();
this.implicitDepAssets = view.implicitDepAssets.concat();
this.depCustoms = view.depCustoms ? view.depCustoms.concat() : [];
this.assetsSource = clonePureObj(this.$store.getters.assets);
......@@ -86,6 +100,7 @@
view: this.view,
explicitDepAssets: this.explicitDepAssets,
implicitDepAssets: this.implicitDepAssets,
depCustoms: this.depCustoms
});
this.visible = false;
},
......@@ -103,7 +118,7 @@
let index = implicitDepAssets.indexOf(uuid);
if (index >= 0) {
implicitDepAssets.splice(index, 1);
}else{
} else {
implicitDepAssets.push(uuid);
}
},
......
......@@ -27,6 +27,9 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="lazyLoadWait" :label="$t('Lazy Load Delay')">
<el-input-number v-model="editData.lazyLoadWait" placeholder="1000" controls-position="right"/>
</el-form-item>
<el-form-item prop="containerId" :label="$t('Container ID')">
<el-input v-model="editData.containerId"/>
</el-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment