Commit 877528b9 authored by 郝聪敏's avatar 郝聪敏

perf: 优化ka工厂功能

parent 7261d30e
......@@ -3,18 +3,11 @@ import { Application } from 'egg';
export default (application: Application) => {
const { router, controller } = application;
// router.post('/admin/api/article/list', controller.admin.list);
// router.post('/admin/api/article/add', controller.admin.add);
// router.post('/admin/api/article/del', controller.admin.del);
// router.get('/admin/api/article/:id', controller.admin.detail);
router.post('/editor/save', controller.editor.save);
router.post('/editor/update', controller.editor.update);
router.get('/editor/get/list', controller.editor.getList);
router.get('/editor/get/template', controller.editor.getTemplateList);
router.get('/editor/get/:pageId', controller.editor.get);
// router.get('/', controller.admin.login);
// router.get('/admin', controller.admin.home);
// router.get('/admin/*', controller.admin.home);
router.get('/editor', controller.editor.home);
router.get('/editor/*', controller.editor.home);
router.get('/activity/:id', controller.activity.home);
......
......@@ -5,7 +5,7 @@
<Menu :active-name="activeName" theme="dark" width="auto" :open-names="['1']" accordion @on-select="select">
<div class="layout-logo-left">低代码平台</div>
<Menu-item name="list">作品列表</Menu-item>
<Menu-item name="my">我的作品</Menu-item>
<Menu-item name="my">我的草稿</Menu-item>
<Menu-item name="template">创意模板</Menu-item>
</Menu>
</i-col>
......
<template>
<div class="top-bar" v-if="isShowTopBar">
<img class="top-bar-left" src="@/asset/images/xyqb@2x.png" />
<img class="top-bar-left" :src="leftImg" />
<div class="top-bar-right">
<a href="https://s.xyqb.com/m">
<a :href="href">
<button class="top-bar-button">打开APP</button>
</a>
<img @click="isShowTopBar = false" class="top-bar-close" src="@/asset/images/close@2x.png" />
<img @click="isShowTopBar = false" class="top-bar-close" src="./images/close@2x.png" />
</div>
</div>
</template>
<script>
export default {
name: "DownloadGuide",
props: {
href: String,
leftImg: String
},
data() {
return {
isShowTopBar: true
isShowTopBar: true,
}
}
}
</script>
<style lang="less" scoped>
.top-bar {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 40px;
background-color: #d7e6ff;
padding: 0 20px 0 15px;
.top-bar-left {
width: 92px;
height: 24px;
}
.top-bar-right {
.top-bar {
display: flex;
align-items: center;
font-size: 0;
a {
margin-right: 15px;
.top-bar-button {
width: 70px;
height: 24px;
line-height: 24px;
border-radius: 24px !important;
background-color: #5573eb !important;
font-size: 13px;
}
justify-content: space-between;
width: 100%;
height: 40px;
background-color: #d7e6ff;
padding: 0 20px 0 15px;
.top-bar-left {
width: 92px;
height: 24px;
}
.top-bar-close {
width: 20px;
height: 20px;
.top-bar-right {
display: flex;
align-items: center;
a {
margin-right: 15px;
font-size: 0;
.top-bar-button {
width: 70px;
height: 24px;
line-height: 24px;
border-radius: 24px !important;
background-color: #5573eb !important;
font-size: 13px;
}
}
.top-bar-close {
width: 20px;
height: 20px;
}
}
}
}
</style>
\ No newline at end of file
......@@ -76,10 +76,7 @@ let sa = null;
export default {
name: "KALoginForm",
props: {
btnTxt: {
type: String,
default: "登录"
},
btnTxt: String,
btnColor: {
type: String,
default: '#000'
......@@ -121,7 +118,7 @@ export default {
},
styles() {
return this.btnImage ? {
background: `url(${this.btnImage}) no-repeat 0 0 / cover`,
background: `url(${this.btnImage}) no-repeat 0 0 / 100%`,
} : {};
}
},
......@@ -315,11 +312,9 @@ export default {
color: #999;
}
}
// &-submit {
// margin-top: 20px !important;
// height: 48px !important;
// border-radius: 8px !important;
// }
&-submit {
border: 0 !important;
}
}
.send-sms-field {
padding: 8px 6px 8px 15px !important;
......
......@@ -2,17 +2,8 @@ export const basicComponents = [
{
eleName: 'freedom-container',
title: '自由容器',
h: 300,
config: [
{
key: 'title',
name: '标题',
type: 'Input'
},
{
key: 'showHeader',
name: '显示标题',
type: 'Checkbox'
},
{
key: 'backgroundImage',
name: '背景图片',
......@@ -20,8 +11,6 @@ export const basicComponents = [
},
],
value: {
title: '活动详情'
showHeader: false,
backgroundImage: 'https://static.q-gp.com/new-xyqb-user-ui/public/static/img/landing-bg.6aa8a19.png';
},
commonStyle: {}
......@@ -92,7 +81,7 @@ export const basicComponents = [
width: '190px',
height: '140px',
src: 'https://appsync.lkbang.net/Fs0qmUsMry39AjHDf_W-qgn8XEy6',
fit: 'contain'
fit: 'contain',
},
commonStyle: {}
}
......@@ -102,7 +91,7 @@ export const businessComponents = [
{
eleName: 'login-form',
title: 'KA登陆表单',
h: 4,
h: 224,
config: [
{
key: 'btnTxt',
......@@ -117,8 +106,8 @@ export const businessComponents = [
{
key: 'btnImage',
name: '按钮图片',
type: 'Input'
}
type: 'Upload'
},
{
key: 'registerFrom',
name: '渠道号',
......@@ -126,11 +115,33 @@ export const businessComponents = [
},
],
value: {
btnTxt: '登陆',
btnTxt: '',
btnColor: '#ee0a24',
btnImage: '',
btnImage: 'https://static.q-gp.com/new-xyqb-user-ui/public/static/img/landing-submit.d875947.png',
registerFrom: ''
},
commonStyle: {}
},
{
eleName: 'download-guide',
title: '下载引导',
h: 40,
config: [
{
key: 'href',
name: '跳转链接',
type: 'Input'
},
{
key: 'leftImg',
name: 'logo',
type: 'Upload'
}
],
value: {
href: 'https://s.xyqb.com/m',
leftImg: 'http://activitystatic.xyqb.com/xyqb%402x.png'
},
commonStyle: {}
}
];
\ No newline at end of file
......@@ -6,12 +6,9 @@ import { Action, Mutation, State } from 'vuex-class';
@Component({ components: { LoginForm }, name: 'FreedomContainer' })
export default class FreedomContainer extends Vue {
@Action('setDragable') setDragable;
@State(state => state.editor.curChildIndex) curChildIndex;
@Prop({type: Object, default: () => ({ child: [] })}) childItem;
@Prop({ type: Boolean, default: true }) showHeader;
@Prop(String) title;
@Prop(String) backgroundImage;
transformStyle(styleObj) {
......
<template>
<div class="freedom">
<header v-if="showHeader">{{ title }}</header>
<div :class="['freedom-body', { 'freedom-body_full': showHeader }]" :style="{background: `url(${backgroundImage}) no-repeat 0 0 / cover`}">
<div class="freedom-body" :style="{background: `url(${backgroundImage}) no-repeat 0 0 / cover`}">
<component :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle)" :is="item.name" :key="index" v-bind="item.props"></component>
</div>
</div>
......
import { kebabCase } from 'lodash';
import { Vue, Component } from 'vue-property-decorator';
import { Vue, Component, Watch } from 'vue-property-decorator';
import eleConfig from '../../../editor/utils/config';
import FreedomContainer from '../../component/FreedomContainer/index.vue';
import GridLayout from '../../component/VueGridLayout/GridLayout.vue';
import GridItem from '../../component/VueGridLayout/GridItem.vue';
import LoginForm from '@/lib/Form/index.vue';
import TopBar from '@/component/TopBar';
import DownloadGuide from '@/lib/DownloadGuide/index.vue';
import {
Getter
} from 'vuex-class';
import { Getter, State } from 'vuex-class';
@Component({ components: { FreedomContainer, GridLayout, GridItem, TopBar, LoginForm }, name: 'Activity'})
@Component({ components: { FreedomContainer, GridLayout, GridItem, LoginForm, DownloadGuide }, name: 'Activity'})
export default class Activity extends Vue {
@Getter('pageData') pageData;
@State(state => state.editor.pageInfo.pageName) pageName;
@State(state => state.editor.gridLayout.rowHeight) rowHeight;
isLayoutComReady = false;
......@@ -21,6 +21,23 @@ export default class Activity extends Vue {
return this.pageData && this.pageData.elements.map(v => v.point) || [];
}
@Watch('pageName')
onPageNameChange(newVal) {
if (newVal) {
document.title = newVal;
// 如果是 iOS 设备,则使用如下 hack 的写法实现页面标题的更新
if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
const hackIframe = document.createElement('iframe');
hackIframe.style.display = 'none';
hackIframe.src = '/public/fixIosTitle.html?r=' + Math.random();
document.body.appendChild(hackIframe);
setTimeout(() => {
document.body.removeChild(hackIframe);
}, 300);
}
}
}
fetchApi(options) {
const { store, route } = options;
const { pageId } = route.params;
......
<template>
<div class="activity">
<TopBar />
<grid-layout
:layout.sync="layout"
:isDraggable="false"
:isResizable="false"
:col-num="12"
:row-height="55.59"
:row-height="rowHeight"
:margin="[0, 0]"
:is-draggable="true"
:is-resizable="true"
......
......@@ -18,8 +18,8 @@ export default class DynamicForm extends Vue {
@Watch('pageData', { immediate: true })
onPageDataChange(newVal) {
const { pageName, pageDescribe, coverImage, showDownload, isPublish, isTemplate } = this.pageData;
this.formCustom = { pageName, pageDescribe, coverImage, showDownload: !!showDownload, isPublish: !!isPublish, isTemplate: !!isTemplate };
const { pageName, pageDescribe, coverImage, isPublish, isTemplate } = this.pageData;
this.formCustom = { pageName, pageDescribe, coverImage, isPublish: !!isPublish, isTemplate: !!isTemplate };
}
@Watch('value')
......@@ -31,7 +31,7 @@ export default class DynamicForm extends Vue {
handleSubmit(type) {
this.$refs.formCustom.validate((valid) => {
if (valid) {
this.$emit('submit', type, { ...this.formCustom, showDownload: this.formCustom.showDownload ? 1 : 0, isPublish: this.formCustom.isPublish ? 1 : 0, isTemplate: this.formCustom.isTemplate ? 1 : 0 });
this.$emit('submit', type, { ...this.formCustom, isPublish: this.formCustom.isPublish ? 1 : 0, isTemplate: this.formCustom.isTemplate ? 1 : 0 });
}
});
},
......
......@@ -10,9 +10,6 @@
<FormItem label="页面封面" prop="coverImage">
<Upload v-model="formCustom.coverImage" />
</FormItem>
<FormItem label="引导下载" prop="showDownload">
<Checkbox v-model="formCustom.showDownload"></Checkbox>
</FormItem>
<FormItem label="是否发布" prop="isPublish">
<Checkbox v-model="formCustom.isPublish"></Checkbox>
</FormItem>
......
......@@ -26,7 +26,7 @@ export default class DynamicComponent extends Vue {
} else if (eleName === 'freedom-container') {
event.dataTransfer.setData('text', JSON.stringify({
name: eleName,
point: {x: 0, y: 2, w: 12, h: 5, i: '0'},
point: {x: 0, y: 2, w: 12, h: eleConfig.h || 1, i: '0'},
child: [],
schame: eleConfig.config,
props: {...props, ...eleConfig.value},
......@@ -60,7 +60,6 @@ export default class DynamicComponent extends Vue {
}
}
console.log(props);
return props;
}
}
\ No newline at end of file
......@@ -11,12 +11,13 @@ export default class DynamicForm extends Mixins(ContextMenu) {
@State(state => state.editor.curChildIndex) curChildIndex;
@Getter('pageData') pageData;
@Prop({type: Object, default: () => ({ schame: { config: [], value: [] }, props: {} })}) curElement;
@Prop({type: Object, default: () => ({ schame: [], props: {} })}) curElement;
form: object = {};
@Watch('curElement', { immediate: true, deep: true })
onElementChange(newVal) {
console.log('newVal', newVal);
newVal?.schame?.forEach(schame => {
this.$set(this.form, schame.key, newVal.props[schame.key]);
});
......
......@@ -13,13 +13,13 @@
<Form ref="formCustom" :label-width="60">
<FormItem label="尺寸" v-if="eleName === 'freedom-container'">
<Tooltip placement="top" content="全屏">
<Button type="ghost" icon="arrow-resize" @click="resizedEvent(12, 12)"></Button>
<Button type="ghost" icon="arrow-resize" @click="resizedEvent(667, 667)"></Button>
</Tooltip>
<Tooltip placement="top" content="宽100%">
<Button type="ghost" icon="arrow-swap" @click="resizedEvent(null, 12)"></Button>
<Button type="ghost" icon="arrow-swap" @click="resizedEvent(null, 667)"></Button>
</Tooltip>
<Tooltip placement="top" content="高100%">
<Button type="ghost" icon="arrow-swap" @click="resizedEvent(12, null)" ></Button>
<Button type="ghost" icon="arrow-swap" @click="resizedEvent(667, null)" ></Button>
</Tooltip>
</FormItem>
<FormItem label="定位" v-if="curChildIndex || curChildIndex === 0">
......
......@@ -11,8 +11,7 @@ export default class FreedomContainer extends Mixins(ContextMenu) {
@Prop({type: Object, default: () => ({ child: [] })}) childItem;
@Prop({type: Number, default: 0}) containerIndex;
@Prop({ type: Boolean, default: true }) showHeader;
@Prop(String) title;
@Prop({ type: Boolean, default: false }) showHeader;
@Prop(String) backgroundImage;
mousedown(childIndex, event) {
......
<template>
<div class="freedom" @click.stop="handleElementClick(containerIndex)">
<header v-if="showHeader">{{ title }}</header>
<div :class="['freedom-body', { 'freedom-body_full': showHeader }]" :style="{background: `url(${backgroundImage}) no-repeat 0 0 / cover`}">
<div class="freedom-body" :style="{background: `url(${backgroundImage}) no-repeat 0 0 / cover`}">
<component :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle)" :is="item.name" :key="index" @click.stop.native="handleElementClick(containerIndex, index)" @mousedown.native.stop="mousedown(index, $event)" v-bind="item.props" @contextmenu.native.prevent.stop="show($event, containerIndex, index)"></component>
</div>
</div>
......@@ -23,9 +22,6 @@
width: 100%;
height: 100%;
overflow: hidden;
&_full {
height: calc(100% - 48px);
}
.freedom-body-item {
&:hover {
border: 2px dashed #0c0c0c !important;
......
......@@ -8,6 +8,14 @@ import template from '../view/template/index.vue';
Vue.use(VueRouter);
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
};
VueRouter.prototype.replace = function push(location) {
return originalPush.call(this, location).catch(err => err);
};
export default function createRouter() {
return new VueRouter({
mode: 'history',
......
......@@ -7,14 +7,14 @@ import FreedomContainer from '../../component/FreedomContainer/index.vue';
import DynamicForm from '../../component/DynamicForm/index.vue';
import components from '@qg/cherry-ui/src/index.js';
import LoginForm from '@/lib/Form/index.vue';
import DownloadGuide from '@/lib/DownloadGuide/index.vue';
import { ContextMenu } from '@editor/mixins/contextMenu.mixin';
import BasicPageForm from '@editor/component/BasicPageForm/index.vue';
import { basicComponents, businessComponents } from '@/lib/config';
import config from '@/config/index';
@Component({components: { DynamicComponent, FreedomContainer, DynamicForm, GridLayout: VueGridLayout.GridLayout,
GridItem: VueGridLayout.GridItem, LoginForm, BasicPageForm }, name: 'DashBoard'})
GridItem: VueGridLayout.GridItem, LoginForm, DownloadGuide, BasicPageForm }, name: 'DashBoard'})
export default class DashBoard extends Mixins(ContextMenu) {
@Mutation('ADD_ELEMENTS') addElements;
@Mutation('SET_CUR_ELE_INDEX') setCurEleIndex;
......@@ -28,7 +28,8 @@ export default class DashBoard extends Mixins(ContextMenu) {
@Action('setTemplateInfo') setTemplateInfo;
@Getter('pageId') pageId;
@Getter('pageData') pageData;
@State(state => state.editor.draggable) draggable;
@State(state => state.editor.gridLayout.draggable) draggable;
@State(state => state.editor.gridLayout.rowHeight) rowHeight;
@State(state => state.editor.curEleIndex) curEleIndex;
@State(state => state.editor.curChildIndex) curChildIndex;
@State(state => state.editor.templateList) templateList;
......@@ -42,6 +43,7 @@ export default class DashBoard extends Mixins(ContextMenu) {
async created() {
const { pageId, templateId } = this.$route.params;
console.log(pageId, templateId);
this.resetPageData();
if (pageId) {
this.getPageDate({ pageId });
......@@ -77,13 +79,13 @@ export default class DashBoard extends Mixins(ContextMenu) {
this.showSubmitPopup = true;
} else {
this.pageData.elements.sort((a, b) => a.point.y - b.point.y);
const { pageName, pageDescribe, coverImage, showDownload, isPublish, isTemplate } = pageConfig;
const pageInfo = { page: JSON.stringify(this.pageData), author: 'congmin.hao', isPublish, pageName, pageDescribe, coverImage, showDownload, isTemplate };
const { pageName, pageDescribe, coverImage, isPublish, isTemplate } = pageConfig;
const pageInfo = { page: JSON.stringify(this.pageData), author: 'congmin.hao', isPublish, pageName, pageDescribe, coverImage, isTemplate };
if (+this.pageId) { pageInfo.id = this.pageId; }
await this.savePageData(pageInfo);
this.showSubmitPopup = false;
if (type === 'preview') {
window.open(`http://localhost:7001/activity/${this.pageId}`);
window.open(`${config.apiHost}activity/${this.pageId}`);
}
}
}
......@@ -133,12 +135,14 @@ export default class DashBoard extends Mixins(ContextMenu) {
}
modProps(props) {
console.log('modProps');
let currentEle = {};
if (this.curEleIndex !== null) {
if (this.curChildIndex !== null) {
this.updatePageInfo({ containerIndex: this.curEleIndex, childIndex: this.curChildIndex, data: { ...this.pageData.elements[this.curEleIndex].child[this.curChildIndex], props } });
currentEle = this.pageData.elements[this.curEleIndex].child[this.curChildIndex];
this.updatePageInfo({ containerIndex: this.curEleIndex, childIndex: this.curChildIndex, data: { ...currentEle, props: { ...currentEle.props, ...props } } });
} else {
this.updatePageInfo({ containerIndex: this.curEleIndex, data: { ...this.pageData.elements[this.curEleIndex], props } });
currentEle = this.pageData.elements[this.curEleIndex];
this.updatePageInfo({ containerIndex: this.curEleIndex, data: { ...this.pageData.elements[this.curEleIndex], props: { ...currentEle.props, ...props } } });
}
}
}
......@@ -158,7 +162,7 @@ export default class DashBoard extends Mixins(ContextMenu) {
const { y: curY } = this.pageData.elements[event.target.dataset.index].point;
const scrollTop = this.layout.reduce((pre, cur) => {
if (cur.y < curY) {
return pre + cur.h * 55.09;
return pre + cur.h * this.rowHeight;
}
return pre;
}, 0);
......@@ -167,28 +171,13 @@ export default class DashBoard extends Mixins(ContextMenu) {
// component
} else {
const { i } = maxBy(this.layout, 'i') || {};
const y = Math.floor(top / 55.09);
const y = Math.floor(top / this.rowHeight);
console.log('drops', i);
this.addElements({ data: {...data, point: { ...data.point, i: i || i === 0 ? String(+i + 1) : '0', y } });
this.handleElementClick(this.pageData.elements.length - 1, null);
}
}
getProps(eleName) {
const props = {};
for (const key of Object.keys(components)) {
const component = components[key];
if (kebabCase(component.name) === eleName && component.props) {
console.log(key, component.props);
for (const prop of Object.keys(component.props)) {
props[prop] = [Object, Array].includes(component.props[prop].type) ? component.props[prop].default() : component.props[prop].default;
}
}
}
return props;
}
resizedEvent(i, h, w) {
const index = this.pageData.elements.findIndex(ele => ele.point.i === i);
this.updatePageInfo({ containerIndex: index, data: { ...this.pageData.elements[index], point: { ...this.pageData.elements[index].point, w, h } } });
......
......@@ -53,7 +53,7 @@
<grid-layout
:layout.sync="layout"
:col-num="12"
:row-height="55.59"
:row-height="rowHeight"
:margin="[0, 0]"
:is-draggable="draggable"
:is-resizable="true"
......
......@@ -65,34 +65,6 @@ export default {
);
},
},
{
key: 'id',
title: '链接',
render: (h, params) => {
return h('span', `${config.apiHost}activity/${params.row.id}`)
}
},
{
key: 'isPublish',
title: '是否发布',
formType: 'select',
number: true,
valueEnum: {
0: '',
1: '',
}
},
{
key: 'isTemplate',
title: '是否模板',
formType: 'select',
number: true,
hideSearch: true,
valueEnum: {
0: '',
1: '',
}
},
{
key: 'action',
title: '操作',
......@@ -167,7 +139,7 @@ export default {
methods: {
async query(data) {
console.log(data);
return editorApi.getPageList({ type: 'my', ...data });
return editorApi.getPageList({ type: 'my', isPublish: 0, isTemplate: 0, ...data });
},
addPage() {
this.$router.push('/detail');
......
......@@ -88,6 +88,74 @@ export default {
1: '',
}
},
{
key: 'action',
title: '操作',
width: 200,
render: (h, params) => {
const props = {
type: 'primary',
};
const style = {
display: 'inline-block',
margin: '5px',
};
const btnArr = [
h(
'Button',
{
props,
style: {
...style,
},
on: {
click: () => {
console.log(params);
this.$router.push(`/detail/${params.row.id}`);
},
},
},
'修改'
),
h(
'Poptip',
{
props: {
confirm: true,
transfer: true,
title: '确认删除?',
},
style: {
...style,
},
on: {
'on-ok': () => {
console.log('删除')
},
},
},
[
h(
'Button',
{
props,
},
'删除'
),
]
),
];
return h(
'div',
{
style: {
textAlign: 'center',
},
},
btnArr
);
},
},
],
}
},
......
import api from '@/api/editor.api';
import { Module, GetterTree, ActionTree, MutationTree } from 'vuex';
import { cloneDeep } from 'lodash';
import {
SET_PAGE_INFO,
SET_DRAGABLE,
......@@ -56,14 +57,14 @@ export default class EditorModule implements Module<EditorState, RootState> {
async setTemplateInfo({commit}, condition) {
const res = await api.getPageById(condition);
const { page } = res as PageInfo;
const { pageInfo } = { ...defaultState };
const { pageInfo } = cloneDeep(defaultState);
commit(SET_PAGE_INFO, { ...pageInfo, page: JSON.parse(page as string) });
},
setDragable({ commit }, condition) {
commit(SET_DRAGABLE, condition);
},
resetPageData({ commit }, condition) {
const { pageInfo, curEleIndex, curChildIndex } = { ...defaultState };
const { pageInfo, curEleIndex, curChildIndex } = cloneDeep(defaultState);
commit(SET_PAGE_INFO, pageInfo);
commit(SET_CUR_ELE_INDEX, curEleIndex);
commit(SET_CUR_CHILD_INDEX, curChildIndex);
......@@ -75,7 +76,7 @@ export default class EditorModule implements Module<EditorState, RootState> {
state.pageInfo = data;
},
[SET_DRAGABLE](state, data) {
state.draggable = data;
state.gridLayout.draggable = data;
},
[SET_CUR_ELE_INDEX](state, curEleIndex) {
state.curEleIndex = curEleIndex;
......@@ -127,7 +128,7 @@ export default class EditorModule implements Module<EditorState, RootState> {
},
};
constructor(initState: EditorState = { ...defaultState }) {
constructor(initState: EditorState = cloneDeep(defaultState)) {
this.state = initState;
}
}
\ No newline at end of file
......@@ -18,6 +18,11 @@ interface CommonStyle {
top: number;
}
interface gridLayout {
draggable: boolean;
rowHeight: number;
}
export interface PageElement {
name: string;
schame: Schame[];
......@@ -42,7 +47,6 @@ export interface PageInfo {
}
export const defaultState = {
draggable: true,
curEleIndex: null,
curChildIndex: null,
pageInfo: {
......@@ -50,13 +54,16 @@ export const defaultState = {
pageName: '',
pageDescribe: '',
coverImage: 'http://desk.fd.zol-img.com.cn/g5/M00/00/07/ChMkJ1ZqMb2IWITEAAbRDaofaNIAAGBHwO3hh0ABtEl380.jpg',
showDownload: false,
isPublish: false,
page: {
elements: [],
}
},
templateList: [],
gridLayout: {
draggable: true,
rowHeight: 1
},
};
export default interface EditorState {
......@@ -65,4 +72,6 @@ export default interface EditorState {
curEleIndex: number | null;
curChildIndex: number | null;
templateList: any[];
rowHeight: number;
gridLayout: gridLayout;
}
\ No newline at end of file
#!/usr/bin/env node
"use strict";
const EggScriptsCommand = require("egg-scripts");
const cmd = new EggScriptsCommand(["start", "--port=80", "--daemon", "--workers=2"]);
cmd.start();
\ No newline at end of file
const npm = require("npm");
npm.load(() => {
npm.run("build");
});
\ No newline at end of file
......@@ -9,5 +9,9 @@ import { Application, EggAppConfig } from 'egg';
export default (appInfo: EggAppConfig) => {
const exports: any = {};
exports.logger = {
dir: '/home/quant_group/logs',
};
return exports;
};
......@@ -5,10 +5,10 @@
"scripts": {
"start": "egg-scripts start --port 80 --daemon --workers 4",
"stop": "egg-scripts stop",
"backend": "nohup egg-scripts start --port 7001 --workers 4 &",
"backend": "nohup egg-scripts start --port 7001 --workers 4",
"dev": "egg-bin dev -r egg-ts-helper/register",
"debug": "egg-bin debug -r egg-ts-helper/register",
"build": "npm run tsc && easy build -s",
"build": "npm run tsc && easy build && npm run start",
"tsc": "ets && tsc -p tsconfig.json",
"clean": "ets clean",
"kill": "easy kill",
......@@ -40,6 +40,7 @@
"mockjs": "^1.0.1-beta3",
"moment": "^2.17.1",
"mysql2": "^2.2.5",
"npm": "^6.14.10",
"postcss-px2rem": "^0.3.0",
"qs": "^6.9.4",
"sa-sdk-javascript": "^1.15.27",
......@@ -64,6 +65,7 @@
"@types/lowdb": "^1.0.6",
"@types/node": "^10.12.0",
"@types/shortid": "^0.0.29",
"@types/validator": "^4.5.26",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"cz-conventional-changelog": "^2.1.0",
"egg-bin": "^4.9.0",
......
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