imatrix-ui 2.9.8-dw → 2.9.8-pv2

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.9.8-dw",
3
+ "version": "2.9.8-pv2",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
@@ -6,7 +6,7 @@ import {
6
6
  import nineGridStore from '../super-nine-grid/src/store'
7
7
  import {
8
8
  Message
9
- } from '@gcommon/gcommon-ui'
9
+ } from 'element-ui'
10
10
  import {
11
11
  packageEnumAndBeanColumnValueSets
12
12
  } from '../utils/value-set'
@@ -6,7 +6,7 @@ import {
6
6
  import nineGridStore from '../super-nine-grid/src/store'
7
7
  import {
8
8
  Message
9
- } from '@gcommon/gcommon-ui'
9
+ } from 'element-ui'
10
10
  import {
11
11
  packageEnumAndBeanColumnValueSets
12
12
  } from '../utils/value-set'
@@ -41,7 +41,7 @@
41
41
  type="yearRange"
42
42
  @change="setYearRangeValue(column.prop,$event)"
43
43
  />
44
- <el-g-date-picker
44
+ <el-date-picker
45
45
  v-else-if="column.componentType==='dateTimePicker'"
46
46
  :value="getFormItemValue(column.prop)"
47
47
  :default-time="getDefaultTime(column)"
@@ -1346,86 +1346,51 @@ export default {
1346
1346
  gridParams.options.subTableData &&
1347
1347
  gridParams.options.subTableData.length > 0
1348
1348
  ) {
1349
- this.packageSubTableData(gridParams, gridParams.options.subTableData)
1350
- } else {
1351
- const isCanRefreshTableData = this.canRefreshTableData(gridParams)
1352
- if (isCanRefreshTableData) {
1353
- // 可以刷新表格记录
1354
- return this.fetchListData(searchParam, isSearch, parentRowIds, resove)
1355
- } else {
1356
- // 子表无记录时不需要刷新子表记录。表示是新建或修改时子表无记录,且不需要刷新子表。
1357
- if (
1358
- this.isSubTableEmpty(gridParams)
1359
- ){
1360
- // 表示是新建表单时,子表记录集合是空数组
1361
- console.log('子表无记录----code=', this.code, gridParams)
1362
- const subTableData = []
1363
- this.packageSubTableData(gridParams,subTableData)
1349
+ this.hasLoadData = false
1350
+ gridParams.loaded = true
1351
+ let subTableData = []
1352
+ // 如果有子表数据,则展示传递的子表数据
1353
+ if (isHasOptionFunction('gridDataLoaded', this.code)) {
1354
+ const gridData = gridParams.options.gridDataLoaded.call(this, {
1355
+ gridData: gridParams.options.subTableData,
1356
+ columns: gridParams.columns
1357
+ })
1358
+ if (gridData) {
1359
+ subTableData = gridData
1360
+ this.hasLoadData = true
1361
+ } else {
1362
+ subTableData = gridParams.options.subTableData
1363
+ this.hasLoadData = true
1364
1364
  }
1365
+ } else {
1366
+ subTableData = gridParams.options.subTableData
1365
1367
  this.hasLoadData = true
1366
- gridParams.loaded = true
1367
1368
  }
1368
- }
1369
- }
1370
- },
1371
- isSubTableEmpty (gridParams) {
1372
- return gridParams.options && gridParams.options.isFormSubTable &&
1373
- ((gridParams.options.subTableData === undefined || gridParams.options.subTableData === null) ||
1374
- gridParams.options.subTableData.length === 0)
1375
- },
1376
- packageSubTableData(gridParams, initSubTableData) {
1377
- this.hasLoadData = false
1378
- gridParams.loaded = true
1379
- let subTableData = []
1380
- // 如果有子表数据,则展示传递的子表数据
1381
- if (isHasOptionFunction('gridDataLoaded', this.code)) {
1382
- const gridData = gridParams.options.gridDataLoaded.call(this, {
1383
- gridData: initSubTableData,
1384
- columns: gridParams.columns
1385
- })
1386
- if (gridData) {
1387
- subTableData = gridData
1388
- this.hasLoadData = true
1369
+ if (subTableData) {
1370
+ // 子表时所有记录的所有字段设置默认值null,优化子表编辑时性能
1371
+ subTableData.forEach(item => {
1372
+ this.setColumnsDefaultValue(gridParams.allColumns, item)
1373
+ })
1374
+ }
1375
+ if (this.pagination && this.isSubTableShowPage === true) {
1376
+ // 表示子表需要显示分页
1377
+ this.subTableData = subTableData
1378
+ // 更新记录总条数
1379
+ this.pagination.total = this.subTableData.length
1380
+ gridParams.subTableData = this.subTableData
1381
+ this.gridData = this.getSubTableGridData(this.subTableData)
1382
+ } else {
1383
+ this.gridData = subTableData
1384
+ }
1385
+ gridParams.gridData = this.gridData
1386
+ // 完成深拷贝,复制一份对象,行编辑时使用
1387
+ gridParams.orgGridData = [].concat(
1388
+ JSON.parse(JSON.stringify(this.gridData))
1389
+ )
1389
1390
  } else {
1390
- subTableData = initSubTableData
1391
- this.hasLoadData = true
1391
+ return this.fetchListData(searchParam, isSearch, parentRowIds, resove)
1392
1392
  }
1393
- } else {
1394
- subTableData = initSubTableData
1395
- this.hasLoadData = true
1396
- }
1397
- if (subTableData) {
1398
- // 子表时所有记录的所有字段设置默认值null,优化子表编辑时性能
1399
- subTableData.forEach(item => {
1400
- this.setColumnsDefaultValue(gridParams.allColumns, item)
1401
- })
1402
- }
1403
- if (this.pagination && this.isSubTableShowPage === true) {
1404
- // 表示子表需要显示分页
1405
- this.subTableData = subTableData
1406
- // 更新记录总条数
1407
- this.pagination.total = this.subTableData.length
1408
- gridParams.subTableData = this.subTableData
1409
- this.gridData = this.getSubTableGridData(this.subTableData)
1410
- } else {
1411
- this.gridData = subTableData
1412
- }
1413
- gridParams.gridData = this.gridData
1414
- // 完成深拷贝,复制一份对象,行编辑时使用
1415
- gridParams.orgGridData = [].concat(
1416
- JSON.parse(JSON.stringify(this.gridData))
1417
- )
1418
- },
1419
- canRefreshTableData (gridParams) {
1420
- let isCanRefreshTableData = false
1421
- if (gridParams.options && !gridParams.options.isFormSubTable) {
1422
- // 如果不是子表时
1423
- isCanRefreshTableData = true
1424
- } else if (gridParams.options && gridParams.options.isFormSubTable && gridParams.options.canRrefreshSubtableData !== undefined && gridParams.options.canRrefreshSubtableData === true) {
1425
- // 是子表,且配置了子表无记录时更新子表记录集合
1426
- isCanRefreshTableData = true
1427
1393
  }
1428
- return isCanRefreshTableData
1429
1394
  },
