qj-common 5.0.0 → 5.0.1

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": "qj-common",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "common files && template for qj-paas",
5
5
  "scripts": {
6
6
  "gulp": "gulp css"
@@ -15,4 +15,4 @@
15
15
  "not ie <= 8"
16
16
  ],
17
17
  "license": "MIT"
18
- }
18
+ }
package/src/permission.js CHANGED
@@ -43,7 +43,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
43
43
  }
44
44
 
45
45
  // Menu from Storage
46
- if (menuList) {
46
+ if (menuList && menuList.routerMap) {
47
47
  // Current Routes
48
48
  if (menuList.routerMap[appPath]) {
49
49
  return menuList.routerMap[appPath].forEach((el) => {
@@ -58,7 +58,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
58
58
  // No Storage
59
59
  store.dispatch('GetAppRouter').then((menuList) => {
60
60
  // Current Routes
61
- if (menuList.routerMap[appPath]) {
61
+ if (menuList.routerMap && menuList.routerMap[appPath]) {
62
62
  return menuList.routerMap[appPath].forEach((el) => {
63
63
  handleRouter(el.children);
64
64
  });
@@ -97,8 +97,15 @@ const user = {
97
97
  }).catch()
98
98
  }
99
99
  },
100
- GetAppRouter: function () {
100
+ GetAppRouter: function next() {
101
101
  return getTopPerMenuListFPc().then(function (res) {
102
+ if(!Array.isArray(res.menuList)){
103
+ localStorage.removeItem('saas-token')
104
+ localStorage.removeItem('saasToken')
105
+ sessionStorage.removeItem('menuList')
106
+ next();
107
+ return
108
+ }
102
109
  if (res.menuList) {
103
110
  window.sessionStorage.setItem('menuList', JSON.stringify(res))
104
111
  if (!res) {
@@ -190,9 +190,10 @@ service.interceptors.request.use(
190
190
  // if (getLocalStorage('saas-token')) {
191
191
  // config.headers['saas-token'] = getLocalStorage('saas-token');
192
192
  // }
193
- if (window.qs && window.qs['saas-token']) {
194
- config.headers['saas-token'] = window.qs['saas-token']
195
- } else if (getQueryString('saas-token')) {
193
+ // if (window.qs && window.qs['saas-token']) {
194
+ // config.headers['saas-token'] = window.qs['saas-token']
195
+ // } else
196
+ if (getQueryString('saas-token')) {
196
197
  config.headers['saas-token'] = getQueryString('saas-token');
197
198
  console.log('saas-token', getQueryString('saas-token'));
198
199
  } else if (getLocalStorage('saas-token')) {
@@ -6,7 +6,7 @@ let globalObj = {
6
6
  proappEnvLayout: window.sessionStorage.getItem('proappEnvLayout'),
7
7
  manager: ['index', 'pc-static', 'pc-mall', 'points-manager', 'consult-manager', 'message-manager', 'user-manager', 'order-manager', 'invoice-manager', 'promotion-manager','b2b-cli-pc-ayd'],
8
8
  };
9
- // timer();
9
+ timer();
10
10
 
11
11
  function timer() {
12
12
  globalObj.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout');
@@ -367,6 +367,7 @@
367
367
  :reserve-selection="temTablePack.reserve_selection ? true : false"
368
368
  type="selection"
369
369
  v-if="'selection' in temTablePack ? temTablePack.selection.state : false"
370
+ :selectable="selectable ? selectable : () => { return true}"
370
371
  width="40"
371
372
  ></el-table-column>
372
373
  <el-table-column
@@ -615,7 +616,7 @@ const querystring = require('querystring');
615
616
  import { isUndefined } from 'lodash';
616
617
  import { parseTime } from '#/utils/index'; //时间格式化
617
618
  export default {
618
- props: ['temInput', 'params', 'temTable', 'temPage', 'temTab', 'url', 'temPageLayout', 'subtotal'],
619
+ props: ['temInput', 'params', 'selectable', 'temTable', 'temPage', 'temTab', 'url', 'temPageLayout', 'subtotal'],
619
620
  computed: {
620
621
  temInputPack() {
621
622
  if (!this.temInput) {
@@ -1305,21 +1306,21 @@ export default {
1305
1306
  });
1306
1307
  }
1307
1308
  }
1308
- } else if (res && res.rows) {
1309
- this.tableData = res.rows;
1309
+ } else if (res && res.list) {
1310
+ this.tableData = res.list;
1310
1311
  if (this.temPage !== false) {
1311
1312
  this.pagenation.total = res.total;
1312
1313
  }
1313
- this.tableData = res.rows;
1314
- this.$emit('getData', res.rows);
1314
+ this.tableData = res.list;
1315
+ this.$emit('getData', res.list);
1315
1316
  this.$emit('getTotal', res.total);
1316
1317
  // 小计
1317
- if (res.rows.length > 0) {
1318
+ if (res.list.length > 0) {
1318
1319
  if (this.subtotal && this.subtotal.length > 0) {
1319
1320
  this.subtotal.forEach((el) => {
1320
1321
  el.value = 0;
1321
1322
  if (el.name) {
1322
- res.rows.forEach((res) => {
1323
+ res.list.forEach((res) => {
1323
1324
  el.value = this.accAdd(el.value, Number(res[el.name]));
1324
1325
  el.value = el.value.toFixed(2);
1325
1326
  });