jufubao-base 1.0.67 → 1.0.69-beta1

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,224 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
5
+ */
6
+ export default {
7
+ style: [],
8
+ content: [
9
+ {
10
+ label: '领券规则:',
11
+ ele: 'xd-site-news',
12
+ valueKey: 'notice',
13
+ value: null,
14
+ className: 'input70',
15
+ setting: {
16
+ config: {
17
+ sort: true,
18
+ maxlen: 100,
19
+ action: 'aliyun',
20
+ size: 5,
21
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
22
+ uploadType: 'aliyun',
23
+ type: ['jpg', 'png', 'jpeg']
24
+ },
25
+ },
26
+ handleCustom({action, data}) {
27
+ if (data && data.params) {
28
+ //当一个插件中出现使用内容分类时候需要设置code值,在页面引用时候容器id + code进行拼接
29
+ //data.params = Object.assign({}, data.params, {code: 'g_test_id'});
30
+ }
31
+
32
+ //获取返回参数(场景类型名称为必填)
33
+ let loading = XdBus.getParentApi('loading')({});
34
+
35
+ //获取显示内容
36
+ if (action === 'screen') {
37
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_bucket_content_tip'})
38
+ .then(res => {
39
+ loading.close();
40
+ data.cb(res['list'])
41
+ })
42
+ .catch(error => {
43
+ console.error(error);
44
+ loading.close();
45
+ });
46
+
47
+ }
48
+
49
+ //获取返回参数(广告位高度必选项)
50
+ if (action === 'getNewsInfo') {
51
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
52
+ .then(res => {
53
+ loading.close()
54
+ data.cb({list: res.list, selectId: res.selected})
55
+ })
56
+ .catch(error => {
57
+ loading.close()
58
+ console.error(error);
59
+ });
60
+ }
61
+
62
+ //获取产品业务线列表
63
+ if (action === 'namespace') {
64
+ XdBus.getParentApi('getOptionsNamespaces')({})
65
+ .then(res => {
66
+ loading.close()
67
+ data.cb(res['list'])
68
+ })
69
+ .catch(error => {
70
+ loading.close()
71
+ console.error(error);
72
+ });
73
+ }
74
+
75
+ //使用内容分类
76
+ if (action === 'cmsPublishEditxContent') {
77
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
78
+ .then(res => {
79
+ console.log('cmsPublishEditxContent', res)
80
+ loading.close();
81
+ data.cb(res)
82
+ })
83
+ .catch(error => {
84
+ loading.close();
85
+ console.error(error);
86
+ });
87
+ }
88
+
89
+ //位置列表
90
+ if (action === 'getListPostion') {
91
+ XdBus.getParentApi('getListNewsPosition')(data.params)
92
+ .then(res => {
93
+ loading.close();
94
+ data.cb(res)
95
+ })
96
+ .catch(error => {
97
+ loading.close();
98
+ console.error(error);
99
+ });
100
+ }
101
+
102
+ //位置创建
103
+ if (action === 'addPostion') {
104
+ XdBus.getParentApi('addNewsPosition')(data.params)
105
+ .then(res => {
106
+ loading.close();
107
+ data.cb(true)
108
+ })
109
+ .catch(error => {
110
+ console.error(error);
111
+ loading.close();
112
+ data.cb(false)
113
+ });
114
+ }
115
+
116
+ //位置编辑
117
+ if (action === 'editPostion') {
118
+ XdBus.getParentApi('updateNewsPosition')(data.params)
119
+ .then(res => {
120
+ loading.close();
121
+ data.cb(true)
122
+ })
123
+ .catch(error => {
124
+ console.error(error);
125
+ loading.close();
126
+ data.cb(false)
127
+ });
128
+ }
129
+
130
+ //位置删除
131
+ if (action === 'deleltePostion') {
132
+ XdBus.getParentApi('deleteNewsPosition')(data.params)
133
+ .then(res => {
134
+ loading.close();
135
+ data.cb(true)
136
+ })
137
+ .catch(error => {
138
+ console.error(error);
139
+ loading.close();
140
+ data.cb(false)
141
+ });
142
+ }
143
+
144
+ //获取广告位内容列表
145
+ if (action === 'getListContent') {
146
+ XdBus.getParentApi('getListNewsContent')(data.params)
147
+ .then(res => {
148
+ loading.close();
149
+ data.cb(res)
150
+ })
151
+ .catch(error => {
152
+ loading.close();
153
+ console.error(error);
154
+ });
155
+ }
156
+
157
+ //广告内容创建
158
+ if (action === 'addContent') {
159
+ XdBus.getParentApi('addNewsContent')(data.params)
160
+ .then(res => {
161
+ loading.close();
162
+ data.cb(true)
163
+ })
164
+ .catch(error => {
165
+ console.error(error);
166
+ loading.close();
167
+ data.cb(false)
168
+ });
169
+ }
170
+
171
+ //广告内容编辑
172
+ if (action === 'editContent') {
173
+ XdBus.getParentApi('updateNewsContent')(data.params)
174
+ .then(res => {
175
+ loading.close();
176
+ data.cb(true)
177
+ })
178
+ .catch(error => {
179
+ console.error(error);
180
+ loading.close();
181
+ data.cb(false)
182
+ });
183
+ }
184
+
185
+ //广告内容删除
186
+ if (action === 'deleteContent') {
187
+ XdBus.getParentApi('deleteNewsContent')(data.params)
188
+ .then(res => {
189
+ loading.close();
190
+ data.cb(true)
191
+ })
192
+ .catch(error => {
193
+ console.error(error);
194
+ loading.close();
195
+ data.cb(false)
196
+ });
197
+ }
198
+
199
+ //内容发布
200
+ if (action === 'publish') {
201
+ console.log('publish', data.params)
202
+ XdBus.getParentApi('cmsPublishContent')(data.params)
203
+ .then(res => {
204
+ loading.close();
205
+ data.cb(res)
206
+ })
207
+ .catch(error => {
208
+ loading.close();
209
+ console.error(error);
210
+ });
211
+ }
212
+
213
+ //通知页面进行刷新
214
+ if (action === 'update') {
215
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
216
+ loading.close()
217
+ }
218
+ },
219
+ inline: false,
220
+ notice: '请配置温馨提示内容,未配置的情况将不显示此模块',
221
+ },
222
+ ],
223
+ advanced: [],
224
+ };