qj-common 4.2.1 → 4.2.3

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": "4.2.1",
3
+ "version": "4.2.3",
4
4
  "description": "common files && template for qj-paas",
5
5
  "scripts": {
6
6
  "gulp": "gulp css"
package/src/permission.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import main from '#/main';
3
3
 
4
4
  // White List
5
- const whiteList = [`b2b.heidelbergchina.com`,`uatb2b.heidelbergchina.com`];
5
+ const whiteList = [`b2b.heidelbergchina.com`, `uatb2b.heidelbergchina.com`];
6
6
 
7
7
  // Executor
8
8
  main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgress, PageNotFound, domCreate, interceptor, queryParams, getActiveMenu, generateRoutesFromMenu }) => {
@@ -30,7 +30,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
30
30
  }
31
31
 
32
32
  // Dispatch GetAppInfo
33
- store.dispatch('GetAppInfo').then(res => {
33
+ store.dispatch('GetAppInfo').then((res) => {
34
34
  // Get App Path
35
35
  const appPath = process.env.APP_PATH;
36
36
 
@@ -46,7 +46,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
46
46
  if (menuList) {
47
47
  // Current Routes
48
48
  if (menuList.routerMap[appPath]) {
49
- return menuList.routerMap[appPath].forEach(el => {
49
+ return menuList.routerMap[appPath].forEach((el) => {
50
50
  handleRouter(el.children);
51
51
  });
52
52
  }
@@ -56,10 +56,10 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
56
56
  }
57
57
 
58
58
  // No Storage
59
- store.dispatch('GetAppRouter').then(menuList => {
59
+ store.dispatch('GetAppRouter').then((menuList) => {
60
60
  // Current Routes
61
61
  if (menuList.routerMap[appPath]) {
62
- return menuList.routerMap[appPath].forEach(el => {
62
+ return menuList.routerMap[appPath].forEach((el) => {
63
63
  handleRouter(el.children);
64
64
  });
65
65
  }
@@ -87,7 +87,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
87
87
  const menu = {};
88
88
 
89
89
  // Set Menu
90
- menuList && menuList.forEach(element => (menu[element.proappModelCode] = element.children));
90
+ menuList && menuList.forEach((element) => (menu[element.proappModelCode] = element.children));
91
91
 
92
92
  // Set Code
93
93
  menuCode(menuList);
@@ -101,7 +101,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
101
101
  return;
102
102
  }
103
103
 
104
- data.forEach(item => {
104
+ data.forEach((item) => {
105
105
  if (item.menuCode === 'P0000111') {
106
106
  return window.sessionStorage.setItem('menuAction', item.menuAction);
107
107
  }
@@ -153,10 +153,10 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
153
153
  const noneLayout = [];
154
154
 
155
155
  // Check Action by Preset
156
- data.forEach(e => (menuActions.includes(e.menuAction) ? noneLayout.push(e) : dataLayout.push(e)));
156
+ data.forEach((e) => (menuActions.includes(e.menuAction) ? noneLayout.push(e) : dataLayout.push(e)));
157
157
 
158
158
  // Check First for No Data
159
- noneLayout.forEach(item => {
159
+ noneLayout.forEach((item) => {
160
160
  // 只做一级
161
161
  menus.push({
162
162
  path: '/' + item.menuAction,
@@ -228,30 +228,56 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
228
228
  if (!proappEnvLayout) {
229
229
  return;
230
230
  }
231
-
232
- // Extension Link of 1 ?
233
- const link = document.getElementsByTagName('link')[1];
234
-
231
+ let arr = document.getElementsByTagName('link') || [];
232
+ let link, head;
235
233
  // Get Head
236
- const head = document.getElementsByTagName('head')[0];
237
-
238
- // Set Href of Link
239
- link.href = '';
240
- link.href = proappEnvLayout.proappEnvIconUrl;
241
-
242
- // Extension Metas
243
- const keywords = domCreate('meta', {
244
- name: 'keywords',
245
- content: proappEnvLayout.proappEnvDes,
246
- });
234
+ if (Array.isArray(arr)) {
235
+ head = document.getElementsByTagName('head')[0];
236
+ // Extension Metas
237
+ const keywords = domCreate('meta', {
238
+ name: 'keywords',
239
+ content: proappEnvLayout.proappEnvDes,
240
+ });
247
241
 
248
- const description = domCreate('meta', {
249
- name: 'description',
250
- content: proappEnvLayout.proappEnvDes,
251
- });
242
+ const description = domCreate('meta', {
243
+ name: 'description',
244
+ content: proappEnvLayout.proappEnvDes,
245
+ });
252
246
 
253
- // Insert
254
- head.appendChild(keywords);
255
- head.appendChild(description);
247
+ // Insert
248
+ head.appendChild(keywords);
249
+ head.appendChild(description);
250
+ }
251
+ if (Array.isArray(arr) && arr.length > 1) {
252
+ // Extension Link of 1 ?
253
+ link = document.getElementsByTagName('link')[1];
254
+ // Set Href of Link
255
+ link.href = '';
256
+ link.href = proappEnvLayout.proappEnvIconUrl;
257
+ }
258
+ // // Extension Link of 1 ?
259
+ // const link = document.getElementsByTagName('link')[1];
260
+
261
+ // // Get Head
262
+ // const head = document.getElementsByTagName('head')[0];
263
+
264
+ // // Set Href of Link
265
+ // link.href = '';
266
+ // link.href = proappEnvLayout.proappEnvIconUrl;
267
+
268
+ // // Extension Metas
269
+ // const keywords = domCreate('meta', {
270
+ // name: 'keywords',
271
+ // content: proappEnvLayout.proappEnvDes,
272
+ // });
273
+
274
+ // const description = domCreate('meta', {
275
+ // name: 'description',
276
+ // content: proappEnvLayout.proappEnvDes,
277
+ // });
278
+
279
+ // // Insert
280
+ // head.appendChild(keywords);
281
+ // head.appendChild(description);
256
282
  });
257
283
  });
@@ -3,9 +3,9 @@
3
3
  <h3 class="template-title" v-if="title">
4
4
  <p>{{ title }}</p>
5
5
  </h3>
6
- <el-form v-if="temInputPack" :model="ruleForm" :rules="rules ? rules : {}" ref="ruleForm" :label-width="labelWidth ? labelWidth : '10rem'" class="demo-ruleForm">
6
+ <el-form v-if="temInput" :model="ruleForm" :rules="rules ? rules : {}" ref="ruleForm" :label-width="labelWidth ? labelWidth : '10rem'" class="demo-ruleForm">
7
7
  <el-form-item
8
- v-for="(item, index) in temInputPack"
8
+ v-for="(item, index) in temInput"
9
9
  :key="index"
10
10
  v-if="('state' in item ? item.state : true) && ('btnArray' in item ? true : 'label' in item)"
11
11
  :label="'label' in item && ('state' in item ? item.state : true) ? item.label + ':' : ''"
@@ -121,7 +121,7 @@ import tempSelect from './components/temp-select';
121
121
  import tempUpload from './components/temp-upload';
122
122
  const querystring = require('querystring');
123
123
  export default {
124
- props: ['temInputPack', 'rules', 'labelWidth', 'tabState', 'title'],
124
+ props: ['temInput', 'rules', 'labelWidth', 'tabState', 'title'],
125
125
  components: {
126
126
  tempSelect,
127
127
  tempUpload,
@@ -194,7 +194,7 @@ export default {
194
194
  setReset() {
195
195
  //数据重置
196
196
  this.$refs['ruleForm'].resetFields();
197
- this.temInputPack.forEach((el) => {
197
+ this.temInput.forEach((el) => {
198
198
  if ('label' in el) {
199
199
  if (el.type === 'cascader') {
200
200
  el.value = [];
@@ -220,7 +220,7 @@ export default {
220
220
  this.tabState.value = this.ruleForm[this.tabState.name];
221
221
  for (let i in this.tabState.dataTemplate) {
222
222
  if (i === this.tabState.value) {
223
- this.temInputPack.forEach((el) => {
223
+ this.temInput.forEach((el) => {
224
224
  if ('state' in el) {
225
225
  if (this.tabState.dataTemplate[i].includes(el.name)) {
226
226
  el.state = true; //是否显示
@@ -248,7 +248,7 @@ export default {
248
248
  if (valid) {
249
249
  if (url) {
250
250
  let data = JSON.parse(JSON.stringify(this.ruleForm)); //去除数据的双向绑定
251
- this.temInputPack.forEach((el) => {
251
+ this.temInput.forEach((el) => {
252
252
  if ('label' in el) {
253
253
  if (el.type === 'cascader') {
254
254
  if (el.value.length > 0) {
@@ -316,7 +316,7 @@ export default {
316
316
  selChange(val, item) {
317
317
  //select选中的事件
318
318
  console.log(item, '目前选中的值');
319
- console.log(this.temInputPack);
319
+ console.log(this.temInput);
320
320
  this.$emit('selChange', val, item);
321
321
  },
322
322
  },
@@ -324,8 +324,8 @@ export default {
324
324
  ruleForm: {
325
325
  get() {
326
326
  let ruleForm = {};
327
- // console.log(this.temInputPack, "ccccccccccccccc");
328
- this.temInputPack.forEach((el) => {
327
+ // console.log(this.temInput, "ccccccccccccccc");
328
+ this.temInput.forEach((el) => {
329
329
  if ('state' in el) {
330
330
  el.state && el.name ? this.$set(ruleForm, el.name, el.value) : '';
331
331
  } else {
@@ -549,7 +549,7 @@
549
549
  <template-input
550
550
  :labelWidth="dialogData.template.labelWidth"
551
551
  :rules="dialogData.template.rules"
552
- :temInputPack="dialogData.template.html"
552
+ :temInput="dialogData.template.html"
553
553
  @cancel="dialogCancel"
554
554
  @getData="getDataList"
555
555
  @handleSelect="handleSelect"