jufubao-admin-library 1.1.7 → 1.1.8

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.
@@ -0,0 +1,218 @@
1
+ 'use strict';
2
+
3
+ const settings = {
4
+
5
+ /**
6
+ * @description 阿里云前端监控配置
7
+ */
8
+ aliPid: 'aa2vphu6tr@f7f6bac23dcef56',
9
+ aliEnvironment: 'daily', //daily测试环境 //prod线上环境
10
+ aliSample: 1, //1表示100%采样,10表示10%采样,100表示1%采样
11
+ aliPvSample: 1, //1表示100%采样,10表示10%采样,100表示1%采样
12
+ aliDisableHook: true, //是否禁用api上报 true=禁用 false=开启
13
+ aliBehavior: true, //是否为了便于排查错误而记录报错的用户行为。
14
+ aliEnableSPA: false, //是否启动单页面上报pv日志
15
+ aliEnableConsole: false, //是否劫持Console
16
+ aliSendResource: true, //静态资源错误上报
17
+ aliAutoSendPerf: true, //性能和api分析日志
18
+
19
+ /**
20
+ * @type {string}
21
+ * @description 项目名称
22
+ */
23
+ title: '供货商后台管理系统(测试)',
24
+
25
+ /**
26
+ * @type {boolean}
27
+ * @description 无返回结构体{code: 200, data: {}, message:'success'},返回格式:{}
28
+ */
29
+ isOpenNoResultKey: true,
30
+
31
+ /**
32
+ * @type {string}
33
+ * @description 项目标识
34
+ */
35
+ system: 'supplier',
36
+
37
+ /**
38
+ * @type {string}
39
+ * @description 图片cdn域名地址
40
+ */
41
+ cdnBaseUrl: '//sandbox-img.jufubao.cn',
42
+
43
+ /**
44
+ * @type {Array}
45
+ * @description API白名单(不需要token,上报日志)
46
+ */
47
+ apiWhiteList: [
48
+ '/api/pb/host/get-brand',
49
+ '/api/pb/host/minfo',
50
+ '/api/pb/host/malert',
51
+ ],
52
+
53
+ /**
54
+ * @type {Number}
55
+ * @description 接口返回时间超时上报日志(单位:毫秒)
56
+ */
57
+ apiDelay: 10000,
58
+
59
+ /**
60
+ * @type {string}
61
+ * @description 百度AK
62
+ */
63
+ baiduAK: 'btKt57MWjMx2P1ds2OjZIttLOOjR2Ndf',
64
+
65
+ /**
66
+ * @type Function
67
+ * @description 页面layout页面路径
68
+ */
69
+ layout: () => import('@/layout'),
70
+
71
+
72
+ /**
73
+ * @type {boolean}
74
+ * @description 是否启用本地演示路由配置
75
+ */
76
+ isOpenLocalDemoRouter: false,
77
+
78
+ /**
79
+ * @type { Array }
80
+ * @description 不验证登录状态
81
+ */
82
+ whiteList:[
83
+ '/login'
84
+ ],
85
+
86
+ /**
87
+ * @description 用户登录页面
88
+ * @type {String}
89
+ */
90
+ login: '/login',
91
+
92
+ /**
93
+ * @type {String}
94
+ * @description 入口页面
95
+ */
96
+ index: '/',
97
+
98
+ /**
99
+ * @type {String}
100
+ * @description 跳转到登录地址
101
+ */
102
+ superAdminLogin: '/login',
103
+
104
+ /**
105
+ * @type {String}
106
+ * @description 后台请求base域名
107
+ */
108
+ apiBaseUrl: '//sandbox-supplier-apis.jufubao.cn',
109
+
110
+ /**
111
+ * @type {String}
112
+ * @description 后台管理API地址
113
+ */
114
+ getBrandHostBaseUrl: 'http://sandbox-c.jufubao.cn',
115
+
116
+ /**
117
+ * @type {string}
118
+ * @description 开发环境api baseurl地址 (开发环境生效)
119
+ */
120
+ //getBrandHost: 'sandbox-gonghui-admin.jufubao.cn',
121
+ getBrandHost: 'sandbox-c.jufubao.cn',
122
+
123
+
124
+ /**
125
+ * @type {String} 聚福宝储存token名字
126
+ * @description cookie token key
127
+ */
128
+ jufubaoTokenKey: 'jufubao-company-token',
129
+
130
+
131
+ /**
132
+ * @type {String} 当前后台系统tokenKey
133
+ * @description cookie token key
134
+ */
135
+ currentToken: 'jufubao-company-token',
136
+
137
+
138
+ /**
139
+ * @type {string}
140
+ * @description 系统版本
141
+ */
142
+ version: 'v1.0.0',
143
+
144
+ /**
145
+ * @type {boolean}
146
+ * @description 是否关闭eslint语法检测
147
+ */
148
+ isCloseEslint: false,
149
+
150
+ /***
151
+ * @description 请求列表返回数据条数
152
+ * @type { number }
153
+ */
154
+ limit: 10,
155
+
156
+
157
+ /**
158
+ * @type {boolean} true | false
159
+ * @description 是否开启方法执行逻辑定位位置显示
160
+ */
161
+ isTimeLog: false,
162
+
163
+
164
+ /**
165
+ * @type {boolean} true | false
166
+ * @description 开发环境与生产环境
167
+ */
168
+ isDebug: false,
169
+
170
+ /**
171
+ * @type {boolean} true | false
172
+ * @description 是否加载模拟数据
173
+ */
174
+ isTestData: false,
175
+
176
+ /**
177
+ * @type {number}
178
+ * @description 开发环境端口号
179
+ */
180
+ port: 8099,
181
+
182
+ /**
183
+ * @type {boolean} true | false
184
+ * @description Whether show the settings right-panel
185
+ */
186
+ showSettings: false,
187
+
188
+ /**
189
+ * @type {boolean} true | false
190
+ * @description Whether need tagsView
191
+ */
192
+ tagsView: true,
193
+
194
+ /**
195
+ * @type {boolean} true | false
196
+ * @description Whether fix the header
197
+ */
198
+ fixedHeader: false,
199
+
200
+ /**
201
+ * @type {boolean} true | false
202
+ * @description Whether show the logo in sidebar
203
+ */
204
+ sidebarLogo: true,
205
+
206
+ /**
207
+ * @type {string | array} 'production' | ['production', 'development']
208
+ * @description Need show err logs component.
209
+ * The default is only used in the production env
210
+ * If you want to also use it in dev, you can pass ['production', 'development']
211
+ */
212
+ errorLog: 'production',
213
+
214
+ };
215
+
216
+ module.exports = settings;
217
+
218
+
@@ -263,7 +263,6 @@ export default {
263
263
  let info = await this.getOnePriceInfo({ product_id });
264
264
  this.priceTypeList = info.data['price_options'];
265
265
  let params = info.data['formula']['price'];
266
- debugger
267
266
  params = {
268
267
  ...params,
269
268
  product_id, product_name,
@@ -45,7 +45,26 @@ module.exports = {
45
45
  // #endif
46
46
 
47
47
  },
48
-
48
+ {
49
+ mapFn: 'getDownloadUrl',
50
+ isRule: false,
51
+ title: '任务query',
52
+ path: '/@@@@/v1/async/real-url',
53
+ params: {
54
+ serial_no: ['id', 'String', '必选'],
55
+ // #ifdef admin
56
+ from: ['项目标识', 'String', '必选', 'admin'],
57
+ // #endif
58
+ // #ifdef supplier
59
+ from: ['项目标识', 'String', '必选', 'supplier'],
60
+ // #endif
61
+ // #ifndef admin supplier
62
+ from: ['项目标识', 'String', '必选', 'partner'],
63
+ // #endif
64
+ },
65
+ disabled: true,
66
+ role: '',
67
+ },
49
68
  ],
50
69
  }
