|
@@ -6,8 +6,8 @@
|
6
|
6
|
<span>跳转类型:</span>
|
7
|
7
|
<div class="flex-item">
|
8
|
8
|
<div style="width:50%" class="radio">
|
9
|
|
- <el-radio v-model="postData.jumpType" label='0' >连接</el-radio>
|
10
|
|
- <el-radio v-model="postData.jumpType" label='1' >课程</el-radio>
|
|
9
|
+ <el-radio v-model="postData.ForwardType" label='1' >链接</el-radio>
|
|
10
|
+ <el-radio v-model="postData.ForwardType" label='0' >课程</el-radio>
|
11
|
11
|
</div>
|
12
|
12
|
</div>
|
13
|
13
|
</li>
|
|
@@ -17,7 +17,7 @@
|
17
|
17
|
<div style="width:50%">
|
18
|
18
|
<el-input
|
19
|
19
|
placeholder="请输入链接"
|
20
|
|
- v-model="postData.link"
|
|
20
|
+ v-model="postData.ForwardUrl"
|
21
|
21
|
clearable>
|
22
|
22
|
</el-input>
|
23
|
23
|
</div>
|
|
@@ -27,8 +27,8 @@
|
27
|
27
|
<span>是否发布:</span>
|
28
|
28
|
<div class="flex-item">
|
29
|
29
|
<div style="width:50%" class="radio">
|
30
|
|
- <el-radio v-model="postData.release" label='0' >是</el-radio>
|
31
|
|
- <el-radio v-model="postData.release" label='1' >否</el-radio>
|
|
30
|
+ <el-radio v-model="postData.status" label='1' >是</el-radio>
|
|
31
|
+ <el-radio v-model="postData.status" label='0' >否</el-radio>
|
32
|
32
|
</div>
|
33
|
33
|
</div>
|
34
|
34
|
</li>
|
|
@@ -36,7 +36,7 @@
|
36
|
36
|
<span>图片位置:</span>
|
37
|
37
|
<div class="flex-item">
|
38
|
38
|
<div style="width:50%">
|
39
|
|
- <el-select v-model="postData.position" placeholder="请选择">
|
|
39
|
+ <el-select v-model="postData.LocationId" placeholder="请选择">
|
40
|
40
|
<el-option
|
41
|
41
|
v-for="item in positionList"
|
42
|
42
|
:key="item.value"
|
|
@@ -53,7 +53,7 @@
|
53
|
53
|
<div style="width:50%">
|
54
|
54
|
<el-input
|
55
|
55
|
placeholder="请输入标题"
|
56
|
|
- v-model="postData.realName"
|
|
56
|
+ v-model="postData.Title"
|
57
|
57
|
clearable>
|
58
|
58
|
</el-input>
|
59
|
59
|
</div>
|
|
@@ -62,13 +62,15 @@
|
62
|
62
|
<li class="flex-h">
|
63
|
63
|
<span>图片:</span>
|
64
|
64
|
<div class="flex-item">
|
65
|
|
- <div>
|
66
|
|
- <a class="formImg">
|
67
|
|
- <img src="" class="centerLabel contain" alt="">
|
68
|
|
- <i class="iconfont icon-quxiao"></i>
|
69
|
|
- </a>
|
70
|
|
- <el-button type="success" size="mini">上传图片</el-button>
|
71
|
|
- </div>
|
|
65
|
+ <el-upload
|
|
66
|
+ class="avatar-uploader"
|
|
67
|
+ :action='$api.file.image.url'
|
|
68
|
+ :show-file-list="false"
|
|
69
|
+ :on-success="handleAvatarSuccess"
|
|
70
|
+ :before-upload="beforeAvatarUpload">
|
|
71
|
+ <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
|
|
72
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
73
|
+ </el-upload>
|
72
|
74
|
</div>
|
73
|
75
|
</li>
|
74
|
76
|
<li style="text-align:center">
|
|
@@ -81,50 +83,59 @@
|
81
|
83
|
</template>
|
82
|
84
|
|
83
|
85
|
<script>
|
|
86
|
+import { mapState, createNamespacedHelpers } from 'vuex'
|
|
87
|
+const { mapActions: mapCmsActions } = createNamespacedHelpers('cms')
|
84
|
88
|
export default {
|
85
|
89
|
name: '',
|
86
|
90
|
data () {
|
87
|
91
|
return {
|
88
|
92
|
postData: {
|
89
|
|
- jumpType: '0',
|
90
|
|
- link: '',
|
91
|
|
- release: '0',
|
92
|
|
- position: ''
|
93
|
|
- },
|
94
|
|
- positionList: [{
|
95
|
|
- value: '0',
|
96
|
|
- label: '首页'
|
97
|
|
- }, {
|
98
|
|
- value: '1',
|
99
|
|
- label: '精选'
|
100
|
|
- }, {
|
101
|
|
- value: '2',
|
102
|
|
- label: '健康'
|
103
|
|
- }, {
|
104
|
|
- value: '3',
|
105
|
|
- label: '社交'
|
106
|
|
- }, {
|
107
|
|
- value: '4',
|
108
|
|
- label: '教育'
|
109
|
|
- }, {
|
110
|
|
- value: '5',
|
111
|
|
- label: '健身'
|
112
|
|
- }, {
|
113
|
|
- value: '6',
|
114
|
|
- label: '艺术'
|
115
|
|
- }],
|
|
93
|
+ ForwardType: '1',
|
|
94
|
+ ForwardUrl: '',
|
|
95
|
+ ForwardResource: '',
|
|
96
|
+ status: '1',
|
|
97
|
+ LocationId: '',
|
|
98
|
+ ImageUrl: '',
|
|
99
|
+ Title: '',
|
|
100
|
+ OrgId: '',
|
|
101
|
+ CaseId: ''
|
|
102
|
+ }
|
116
|
103
|
}
|
117
|
104
|
},
|
118
|
105
|
components: {},
|
|
106
|
+ created () {
|
|
107
|
+ this.updateLocationInfo()
|
|
108
|
+ },
|
|
109
|
+ computed: {
|
|
110
|
+ ...mapState({
|
|
111
|
+ positionList: x => x.cms.location,
|
|
112
|
+ OrgId: x => x.app.user.OrgId,
|
|
113
|
+ CaseId: x => x.app.case.CaseId
|
|
114
|
+ })
|
|
115
|
+ },
|
119
|
116
|
methods: {
|
120
|
117
|
submit () {
|
121
|
118
|
console.log(this.postData)
|
|
119
|
+ this.$ajax(this.$api.cms.addImage.url, {
|
|
120
|
+ method: this.$api.cms.addImage.method,
|
|
121
|
+ data: this.postData
|
|
122
|
+ }).then(res => {
|
|
123
|
+ console.log(res)
|
|
124
|
+ }).catch(msg => {
|
|
125
|
+
|
|
126
|
+ })
|
122
|
127
|
},
|
123
|
128
|
cancel () {
|
124
|
129
|
this.$router.go(-1)
|
125
|
|
- }
|
126
|
|
- },
|
127
|
|
- mounted () {}
|
|
130
|
+ },
|
|
131
|
+ handleAvatarSuccess (res, file) {
|
|
132
|
+ console.log(res)
|
|
133
|
+ console.log(file)
|
|
134
|
+ this.postData.ImageUrl = res.result.url
|
|
135
|
+ },
|
|
136
|
+ beforeAvatarUpload (file) { },
|
|
137
|
+ ...mapCmsActions(['updateLocationInfo']),
|
|
138
|
+ }
|
128
|
139
|
}
|
129
|
140
|
</script>
|
130
|
141
|
|