|
@@ -5,8 +5,8 @@
|
|
<el-input v-model="form.name" placeholder="请输入专辑名称" />
|
|
<el-input v-model="form.name" placeholder="请输入专辑名称" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="专辑介绍" prop="description">
|
|
<el-form-item label="专辑介绍" prop="description">
|
|
- <el-input v-model="form.description" type="textarea" :autosize="{ minRows: 5, maxRows: 10}" maxlength="100" show-word-limit
|
|
|
|
- placeholder="请输入专辑介绍" />
|
|
|
|
|
|
+ <el-input v-model="form.description" type="textarea" :autosize="{ minRows: 5, maxRows: 10}"
|
|
|
|
+ maxlength="100" show-word-limit placeholder="请输入专辑介绍" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="专辑类型:" prop="albumType">
|
|
<el-form-item label="专辑类型:" prop="albumType">
|
|
<el-select v-model="form.albumType" placeholder="请选择专辑类型">
|
|
<el-select v-model="form.albumType" placeholder="请选择专辑类型">
|
|
@@ -27,10 +27,10 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item v-if="form.payType !== 1" label="原价:" prop="price">
|
|
<el-form-item v-if="form.payType !== 1" label="原价:" prop="price">
|
|
- <el-input type="number" v-model="form.price" placeholder="请输入原价" />
|
|
|
|
|
|
+ <el-input v-model.number="form.price" placeholder="请输入原价" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item v-if="form.payType !== 1" label="折扣价:" prop="discount">
|
|
<el-form-item v-if="form.payType !== 1" label="折扣价:" prop="discount">
|
|
- <el-input type="number" v-model="form.discount" placeholder="请输入折扣价" />
|
|
|
|
|
|
+ <el-input v-model.number="form.discount" placeholder="请输入折扣价" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="专辑封面:" prop="coverUrl">
|
|
<el-form-item label="专辑封面:" prop="coverUrl">
|
|
<Upload listType="picture-card" :url="form.coverUrl" @upload="upload($event, 'coverUrl')"
|
|
<Upload listType="picture-card" :url="form.coverUrl" @upload="upload($event, 'coverUrl')"
|
|
@@ -50,7 +50,7 @@
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<Audio :src="scope.row.progaramUrl" />
|
|
<Audio :src="scope.row.progaramUrl" />
|
|
- <el-button type="delete" :disabled="disabled">删除</el-button>
|
|
|
|
|
|
+ <el-button type="delete" :disabled="disabled" @click="getDelete(scope.$index)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -90,14 +90,14 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <pagination v-show="total>0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
|
|
|
|
- @pagination="getList" />
|
|
|
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="dialogForm.pageNum"
|
|
|
|
+ :limit.sync="dialogForm.pageSize" @pagination="getList" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { create, edit, detail } from '@/api/music/menu'
|
|
|
|
|
|
+import { submit, detail } from '@/api/music/menu'
|
|
import { list } from '@/api/music/list'
|
|
import { list } from '@/api/music/list'
|
|
import { platformMixin, onOrOffMixin, payTypeMixin, albumTypeMixin } from '@/mixin/index'
|
|
import { platformMixin, onOrOffMixin, payTypeMixin, albumTypeMixin } from '@/mixin/index'
|
|
import Upload from '@/components/Upload/index.vue'
|
|
import Upload from '@/components/Upload/index.vue'
|
|
@@ -118,7 +118,7 @@ export default {
|
|
} else if (!str.test(value)) {
|
|
} else if (!str.test(value)) {
|
|
return callback(new Error('小数点后最多输入两位'))
|
|
return callback(new Error('小数点后最多输入两位'))
|
|
} else if (this.form.discount) {
|
|
} else if (this.form.discount) {
|
|
- Number(value) > Number(this.form.discount) ? this.$refs.form.clearValidate('discount') : callback(new Error('原价必须大于折扣价'))
|
|
|
|
|
|
+ Number(value) > Number(this.form.discount) ? callback() : callback(new Error('原价必须大于折扣价'))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 判断折扣价是否小于原价
|
|
// 判断折扣价是否小于原价
|
|
@@ -127,7 +127,7 @@ export default {
|
|
if (!str.test(value)) {
|
|
if (!str.test(value)) {
|
|
return callback(new Error('小数点后最多输入两位'))
|
|
return callback(new Error('小数点后最多输入两位'))
|
|
} else if (this.form.price) {
|
|
} else if (this.form.price) {
|
|
- Number(value) < Number(this.form.price) ? this.$refs.form.clearValidate('price') : callback(new Error('折扣价必须小于原价'))
|
|
|
|
|
|
+ Number(value) < Number(this.form.price) ? callback() : callback(new Error('折扣价必须小于原价'))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -143,8 +143,6 @@ export default {
|
|
},
|
|
},
|
|
// 添加的歌曲Id
|
|
// 添加的歌曲Id
|
|
ids: [],
|
|
ids: [],
|
|
- // 音频类型
|
|
|
|
- audioType: 15,
|
|
|
|
// 校验
|
|
// 校验
|
|
rules: {
|
|
rules: {
|
|
name: [{
|
|
name: [{
|
|
@@ -198,6 +196,8 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ // 获取资源平台
|
|
|
|
+ this.getPlatform(15)
|
|
if (this.$route.query.id) {
|
|
if (this.$route.query.id) {
|
|
this.form.id = this.$route.query.id
|
|
this.form.id = this.$route.query.id
|
|
this.disabled = Boolean(this.$route.query.disabled)
|
|
this.disabled = Boolean(this.$route.query.disabled)
|
|
@@ -274,27 +274,25 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 删除已选歌曲
|
|
|
|
+ getDelete(index) {
|
|
|
|
+ this.form.programList.splice(index, 1)
|
|
|
|
+ this.ids.splice(index, 1)
|
|
|
|
+ },
|
|
|
|
+
|
|
// 确定
|
|
// 确定
|
|
getSubmit() {
|
|
getSubmit() {
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.form.programList = this.ids
|
|
this.form.programList = this.ids
|
|
this.form_loading = true
|
|
this.form_loading = true
|
|
- if (this.form.id) {
|
|
|
|
- edit(this.form).then(res => {
|
|
|
|
- if (res.code === 0) {
|
|
|
|
- this.$message.success('编辑成功!')
|
|
|
|
- this.getDetail()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- create(this.form).then(res => {
|
|
|
|
- if (res.code === 0) {
|
|
|
|
- this.$message.success('新增成功!')
|
|
|
|
- this.cancel()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ let title = this.form.id ? '编辑成功!' : '新增成功!'
|
|
|
|
+ submit(this.form).then(res => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.$message.success(`${title}`)
|
|
|
|
+ this.cancel()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
return false
|
|
return false
|
|
}
|
|
}
|