51
70
 
@@ -1,9 +1,23 @@
1
1
  <template>
2
2
  <div class="app-container">
3
+ <el-card class="app-container__search">
4
+ <xd-search
5
+ time-type
6
+ dateFilter
7
+ :picker-options="{}"
8
+ v-if="searchForm.length > 0"
9
+ v-model="searchParams"
10
+ :list="searchForm"
11
+ @onSearch="handleSearch"
12
+ >
13
+ </xd-search>
14
+ </el-card>
3
15
  <el-card class="app-container__list">
4
16
  <div slot="header">导出任务</div>
5
17
  <div class="app-container__list-pagination">
6
- <div></div>
18
+ <div class="app-container__list-pagination-left red">
19
+ <i class="el-icon-warning-outline"></i><span>下载文件超过7天后,系统将自动删除</span>
20
+ </div>
7
21
  <div>
8
22
  <el-button type="primary" @click="getList()">刷新</el-button>
9
23
  </div>
@@ -11,7 +25,6 @@
11
25
  <div class="app-container__list-table">
12
26
  <xd-table
13
27
  is-border
14
- :get-link="getLink"
15
28
  :headers="headers"
16
29
  :list="tables"
17
30
  @onClick="handleBtnClick"
@@ -48,12 +61,12 @@
48
61
  import XdPagination from "@/components/XdPagination.vue"
