showSet.vue
2.95 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<template>
<div class="contentBox minHeight">
<el-col :span="12">
<el-form label-position="left" label-width="80px" :model="formLabelAlign">
<el-form-item label="视频1">
<el-input v-model="formLabelAlign.video1"></el-input>
</el-form-item>
<el-form-item label="视频2">
<el-input v-model="formLabelAlign.video2"></el-input>
</el-form-item>
<el-form-item label="视频3">
<el-input v-model="formLabelAlign.video3"></el-input>
</el-form-item>
<el-form-item label="视频4">
<el-input v-model="formLabelAlign.video4"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</div>
</template>
<script>
export default {
data() {
return {
activeName: "first",
height: "",
vchan_conf_unid: "",
formLabelAlign: {
video1: "",
video2: "",
video3: "",
video4: ""
}
};
},
mounted() {},
methods: {
handleClick(tab, event) {},
getshow() {
this.$api.show.getShowUrl().then(res => {
if (res.length > 0 && res[0].conf.length > 0) {
this.formLabelAlign = {
video1: res[0].conf[0].url,
video2: res[0].conf[1].url,
video3: res[0].conf[2].url,
video4: res[0].conf[3].url
};
this.vchan_conf_unid = res[0].vchan_conf_unid;
}
});
},
onSubmit() {
let data = {
conf: [
{
name: "1",
url: this.formLabelAlign.video1,
isActive: true
},
{
name: "1",
url: this.formLabelAlign.video2,
isActive: true
},
{
name: "1",
url: this.formLabelAlign.video3,
isActive: true
},
{
name: "1",
url: this.formLabelAlign.video4,
isActive: true
}
]
};
if (this.vchan_conf_unid) {
this.$api.show.editShowUrl(data, this.vchan_conf_unid).then(res => {
console.log(res);
if (res.ecode == 200) {
this.$message({
type: "success",
message: "设置成功!"
});
} else {
this.$message({
type: "error",
message: "设置失败!"
});
}
});
} else {
this.$api.show.addShowUrl(data).then(res => {
if (res.ecode == 200) {
this.$message({
type: "success",
message: "设置成功!"
});
} else {
this.$message({
type: "error",
message: "设置失败!"
});
}
});
}
}
},
created() {
this.getshow();
}
};
</script>
<style lang="scss" scoped></style>