1430
1395
  getSubTableGridData(subTableData) {
1431
1396
  let gridData = subTableData
@@ -2052,7 +2017,6 @@ export default {
2052
2017
  handleSizeChange(val) {
2053
2018
  if (!this.options || !this.options.isPageShow) {
2054
2019
  // console.log(`每页 ${val} 条`)
2055
- this.currentPage = 1
2056
2020
  this.pageSize = val
2057
2021
  this.changePage()
2058
2022
  }
@@ -27,15 +27,21 @@
27
27
  </el-col>
28
28
  <el-col v-for="(params,index) in gridData" :key="params.id" :span="6" :offset="1.5" class="col-content">
29
29
  <el-card :body-style="{ padding: '0px' }" shadow="hover">
30
- <div @mouseenter="enter(index)" @mouseleave="leave()" @click="clickContent(params)">
30
+ <!-- <div @mouseenter="enter(index)" @mouseleave="leave()" @click="clickContent(params)"> -->
31
+ <div @click="clickContent(params)">
31
32
  <transition name="fade">
32
- <div v-if="seen && index === current" class="popContainer">
33
- <div class="else-button">
33
+ <!-- <div v-if="seen && index === current" class="popContainer"> -->
34
+ <div class="popContainer">
35
+ <div class="else-button" style="background: rgba(0,0,0,0.5); min-height: 20%;">
36
+ <!-- <div class="else-button" style="min-height: 20%;"> -->
37
+ <slot :name="slotBefore" :params="params" />
34
38
  <template v-for="button in operations">
35
39
  <template v-if="isShowButton(params, button)">
36
40
  <el-tooltip v-if="button.icon" :key="button.name" v-permission="button.permission?button.permission:'true'" class="item" effect="dark" :content="button.name" placement="top">
41
+ <!-- <em style="color: black;" :class="button.icon +' icons'" @click.stop="buttonClick(button.event, params)" /> -->
37
42
  <em :class="button.icon +' icons'" @click.stop="buttonClick(button.event, params)" />
38
43
  </el-tooltip>
44
+ <!-- <em v-else :key="button.name" v-permission="button.permission?button.permission:'true'" style="color: black;" :class="button.name +' icons'" @click.stop="buttonClick(button.event, params)">{{ button.name }} </em> -->
39
45
  <em v-else :key="button.name" v-permission="button.permission?button.permission:'true'" :class="button.name +' icons'" @click.stop="buttonClick(button.event, params)">{{ button.name }} </em>
40
46
  </template>
41
47
  </template>
@@ -160,7 +166,7 @@
160
166
  width: 23.15%;
161
167
  display: block;
162
168
  height: 200px;
163
- background: rgba(0,0,0,0.5);
169
+ // background: rgba(0,0,0,0.5);
164
170
  text-align: right;
165
171
  }
166
172
  .fade-enter-active, .fade-leave-active {
@@ -280,7 +286,8 @@ export default {
280
286
  storeId,
281
287
  currentId: null, // 当前点击的记录id
282
288
  isShowRadio, // 单选时是否显示单选按钮
283
- titleStyle: null // 标题的样式对象,格式为:{ color: 'green', fontWeight: 'bold'}
289
+ titleStyle: null, // 标题的样式对象,格式为:{ color: 'green', fontWeight: 'bold'}
290
+ slotBefore: 'before'
284
291
  }
285
292
  },
286
293
  computed: {
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: '确定',
@@ -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',
package/src/permission.js CHANGED
@@ -4,7 +4,7 @@ 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
10
  const whiteList = ['/login', '/update-password', '/forget-password', '/reset-password', '/redirect'] // 不重定向白名单
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'
@@ -9,8 +9,8 @@
9
9
  @import './theme/blue2/sidebar.scss';
10
10
  @import './theme/gray/index.scss';
11
11
  @import './theme/gray/sidebar.scss';
12
- // @import './theme/dark-blue/index.scss';
13
- // @import './theme/dark-blue/sidebar.scss';
12
+ @import './theme/dark-blue/index.scss';
13
+ @import './theme/dark-blue/sidebar.scss';
14
14
  @import './display-layout.scss';
15
15
 
16
16
  body {
@@ -79,11 +79,8 @@
79
79
  }
80
80
 
81
81
  .el-menu {
82
- position: static;
83
82
  border: none;
84
- // height: 100%;
85
- height: auto;
86
- max-height: 100vh;
83
+ height: 100%;
87
84
  width: 100% !important;
88
85
  background-color: #FFF;
89
86
  color: #000D1F
@@ -191,22 +188,13 @@
191
188
  }
192
189
  }
193
190
 
194
- .sidebar-container-popper .el-menu{
195
- // height: 100vh;
196
- height: auto;
197
- max-height: 100vh;
198
- overflow-y: auto;
199
- overflow-x: hidden;
200
- scroll-behavior: smooth;
201
- }
202
-
203
191
  .sidebar-container-popper .el-submenu__title:not(.is-disabled):hover {
204
192
  background: #F7F7F8;
205
193
  color: rgba(0, 13, 31, 0.85);
206
194
  font-weight: 500;
207
195
  }
208
196
 
209
- .sidebar-container-popper .el-menu-item.is-active,.sidebar-container-popper .el-menu .el-submenu.is-active>.el-submenu__title {
197
+ .sidebar-container-popper .el-menu .el-submenu.is-active>.el-submenu__title {
210
198
  background-color: #EBECFF !important;
211
199
  color: #3D4CF2;
212
200
  font-weight: 500;
@@ -1,7 +1,5 @@
1
1
  import sessionStorage from 'sessionstorage'
2
2
  import Vue from 'vue'
3
- import authApi from './auth-api'
4
- import { getToken } from './auth'
5
3
  /**
6
4
  * 获得相对地址
7
5
  */
@@ -171,7 +169,7 @@ export function isPlateSys(systemCode) {
171
169
  systemCode === 'mms' || systemCode === 'task' ||
172
170
  systemCode === 'wf' || systemCode === 'dc' ||
173
171
  systemCode === 'mc' || systemCode === 'mobile' ||
174
- systemCode === 'acs' || systemCode === 'bs' || systemCode === 'pcm')) {
172
+ systemCode === 'acs' || systemCode === 'bs')) {
175
173
  return true
176
174
  } else {
177
175
  return false
@@ -225,90 +223,3 @@ export function getTimeZone() {
225
223
  }
226
224
  return timeZone
227
225
  }
228
-
229
- export function isMobileBrowser() {
230
- if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Opera Mobi|Windows CE|Symbian|Windows Phone|POLARIS|lgtelecom|nokia|SonyEricsson|LG|SAMSUNG|Samsung/i
231
- .test(navigator.userAgent)) {
232
- //移动端浏览器
233
- return true
234
- } else {
235
- //PC浏览器
236
- return false
237
- }
238
- }
239
-
240
- export function getLocaleByLang(lang) {
241
- let locale = 'cn'
242
- if (lang && lang.indexOf('_') > 0) {
243
- const language = lang.substring(0, lang.indexOf('_'))
244
- locale = language
245
- }
246
- if (locale === 'zh') {
247
- locale = 'cn'
248
- }
249
- return locale
250
- }
251
-
252
- const langKey = 'AMB_LANG_INFO'
253
-
254
- export function cacheLangs(langs) {
255
- let langResult
256
- if(langs) {
257
- langResult = JSON.stringify(langs)
258
- }
259
- return authApi.setCookieCache(langKey,langResult)
260
- }
261
-
262
- export function getLangs() {
263
- return authApi.getCookieCache(langKey)
264
- }
265
- /**
266
- *
267
- * @param {*} langShort 例如:cn或en
268
- * @returns 例如:zh_CN或en_US
269
- */
270
- export function getLangByShort(langShort) {
271
- let lang
272
- const langResultJson = getLangs()
273
- if(langResultJson){
274
- const langObj = JSON.parse(langResultJson)
275
- lang = langObj[langShort]
276
- }
277
- if(!lang){
278
- lang = 'zh_CN'
279
- }
280
- return lang
281
- }
282
-
283
- // 首次加载业务系统时,缓存所有语言
284
- export function cacheAllLanguagesUtil(http) {
285
- return new Promise((resolve, reject) => {
286
- const token = getToken()
287
- if (token) {
288
- http.get(Vue.prototype.baseAPI + '/component/all-languages').then((langList) => {
289
- const langResult = {}
290
- if (langList) {
291
- langList.forEach(item => {
292
- // 例如:zh_CN、en_US
293
- const lang = item.value
294
- let langShort
295
- if (lang.indexOf('_') > 0) {
296
- langShort = lang.substring(0, lang.indexOf('_'))
297
- }
298
- if (langShort && langShort === 'zh') {
299
- // 中文处理,为了兼容历史逻辑
300
- langShort = 'cn'
301
- }
302
- if (langShort) {
303
- langResult[langShort] = lang
304
- }
305
- })
306
- }
307
- cacheLangs(langResult)
308
- resolve()
309
- })
310
- } else {
311
- resolve()
312
- }
313
- })
314
- }
@@ -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/utils/util.js CHANGED
@@ -3,7 +3,6 @@ import Vue from 'vue'
3
3
  import {
4
4
  executeExpression
5
5
  } from './calculator/calculator-util'
6
- import { getLangByShort } from './common-util'
7
6
  export function getI18n() {
8
7
  if (!window.$locale) {
9
8
  i18n.locale = 'cn'
@@ -14,11 +13,12 @@ export function getI18n() {
14
13
  }
15
14
 
16
15
  export function getLanguageWithLocale() {
17
- let currentLocale = window.$locale
18
- if (!currentLocale || currentLocale === 'zh') {
19
- currentLocale = 'cn'
16
+ const currentLocale = window.$locale
17
+ if (currentLocale && currentLocale === 'en') {
18
+ return 'en_US'
19
+ } else {
20
+ return 'zh_CN'
20
21
  }
21
- return getLangByShort(currentLocale)
22
22
  }
23
23
  /**
24
24
  * 根据动态数据源获得下拉选的选项集合
@@ -8,7 +8,7 @@
8
8
  </app-link>
9
9
  </template>
10
10
 
11
- <el-submenu v-else :index="resolvePath(item.code,item.path,item.pageType)" :show-timeout="0" :hide-timeout="50" :popper-append-to-body="false" popper-class="sidebar-container-popper">
11
+ <el-submenu v-else :index="resolvePath(item.code,item.path,item.pageType)" :show-timeout="0" :hide-timeout="50" popper-class="sidebar-container-popper">
12
12
  <template v-slot:title>
13
13
  <item :icon="item.iconName" :title="getI18nName(item)" :has-children="item.children.length > 0?true:false" />
14
14
  </template>
@@ -41,7 +41,7 @@
41
41
  </template>
42
42
 
43
43
  <script>
44
- import { Message } from '@gcommon/gcommon-ui'
44
+ import { Message } from 'element-ui'
45
45
  export default {
46
46
  name: 'Login',
47
47
  data() {