49
62
  import XdTable from "@/components/XdTable"
50
63
  import XdSearch from "@/components/XdSearch"
51
- import { Loading } from 'element-ui'
52
- import checkPermission from "@/utils/permission"
64
+ import downloadJs from "downloadjs";
53
65
  import {
54
66
  mapActions,
55
67
  mapState,
56
68
  } from 'vuex'
69
+ import {getOptions} from "@/utils/options";
57
70
 
58
71
 
59
72
  export default {
@@ -68,7 +81,7 @@ export default {
68
81
 
69
82
  //搜索
70
83
  searchForm: [], //搜索区域模块表单
71
- searchParams: null, //搜索参数
84
+ searchParams: {}, //搜索参数
72
85
 
73
86
  //分页参数
74
87
  pageSize: 1, //当前页面数量
@@ -81,6 +94,7 @@ export default {
81
94
  { "type": "normal", "prop": "serial_no", "align": "center", "width": 120, "label": "ID" },
82
95
  { "type": "normal", "prop": "file_name", "align": "center", "minWidth": 200, "label": "文件名称" },
83
96
  { "type": "normal", "prop": "status_text", "align": "center", "width": 100, "label": "任务状态" },
97
+ { "type": "normal", "prop": "data_tag_text", "align": "center", "width": 180, "label": "模版名称" },
84
98
  { "type": "normal", "prop": "error_reason", "align": "center", "minWidth": 200, "label": "错误原因" },
85
99
  { "type": "normal", "prop": "admin_user", "align": "center", "width": 100, "label": "操作人" },
86
100
  { "type": "normal", "prop": "created_time", "align": "center", "width": 190, "label": "创建时间" },
@@ -99,11 +113,14 @@ export default {
99
113
  }
100
114
  },
101
115
  created () {
102
- this.getList()
116
+ this.getList();
117
+ this.initSearchForm();
103
118
  },
104
119
  methods: {
105
120
  ...mapActions('tasks', [
106
- 'getAsyncList', 'asyncRetry'
121
+ 'getAsyncList',
122
+ 'asyncRetry',
123
+ 'getDownloadUrl'
107
124
  ]),
108
125
 
109
126
  /**
@@ -123,10 +140,10 @@ export default {
123
140
  * @description 获取数据列表
124
141
  */
125
142
  getList () {
126
-
127
143
  let params = {
128
144
  page_token: this.pageSize,
129
145
  page_size: this.limit,
146
+ ...this.searchParams,
130
147
  }
131
148
  let loading = this.$loading({})
132
149
  this.getAsyncList(params).then(res => {
@@ -145,13 +162,103 @@ export default {
145
162
  loading.close()
146
163
  })
147
164
  },
165
+
166
+
167
+ /**
168
+ * @description 点击搜索进行搜索操作
169
+ * @param action 动作
170
+ * @param form 搜索请求参数
171
+ */
172
+ handleSearch({ action, form }) {
173
+ this.page_token = 1;
174
+ this.getList();
175
+ },
148
176
  /**
149
- * @description 预设获取页面跳转地址方法(次场景可以不实现)
150
- * @param item
177
+ * @description 初始化搜索模块
151
178
  */
152
- getLink (item) {
153
- return '/'
179
+ initSearchForm() {
180
+ this.searchForm = [
181
+ {
182
+ label: "文件名称",
183
+ ele: "el-input",
184
+ valueKey: "file_name",
185
+ value: "",
186
+ placeholder: "请输入文件名称"
187
+ },
188
+ {
189
+ label: '任务状态:',
190
+ ele: 'xd-remote-select-list',
191
+ valueKey: 'status',
192
+ value: '',
193
+ placeholder: '请选择任务状态',
194
+ handleCustom({action, data}) {
195
+ ///export-public/v1/options/task-status
196
+ let params = {};
197
+ // #ifdef admin
198
+ params = {from:'admin'}
199
+ // #endif
200
+ // #ifdef supplier
201
+ params = {from:'supplier'}
202
+ // #endif
203
+ // #ifndef admin supplier
204
+ params = {from:'partner'}
205
+ // #endif
206
+ getOptions({
207
+ server:'export-public',
208
+ fn:'task-status',
209
+ path: 'p1',
210
+ params:params,
211
+ }).then(res => {
212
+ data.cb(res.data.list || [])
213
+ }).catch(error => {
214
+ console.error(error)
215
+ data.cb([])
216
+ })
217
+ },
218
+ },
219
+ {
220
+ label: '模版:',
221
+ ele: 'xd-remote-select-list',
222
+ valueKey: 'data_tag',
223
+ value: '',
224
+ placeholder: '请选择模版',
225
+ handleCustom({action, data}) {
226
+ ///export-public/v1/data-tags/options
227
+ let params = {};
228
+ // #ifdef admin
229
+ params = {from:'admin'}
230
+ // #endif
231
+ // #ifdef supplier
232
+ params = {from:'supplier'}
233
+ // #endif
234
+ // #ifndef admin supplier
235
+ params = {from:'partner'}
236
+ // #endif
237
+ getOptions({
238
+ server:'export-public',
239
+ fn:'data-tags',
240
+ path: 'p1',
241
+ params
242
+ }).then(res => {
243
+ data.cb(res.data.list || [])
244
+ }).catch(error => {
245
+ console.error(error)
246
+ data.cb([])
247
+ })
248
+ },
249
+ },
250
+ {
251
+ label: '触发时间:', //label
252
+ ele: 'xd-date', //package 名称
253
+ valueKey: ['created_time_start', 'created_time_end'], //form[valueKey]
254
+ value: [], //v-model
255
+ format: 'yyyy/MM/dd HH:mm:ss',//时间显示格式
256
+ formatValue: 'timestamp', //输出时间格式
257
+ placeholder: ['开始时间', '结束时间'],
258
+ },
259
+ ];
154
260
  },
261
+
155
262
  /**
156
263
  *按钮操作
157
264
  **/
@@ -170,10 +277,19 @@ export default {
170
277
  })
171
278
 
172
279
  } else if (action === 'download') {
173
- //下载
174
- window.open(url)
280
+ let loading = this.$loading({})
281
+ this.getDownloadUrl({serial_no})
282
+ .then(res=>{
283
+ if(res.data.download_url) {
284
+ window.open(res.data.download_url)
285
+ }
286
+ loading.close()
287
+ }).catch(err=>{
288
+ loading.close()
289
+ })
175
290
  }
176
291
  },
292
+
177
293
  /**
178
294
  * @description 翻页处理方法
179
295
  * @param page {Number} 访问页面页码数
@@ -192,4 +308,15 @@ export default {
192
308
  margin: 0 auto;
193
309
  }
194
310
  }
311
+
312
+ .app-container__list-pagination-left {
313
+ display: flex;
314
+ justify-content: flex-start;
315
+ align-items: center;
316
+ font-size: 14px;
317
+ & > i {
318
+ margin-right: 5px;
319
+ font-size: 18px;
320
+ }
321
+ }
195
322
  </style>
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "jufubao-admin-library",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "聚福宝福利后台管理系统公共模块",
5
5
  "author": "goashiyong <gaoshiyong1272@vip.163.com>",
6
6
  "scripts": {
7
- "serve": "cross-env type=test cover=true service=serve npm run entry",
8
- "serve.domain": "cross-env type=test cover=true service=serve domain=http://sandbox-editx.jufubao.cn npm run entry",
9
- "dev": "cross-env type=dev cover=true service=build npm run entry",
10
- "test": "cross-env type=test cover=true service=build npm run entry",
11
- "build": "cross-env type=build cover=true service=build npm run entry",
7
+ "serve": "cross-env type=test cover=true service=serve npm run entry bus",
8
+ "serve.domain": "cross-env type=test cover=true service=serve domain=http://sandbox-editx.jufubao.cn npm run entry bus",
9
+ "dev": "cross-env type=dev cover=true service=build npm run entry bus",
10
+ "test": "cross-env type=test cover=true service=build npm run entry bus",
11
+ "build": "cross-env type=build cover=true service=build npm run entry bus",
12
12
  "update": " node ./update.command.js false",
13
13
  "update.local": " node ./update.command.js true",
14
14
  "entry": "node ./build/commands/entry.init.js",
@@ -27,7 +27,7 @@
27
27
  "element-ui": "2.13.2",
28
28
  "gxd-file-preview": "1.2.1",
29
29
  "gxd-helper": "2.0.21",
30
- "gxd-vue-library": "1.1.69",
30
+ "gxd-vue-library": "1.1.70",
31
31
  "js-base64": "^3.4.5",
32
32
  "js-cookie": "2.2.0",
33
33
  "md5": "^2.3.0",