From 8d34b5449f23a15c291629496cb1d5d47a775718 Mon Sep 17 00:00:00 2001
From: "aoli.qu" <408346101@qq.com>
Date: Mon, 23 Aug 2021 15:15:19 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/sys/dictionary.js | 45 ++++++
src/api/sys/dictionaryItem.js | 45 ++++++
src/components/GlobalFooter/index.vue | 2 +-
src/config/router.config.js | 28 +++-
src/layouts/UserLayout.vue | 2 +-
src/router/generator-routers.js | 6 +-
src/utils/screenLog.js | 5 +-
src/views/sys/dictionary/DictionaryDetail.vue | 40 ++++++
src/views/sys/dictionary/DictionaryForm.vue | 98 +++++++++++++
src/views/sys/dictionary/DictionaryList.vue | 126 +++++++++++++++++
.../dictionaryItem/DictionaryItemDetail.vue | 48 +++++++
.../sys/dictionaryItem/DictionaryItemForm.vue | 130 +++++++++++++++++
.../sys/dictionaryItem/DictionaryItemList.vue | 132 ++++++++++++++++++
13 files changed, 694 insertions(+), 13 deletions(-)
create mode 100644 src/api/sys/dictionary.js
create mode 100644 src/api/sys/dictionaryItem.js
create mode 100644 src/views/sys/dictionary/DictionaryDetail.vue
create mode 100644 src/views/sys/dictionary/DictionaryForm.vue
create mode 100644 src/views/sys/dictionary/DictionaryList.vue
create mode 100644 src/views/sys/dictionaryItem/DictionaryItemDetail.vue
create mode 100644 src/views/sys/dictionaryItem/DictionaryItemForm.vue
create mode 100644 src/views/sys/dictionaryItem/DictionaryItemList.vue
diff --git a/src/api/sys/dictionary.js b/src/api/sys/dictionary.js
new file mode 100644
index 0000000..2c0d122
--- /dev/null
+++ b/src/api/sys/dictionary.js
@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+const dictionaryApi = {
+ add: '/sys/dictionary/add',
+ get: '/sys/dictionary/get',
+ update: '/sys/dictionary/edit',
+ del: '/sys/dictionary/del',
+ page: '/sys/dictionary/pageList'
+}
+
+export function dictionaryAdd (params) {
+ return request({
+ url: dictionaryApi.add,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryGet (params) {
+ return request({
+ url: dictionaryApi.get,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryUpdate (params) {
+ return request({
+ url: dictionaryApi.update,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryDel (params) {
+ return request({
+ url: dictionaryApi.del,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryPage (params) {
+ return request({
+ url: dictionaryApi.page,
+ method: 'post',
+ data: params
+ })
+}
diff --git a/src/api/sys/dictionaryItem.js b/src/api/sys/dictionaryItem.js
new file mode 100644
index 0000000..90eefd1
--- /dev/null
+++ b/src/api/sys/dictionaryItem.js
@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+const dictionaryItemApi = {
+ add: '/sys/dictionaryItem/add',
+ get: '/sys/dictionaryItem/get',
+ update: '/sys/dictionaryItem/edit',
+ del: '/sys/dictionaryItem/del',
+ page: '/sys/dictionaryItem/pageList'
+}
+
+export function dictionaryItemAdd (params) {
+ return request({
+ url: dictionaryItemApi.add,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryItemGet (params) {
+ return request({
+ url: dictionaryItemApi.get,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryItemUpdate (params) {
+ return request({
+ url: dictionaryItemApi.update,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryItemDel (params) {
+ return request({
+ url: dictionaryItemApi.del,
+ method: 'post',
+ data: params
+ })
+}
+export function dictionaryItemPage (params) {
+ return request({
+ url: dictionaryItemApi.page,
+ method: 'post',
+ data: params
+ })
+}
diff --git a/src/components/GlobalFooter/index.vue b/src/components/GlobalFooter/index.vue
index d7e0125..d4e0830 100644
--- a/src/components/GlobalFooter/index.vue
+++ b/src/components/GlobalFooter/index.vue
@@ -2,7 +2,7 @@
diff --git a/src/config/router.config.js b/src/config/router.config.js
index 2bdd8f5..f5d4cc6 100644
--- a/src/config/router.config.js
+++ b/src/config/router.config.js
@@ -56,6 +56,12 @@ export const asyncRouterMap = [
name: 'SecurityResource',
component: () => import('@/views/security/resource/ResourceTree'),
meta: { title: '菜单管理', keepAlive: true }
+ },
+ {
+ path: '/sys/dictionary',
+ name: 'DictionaryList',
+ component: () => import('@/views/sys/dictionary/DictionaryList'),
+ meta: { title: '数据字段', keepAlive: true }
}
]
},
@@ -69,7 +75,7 @@ export const asyncRouterMap = [
{
path: '/form/base-form',
name: 'BaseForm',
- component: () => import('@/views/form/basicForm/index'),
+ component: () => import('@/views/form/basicForm/Index'),
meta: { title: '基础表单', keepAlive: true, permission: [ 'form' ] }
},
{
@@ -154,7 +160,7 @@ export const asyncRouterMap = [
{
path: '/profile/basic',
name: 'ProfileBasic',
- component: () => import('@/views/profile/basic/index'),
+ component: () => import('@/views/profile/basic/Index'),
meta: { title: '基础详情页', permission: [ 'profile' ] }
},
{
@@ -226,7 +232,7 @@ export const asyncRouterMap = [
{
path: '/account/center',
name: 'center',
- component: () => import('@/views/account/center/index'),
+ component: () => import('@/views/account/center/Index'),
meta: { title: '个人中心', keepAlive: true, permission: [ 'user' ] }
},
{
@@ -373,5 +379,19 @@ export const constantRouterMap = [
{
path: '/404',
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
- }
+ },
+ {
+ path: '/dictionary',
+ component: BasicLayout,
+ redirect: '/sys/dictionary',
+ meta: { title: '词典分类' },
+ children: [
+ {
+ path: 'dictionaryItem/list/:id',
+ name: 'DictionaryItemList',
+ component: () => import('@/views/sys/dictionaryItem/DictionaryItemList'),
+ meta: { title: '词典项', keepAlive: true, permission: [ 'dictionaryItem' ] }
+ }
+ ]
+ },
]
diff --git a/src/layouts/UserLayout.vue b/src/layouts/UserLayout.vue
index 99c836b..fc04200 100644
--- a/src/layouts/UserLayout.vue
+++ b/src/layouts/UserLayout.vue
@@ -17,7 +17,7 @@
条款
- Copyright © 2021 YinMei
+ Copyright © 2021 XinMei
diff --git a/src/router/generator-routers.js b/src/router/generator-routers.js
index 7c8958a..4556aed 100644
--- a/src/router/generator-routers.js
+++ b/src/router/generator-routers.js
@@ -17,7 +17,7 @@ const constantRouterComponents = {
// 你需要动态引入的页面组件
'Workplace': () => import('@/views/dashboard/Workplace'),
// form
- 'BasicForm': () => import('@/views/form/basicForm/index'),
+ 'BasicForm': () => import('@/views/form/basicForm/Index'),
'StepForm': () => import('@/views/form/stepForm/StepForm'),
'AdvanceForm': () => import('@/views/form/advancedForm/AdvancedForm'),
@@ -29,7 +29,7 @@ const constantRouterComponents = {
'SearchArticles': () => import('@/views/list/search/Article'),
'SearchProjects': () => import('@/views/list/search/Projects'),
'SearchApplications': () => import('@/views/list/search/Applications'),
- 'ProfileBasic': () => import('@/views/profile/basic/index'),
+ 'ProfileBasic': () => import('@/views/profile/basic/Index'),
'ProfileAdvanced': () => import('@/views/profile/advanced/Advanced'),
// result
@@ -42,7 +42,7 @@ const constantRouterComponents = {
'Exception500': () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
// account
- 'AccountCenter': () => import('@/views/account/center/index'),
+ 'AccountCenter': () => import('@/views/account/center/Index'),
'AccountSettings': () => import('@/views/account/settings/Index'),
'BaseSettings': () => import('@/views/account/settings/BaseSetting'),
'SecuritySettings': () => import('@/views/account/settings/Security'),
diff --git a/src/utils/screenLog.js b/src/utils/screenLog.js
index 04ea8d7..1ed8f22 100644
--- a/src/utils/screenLog.js
+++ b/src/utils/screenLog.js
@@ -3,10 +3,7 @@ export const printANSI = () => {
// console.clear()
// ASCII - ANSI Shadow
let text = `
-╔═╗╔╗╔╔╦╗╔═╗╔═╗╔╦╗╔═╗╦═╗
-╠═╣║║║ ║ ║╣ ╠═╣ ║ ║╣ ╠╦╝
-╩ ╩╝╚╝ ╩ ╚═╝╩ ╩ ╩ ╚═╝╩╚═
-Published ${APP_VERSION}-${GIT_HASH} @ tcc.com
+Published ${APP_VERSION}-${GIT_HASH} @ xinmei.com
Build date: ${BUILD_DATE}`
console.log(`%c${text}`, 'color: #fc4d50')
}
diff --git a/src/views/sys/dictionary/DictionaryDetail.vue b/src/views/sys/dictionary/DictionaryDetail.vue
new file mode 100644
index 0000000..9c8a7f5
--- /dev/null
+++ b/src/views/sys/dictionary/DictionaryDetail.vue
@@ -0,0 +1,40 @@
+
+
+
+ {{ model.dictionaryName }}
+ {{ model.dictionaryCode }}
+ {{ model.createTime | moment('YYYY-MM-DD HH:mm:ss') }}
+ {{ model.updateTime | moment('YYYY-MM-DD HH:mm:ss') }}
+
+
+
+
+
diff --git a/src/views/sys/dictionary/DictionaryForm.vue b/src/views/sys/dictionary/DictionaryForm.vue
new file mode 100644
index 0000000..ab95ddf
--- /dev/null
+++ b/src/views/sys/dictionary/DictionaryForm.vue
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/sys/dictionary/DictionaryList.vue b/src/views/sys/dictionary/DictionaryList.vue
new file mode 100644
index 0000000..4190eb7
--- /dev/null
+++ b/src/views/sys/dictionary/DictionaryList.vue
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ {queryParam = {}, handleRefresh()}">重置
+
+
+ 新增
+
+
+
+
+
+
+ 修改
+
+ handleDelete(record)">
+ 删除
+
+
+ 详情
+
+ 词典项
+
+
+
+
+
+
+
+
+
diff --git a/src/views/sys/dictionaryItem/DictionaryItemDetail.vue b/src/views/sys/dictionaryItem/DictionaryItemDetail.vue
new file mode 100644
index 0000000..7d7e057
--- /dev/null
+++ b/src/views/sys/dictionaryItem/DictionaryItemDetail.vue
@@ -0,0 +1,48 @@
+
+
+
+ {{ model.name }}
+ {{ model.value }}
+ {{ model.parentid }}
+ {{ model.sortid }}
+ {{ model.description }}
+ {{ model.createTime | moment('YYYY-MM-DD HH:mm:ss') }}
+ {{ model.updateTime | moment('YYYY-MM-DD HH:mm:ss') }}
+
+
+
+
+
diff --git a/src/views/sys/dictionaryItem/DictionaryItemForm.vue b/src/views/sys/dictionaryItem/DictionaryItemForm.vue
new file mode 100644
index 0000000..2b07ab6
--- /dev/null
+++ b/src/views/sys/dictionaryItem/DictionaryItemForm.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/sys/dictionaryItem/DictionaryItemList.vue b/src/views/sys/dictionaryItem/DictionaryItemList.vue
new file mode 100644
index 0000000..76eff64
--- /dev/null
+++ b/src/views/sys/dictionaryItem/DictionaryItemList.vue
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ {queryParam = { dictionaryCode: this.$route.params.id }, handleRefresh()}">重置
+
+
+ 新增
+
+
+
+
+
+
+ 修改
+
+ handleDelete(record)">
+ 删除
+
+
+ 详情
+
+
+
+
+
+
+
+
+
From 1147ff416829dbad5fc41ed1ff834d09ff65b2d9 Mon Sep 17 00:00:00 2001
From: "aoli.qu" <408346101@qq.com>
Date: Mon, 23 Aug 2021 15:55:24 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/sys/dictionary.js | 2 +-
src/api/sys/dictionaryItem.js | 2 +-
src/components/Table/index.js | 2 +-
src/config/router.config.js | 2 +-
src/store/modules/user.js | 13 +++++--------
src/store/mutation-types.js | 4 +---
src/utils/request.js | 16 ++++++----------
src/views/sys/dictionary/DictionaryForm.vue | 15 ++++++++++-----
.../sys/dictionaryItem/DictionaryItemForm.vue | 4 ++--
9 files changed, 28 insertions(+), 32 deletions(-)
diff --git a/src/api/sys/dictionary.js b/src/api/sys/dictionary.js
index 2c0d122..0f230a1 100644
--- a/src/api/sys/dictionary.js
+++ b/src/api/sys/dictionary.js
@@ -39,7 +39,7 @@ export function dictionaryDel (params) {
export function dictionaryPage (params) {
return request({
url: dictionaryApi.page,
- method: 'post',
+ method: 'get',
data: params
})
}
diff --git a/src/api/sys/dictionaryItem.js b/src/api/sys/dictionaryItem.js
index 90eefd1..6d744ed 100644
--- a/src/api/sys/dictionaryItem.js
+++ b/src/api/sys/dictionaryItem.js
@@ -39,7 +39,7 @@ export function dictionaryItemDel (params) {
export function dictionaryItemPage (params) {
return request({
url: dictionaryItemApi.page,
- method: 'post',
+ method: 'get',
data: params
})
}
diff --git a/src/components/Table/index.js b/src/components/Table/index.js
index 3e7f68c..9021865 100644
--- a/src/components/Table/index.js
+++ b/src/components/Table/index.js
@@ -136,7 +136,7 @@ export default {
loadData (pagination, filters, sorter) {
this.localLoading = true
const parameter = Object.assign({
- pageIndex: (pagination && pagination.current) ||
+ pageNum: (pagination && pagination.current) ||
this.showPagination && this.localPagination.current || this.pageNum,
pageSize: (pagination && pagination.pageSize) ||
this.showPagination && this.localPagination.pageSize || this.pageSize
diff --git a/src/config/router.config.js b/src/config/router.config.js
index f5d4cc6..35c941d 100644
--- a/src/config/router.config.js
+++ b/src/config/router.config.js
@@ -61,7 +61,7 @@ export const asyncRouterMap = [
path: '/sys/dictionary',
name: 'DictionaryList',
component: () => import('@/views/sys/dictionary/DictionaryList'),
- meta: { title: '数据字段', keepAlive: true }
+ meta: { title: '数据词典', keepAlive: true }
}
]
},
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index a3f5f0a..b90ce57 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,11 +1,11 @@
import storage from 'store'
import { userLogin, getInfo } from '@/api/security/user'
-import { ACCESS_TOKEN, LOGIN_TOKEN } from '@/store/mutation-types'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
import { welcome } from '@/utils/util'
const user = {
state: {
- loginToken: '',
+ token: '',
name: '',
welcome: '',
avatar: '',
@@ -15,7 +15,7 @@ const user = {
mutations: {
SET_TOKEN: (state, token) => {
- state.loginToken = token
+ state.token = token
},
SET_NAME: (state, { name, welcome }) => {
state.name = name
@@ -37,10 +37,8 @@ const user = {
Login ({ commit }, userInfo) {
return new Promise((resolve, reject) => {
userLogin(userInfo).then(response => {
- const result = response.data
- storage.set(LOGIN_TOKEN, result.loginToken, 24 * 60 * 60 * 1000)
- commit('SET_TOKEN', result.loginToken)
- commit('SET_INFO', result)
+ storage.set(ACCESS_TOKEN, response.token, 24 * 60 * 60 * 1000)
+ commit('SET_TOKEN', response.token)
resolve()
}).catch(error => {
reject(error)
@@ -82,7 +80,6 @@ const user = {
return new Promise((resolve) => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
- storage.remove(LOGIN_TOKEN)
storage.remove(ACCESS_TOKEN)
resolve()
})
diff --git a/src/store/mutation-types.js b/src/store/mutation-types.js
index 03055f4..9bcaa35 100644
--- a/src/store/mutation-types.js
+++ b/src/store/mutation-types.js
@@ -1,6 +1,4 @@
-export const ACCESS_TOKEN = 'ACCESS-TOKEN'
-export const LOGIN_TOKEN = 'LOGIN-TOKEN'
-export const TOKEN_NAME = 'Authorization'
+export const ACCESS_TOKEN = 'Authorization'
export const SIDEBAR_TYPE = 'sidebar_type'
export const TOGGLE_MOBILE_TYPE = 'is_mobile'
diff --git a/src/utils/request.js b/src/utils/request.js
index 45e0aa2..1150477 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -3,10 +3,9 @@ import store from '@/store'
import storage from 'store'
import notification from 'ant-design-vue/es/notification'
import { VueAxios } from './axios'
-import { ACCESS_TOKEN, LOGIN_TOKEN, TOKEN_NAME } from '@/store/mutation-types'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
-const DATA_OWNER = 1
-const SUCCESS_CODE = 'ok'
+const SUCCESS_CODE = 200
const INVALID_TOKEN_CODE = '0000'
const toast = (msg, description) => {
@@ -48,20 +47,17 @@ const errorHandler = (error) => {
// request interceptor
request.interceptors.request.use(config => {
- const token = storage.get(ACCESS_TOKEN)
- const loginToken = storage.get(LOGIN_TOKEN)
- // 如果 token 存在
- // 让每个请求携带自定义 token 请根据实际情况自行修改
+ // const token = storage.get(ACCESS_TOKEN)
+ // 由于登录接口待联调,token使用默认值
+ const token = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImU1MmNhNTQ4LThmYmMtNGUyNC1iZjZjLWEzZjgwNDAwMDNiMCJ9._j_AHCd4I_PTWk4mt9euUzlABBoiqsNAIjVGrFJPWv8ZyoqgH9JPs2QFHtoj1Vly8cgtOri8X0ylbttglCcUQQ'
+ // 如果 token 存在,让每个请求携带自定义 token 请根据实际情况自行修改
if (token) {
config.headers[ACCESS_TOKEN] = token
- config.headers[TOKEN_NAME] = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjdhYTViMGZiLTkyOWQtNDhhZS04ODU1LWJkNzM5MjdlOTNiZCJ9.CZzowaB-w2krGpNttPZBNLfq1mw775Lh-sx1K8onfgSwNzA6bw-P7CqC4vgH29xjDv3ey4zEFDzV9pHnrAGrDA'
}
if (config.method === 'post') {
if (!config.data) {
config.data = {}
}
- config.data.dataOwner = DATA_OWNER
- config.data.loginToken = loginToken
}
return config
}, errorHandler)
diff --git a/src/views/sys/dictionary/DictionaryForm.vue b/src/views/sys/dictionary/DictionaryForm.vue
index ab95ddf..359a440 100644
--- a/src/views/sys/dictionary/DictionaryForm.vue
+++ b/src/views/sys/dictionary/DictionaryForm.vue
@@ -1,6 +1,11 @@
-
-
+
+
@@ -18,8 +23,8 @@
取消
保存
-
-
+
+