imatrix-ui 2.7.78-dw → 2.7.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imatrix-ui",
3
- "version": "2.7.78-dw",
3
+ "version": "2.7.78",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
package/src/api/tab.js ADDED
@@ -0,0 +1,30 @@
1
+ const tabJs = {
2
+ addTabs(query, openTab, path, fullpath) {
3
+ let flag = false
4
+ let menuCode
5
+ let menuName
6
+ if (query) {
7
+ menuCode = query._menuCode
8
+ menuName = query._menuName
9
+ }
10
+ if (openTab && menuCode) {
11
+ for (let i = 0; i < openTab.length; i++) {
12
+ const item = openTab[i]
13
+ console.log('item.name', item.name)
14
+
15
+ if (menuCode && item.code === menuCode) {
16
+ console.log('to.path--menuCode1=', menuCode)
17
+ this.$store.commit('set_active_index', menuCode)
18
+ flag = true
19
+ break
20
+ }
21
+ }
22
+ }
23
+ if (!flag && menuCode) {
24
+ console.log('to.path--menuCode2=', menuCode)
25
+ this.$store.commit('add_tabs', { code: menuCode, name: menuName, routePath: path, routeQuery: query, fullpath: fullpath })
26
+ this.$store.commit('set_active_index', menuCode)
27
+ }
28
+ }
29
+ }
30
+ export default tabJs
package/src/i18n/i18n.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Vue from 'vue'
2
- import locale from '@gcommon/gcommon-ui/lib/locale'
2
+ import locale from 'element-ui/lib/locale'
3
3
  import VueI18n from 'vue-i18n'
4
4
  import en from './langs/en'
5
5
  import cn from './langs/cn'
