Commit c8f78c2a authored by miaojiale's avatar miaojiale

运营管理部分接口

parent a4ffb7e6
<template> <template>
<el-row class="el-table-self"> <el-row class="el-table-self">
<el-table <el-table
:max-height="maxHeight || maxTableHeight"
:height="tableHeight"
ref="selftab" ref="selftab"
v-loading="listLoading" v-loading="listLoading"
:max-height="maxHeight || maxTableHeight"
:height="tableHeight"
:data="tableData" :data="tableData"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
:highlight-current-row="highLight" :highlight-current-row="highLight"
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<!-- 表内容插槽 --> <!-- 表内容插槽 -->
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{ fontSize: fontSize[fontIndex] }"> <span :style="{ fontSize: fontSize[fontIndex] }">
{{ scope.row[column.value] }}</span {{ scope.row[column.value] || "--" }}</span
> >
</template> </template>
</el-table-column> </el-table-column>
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<template v-else> <template v-else>
<el-table-column <el-table-column
:key="index" :key="index"
:show-overflow-tooltip="column.type === 'img' ? false : true"
:fixed="column.fixed" :fixed="column.fixed"
:prop="column.value" :prop="column.value"
:label="column.label" :label="column.label"
...@@ -92,15 +93,49 @@ ...@@ -92,15 +93,49 @@
</el-button> </el-button>
</template> </template>
</template> </template>
<!-- 图片 -->
<template v-if="column.type === 'img'">
<el-image
style="width: 100px; height: 100px"
:src="
scope.row[column.value]
? 'https://ds.cixincloud.com/geca-api' +
'/disease-data/file/info/' +
scope.row[column.value][0].bucketName +
'/' +
scope.row[column.value][0].uuidName
: ''
"
:preview-src-list="[
scope.row[column.value]
? 'https://ds.cixincloud.com/geca-api' +
'/disease-data/file/info/' +
scope.row[column.value][0].bucketName +
'/' +
scope.row[column.value][0].uuidName
: '',
]"
>
</el-image>
</template>
<!-- 文件 -->
<template v-if="column.type === 'file'">
<span>{{
scope.row[column.value]
? scope.row[column.value][0].fileName
: ""
}}</span>
</template>
<!-- html --> <!-- html -->
<template v-if="column.type === 'html'"> <template v-if="column.type === 'html'">
<div v-html="scope.row[column.value]" class="highlight"></div> <div class="highlight" v-html="scope.row[column.value]"></div>
</template> </template>
<!-- switch切换 启用 --> <!-- switch切换 启用 -->
<template v-if="column.type === 'switch'"> <template v-if="column.type === 'switch'">
<el-switch <el-switch
v-model="scope.row[column.value]" v-model="scope.row[column.value]"
:active-value="1" :active-value="1"
:inactive-value="0"
@change="column.func(scope.row, scope.$index)" @change="column.func(scope.row, scope.$index)"
> >
</el-switch> </el-switch>
...@@ -131,6 +166,7 @@ ...@@ -131,6 +166,7 @@
import resize from "../TabComponents/resize.js" import resize from "../TabComponents/resize.js"
import { mapGetters } from "vuex" import { mapGetters } from "vuex"
export default { export default {
mixins: [resize],
props: { props: {
tableHeight: Number, // 表格的高度 tableHeight: Number, // 表格的高度
maxHeight: Number, // 表格的最大高度 maxHeight: Number, // 表格的最大高度
...@@ -145,10 +181,13 @@ export default { ...@@ -145,10 +181,13 @@ export default {
tableData: Array, // 表格数据 tableData: Array, // 表格数据
showIndex: { default: false }, // 是否展示索引 showIndex: { default: false }, // 是否展示索引
}, },
mixins: [resize],
data() { data() {
return { return {
fontSize: ["12px", "14px", "16px"], fontSize: ["12px", "14px", "16px"],
httpPrefix:
process.env.NODE_ENV === "development"
? "/api"
: process.env.VUE_APP_BASE_API,
} }
}, },
computed: { computed: {
......
...@@ -42,6 +42,29 @@ ...@@ -42,6 +42,29 @@
<!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" /> --> <!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" /> -->
<el-button size="middle" type="text">点击上传</el-button> <el-button size="middle" type="text">点击上传</el-button>
</template> </template>
<div slot="file" slot-scope="{ file }">
<img
v-if="accept == 'image/*'"
class="el-upload-list__item-thumbnail"
:src="file.url"
alt=""
/>
<span v-if="accept == 'image/*'" class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePreview(file)"
>
<i class="el-icon-download"></i>
</span>
</span>
<span
style="cursor: pointer"
class="fileName"
v-if="accept != 'image/*'"
@click="handlePreview(file)"
>{{ file.name }}</span
>
</div>
<!-- <div slot="tip" class="el-upload__tip">{{ tip }}</div> --> <!-- <div slot="tip" class="el-upload__tip">{{ tip }}</div> -->
</el-upload> </el-upload>
...@@ -125,7 +148,7 @@ export default { ...@@ -125,7 +148,7 @@ export default {
return this.value.map((_) => { return this.value.map((_) => {
return ( return (
_.url || _.url ||
`${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}`
) )
}) })
}, },
...@@ -136,8 +159,8 @@ export default { ...@@ -136,8 +159,8 @@ export default {
if (newValue === oldValue) return if (newValue === oldValue) return
this.fileList = newValue.map((_) => { this.fileList = newValue.map((_) => {
return { return {
name: _.file_name, name: _.fileName,
url: `${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`, url: `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}`,
} }
}) })
}, },
...@@ -203,7 +226,7 @@ export default { ...@@ -203,7 +226,7 @@ export default {
let responseUrl let responseUrl
if (file.response) { if (file.response) {
const _ = file.response.data const _ = file.response.data
responseUrl = `${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` responseUrl = `https://ds.cixincloud.com/geca-api/disease-data/file/info/${_.bucketName}/${_.uuidName}`
} }
try { try {
if (name.match(/\.(png|jpg|jpeg)/)) { if (name.match(/\.(png|jpg|jpeg)/)) {
...@@ -255,8 +278,8 @@ export default { ...@@ -255,8 +278,8 @@ export default {
justify-content: flex-end; justify-content: flex-end;
::v-deep .el-upload-list__item { ::v-deep .el-upload-list__item {
transform: translateY(-6px); transform: translateY(-6px);
width: 158px; // width: 158px;
height: 40px; height: 20px;
} }
} }
::v-deep .avatar-uploader .el-upload { ::v-deep .avatar-uploader .el-upload {
...@@ -273,6 +296,10 @@ export default { ...@@ -273,6 +296,10 @@ export default {
height: 30px; height: 30px;
line-height: 0px; line-height: 0px;
} }
.el-upload--text {
height: 20px;
transform: translateY(-4px);
}
} }
::v-deep .avatar-uploader .el-upload:hover { ::v-deep .avatar-uploader .el-upload:hover {
border-color: #409eff; border-color: #409eff;
...@@ -280,6 +307,9 @@ export default { ...@@ -280,6 +307,9 @@ export default {
::v-deep .el-upload-list__item { ::v-deep .el-upload-list__item {
width: 88px; width: 88px;
height: 88px; height: 88px;
&:hover {
background-color: #fff;
}
} }
.avatar-uploader-icon { .avatar-uploader-icon {
font-size: 28px; font-size: 28px;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
:label-position="'right'" :label-position="'right'"
label-width="110px" label-width="110px"
label-suffix=":" label-suffix=":"
:rules="rules" :disabled="readOnly"
> >
<el-form-item <el-form-item
v-for="(item, index) in formList" v-for="(item, index) in formList"
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
:prop="item.prop" :prop="item.prop"
:rules="[{ required: true, message: item.label + '不能为空' }]" :rules="[{ required: true, message: item.label + '不能为空' }]"
> >
<template v-if="!readOnly"> <!-- <template v-if="!readOnly"> -->
<template>
<!-- 输入框 --> <!-- 输入框 -->
<el-input <el-input
v-if="item.type == 'input'" v-if="item.type == 'input'"
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
:list-type="item.listType" :list-type="item.listType"
:accept="item.accept" :accept="item.accept"
:limit="item.limit" :limit="item.limit"
@fileSuccess="fileSuccess" :disabled="readOnly"
></el-upload-self> ></el-upload-self>
<!-- switch --> <!-- switch -->
<!-- switch切换 启用 --> <!-- switch切换 启用 -->
...@@ -92,13 +93,23 @@ ...@@ -92,13 +93,23 @@
> >
</el-switch> </el-switch>
</template> </template>
<template v-else> <!-- <template v-else>
<span>{{ form[item.prop] || "--" }}</span> <span>{{ form[item.prop] || "--" }}</span>
</template> </template> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">保存</el-button> <el-button class="f-btn" type="primary" @click="submitForm('4')"
>保存</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> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -107,41 +118,38 @@ ...@@ -107,41 +118,38 @@
import CustomsTable from "@/components/CustomsTable" import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin" import paginationMixin from "@/components/TabComponents/mixin"
import ElUploadSelf from "@/components/Upload" import ElUploadSelf from "@/components/Upload"
import { import mixin from "./mixin"
articleList, import { articleList } from "@/api/operation-management"
articleEnable,
deleteArticle,
addArticle,
} from "@/api/operation-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
ElUploadSelf, ElUploadSelf,
}, },
mixins: [paginationMixin], mixins: [paginationMixin, mixin],
data() { data() {
return { return {
readOnly: true, // readOnly: true,
addVisible: false, // addVisible: false,
// deleteVisible: false,
selectList: [ selectList: [
{ {
label: "筛查", label: "筛查",
value: 0, value: "0",
}, },
{ {
label: "生活", label: "生活",
value: 1, value: "1",
}, },
{ {
label: "医学知识", label: "医学知识",
value: 2, value: "2",
}, },
{ {
label: "其他", label: "其他",
value: 3, value: "3",
}, },
], ],
selectType: 0, selectType: "0",
listLoading: false, listLoading: false,
columns: [ columns: [
{ {
...@@ -151,13 +159,15 @@ export default { ...@@ -151,13 +159,15 @@ export default {
}, },
{ {
label: "图片", label: "图片",
type: "img",
minWidth: 120, minWidth: 120,
value: "iamge", value: "imgPath",
}, },
{ {
label: "文件", label: "文件",
minWidth: 120, minWidth: 120,
value: "file", type: "file",
value: "filePath",
}, },
{ {
label: "上传时间", label: "上传时间",
...@@ -167,18 +177,18 @@ export default { ...@@ -167,18 +177,18 @@ export default {
{ {
label: "最新修改时间", label: "最新修改时间",
minWidth: 120, minWidth: 120,
value: "editTime", value: "updateTime",
}, },
{ {
label: "上传人姓名", label: "上传人姓名",
minWidth: 120, minWidth: 120,
value: "uploadPerson", value: "uploadUserName",
}, },
{ {
label: "启用状态", label: "启用状态",
minWidth: 120, minWidth: 120,
type: "switch", type: "switch",
value: "isOpen", value: "status",
func: this.openChage, func: this.openChage,
}, },
{ {
...@@ -206,7 +216,7 @@ export default { ...@@ -206,7 +216,7 @@ export default {
}, },
}, },
{ {
func: this.rowOpration, func: this.deleteFunc,
style: { style: {
color: "#FA6400", color: "#FA6400",
}, },
...@@ -235,19 +245,19 @@ export default { ...@@ -235,19 +245,19 @@ export default {
selectGroup: [ selectGroup: [
{ {
label: "筛查", label: "筛查",
value: 1, value: "1",
}, },
{ {
label: "生活", label: "生活",
value: 2, value: "2",
}, },
{ {
label: "医学知识", label: "医学知识",
value: 3, value: "3",
}, },
{ {
label: "其他", label: "其他",
value: 4, value: "4",
}, },
], ],
}, },
...@@ -274,12 +284,9 @@ export default { ...@@ -274,12 +284,9 @@ export default {
prop: "status", prop: "status",
}, },
], ],
rules: { // form: {
title: [{ required: true, message: "请输入标题", trigger: "blur" }], // status: 1,
}, // },
form: {
status: 1,
},
} }
}, },
watch: {}, watch: {},
...@@ -287,9 +294,6 @@ export default { ...@@ -287,9 +294,6 @@ export default {
this.getArticleList() this.getArticleList()
}, },
methods: { methods: {
fileSuccess(val) {
console.log(this.form)
},
// 获取健康科普 // 获取健康科普
getArticleList() { getArticleList() {
this.listLoading = true this.listLoading = true
...@@ -297,7 +301,7 @@ export default { ...@@ -297,7 +301,7 @@ export default {
size: this.pageSize, size: this.pageSize,
current: this.pageIndex, current: this.pageIndex,
moduleType: "4", moduleType: "4",
articleType: this.selectType + 1, articleType: this.selectType - 0 + 1,
} }
articleList(params) articleList(params)
.then((res) => { .then((res) => {
...@@ -311,72 +315,6 @@ export default { ...@@ -311,72 +315,6 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
// 添加文章
addMedical() {
this.readOnly = false
this.addVisible = true
},
// 查看
viewMedical() {
this.readOnly = true
this.form = {
title: "123",
}
this.addVisible = true
},
// 编辑医联体
editMedical(data) {
this.readOnly = false
console.log(data)
this.form = {
medicalName: "黑乎乎",
medicalId: "123",
province: "001",
city: "001",
}
this.addVisible = true
},
// 启用状态
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) {
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
}
})
},
}, },
} }
</script> </script>
...@@ -412,15 +350,10 @@ export default { ...@@ -412,15 +350,10 @@ export default {
::v-deep .el-dialog__footer { ::v-deep .el-dialog__footer {
border-top: none; border-top: none;
text-align: center; text-align: center;
.el-button { .f-btn {
width: 100px; width: 100px;
height: 32px; height: 32px;
background: #4e68ff; background: #4e68ff;
} }
} }
::v-deep .el-upload {
.el-button {
transform: translateY(-4px);
}
}
</style> </style>
...@@ -18,66 +18,105 @@ ...@@ -18,66 +18,105 @@
@currentPageChange="handleCurrentChange" @currentPageChange="handleCurrentChange"
/> />
</div> </div>
<!-- 删除提示框 --> <el-dialog
<el-dialog title="提示" :visible.sync="deleteVisible" width="30%"> :visible.sync="addVisible"
<span>确定删除吗?</span> width="520px"
<span slot="footer" class="dialog-footers"> :show-close="true"
<el-button @click="deleteVisible = false">取 消</el-button> @closed="resetForm"
<el-button type="primary" @click="confirmDelete">确 定</el-button> >
</span> <div class="title">{{ readOnly ? "查看" : "添加" }}</div>
</el-dialog>
<!-- <el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
<div class="title">添加医联体</div>
<el-form <el-form
ref="form"
:model="form" :model="form"
:label-position="'right'" :label-position="'right'"
label-width="110px" label-width="110px"
label-suffix=":" label-suffix=":"
:disabled="readOnly"
> >
<el-form-item <el-form-item
v-for="(item, index) in formList" v-for="(item, index) in formList"
:key="index" :key="index"
:label="item.label" :label="item.label"
:prop="item.prop"
:rules="[{ required: true, message: item.label + '不能为空' }]"
> >
<el-input <!-- <template v-if="!readOnly"> -->
v-if="item.type == 'input'" <template>
v-model="form[item.prop]" <!-- 输入框 -->
autocomplete="off" <el-input
:placeholder="'请填写' + item.label" v-if="item.type == 'input'"
></el-input> v-model="form[item.prop]"
<el-select autocomplete="off"
v-if="item.type == 'select'" :placeholder="'请填写' + item.label"
v-model="form[item.prop]" ></el-input>
:placeholder="'请选择' + item.label" <!-- 下拉选 -->
> <el-select
<el-option v-else-if="item.type == 'select'"
v-for="e in item.selectGroup" v-model="form[item.prop]"
:key="e.value" :placeholder="'请选择' + item.label"
:label="e.label" style="width: 100%"
:value="e.value" >
></el-option> <el-option
</el-select> v-for="e in item.selectGroup"
:key="e.value"
:label="e.label"
:value="e.value"
></el-option>
</el-select>
<!-- 上传 -->
<el-upload-self
v-else-if="item.type === 'upload'"
v-model="form[item.prop]"
:btn-type="'text'"
v-bind="item"
:list-type="item.listType"
:accept="item.accept"
:limit="item.limit"
:disabled="readOnly"
></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>
<!-- <template v-else>
<span>{{ form[item.prop] || "--" }}</span>
</template> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addVisible = false">保存</el-button> <el-button class="f-btn" type="primary" @click="submitForm('1')"
>保存</el-button
>
</span> </span>
</el-dialog> --> </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> </div>
</template> </template>
<script> <script>
import CustomsTable from "@/components/CustomsTable" import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin" import paginationMixin from "@/components/TabComponents/mixin"
import { import ElUploadSelf from "@/components/Upload"
articleList, import mixin from "./mixin"
articleEnable, import { articleList } from "@/api/operation-management"
deleteArticle,
} from "@/api/operation-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
ElUploadSelf,
}, },
mixins: [paginationMixin], mixins: [paginationMixin, mixin],
data() { data() {
return { return {
addVisible: false, addVisible: false,
...@@ -92,7 +131,8 @@ export default { ...@@ -92,7 +131,8 @@ export default {
{ {
label: "文件", label: "文件",
minWidth: 120, minWidth: 120,
value: "fileCode", type: "file",
value: "filePath",
}, },
{ {
label: "上传时间", label: "上传时间",
...@@ -123,7 +163,7 @@ export default { ...@@ -123,7 +163,7 @@ export default {
operType: "button", operType: "button",
operations: [ operations: [
{ {
func: this.editMedical, func: this.viewMedical,
formatter(row) { formatter(row) {
return { return {
label: "查看", label: "查看",
...@@ -164,29 +204,21 @@ export default { ...@@ -164,29 +204,21 @@ export default {
formList: [ formList: [
{ {
type: "input", type: "input",
label: "医联体名称", label: "标题",
prop: "medicalName", prop: "articleTitle",
},
{
type: "input",
label: "医联体编号",
prop: "medicalId",
}, },
{ {
type: "select", type: "upload",
label: "", label: "PDF",
prop: "province", prop: "filePath",
selectGroup: [{ label: "北京市", value: "001" }], accept: "application/pdf",
}, },
{ {
type: "select", type: "switch",
label: "", label: "启用状态",
prop: "city", prop: "status",
selectGroup: [{ label: "北京市", value: "001" }],
}, },
], ],
form: {},
deleteId: "",
} }
}, },
watch: {}, watch: {},
...@@ -194,24 +226,6 @@ export default { ...@@ -194,24 +226,6 @@ export default {
this.getArticleList() this.getArticleList()
}, },
methods: { 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() { getArticleList() {
this.listLoading = true this.listLoading = true
...@@ -232,35 +246,6 @@ export default { ...@@ -232,35 +246,6 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
// 添加医联体
addMedical() {
this.addVisible = true
},
// 编辑医联体
editMedical(data) {
console.log(data)
this.form = {
medicalName: "黑乎乎",
medicalId: "123",
province: "001",
city: "001",
}
this.addVisible = true
},
// 启用状态
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()
}
})
},
}, },
} }
</script> </script>
......
...@@ -18,41 +18,89 @@ ...@@ -18,41 +18,89 @@
@currentPageChange="handleCurrentChange" @currentPageChange="handleCurrentChange"
/> />
</div> </div>
<el-dialog :visible.sync="addVisible" width="520px" :show-close="true"> <el-dialog
<div class="title">添加医联体</div> :visible.sync="addVisible"
width="520px"
:show-close="true"
@closed="resetForm"
>
<div class="title">{{ readOnly ? "查看" : "添加" }}</div>
<el-form <el-form
ref="form"
:model="form" :model="form"
:label-position="'right'" :label-position="'right'"
label-width="110px" label-width="110px"
label-suffix=":" label-suffix=":"
:disabled="readOnly"
> >
<el-form-item <el-form-item
v-for="(item, index) in formList" v-for="(item, index) in formList"
:key="index" :key="index"
:label="item.label" :label="item.label"
:prop="item.prop"
:rules="[{ required: true, message: item.label + '不能为空' }]"
> >
<el-input <!-- <template v-if="!readOnly"> -->
v-if="item.type == 'input'" <template>
v-model="form[item.prop]" <!-- 输入框 -->
autocomplete="off" <el-input
:placeholder="'请填写' + item.label" v-if="item.type == 'input'"
></el-input> v-model="form[item.prop]"
<el-select autocomplete="off"
v-if="item.type == 'select'" :placeholder="'请填写' + item.label"
v-model="form[item.prop]" ></el-input>
:placeholder="'请选择' + item.label" <!-- 下拉选 -->
> <el-select
<el-option v-else-if="item.type == 'select'"
v-for="e in item.selectGroup" v-model="form[item.prop]"
:key="e.value" :placeholder="'请选择' + item.label"
:label="e.label" style="width: 100%"
:value="e.value" >
></el-option> <el-option
</el-select> v-for="e in item.selectGroup"
:key="e.value"
:label="e.label"
:value="e.value"
></el-option>
</el-select>
<!-- 上传 -->
<el-upload-self
v-else-if="item.type === 'upload'"
v-model="form[item.prop]"
:btn-type="'text'"
v-bind="item"
:list-type="item.listType"
:accept="item.accept"
:limit="item.limit"
:disabled="readOnly"
></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>
<!-- <template v-else>
<span>{{ form[item.prop] || "--" }}</span>
</template> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addVisible = false">保存</el-button> <el-button class="f-btn" type="primary" @click="submitForm('2')"
>保存</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> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -60,30 +108,31 @@ ...@@ -60,30 +108,31 @@
<script> <script>
import CustomsTable from "@/components/CustomsTable" import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin" import paginationMixin from "@/components/TabComponents/mixin"
import { import ElUploadSelf from "@/components/Upload"
articleList, import mixin from "./mixin"
articleEnable, import { articleList } from "@/api/operation-management"
deleteArticle,
} from "@/api/operation-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
ElUploadSelf,
}, },
mixins: [paginationMixin], mixins: [paginationMixin, mixin],
data() { data() {
return { return {
addVisible: false, addVisible: false,
listLoading: false, listLoading: false,
deleteVisible: false,
columns: [ columns: [
{ {
label: "标题", label: "标题",
minWidth: 120, minWidth: 120,
value: "title", value: "articleTitle",
}, },
{ {
label: "文件", label: "文件",
minWidth: 120, minWidth: 120,
value: "file", type: "file",
value: "filePath",
}, },
{ {
label: "上传时间", label: "上传时间",
...@@ -93,12 +142,12 @@ export default { ...@@ -93,12 +142,12 @@ export default {
{ {
label: "最新修改时间", label: "最新修改时间",
minWidth: 120, minWidth: 120,
value: "editTime", value: "updateTime",
}, },
{ {
label: "上传人姓名", label: "上传人姓名",
minWidth: 120, minWidth: 120,
value: "uploadPerson", value: "uploadUserName",
}, },
{ {
label: "启用状态", label: "启用状态",
...@@ -114,7 +163,7 @@ export default { ...@@ -114,7 +163,7 @@ export default {
operType: "button", operType: "button",
operations: [ operations: [
{ {
func: this.editMedical, func: this.viewMedical,
formatter(row) { formatter(row) {
return { return {
label: "查看", label: "查看",
...@@ -132,7 +181,7 @@ export default { ...@@ -132,7 +181,7 @@ export default {
}, },
}, },
{ {
func: this.rowOpration, func: this.deleteFunc,
style: { style: {
color: "#FA6400", color: "#FA6400",
}, },
...@@ -146,32 +195,30 @@ export default { ...@@ -146,32 +195,30 @@ export default {
], ],
}, },
], ],
tableData: [], tableData: [
// {
// title: "第一个",
// isOpen: true,
// },
],
formList: [ formList: [
{ {
type: "input", type: "input",
label: "医联体名称", label: "标题",
prop: "medicalName", prop: "articleTitle",
},
{
type: "input",
label: "医联体编号",
prop: "medicalId",
}, },
{ {
type: "select", type: "upload",
label: "", label: "PDF",
prop: "province", prop: "filePath",
selectGroup: [{ label: "北京市", value: "001" }], accept: "application/pdf",
}, },
{ {
type: "select", type: "switch",
label: "", label: "启用状态",
prop: "city", prop: "status",
selectGroup: [{ label: "北京市", value: "001" }],
}, },
], ],
form: {},
} }
}, },
watch: {}, watch: {},
...@@ -179,7 +226,7 @@ export default { ...@@ -179,7 +226,7 @@ export default {
this.getArticleList() this.getArticleList()
}, },
methods: { methods: {
// 获取通知公告 // 获取新闻会议
getArticleList() { getArticleList() {
this.listLoading = true this.listLoading = true
let params = { let params = {
...@@ -199,31 +246,13 @@ export default { ...@@ -199,31 +246,13 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
// 添加医联体
addMedical() {
this.addVisible = true
},
// 编辑医联体
editMedical(data) {
console.log(data)
this.form = {
medicalName: "黑乎乎",
medicalId: "123",
province: "001",
city: "001",
}
this.addVisible = true
},
// 启用状态
openChage(data, index) {
console.log(data, index)
},
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
#medicalunion-management { #medicalunion-management {
padding: 20px 0; padding: 20px 0;
.top-btn { .top-btn {
.btn { .btn {
width: 80px; width: 80px;
...@@ -252,7 +281,7 @@ export default { ...@@ -252,7 +281,7 @@ export default {
::v-deep .el-dialog__footer { ::v-deep .el-dialog__footer {
border-top: none; border-top: none;
text-align: center; text-align: center;
.el-button { .f-btn {
width: 100px; width: 100px;
height: 32px; height: 32px;
background: #4e68ff; background: #4e68ff;
......
import {
articleEnable,
deleteArticle,
addArticle,
} from "@/api/operation-management"
const mixin = {
data() {
return {
readOnly: true,
addVisible: false,
deleteVisible: false,
deleteId: "",
form: {
status: 1,
},
}
},
methods: {
// 添加文章
addMedical() {
this.readOnly = false
this.addVisible = true
},
// 查看
viewMedical(data) {
this.readOnly = true
this.form = { ...data }
this.addVisible = true
},
// 编辑医联体
editMedical(data) {
this.readOnly = false
this.form = JSON.parse(JSON.stringify(data))
this.addVisible = true
},
// 启用状态
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(moduleType) {
this.$refs["form"].validate((valid) => {
if (valid) {
addArticle({
...this.form,
moduleType: moduleType,
}).then((res) => {
if (res.code == 1) {
this.addVisible = false
this.$refs["form"].resetFields()
this.form = {
status: 1,
}
this.getArticleList()
}
})
} else {
console.log("error submit!!")
return false
}
})
},
// 删除
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(() => {})
},
},
}
export default mixin
...@@ -357,9 +357,4 @@ export default { ...@@ -357,9 +357,4 @@ export default {
background: #4e68ff; background: #4e68ff;
} }
} }
::v-deep .el-upload {
.el-button {
transform: translateY(-4px);
}
}
</style> </style>
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