1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { getInfo } from '@/highOrderComponent/Service';
export function getConfigApi(code) {
return getInfo({ code }, '/PublicPrintApi/query');
}
export const queryConfig = function() {
const { code } = this.props;
return getConfigApi(code).then((x) => {
if (!x) {
console.error('配置接口报错');
return false;
}
if (x) {
if (!x.backgroundUrl) {
console.error('未配置打印背景图 无法进行操作');
return false;
}
x.config = x.config.filter((y) => {
// 过滤不显示的字段.
return y.hasHidden !== true;
});
if (!x.config.length) {
console.error('没有有效的配置项');
return false;
}
this.setState({
configAll: x,
});
return x;
}
});
};
export function saveConfig(parmas = {}) {
return getInfo(parmas, '/PublicPrintApi/update');
}