Commit 4e9e04b4 authored by 付清曌's avatar 付清曌

Merge branch 'strate' into 'master'

Strate

See merge request !3
parents 597f6441 634ef8ce
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
"eqeqeq": 0,
"no-unused-vars": 0,
'semi': 0,
"handle-callback-err": 0,
"no-array-constructor": 0,
"no-irregular-whitespace": 0,
"no-tabs": 0,
"no-mixed-spaces-and-tabs": 0,
"no-useless-escape": 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
"vue/no-parsing-error": [2, { "x-invalid-end-tag": false }]
}
}
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
......@@ -11,11 +11,11 @@ module.exports = {
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/gateway': {
target: 'https://s-engine-ai3.liangkebang.net',
changeOrigin: true,
pathRewrite: {'^/gateway' : ''}
}
// '/gateway': {
// target: 'https://s-engine-ai3.liangkebang.net',
// changeOrigin: true,
// pathRewrite: {'^/gateway' : ''}
// }
},
// Various Dev Server settings
......
......@@ -4,8 +4,6 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>strategy-ui</title>
<script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.7.13/dingtalk.open.js"></script>
<script type="text/javascript" src="http://g.alicdn.com/dingding/dingtalk-pc-api/2.3.1/index.js"></script>
</head>
<body>
<div id="app"></div>
......
import axios from '../services/http.service'
import {
sapi
} from '../config'
export function getSoulSoother () {
return axios.get(`/gateway/api/sysStrategy/getTodaySoul`, {headers: {
return axios.get(`${sapi}/api/sysStrategy/getTodaySoul`, {headers: {
'Content-Type': 'application/json'
}})
}
export function getlist () {
return axios.get(`/gateway/api/sysStrategy/query`, {headers: {
return axios.get(`${sapi}/api/sysStrategy/query`, {headers: {
'Content-Type': 'application/json'
}})
}
export function addtitlelist (data) {
return axios.post(`/gateway/api/strategyObjectives/save`, data, {headers: {
return axios.post(`${sapi}/api/strategyObjectives/save`, data, {headers: {
'Content-Type': 'application/json'
}})
}
export function delatetitlelist (data) {
return axios.delete(`/gateway/api/strategyObjectives/delete/${data}`, {headers: {
return axios.post(`${sapi}/api/strategyObjectives/delete/${data}`, {headers: {
'Content-Type': 'application/json'
}})
}
export function savechildput (data) {
return axios.post(`/gateway/api/keyresults/save`, data, {headers: {
return axios.post(`${sapi}/api/keyresults/save`, data, {headers: {
'Content-Type': 'application/json'
}})
}
// 删除战略步骤
export function delatechildputchlid (data) {
return axios.delete(`/gateway/api/keyresults/delete/${data}`, {headers: {
return axios.post(`${sapi}/api/keyresults/delete/${data}`, {headers: {
'Content-Type': 'application/json'
}})
}
// 保存战略大标题
export function savehostTitle (data) {
return axios.post(`/gateway/api/sysStrategy/edit`, data, {headers: {
return axios.post(`${sapi}/api/sysStrategy/edit`, data, {headers: {
'Content-Type': 'application/json'
}})
}
// 排序战略
export function sortstrategy (arr, data) {
return axios.post(`/gateway/api/keyresults/${data}/order`, arr, {headers: {
return axios.post(`${sapi}/api/keyresults/${data}/order`, arr, {headers: {
'Content-Type': 'application/json'
}})
}
// 查询素材列表
export function getsourcelist (data) {
return axios.get(`/gateway/api/material/${data}/list`, {headers: {
return axios.get(`${sapi}/api/material/${data}/list`, {headers: {
'Content-Type': 'application/json'
}})
}
// 编辑素材
export function editsourceitem (data) {
return axios.post(`/gateway/api/material/save`, data, {headers: {
return axios.post(`${sapi}/api/material/save`, data, {headers: {
'Content-Type': 'application/json'
}})
}
// 删除素材
export function delatesourceitem (data) {
return axios.delete(`/gateway/api/material/delete/${data}`, {headers: {
return axios.post(`${sapi}/api/material/delete/${data}`, {headers: {
'Content-Type': 'application/json'
}})
}
// 查询战略详细列表
export function getdetailList (data) {
return axios.post(`/gateway/api/keyresultsDetail/${data}/list`, {headers: {
return axios.post(`${sapi}/api/keyresultsDetail/${data}/list`, {headers: {
'Content-Type': 'application/json'
}})
}
// 新增或修改战略详情
export function edutListitem (data) {
return axios.post(`/gateway/api/keyresultsDetail/save`, data, {headers: {
return axios.post(`${sapi}/api/keyresultsDetail/save`, data, {headers: {
'Content-Type': 'application/json'
}})
}
// 删除战略详情
export function delateListitem (data) {
return axios.delete(`/gateway/api/keyresultsDetail/delete/${data}`, {headers: {
return axios.post(`${sapi}/api/keyresultsDetail/delete/${data}`, {headers: {
'Content-Type': 'application/json'
}})
}
// 获取钉钉员工列表
export function getname (data) {
return axios.get(`/gateway/api/dingdingUser/searchDingDingUserByKey?key=${data}`, {headers: {
return axios.get(`${sapi}/api/dingdingUser/searchDingDingUserByKey?key=${data}`, {headers: {
'Content-Type': 'application/json'
}})
}
// 获取鉴权相关参数配置
export function getconfiglist () {
return axios.get(`/gateway/api/dingTalk/getDingTalkConfig`, {headers: {
return axios.get(`${sapi}/api/dingTalk/getDingTalkConfig`, {headers: {
'Content-Type': 'application/json'
}})
}
// 发送钉钉消息
export function sendding (data) {
return axios.post(`${sapi}/api/dingNotice/send`, data, {headers: {
'Content-Type': 'application/json'
}})
}
import axios from '../services/http.service'
// import {
// sapi
// } from '../config'
import {
sapi
} from '../config'
export function login (data) {
return axios.post(`/gateway/api/login/doLogin`, data, {headers: {
return axios.post(`${sapi}/api/login/doLogin`, data, {headers: {
'Content-Type': 'application/json'
}})
}
export function loginout () {
return axios.get(`/gateway/api/login/loginOut`, {headers: {
return axios.get(`${sapi}/api/login/loginOut`, {headers: {
'Content-Type': 'application/json'
}})
}
export function getmassage () {
return axios.get(`/gateway/api/login/me`, {headers: {
return axios.get(`${sapi}/api/login/me`, {headers: {
'Content-Type': 'application/json'
}})
}
<template>
<div class="layout">
<Layout class="layout_content">
<Sider breakpoint="md" collapsible :collapsed-width="78" v-model="isCollapsed">
<Sider breakpoint="md" ref="side1" hide-trigger collapsible :collapsed-width="78" v-model="isCollapsed">
<div class="title">
战略引擎
</div>
......@@ -13,10 +13,13 @@
</Menu>
<div slot="trigger"></div>
</Sider>
<Layout>
<Layout class="headerclass">
<Header class="layout-header-bar">
<span class="signout" @click="logOut">退出</span>
<span class="message">{{me}}</span>
<!-- <Header :style="{padding: 0}" class="layout-header-bar"> -->
<Icon @click.native="collapsedSider" :class="rotateIcon" :style="{margin: '0 0px 0 -40px'}" type="md-menu" size="24"></Icon>
<span class="signout" @click="logOut">退出</span>
<span class="message">{{me}}</span>
<!-- </Header> -->
</Header>
<Content :style="{margin: '5px', background: '#fff', minHeight: '220px'}">
<router-view></router-view>
......@@ -35,6 +38,12 @@ export default {
}
},
computed: {
rotateIcon () {
return [
'menu-icon',
this.isCollapsed ? 'rotate-icon' : ''
];
},
menuitemClasses: function () {
return [
'menu-item',
......@@ -55,8 +64,11 @@ export default {
},
getmass () {
getmassage().then(data => {
this.me = data.data.userCode
this.me = data.data.body.userName
})
},
collapsedSider () {
this.$refs.side1.toggleCollapse();
}
},
mounted () {
......@@ -66,7 +78,7 @@ export default {
</script>
<style scoped>
.layout{
border: 1px solid #d7dde4;
/* border: 1px solid #d7dde4; */
background: #f5f7f9;
position: relative;
border-radius: 4px;
......@@ -106,7 +118,7 @@ export default {
font-size: 22px;
}
.signout{
font-size: 16px;
font-size: 14px;
float: right;
margin-right: 10px;
color: #0092ff
......@@ -121,9 +133,64 @@ export default {
font-weight: 900;
}
.message {
font-size: 16px;
font-size: 14px;
float: right;
margin-right: 30px;
color: #0092ff
}
.layout{
border: 1px solid #d7dde4;
background: #f5f7f9;
position: relative;
border-radius: 4px;
overflow: hidden;
}
.layout-header-bar{
background: #fff;
box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
.layout-logo-left{
width: 90%;
height: 30px;
background: #5b6270;
border-radius: 3px;
margin: 15px auto;
}
.menu-icon{
transition: all .3s;
}
.rotate-icon{
transform: rotate(-90deg);
}
.menu-item span{
display: inline-block;
overflow: hidden;
width: 69px;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: bottom;
transition: width .2s ease .2s;
}
.menu-item i{
transform: translateX(0px);
transition: font-size .2s ease, transform .2s ease;
vertical-align: middle;
font-size: 16px;
}
.collapsed-menu span{
width: 0px;
transition: width .2s ease;
}
.collapsed-menu i{
transform: translateX(5px);
transition: font-size .2s ease .2s, transform .2s ease .2s;
vertical-align: middle;
font-size: 22px;
}
</style>
<style>
.headerclass .ivu-layout-header {
height: 48px;
line-height: 48px;
}
</style>
......@@ -82,8 +82,7 @@ export default {
height: 100%;
width: 100%;
position: relative;
background: url("../../static/logo.jpg") repeat;
background-size: 100% 100%;
background: url("../../static/bgss.jpg") no-repeat center 0 / cover;
}
.logincontent{
width:300px;
......
const sapi = 'https://s-engine-ai3.liangkebang.net'
// const sapi = 'http://192.168.29.88:5555'
export {
sapi
}
const sapi = 'http://heimdallr-arch.liangkebang.net'
// const sapi = 'http://192.168.29.88:5555'
const sapi = 'http://api.s-engine.quantgroup.cn'
// const sapi = 'https://s-engine.quantgroup.cn'
export {
sapi
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,8 +5,8 @@ import localStorage from './localStorage.service'
// window.Promise = require('es6-promise').Promise
const config = {
timeout: 600000
// withCredentials: true // 允许携带cookie
timeout: 600000,
withCredentials: true // 允许携带cookie
}
const instance = axios.create(Object.assign({}, config))
instance._extend = {}
......
static/add.png

406 Bytes

// A custom Nightwatch assertion.
// The assertion name is the filename.
// Example usage:
//
// browser.assert.elementCount(selector, count)
//
// For more information on custom assertions see:
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
this.message = 'Testing if element <' + selector + '> has count: ' + count
this.expected = count
this.pass = function (val) {
return val === this.expected
}
this.value = function (res) {
return res.value
}
this.command = function (cb) {
var self = this
return this.api.execute(function (selector) {
return document.querySelectorAll(selector).length
}, [selector], function (res) {
cb.call(self, res)
})
}
}
require('babel-register')
var config = require('../../config')
// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
src_folders: ['test/e2e/specs'],
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
selenium: {
start_process: true,
server_path: require('selenium-server').path,
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path
}
},
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
}
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true
}
},
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
}
}
}
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing'
const webpack = require('webpack')
const DevServer = require('webpack-dev-server')
const webpackConfig = require('../../build/webpack.prod.conf')
const devConfigPromise = require('../../build/webpack.dev.conf')
let server
devConfigPromise.then(devConfig => {
const devServerOptions = devConfig.devServer
const compiler = webpack(webpackConfig)
server = new DevServer(compiler, devServerOptions)
const port = devServerOptions.port
const host = devServerOptions.host
return server.listen(port, host)
})
.then(() => {
// 2. run the nightwatch test suite against it
// to run in additional browsers:
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
// 2. add it to the --env flag below
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
let opts = process.argv.slice(2)
if (opts.indexOf('--config') === -1) {
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
}
if (opts.indexOf('--env') === -1) {
opts = opts.concat(['--env', 'chrome'])
}
const spawn = require('cross-spawn')
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
runner.on('exit', function (code) {
server.close()
process.exit(code)
})
runner.on('error', function (err) {
server.close()
throw err
})
})
// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage
module.exports = {
'default e2e tests': function (browser) {
// automatically uses dev Server port from /config.index.js
// default: http://localhost:8080
// see nightwatch.conf.js
const devServer = browser.globals.devServerURL
browser
.url(devServer)
.waitForElementVisible('#app', 5000)
.assert.elementPresent('.hello')
.assert.containsText('h1', 'Welcome to Your Vue.js App')
.assert.elementCount('img', 1)
.end()
}
}
{
"env": {
"jest": true
},
"globals": {
}
}
const path = require('path')
module.exports = {
rootDir: path.resolve(__dirname, '../../'),
moduleFileExtensions: [
'js',
'json',
'vue'
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
transform: {
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
},
testPathIgnorePatterns: [
'<rootDir>/test/e2e'
],
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
setupFiles: ['<rootDir>/test/unit/setup'],
mapCoverage: true,
coverageDirectory: '<rootDir>/test/unit/coverage',
collectCoverageFrom: [
'src/**/*.{js,vue}',
'!src/main.js',
'!src/router/index.js',
'!**/node_modules/**'
]
}
import Vue from 'vue'
Vue.config.productionTip = false
import Vue from 'vue'
import HelloWorld from '@/components/HelloWorld'
describe('HelloWorld.vue', () => {
it('should render correct contents', () => {
const Constructor = Vue.extend(HelloWorld)
const vm = new Constructor().$mount()
expect(vm.$el.querySelector('.hello h1').textContent)
.toEqual('Welcome to Your Vue.js App')
})
})
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