Commit 5ca11651 authored by rockyl's avatar rockyl

相对布局的属性打开,但设计时不用生效

parent 83819722
...@@ -9,4 +9,6 @@ ...@@ -9,4 +9,6 @@
4. 增加circle类型,属性同rect 4. 增加circle类型,属性同rect
5. 属性中增加alias为别名,用来呈现中文别名(`{alias: '文本', type: 'string', default: '你好'}`) 5. 属性中增加alias为别名,用来呈现中文别名(`{alias: '文本', type: 'string', default: '你好'}`)
6. 属性中枚举的类型,type改为enum,增加以enum为名字的字符串存放枚举项(`{alias: '类型', type: 'enum', enum: ['rotate', 'jump', 'breath'], default: 'rotate'}`) 6. 属性中枚举的类型,type改为enum,增加以enum为名字的字符串存放枚举项(`{alias: '类型', type: 'enum', enum: ['rotate', 'jump', 'breath'], default: 'rotate'}`)
7. 编辑区需要能设置尺寸,默认`750*1334`,增加缩放功能,缩放可由按钮或者滚轮控制 7. 编辑区需要能设置尺寸,默认`750*1334`,增加缩放功能,缩放可由按钮或者滚轮控制
\ No newline at end of file 8. 增加删除脚本功能
9. 增加删除行为功能
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>zeroing-editor</title> <title>zeroing-editor</title>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but zeroing-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but zeroing-editor doesn't work properly without JavaScript enabled. Please enable it to
</noscript> continue.</strong>
<div id="app"></div> </noscript>
<!-- built files will be auto injected --> <script>
</body> window.__data = {
token: 'eyJhbGciOiJIUzI1NiJ9.5Y2e6b6Z5Lqt.2fNMm0oJt0l0ZzsSYwo4ie8Bs7yLU9EmS2mtrmLPktY',
};
</script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html> </html>
...@@ -6,7 +6,7 @@ import {API_HOST} from "../config"; ...@@ -6,7 +6,7 @@ import {API_HOST} from "../config";
import cookie from "cookie"; import cookie from "cookie";
import {stringify} from "querystringify"; import {stringify} from "querystringify";
const user_cookie = cookie.parse(document.cookie).user_cookie; const user_cookie = window.__data.token || cookie.parse(document.cookie).user_cookie;
class ApiError extends Error { class ApiError extends Error {
constructor(name, code, message) { constructor(name, code, message) {
...@@ -33,7 +33,7 @@ export async function fetchApi(uri, {params, method = 'get', contentType = 'json ...@@ -33,7 +33,7 @@ export async function fetchApi(uri, {params, method = 'get', contentType = 'json
const options = { const options = {
method, method,
headers: { headers: {
authorization: user_cookie, authorization: 'Bearer ' + user_cookie,
}, },
}; };
if (params) { if (params) {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Created by rockyl on 2019-09-19. * Created by rockyl on 2019-09-19.
*/ */
export const API_HOST = 'http://beacon.duibadev.com.cn'; //export const API_HOST = 'http://beacon.duibadev.com.cn';
//export const API_HOST = 'http://10.10.95.74:7777'; export const API_HOST = 'http://10.10.95.74:7777';
//export const API_HOST = 'http://localhost:3002'; //export const API_HOST = 'http://localhost:3002';
export const UPLOAD_FILE_URL = API_HOST + '/api/uploadFile'; export const UPLOAD_FILE_URL = API_HOST + '/api/uploadFile';
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
"Custom": "Custom", "Custom": "Custom",
"Entry": "Entry", "Entry": "Entry",
"Packing": "Packing", "Packing": "Packing",
"Type": "Type",
"Group": "Group",
"Open in new tab": "Open in new tab", "Open in new tab": "Open in new tab",
"Pack project successfully": "Pack project successfully", "Pack project successfully": "Pack project successfully",
"Pack project failed": "Pack project failed", "Pack project failed": "Pack project failed",
......
...@@ -17,8 +17,11 @@ $dock-pin-width: 9px; ...@@ -17,8 +17,11 @@ $dock-pin-width: 9px;
} }
.process-tree { .process-tree {
display: flex;
flex-direction: column;
.scrollbar { .scrollbar {
height: 100%; flex: 1;
.process-tree-node { .process-tree-node {
flex: 1; flex: 1;
......
...@@ -13,26 +13,26 @@ export default { ...@@ -13,26 +13,26 @@ export default {
type: 'inputNumber', type: 'inputNumber',
value: 0, value: 0,
}, },
// left: { left: {
// title: '左边距', title: '左边距',
// type: 'inputNumber', type: 'inputNumber',
// value: undefined, value: undefined,
// }, },
// right: { right: {
// title: '右边距', title: '右边距',
// type: 'inputNumber', type: 'inputNumber',
// value: undefined, value: undefined,
// }, },
// top: { top: {
// title: '上边距', title: '上边距',
// type: 'inputNumber', type: 'inputNumber',
// value: undefined, value: undefined,
// }, },
// bottom: { bottom: {
// title: '下边距', title: '下边距',
// type: 'inputNumber', type: 'inputNumber',
// value: undefined, value: undefined,
// }, },
width: { width: {
title: '宽度', title: '宽度',
type: 'inputNumber', type: 'inputNumber',
...@@ -43,18 +43,18 @@ export default { ...@@ -43,18 +43,18 @@ export default {
type: 'inputNumber', type: 'inputNumber',
value: 1 value: 1
}, },
// horizonCenter: { horizonCenter: {
// title: '水平偏移', title: '水平偏移',
// type: 'inputNumber', type: 'inputNumber',
// value: undefined, value: undefined,
// desc: '相对于父元素中心点的水平偏移,0为正中心' desc: '相对于父元素中心点的水平偏移,0为正中心'
// }, },
// verticalCenter: { verticalCenter: {
// title: '垂直偏移', title: '垂直偏移',
// type: 'inputNumber', type: 'inputNumber',
// value: undefined, value: undefined,
// desc: '相对于父元素中心点的垂直偏移,0为正中心' desc: '相对于父元素中心点的垂直偏移,0为正中心'
// }, },
rotation: { rotation: {
title: '旋转', title: '旋转',
type: 'inputNumber', type: 'inputNumber',
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<split-panes class="pane-container" @resized="onPanesReSized(0, $event)"> <split-panes class="pane-container" @resized="onPanesReSized(0, $event)">
<split-panes splitpanes-min="40" :splitpanes-size="getSize(0, 0)" horizontal @resized="onPanesReSized(1, $event)"> <split-panes splitpanes-min="40" :splitpanes-size="getSize(0, 0)" horizontal @resized="onPanesReSized(1, $event)">
<split-panes splitpanes-min="20" :splitpanes-size="getSize(1, 0)" @resized="onPanesReSized(2, $event)"> <split-panes splitpanes-min="20" :splitpanes-size="getSize(1, 0)" @resized="onPanesReSized(2, $event)">
<views splitpanes-min="30" :splitpanes-size="getSize(2, 0)"></views> <views splitpanes-min="20" :splitpanes-size="getSize(2, 0)"></views>
<playground splitpanes-min="20" :splitpanes-size="getSize(2, 1)"></playground> <playground splitpanes-min="20" :splitpanes-size="getSize(2, 1)"></playground>
</split-panes> </split-panes>
<assets splitpanes-min="20" :splitpanes-size="getSize(1, 1)"></assets> <assets splitpanes-min="20" :splitpanes-size="getSize(1, 1)"></assets>
...@@ -176,7 +176,9 @@ ...@@ -176,7 +176,9 @@
}).then(() => { }).then(() => {
}).catch(() => { }).catch(() => {
window.open(tplUrl, 'blank'); setTimeout(()=>{
window.open(tplUrl, 'blank');
}, 500);
}); });
}catch (e) { }catch (e) {
this.$message({ this.$message({
......
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
showBehaviorEditor(evn, key) { showBehaviorEditor(evn, key) {
this.currentEvent = key; this.currentEvent = key;
this.behaviors = evn.behaviors || []; this.behaviors = evn.behaviors || [];
this.$refs.behaviorEditorDialog.show(this.behaviors, key); this.$refs.behaviorEditorDialog.show(this.behaviors, this.activeComponent.name + '_' + key);
}, },
/** /**
* 当前选中组件发生变化时,更新eventsObj的数据 * 当前选中组件发生变化时,更新eventsObj的数据
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
<el-form-item prop="desc" label="Desc"> <el-form-item prop="desc" label="Desc">
<el-input v-model="meta.desc" :placeholder="$t('Description')" :readonly="!editable"/> <el-input v-model="meta.desc" :placeholder="$t('Description')" :readonly="!editable"/>
</el-form-item> </el-form-item>
<el-form-item prop="type" label="Type">
<el-input v-model="meta.type" :placeholder="$t('Type')" :readonly="!editable"/>
</el-form-item>
<el-form-item prop="group" label="Group">
<el-input v-model="meta.group" :placeholder="$t('Group')" :readonly="!editable"/>
</el-form-item>
<el-form-item label="Props"> <el-form-item label="Props">
<el-link :underline="false" @click="onClickEditProps" :disabled="!editable"> <el-link :underline="false" @click="onClickEditProps" :disabled="!editable">
<template v-if="Object.keys(meta.props).length"> <template v-if="Object.keys(meta.props).length">
...@@ -35,7 +41,13 @@ ...@@ -35,7 +41,13 @@
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<div class="button-bar"> <div class="button-bar">
<el-button size="mini" plain @click="printMeta">PrintMeta</el-button> <el-button-group style="margin-right: 20px;">
<el-button size="mini" plain @click="copyMeta">CopyMeta</el-button>
<el-popover>
<div ref="pasteBoard" @paste="onPaste">Click and Ctrl+V</div>
<el-button size="mini" slot="reference" plain @click="pasteMeta">PasteMeta</el-button>
</el-popover>
</el-button-group>
<el-button size="mini" plain @click="cancel">Cancel</el-button> <el-button size="mini" plain @click="cancel">Cancel</el-button>
<el-button size="mini" plain @click="save">Save</el-button> <el-button size="mini" plain @click="save">Save</el-button>
</div> </div>
...@@ -47,6 +59,7 @@ ...@@ -47,6 +59,7 @@
<script> <script>
import ElFormItem from "./editors/form-item"; import ElFormItem from "./editors/form-item";
import PropsEditorDialog from "./PropsEditorDialog"; import PropsEditorDialog from "./PropsEditorDialog";
import copy from 'copy-to-clipboard'
export default { export default {
name: "MetaEditorDialog", name: "MetaEditorDialog",
...@@ -69,7 +82,7 @@ ...@@ -69,7 +82,7 @@
}, },
computed: { computed: {
editable() { editable() {
return this.meta && this.meta.type !== 'builtin'; return this.meta;// && this.meta.type !== 'builtin';
}, },
props() { props() {
return Object.keys(this.meta.props).join(',') return Object.keys(this.meta.props).join(',')
...@@ -103,8 +116,25 @@ ...@@ -103,8 +116,25 @@
cancel() { cancel() {
this.visible = false; this.visible = false;
}, },
printMeta() { copyMeta() {
console.log(JSON.stringify(this.meta)); copy(JSON.stringify(this.meta));
},
pasteMeta() {
//setTimeout(this.focusPasteBoard, 1000, this);
},
onPaste(e) {
let metaStr = e.clipboardData.getData("Text");
if(metaStr){
try {
let meta = JSON.parse(metaStr);
this.meta = meta;
}catch (e) {
}
}
},
focusPasteBoard(){
this.$refs.pasteBoard.focus();
}, },
} }
} }
......
module.exports = { module.exports = {
publicPath: '',
pluginOptions: { pluginOptions: {
i18n: { i18n: {
locale: 'en', locale: 'en',
...@@ -7,4 +8,4 @@ module.exports = { ...@@ -7,4 +8,4 @@ module.exports = {
enableInSFC: true enableInSFC: true
} }
} }
} };
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