bi-element-ui 1.6.3-beta.10 → 1.6.3-beta.12

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bi-element-ui",
3
- "version": "1.6.3-beta.10",
3
+ "version": "1.6.3-beta.12",
4
4
  "private": false,
5
5
  "description": "基于 bi-eleme 编写的企业级 Vue 2 UI 组件库",
6
6
  "main": "lib/bi-element-ui-externals.common.js",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var accessReport_1 = require("../utils/request/accessReport");
3
+ var accessReport_1 = require("../utils/request/defaultRequest");
4
4
  var AccessReport = /** @class */ (function () {
5
5
  function AccessReport(_a) {
6
6
  var _b = _a.system, system = _b === void 0 ? '' : _b, _c = _a.authorization, authorization = _c === void 0 ? '' : _c, _d = _a.env, env = _d === void 0 ? 'production' : _d;
@@ -1,4 +1,4 @@
1
- import request from '../utils/request/accessReport'
1
+ import request from '../utils/request/defaultRequest'
2
2
  class AccessReport {
3
3
  systemName = ''
4
4
  authorization = ''
@@ -76,8 +76,7 @@
76
76
  </template>
77
77
 
78
78
  <script>
79
- import request from '../../utils/request/exportDownload'
80
- import { getCurrentEnvURL } from '../../config/index'
79
+ import request from '../../utils/request/index.js'
81
80
  import Box from './Box'
82
81
  import TaskCenterBox from '../../TaskCenter/Box.vue'
83
82
  export default {
@@ -115,19 +114,15 @@ export default {
115
114
  downloadingImg: 'https://wanxiaomeng-1255977238.file.myqcloud.com/bi-element-ui/DownloadCenter/downloadingnew.gif',
116
115
  drawerVisible: false,
117
116
  badgeDot: false,
118
- baseUrl: '',
119
117
  tabsName: ''
120
118
  }
121
119
  },
122
- mounted() {
123
- this.baseUrl = getCurrentEnvURL(this.$BI.env || '').downloadCenter.baseUrl
124
- // this.readSignTask()
125
- },
126
120
  methods: {
127
121
  getExportList(params) {
128
122
  return request({
129
- url: this.baseUrl + '/task/index',
130
- method: 'post',
123
+ env: this.$BI.env,
124
+ system: 'export',
125
+ api: '/task/index',
131
126
  data: Object.assign({ origin_system: this.system }, params)
132
127
  })
133
128
  },
@@ -149,9 +149,7 @@
149
149
  <script>
150
150
  // import WebSocketClass from '../../WebSocket'
151
151
  import { diffTime } from '../../utils/time/index'
152
- import { getServiceURL } from '../../config/index'
153
- import request from '../../utils/request/noticeCenter'
154
- import { getToken } from '../../utils/tools'
152
+ import request from '../../utils/request/index.js'
155
153
  export default {
156
154
  name: 'BiNoticeCenter',
157
155
  props: {
@@ -187,8 +185,7 @@ export default {
187
185
  noticeListLoading: false,
188
186
  noMore: false,
189
187
  detailData: {},
190
- noticeList: [],
191
- baseUrl: ''
188
+ noticeList: []
192
189
  }
193
190
  },
194
191
  computed: {
@@ -197,7 +194,6 @@ export default {
197
194
  }
198
195
  },
199
196
  mounted() {
200
- this.baseUrl = getServiceURL('noticeCenter', this.$BI.env || '')
201
197
  this.noticeList = []
202
198
  this.last_id = ''
203
199
  this.last_send_time = ''
@@ -227,13 +223,10 @@ export default {
227
223
  },
228
224
  async noticePoped(msg_id) {
229
225
  await request({
230
- url: this.baseUrl + '/admin/message/setPopup',
231
- headers: {
232
- Authtoken: getToken()
233
- },
234
- method: 'post',
226
+ env: this.$BI.env,
227
+ system: 'service_center',
228
+ api: '/api/admin/message/setPopup',
235
229
  data: {
236
- token: getToken(),
237
230
  system: this.system,
238
231
  msg_id
239
232
  }
@@ -241,11 +234,9 @@ export default {
241
234
  },
242
235
  async initUnreadNum() {
243
236
  const res = await request({
244
- url: this.baseUrl + '/admin/message/getUnreadNum',
245
- headers: {
246
- Authtoken: getToken()
247
- },
248
- method: 'post',
237
+ env: this.$BI.env,
238
+ system: 'service_center',
239
+ api: '/api/admin/message/getUnreadNum',
249
240
  data: {
250
241
  system: this.system
251
242
  }
@@ -265,11 +256,9 @@ export default {
265
256
  async getNoticeList() {
266
257
  this.noticeListLoading = true
267
258
  const res = await request({
268
- url: this.baseUrl + '/admin/message/getSystemMessage',
269
- headers: {
270
- Authtoken: getToken()
271
- },
272
- method: 'post',
259
+ env: this.$BI.env,
260
+ system: 'service_center',
261
+ api: '/api/admin/message/getSystemMessage',
273
262
  data: {
274
263
  system: this.system,
275
264
  last_id: this.last_id,
@@ -302,11 +291,9 @@ export default {
302
291
  },
303
292
  async handleNoticeRead(msg_id) {
304
293
  const res = await request({
305
- url: this.baseUrl + '/admin/message/read',
306
- headers: {
307
- Authtoken: getToken()
308
- },
309
- method: 'post',
294
+ env: this.$BI.env,
295
+ system: 'service_center',
296
+ api: '/api/admin/message/read',
310
297
  data: {
311
298
  system: this.system,
312
299
  msg_id
@@ -321,11 +308,9 @@ export default {
321
308
  },
322
309
  async noticeAllRead() {
323
310
  await request({
324
- url: this.baseUrl + '/admin/message/isReadAll',
325
- headers: {
326
- Authtoken: getToken()
327
- },
328
- method: 'post',
311
+ env: this.$BI.env,
312
+ system: 'service_center',
313
+ api: '/api/admin/message/isReadAll',
329
314
  data: {
330
315
  system: this.system,
331
316
  type: 'system'
@@ -36,8 +36,7 @@
36
36
  </template>
37
37
 
38
38
  <script>
39
- import { getCurrentEnvURL } from '../../config/index'
40
- import request from '../../utils/request/defaultRequest'
39
+ import request from '../../utils/request/index.js'
41
40
  import { getToken } from '../../utils/tools'
42
41
 
43
42
  export default {
@@ -45,24 +44,19 @@ export default {
45
44
  props: {},
46
45
  data() {
47
46
  return {
48
- systemList: [],
49
- baseUrl: ''
47
+ systemList: []
50
48
  }
51
49
  },
52
50
  mounted() {
53
- this.baseUrl = getCurrentEnvURL(this.$BI.env || '').zhangquan.baseUrl
54
-
55
51
  // this.getZqToken()
56
52
  this.getSystemList()
57
53
  },
58
54
  methods: {
59
55
  async getSystemList() {
60
56
  const res = await request({
61
- url: this.baseUrl + '/index/system',
62
- headers: {
63
- 'authkey': 'authtpe84dzfl3iq62'
64
- },
65
- method: 'post'
57
+ env: this.$BI.env,
58
+ system: 'zq',
59
+ api: '/api/index/system'
66
60
  })
67
61
  if (res.status_code === 1) {
68
62
  this.systemList = res.data
@@ -1,6 +1,5 @@
1
1
  import { getSystem, getEnv } from '../../utils/tools'
2
- import { getCurrentEnvURL } from '../../config/index'
3
- import request from '../../utils/request/defaultRequest'
2
+ import request from '../../utils/request/index.js'
4
3
 
5
4
  export default class HeaderPopper {
6
5
  constructor(moduleName) {
@@ -9,7 +8,6 @@ export default class HeaderPopper {
9
8
  this.module = moduleName || ''
10
9
  this.system = getSystem()
11
10
  this.$BiEnv = getEnv()
12
- this.baseUrl = getCurrentEnvURL(this.$BiEnv || '').zhangquan.baseUrl
13
11
  if (this.module) {
14
12
  this.getPopperList()
15
13
  }
@@ -23,11 +21,9 @@ export default class HeaderPopper {
23
21
 
24
22
  async getPopperList() {
25
23
  const res = await request({
26
- url: this.baseUrl + '/common/table_head/list',
27
- method: 'post',
28
- headers: {
29
- System: this.system
30
- },
24
+ env: this.$BI.env,
25
+ system: 'zq',
26
+ api: '/common/table_head/list',
31
27
  data: {
32
28
  module: this.module
33
29
  }
@@ -54,11 +50,9 @@ export default class HeaderPopper {
54
50
  obj.id = params.id
55
51
  }
56
52
  request({
57
- url: this.baseUrl + '/common/table_head/save',
58
- method: 'post',
59
- headers: {
60
- System: this.system
61
- },
53
+ env: this.$BI.env,
54
+ system: 'zq',
55
+ api: '/common/table_head/save',
62
56
  data: obj
63
57
  }).then((res) => {
64
58
  if (res.status_code === 1) {
@@ -71,11 +65,9 @@ export default class HeaderPopper {
71
65
 
72
66
  async delPopperItem(id) {
73
67
  return request({
74
- url: this.baseUrl + '/common/table_head/del',
75
- method: 'post',
76
- headers: {
77
- System: this.system
78
- },
68
+ env: this.$BI.env,
69
+ system: 'zq',
70
+ api: '/common/table_head/del',
79
71
  data: {
80
72
  id
81
73
  }
@@ -150,7 +150,6 @@
150
150
 
151
151
  <script>
152
152
  import { taskOption, taskList } from './api'
153
- import { getServiceURL } from '../config/index'
154
153
  export default {
155
154
  name: 'TaskCenterShow',
156
155
  props: {
@@ -225,8 +224,7 @@ export default {
225
224
  showInfo: {
226
225
  visible: false,
227
226
  info: ''
228
- },
229
- baseUrl: ''
227
+ }
230
228
  }
231
229
  },
232
230
  computed: {
@@ -245,7 +243,6 @@ export default {
245
243
  }
246
244
  },
247
245
  mounted() {
248
- this.baseUrl = getServiceURL('noticeCenter', this.$BI.env || '')
249
246
  this.handlerOpen()
250
247
  },
251
248
  methods: {
@@ -267,7 +264,7 @@ export default {
267
264
  this.search()
268
265
  },
269
266
  async getOption() {
270
- const res = await taskOption(this.baseUrl)
267
+ const res = await taskOption(this.$BI.env)
271
268
  if (res.status_code === 1) {
272
269
  this.taskStatus = res.data.task_status
273
270
  this.taskType = res.data.task_types
@@ -294,7 +291,7 @@ export default {
294
291
  async getList(params = this.params) {
295
292
  this.loading = true
296
293
  // taskList
297
- const res = await taskList(this.baseUrl, params)
294
+ const res = await taskList(this.$BI.env, params)
298
295
  this.loading = false
299
296
  if (res.status_code === 1) {
300
297
  this.tableData = res.data.data
@@ -1,15 +1,19 @@
1
- import request from '../utils/request/noticeCenter'
2
- export const taskOption = (baseUrl) => {
1
+ // import request from '../utils/request/noticeCenter'
2
+ import request from '../utils/request/index.js'
3
+
4
+ export const taskOption = (env = 'production') => {
3
5
  return request({
4
- url: baseUrl + '/admin/task/option',
5
- method: 'get'
6
+ env: env,
7
+ system: 'service_center',
8
+ api: '/api/admin/task/option'
6
9
  })
7
10
  }
8
11
 
9
- export const taskList = (baseUrl, data) => {
12
+ export const taskList = (env, data) => {
10
13
  return request({
11
- url: baseUrl + '/admin/task/taskMessages',
12
- method: 'post',
13
- data
14
+ env: env,
15
+ system: 'service_center',
16
+ api: '/api/admin/task/taskMessages',
17
+ data: data
14
18
  })
15
19
  }
@@ -2,7 +2,6 @@
2
2
  * 环境配置管理
3
3
  * 支持的环境: development, dev, staging, stage, production, prod, release
4
4
  */
5
-
6
5
  // 基础环境常量
7
6
  const ENV_TYPES = {
8
7
  DEVELOPMENT: 'development',
@@ -26,26 +25,26 @@ const ENV_ALIASES = {
26
25
  const BASE_URLS = {
27
26
  [ENV_TYPES.DEVELOPMENT]: {
28
27
  noticeCenterWebsocket: { baseUrl: 'wss://message.wanqudianchi.com/' },
29
- noticeCenter: { baseUrl: '/scenter-dev' },
30
- downloadCenter: { baseUrl: '/export-dev' },
28
+ noticeCenter: { baseUrl: '/zhangquan-dev' },
29
+ downloadCenter: { baseUrl: '/zhangquan-dev' },
31
30
  zhangquan: { baseUrl: '/zhangquan-dev' }
32
31
  },
33
32
  [ENV_TYPES.STAGING]: {
34
33
  noticeCenterWebsocket: { baseUrl: 'wss://message.wanqudianchi.com/' },
35
- noticeCenter: { baseUrl: 'https://scenter.zwwlkj03.top/api' },
36
- downloadCenter: { baseUrl: 'https://export.zwwlkj03.top' },
34
+ noticeCenter: { baseUrl: 'https://zq.zwwlkj03.top/api' },
35
+ downloadCenter: { baseUrl: 'https://zq.zwwlkj03.top/api' },
37
36
  zhangquan: { baseUrl: 'https://zq.zwwlkj03.top/api' }
38
37
  },
39
38
  [ENV_TYPES.PRODUCTION]: {
40
39
  noticeCenterWebsocket: { baseUrl: 'wss://message.zwnet.cn/' },
41
- noticeCenter: { baseUrl: 'https://scenter.wozhangwan.com/api' },
42
- downloadCenter: { baseUrl: 'https://export.wozhangwan.com' },
40
+ noticeCenter: { baseUrl: 'https://zq.wozhangwan.com/api' },
41
+ downloadCenter: { baseUrl: 'https://zq.wozhangwan.com/api' },
43
42
  zhangquan: { baseUrl: 'https://zq.wozhangwan.com/api' }
44
43
  },
45
44
  [ENV_TYPES.RELEASE]: {
46
45
  noticeCenterWebsocket: { baseUrl: 'wss://message.wanqudianchi.com/' },
47
- noticeCenter: { baseUrl: 'https://scenter.zwwlkj03.top/api' },
48
- downloadCenter: { baseUrl: 'https://export.zwwlkj03.top' },
46
+ noticeCenter: { baseUrl: 'https://zq.zwwlkj03.top/api' },
47
+ downloadCenter: { baseUrl: 'https://zq.zwwlkj03.top/api' },
49
48
  zhangquan: { baseUrl: 'https://zq.zwwlkj03.top/api' }
50
49
  }
51
50
  }
@@ -89,7 +88,7 @@ const getCurrentEnvURL = (env = 'production') => {
89
88
  */
90
89
  const getServiceURL = (service, env = 'production') => {
91
90
  const config = getCurrentEnvURL(env)
92
- return (config[service] && config[service].baseUrl) || ''
91
+ return config['zhangquan'].baseUrl || ''
93
92
  }
94
93
 
95
94
  // 兼容性:保持原有的URLConfig导出
package/packages/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import './styles/index.scss'
2
2
  import Cookies from 'js-cookie'
3
+ import pkg from '../package.json'
4
+
3
5
  // 导入button组件
4
6
  import BiTable from './Table'
5
7
  import BiCustomColumn from './CustomColumn'
@@ -38,62 +40,62 @@ const components = [BiTable, BiCustomColumn, BiDatePicker, BiDownloadCenter, BiM
38
40
  // =============================================
39
41
  // 依赖检查机制 - 运行时检查必要的外部依赖
40
42
  // =============================================
41
- const checkDependencies = () => {
42
- const requiredDeps = [
43
- { name: 'Vue', global: 'Vue', package: 'vue@^2.6.0' },
44
- { name: 'ELEMENT', global: 'ELEMENT', package: 'bi-eleme@^2.4.5' },
45
- { name: 'moment', global: 'moment', package: 'moment@^2.29.4' },
46
- { name: 'md5', global: 'md5', package: 'md5@^2.3.0' }
47
- ]
48
-
49
- const missingDeps = []
50
-
51
- // 检查每个必要依赖
52
- requiredDeps.forEach((dep) => {
53
- try {
54
- // 尝试 require (CommonJS/Node环境)
55
- if (typeof require !== 'undefined') {
56
- // 使用 webpack 注释来忽略动态 require 警告
57
- // eslint-disable-next-line
58
- require(dep.name.toLowerCase())
59
- } else if (typeof window !== 'undefined' && !window[dep.global]) {
60
- // 检查全局变量 (浏览器环境)
61
- missingDeps.push(dep)
62
- }
63
- } catch (e) {
64
- // 在 ES 模块环境下,如果模块不存在会抛出错误
65
- if (e.code === 'MODULE_NOT_FOUND' || e.message.includes('Cannot resolve module')) {
66
- missingDeps.push(dep)
67
- }
68
- }
69
- })
70
-
71
- // 如果有缺失的依赖,显示友好的错误信息
72
- if (missingDeps.length > 0) {
73
- const depList = missingDeps.map((dep) => ` - ${dep.package}`).join('\n')
74
- const errorMsg = `
75
- 🚨 bi-element-ui: 缺少必要的依赖项
76
-
77
- 请安装以下依赖项:
78
- ${depList}
79
-
80
- 安装命令:
81
- npm install ${missingDeps.map((d) => d.package.split('@')[0]).join(' ')}
82
-
83
- 或者使用完整版本:
84
- import BiElementUI from 'bi-element-ui/full'
85
-
86
- 更多信息请查看: https://github.com/your-repo/bi-element-ui#installation
87
- `
88
-
89
- console.error(errorMsg)
90
-
91
- // 在开发环境下抛出错误,生产环境下只警告
92
- if (process.env.NODE_ENV === 'development') {
93
- throw new Error('bi-element-ui: Missing required dependencies')
94
- }
95
- }
96
- }
43
+ // const checkDependencies = () => {
44
+ // const requiredDeps = [
45
+ // { name: 'Vue', global: 'Vue', package: 'vue@^2.6.0' },
46
+ // { name: 'ELEMENT', global: 'ELEMENT', package: 'bi-eleme@^2.4.5' },
47
+ // { name: 'moment', global: 'moment', package: 'moment@^2.29.4' },
48
+ // { name: 'md5', global: 'md5', package: 'md5@^2.3.0' }
49
+ // ]
50
+
51
+ // const missingDeps = []
52
+
53
+ // // 检查每个必要依赖
54
+ // requiredDeps.forEach((dep) => {
55
+ // try {
56
+ // // 尝试 require (CommonJS/Node环境)
57
+ // if (typeof require !== 'undefined') {
58
+ // // 使用 webpack 注释来忽略动态 require 警告
59
+ // // eslint-disable-next-line
60
+ // require(dep.name.toLowerCase())
61
+ // } else if (typeof window !== 'undefined' && !window[dep.global]) {
62
+ // // 检查全局变量 (浏览器环境)
63
+ // missingDeps.push(dep)
64
+ // }
65
+ // } catch (e) {
66
+ // // 在 ES 模块环境下,如果模块不存在会抛出错误
67
+ // if (e.code === 'MODULE_NOT_FOUND' || e.message.includes('Cannot resolve module')) {
68
+ // missingDeps.push(dep)
69
+ // }
70
+ // }
71
+ // })
72
+
73
+ // // 如果有缺失的依赖,显示友好的错误信息
74
+ // if (missingDeps.length > 0) {
75
+ // const depList = missingDeps.map((dep) => ` - ${dep.package}`).join('\n')
76
+ // const errorMsg = `
77
+ // 🚨 bi-element-ui: 缺少必要的依赖项
78
+
79
+ // 请安装以下依赖项:
80
+ // ${depList}
81
+
82
+ // 安装命令:
83
+ // npm install ${missingDeps.map((d) => d.package.split('@')[0]).join(' ')}
84
+
85
+ // 或者使用完整版本:
86
+ // import BiElementUI from 'bi-element-ui/full'
87
+
88
+ // 更多信息请查看: https://github.com/your-repo/bi-element-ui#installation
89
+ // `
90
+
91
+ // console.error(errorMsg)
92
+
93
+ // // 在开发环境下抛出错误,生产环境下只警告
94
+ // if (process.env.NODE_ENV === 'development') {
95
+ // throw new Error('bi-element-ui: Missing required dependencies')
96
+ // }
97
+ // }
98
+ // }
97
99
 
98
100
  // 仅在外部依赖版本中进行检查,且不在开发环境中
99
101
  // 在浏览器环境中,我们假设依赖已经正确安装
@@ -185,5 +187,6 @@ export default {
185
187
  BiIcon,
186
188
  BiSuperDate,
187
189
  BiTextEditor,
188
- BiFireworks
190
+ BiFireworks,
191
+ version: pkg.version
189
192
  }
@@ -2,7 +2,6 @@ import axios from 'axios'
2
2
  import { Message } from 'bi-eleme'
3
3
  import { getCSFToken } from '../tools'
4
4
  // create an axios instance
5
-
6
5
  const service = axios.create({
7
6
  baseURL: '', // url = base url + request url
8
7
  // withCredentials: true, // send cookies when cross-domain requests
@@ -0,0 +1,28 @@
1
+ import defaultRequest from './defaultRequest.js'
2
+ import { getServiceURL } from '../../config/index'
3
+
4
+ export default function request({ env = 'production', system, api, data }) {
5
+ const baseUrl = getServiceURL('', env)
6
+ if (system === 'zq') {
7
+ return defaultRequest({
8
+ url: baseUrl + api,
9
+ method: 'post',
10
+ headers: {
11
+ authkey: 'authtpe84dzfl3iq62'
12
+ },
13
+ data: data
14
+ })
15
+ }
16
+ return defaultRequest({
17
+ url: baseUrl + '/api/cross_system/request',
18
+ method: 'post',
19
+ headers: {
20
+ authkey: 'authtpe84dzfl3iq62'
21
+ },
22
+ data: {
23
+ system: system,
24
+ api: api,
25
+ params: data
26
+ }
27
+ })
28
+ }
@@ -1,22 +1,20 @@
1
- import request from '../request/defaultRequest'
2
- import { getCurrentEnvURL } from '../../config/index'
1
+ import request from '../request/index.js'
3
2
 
4
- function getIconUrl(character, baseUrl) {
3
+ function getIconUrl(character, env) {
5
4
  return request({
6
- url: baseUrl + '/data/system/getInfo',
7
- method: 'post',
5
+ env: env,
6
+ system: 'zq',
7
+ api: '/data/system/getInfo',
8
8
  data: {
9
9
  character
10
10
  }
11
11
  })
12
12
  }
13
- function getIconList(baseUrl) {
13
+ function getIconList(env) {
14
14
  return request({
15
- headers: {
16
- AuthKey: 'authtpe84dzfl3iq62'
17
- },
18
- url: baseUrl + '/api/icon/list',
19
- method: 'post'
15
+ env: env,
16
+ system: 'zq',
17
+ api: '/api/icon/list'
20
18
  })
21
19
  }
22
20
 
@@ -26,9 +24,7 @@ function loadScript(url) {
26
24
  document.head.appendChild(script)
27
25
  }
28
26
  export function loadSvg(character, env) {
29
- const baseUrl = getCurrentEnvURL(env || '').zhangquan.baseUrl
30
-
31
- getIconUrl(character, baseUrl).then((res) => {
27
+ getIconUrl(character, env).then((res) => {
32
28
  if (res.status_code === 1 && res.data.icon_url) {
33
29
  setTimeout(() => {
34
30
  loadScript(res.data.icon_url)
@@ -37,8 +33,7 @@ export function loadSvg(character, env) {
37
33
  })
38
34
  }
39
35
  export function loadIcon(env, callback) {
40
- const baseUrl = getCurrentEnvURL(env || '').zhangquan.baseUrl
41
- getIconList(baseUrl).then((res) => {
36
+ getIconList(env).then((res) => {
42
37
  if (res.status_code === 1) {
43
38
  callback(res.data)
44
39
  setTimeout(() => {