Browse Source

新增视频 新增文章 - 按钮

master release.2022-03-04
pzy 3 years ago
parent
commit
d030ea6ef1
  1. 42
      src/views/article/index.vue

42
src/views/article/index.vue

@ -87,8 +87,15 @@
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleCreate"
>新增</el-button
@click="handleCreate('article')"
>新增文章</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleCreate('video')"
>新增视频</el-button
>
</el-col>
</el-row>
@ -186,6 +193,7 @@
:limit.sync="listQuery.limit"
@pagination="getList"
/>
<div style="display: block; height: 20px"></div>
</el-col>
</el-row>
</el-card>
@ -311,7 +319,11 @@
</div>-->
</el-upload>
</el-form-item>
<el-form-item label="视频时长" prop="video_time">
<el-form-item
label="视频时长"
prop="video_time"
v-show="slider_type !== 'article'"
>
<el-time-picker
v-model="temp.video_time"
value-format="HH:mm:ss"
@ -370,9 +382,10 @@ export default {
{ value: 1, label: "下线" },
],
categoryOptionsLeft: undefined,
slider_type: "",
tableKey: 0,
list: null,
total: 0,
total: 0, //
listLoading: true,
listQuery: {
page: 1,
@ -382,7 +395,7 @@ export default {
label_name: "",
category_id: undefined,
author: "", //
},
}, //()
// accountRules: {
// phone: [{ required: true, trigger: 'blur', validator: RulePhone }],
// wam_name: [{ required: true, trigger: 'blur', validator: RuleEmpty }]
@ -392,8 +405,8 @@ export default {
serverUrl: process.env.VUE_APP_BASE_API + "/files/baiduUp",
initialFrameHeight: 300,
scaleEnabled: true,
},
uploadAction: process.env.VUE_APP_BASE_API + "/files/uploadFile",
}, //
uploadAction: process.env.VUE_APP_BASE_API + "/files/uploadFile", //URL
temp: {
id: undefined,
category_id: undefined,
@ -405,9 +418,9 @@ export default {
description: "",
video_time: "",
is_offline: 2,
},
}, //||
dialogFullscreen: true,
dialogFormVisible: false,
dialogFormVisible: false, //
dialogStatus: "",
textMap: {
update: "编辑",
@ -452,6 +465,7 @@ export default {
dialogFormVisible(newVal) {
if (newVal === false) {
this.validation = true;
this.slider_type = "";
}
},
tagData(newVal) {
@ -586,9 +600,17 @@ export default {
this.updateData();
}
},
handleCreate() {
handleCreate(type) {
this.resetTemp();
this.temp.category_id = this.listQuery.category_id;
if (!this.temp.category_id) {
this.$message({
type: "warning",
message: "请选择分类",
});
return;
}
this.slider_type = type;
this.dialogStatus = "create";
this.dialogFormVisible = true;
this.$nextTick(() => {

Loading…
Cancel
Save