jufubao-admin-library 1.1.28 → 1.1.30

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.
@@ -10,7 +10,10 @@ const greetingCardRouter = {
10
10
  component: Layout,
11
11
  sort: 80,
12
12
  name: '贺卡管理',
13
- alwaysShow: true,
13
+ alwaysShow: false,
14
+ // #ifdef saas-admin
15
+ hidden: true,
16
+ // #endif
14
17
  redirect: '/greeting_card/list',
15
18
  meta: {
16
19
  title: '贺卡管理',
@@ -27,10 +27,14 @@
27
27
  <el-button type="primary" icon="el-icon-search" @click="handleSearch()"></el-button>
28
28
  </div>
29
29
  <div class="pages-left__content" v-if="leftGroupList !== null">
30
+ <!--#ifdef saas-admin-->
30
31
  <div class="pages-left__content-title" v-if="leftGroupList && leftGroupList.length === 0">【<span>{{custom_group_name}}</span>】可用模版列表</div>
32
+ <!--#endif-->
31
33
  <template v-for="(item,index) in leftGroupList" >
34
+ <!--#ifdef saas-admin-->
32
35
  <div class="pages-left__content-title" v-if="index ===0 && item.isSelected">当前使用模版</div>
33
36
  <div class="pages-left__content-title" v-if="index ===0 && !item.isSelected">【<span>{{custom_group_name}}</span>】可用模版列表</div>
37
+ <!--#endif-->
34
38
  <div
35
39
  class="pages-left__content-item"
36
40
  :key="item.value"
@@ -42,7 +46,9 @@
42
46
  </el-image>
43
47
  <div>{{item.label}}</div>
44
48
  </div>
49
+ <!--#ifdef saas-admin-->
45
50
  <div class="pages-left__content-title" v-if="index === 0 && item.isSelected">【<span>{{custom_group_name}}</span>】可用模版列表</div>
51
+ <!--#endif-->
46
52
  </template>
47
53
  </div>
48
54
  <div
@@ -181,12 +187,12 @@ export default {
181
187
 
182
188
 
183
189
  //自定义素材ID(SaaS后台)
184
- custom_x_material_id:null,
185
- custom_x_material_item: null,
186
- custom_group_id: null,
187
- custom_group_name:'',
188
- custom_active_item: null,
189
- custom_active_material_id: null,
190
+ custom_x_material_id:null, //自定义素材对象ID
191
+ custom_x_material_item: null, //获取自定义素材对象
192
+ custom_group_id: null, //分组ID
193
+ custom_group_name:'', //分组名称
194
+ custom_active_item: null, //自定义素材所使用到原始素材对象
195
+ custom_active_material_id: null,//自定义素材所使用到原始素材对象ID
190
196
 
191
197
  //search(SaaS后台)
192
198
  is_search_show: false,
@@ -198,10 +204,13 @@ export default {
198
204
 
199
205
 
200
206
  //main ---> material_cover_config/material_detail_config
201
- active:'',//当前选择到素材ID
202
- activeItem: null, //当前操作贺卡数据
207
+ active:'',//当前选中到素材ID
208
+ activeItem: null, //当前选中操作贺卡数据
203
209
  active_material_id:null, //原素材ID切换的参数
204
- mainActive:'',
210
+
211
+
212
+ //编辑模式下使用变量
213
+ mainActive:'', //编辑时候区分是封面还是详情原始快
205
214
  materialCoverKey:{
206
215
  material_cover_config:'materialCoverConfig',
207
216
  material_detail_config:'materialDetailConfig'
@@ -211,12 +220,8 @@ export default {
211
220
  material_detail_config:{},//{"material_image": "", "material_height": 1334, "material_status": "Y", "material_nickname": "亲爱的 {{name}}!", "material_content": "", "material_end": "{{company}}", "material_color": "#F99E15", "material_margin": { "top": 450, "right": 100, "bottom": 0, "left": 100 } }
212
221
  },
213
222
  material_cover:null,//封面图
214
-
215
- //封面配置信息
216
- materialCoverConfig:{},
217
-
218
- //详情配置信息
219
- materialDetailConfig:{},
223
+ materialCoverConfig:{}, //封面配置信息
224
+ materialDetailConfig:{}, //详情配置信息
220
225
 
221
226
  //pages data
222
227
  materialDataTimer:null,
@@ -242,8 +247,9 @@ export default {
242
247
  let query = this.$route.query;
243
248
  if(params.group_id) this.group_id = params.group_id;
244
249
  if(params.material_id){
245
- this.material_id = params.material_id;
250
+ this.material_id = Number(params.material_id);
246
251
  this.active_material_id = Number(params.material_id);
252
+ this.active = Number(params.material_id);
247
253
  }
248
254
 
249
255
  //自定义素材ID
@@ -283,12 +289,13 @@ export default {
283
289
  return item
284
290
  });
285
291
 
292
+ // #ifdef saas-admin
286
293
  this.search_group_list.map(item=>{
287
- debugger
288
294
  if(item.value === this.custom_group_id+''){
289
295
  this.custom_group_name = item.label;
290
296
  }
291
297
  });
298
+ // #endif
292
299
 
293
300
  //设置当前选中
294
301
  if(activeItem){
@@ -325,7 +332,7 @@ export default {
325
332
  }
326
333
  this.getGreetingCardList(params)
327
334
  .then(res=>{
328
- this.handleInitLeftData(res.data.list, this.material_id);
335
+ this.handleInitLeftData(res.data.list, this.active || this.material_id);
329
336
  }).catch();
330
337
  },
331
338
  handlePublish(){
@@ -339,6 +346,7 @@ export default {
339
346
  material_detail_config:JSON.stringify(this.materialDetailConfig),
340
347
  },
341
348
  }
349
+
342
350
  let loading = Loading.service({});
343
351
  this.setGreetingCardBaseConfig(params)
344
352
  .then(res=>{
@@ -473,6 +481,10 @@ export default {
473
481
  .then(res=>{
474
482
  debugger
475
483
  this.$message({message:'操作成功!',type:"success"});
484
+ window['xdLocalStore'].set('xd-card-x-material-id', res.data.x_material_id || this.custom_x_material_id);
485
+ setTimeout(()=>{
486
+ this.$router.back();
487
+ },1500)
476
488
  loading.close()
477
489
  })
478
490
  .catch(err=>{
@@ -496,7 +508,6 @@ export default {
496
508
  handleChange(item, init = false){
497
509
  if(item.value === this.active) return;
498
510
  if(init || this.active === '') {
499
- debugger
500
511
  this.handleChangeClear();
501
512
  this.activeItem = this.$xdHelper.cloneDeep(item);
502
513
  this.active = item.value;
@@ -554,7 +565,7 @@ export default {
554
565
 
555
566
  // #ifdef saas-admin
556
567
  //封面数据
557
- if(this.custom_x_material_item['material_cover_config']
568
+ if(this.custom_x_material_item && this.custom_x_material_item['material_cover_config']
558
569
  && item.id === this.custom_x_material_item['material_id']
559
570
  ) {
560
571
  this.materialCoverConfig = JSON.parse(this.custom_x_material_item['material_cover_config']);
@@ -562,7 +573,7 @@ export default {
562
573
  else this.materialCoverConfig = this.toJson(item['material_cover_config'],'material_cover_config');
563
574
 
564
575
  //详情
565
- if(this.custom_x_material_item['material_detail_config']
576
+ if(this.custom_x_material_item && this.custom_x_material_item['material_detail_config']
566
577
  && item.id === this.custom_x_material_item['material_id']
567
578
  ) {
568
579
  this.materialDetailConfig = JSON.parse(this.custom_x_material_item['material_detail_config']);
@@ -780,6 +791,8 @@ export default {
780
791
  height: params['key'] === 'material_detail_config'?'1334px':`450px`,
781
792
  backgroundImage: `url(${thumb})`
782
793
  };
794
+
795
+
783
796
  if((this.mainActive || key)) {
784
797
  this.$set(this.materialData, this.materialCoverMap[this.mainActive || key], params);
785
798
  }
@@ -833,7 +846,7 @@ export default {
833
846
  &__content {
834
847
  width: 100%;
835
848
  &-item {
836
- width: 280px;
849
+ width: 100%;
837
850
  padding: 5px;
838
851
  box-sizing: border-box;
839
852
  border-radius: 5px;
@@ -191,7 +191,7 @@ export default {
191
191
  },
192
192
 
193
193
  handleSubmit(){
194
- this.$refs['form'].submit()
194
+ this.$refs['form'].submitAll()
195
195
  .then(res=>{
196
196
  let loading = Loading.service({})
197
197
  let form = this.$refs['form'].getAllFormData();
@@ -354,7 +354,7 @@ export default {
354
354
  }
355
355
  this.greetingCardListForm = [
356
356
  params['id'] && {
357
- label: "分组名称",
357
+ label: "贺卡ID",
358
358
  ele: "el-input",
359
359
  value: params['id'],
360
360
  valueKey: "id",
@@ -362,13 +362,14 @@ export default {
362
362
  disabled: true,
363
363
  },
364
364
  {
365
- label: "分组名称",
365
+ label: "贺卡名称",
366
366
  ele: "el-input",
367
367
  value: params['material_name'] || '',
368
368
  valueKey: "material_name",
369
369
  className: "input80",
370
+ placeholder: '请输入贺卡名称',
370
371
  rules: [
371
- { required: true, message: "请输入分组名称" }
372
+ { required: true, message: "请输入贺卡名称" }
372
373
  ]
373
374
  },
374
375
  {
@@ -378,13 +379,15 @@ export default {
378
379
  type:'textarea',
379
380
  valueKey: "material_desc",
380
381
  className: "input80",
382
+ placeholder: '请输入贺卡描述',
381
383
  },
382
384
  {
383
- label: "贺卡分组",
384
- ele: "el-input",
385
- value: this.getGroupActive().label,
386
- disabled: true,
387
- valueKey: "group_name",
385
+ label: '贺卡分组',
386
+ ele: 'xd-select-list',
387
+ valueKey: 'group_id',
388
+ value: params['group_id'] || this.getGroupActive().value,
389
+ list: this.groupList,
390
+ disabled: !params['id'],
388
391
  className: "input80",
389
392
  },
390
393
  {
@@ -431,14 +434,11 @@ export default {
431
434
  let form = this.$refs['formCard'];
432
435
  form.submitAll()
433
436
  .then(res=>{
434
- debugger
435
437
  let loading = Loading.service({})
436
438
  let item = this.$xdHelper.cloneDeep(form.getAllFormData());
437
- if(item['group_name']) delete item['group_name'];
438
439
  if(item['material_cover']) {
439
440
  item['material_cover'] = item['material_cover']['url'];
440
441
  }
441
- item['group_id'] = Number(this.activeName);
442
442
  let params = {item:item};
443
443
  let fn = 'addGreetingCard';
444
444
  if(item.id) {
@@ -15,6 +15,19 @@ module.exports = {
15
15
  disabled: true,
16
16
  role: '',
17
17
  },
18
+ {
19
+ title: '客户管理 - 获取站点所有应用',
20
+ mapFn: "getSaasSiteAppList",
21
+ isPublic: true,
22
+ path: '/editx/v1/platforms/all-platform-catelogs',
23
+ isRule: false,
24
+ params: {
25
+ site_id:['站点id', 'String', '必选'],
26
+ },
27
+ resultKey: "data",
28
+ disabled: true,
29
+ role: '',
30
+ },
18
31
  {
19
32
  title: '客户管理 - 设置',
20
33
  mapFn: "updateSaasCompany",
@@ -45,6 +45,7 @@
45
45
  label-width="120px"
46
46
  v-if="status"
47
47
  :list="listForm"
48
+ :key="key"
48
49
  @success="handleSuccess"
49
50
  @onApiSuccessUrl="handleApiSuccessUrl"
50
51
  @onGetParamsAndHeader="handleGetParamsAndHeader"
@@ -92,6 +93,11 @@ export default {
92
93
  ]
93
94
  }
94
95
  },
96
+ watch:{
97
+ 'listValue.site_id'(){
98
+ this.initForm(this.listValue);
99
+ },
100
+ },
95
101
  data () {
96
102
  return {
97
103
  //分页参数
@@ -113,6 +119,7 @@ export default {
113
119
  listForm: [],
114
120
  status: false,
115
121
  id:null, //客户记录ID
122
+ key: Date.now()
116
123
  }
117
124
  },
118
125
 
@@ -123,7 +130,8 @@ export default {
123
130
  ...mapActions('mCompany', [
124
131
  'getSaasCompanyList',
125
132
  'getSaasSiteList',
126
- 'updateSaasCompany'
133
+ 'updateSaasCompany',
134
+ 'getSaasSiteAppList'
127
135
  ]),
128
136
 
129
137
  //create and edit
@@ -144,7 +152,6 @@ export default {
144
152
  .then(res=>{
145
153
  let form = this.$xdHelper.cloneDeep(this.$refs['form'].getAllFormData());
146
154
  let loading = Loading.service({});
147
- debugger
148
155
  this.updateSaasCompany({id:this.id,item:form})
149
156
  .then(res=>{
150
157
  loading.close();
@@ -206,6 +213,33 @@ export default {
206
213
  { required: true, message: "请选择指定站点",trigger: ['change']}
207
214
  ]
208
215
  },
216
+ params['site_id'] && {
217
+ label: '指定站点应用',
218
+ ele: 'xd-remote-select-list',
219
+ valueKey: 'index_path',
220
+ value: params['index_path'] || null,
221
+ placeholder: '请选择指定站点应用:',
222
+ setting: { multiple: false,},
223
+ className: 'input80',
224
+ handleCustom:({action, data}) =>{
225
+ this.getSaasSiteAppList({site_id: params['site_id']})
226
+ .then(res=>{
227
+ data.cb(res.data.items.map(item=>{
228
+ return {
229
+ label: item.label,
230
+ value: item.route,
231
+ id: item.value
232
+ }
233
+ }))
234
+ })
235
+ .catch(err=>{
236
+ data.cb([])
237
+ })
238
+ },
239
+ rules: [
240
+ { required: true, message: "请选择指定站点",trigger: ['change']}
241
+ ]
242
+ },
209
243
  {
210
244
  label: '客户状态:',
211
245
  ele: 'xd-radio-status',
@@ -217,6 +251,7 @@ export default {
217
251
  },
218
252
  ].filter(ii => ii)
219
253
  this.status = true
254
+ this.key = Date.now()
220
255
  },
221
256
  //create and edit
222
257
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-admin-library",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "description": "聚福宝福利后台管理系统公共模块",
5
5
  "author": "goashiyong <gaoshiyong1272@vip.163.com>",
6
6
  "scripts": {