|
|
@@ -9,7 +9,7 @@
|
|
|
<div class="l-flex__auto l-flex--row c-sibling-item">
|
|
|
<button
|
|
|
class="o-button"
|
|
|
- @click="toAdd"
|
|
|
+ @click="onAdd"
|
|
|
>
|
|
|
<i class="o-button__icon el-icon-circle-plus-outline" />
|
|
|
新增
|
|
|
@@ -95,6 +95,17 @@
|
|
|
@click.stop="onSubmit(item)"
|
|
|
/>
|
|
|
</el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="item.status === 2"
|
|
|
+ content="复制"
|
|
|
+ :hide-after="2000"
|
|
|
+ >
|
|
|
+ <svg-icon
|
|
|
+ class="o-icon--active u-pointer"
|
|
|
+ icon-class="copy"
|
|
|
+ @click.stop="onCopy(item)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
<permission
|
|
|
:skip="item.status === 0"
|
|
|
:access="Access.DELETE_FORCE"
|
|
|
@@ -178,6 +189,40 @@
|
|
|
</button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="复制节目"
|
|
|
+ :visible.sync="copying"
|
|
|
+ custom-class="c-dialog mini"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :before-close="onCloseCopyDialog"
|
|
|
+ >
|
|
|
+ <div class="c-form">
|
|
|
+ <div class="c-form__section">
|
|
|
+ <span class="c-form__label auto">名称:</span>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="copyProgram.name"
|
|
|
+ class="c-form__item"
|
|
|
+ placeholder="请输入名称"
|
|
|
+ maxlength="50"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <button
|
|
|
+ class="o-button"
|
|
|
+ @click="copy"
|
|
|
+ >
|
|
|
+ 确定
|
|
|
+ </button>
|
|
|
+ <button
|
|
|
+ class="o-button cancel"
|
|
|
+ @click="onCloseCopyDialog"
|
|
|
+ >
|
|
|
+ 取消
|
|
|
+ </button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</wrapper>
|
|
|
</template>
|
|
|
|
|
|
@@ -190,7 +235,8 @@ import {
|
|
|
updateProgramName,
|
|
|
deleteProgram,
|
|
|
getProgram,
|
|
|
- submitProgram
|
|
|
+ submitProgram,
|
|
|
+ copyProgram
|
|
|
} from '@/api/program'
|
|
|
import { State } from '@/constant'
|
|
|
import { createListOptions } from '@/utils'
|
|
|
@@ -215,7 +261,12 @@ export default {
|
|
|
status: void 0,
|
|
|
resolutionRatio: void 0,
|
|
|
name: ''
|
|
|
- })
|
|
|
+ }),
|
|
|
+ copying: false,
|
|
|
+ copyProgram: {
|
|
|
+ id: null,
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -309,7 +360,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- toAdd () {
|
|
|
+ onAdd () {
|
|
|
this.program = {
|
|
|
name: '',
|
|
|
resolutionRatio: ''
|
|
|
@@ -409,6 +460,27 @@ export default {
|
|
|
}
|
|
|
this.getList()
|
|
|
})
|
|
|
+ },
|
|
|
+ onCopy ({ id, name }) {
|
|
|
+ this.copyProgram = { id, name }
|
|
|
+ this.copying = true
|
|
|
+ },
|
|
|
+ copy () {
|
|
|
+ const { id, name } = this.copyProgram
|
|
|
+ copyProgram({ id }, name).then(() => {
|
|
|
+ this.onCloseCopyDialog()
|
|
|
+ const params = this.params
|
|
|
+ if (params.status !== void 0 && params.status !== State.READY) {
|
|
|
+ params.status = void 0
|
|
|
+ }
|
|
|
+ if (params.name && !(new RegExp(params.name).test(name))) {
|
|
|
+ params.name = ''
|
|
|
+ }
|
|
|
+ this.search()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCloseCopyDialog () {
|
|
|
+ this.copying = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -460,7 +532,7 @@ export default {
|
|
|
rgba(#000, 0.6) 100%
|
|
|
);
|
|
|
|
|
|
- i {
|
|
|
+ .o-icon--active {
|
|
|
margin-left: $spacing;
|
|
|
font-size: 18px;
|
|
|
}
|