修改上传文件组件显示文件名
This commit is contained in:
@ -147,7 +147,7 @@ export default {
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res, file) {
|
||||
this.$message.success("上传成功");
|
||||
this.fileList.push({ name: res.fileName, url: res.fileName });
|
||||
this.fileList.push({ name: res.msg, url: res.msg });
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
},
|
||||
// 删除文件
|
||||
|
186
src/views/chartList/page5/center2.vue
Normal file
186
src/views/chartList/page5/center2.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<!--用户数据-->
|
||||
<el-col :span="24" :xs="24">
|
||||
<el-row :gutter="10" class="mb8 fr">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="userList">
|
||||
<el-table-column label="序号" align="center" prop="id" width="80" />
|
||||
<el-table-column label="视频类型" align="center" prop="category" >
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.category=='1'">
|
||||
奖惩播放
|
||||
</div>
|
||||
<div v-if="scope.row.category=='2'">
|
||||
典型案例播放
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="视频名称" align="center" prop="videoName" />
|
||||
<el-table-column label="视频地址" align="center" prop="videoFileName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:autoScroll="false"
|
||||
:pageSizes="[2, 5, 10, 20]"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="视频类型" prop="category">
|
||||
<el-radio v-model="form.category" label="1">奖惩播放</el-radio>
|
||||
<el-radio v-model="form.category" label="2">典型案例播放</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="视频名称" prop="videoName">
|
||||
<el-input v-model="form.videoName" placeholder="请输入视频名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" :autosize="{ minRows: 2, maxRows: 6}" placeholder="备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="视频" prop="videoFileName">
|
||||
<FileUpload v-model="form.videoFileName" :isShowTip="false" :fileType="['mp4']" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { centerTwoList, delVideo, addVideo, editVideo } from './indexApi'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 用户表格数据
|
||||
userList: null,
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: this.page_size,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
videoName: [{ required: true, message: '视频名称不能为空', trigger: 'blur' }],
|
||||
videoFileName: [{ required: true, message: '请上传视频', trigger: 'blur' }],
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
centerTwoList(this.queryParams).then(response => {
|
||||
this.userList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
category: '1',
|
||||
videoName: undefined,
|
||||
remark: undefined,
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
this.form = Object.assign({}, row)
|
||||
this.form.videoFileName='http://192.168.0.115:1818/' + this.form.videoFileName
|
||||
this.open = true
|
||||
this.title = '修改装药量概况'
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
editVideo(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addVideo(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除序号为"' + row.id + '"的数据项?')
|
||||
.then(function () {
|
||||
return delVideo({hxVideoId:row.id})
|
||||
})
|
||||
.then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
@ -10,9 +10,9 @@
|
||||
<left4 />
|
||||
<el-divider content-position="left"><span class="text-bold-18">危险场所管理</span></el-divider>
|
||||
<center1 />
|
||||
<!-- <el-divider content-position="left"><span class="text-bold-18">关键参数SPC分析</span></el-divider>
|
||||
<el-divider content-position="left"><span class="text-bold-18">视频管理</span></el-divider>
|
||||
<center2 />
|
||||
<el-divider content-position="left"><span class="text-bold-18">质量问题</span></el-divider>
|
||||
<!-- <el-divider content-position="left"><span class="text-bold-18">质量问题</span></el-divider>
|
||||
<right1 />
|
||||
<el-divider content-position="left"><span class="text-bold-18">质量检查分析</span></el-divider>
|
||||
<right2 />
|
||||
@ -27,7 +27,7 @@ import left2 from './left2.vue'
|
||||
import left3 from './left3.vue'
|
||||
import left4 from './left4.vue'
|
||||
import center1 from './center1.vue'
|
||||
// import center2 from './center2.vue'
|
||||
import center2 from './center2.vue'
|
||||
// import right1 from './right1.vue'
|
||||
// import right2 from './right2.vue'
|
||||
// import right3 from './right3.vue'
|
||||
@ -38,7 +38,7 @@ export default {
|
||||
left3,
|
||||
left4,
|
||||
center1,
|
||||
// center2,
|
||||
center2,
|
||||
// right1,
|
||||
// right2,
|
||||
// right3,
|
||||
|
@ -69,20 +69,38 @@ export function centerOneImportTemplate() {
|
||||
url: '/hx/dangerousPlace/importTemplate',
|
||||
})
|
||||
}
|
||||
// /** --------------- center2 --------------- */
|
||||
// // 关键参数SPC分析
|
||||
// export function centerTwoList(params) {
|
||||
// return request({
|
||||
// url: '/hx/spcInfo/list',
|
||||
// params,
|
||||
// })
|
||||
// }
|
||||
// // 导出模板
|
||||
// export function centerTwoImportTemplate() {
|
||||
// return request({
|
||||
// url: '/hx/spcInfo/importTemplate',
|
||||
// })
|
||||
// }
|
||||
/** --------------- center2 --------------- */
|
||||
// 视频管理
|
||||
export function centerTwoList(params) {
|
||||
return request({
|
||||
url: '/hx/video/list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
// 删除视频
|
||||
export function delVideo(params) {
|
||||
return request({
|
||||
url: '/hx/video',
|
||||
method: 'delete',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 新增视频
|
||||
export function addVideo(data) {
|
||||
return request({
|
||||
url: '/hx/video',
|
||||
method:'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 修改视频
|
||||
export function editVideo(data) {
|
||||
return request({
|
||||
url: '/hx/video',
|
||||
method:'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
// /** --------------- right1 --------------- */
|
||||
// // 质量问题
|
||||
// export function rightOneList(params) {
|
||||
|
Reference in New Issue
Block a user