Commit c73c5c89 authored by 郝聪敏's avatar 郝聪敏

Merge branch 'feature/test' into 'master'

Feature/test

See merge request !2
parents da15d790 6a333c9b
import { Vue, Component, Prop } from 'vue-property-decorator'; import { Vue, Component, Prop } from 'vue-property-decorator';
import cherryUi from '@qg/cherry-ui';
import Raven from 'raven-js'; import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue'; import RavenVue from 'raven-js/plugins/vue';
import { release } from '@/.sentryclirc'; import { release } from '@/.sentryclirc';
import '@qg/cherry-ui/dist/cherry.css'; import '@/service/qg.service';
Vue.use(cherryUi);
// 初始化sentry // 初始化sentry
if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') { if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/public/asset/css/reset.css"> <link rel="stylesheet" href="/public/asset/css/reset.css">
<link rel="stylesheet" href="">
</head> </head>
<body> <body>
<div id="app"><slot></slot></div> <div id="app"><slot></slot></div>
......
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
import iView from 'iview'; import iView from 'iview';
import cherryUi from '@qg/cherry-ui';
import Raven from 'raven-js'; import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue'; import RavenVue from 'raven-js/plugins/vue';
import { release } from '@/.sentryclirc'; import { release } from '@/.sentryclirc';
import VueContextMenu from '@editor/component/Contextmenu/index'; import VueContextMenu from '@editor/component/Contextmenu/index';
import localStorage from '@/service/localStorage.service'; import localStorage from '@/service/localStorage.service';
import '@/service/qg.service';
import 'iview/dist/styles/iview.css'; import 'iview/dist/styles/iview.css';
import '@qg/cherry-ui/dist/cherry.css';
Vue.use(iView); Vue.use(iView);
Vue.use(cherryUi);
Vue.use(VueContextMenu); Vue.use(VueContextMenu);
// 初始化sentry // 初始化sentry
......
import { Vue, Component, Prop } from 'vue-property-decorator'; import { Vue, Component, Prop } from 'vue-property-decorator';
// import cherryUi from '../../../../../node_modules/@qg/cherry-ui/src/index';
import cherryUi from '@qg/cherry-ui';
import iView from 'iview'; import iView from 'iview';
import '@qg/cherry-ui/dist/cherry.css';
import 'iview/dist/styles/iview.css'; import 'iview/dist/styles/iview.css';
Vue.use(iView); Vue.use(iView);
Vue.use(cherryUi);
@Component({ @Component({
name: 'Layout' name: 'Layout'
......
...@@ -2,4 +2,5 @@ import prod from './prod.config'; ...@@ -2,4 +2,5 @@ import prod from './prod.config';
import dev from './dev.config'; import dev from './dev.config';
import test from './test.config'; import test from './test.config';
export default process.env.NODE_ENV === 'test' ? test : process.env.NODE_ENV === 'production' ? prod : dev; // export default process.env.NODE_ENV === 'test' ? test : process.env.NODE_ENV === 'production' ? prod : dev;
export default process.env.SENTRY_ENV ? test : process.env.NODE_ENV === 'production' ? prod : dev;
// export const basicComponents = require('@qg/cherry-ui/md/index.json'); // export const basicComponents = require('@qg/cherry-ui/md/index.json');
// export const kaLoginForm = require('@qg/citrus-ui/md/index.json');
export const basicComponents = [ export const basicComponents = [
{ {
eleName: 'freedom-container', eleName: 'freedom-container',
......
import { Component, Vue, Prop, Watch } from 'vue-property-decorator'; import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import components from '@qg/cherry-ui/src/index.js';
import FreedomContainer from '../../component/FreedomContainer/index.vue'; import FreedomContainer from '../../component/FreedomContainer/index.vue';
import { kebabCase, chunk, flatten } from 'lodash'; import { kebabCase, chunk, flatten } from 'lodash';
import { State } from 'vuex-class'; import { State } from 'vuex-class';
...@@ -52,17 +51,17 @@ export default class DynamicComponent extends Vue { ...@@ -52,17 +51,17 @@ export default class DynamicComponent extends Vue {
console.log('dragend'); console.log('dragend');
} }
getProps(eleName) { // getProps(eleName) {
const props = {}; // const props = {};
for (const key of Object.keys(components)) { // for (const key of Object.keys(components)) {
const component = components[key]; // const component = components[key];
if (kebabCase(component.name) === eleName && component.props) { // if (kebabCase(component.name) === eleName && component.props) {
for (const prop of Object.keys(component.props)) { // for (const prop of Object.keys(component.props)) {
props[prop] = ['Object', 'Array'].includes(component.props[prop].type.name) ? component.props[prop].default && component.props[prop].default() : component.props[prop].default; // props[prop] = ['Object', 'Array'].includes(component.props[prop].type.name) ? component.props[prop].default && component.props[prop].default() : component.props[prop].default;
} // }
} // }
} // }
return props; // return props;
} // }
} }
\ No newline at end of file
...@@ -5,7 +5,6 @@ import DynamicComponent from '@editor/component/DynamicComponent/index.vue'; ...@@ -5,7 +5,6 @@ import DynamicComponent from '@editor/component/DynamicComponent/index.vue';
import VueGridLayout from 'vue-grid-layout'; import VueGridLayout from 'vue-grid-layout';
import FreedomContainer from '../../component/FreedomContainer/index.vue'; import FreedomContainer from '../../component/FreedomContainer/index.vue';
import DynamicForm from '../../component/DynamicForm/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 LoginForm from '@/lib/Form/index.vue';
import DownloadGuide from '@/lib/DownloadGuide/index.vue'; import DownloadGuide from '@/lib/DownloadGuide/index.vue';
import { ContextMenu } from '@editor/mixins/contextMenu.mixin'; import { ContextMenu } from '@editor/mixins/contextMenu.mixin';
......
import Vue from 'vue';
import {
Button,
Image,
Icon,
Cell,
CellGroup,
Row,
Col,
Dialog,
Popup,
Overlay,
Divider,
Loading,
Picker,
NavBar,
Field,
Checkbox,
CardList,
List,
Form,
Sticky,
Tab,
Tabs
} from '@qg/cherry-ui';
// import { KaLoginForm } from '@qg/citrus-ui';
Vue.use(Button);
Vue.use(Image);
// Vue.use(Cell);
// Vue.use(CellGroup);
// Vue.use(Row);
// Vue.use(Col);
// Vue.use(Popup);
// Vue.use(Divider);
// Vue.use(Picker);
Vue.use(Field);
// Vue.use(Dialog);
// Vue.use(Checkbox);
// Vue.use(Icon);
// Vue.use(Sticky);
// Vue.use(Overlay);
Vue.use(Form);
// Vue.use(CardList);
// Vue.use(Loading);
// Vue.use(List);
// Vue.use(Tab);
// Vue.use(Tabs);
// Vue.use(KaLoginForm);
...@@ -22,12 +22,7 @@ export default (appInfo: EggAppConfig) => { ...@@ -22,12 +22,7 @@ export default (appInfo: EggAppConfig) => {
injectCss: false injectCss: false
}; };
exports.webpack = { const localMysqlConfig = {
webpackConfigList: getWebpackConfig(),
browser: 'http://localhost:7001/editor/list'
};
exports.sequelize = {
dialect: 'mysql', dialect: 'mysql',
username: 'qa', username: 'qa',
password: 'qatest', password: 'qatest',
...@@ -36,5 +31,12 @@ export default (appInfo: EggAppConfig) => { ...@@ -36,5 +31,12 @@ export default (appInfo: EggAppConfig) => {
database: 'low_code', database: 'low_code',
}; };
exports.sequelize = localMysqlConfig;
exports.webpack = {
webpackConfigList: getWebpackConfig(),
browser: 'http://localhost:7001/editor/list'
};
return exports; return exports;
}; };
...@@ -31,8 +31,9 @@ export default (appInfo: EggAppConfig) => { ...@@ -31,8 +31,9 @@ export default (appInfo: EggAppConfig) => {
database: 'low_code', database: 'low_code',
}; };
// exports.sequelize = process.env.NODE_ENV === 'test' ? localMysqlConfig : prodMysqlConfig; console.log('process.env.NODE_ENV', process.env.NAMESPACE);
exports.sequelize = localMysqlConfig;
exports.sequelize = process.env.NAMESPACE ? localMysqlConfig : prodMysqlConfig;
return exports; return exports;
}; };
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.0.1", "version": "0.0.1",
"description": "低代码平台", "description": "低代码平台",
"scripts": { "scripts": {
"start": "egg-scripts start --port 9050 --workers 1", "start": "egg-scripts start --port 80 --workers 1",
"stop": "egg-scripts stop", "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", "dev": "egg-bin dev -r egg-ts-helper/register",
...@@ -18,14 +18,25 @@ ...@@ -18,14 +18,25 @@
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s" "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
}, },
"dependencies": { "dependencies": {
"@babel/plugin-syntax-jsx": "^7.12.1",
"@better-scroll/core": "^2.0.5", "@better-scroll/core": "^2.0.5",
"@easy-team/easywebpack-cli": "^4.0.0",
"@easy-team/easywebpack-vue": "^4.0.0",
"@hubcarl/json-typescript-mapper": "^2.0.0", "@hubcarl/json-typescript-mapper": "^2.0.0",
"@qg/cherry-ui": "^2.18.66", "@qg/cherry-ui": "^2.18.66",
"@qg/citrus-ui": "0.0.1-alpha.1",
"@types/lodash": "^4.14.117",
"@types/node": "^10.12.0",
"@types/validator": "^4.5.26",
"axios": "^0.18.1", "axios": "^0.18.1",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"cz-conventional-changelog": "^2.1.0",
"egg": "^2.3.0", "egg": "^2.3.0",
"egg-bin": "^4.9.0",
"egg-cors": "^2.1.1", "egg-cors": "^2.1.1",
"egg-scripts": "^2.10.0", "egg-scripts": "^2.10.0",
"egg-sequelize-ts": "^0.2.3-0", "egg-sequelize-ts": "^0.2.3-0",
"egg-ts-helper": "^1.13.0",
"egg-view-vue-ssr": "^3.0.5", "egg-view-vue-ssr": "^3.0.5",
"egg-webpack": "^4.4.7", "egg-webpack": "^4.4.7",
"egg-webpack-vue": "^2.0.0", "egg-webpack-vue": "^2.0.0",
...@@ -33,10 +44,13 @@ ...@@ -33,10 +44,13 @@
"html2canvas": "^1.0.0-rc.7", "html2canvas": "^1.0.0-rc.7",
"iview": "^2.9.0", "iview": "^2.9.0",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"less": "^3.12.2",
"less-loader": "^7.1.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"mockjs": "^1.0.1-beta3", "mockjs": "^1.0.1-beta3",
"moment": "^2.17.1", "moment": "^2.17.1",
"mysql2": "^2.2.5", "mysql2": "^2.2.5",
"node-tool-utils": "^1.1.1",
"npm": "^6.14.10", "npm": "^6.14.10",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"qs": "^6.9.4", "qs": "^6.9.4",
...@@ -44,6 +58,12 @@ ...@@ -44,6 +58,12 @@
"sa-sdk-javascript": "^1.15.27", "sa-sdk-javascript": "^1.15.27",
"sequelize": "^4.38.0", "sequelize": "^4.38.0",
"sequelize-typescript": "^0.6.6", "sequelize-typescript": "^0.6.6",
"ts-loader": "^5.3.0",
"ts-node": "^7.0.1",
"tslint": "^5.9.1",
"tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.3",
"typescript": "^3.9.2",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-grid-layout": "^2.3.11", "vue-grid-layout": "^2.3.11",
"vue-property-decorator": "^7.2.0", "vue-property-decorator": "^7.2.0",
...@@ -51,25 +71,6 @@ ...@@ -51,25 +71,6 @@
"vuex": "^3.0.1", "vuex": "^3.0.1",
"vuex-class": "^0.3.1", "vuex-class": "^0.3.1",
"vuex-router-sync": "^5.0.0", "vuex-router-sync": "^5.0.0",
"@babel/plugin-syntax-jsx": "^7.12.1",
"@easy-team/easywebpack-cli": "^4.0.0",
"@easy-team/easywebpack-vue": "^4.0.0",
"@types/lodash": "^4.14.117",
"@types/node": "^10.12.0",
"@types/validator": "^4.5.26",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"cz-conventional-changelog": "^2.1.0",
"egg-bin": "^4.9.0",
"egg-ts-helper": "^1.13.0",
"less": "^3.12.2",
"less-loader": "^7.1.0",
"node-tool-utils": "^1.1.1",
"ts-loader": "^5.3.0",
"ts-node": "^7.0.1",
"tslint": "^5.9.1",
"tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.3",
"typescript": "^3.9.2",
"webpack-sentry-plugin": "^1.16.0" "webpack-sentry-plugin": "^1.16.0"
}, },
"devDependencies": {}, "devDependencies": {},
......
...@@ -67,6 +67,13 @@ module.exports = { ...@@ -67,6 +67,13 @@ module.exports = {
args: SentryConfig args: SentryConfig
} }
}, },
{
define:{
'process.env': {
SENTRY_ENV: JSON.stringify(process.env.SENTRY_ENV)
}
}
}
], ],
optimization: { optimization: {
namedModules: true, namedModules: true,
...@@ -83,13 +90,13 @@ module.exports = { ...@@ -83,13 +90,13 @@ module.exports = {
default: false, default: false,
saSdk: { saSdk: {
name: "chunk-sa-sdk", // split cherryUI into a single package name: "chunk-sa-sdk", // split cherryUI into a single package
priority: 22, // the weight needs to be larger than libs and app or it will be packaged into libs or app priority: 21, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]sa-sdk-javascript[\\/]/, // in order to adapt to cnpm test: /[\\/]node_modules[\\/]sa-sdk-javascript[\\/]/, // in order to adapt to cnpm
enforce: true enforce: true
}, },
cherryUI: { cherryUI: {
name: 'chunk-cherryUI', // 分离组件库 name: 'chunk-cherryUI', // 分离组件库
priority: 21, priority: 22,
chunks: 'all', chunks: 'all',
test: /[\\/]node_modules[\\/]@qg[\\/]cherry-ui[\\/]/, test: /[\\/]node_modules[\\/]@qg[\\/]cherry-ui[\\/]/,
enforce: true enforce: 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