Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2024-03-01 17:06:15 +08:00
commit 3173966d0c
7 changed files with 3100 additions and 0 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询素材信息列表
export function listMaterials(query) {
return request({
url: '/manage/materials/list',
method: 'get',
params: query
})
}
// 查询素材信息详细
export function getMaterials(id) {
return request({
url: '/manage/materials/' + id,
method: 'get'
})
}
// 新增素材信息
export function addMaterials(data) {
return request({
url: '/manage/materials',
method: 'post',
data: data
})
}
// 修改素材信息
export function updateMaterials(data) {
return request({
url: '/manage/materials',
method: 'put',
data: data
})
}
// 删除素材信息
export function delMaterials(id) {
return request({
url: '/manage/materials/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,68 @@
import request from '@/utils/request'
// 查询患者宣教信息列表
export function listPropaganda(query) {
return request({
url: '/manage/propaganda/list',
method: 'get',
params: query
})
}
// 查询患者宣教信息详细
export function getPropaganda(id) {
return request({
url: '/manage/propaganda/' + id,
method: 'get'
})
}
// 复制宣教内容
export function copy(id) {
return request({
url: '/manage/propaganda/copy/' + id,
method: 'get'
})
}
// 审核患者宣教信息
export function updateStatus(data) {
return request({
url: '/manage/propaganda/updateStatus',
method: 'post',
data: data
})
}
// 新增患者宣教信息
export function addPropaganda(data) {
return request({
url: '/manage/propaganda',
method: 'post',
data: data
})
}
// 修改患者宣教信息
export function updatePropaganda(data) {
return request({
url: '/manage/propaganda',
method: 'put',
data: data
})
}
// 删除患者宣教信息
export function delPropaganda(id) {
return request({
url: '/manage/propaganda/' + id,
method: 'delete'
})
}
// 左侧列表
export function listWechatTemplateNum(query) {
return request({
url: '/system/department/listWechatTemplateNum',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,56 @@
import request from '@/utils/request'
// 用户头像上传
export function updateNurseStationHeads(data) {
return request({
url: '/system/station/updateNurseStationHeads',
method: 'post',
data: data
})
}
export function uploadFilefm(data) {
return request({
url: '/manage/file/uploadFile',
method: 'post',
data: data
})
}
//海报视频上传
export function updatePoserHeads(data) {
return request({
url: '/system/poser/updatePoserHeads',
method: 'post',
data: data
})
}
export function uploadVideoUrl(data) {
return request({
url: '/system/trainingItem/uploadVideoUrl',
method: 'post',
data: data
})
}
export function uploadUrl(data) {
return request({
url: '/system/trainingItem/uploadUrl',
method: 'post',
data: data
})
}
export function uploadTrainingCategoryPicture(data) {
return request({
url: '/system/trainingCategory/uploadTrainingCategoryPicture',
method: 'post',
data: data
})
}
export function posts(data) {
return request({
url: 'https://jsonplaceholder.typicode.com/posts/',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,853 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="素材状态" prop="materialsStatus">
<el-select
v-model="queryParams.materialsStatus"
placeholder="请选择素材状态"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="素材来源" prop="materialsName">
<el-select
v-model="queryParams.materialsName"
placeholder="请选择素材来源"
>
<el-option
v-for="item in optionsly"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<!-- <el-input
v-model="queryParams.materialsName"
placeholder="请输入素材来源"
clearable
@keyup.enter.native="handleQuery"
/> -->
</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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['manage:materials:add']"
>新增素材</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['manage:materials:remove']"
>批量删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="图片" name="IMAGE_TEXT"></el-tab-pane>
<el-tab-pane label="视频" name="VIDEO"></el-tab-pane>
</el-tabs>
<div class="bodytopxj">
<div class="bodylist" @click="viewshow">
<el-checkbox v-model="checked"></el-checkbox>
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label" @click="labelchange">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
</div>
<!-- <el-table
v-loading="loading"
:data="materialsList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="素材名称" align="center" prop="materialsName" />
<el-table-column
label="
素材类型图文IMAGE_TEXT视频VIDEO"
align="center"
prop="materialsType"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.materials_type"
:value="scope.row.materialsType"
/>
</template>
</el-table-column>
<el-table-column
label="素材选择AI生成AI_GENERATION手动上传MANUAL_UPLOAD"
align="center"
prop="materialsOption"
/>
<el-table-column
label="素材图片/者视频文件存放路径"
align="center"
prop="materialsFilePath"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.video_cover_type"
:value="scope.row.materialsFilePath"
/>
</template>
</el-table-column>
<el-table-column
label="视频封面类型视频首帧VIDEO_FIRST_FRAME手动上传MANUAL_UPLOAD"
align="center"
prop="videoCoverType"
width="100"
>
<template slot-scope="scope">
<image-preview
:src="scope.row.videoCoverType"
:width="50"
:height="50"
/>
</template>
</el-table-column>
<el-table-column
label="视频封面存放路径"
align="center"
prop="videoCoverFilePath"
/>
<el-table-column
label="素材摘要"
align="center"
prop="materialsAbstract"
/>
<el-table-column label="适用症状" align="center" prop="indications" />
<el-table-column
label="适用疾病"
align="center"
prop="applicableDiseases"
/>
<el-table-column label="药物名称" align="center" prop="drugName" />
<el-table-column label="手术名称" align="center" prop="surgicalName" />
<el-table-column label="检查项目" align="center" prop="checkItems" />
<el-table-column label="检验项目" align="center" prop="inspectionItems" />
<el-table-column label="所属人群表id" align="center" prop="crowdId">
<template slot-scope="scope">
<dict-tag
:options="dict.type.crowd_type"
:value="scope.row.crowdId"
/>
</template>
</el-table-column>
<el-table-column label="人群名称" align="center" prop="crowName" />
<el-table-column
label="素材状态全部ALL已上架LISTED未上架NOT_LISTED"
align="center"
prop="materialsStatus"
/>
<el-table-column label="素材备注" align="center" prop="materialsRemark" />
<el-table-column
label="素材排序,值越小排序越靠前"
align="center"
prop="materialsSort"
/>
<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)"
v-hasPermi="['manage:materials:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['manage:materials:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table> -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改素材信息对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="500px"
append-to-body
v-if="open"
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="素材名称" prop="materialsName">
<el-input v-model="form.materialsName" placeholder="请输入素材名称" />
</el-form-item>
<el-form-item label="素材类型">
<el-radio
v-model="form.materialsType"
label="IMAGE_TEXT"
@change="radioChange('IMAGE_TEXT')"
>图文</el-radio
>
<el-radio
v-model="form.materialsType"
label="VIDEO"
@change="radioChange('VIDEO')"
>视频</el-radio
>
</el-form-item>
<el-form-item
label="素材上传"
prop="materialsName111"
v-if="form.materialsType == 'IMAGE_TEXT'"
>
<stationAcatar
@imgUrl="imgUrl"
:img="form.propagandaCoverPath"
:type="'propagandaCoverUrl'"
/>
</el-form-item>
<el-form-item
label="视频素材上传"
prop="materialsName111"
v-if="form.materialsType == 'VIDEO'"
>
<stationAcatar
style="width: 208px"
@imgUrl="imgUrl2"
:tovideo="form.posterVideoUrl"
:type="'posterVideoUrl'"
v-if="open"
/>
</el-form-item>
<el-form-item
label="视频封面"
prop="materialsName111"
v-if="form.materialsType == 'VIDEO'"
>
<stationAcatar
@imgUrl="imgUrl"
:img="form.propagandaCoverPath"
:type="'propagandaCoverUrl'"
/>
</el-form-item>
<el-form-item label="素材摘要" prop="materialsAbstract">
<el-input
v-model="form.materialsAbstract"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<!-- <el-form-item
label="素材选择AI生成AI_GENERATION手动上传MANUAL_UPLOAD"
>
<file-upload v-model="form.materialsOption" />
</el-form-item> -->
<!-- <el-form-item label="素材图片/者视频文件存放路径">
<el-radio-group v-model="form.materialsFilePath">
<el-radio
v-for="dict in dict.type.video_cover_type"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
label="视频封面类型视频首帧VIDEO_FIRST_FRAME手动上传MANUAL_UPLOAD"
>
<image-upload v-model="form.videoCoverType" />
</el-form-item>
<el-form-item label="视频封面存放路径" prop="videoCoverFilePath">
<el-input
v-model="form.videoCoverFilePath"
placeholder="请输入视频封面存放路径"
/>
</el-form-item> -->
<el-form-item label="适用症状" prop="indications">
<el-input v-model="form.indications" placeholder="请输入适用症状" />
</el-form-item>
<el-form-item label="适用疾病" prop="applicableDiseases">
<el-input
v-model="form.applicableDiseases"
placeholder="请输入适用疾病"
/>
</el-form-item>
<el-form-item label="药物名称" prop="drugName">
<el-input v-model="form.drugName" placeholder="请输入药物名称" />
</el-form-item>
<el-form-item label="手术名称" prop="surgicalName">
<el-input v-model="form.surgicalName" placeholder="请输入手术名称" />
</el-form-item>
<el-form-item label="检查项目" prop="checkItems">
<el-input v-model="form.checkItems" placeholder="请输入检查项目" />
</el-form-item>
<el-form-item label="检验项目" prop="inspectionItems">
<el-input
v-model="form.inspectionItems"
placeholder="请输入检验项目"
/>
</el-form-item>
<!-- <el-form-item label="所属人群表id" prop="crowdId">
<el-select v-model="form.crowdId" placeholder="请选择所属人群表id">
<el-option
v-for="dict in dict.type.crowd_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="人群名称" prop="crowName">
<el-input v-model="form.crowName" placeholder="请输入人群名称" />
</el-form-item>
<!-- <el-form-item label="素材备注" prop="materialsRemark">
<el-input
v-model="form.materialsRemark"
placeholder="请输入素材备注"
/>
</el-form-item>
<el-form-item label="素材排序,值越小排序越靠前" prop="materialsSort">
<el-input
v-model="form.materialsSort"
placeholder="请输入素材排序,值越小排序越靠前"
/>
</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>
<!-- 预览弹框 -->
<el-dialog title="预览" :visible.sync="openview" width="60%">
<div class="viewbody">
<div class="left">
<video
ref="myVideo"
src="./text.mp4"
controls
></video>
</div>
<div class="right">
<div class="nametitle">素材名称</div>
<div class="nameitem">半蹲起立练习室早</div>
<div class="nametitle">创建人员</div>
<div class="nameitem">张宇</div>
<div class="nametitle">创建时间</div>
<div class="nameitem">2024-1-25 15:42</div>
<div class="nametitle">素材摘要</div>
<div class="nameitem">88888888888888888888888888888888888</div>
<div class="nametitle">素材标签</div>
<div class="nameitem">适用症状</div>
<div class="nameitem">药物名称</div>
<div class="nameitem">适用疾病</div>
<div class="nameitem">手术名称</div>
<div class="nameitem">检验项目</div>
<div class="nameitem">检查项目</div>
<div class="nameitem">人群</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/manage/materials";
import stationAcatar from "../../system/stationAvatar/index.vue";
export default {
name: "Materials",
components: { stationAcatar },
dicts: ['crowd_type', 'materials_type', 'video_cover_type'],
data() {
return {
videoState: false, //
//
studyTime: {
currentTime: 0, //
duration: 0 //
},
timer: {}, //
pauseTimer: {}, //
checked: true,
openview: false,//
activeName: 'IMAGE_TEXT',
options: [{
value: 'ALL',
label: '全部'
}, {
value: 'LISTED',
label: '已上架'
}, {
value: 'NOT_LISTED',
label: '未上架'
}],
optionsly: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
materialsList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
materialsName: null,
materialsStatus: null,
createTime: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
handleClick(e) {
console.log(e.name);
},
//
radioChange(e) {
console.log(e)
},
//
imgUrl(imgUrl) {
this.form.propagandaCoverPath = imgUrl;
},
//
imgUrl2(imgUrl) {
this.videoForm.showVideoPath = process.env.VUE_APP_BASE_API + imgUrl;
this.form.posterVideoUrl = imgUrl;
},
//
viewshow() {
this.openview = true
},
/** 查询素材信息列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
}
listMaterials(this.queryParams).then(response => {
this.materialsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
materialsName: null,
materialsType: "IMAGE_TEXT",
materialsOption: 'MANUAL_UPLOAD',
materialsFilePath: "0",
videoCoverType: null,
videoCoverFilePath: null,
materialsAbstract: null,
indications: null,
applicableDiseases: null,
drugName: null,
surgicalName: null,
checkItems: null,
inspectionItems: null,
crowdId: null,
crowName: null,
materialsStatus: "0",
materialsRemark: null,
materialsSort: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
console.log(this.form)
this.open = true;
this.title = "添加素材信息";
},
/** 修改按钮操作 */
labelchange(row) {
this.reset();
this.open = true;
const id = row.id || this.ids
// getMaterials(id).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "";
// });
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMaterials(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMaterials(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除素材信息编号为"' + ids + '"的数据项?').then(function () {
return delMaterials(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('manage/materials/export', {
...this.queryParams
}, `materials_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style lang="scss" scoped>
::v-deep .el-checkbox__inner {
position: absolute !important;
top: -84px;
left: 8px;
}
video{
height: 500px;
width: 100%;
}
.viewbody{
width: 100%;
height: 500px;
// background: #409eff;
display: flex;
.left{
width: 77%;
height: 500px;
background: #989992;
}
.right{
width: 20%;
// background: red;
margin-left: 30px;
.nametitle{
font-size: 14px;
font-weight: 600;
}
.nameitem{
color: #959595;
margin: 5px;
}
}
}
.bodytopxj {
width: 100%;
display: flex;
white-space: wrap;
align-items: center;
flex-wrap: wrap;
justify-content: space-around;
align-content: space-between;
.bodylist {
width: 19%;
height: 210px;
border: 2px solid #e2e3e5;
border-radius: 10px;
position: relative;
margin-bottom: 10px;
.texttitle {
font-weight: 700;
margin: 5px 0px 5px 10px;
}
//
.dataliat {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0px 0px 5px 10px;
font-size: 12px;
color: #989992;
}
img {
width: 100%;
height: 100px;
}
.label {
position: absolute;
right: 0px;
right: 18px;
color: #409eff;
bottom: 11px;
font-size: 13px;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,391 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="患者信息表id" prop="patientId">
<el-input
v-model="queryParams.patientId"
placeholder="请输入患者信息表id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宣教表id" prop="propagandaId">
<el-input
v-model="queryParams.propagandaId"
placeholder="请输入宣教表id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属科室名称" prop="departmentName">
<el-input
v-model="queryParams.departmentName"
placeholder="请输入所属科室名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宣教标题" prop="propagandaTitle">
<el-input
v-model="queryParams.propagandaTitle"
placeholder="请输入宣教标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宣教ID" prop="propagandaCode">
<el-input
v-model="queryParams.propagandaCode"
placeholder="请输入宣教ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宣教封面文件存放地址" prop="propagandaCoverPath">
<el-input
v-model="queryParams.propagandaCoverPath"
placeholder="请输入宣教封面文件存放地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属病种名称" prop="diseaseTypeName">
<el-input
v-model="queryParams.diseaseTypeName"
placeholder="请输入所属病种名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宣教链接" prop="propagandaLink">
<el-input
v-model="queryParams.propagandaLink"
placeholder="请输入宣教链接"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宣教二维码图片存放地址" prop="propagandaBarcodePath">
<el-input
v-model="queryParams.propagandaBarcodePath"
placeholder="请输入宣教二维码图片存放地址"
clearable
@keyup.enter.native="handleQuery"
/>
</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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['manage:propaganda:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['manage:propaganda:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['manage:propaganda:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['manage:propaganda:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="propagandaList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="患者信息表id" align="center" prop="patientId" />
<el-table-column label="宣教表id" align="center" prop="propagandaId" />
<el-table-column label="所属科室名称" align="center" prop="departmentName" />
<el-table-column label="宣教标题" align="center" prop="propagandaTitle" />
<el-table-column label="宣教类型用药知识MEDICATION_KNOWLEDGE疾病科普DISEASE_POPULARIZATION运动营养SPORT_NUTRITION其他知识OTHER_KNOWLEDGE
定制内容CUSTOMIZED_CONTENT" align="center" prop="propagandaType" />
<el-table-column label="宣教ID" align="center" prop="propagandaCode" />
<el-table-column label="宣教正文内容" align="center" prop="propagandaContent" />
<el-table-column label="宣教封面文件存放地址" align="center" prop="propagandaCoverPath" />
<el-table-column label="宣教文章摘要" align="center" prop="articleSummary" />
<el-table-column label="语音播报" align="center" prop="voicebroadcast" />
<el-table-column label="所属病种名称" align="center" prop="diseaseTypeName" />
<el-table-column label="宣教链接" align="center" prop="propagandaLink" />
<el-table-column label="宣教二维码图片存放地址" align="center" prop="propagandaBarcodePath" />
<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)"
v-hasPermi="['manage:propaganda:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['manage:propaganda:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改患者宣教信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="患者信息表id" prop="patientId">
<el-input v-model="form.patientId" placeholder="请输入患者信息表id" />
</el-form-item>
<el-form-item label="宣教表id" prop="propagandaId">
<el-input v-model="form.propagandaId" placeholder="请输入宣教表id" />
</el-form-item>
<el-form-item label="所属科室名称" prop="departmentName">
<el-input v-model="form.departmentName" placeholder="请输入所属科室名称" />
</el-form-item>
<el-form-item label="宣教标题" prop="propagandaTitle">
<el-input v-model="form.propagandaTitle" placeholder="请输入宣教标题" />
</el-form-item>
<el-form-item label="宣教ID" prop="propagandaCode">
<el-input v-model="form.propagandaCode" placeholder="请输入宣教ID" />
</el-form-item>
<el-form-item label="宣教正文内容">
<editor v-model="form.propagandaContent" :min-height="192"/>
</el-form-item>
<el-form-item label="宣教封面文件存放地址" prop="propagandaCoverPath">
<el-input v-model="form.propagandaCoverPath" placeholder="请输入宣教封面文件存放地址" />
</el-form-item>
<el-form-item label="宣教文章摘要" prop="articleSummary">
<el-input v-model="form.articleSummary" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="语音播报" prop="voicebroadcast">
<el-input v-model="form.voicebroadcast" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="所属病种名称" prop="diseaseTypeName">
<el-input v-model="form.diseaseTypeName" placeholder="请输入所属病种名称" />
</el-form-item>
<el-form-item label="宣教链接" prop="propagandaLink">
<el-input v-model="form.propagandaLink" placeholder="请输入宣教链接" />
</el-form-item>
<el-form-item label="宣教二维码图片存放地址" prop="propagandaBarcodePath">
<el-input v-model="form.propagandaBarcodePath" placeholder="请输入宣教二维码图片存放地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</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 { listPropaganda, getPropaganda, delPropaganda, addPropaganda, updatePropaganda } from "@/api/manage/propaganda";
export default {
name: "Propaganda",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
propagandaList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
patientId: null,
propagandaId: null,
departmentName: null,
propagandaTitle: null,
propagandaType: null,
propagandaCode: null,
propagandaContent: null,
propagandaCoverPath: null,
articleSummary: null,
voicebroadcast: null,
diseaseTypeName: null,
propagandaLink: null,
propagandaBarcodePath: null,
},
//
form: {},
//
rules: {
patientId: [
{ required: true, message: "患者信息表id不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询患者宣教信息列表 */
getList() {
this.loading = true;
listPropaganda(this.queryParams).then(response => {
this.propagandaList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
patientId: null,
propagandaId: null,
departmentName: null,
propagandaTitle: null,
propagandaType: null,
propagandaCode: null,
propagandaContent: null,
propagandaCoverPath: null,
articleSummary: null,
voicebroadcast: null,
diseaseTypeName: null,
propagandaLink: null,
propagandaBarcodePath: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加患者宣教信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getPropaganda(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改患者宣教信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updatePropaganda(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPropaganda(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除患者宣教信息编号为"' + ids + '"的数据项?').then(function() {
return delPropaganda(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('manage/propaganda/export', {
...this.queryParams
}, `propaganda_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,463 @@
<template>
<div>
<div class="user-info-head" :class="video.VideoPath ? 'wihi' : ''" @click="editCropper()">
<video
style="width: 208px; height: 208px"
v-if="video.VideoPath"
v-bind:src="video.VideoPath"
class="avatar video-avatar"
controls="controls"
>您的浏览器不支持视频播放</video>
<img
v-if="options.img"
v-bind:src="options.img"
title="点击上传图片"
style="width: 100px; height: 100px; line-height: 200px"
/>
<i
v-else-if="!options.img && !video.VideoPath"
class="el-icon-plus avatar-uploader-icon"
style="
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
"
></i>
</div>
<el-dialog
:title="title"
:visible.sync="openimg"
width="950px"
append-to-body
@opened="modalOpened"
@close="closeDialog"
>
<el-row>
<el-col :xs="24" :md="0" :style="{ height: '350px' }">
<vue-cropper
ref="cropper"
:img="options.img"
:info="true"
:autoCrop="options.autoCrop"
:autoCropWidth="options.autoCropWidth"
:autoCropHeight="options.autoCropHeight"
:fixedBox="options.fixedBox"
@realTime="realTime"
v-if="visible"
/>
</el-col>
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
<div class="avatar-upload-preview">
<video
style="width: 100%; height: 100%"
v-if="videoForm.showVideoPath"
v-bind:src="videoForm.showVideoPath"
class="avatar video-avatar"
controls="controls"
>您的浏览器不支持视频播放</video>
<img style="width: 100%; height: 100%" v-if="previews.url" :src="previews.url" />
<div v-else></div>
</div>
<div
class="title"
v-if="
types != 'posterVideoUrl' &&
types != 'posterPictureUrl' &&
types != 'itemDirectoryUrl'
"
>请上传图片为800x800px的正方形</div>
</el-col>
</el-row>
<br />
<el-row>
<el-col :lg="2" :md="2">
<el-upload
action="#"
:http-request="requestUpload"
:show-file-list="false"
:before-upload="beforeUpload"
>
<el-button size="small">
选择
<i class="el-icon-upload el-icon--right"></i>
</el-button>
</el-upload>
</el-col>
<!-- <el-col :lg="{ span: 1, offset: 2 }" :md="2">
<el-button
icon="el-icon-plus"
size="small"
@click="changeScale(1)"
></el-button>
</el-col>
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
<el-button
icon="el-icon-minus"
size="small"
@click="changeScale(-1)"
></el-button>
</el-col>
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
<el-button
icon="el-icon-refresh-left"
size="small"
@click="rotateLeft()"
></el-button>
</el-col>
<el-col :lg="{ span: 1, offset: 1 }" :md="2">
<el-button
icon="el-icon-refresh-right"
size="small"
@click="rotateRight()"
></el-button>
</el-col>-->
<el-col :lg="{ span: 2, offset: 19 }" :md="2">
<el-button v-if="uploadbtn" type="primary" size="small" @click="uploadImg()"> </el-button>
<el-button v-else :loading="!uploadbtn" type="primary" size="small"> ...</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
import { VueCropper } from "vue-cropper";
import {
updateNurseStationHeads,
posts,
uploadVideoUrl,
uploadTrainingCategoryPicture,
updatePoserHeads,
uploadUrl,
uploadFilefm
} from "@/api/system/stationAvatar.js";
export default {
components: { VueCropper },
props: ["img", "type", "item", "tovideo"],
data() {
return {
uploadbtn: true, //
imageUrl: "",
types: "",
//
openimg: false,
// cropper
visible: false,
//
title: "上传图片/视频",
options: {
img: null, //
autoCrop: true, //
autoCropWidth: 300, //
autoCropHeight: 300, //
fixedBox: true //
},
previews: {},
items: {},
//
videoForm: {
showVideoPath: null //
},
video: {
VideoPath: null //
}
};
},
created() {
this.types = this.type;
this.items = this.item;
if (this.tovideo == null) {
this.video.VideoPath = null;
} else if (this.tovideo == "") {
this.video.VideoPath = null;
} else {
this.video.VideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
}
if (this.img == null) {
this.options.img = null;
} else if (this.img == "") {
this.options.img = null;
} else {
this.options.img = process.env.VUE_APP_BASE_API + this.img;
}
if (this.types == "posterVideoUrl" || this.types == "itemDirectoryUrl") {
this.title = "上传视频";
} else {
this.title = "上传图片";
}
},
watch: {
tovideo: {
handler(newimg, oldimg) {
if (this.tovideo == null) {
this.video.VideoPath = null;
} else if (this.tovideo == "") {
this.video.VideoPath = null;
} else {
this.video.VideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
}
}
},
item: {
handler(newimg, oldimg) {
this.items = this.item;
}
},
img: {
handler(newimg, oldimg) {
if (this.img == null) {
this.options.img = null;
} else if (this.img == "") {
this.options.img = null;
} else {
this.options.img = process.env.VUE_APP_BASE_API + this.img;
}
}
},
type: {
handler(newimg, oldimg) {
this.types = this.type;
}
}
},
methods: {
//
editCropper() {
this.openimg = true;
},
//
modalOpened() {
this.visible = true;
},
//
requestUpload() {},
//
rotateLeft() {
this.$refs.cropper.rotateLeft();
},
//
rotateRight() {
this.$refs.cropper.rotateRight();
},
//
changeScale(num) {
num = num || 1;
this.$refs.cropper.changeScale(num);
},
//
beforeUpload(file) {
console.log(file)
if (this.types == "posterVideoUrl" || this.types == "itemDirectoryUrl") {
const reader = new FileReader();
this.previews.data = file;
this.videoForm.showVideoPath = URL.createObjectURL(file);
reader.readAsDataURL(file);
reader.onload = () => {
};
} else {
if (file.type.indexOf("image/") == -1) {
this.$modal.msgError(
"文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。"
);
} else {
const reader = new FileReader();
this.previews.data = file;
this.previews.url = URL.createObjectURL(file);
reader.readAsDataURL(file);
reader.onload = () => {
this.options.img = reader.result;
};
}
}
},
//
uploadImg() {
this.uploadbtn = true;
let formData = new FormData();
if (this.previews.data) {
formData.append("file", this.previews.data);
formData.append("type", this.types);
if (this.types == "itemDirectoryUrl") {
this.$modal.msgSuccess("上传视频中,请耐心等待");
this.uploadbtn = false;
uploadVideoUrl(formData).then(response => {
if (response.code == 200) {
this.video.VideoPath =
process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
this.items.itemDirectoryUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
this.uploadbtn = true;
});
} else if (
this.types == "trainingItemCoverUrl" ||
this.types == "trainingItemContentUrl" ||
this.types == "trainingItemPosterUrl"
) {
uploadUrl(formData).then(response => {
if (response.code == 200) {
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
});
} else if (this.types == "trainingCategoryPictureUrl") {
uploadTrainingCategoryPicture(formData).then(response => {
if (response.code == 200) {
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
});
} else if (this.types == "posterVideoUrl") {
updatePoserHeads(formData).then(response => {
if (response.code == 200) {
this.video.VideoPath =
process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
});
//
} else if(this.types == "propagandaCoverUrl"){
uploadFilefm(formData).then(response => {
if (response.code == 200) {
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
});
}
else {
updateNurseStationHeads(formData).then(response => {
if (response.code == 200) {
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
if (this.types == "attributePitureUrl") {
this.items.attributePitureUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
if (this.types == "nurseItemClassifyUrl") {
this.items.classifyPictureUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
if (this.types == "nurseStationClassifyUrl") {
this.items.classifyPictureUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
if (this.types == "posterPictureUrl") {
this.items.posterPictureUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
if (this.types == "certificateUrl") {
this.items.certificateUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
if (this.types == "personCertificateUrl") {
this.items.certificateUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
});
}
} else {
this.openimg = false;
}
// this.videoForm.showVideoPath = null;
this.previews.data = null;
},
//
realTime(data) {
// this.previews = data;
},
//
closeDialog() {
this.imgs = "";
this.visible = false;
}
}
};
</script>
<style scoped lang="scss">
.title {
position: absolute;
bottom: 5%;
left: 50%;
transform: translate(-50%, 0%);
}
.avatar-upload-preview {
position: absolute;
top: 0%;
left: 50%;
transform: translate(-50%, 0%);
width: 300px;
height: 300px;
border-radius: 0%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
.user-info-head {
position: relative;
display: inline-block;
background: #fafafa;
width: 100px;
height: 100px;
}
.user-info-head:hover:after {
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
color: #eee;
background: rgba(0, 0, 0, 0.5);
font-size: 24px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
cursor: pointer;
line-height: 110px;
border-radius: 50%;
}
.wihi {
background-color: #fff;
width: 100px;
height: 100px;
}
.wihi:hover:after {
transform: translate(50%, 50%);
}
</style>