@@ -1,4 +1,4 @@
1
- import zhLocale from '@gcommon/gcommon-ui/lib/locale/lang/zh-CN'
1
+ import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
2
2
  const cn = {
3
3
  imatrixUIPublicModel: {
4
4
  sure: '确定',
@@ -67,7 +67,10 @@ const cn = {
67
67
  invalideDoubleValue: '{num} 不是合法的小数',
68
68
  noJumpPage: '未配置跳转页面',
69
69
  saveSuccessfully: '保存成功',
70
- pleaseInputSearchCondition: '请输入查询条件'
70
+ pleaseInputSearchCondition: '请输入查询条件',
71
+ fileUpload: '文件上传',
72
+ selectYear: '选择年',
73
+ search: '查询'
71
74
  },
72
75
  // 列表组件
73
76
  superGrid: {
@@ -105,7 +108,9 @@ const cn = {
105
108
  selectAll: '全选',
106
109
  viewImage: '查看图片',
107
110
  previewTitleWhenNotImg: '非图片格式,使用其它方式预览',
108
- refresh: '刷新'
111
+ refresh: '刷新',
112
+ open: '展开',
113
+ fold: '收起'
109
114
  },
110
115
  // 部门树组件
111
116
  departmentTree: {
@@ -1,4 +1,4 @@
1
- import enLocale from '@gcommon/gcommon-ui/lib/locale/lang/en'
1
+ import enLocale from 'element-ui/lib/locale/lang/en'
2
2
  const en = {
3
3
  imatrixUIPublicModel: {
4
4
  sure: 'Sure',
@@ -67,7 +67,10 @@ const en = {
67
67
  invalideDoubleValue: '{num} is not a legal decimal',
68
68
  noJumpPage: 'Jump page not configured',
69
69
  saveSuccessfully: 'Savee successfully',
70
- pleaseInputSearchCondition: 'Please enter the query criteria'
70
+ pleaseInputSearchCondition: 'Please enter the query criteria',
71
+ fileUpload: 'File Upload',
72
+ selectYear: 'Select Year',
73
+ search: 'Search'
71
74
  },
72
75
  superGrid: {
73
76
  columnConfig: 'Column Config',
@@ -104,7 +107,9 @@ const en = {
104
107
  selectAll: 'Select All',
105
108
  viewImage: 'View Image',
106
109
  previewTitleWhenNotImg: 'Non picture format, preview in other ways',
107
- refresh: 'Refresh'
110
+ refresh: 'Refresh',
111
+ open: 'Open',
112
+ fold: 'Fold'
108
113
  },
109
114
  departmentTree: {
110
115
 
package/src/permission.js CHANGED
@@ -4,10 +4,10 @@ import { getToken, setToken } from './utils/auth' // 验权
4
4
  import store from './store'
5
5
  import router, { errorRouterMap } from './router'
6
6
  NProgress.configure({ showSpinner: false })// NProgress Configuration
7
- import { Message } from '@gcommon/gcommon-ui'
7
+ import { Message } from 'element-ui'
8
8
  import Vue from 'vue'
9
9
 
10
- const whiteList = ['/login', '/update-password', '/forget-password', '/reset-password', '/redirect', '/login-auto'] // 不重定向白名单
10
+ const whiteList = ['/login', '/update-password', '/forget-password', '/reset-password', '/redirect'] // 不重定向白名单
11
11
  router.beforeEach((to, from, next) => {
12
12
  NProgress.start()
13
13
  console.log('router.beforeEach-to=', to)
@@ -32,7 +32,7 @@ router.beforeEach((to, from, next) => {
32
32
  // console.log('router.beforeEach-getToken()=', token)
33
33
  if (['/update-password', '/forget-password', '/reset-password', '/redirect'].indexOf(to.path) === -1 && token) {
34
34
  if (to.path === '/login') {
35
- next({ path: '/', query: to.query })
35
+ next({ path: '/' })
36
36
  NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
37
37
  } else {
38
38
  console.log('router.beforeEach-to.path!=login')
package/src/plugins.js CHANGED
@@ -3,9 +3,9 @@ import Vue from 'vue'
3
3
  import 'normalize.css/normalize.css' // A modern alternative to CSS resets
4
4
  import './styles/index.scss' // global css
5
5
 
6
- import ElementUI from '@gcommon/gcommon-ui'
7
- import '@gcommon/gcommon-ui/lib/theme-chalk/index.css'
8
- import locale from '@gcommon/gcommon-ui/lib/locale/lang/zh-CN' // lang i18n
6
+ import ElementUI from 'element-ui'
7
+ import 'element-ui/lib/theme-chalk/index.css'
8
+ import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
9
9
 
10
10
  import SuperUI from 'imatrix-ui'
11
11
  import 'imatrix-ui/lib/super-ui.css'
@@ -7,6 +7,8 @@ const getters = {
7
7
  protectedRouters: state => state.permission.protectedRouters,
8
8
  currentUserPermissions: state => state.permission.currentUserPermissions,
9
9
  preventReclick: state => state.app.preventReclick,
10
- menus: state => state.user.menus
10
+ menus: state => state.user.menus,
11
+ openTab: state => state.tabContent.openTab,
12
+ activeIndex: state => state.tabContent.activeIndex
11
13
  }
12
14
  export default getters
@@ -3,6 +3,7 @@ import Vuex from 'vuex'
3
3
  import app from './modules/app'
4
4
  import user from './modules/user'
5
5
  import permission from './modules/permission'
6
+ import tabContent from './modules/tab-content'
6
7
  import getters from './getters'
7
8
 
8
9
  Vue.use(Vuex)
@@ -11,7 +12,8 @@ const store = new Vuex.Store({
11
12
  modules: {
12
13
  app,
13
14
  user,
14
- permission
15
+ permission,
16
+ tabContent
15
17
  },
16
18
  getters
17
19
  })
@@ -0,0 +1,32 @@
1
+ const tabContent = {
2
+ state: {
3
+ openTab: [], // 所有打开的路由
4
+ activeIndex: null // 激活状态
5
+ },
6
+ mutations: {
7
+ // 添加tabs
8
+ add_tabs(state, data) {
9
+ state.openTab.push(data)
10
+ },
11
+ // 删除tabs
12
+ delete_tabs(state, route) {
13
+ let index = 0
14
+ for (const option of state.openTab) {
15
+ if (option.code === route.code) {
16
+ break
17
+ }
18
+ index++
19
+ }
20
+ state.openTab.splice(index, 1)
21
+ },
22
+ // 设置当前激活的tab
23
+ set_active_index(state, index) {
24
+ state.activeIndex = index
25
+ }
26
+ },
27
+ actions: {
28
+
29
+ }
30
+ }
31
+
32
+ export default tabContent
@@ -32,3 +32,20 @@ body .el-table th.gutter {
32
32
  body .el-table colgroup.gutter {
33
33
  display: table-cell !important;
34
34
  }
35
+
36
+
37
+ .card-title{
38
+ width:4px;
39
+ height:22px;
40
+ position: absolute;
41
+ left:0;
42
+ align-items:center;
43
+ text-align:center
44
+ }
45
+
46
+ .card-title-bgc{
47
+ width:4px;
48
+ height:14px;
49
+ display:inline-block;
50
+ background-color:#3081f2
51
+ }
@@ -6,4 +6,21 @@
6
6
  cursor: pointer;
7
7
  }
8
8
 
9
+ .form-list-file {
10
+ color: rgba(0, 0, 0, 0.65);
11
+ background: #F2F6FA;
12
+ border-radius: 6px;
13
+ font-size: 14px;
14
+ cursor: pointer;
15
+ height: 28px;
16
+ line-height: 28px;
17
+ padding: 0 8px 0 8px;
18
+ margin-right: 32px
19
+ }
20
+
21
+ .tip-font {
22
+ color: rgba(0, 0, 0, 0.65);
23
+ font-size: 14px;
24
+ }
25
+
9
26
  }
@@ -1,14 +1,5 @@
1
1
  @import './sidebar.scss';
2
2
  @import './font-style.scss';
3
-
4
- .gray .el-dialog__header {
5
- padding: 10px 10px 10px;
6
- }
7
-
8
- .gray .el-dialog__body {
9
- padding: 10px 10px;
10
- }
11
-
12
3
  .gray {
13
4
  font-family: microsoft yahei, Arial, Helvetica, sans-serif;
14
5
  font-size: 14px;
@@ -75,16 +66,23 @@
75
66
 
76
67
  //main-container全局样式
77
68
  .app-main {
78
- min-height: 100%
69
+ min-height: 100%;
70
+ background: #f7f7f8;
79
71
  }
80
72
 
81
73
  .app-container {
82
- padding: 20px;
74
+ // padding: 20px;
75
+ padding: 0px;
76
+ .box-card {
77
+ margin: 16px 24px 24px 24px;
78
+ .el-card__body {
79
+ padding-top: 16px;
80
+ }
81
+ }
83
82
  }
84
83
 
85
84
  .operation-area {
86
- margin-bottom: 10px;
87
- height: 40px;
85
+ margin-bottom: 16px;
88
86
  }
89
87
 
90
88
  .form-container {
@@ -133,56 +131,20 @@
133
131
  .el-tree-node.is-current>.el-tree-node__content {
134
132
  background-color: #c2d6ea !important;
135
133
  }
136
-
137
- // .el-pagination {
138
- // background: #fff;
139
- // text-align: center;
140
- // padding: 5px 0;
141
- // color: #777;
142
- // }
143
-
144
- // .el-pager li.active {
145
- // color: #4A4A4A;
146
- // background: #FBE997;
147
- // border-radius: 50px;
148
- // }
149
-
150
- // .el-table td,
151
- // .el-table th {
152
- // padding: 10px 0;
153
- // min-width: 0;
154
- // -webkit-box-sizing: border-box;
155
- // box-sizing: border-box;
156
- // text-overflow: ellipsis;
157
- // vertical-align: middle;
158
- // position: relative;
159
- // text-align: left
160
- // }
161
-
162
- // .el-table--enable-row-hover .el-table__body tr:hover>td {
163
- // background-color: #FFF3CB
164
- // }
165
-
166
- // .el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
167
- // .el-table__body tr.current-row>td,
168
- // .el-table__body tr.hover-row.current-row>td,
169
- // .el-table__body tr.hover-row.el-table__row--striped.current-row>td,
170
- // .el-table__body tr.hover-row.el-table__row--striped>td,
171
- // .el-table__body tr.hover-row>td {
172
- // background-color: #FFF3CB
173
- // }
174
-
175
- // .el-table th {
176
- // background-color: #eee;
177
- // color: #555
178
- // }
179
-
180
- // // 列表表头整个都有背景色
181
- // .el-table .el-table__header-wrapper {
182
- // background: #eee;
183
- // }
184
134
  .menu-tab-container .el-tabs__item {
185
135
  height: 48px;
186
136
  line-height: 48px;
187
137
  }
138
+
139
+ //顶部标签字体样式
140
+ .menu-tab-container .el-tabs__item.is-active{
141
+ color:#3D4cf2;
142
+ }
143
+ //顶部标签样式
144
+ .menu-tab-container .el-tabs__active-bar{
145
+ background-color: #3D4cf2;
146
+ }
147
+ .el-pagination {
148
+ text-align: right;
149
+ }
188
150
  }
@@ -117,6 +117,18 @@ export function openPage(pageSetting) {
117
117
  }
118
118
  }
119
119
 
120
+ // 附加参数中是否设值了ID参数。如果添加了id参数,则不需要自动添加dataId参数
121
+ function isHasIdAdditionalParam(jumpPageAdditional) {
122
+ if (jumpPageAdditional && jumpPageAdditional.length > 0) {
123
+ for (let i = 0; i < jumpPageAdditional.length; i++) {
124
+ const item = jumpPageAdditional[i]
125
+ if (item.paramName && (item.paramName === 'id' || item.paramName === 'ID')) {
126
+ return true
127
+ }
128
+ }
129
+ }
130
+ }
131
+
120
132
  // 页面跳转处理,api方法;additionalParamMap是上个页面传过来的附加参数集合;
121
133
  // isFromChart 是否是从chart方面来,如果是,则弹窗和刷新页面都用winows方式打开
122
134
  export function jumpToPage(jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode, parentFormData) {
@@ -138,6 +150,7 @@ export function jumpToPage(jumpPageSetting, system, dataId, entity, additionalPa
138
150
  paramMap.additionalParamMap = additionalParamMap
139
151
  console.log('paramMap.parentFormData', parentFormData)
140
152
  paramMap.parentFormData = parentFormData
153
+ const isHasIdParam = isHasIdAdditionalParam(jumpPageSetting.jumpPageAdditional)
141
154
 
142
155
  Vue.prototype.$http.post(paramPath, paramMap).then((result) => {
143
156
  let paramStoreId = ''
@@ -147,13 +160,13 @@ export function jumpToPage(jumpPageSetting, system, dataId, entity, additionalPa
147
160
  }
148
161
  jumpPageSetting.paramStoreId = paramStoreId
149
162
  // 存入缓存
150
- jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode).then(openPageParams => {
163
+ jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode, isHasIdParam).then(openPageParams => {
151
164
  // openPageParams:xxx弹框打开页面时需要的参数 或 刷新页面时路由查询参数
152
165
  resolve(openPageParams)
153
166
  })
154
167
  })
155
168
  } else {
156
- jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode).then(openPageParams => {
169
+ jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode, false).then(openPageParams => {
157
170
  // openPageParams:xxx弹框打开页面时需要的参数 或 刷新页面时路由查询参数
158
171
  resolve(openPageParams)
159
172
  })
@@ -204,7 +217,7 @@ function isFullPath(path) {
204
217
  return path.indexOf('http:') === 0 || path.indexOf('https:') === 0
205
218
  }
206
219
  // 正式跳转
207
- function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode) {
220
+ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode, isHasIdParam) {
208
221
  return new Promise((resolve, reject) => {
209
222
  const jumpPageUrl = jumpPageSetting.jumpPageUrl
210
223
  if (!jumpPageUrl) {
@@ -212,7 +225,7 @@ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode) {
212
225
  }
213
226
  if (jumpPageUrl.indexOf('page:') === 0) {
214
227
  // 表示是自定义系统跳转页面编码
215
- jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode).then((openPageParams) => {
228
+ jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode, isHasIdParam).then((openPageParams) => {
216
229
  resolve(openPageParams)
217
230
  })
218
231
  } else {
@@ -230,7 +243,7 @@ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode) {
230
243
  const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
231
244
  path = frontendUrl + '/#' + path
232
245
  }
233
- jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPageSetting, ids, buttonCode)
246
+ jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPageSetting, ids, buttonCode, isHasIdParam)
234
247
  resolve()
235
248
  }
236
249
  })
@@ -242,8 +255,8 @@ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode) {
242
255
  * @param {*} additionalParameterStr
243
256
  * @param {*} jumpPage
244
257
  */
245
- function jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPage, ids, buttonCode) {
246
- path = packagePathParams(dataId, path, jumpPage, ids, buttonCode)
258
+ function jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPage, ids, buttonCode, isHasIdParam) {
259
+ path = packagePathParams(dataId, path, jumpPage, ids, buttonCode, isHasIdParam)
247
260
  // 保持这种情况参数传递,是为了解决不同域时获得不到sessionStorage中存的附加参数问题
248
261
  if (additionalParameterStr && additionalParameterStr !== '') {
249
262
  if (path.indexOf('?') !== -1) {
@@ -289,9 +302,9 @@ function jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPage,
289
302
  }
290
303
 
291
304
  // path封装参数
292
- function packagePathParams(dataId, path, jumpPage, ids, buttonCode) {
305
+ function packagePathParams(dataId, path, jumpPage, ids, buttonCode, isHasIdParam) {
293
306
  if (jumpPage.isNeedId === undefined || jumpPage.isNeedId === null || jumpPage.isNeedId === true) {
294
- if (dataId) {
307
+ if (!isHasIdParam && dataId) {
295
308
  // 表示是修改或查看页面,封装id参数
296
309
  let paramSeparator = '?'
297
310
  if (path.indexOf('?') > 0) {
@@ -339,7 +352,7 @@ function getPageCode(jumpPageUrl) {
339
352
  return pageCode
340
353
  }
341
354
  // 使用页面组件内部调整
342
- function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode) {
355
+ function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode, isHasIdParam) {
343
356
  return new Promise((resolve, reject) => {
344
357
  // 表示是自定义系统跳转页面编码
345
358
  console.log('----jumpWithSuperPage---', jumpPageUrl, system, dataId, jumpPageSetting)
@@ -355,14 +368,14 @@ function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, bu
355
368
  }
356
369
  sessionStorage.setItem(pageCode + '-jumpMode', JSON.stringify(jumpJsonData))
357
370
  if (jumpMode === 'popup') {
358
- const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode)
371
+ const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode, isHasIdParam)
359
372
  // 页面布局中的按钮打开
360
373
  const popPageSetting = openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode, ids, buttonCode)
361
374
  popPageSetting._path = path
362
375
  resolve(popPageSetting)
363
376
  } else if (jumpMode === 'newTab') {
364
377
  // 新页签打开
365
- const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode)
378
+ const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode, isHasIdParam)
366
379
  window.open(path)
367
380
  resolve()
368
381
  } else {
@@ -375,7 +388,7 @@ function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, bu
375
388
  ids: ids ? ids.join(',') : ''
376
389
  }
377
390
  if (jumpPageSetting.isNeedId === undefined || jumpPageSetting.isNeedId === null || jumpPageSetting.isNeedId === true) {
378
- if (dataId) {
391
+ if (!isHasIdParam && dataId) {
379
392
  // 表示是修改或查看页面,封装id参数
380
393
  queryParam.id = dataId
381
394
  }
@@ -384,7 +397,7 @@ function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, bu
384
397
  if (paramStoreId && paramStoreId !== '') {
385
398
  queryParam['paramStoreId'] = paramStoreId
386
399
  }
387
- const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode)
400
+ const path = packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode, isHasIdParam)
388
401
  queryParam._path = path
389
402
  resolve(queryParam)
390
403
  }
@@ -432,10 +445,10 @@ function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode
432
445
  return popPageSetting
433
446
  }
434
447
 
435
- function packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode) {
448
+ function packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode, isHasIdParam) {
436
449
  const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
437
450
  const path = frontendUrl + '/#/dsc-full-screen/page?customSystem=' + system.code + '&pageCode=' + pageCode + '&jumpMode=' + jumpMode
438
- return packagePathParams(dataId, path, jumpPageSetting, ids, buttonCode)
451
+ return packagePathParams(dataId, path, jumpPageSetting, ids, buttonCode, isHasIdParam)
439
452
  }
440
453
 
441
454
  // 解析跳转页面附带参数
@@ -1,7 +1,7 @@
1
1
  import axios from 'axios'
2
2
  import {
3
3
  Message
4
- } from '@gcommon/gcommon-ui'
4
+ } from 'element-ui'
5
5
  import {
6
6
  getToken,
7
7
  removeToken
package/src/views/404.vue CHANGED
@@ -8,18 +8,18 @@
8
8
  <img class="pic-404__child right" src="@/assets/404/404-cloud.png" alt="404">
9
9
  </div>
10
10
  <div class="bullshit">
11
- <div class="bullshit__oops">
12
- OOPS!
11
+ <div class="bullshit__oops">
12
+ OOPS!
13
13
  </div>
14
- <div class="bullshit__info">
14
+ <div class="bullshit__info">
15
15
  版权所有
16
16
  <a class="link-type" href="https://wallstreetcn.com" target="_blank">华尔街见闻</a>
17
17
  </div>
18
- <div class="bullshit__headline">
19
- {{ message }}
18
+ <div class="bullshit__headline">
19
+ {{ message }}
20
20
  </div>
21
- <div class="bullshit__info">
22
- 请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告
21
+ <div class="bullshit__info">
22
+ 请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告
23
23
  </div>
24
24
  <a href="" class="bullshit__return-home">返回首页</a>
25
25
  </div>
@@ -0,0 +1,58 @@
1
+ <script>
2
+ export default {
3
+ name: 'MenuItem',
4
+ functional: true,
5
+ props: {
6
+ icon: {
7
+ type: String,
8
+ default: ''
9
+ },
10
+ title: {
11
+ type: String,
12
+ default: ''
13
+ },
14
+ hasChildren: {
15
+ type: Boolean,
16
+ default: false
17
+ },
18
+ isRoot: {
19
+ type: Boolean,
20
+ default: false
21
+ }
22
+ },
23
+ render(h, context) {
24
+ let icon = context.props.icon
25
+ const { title, hasChildren, isRoot } = context.props
26
+ const vnodes = []
27
+
28
+ if (icon) {
29
+ if (icon.indexOf('fa-') === 0) {
30
+ // 表示以“fa-”开头,使用font-awesome中的图标
31
+ icon = 'fa ' + icon
32
+ }
33
+ icon += ' svg-icon'
34
+ vnodes.push(<div style='display: inline-block;'><i class={icon}/></div>)
35
+ }
36
+
37
+ if (title) {
38
+ let width = '130px'
39
+ if (hasChildren) {
40
+ // 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
41
+ width = '100px'
42
+ }
43
+ if (isRoot) {
44
+ // 是否是根目录,没有子菜单时
45
+ vnodes.push(<div style='display: inline-block'>
46
+ <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
47
+ </div>)
48
+ } else {
49
+ // 有子菜单时
50
+ vnodes.push(<div slot='title' style='display: inline-block'>
51
+ <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
52
+ </div>)
53
+ }
54
+ }
55
+ return vnodes
56
+ }
57
+ }
58
+ </script>
@@ -0,0 +1,31 @@
1
+
2
+ <template>
3
+ <div>
4
+ <!-- eslint-disable vue/require-component-is-->
5
+ <!-- <a v-if="isExter" :href="to.path" target="_blank" rel="noopener">
6
+ <slot />
7
+ </a> -->
8
+
9
+ <router-link :to="to">
10
+ <slot />
11
+ </router-link>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+
17
+ export default {
18
+ props: {
19
+ to: {
20
+ type: Object,
21
+ required: true
22
+ }
23
+ },
24
+ data() {
25
+ const isExter = this.to.isExternal
26
+ return {
27
+ isExter
28
+ }
29
+ }
30
+ }
31
+ </script>