Commit 42cd36bd authored by 刘予佳's avatar 刘予佳

Merge remote-tracking branch 'remotes/origin/dev_Miaojiale' into dev_lyj

parents f10bae1e a4ffb7e6
......@@ -16,3 +16,9 @@ export function medicalunionList(params = {}) {
params,
})
}
export function deleteUnion(id) {
return request({
url: `/cloud-upms/sys/union/${id}`,
method: "delete",
})
}
import request from "@/utils/request"
/* 数据库管理 */
export function addArticle(data = {}) {
return request({
url: "/cloud-upms/sys/article/addOrUpdate",
method: "post",
data,
})
}
// 获取列表
export function articleList(params = {}) {
return request({
url: "/cloud-upms/sys/article/list",
method: "get",
params,
})
}
// 启用禁用状态
export function articleEnable(params = {}) {
return request({
url: "/cloud-upms/sys/article/enable",
method: "get",
params,
})
}
// 删除文章
export function deleteArticle(id) {
return request({
url: `/cloud-upms/sys/article/${id}`,
method: "delete",
})
}
......@@ -11,6 +11,8 @@
:header-row-class-name="headerClass"
style="width: 100%"
>
<el-table-column v-if="showIndex" type="index" width="120" label="序号">
</el-table-column>
<template v-for="(column, index) in columns">
<template v-if="!column.type && !column.operType">
<el-table-column
......@@ -98,6 +100,7 @@
<template v-if="column.type === 'switch'">
<el-switch
v-model="scope.row[column.value]"
:active-value="1"
@change="column.func(scope.row, scope.$index)"
>
</el-switch>
......@@ -140,6 +143,7 @@ export default {
headerClass: { type: String, default: "default" }, // 头部背景色Class名称,默认default
columns: Array, // 表格列配置数据,{vlaue:对应数据对象中的属性,label:对应的是标题文字,fixed:列是否固定,width:列宽, sortable:是否可排序,formatter:列格式化, className:对应的是列的样式类名}
tableData: Array, // 表格数据
showIndex: { default: false }, // 是否展示索引
},
mixins: [resize],
data() {
......
<template>
<el-row class="el-upload-self">
<el-upload
:multiple="multiple"
class="avatar-uploader"
ref="upload"
:multiple="multiple"
:class="[
'avatar-uploader',
value.length > 0 ? 'textUpload' : '',
accept == 'application/pdf' ? 'pdfUpload' : '',
]"
:action="action"
:headers="headers"
:list-type="listType"
......@@ -11,6 +15,7 @@
:on-remove="handleRemove"
:on-success="handleSuccess"
:on-exceed="handleExceed"
:on-change="handleSelectFile"
:before-upload="beforeUpload"
:before-remove="beforeRemove"
:file-list="fileList"
......@@ -24,23 +29,27 @@
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</template>
<template v-else-if="listType === 'picture-card'">
<i class="el-icon-plus"></i>
<template v-else-if="value.length">
<el-button size="middle" type="text">点击更换</el-button>
</template>
<template v-else-if="listType === 'picture-card' && !value.length">
<el-button size="middle" type="text">点击上传</el-button>
</template>
<template v-else>
<!-- <el-button size="middle" :type="btnType">点击上传</el-button> -->
<!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" /> -->
<i class="el-icon-plus avatar-uploader-icon"></i>
<el-button size="middle" type="text">点击上传</el-button>
</template>
<div slot="tip" class="el-upload__tip">{{ tip }}</div>
<!-- <div slot="tip" class="el-upload__tip">{{ tip }}</div> -->
</el-upload>
<el-image
ref="image"
style="display: none"
:src="imgUrl"
:preview-src-list="previewList"
ref="image"
>
</el-image>
</el-row>
......@@ -50,7 +59,7 @@
import { getAccessToken } from "@/utils/accessToken"
import { delFile } from "@/api/file"
export default {
name: "el-upload-self",
name: "ElUploadSelf",
props: {
accept: { type: String, default: "image/*" },
disabled: {
......@@ -84,7 +93,10 @@ export default {
type: String,
default: "primary",
},
value: Array, //上传文件数组 绑定数组
value: {
type: Array,
default: () => [],
}, //上传文件数组 绑定数组
},
data() {
return {
......@@ -97,20 +109,6 @@ export default {
fileList: [],
}
},
watch: {
value: {
handler(newValue, oldValue) {
if (newValue === oldValue) return
this.fileList = newValue.map((_) => {
return {
name: _.file_name,
url: `${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`,
}
})
},
immediate: true,
},
},
computed: {
headers() {
return {
......@@ -118,23 +116,41 @@ export default {
}
},
action() {
return (
this.httpPrefix +
`/disease-data/file/upload?formId=${this.uploadQuery.formId}&patientId=${this.uploadQuery.patientId}&prefix=${this.uploadQuery.prefix}`
)
return this.httpPrefix + `/cloud-upms/file/upload`
},
// 预览list
previewList() {
if (!this.value) return []
console.log(this.value)
if (!this.value.length || this.accept != "image/*") return []
return this.value.map((_) => {
return (
_.url ||
`${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
`${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
)
})
},
},
watch: {
value: {
handler(newValue, oldValue) {
if (newValue === oldValue) return
this.fileList = newValue.map((_) => {
return {
name: _.file_name,
url: `${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`,
}
})
},
immediate: true,
},
},
methods: {
handleSelectFile(file, fileList) {
if (fileList.length > 1) {
this.value.shift()
fileList.shift()
}
},
// 上传前回调
beforeUpload(file) {
return new Promise((resolve, reject) => {
......@@ -146,17 +162,18 @@ export default {
resolve()
})
},
// 超出限制
handleExceed(files, fileList) {
this.$message.error(`最多可上传${this.limit}个文件!`)
},
// 上传成功
handleSuccess(res, file, fileList) {
const { data } = res
if (data) {
this.value.push({ ...data, url: file.url })
// 上传成功
this.$emit("input", this.value)
this.$emit("fileSuccess")
} else {
this.$message.warning(res.msg)
this.$refs.upload.clearFiles()
......@@ -170,8 +187,13 @@ export default {
// 移除
handleRemove({ url }, fileList) {
const i = this.value.findIndex((_) => url.endsWith(_.uuid_name))
if (i > -1) this.value.splice(i, 1) // 静态移除
if (fileList.length > 1) {
fileList.shift()
}
this.value = []
this.$emit("input", this.value)
// const i = this.value.findIndex((_) => url.endsWith(_.uuid_name))
// if (i > -1) this.value.splice(i, 1) // 静态移除
},
// 查看
......@@ -181,7 +203,7 @@ export default {
let responseUrl
if (file.response) {
const _ = file.response.data
responseUrl = `${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
responseUrl = `${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
}
try {
if (name.match(/\.(png|jpg|jpeg)/)) {
......@@ -227,16 +249,38 @@ export default {
display: flex;
align-items: center;
}
.pdfUpload {
display: flex;
flex-direction: row-reverse;
justify-content: flex-end;
::v-deep .el-upload-list__item {
transform: translateY(-6px);
width: 158px;
height: 40px;
}
}
::v-deep .avatar-uploader .el-upload {
border: 1px solid #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
border: none;
width: 80px;
height: 30px;
line-height: 0px;
}
::v-deep .textUpload {
align-items: flex-start;
.el-upload {
border: none;
width: 80px;
height: 30px;
line-height: 0px;
}
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409eff;
}
::v-deep .el-upload-list__item {
width: 88px;
height: 88px;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
......@@ -250,4 +294,10 @@ export default {
height: 88px;
display: block;
}
// ::v-deep .el-upload--picture-card {
// width: none;
// height: none;
// line-height: 0px;
// border: none;
// }
</style>
......@@ -8,6 +8,7 @@
ref="table"
:table-data="tableData"
:columns="columns"
:show-index="true"
:header-class="'newHeader'"
:list-loading="listLoading"
:current-page="pageIndex"
......@@ -18,12 +19,7 @@
@currentPageChange="handleCurrentChange"
/>
</div>
<el-dialog
:visible.sync="addVisible"
width="520px"
:show-close="true"
@closed="clearForm"
>
<el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
<div class="title">添加医联体</div>
<el-form
ref="form"
......@@ -49,18 +45,29 @@
v-if="item.type == 'select'"
v-model="form[item.prop]"
:placeholder="'请选择' + item.label"
@change="changeCity(item.prop)"
>
<el-option
v-for="e in item.selectGroup"
:key="e.value"
:label="e.label"
:value="e.value"
:value="e.label"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit()">保存</el-button>
<el-button class="f-btn" type="primary" @click="submit()"
>保存</el-button
>
</span>
</el-dialog>
<!-- 删除提示框 -->
<el-dialog title="提示" :visible.sync="deleteVisible" width="30%">
<span>确定删除吗?</span>
<span slot="footer" class="dialog-footers">
<el-button @click="deleteVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDelete">确 定</el-button>
</span>
</el-dialog>
</div>
......@@ -71,7 +78,9 @@ import paginationMixin from "@/components/TabComponents/mixin"
import {
addMedicalunion,
medicalunionList,
deleteUnion,
} from "@/api/medicalunion-management"
import cityList from "@/data/city"
export default {
components: {
......@@ -80,6 +89,7 @@ export default {
mixins: [paginationMixin],
data() {
return {
deleteVisible: false,
addVisible: false,
listLoading: false,
columns: [
......@@ -120,7 +130,7 @@ export default {
},
},
{
func: this.rowOpration,
func: this.deleteFunc,
style: {
color: "#FA6400",
},
......@@ -134,12 +144,7 @@ export default {
],
},
],
tableData: [
{
unionName: "第一个",
id: 123,
},
],
tableData: [],
formList: [
{
type: "input",
......@@ -155,21 +160,23 @@ export default {
type: "select",
label: "",
prop: "province",
selectGroup: [{ label: "北京市", value: "001" }],
selectGroup: cityList,
},
{
type: "select",
label: "",
prop: "city",
selectGroup: [{ label: "北京市", value: "001" }],
selectGroup: [],
},
],
form: {},
deleteId: "",
}
},
watch: {},
mounted() {
this.getMedicalunionList()
console.log(cityList)
},
methods: {
// 获取list
......@@ -177,17 +184,35 @@ export default {
medicalunionList({
size: this.pageSize,
current: this.pageIndex,
}).then((res) => {})
}).then((res) => {
if (res.code == 1) {
this.total = res.data.total
this.tableData = res.data.records
}
})
},
// 添加医联体
addMedical() {
if (this.$refs["form"]) {
this.clearForm()
}
this.addVisible = true
},
// 编辑医联体
editMedical(data) {
console.log(data)
this.form = data
this.form = { ...data }
this.addVisible = true
let value = this.form["province"]
cityList.forEach((e) => {
if (e.label == value) {
this.formList[3].selectGroup = e.children
if (e.children[0].label == "市辖区") {
this.formList[3].selectGroup[0].label = e.label
}
}
})
},
submit() {
this.$refs["form"].validate((valid) => {
......@@ -196,18 +221,54 @@ export default {
if (res.code == 1) {
this.$message.success("添加成功")
this.addVisible = false
this.page = 1
this.getMedicalunionList()
}
})
} else {
console.log("error submit!!")
// console.log("error submit!!")
return false
}
})
},
// 删除
deleteFunc(data) {
console.log(data)
this.deleteVisible = true
this.deleteId = data.id
},
clearForm() {
this.form = {}
this.$refs["form"].resetFields()
},
confirmDelete() {
this.deleteVisible = false
deleteUnion(this.deleteId)
.then((res) => {
if (res.code == 1) {
this.$message.success("删除成功")
this.getMedicalunionList()
}
})
.catch(() => {})
},
// 省份变化改变城市
changeCity(val) {
console.log(val)
if (val == "province") {
delete this.form["city"]
// console.log(this.form["province"])
let value = this.form["province"]
cityList.forEach((e) => {
if (e.label == value) {
this.formList[3].selectGroup = e.children
if (e.children[0].label == "市辖区") {
this.formList[3].selectGroup[0].label = e.label
}
}
})
}
},
},
}
</script>
......@@ -242,7 +303,7 @@ export default {
::v-deep .el-dialog__footer {
border-top: none;
text-align: center;
.el-button {
.f-btn {
width: 100px;
height: 32px;
background: #4e68ff;
......
<template>
<div id="medicalunion-management">
<div class="top-btn">
<el-select v-model="selectType">
<el-select v-model="selectType" @change="getArticleList">
<el-option
v-for="item in selectList"
:key="item.value"
......@@ -47,6 +47,7 @@
:key="index"
:label="item.label"
:prop="item.prop"
:rules="[{ required: true, message: item.label + '不能为空' }]"
>
<template v-if="!readOnly">
<!-- 输入框 -->
......@@ -61,6 +62,7 @@
v-else-if="item.type == 'select'"
v-model="form[item.prop]"
:placeholder="'请选择' + item.label"
style="width: 100%"
>
<el-option
v-for="e in item.selectGroup"
......@@ -75,12 +77,18 @@
v-model="form[item.prop]"
:btn-type="'text'"
v-bind="item"
:list-type="item.listType"
:accept="item.accept"
:limit="item.limit"
@fileSuccess="fileSuccess"
></el-upload-self>
<!-- switch -->
<!-- switch切换 启用 -->
<el-switch
v-else-if="item.type === 'switch'"
v-model="form[item.prop]"
:active-value="1"
:inactive-value="0"
>
</el-switch>
</template>
......@@ -99,7 +107,12 @@
import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin"
import ElUploadSelf from "@/components/Upload"
import {
articleList,
articleEnable,
deleteArticle,
addArticle,
} from "@/api/operation-management"
export default {
components: {
CustomsTable,
......@@ -134,7 +147,7 @@ export default {
{
label: "标题",
minWidth: 120,
value: "title",
value: "articleTitle",
},
{
label: "图片",
......@@ -218,58 +231,89 @@ export default {
{
type: "select",
label: "类型",
prop: "type",
prop: "articleType",
selectGroup: [
{
label: "筛查",
value: 0,
value: 1,
},
{
label: "生活",
value: 1,
value: 2,
},
{
label: "医学知识",
value: 2,
value: 3,
},
{
label: "其他",
value: 3,
value: 4,
},
],
},
{
type: "input",
label: "标题",
prop: "title",
prop: "articleTitle",
},
{
type: "upload",
label: "图片",
prop: "img",
prop: "imgPath",
listType: "picture-card",
},
{
type: "upload",
label: "PDF",
prop: "aaa",
prop: "filePath",
accept: "application/pdf",
},
{
type: "switch",
label: "启用状态",
prop: "ssd",
prop: "status",
},
],
rules: {
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
},
form: {},
form: {
status: 1,
},
}
},
watch: {},
mounted() {},
mounted() {
this.getArticleList()
},
methods: {
// 添加医联体
fileSuccess(val) {
console.log(this.form)
},
// 获取健康科普
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "4",
articleType: this.selectType + 1,
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加文章
addMedical() {
this.readOnly = false
this.addVisible = true
},
// 查看
......@@ -295,15 +339,38 @@ export default {
// 启用状态
openChage(data, index) {
console.log(data, index)
let params = {
id: data.id,
status: data.status ? 1 : 0,
}
articleEnable(params).then((res) => {
if (res.code == 1) {
// this.$message.success("保存成功")
this.getArticleList()
}
})
},
resetForm() {
this.$refs["form"].resetFields()
this.form = {
status: 1,
}
},
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
alert("submit!")
this.addVisible = false
addArticle({
...this.form,
moduleType: "4",
}).then((res) => {
if (res.code == 1) {
this.addVisible = false
this.$refs["form"].resetFields()
this.form = {
status: 1,
}
}
})
} else {
console.log("error submit!!")
return false
......
......@@ -18,7 +18,15 @@
@currentPageChange="handleCurrentChange"
/>
</div>
<el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
<!-- 删除提示框 -->
<el-dialog title="提示" :visible.sync="deleteVisible" width="30%">
<span>确定删除吗?</span>
<span slot="footer" class="dialog-footers">
<el-button @click="deleteVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDelete">确 定</el-button>
</span>
</el-dialog>
<!-- <el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
<div class="title">添加医联体</div>
<el-form
:model="form"
......@@ -54,12 +62,17 @@
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addVisible = false">保存</el-button>
</span>
</el-dialog>
</el-dialog> -->
</div>
</template>
<script>
import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin"
import {
articleList,
articleEnable,
deleteArticle,
} from "@/api/operation-management"
export default {
components: {
CustomsTable,
......@@ -69,16 +82,17 @@ export default {
return {
addVisible: false,
listLoading: false,
deleteVisible: false,
columns: [
{
label: "标题",
minWidth: 120,
value: "title",
value: "articleTitle",
},
{
label: "文件",
minWidth: 120,
value: "file",
value: "fileCode",
},
{
label: "上传时间",
......@@ -88,18 +102,18 @@ export default {
{
label: "最新修改时间",
minWidth: 120,
value: "editTime",
value: "updateTime",
},
{
label: "上传人姓名",
minWidth: 120,
value: "uploadPerson",
value: "uploadUserName",
},
{
label: "启用状态",
minWidth: 120,
type: "switch",
value: "isOpen",
value: "status",
func: this.openChage,
},
{
......@@ -127,7 +141,7 @@ export default {
},
},
{
func: this.rowOpration,
func: this.deleteFunc,
style: {
color: "#FA6400",
},
......@@ -142,10 +156,10 @@ export default {
},
],
tableData: [
{
title: "第一个",
isOpen: true,
},
// {
// title: "第一个",
// isOpen: true,
// },
],
formList: [
{
......@@ -172,11 +186,52 @@ export default {
},
],
form: {},
deleteId: "",
}
},
watch: {},
mounted() {},
mounted() {
this.getArticleList()
},
methods: {
// 删除
deleteFunc(data) {
console.log(data)
this.deleteVisible = true
this.deleteId = data.id
},
// 确认删除
confirmDelete() {
this.deleteVisible = false
deleteArticle(this.deleteId)
.then((res) => {
if (res.code == 1) {
this.$message.success("删除成功")
this.getArticleList()
}
})
.catch(() => {})
},
// 获取新闻会议
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "1",
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加医联体
addMedical() {
this.addVisible = true
......@@ -195,6 +250,16 @@ export default {
// 启用状态
openChage(data, index) {
console.log(data, index)
let params = {
id: data.id,
status: data.status ? 1 : 0,
}
articleEnable(params).then((res) => {
if (res.code == 1) {
// this.$message.success("保存成功")
this.getArticleList()
}
})
},
},
}
......@@ -231,7 +296,7 @@ export default {
::v-deep .el-dialog__footer {
border-top: none;
text-align: center;
.el-button {
.f-btn {
width: 100px;
height: 32px;
background: #4e68ff;
......
......@@ -60,6 +60,11 @@
<script>
import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin"
import {
articleList,
articleEnable,
deleteArticle,
} from "@/api/operation-management"
export default {
components: {
CustomsTable,
......@@ -99,7 +104,7 @@ export default {
label: "启用状态",
minWidth: 120,
type: "switch",
value: "isOpen",
value: "status",
func: this.openChage,
},
{
......@@ -141,12 +146,7 @@ export default {
],
},
],
tableData: [
{
title: "第一个",
isOpen: true,
},
],
tableData: [],
formList: [
{
type: "input",
......@@ -175,8 +175,30 @@ export default {
}
},
watch: {},
mounted() {},
mounted() {
this.getArticleList()
},
methods: {
// 获取通知公告
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "2",
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加医联体
addMedical() {
this.addVisible = true
......
......@@ -94,7 +94,11 @@
import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin"
import ElUploadSelf from "@/components/Upload"
import {
articleList,
articleEnable,
deleteArticle,
} from "@/api/operation-management"
export default {
components: {
CustomsTable,
......@@ -255,8 +259,30 @@ export default {
}
},
watch: {},
mounted() {},
mounted() {
this.getArticleList()
},
methods: {
// 获取健康科普
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "5",
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加医联体
addMedical() {
this.addVisible = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment