Commit 8afe3245 authored by rockyl's avatar rockyl

修改过程属性链接方式

parent e1713b17
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
function verification(callback) {
var container = document.createElement('div');
container.style.position = 'fixed';
container.style.zIndex = '99999';
document.body.append(container);
var input = document.createElement('input');
input.placeholder = 'password';
container.append(input);
var button = document.createElement('button');
button.innerText = 'OK';
container.append(button);
button.onclick = function () {
callback(input.value === 'password');
}
var aaa = document.createElement('div');
document.body.append(aaa);
}
verification(function(result){
console.log(result);
})
</script>
</body>
</html>
\ No newline at end of file
module.exports = {
region: 'oss-cn-hangzhou',
id: 'LTAIqO2wblIxQvwc',
secret: '4brsaSRbRpjxw3oDIxJi6bNMcndIR6',
bucket: 'duiba',
output: '/editor/zeroing/v1'
};
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"upload": "cp dist/index.html ../duiba-aurora-node/src/public/index.html&&ali-oss-publish -c oss.config.js -e dist",
"build:upload": "npm run build&&npm run upload",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'" "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'"
}, },
"dependencies": { "dependencies": {
...@@ -27,6 +29,7 @@ ...@@ -27,6 +29,7 @@
"@kazupon/vue-i18n-loader": "^0.3.0", "@kazupon/vue-i18n-loader": "^0.3.0",
"@vue/cli-plugin-babel": "^3.11.0", "@vue/cli-plugin-babel": "^3.11.0",
"@vue/cli-service": "^3.11.0", "@vue/cli-service": "^3.11.0",
"ali-oss-publish": "^0.3.0",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"node-sass": "^4.9.2", "node-sass": "^4.9.2",
"sass": "^1.22.9", "sass": "^1.22.9",
......
public/favicon.ico

4.19 KB | W: | H:

public/favicon.ico

4.19 KB | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<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>烽火台</title>
</head> </head>
<body> <body>
<noscript> <noscript>
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
</noscript> </noscript>
<script> <script>
window.__data = { window.__data = {
token: 'eyJhbGciOiJIUzI1NiJ9.5Y2e6b6Z5Lqt.2fNMm0oJt0l0ZzsSYwo4ie8Bs7yLU9EmS2mtrmLPktY', token : 'eyJhbGciOiJIUzI1NiJ9.5Yqz55Cq5bOw.wixVqBeqGS2FBY_VWF1cC_Vg5Zr0vYgRTfuncjGthYY'//'$TOKEN$'
}; }
</script> </script>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
......
<template> <template>
<div id="app" class="theme-light"> <div id="app" class="theme-light">
<router-view/> <div class="error-tips" v-if="ready && showErrorTips">
<div class="invalid-route" v-if="ready && invalidRoute"> <p>{{errorTipsStr}}</p>
<p>无效的页面 {{cd}}秒后跳转</p> <el-button @click="jump">direct link</el-button>
</div> </div>
<router-view v-else/>
</div> </div>
</template> </template>
<script> <script>
import i18n from "./i18n";
import {SSO_VERIFY_PAGE_URL} from "./config";
const errorTipsArr = [
'',
i18n.t('Access denied'),
i18n.t('Invalid router'),
];
export default { export default {
name: "App", name: "App",
...@@ -15,25 +24,38 @@ ...@@ -15,25 +24,38 @@
return { return {
cd: 5, cd: 5,
ready: false, ready: false,
errorType: 0,
errorTips: '',
} }
}, },
computed: { mounted() {
invalidRoute() { if (!window['zeroing_token']) {
return !this.$route.matched || this.$route.matched.length === 0; this.dealError(1);
} }
}, },
computed: {
showErrorTips() {
return !window['zeroing_token'] || !this.$route.matched || this.$route.matched.length === 0;
},
errorTipsStr() {
return this.errorTips + ' ' + this.$t('Jump after', {cd: this.cd});
},
},
watch: { watch: {
$route: { $route: {
handler: function(val, oldVal){ handler: function (val, oldVal) {
this.dealInvalidRoute(); this.dealError(2);
this.ready = true;
}, },
deep: true deep: true
} }
}, },
methods: { methods: {
dealInvalidRoute(){ dealError(type) {
if (this.invalidRoute) { this.errorType = type;
this.errorTips = errorTipsArr[type];
this.ready = true;
if (this.showErrorTips) {
this.cd = 5; this.cd = 5;
this.startCD(); this.startCD();
} }
...@@ -42,18 +64,28 @@ ...@@ -42,18 +64,28 @@
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (this.cd <= 0) { if (this.cd <= 0) {
clearInterval(this.timer); clearInterval(this.timer);
this.$router.replace({name: 'home'}); this.jump();
return; return;
} }
this.cd--; this.cd--;
}, 1000) }, 1000)
},
jump() {
switch (this.errorType) {
case 1:
location.href = SSO_VERIFY_PAGE_URL;
break;
case 2:
this.$router.replace({name: 'home'});
break;
} }
}, },
},
} }
</script> </script>
<style> <style>
.invalid-route { .error-tips {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
*/ */
import {API_HOST} from "../config"; import {API_HOST} from "../config";
import cookie from "cookie";
import {stringify} from "querystringify"; import {stringify} from "querystringify";
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) {
super(); super();
...@@ -33,8 +30,9 @@ export async function fetchApi(uri, {params, method = 'get', contentType = 'json ...@@ -33,8 +30,9 @@ export async function fetchApi(uri, {params, method = 'get', contentType = 'json
const options = { const options = {
method, method,
headers: { headers: {
authorization: 'Bearer ' + user_cookie, authorization: 'Bearer ' + window['zeroing_token'],
}, },
//credentials: 'include',
}; };
if (params) { if (params) {
if (method.toLowerCase() === 'post') { if (method.toLowerCase() === 'post') {
......
...@@ -9,6 +9,8 @@ export const API_HOST = 'http://10.10.95.74:7777'; ...@@ -9,6 +9,8 @@ export const API_HOST = 'http://10.10.95.74:7777';
export const UPLOAD_FILE_URL = API_HOST + '/api/uploadFile'; export const UPLOAD_FILE_URL = API_HOST + '/api/uploadFile';
export const PARSE_BUNDLE_URL = API_HOST + '/api/parsePSD'; export const PARSE_BUNDLE_URL = API_HOST + '/api/parsePSD';
export const SSO_VERIFY_PAGE_URL = '/sso/logout';
export const DOCK_POINT_OFFSET = 4; export const DOCK_POINT_OFFSET = 4;
//文件类型图标 t表示展示缩略图 //文件类型图标 t表示展示缩略图
......
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
"Packing": "Packing", "Packing": "Packing",
"Type": "Type", "Type": "Type",
"Group": "Group", "Group": "Group",
"Access denied": "Access denied",
"Invalid router": "Invalid router",
"Jump after": "Jump after {cd}s",
"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",
......
...@@ -11,6 +11,8 @@ import './assets/style.css' ...@@ -11,6 +11,8 @@ import './assets/style.css'
import './plugins/element.js' import './plugins/element.js'
import './themes/light/index.scss' import './themes/light/index.scss'
import './token'
new Vue({ new Vue({
router, router,
store, store,
......
...@@ -153,6 +153,12 @@ $dock-pin-width: 9px; ...@@ -153,6 +153,12 @@ $dock-pin-width: 9px;
} }
.linked-value {
display: flex;
align-items: center;
justify-content: flex-end;
}
.string-value { .string-value {
text-align: right; text-align: right;
} }
...@@ -232,7 +238,7 @@ $dock-pin-width: 9px; ...@@ -232,7 +238,7 @@ $dock-pin-width: 9px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.linked{ .linked {
display: block; display: block;
height: 26px; height: 26px;
overflow: hidden; overflow: hidden;
...@@ -263,7 +269,7 @@ $dock-pin-width: 9px; ...@@ -263,7 +269,7 @@ $dock-pin-width: 9px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.name-input{ .name-input {
} }
...@@ -272,7 +278,7 @@ $dock-pin-width: 9px; ...@@ -272,7 +278,7 @@ $dock-pin-width: 9px;
padding-top: 5px; padding-top: 5px;
flex: 1; flex: 1;
.scrollbar-view{ .scrollbar-view {
padding-right: 10px; padding-right: 10px;
} }
...@@ -285,11 +291,11 @@ $dock-pin-width: 9px; ...@@ -285,11 +291,11 @@ $dock-pin-width: 9px;
} }
} }
.node-select-container{ .node-select-container {
flex: 1; flex: 1;
} }
.string-editor-container{ .string-editor-container {
flex: 1; flex: 1;
height: 28px; height: 28px;
} }
...@@ -349,13 +355,13 @@ $dock-pin-width: 9px; ...@@ -349,13 +355,13 @@ $dock-pin-width: 9px;
} }
} }
.node-select-popover{ .node-select-popover {
.tree-scrollbar { .tree-scrollbar {
width: 100%; width: 100%;
height: 200px; height: 200px;
} }
.bottom-bar{ .bottom-bar {
margin-top: 5px; margin-top: 5px;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -363,3 +369,9 @@ $dock-pin-width: 9px; ...@@ -363,3 +369,9 @@ $dock-pin-width: 9px;
} }
} }
.linked-prop-popover {
div + div {
margin-top: 5px;
}
}
/**
* Created by rockyl on 2019-11-16.
*/
import cookie from "cookie";
let user_cookie;
user_cookie = cookie.parse(document.cookie).user_cookie;
if (!user_cookie) {
try {
user_cookie = window.__data.token;
} catch (e) {
}
}
if (!user_cookie) {
console.log('Access denied');
}
window['zeroing_token'] = user_cookie;
...@@ -20,8 +20,6 @@ export const RENDERER_TYPES= { ...@@ -20,8 +20,6 @@ export const RENDERER_TYPES= {
CANVAS: 'canvas', CANVAS: 'canvas',
}; };
export const linkedFlag = '$_linked_$';
export function messageError(e) { export function messageError(e) {
Message({ Message({
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
class="menu-item import-file" class="menu-item import-file"
:action="importFileUrl" :action="importFileUrl"
name="file" name="file"
:headers="uploadHeaders"
:show-file-list="false" :show-file-list="false"
:on-success="uploadFileSuccess" :on-success="uploadFileSuccess"
:on-error="uploadFileError" :on-error="uploadFileError"
...@@ -66,7 +67,10 @@ export default { ...@@ -66,7 +67,10 @@ export default {
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
} },
uploadHeaders: {
authorization: 'Bearer ' + window['zeroing_token'],
},
}; };
}, },
computed: { computed: {
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
</div> </div>
<div v-else class="field-item" v-for="(param, key, index) in meta.props" :key="index"> <div v-else class="field-item" v-for="(param, key, index) in meta.props" :key="index">
<span class="key">{{param.alias || key}}</span>: <span class="key">{{param.alias || key}}</span>:
<span class="" v-if="data.props[key] === linkedFlag"> <span class="linked-value" v-if="typeof data.props[key] === 'object'">
<span>{{data.props[key].alias || ''}}</span>
<i class="el-icon-link linked-icon"></i> <i class="el-icon-link linked-icon"></i>
</span> </span>
<template v-else> <template v-else>
...@@ -43,7 +44,6 @@ ...@@ -43,7 +44,6 @@
import {mapState} from "vuex"; import {mapState} from "vuex";
import DockPin from "./DockPin"; import DockPin from "./DockPin";
import events from "../../../../global-events"; import events from "../../../../global-events";
import {linkedFlag} from "../../../../utils";
export default { export default {
name: "ProcessNode", name: "ProcessNode",
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
height: 100, height: 100,
inputMeta, inputMeta,
active: false, active: false,
linkedFlag,
} }
}, },
mounted() { mounted() {
......
...@@ -11,10 +11,15 @@ ...@@ -11,10 +11,15 @@
trigger="click" trigger="click"
:disabled="!editable" :disabled="!editable"
> >
<div class="linked-prop-popover">
<div> <div>
<span>{{$t('Link to parent')}}: </span> <span>{{$t('Link to parent')}}: </span>
<el-switch :value="linked" @input="onChange"/> <el-switch :value="linked" @input="onChange"/>
</div> </div>
<div v-if="linked">
<el-input size="mini" v-model="value.alias"/>
</div>
</div>
<el-link style="padding: 3px;" slot="reference" icon="el-icon-link" :underline="false" <el-link style="padding: 3px;" slot="reference" icon="el-icon-link" :underline="false"
:type="linked ? 'success' : 'default'" :disabled="!editable"/> :type="linked ? 'success' : 'default'" :disabled="!editable"/>
</el-popover> </el-popover>
...@@ -24,7 +29,6 @@ ...@@ -24,7 +29,6 @@
<script> <script>
import camelcase from 'camelcase' import camelcase from 'camelcase'
import ElFormItem from "./form-item"; import ElFormItem from "./form-item";
import {linkedFlag} from "../../../../utils";
export default { export default {
name: "EditorWrapper", name: "EditorWrapper",
...@@ -44,15 +48,27 @@ ...@@ -44,15 +48,27 @@
default: 0, default: 0,
}, },
}, },
data(){
return {
}
},
watch: {
value(v){
}
},
computed: { computed: {
linked() { linked() {
return this.value === linkedFlag return typeof this.value === 'object'
} }
}, },
methods: { methods: {
onChange(v) { onChange(v) {
if (v) { if (v) {
this.$set(this.container.data.props, this.propertyName, linkedFlag); this.$set(this.container.data.props, this.propertyName, {
alias: undefined,
});
} else { } else {
this.$delete(this.container.data.props, this.propertyName); this.$delete(this.container.data.props, this.propertyName);
} }
......
<template> <template>
<editor-wrapper :editable="editable" :value="value" :container="container" :property="property" :propertyName="propertyName"> <editor-wrapper :editable="editable" :value="value" :container="container" :property="property"
:propertyName="propertyName">
<div style="display: flex;flex: 1;"> <div style="display: flex;flex: 1;">
<el-popover <el-popover
placement="top" placement="top"
...@@ -34,7 +35,8 @@ ...@@ -34,7 +35,8 @@
</el-button-group> </el-button-group>
</div> </div>
</div> </div>
<el-input clearable slot="reference" v-model="editValue" @change="onInput" placeholder="unset" :readonly="!editable"> <el-input clearable slot="reference" v-model="editValue" @change="onInput" placeholder="unset"
:readonly="!editable">
<template slot="prepend">node://</template> <template slot="prepend">node://</template>
</el-input> </el-input>
</el-popover> </el-popover>
...@@ -66,15 +68,20 @@ ...@@ -66,15 +68,20 @@
}, },
} }
}, },
watch: {
value(v) {
this.editValueOrigin = v;
}
},
computed: { computed: {
...mapGetters([ ...mapGetters([
'behavior_views' 'behavior_views'
]), ]),
editValue: { editValue: {
get(){ get() {
return this.editValueOrigin ? this.editValueOrigin.replace(nodeScheme) : ''; return this.editValueOrigin && typeof this.editValueOrigin !== 'object'? this.editValueOrigin.replace(nodeScheme, '') : '';
}, },
set(v){ set(v) {
this.editValueOrigin = v; this.editValueOrigin = v;
}, },
}, },
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<script> <script>
import EditorWrapper from "./EditorWrapper"; import EditorWrapper from "./EditorWrapper";
import {getEditorDefaultValue, linkedFlag} from "../../../../utils"; import {getEditorDefaultValue} from "../../../../utils";
export default { export default {
name: "StringEditor", name: "StringEditor",
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="project-info"> <div class="project-info">
<span class="project-name">{{scope.row.name}}</span> <span class="project-name">{{scope.row.name}}</span>
<el-tag size="mini" type="success">{{scope.row.creator}}</el-tag> <el-tag size="mini" type="success">{{scope.row.operator}}</el-tag>
<el-tag size="mini" type="warning">{{moment(scope.row.update_time)}}</el-tag> <el-tag size="mini" type="warning">{{moment(scope.row.update_time)}}</el-tag>
</div> </div>
</template> </template>
......
const serverHost = 'http://10.10.95.74:7777';
module.exports = { module.exports = {
publicPath: '', publicPath: process.env.NODE_ENV === 'production' ? '//yun.duiba.com.cn/editor/zeroing/v1/' : '',
pluginOptions: { pluginOptions: {
i18n: { i18n: {
locale: 'en', locale: 'en',
...@@ -7,5 +9,20 @@ module.exports = { ...@@ -7,5 +9,20 @@ module.exports = {
localeDir: 'locales', localeDir: 'locales',
enableInSFC: true enableInSFC: true
} }
},
devServer: {
host: '0.0.0.0',
port: '8080',
proxy: {
'/sso': {
target: serverHost,
},
'/api': {
target: serverHost,
},
}
},
configureWebpack: {
} }
}; };
This source diff could not be displayed because it is too large. You can view the blob instead.
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