修改
This commit is contained in:
parent
472ae45bb0
commit
1448296be0
@ -35,16 +35,8 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -56,8 +48,7 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:motionPrescriptionLibrary:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -68,8 +59,7 @@
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:motionPrescriptionLibrary:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -80,8 +70,7 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:motionPrescriptionLibrary:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
@ -93,10 +82,7 @@
|
||||
v-hasPermi="['system:motionPrescriptionLibrary:export']"
|
||||
>导出</el-button>
|
||||
</el-col>-->
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
@ -104,38 +90,17 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="身体素质名称"
|
||||
align="center"
|
||||
prop="physicalQualityName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="运动程度开始值"
|
||||
align="center"
|
||||
prop="degreeStartFraction"
|
||||
/>
|
||||
<el-table-column
|
||||
label="运动程度结束值"
|
||||
align="center"
|
||||
prop="degreeEndFraction"
|
||||
/>
|
||||
<el-table-column label="身体素质名称" align="center" prop="physicalQualityName" />
|
||||
<el-table-column label="运动程度开始值" align="center" prop="degreeStartFraction" />
|
||||
<el-table-column label="运动程度结束值" align="center" prop="degreeEndFraction" />
|
||||
<el-table-column label="运动类型" align="center" prop="motionType" />
|
||||
<el-table-column label="运动频率" align="center" prop="motionFrequency" />
|
||||
<el-table-column label="运动强度" align="center" prop="motionStrength" />
|
||||
<el-table-column label="运动时间" align="center" prop="motionTime" />
|
||||
<el-table-column label="运动量" align="center" prop="motionCapacity" />
|
||||
<el-table-column label="进阶时间" align="center" prop="advancedTime" />
|
||||
<el-table-column
|
||||
label="进阶方案"
|
||||
align="center"
|
||||
prop="advancedScheme"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="处方视频"
|
||||
align="center"
|
||||
prop="prescriptionVideoUrl"
|
||||
>
|
||||
<el-table-column label="进阶方案" align="center" prop="advancedScheme" show-overflow-tooltip />
|
||||
<el-table-column label="处方视频" align="center" prop="prescriptionVideoUrl">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -146,41 +111,32 @@
|
||||
v-hasPermi="[
|
||||
'system:motionPrescriptionLibrary:getPrescriptionVideoInfo',
|
||||
]"
|
||||
>查看</el-button
|
||||
>
|
||||
>查看</el-button>
|
||||
<div v-else>无</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<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-upload2"
|
||||
@click="uploadopentrue(scope.row)"
|
||||
>上传视频</el-button
|
||||
>
|
||||
>上传视频</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:motionPrescriptionLibrary:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:motionPrescriptionLibrary:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -193,13 +149,7 @@
|
||||
/>
|
||||
<!-- 添加或修改运动处方库数据对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
:inline="true"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" :inline="true">
|
||||
<el-form-item label="身体素质名称" prop="physicalQualityName">
|
||||
<el-input
|
||||
v-model="form.physicalQualityName"
|
||||
@ -224,39 +174,19 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运动频率" prop="motionFrequency">
|
||||
<el-input
|
||||
v-model="form.motionFrequency"
|
||||
placeholder="请输入运动频率"
|
||||
style="width: 250px"
|
||||
/>
|
||||
<el-input v-model="form.motionFrequency" placeholder="请输入运动频率" style="width: 250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="运动强度" prop="motionStrength">
|
||||
<el-input
|
||||
v-model="form.motionStrength"
|
||||
placeholder="请输入运动强度"
|
||||
style="width: 250px"
|
||||
/>
|
||||
<el-input v-model="form.motionStrength" placeholder="请输入运动强度" style="width: 250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="运动时间" prop="motionTime">
|
||||
<el-input
|
||||
v-model="form.motionTime"
|
||||
placeholder="请输入运动时间"
|
||||
style="width: 250px"
|
||||
/>
|
||||
<el-input v-model="form.motionTime" placeholder="请输入运动时间" style="width: 250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="运动量" prop="motionCapacity">
|
||||
<el-input
|
||||
v-model="form.motionCapacity"
|
||||
placeholder="请输入运动量"
|
||||
style="width: 250px"
|
||||
/>
|
||||
<el-input v-model="form.motionCapacity" placeholder="请输入运动量" style="width: 250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="进阶时间" prop="advancedTime">
|
||||
<el-input
|
||||
v-model="form.advancedTime"
|
||||
placeholder="请输入进阶时间"
|
||||
style="width: 250px"
|
||||
/>
|
||||
<el-input v-model="form.advancedTime" placeholder="请输入进阶时间" style="width: 250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="进阶方案" prop="advancedScheme">
|
||||
<el-input
|
||||
@ -274,12 +204,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- //上传视频 -->
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<!-- <video
|
||||
v-if="videourl"
|
||||
:src="baseurl+videourl"
|
||||
@ -312,12 +237,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看视频 -->
|
||||
<el-dialog
|
||||
title="查看"
|
||||
:visible.sync="lookvideoshow"
|
||||
width="1200px"
|
||||
append-to-body
|
||||
>
|
||||
<el-dialog title="查看" :visible.sync="lookvideoshow" width="1200px" append-to-body>
|
||||
<div v-if="lookvideolist.length > 0">
|
||||
<video
|
||||
v-for="(item, index) in lookvideolist"
|
||||
@ -336,9 +256,7 @@
|
||||
<el-empty description="暂无视频"></el-empty>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="lookvideoshow = false"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button type="primary" @click="lookvideoshow = false">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -353,7 +271,7 @@ import {
|
||||
getPrescriptionVideoInfo,
|
||||
confirmUploadVideo,
|
||||
deletePrescriptionVideo,
|
||||
prescriptionVideoUpload,
|
||||
prescriptionVideoUpload
|
||||
} from "@/api/system/motionPrescriptionLibrary";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import baseurl from "@/api/baseurl";
|
||||
@ -398,7 +316,7 @@ export default {
|
||||
motionCapacity: null,
|
||||
advancedTime: null,
|
||||
advancedScheme: null,
|
||||
prescriptionVideoUrl: null,
|
||||
prescriptionVideoUrl: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -417,12 +335,12 @@ export default {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
data: {
|
||||
motionPrescriptionId: null,
|
||||
motionPrescriptionId: null
|
||||
},
|
||||
// 上传的地址
|
||||
url:
|
||||
process.env.VUE_APP_BASE_API +
|
||||
"/system/motionPrescriptionLibrary/uploadMotionPrescriptionVideo",
|
||||
"/system/motionPrescriptionLibrary/uploadMotionPrescriptionVideo"
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
@ -430,75 +348,75 @@ export default {
|
||||
{
|
||||
required: true,
|
||||
message: "请输入身体素质名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
degreeStartFraction: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入运动程度开始值",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
degreeEndFraction: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入运动程度结束值",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
motionType: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入运动类型",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
motionFrequency: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入运动频率",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
motionStrength: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入运动强度",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
motionTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入运动时间",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
|
||||
motionCapacity: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入运动量",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
advancedTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入进阶时间",
|
||||
trigger: "blur",
|
||||
},
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
advancedScheme: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入进阶方案",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
fileList: [],
|
||||
fileList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -509,7 +427,7 @@ export default {
|
||||
/** 查询运动处方库数据列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMotionPrescriptionLibrary(this.queryParams).then((response) => {
|
||||
listMotionPrescriptionLibrary(this.queryParams).then(response => {
|
||||
this.motionPrescriptionLibraryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -538,7 +456,7 @@ export default {
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -554,7 +472,7 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
@ -568,7 +486,7 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getMotionPrescriptionLibrary(id).then((response) => {
|
||||
getMotionPrescriptionLibrary(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改运动处方数据";
|
||||
@ -576,16 +494,16 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateMotionPrescriptionLibrary(this.form).then((response) => {
|
||||
updateMotionPrescriptionLibrary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMotionPrescriptionLibrary(this.form).then((response) => {
|
||||
addMotionPrescriptionLibrary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -599,7 +517,7 @@ export default {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm("是否确认删除?")
|
||||
.then(function () {
|
||||
.then(function() {
|
||||
return delMotionPrescriptionLibrary(ids);
|
||||
})
|
||||
.then(() => {
|
||||
@ -613,15 +531,15 @@ export default {
|
||||
this.download(
|
||||
"system/motionPrescriptionLibrary/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
...this.queryParams
|
||||
},
|
||||
`motionPrescriptionLibrary_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
uploadhandle(e) {
|
||||
this.lookvideolist = [];
|
||||
getPrescriptionVideoInfo(e.id).then((res) => {
|
||||
res.data.forEach((e) => {
|
||||
getPrescriptionVideoInfo(e.id).then(res => {
|
||||
res.data.forEach(e => {
|
||||
e.prescriptionVideoUrl = baseurl + e.prescriptionVideoUrl;
|
||||
this.lookvideolist.push(e.prescriptionVideoUrl);
|
||||
});
|
||||
@ -633,18 +551,16 @@ export default {
|
||||
this.videourl = [];
|
||||
this.fileList = [];
|
||||
this.upload.data.motionPrescriptionId = e.id;
|
||||
prescriptionVideoUpload(e.id).then((res) => {
|
||||
prescriptionVideoUpload(e.id).then(res => {
|
||||
if (
|
||||
res.data.prescriptionVideoUrlList &&
|
||||
res.data.prescriptionVideoUrlList.length > 0
|
||||
) {
|
||||
res.data.prescriptionVideoUrlList.forEach((e) => {
|
||||
var arr = e.split("/");
|
||||
res.data.prescriptionVideoUrlList.forEach(el => {
|
||||
var arr = el.prescriptionVideoUrl.split("/");
|
||||
var obj = {
|
||||
name: arr[4],
|
||||
response: {
|
||||
prescriptionVideoUrl: e,
|
||||
},
|
||||
response: el
|
||||
};
|
||||
this.fileList.push(obj);
|
||||
});
|
||||
@ -663,7 +579,7 @@ export default {
|
||||
// deletePrescriptionVideo(file.response.prescriptionVideoUrl).then(res => {
|
||||
// this.$modal.msgSuccess("删除视频成功");
|
||||
// });
|
||||
this.fileList = this.fileList.filter((e) => e != file);
|
||||
this.fileList = this.fileList.filter(e => e != file);
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
@ -680,20 +596,20 @@ export default {
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.fileList.forEach((e) => {
|
||||
this.videourl.push(e.response.prescriptionVideoUrl);
|
||||
this.fileList.forEach(e => {
|
||||
this.videourl.push(e.response);
|
||||
});
|
||||
var obj = {
|
||||
motionPrescriptionId: this.upload.data.motionPrescriptionId,
|
||||
prescriptionVideoUrlList: this.videourl,
|
||||
prescriptionVideoUrlList: this.videourl
|
||||
};
|
||||
confirmUploadVideo(obj).then((res) => {
|
||||
confirmUploadVideo(obj).then(res => {
|
||||
this.upload.open = false;
|
||||
this.$modal.msgSuccess("上传视频成功");
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user