Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 6850312
Author: 李小斐 <623536309@qq.com>
Date:   Sat Jan 11 10:25:59 2020 +0800

    fix: fixed redirect path regex (PanJiaChen#2933)

commit d634e2a
Author: 花裤衩 <panfree23@gmail.com>
Date:   Thu Jan 9 20:24:48 2020 +0800

    fix: fixed require mock bug in production

commit b57f200
Author: 花裤衩 <panfree23@gmail.com>
Date:   Thu Jan 9 17:36:49 2020 +0800

    bump: update element-ui version

commit c9affcf
Author: 花裤衩 <panfree23@gmail.com>
Date:   Thu Jan 9 17:21:36 2020 +0800

    fix: fixed mock server (PanJiaChen#2929)

    * init

    * refine

    * update

commit fbad7f4
Author: 花裤衩 <panfree23@gmail.com>
Date:   Thu Jan 9 16:49:57 2020 +0800

    fix[Charts]: fix charts resize in keep-alive bug (PanJiaChen#2922)

    * fix[Charts]: fix charts resize in keep-alive bug

    * refine

commit 088f64e
Author: RussXD <shangtouWeb@foxmail.com>
Date:   Wed Jan 8 12:12:10 2020 +0800

    perf: optimize checkCapslock method (PanJiaChen#2635)

    * optimize checkCapslock method

    * update

    Co-authored-by: 花裤衩 <panfree23@gmail.com>

commit 55b1bba
Author: AndyLZC/AndyLZC.github.io <34624589+AndyLZC@users.noreply.github.com>
Date:   Tue Jan 7 22:30:07 2020 +0800

    perf[complex-table]:refine code (PanJiaChen#2825)

    * 解决无法删除列表的bug;优化代码;

    * perf: refine

    Co-authored-by: 花裤衩 <panfree23@gmail.com>

commit fd5a2e8
Author: Kaitian Xie <xkaitian@gmail.com>
Date:   Mon Jan 6 06:34:14 2020 -0800

    perf[Menu]: remove unused menu-wrapper (PanJiaChen#2903)

commit a0b39d5
Author: 任羽飞 <ren12345@126.com>
Date:   Mon Jan 6 22:22:37 2020 +0800

    perf: import mockXHR only in production (PanJiaChen#2910)

    * 自动排除mock

    生产环境,使用webpack的条件编译自动排除mock数据

    * perf: refine

    Co-authored-by: 花裤衩 <panfree23@gmail.com>

commit 4f563a7
Author: 韬 <605682551@qq.com>
Date:   Tue Dec 31 14:14:34 2019 +0800

    fix[Logout]: click blank area of ​​dropDown able to logout (PanJiaChen#2896)

    Fixed clicking blank area of ​​drop-down unable to log out

commit 262c0ba
Author: 花裤衩 <panfree23@gmail.com>
Date:   Sun Dec 15 20:17:59 2019 +0800

    perf[documentation]:  refine css

commit 594fc58
Author: flitrue <812863096@qq.com>
Date:   Thu Dec 12 15:16:03 2019 +0800

    fix[icons]:fixed eslint 1 error and 2 warnings (PanJiaChen#2835)

commit 65d8c45
Author: monkeycf <41945134+monkeycf@users.noreply.github.com>
Date:   Wed Dec 4 10:34:23 2019 +0800

    feat: plop new generate store (PanJiaChen#2805)

commit e1554fd
Author: xuanzai <43233731+MikuBlog@users.noreply.github.com>
Date:   Sun Dec 1 15:48:30 2019 +0800

    perf[views/icons]: use grid (PanJiaChen#2803)

commit 53803d0
Author: Phạm Ngọc Hòa <thaycacac@gmail.com>
Date:   Wed Nov 27 09:06:28 2019 +0700

    perf: format pdf download (PanJiaChen#2791)

commit 25dddbb
Merge: 683f68b 44203f8
Author: 花裤衩 <panfree23@gmail.com>
Date:   Tue Nov 12 17:25:12 2019 +0800

    update 'MarkdownEditor' components name (PanJiaChen#2743)

commit 683f68b
Author: Phạm Ngọc Hòa <thaycacac@gmail.com>
Date:   Tue Nov 12 16:24:30 2019 +0700

    format: space in user card (PanJiaChen#2744)

commit 44203f8
Author: bbigcd <bbigcd@163.com>
Date:   Tue Nov 12 12:08:45 2019 +0800

    update 'MarkdownEditor' components name

commit d5c013a
Author: Phạm Ngọc Hòa <thaycacac@gmail.com>
Date:   Mon Nov 11 18:39:59 2019 +0700

    perf: text i18n (PanJiaChen#2739)

commit b11acb2
Author: Phạm Ngọc Hòa <thaycacac@gmail.com>
Date:   Fri Nov 8 10:26:53 2019 +0700

    perf: complex table (PanJiaChen#2732)

    Move ont format `{row}`

commit b2dd7ca
Author: Phạm Ngọc Hòa <thaycacac@gmail.com>
Date:   Fri Nov 8 10:25:42 2019 +0700

    perf: format drag table (PanJiaChen#2733)

    move one format `{row}`

commit a4fa119
Author: Phạm Ngọc Hòa <thaycacac@gmail.com>
Date:   Thu Nov 7 12:37:05 2019 +0700

    perf: format inline edit table (PanJiaChen#2725)

    move one format `{row}`

commit 6a194d1
Author: Phạm Ngọc Hòa <thaycacac@gmail.com>
Date:   Tue Nov 5 13:26:24 2019 +0700

    perf: format dropdown menu code (PanJiaChen#2720)

commit 6739ab5
Author: 花裤衩 <panfree23@gmail.com>
Date:   Fri Oct 25 19:45:21 2019 +0800

    style: fix el-date-picker css style

commit 6a214f0
Author: BradyBromley <51128276+BradyBromley@users.noreply.github.com>
Date:   Sun Oct 13 19:25:30 2019 -0700

    docs: improved README.md (PanJiaChen#2656)

commit 5273e02
Author: 花裤衩 <panfree23@gmail.com>
Date:   Sat Oct 12 17:51:26 2019 +0800

    docs: add job ad
  • Loading branch information
Chan committed Jan 15, 2020
1 parent 252b8ca commit 7bd9405
Show file tree
Hide file tree
Showing 32 changed files with 330 additions and 345 deletions.
12 changes: 6 additions & 6 deletions mock/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for (let i = 0; i < count; i++) {
forecast: '@float(0, 100, 2, 2)',
importance: '@integer(1, 3)',
'type|1': ['CN', 'US', 'JP', 'EU'],
'status|1': ['published', 'draft', 'deleted'],
'status|1': ['published', 'draft'],
display_time: '@datetime',
comment_disabled: true,
pageviews: '@integer(300, 5000)',
Expand All @@ -29,7 +29,7 @@ for (let i = 0; i < count; i++) {

export default [
{
url: '/article/list',
url: '/vue-element-admin/article/list',
type: 'get',
response: config => {
const { importance, type, title, page = 1, limit = 20, sort } = config.query
Expand Down Expand Up @@ -58,7 +58,7 @@ export default [
},

{
url: '/article/detail',
url: '/vue-element-admin/article/detail',
type: 'get',
response: config => {
const { id } = config.query
Expand All @@ -74,7 +74,7 @@ export default [
},

{
url: '/article/pv',
url: '/vue-element-admin/article/pv',
type: 'get',
response: _ => {
return {
Expand All @@ -92,7 +92,7 @@ export default [
},

{
url: '/article/create',
url: '/vue-element-admin/article/create',
type: 'post',
response: _ => {
return {
Expand All @@ -103,7 +103,7 @@ export default [
},

{
url: '/article/update',
url: '/vue-element-admin/article/update',
type: 'post',
response: _ => {
return {
Expand Down
3 changes: 2 additions & 1 deletion mock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ export function mockXHR() {
// for mock server
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`/mock${url}`),
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
type: type || 'get',
response(req, res) {
console.log('request invoke:' + req.path)
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
}
}
Expand Down
4 changes: 2 additions & 2 deletions mock/remote-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NameList.push({ name: 'mock-Pan' })
export default [
// username search
{
url: '/search/user',
url: '/vue-element-admin/search/user',
type: 'get',
response: config => {
const { name } = config.query
Expand All @@ -30,7 +30,7 @@ export default [

// transaction list
{
url: '/transaction/list',
url: '/vue-element-admin/transaction/list',
type: 'get',
response: _ => {
return {
Expand Down
10 changes: 5 additions & 5 deletions mock/role/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const roles = [
export default [
// mock get all routes form server
{
url: '/routes',
url: '/vue-element-admin/routes',
type: 'get',
response: _ => {
return {
Expand All @@ -50,7 +50,7 @@ export default [

// mock get all roles form server
{
url: '/roles',
url: '/vue-element-admin/roles',
type: 'get',
response: _ => {
return {
Expand All @@ -62,7 +62,7 @@ export default [

// add role
{
url: '/role',
url: '/vue-element-admin/role',
type: 'post',
response: {
code: 20000,
Expand All @@ -74,7 +74,7 @@ export default [

// update role
{
url: '/role/[A-Za-z0-9]',
url: '/vue-element-admin/role/[A-Za-z0-9]',
type: 'put',
response: {
code: 20000,
Expand All @@ -86,7 +86,7 @@ export default [

// delete role
{
url: '/role/[A-Za-z0-9]',
url: '/vue-element-admin/role/[A-Za-z0-9]',
type: 'delete',
response: {
code: 20000,
Expand Down
6 changes: 3 additions & 3 deletions mock/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const users = {
export default [
// user login
{
url: '/user/login',
url: '/vue-element-admin/user/login',
type: 'post',
response: config => {
const { username } = config.body
Expand All @@ -49,7 +49,7 @@ export default [

// get user info
{
url: '/user/info\.*',
url: '/vue-element-admin/user/info\.*',
type: 'get',
response: config => {
const { token } = config.query
Expand All @@ -72,7 +72,7 @@ export default [

// user logout
{
url: '/user/logout',
url: '/vue-element-admin/user/logout',
type: 'post',
response: _ => {
return {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"driver.js": "0.9.5",
"dropzone": "5.5.1",
"echarts": "4.2.1",
"element-ui": "^2.9.2",
"element-ui": "2.13.0",
"file-saver": "2.0.1",
"fuse.js": "3.4.4",
"js-cookie": "2.2.0",
Expand Down
16 changes: 16 additions & 0 deletions plop-templates/store/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{#if state}}
const state = {}
{{/if}}

{{#if mutations}}
const mutations = {}
{{/if}}

{{#if actions}}
const actions = {}
{{/if}}

export default {
namespaced: true,
{{options}}
}
62 changes: 62 additions & 0 deletions plop-templates/store/prompt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const { notEmpty } = require('../utils.js')

module.exports = {
description: 'generate store',
prompts: [{
type: 'input',
name: 'name',
message: 'store name please',
validate: notEmpty('name')
},
{
type: 'checkbox',
name: 'blocks',
message: 'Blocks:',
choices: [{
name: 'state',
value: 'state',
checked: true
},
{
name: 'mutations',
value: 'mutations',
checked: true
},
{
name: 'actions',
value: 'actions',
checked: true
}
],
validate(value) {
if (!value.includes('state') || !value.includes('mutations')) {
return 'store require at least state and mutations'
}
return true
}
}
],
actions(data) {
const name = '{{name}}'
const { blocks } = data
const options = ['state', 'mutations']
const joinFlag = `,
`
if (blocks.length === 3) {
options.push('actions')
}

const actions = [{
type: 'add',
path: `src/store/modules/${name}.js`,
templateFile: 'plop-templates/store/index.hbs',
data: {
options: options.join(joinFlag),
state: blocks.includes('state'),
mutations: blocks.includes('mutations'),
actions: blocks.includes('actions')
}
}]
return actions
}
}
2 changes: 2 additions & 0 deletions plopfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')
const storeGenerator = require('./plop-templates/store/prompt.js')

module.exports = function(plop) {
plop.setGenerator('view', viewGenerator)
plop.setGenerator('component', componentGenerator)
plop.setGenerator('store', storeGenerator)
}
14 changes: 7 additions & 7 deletions src/api/article.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import request from '@/utils/request'

export async function fetchList(query) {
return await request({
url: '/article/list',
export function fetchList(query) {
return request({
url: '/vue-element-admin/article/list',
method: 'get',
params: query
})
}

export function fetchArticle(id) {
return request({
url: '/article/detail',
url: '/vue-element-admin/article/detail',
method: 'get',
params: { id }
})
}

export function fetchPv(pv) {
return request({
url: '/article/pv',
url: '/vue-element-admin/article/pv',
method: 'get',
params: { pv }
})
}

export function createArticle(data) {
return request({
url: '/article/create',
url: '/vue-element-admin/article/create',
method: 'post',
data
})
}

export function updateArticle(data) {
return request({
url: '/article/update',
url: '/vue-element-admin/article/update',
method: 'post',
data
})
Expand Down
4 changes: 2 additions & 2 deletions src/api/remote-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import request from '@/utils/request'

export function searchUser(name) {
return request({
url: '/search/user',
url: '/vue-element-admin/search/user',
method: 'get',
params: { name }
})
}

export function transactionList(query) {
return request({
url: '/transaction/list',
url: '/vue-element-admin/transaction/list',
method: 'get',
params: query
})
Expand Down
10 changes: 5 additions & 5 deletions src/api/role.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ import request from '@/utils/request'

export function getRoutes() {
return request({
url: '/routes',
url: '/vue-element-admin/routes',
method: 'get'
})
}

export function getRoles() {
return request({
url: '/roles',
url: '/vue-element-admin/roles',
method: 'get'
})
}

export function addRole(data) {
return request({
url: '/role',
url: '/vue-element-admin/role',
method: 'post',
data
})
}

export function updateRole(id, data) {
return request({
url: `/role/${id}`,
url: `/vue-element-admin/role/${id}`,
method: 'put',
data
})
}

export function deleteRole(id) {
return request({
url: `/role/${id}`,
url: `/vue-element-admin/role/${id}`,
method: 'delete'
})
}
6 changes: 3 additions & 3 deletions src/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import request from '@/utils/request'

export function login(data) {
return request({
url: '/user/login',
url: '/vue-element-admin/user/login',
method: 'post',
data
})
}

export function getInfo(token) {
return request({
url: '/user/info',
url: '/vue-element-admin/user/info',
method: 'get',
params: { token }
})
}

export function logout() {
return request({
url: '/user/logout',
url: '/vue-element-admin/user/logout',
method: 'post'
})
}
Loading

0 comments on commit 7bd9405

Please sign in to comment.