|
|
@@ -132,11 +132,6 @@ import {
|
|
|
} from '@/api/asset.js'
|
|
|
import LineChart from './components/LineChart.vue'
|
|
|
|
|
|
-const marketingOptions = [
|
|
|
- { label: '否', value: 0 },
|
|
|
- { label: '是', value: 1 }
|
|
|
-]
|
|
|
-
|
|
|
export default {
|
|
|
components: {
|
|
|
LineChart
|
|
|
@@ -200,22 +195,22 @@ export default {
|
|
|
{ type: 'selection', fixed: true },
|
|
|
{ prop: 'tagInfo', label: '分类', width: 72, 'align': 'center', fixed: true },
|
|
|
{ prop: 'typeInfo', label: '资源', width: 72, 'align': 'center', fixed: true },
|
|
|
- { prop: 'marketing', label: '参与营销', render: (data, h) => h('el-select', {
|
|
|
+ { prop: 'marketing', label: '参与营销', render: (data, h) => h('el-switch', {
|
|
|
props: {
|
|
|
- value: data.marketing === 1 ? '是' : '否',
|
|
|
- size: 'mini'
|
|
|
+ value: data.marketing,
|
|
|
+ size: 'mini',
|
|
|
+ 'active-value': 1,
|
|
|
+ 'active-color': '#13ce66',
|
|
|
+ 'inactive-value': 0,
|
|
|
+ 'inactive-color': '#ff4949'
|
|
|
+ },
|
|
|
+ nativeOn: {
|
|
|
+ click: e => e.stopPropagation()
|
|
|
},
|
|
|
on: {
|
|
|
- input: val => { this.onEditSelect(data, val, data.marketing) }
|
|
|
+ input: val => { this.onToggleMarketing(data, val, data.marketing) }
|
|
|
}
|
|
|
- }, [
|
|
|
- marketingOptions.map(item => h('el-option', {
|
|
|
- props: {
|
|
|
- value: item.value,
|
|
|
- label: item.label
|
|
|
- }
|
|
|
- }))
|
|
|
- ]), width: 86, fixed: true },
|
|
|
+ }), width: 72, align: 'center', fixed: true },
|
|
|
{ prop: 'file', label: '', type: 'asset', on: this.onView, fixed: true },
|
|
|
{ render: (data, h) => h('edit-input', {
|
|
|
props: {
|
|
|
@@ -438,11 +433,11 @@ export default {
|
|
|
asset.originalName = oldVal
|
|
|
})
|
|
|
},
|
|
|
- onEditSelect (asset, newVal, oldVal) {
|
|
|
+ onToggleMarketing (asset, newVal, oldVal) {
|
|
|
if (newVal === oldVal) {
|
|
|
return
|
|
|
}
|
|
|
- asset.marketing = newVal
|
|
|
+ this.$set(asset, 'marketing', newVal)
|
|
|
updateAsset({
|
|
|
keyName: asset.keyName,
|
|
|
marketing: newVal
|