Commit 5b6c9dde authored by rockyl's avatar rockyl

提交一波

parent 9be049cf
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<style scoped> <style scoped>
.picker { .picker {
flex: 1;
float: right; float: right;
margin-top: 4px; margin-top: 4px;
} }
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
} }
.picker { .picker {
flex: 1;
float: right; float: right;
} }
</style> </style>
...@@ -8,9 +8,12 @@ ...@@ -8,9 +8,12 @@
v-model="popoverVisible" v-model="popoverVisible"
:disabled="!editable" :disabled="!editable"
> >
<el-radio-group v-model="editValue.type" size="mini" @change="onChange" :disabled="!editable"> <div>
<el-radio-button v-for="(item, key) in dataTypes" :label="key" :key="key">{{item}}</el-radio-button> <el-radio-group v-model="editValue.type" size="mini" @change="onChange" :disabled="!editable">
</el-radio-group> <el-radio-button v-for="(item, key) in dataTypes" :label="key" :key="key">{{item}}</el-radio-button>
</el-radio-group>
<el-button circle plain type="danger" icon="el-icon-close" class="micro" style="margin-left: 5px;" @click="popoverVisible=false"/>
</div>
<el-input clearable slot="reference" :value="editValue.value" @input="onInput" @change="onChange" <el-input clearable slot="reference" :value="editValue.value" @input="onInput" @change="onChange"
:readonly="!editable" :readonly="!editable"
:placeholder="defaultValue"/> :placeholder="defaultValue"/>
......
<template> <template>
<div style="display: flex;flex: 1;"> <div style="display: flex;flex: 1;">
<el-popover <el-popover
placement="top" placement="bottom"
popper-class="node-select-popover" popper-class="node-select-popover"
class="node-select-container" class="node-select-container"
trigger="manual" trigger="manual"
width="400" width="400"
height="500"
v-model="popoverVisible" v-model="popoverVisible"
@after-enter="onPopoverShow"
> >
<div> <div>
<el-input v-model="filterText" prefix-icon="el-icon-search" size="mini" clearable/> <el-input v-model="filterText" prefix-icon="el-icon-search" size="mini" clearable/>
...@@ -16,8 +18,10 @@ ...@@ -16,8 +18,10 @@
v-if="popoverVisible" v-if="popoverVisible"
:data="behavior_views" :data="behavior_views"
:props="defaultProps" :props="defaultProps"
:expand-on-click-node="false" :expand-on-click-node="true"
:default-expanded-keys="expandedKeys"
draggable draggable
node-key="uuid"
highlight-current highlight-current
:default-expand-all="true" :default-expand-all="true"
@node-click="handleNodeClick" @node-click="handleNodeClick"
...@@ -32,8 +36,8 @@ ...@@ -32,8 +36,8 @@
<div class="bottom-bar"> <div class="bottom-bar">
<div></div> <div></div>
<div> <div>
<el-button @click="onCancel" plain>Cancel</el-button> <el-button @click="onCancel" plain>{{$t('Cancel')}}</el-button>
<el-button @click="onConfirm" type="primary">Confirm</el-button> <el-button @click="onConfirm" type="primary">{{$t('Confirm')}}</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -41,7 +45,7 @@ ...@@ -41,7 +45,7 @@
:readonly="!editable"> :readonly="!editable">
<template slot="prepend"> <template slot="prepend">
<el-tooltip effect="dark" :content="nodePath" placement="top" :open-delay="500" :disabled="!nodePath"> <el-tooltip effect="dark" :content="nodePath" placement="top" :open-delay="500" :disabled="!nodePath">
<el-button>{{nodeScheme}}</el-button> <span>{{nodeScheme}}</span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-input> </el-input>
...@@ -74,6 +78,7 @@ ...@@ -74,6 +78,7 @@
label: 'name' label: 'name'
}, },
nodePath: '', nodePath: '',
expandedKeys: [],
} }
}, },
watch: { watch: {
...@@ -121,7 +126,12 @@ ...@@ -121,7 +126,12 @@
} }
}, },
filterNodeMethod(value, data) { filterNodeMethod(value, data) {
return data.name.toLowerCase().includes(value.toLowerCase()); if(value.startsWith(':uuid|')){
let targetUUID = value.replace(':uuid|', '');
return data.uuid === targetUUID;
}else{
return data.name.toLowerCase().includes(value.toLowerCase());
}
}, },
onInput(v, oldValue) { onInput(v, oldValue) {
if (v !== this.value) { if (v !== this.value) {
...@@ -133,6 +143,7 @@ ...@@ -133,6 +143,7 @@
}, },
onClickEdit() { onClickEdit() {
this.popoverVisible = !this.popoverVisible; this.popoverVisible = !this.popoverVisible;
}, },
onClickClean() { onClickClean() {
this.nodePath = ''; this.nodePath = '';
...@@ -150,6 +161,16 @@ ...@@ -150,6 +161,16 @@
handleNodeClick(data, node) { handleNodeClick(data, node) {
this.selectedNodeUUID = data.uuid; this.selectedNodeUUID = data.uuid;
}, },
onPopoverShow(){
let uuid = this.editValue;
if(uuid){
this.filterText = ':uuid|' + uuid;
this.updateFilter();
this.$refs.tree.setCurrentKey(uuid);
this.expandedKeys = [uuid];
this.selectedNodeUUID = uuid;
}
},
}, },
} }
</script> </script>
......
<template> <template>
<div> <div class="vector2-input">
<span class="field-label">x</span> <span class="field-label">x</span>
<el-input-number :disabled="!editable" :value="editValue.x" @input="v=>onInput(v, 'x')" controls-position="right" <el-input-number style="flex: 1;" :disabled="!editable" v-model="editValue.x" @change="v=>onInput(v, 'x')" controls-position="right"
:placeholder="defaultValue.x"></el-input-number> :placeholder="defaultValue.x"></el-input-number>
<span class="field-label">y</span> <span class="field-label">y</span>
<el-input-number :disabled="!editable" :value="editValue.y" @input="v=>onInput(v, 'y')" controls-position="right" <el-input-number style="flex: 1;" :disabled="!editable" v-model="editValue.y" @change="v=>onInput(v, 'y')" controls-position="right"
:placeholder="defaultValue.y"></el-input-number> :placeholder="defaultValue.y"></el-input-number>
</div> </div>
</template> </template>
...@@ -20,19 +20,19 @@ ...@@ -20,19 +20,19 @@
props: ['value', 'container', 'property', 'propertyName', 'editable'], props: ['value', 'container', 'property', 'propertyName', 'editable'],
data() { data() {
return { return {
editValue: {}, //editValue: {},
} }
}, },
watch: { watch: {
value(v) { value(v) {
let editValue = v === undefined ? this.property.default : v; //let editValue = v === undefined ? this.property.default : v;
this.editValue = parseVector2(editValue); //this.editValue = parseVector2(editValue);
} }
}, },
computed: { computed: {
/*editValue() { editValue() {
return this.value === undefined ? this.property.default : this.value; return this.value === undefined ? this.defaultValue : parseVector2(this.value);
},*/ },
defaultValue() { defaultValue() {
let value = this.property.default; let value = this.property.default;
let placeholder = {}; let placeholder = {};
......
...@@ -245,6 +245,7 @@ ...@@ -245,6 +245,7 @@
"pack": { "pack": {
"label": "打包", "label": "打包",
"sub": { "sub": {
"pack-debug-mode": "调试打包",
"pack-manager": "打包管理" "pack-manager": "打包管理"
} }
}, },
......
...@@ -834,11 +834,11 @@ export const projectStore = { ...@@ -834,11 +834,11 @@ export const projectStore = {
return failedList; return failedList;
}, },
async packProject({state, dispatch}, params) { async packProject({state, dispatch}, params) {
let debug = false; let debug = params.debug;
let packedAssets; let packedAssets;
if (!debug) { //if (!debug) {
packedAssets = await packAssets(state.data.assets); packedAssets = await packAssets(state.data.assets);
} //}
const packResult = await projectApi.pack(state.id, debug, packedAssets); const packResult = await projectApi.pack(state.id, debug, packedAssets);
console.log(packResult); console.log(packResult);
......
...@@ -93,10 +93,11 @@ $dock-pin-width: 9px; ...@@ -93,10 +93,11 @@ $dock-pin-width: 9px;
&.hover, &:hover { &.hover, &:hover {
stroke: $--color-primary; stroke: $--color-primary;
stroke-dasharray: 5, 1; stroke-dasharray: 5, 1;
} }
&.contact {
stroke: $--color-primary; &.contact {
} stroke: $--color-primary;
}
} }
.node { .node {
...@@ -284,7 +285,6 @@ $dock-pin-width: 9px; ...@@ -284,7 +285,6 @@ $dock-pin-width: 9px;
flex-direction: column; flex-direction: column;
.wrapper { .wrapper {
padding: 5px; padding: 5px;
flex: 1; flex: 1;
...@@ -305,19 +305,20 @@ $dock-pin-width: 9px; ...@@ -305,19 +305,20 @@ $dock-pin-width: 9px;
} }
} }
.inside-code{ .inside-code {
flex: 1; flex: 1;
height: 0; height: 0;
border-top: 1px solid $--border-color-base; border-top: 1px solid $--border-color-base;
.scrollbar { .scrollbar {
height: 100%; height: 100%;
.code-body{
.code-body {
tab-size: 1.5em; tab-size: 1.5em;
width: 100%; width: 100%;
margin: 0; margin: 0;
font-size: 12px; font-size: 12px;
white-space:pre-wrap; white-space: pre-wrap;
} }
} }
} }
...@@ -397,7 +398,7 @@ $dock-pin-width: 9px; ...@@ -397,7 +398,7 @@ $dock-pin-width: 9px;
} }
} }
.property-name-popover{ .property-name-popover {
p { p {
margin: 0; margin: 0;
//text-overflow: ellipsis; //text-overflow: ellipsis;
...@@ -417,7 +418,7 @@ $dock-pin-width: 9px; ...@@ -417,7 +418,7 @@ $dock-pin-width: 9px;
} }
} }
.props-editor{ .props-editor {
.linked { .linked {
display: block; display: block;
height: 26px; height: 26px;
...@@ -458,30 +459,37 @@ $dock-pin-width: 9px; ...@@ -458,30 +459,37 @@ $dock-pin-width: 9px;
color: $--color-text-secondary; color: $--color-text-secondary;
} }
} }
.field-label{
.field-label {
padding: 0 5px; padding: 0 5px;
color: $--color-text-secondary; color: $--color-text-secondary;
} }
} }
.source-input{ .source-input {
flex: 1; flex: 1;
} }
.vector2-input {
flex: 1;
display: flex;
width: 0;
}
.node-select-container { .node-select-container {
flex: 1; flex: 1;
} }
} }
.source-input-popover{ .source-input-popover {
.wrapper{ .wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
} }
.enum-input-comment{ .enum-input-comment {
float: right; float: right;
color: $--color-text-secondary; color: $--color-text-secondary;
} }
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
margin-bottom: 1px; margin-bottom: 1px;
padding: 5px 10px; padding: 5px 10px;
font-size: 13px; font-size: 13px;
justify-content: space-between;
.menu { .menu {
flex: 1; flex: 1;
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
.el-form-item__content { .el-form-item__content {
display: flex; display: flex;
justify-content: flex-end; //justify-content: flex-end;
.el-input-number--mini { .el-input-number--mini {
flex: 1; flex: 1;
......
...@@ -234,6 +234,9 @@ ...@@ -234,6 +234,9 @@
case 'pack': case 'pack':
await this.pack(); await this.pack();
break; break;
case 'pack-debug-mode':
await this.pack(true);
break;
case 'pack-manager': case 'pack-manager':
this.$refs.packManagerDialog.show(); this.$refs.packManagerDialog.show();
break; break;
...@@ -274,7 +277,7 @@ ...@@ -274,7 +277,7 @@
break; break;
} }
}, },
async pack() { async pack(debug) {
let cancel; let cancel;
cancel = await this.saveProject(false); cancel = await this.saveProject(false);
if (cancel) { if (cancel) {
...@@ -286,6 +289,7 @@ ...@@ -286,6 +289,7 @@
}); });
try { try {
await this.packProject({ await this.packProject({
debug: debug || false,
remark: this.lastSaveRemark, remark: this.lastSaveRemark,
}); });
this.$message({ this.$message({
......
...@@ -97,7 +97,8 @@ ...@@ -97,7 +97,8 @@
this.$refs.assetsShow.show(asset); this.$refs.assetsShow.show(asset);
}, },
onItemClick(asset) { onItemClick(asset) {
this.selectAssetItem(asset); this.updateAssetSize(asset.url);
this.currentItem = asset;
}, },
deleteAll() { deleteAll() {
this.$confirm(this.$t('Are you sure to delete all assets'), this.$t('Alert'), { this.$confirm(this.$t('Are you sure to delete all assets'), this.$t('Alert'), {
......
<template> <template>
<div class="tool-bar"> <div class="tool-bar">
<sample-menu :data="menu" @click-menu="clickMenu"/> <sample-menu :data="menu" @click-menu="clickMenu"/>
<div style="flex: 1"></div>
<div class="right-part"> <div class="right-part">
<span> <span>
[{{project.name}}] [{{project.name}}]
......
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