Commit 0b4be06c authored by miaojiale's avatar miaojiale

Merge branch 'dev' into dev_Miaojiale

parents 93233e79 1bd4127d
NODE_ENV = 'production' NODE_ENV = 'production'
VUE_APP_BASE_API = '/disease-api/' VUE_APP_BASE_API = '/geca-api/'
...@@ -19,8 +19,15 @@ ...@@ -19,8 +19,15 @@
> >
<div class="flex"> <div class="flex">
<div> <div>
<el-upload-self
v-if="item.type === 'upload'"
v-bind="item"
:upload-query="{ formId, patientId, prefix: item.prop }"
v-model="form[item.prop]"
:disabled="item.disabled"
></el-upload-self>
<!-- 表单改文本 --> <!-- 表单改文本 -->
<template v-if="vwForm.detail"> <template v-else-if="vwForm.detail">
<form-item-text :item="item" :form="form"></form-item-text> <form-item-text :item="item" :form="form"></form-item-text>
</template> </template>
<template v-else> <template v-else>
...@@ -342,12 +349,6 @@ ...@@ -342,12 +349,6 @@
> >
</el-date-picker> </el-date-picker>
</template> </template>
<el-upload-self
v-if="item.type === 'upload'"
v-bind="item"
v-model="form[item.prop]"
:disabled="item.disabled"
></el-upload-self>
</div> </div>
<span <span
class="important_field" class="important_field"
...@@ -385,6 +386,11 @@ export default { ...@@ -385,6 +386,11 @@ export default {
vwForm: { vwForm: {
default: {}, default: {},
}, },
formId: {},
getPatientId: {
type: Function,
default: () => {},
},
getDefectsSet: { getDefectsSet: {
type: Function, type: Function,
default: () => {}, default: () => {},
...@@ -428,6 +434,9 @@ export default { ...@@ -428,6 +434,9 @@ export default {
defectsSet() { defectsSet() {
return this.getDefectsSet ? this.getDefectsSet() : [] return this.getDefectsSet ? this.getDefectsSet() : []
}, },
patientId() {
return this.getPatientId ? this.getPatientId() : ""
},
}, },
methods: { methods: {
scrollToView() { scrollToView() {
......
...@@ -54,7 +54,12 @@ export default { ...@@ -54,7 +54,12 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
bucketName: { type: String }, //后端上传文件路径(参数) uploadQuery: {
type: Object,
default: () => {
return {}
},
}, //后端上传文件路径(参数)
listType: String, listType: String,
tip: String, tip: String,
multiple: Boolean, multiple: Boolean,
...@@ -72,7 +77,7 @@ export default { ...@@ -72,7 +77,7 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
value: Array,//上传文件数组 绑定数组 value: Array, //上传文件数组 绑定数组
}, },
data() { data() {
return { return {
...@@ -91,13 +96,8 @@ export default { ...@@ -91,13 +96,8 @@ export default {
if (newValue === oldValue) return if (newValue === oldValue) return
this.fileList = newValue.map((_) => { this.fileList = newValue.map((_) => {
return { return {
name: _.fileName, name: _.file_name,
url: url: `${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`,
this.httpPrefix +
"/disease-data/file/" +
_.bucketName +
"-" +
_.uuidName,
} }
}) })
}, },
...@@ -113,8 +113,7 @@ export default { ...@@ -113,8 +113,7 @@ export default {
action() { action() {
return ( return (
this.httpPrefix + this.httpPrefix +
"/disease-data/file/upload?bucketName=" + `/disease-data/file/upload?formId=${this.uploadQuery.formId}&patientId=${this.uploadQuery.patientId}&prefix=${this.uploadQuery.prefix}`
this.bucketName
) )
}, },
// 预览list // 预览list
...@@ -123,11 +122,7 @@ export default { ...@@ -123,11 +122,7 @@ export default {
return this.value.map((_) => { return this.value.map((_) => {
return ( return (
_.url || _.url ||
this.httpPrefix + `${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
"/disease-data/file/" +
_.bucketName +
"-" +
_.uuidName
) )
}) })
}, },
...@@ -163,27 +158,43 @@ export default { ...@@ -163,27 +158,43 @@ export default {
// 移除提醒 // 移除提醒
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.fileName || file.name}?`) return this.$confirm(`确定移除 ${file.file_name || file.name}?`)
}, },
// 移除 // 移除
handleRemove({ url }, fileList) { handleRemove({ url }, fileList) {
const i = this.value.findIndex((_) => url.endsWith(_.uuidName)) const i = this.value.findIndex((_) => url.endsWith(_.uuid_name))
if (i > -1) this.value.splice(i, 1)// 静态移除 if (i > -1) this.value.splice(i, 1) // 静态移除
}, },
// 查看 // 查看
handlePreview(file) { handlePreview(file) {
const name = file.fileName || file.name const name = file.fileName || file.name
this.title = name this.title = name
if (name.match(/\.(png|jpg|jpeg)/)) { let responseUrl
this.imgUrl = file.url if (file.response) {
this.$refs.image.clickHandler() const _ = file.response.data
} else { responseUrl = `${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
}
try {
if (name.match(/\.(png|jpg|jpeg)/)) {
this.imgUrl = file.url || responseUrl
this.$refs.image.clickHandler()
} else {
const elink = document.createElement("a")
elink.download = name
elink.style.display = "none"
elink.href = file.url || responseUrl
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
} catch {
const elink = document.createElement("a") const elink = document.createElement("a")
elink.download = name elink.download = name
elink.style.display = "none" elink.style.display = "none"
elink.href = file.url elink.href = file.url || responseUrl
document.body.appendChild(elink) document.body.appendChild(elink)
elink.click() elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象 URL.revokeObjectURL(elink.href) // 释放URL 对象
...@@ -204,6 +215,5 @@ export default { ...@@ -204,6 +215,5 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.el-upload-self { .el-upload-self {
font-size: 14px; font-size: 14px;
margin-bottom: 15px;
} }
</style> </style>
...@@ -82,6 +82,14 @@ export default { ...@@ -82,6 +82,14 @@ export default {
getAll: Boolean, // 获取页面所有数据 getAll: Boolean, // 获取页面所有数据
}, },
components: { CustomForm, TagsScrollBar }, components: { CustomForm, TagsScrollBar },
provide() {
return {
formId: this.form.formId,
getPatientId: () => {
return this.patientId || this.patientStandbyId
},
}
},
data() { data() {
return { return {
btnType: "", btnType: "",
......
...@@ -154,9 +154,9 @@ export default { ...@@ -154,9 +154,9 @@ export default {
}, },
methods: { methods: {
handleView(row) { handleView(row) {
this.handleAdd(row, true) this.handleAdd(row, null, true)
}, },
handleAdd({ patient_id, hzxx_xm }, disabled = false) { handleAdd({ patient_id, hzxx_xm }, index, disabled = false) {
this.disabled = disabled this.disabled = disabled
this.isDetail = true this.isDetail = true
this.patientId = patient_id || null this.patientId = patient_id || null
......
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
width: 80, width: 80,
formatter: (row) => { formatter: (row) => {
return this.$handle.formatDicList( return this.$handle.formatDicList(
this.dictMap["gender"], this.dictMap["d-sex"],
String(row.sex) String(row.sex)
) )
}, },
...@@ -249,7 +249,7 @@ export default { ...@@ -249,7 +249,7 @@ export default {
spanCount: 12, spanCount: 12,
prop: "sex", prop: "sex",
optsFormatter: () => { optsFormatter: () => {
return this.dictMap && this.dictMap["gender"] return this.dictMap && this.dictMap["d-sex"]
}, },
}, },
{ {
...@@ -273,14 +273,12 @@ export default { ...@@ -273,14 +273,12 @@ export default {
prop: "orgId", prop: "orgId",
opts: orgList, opts: orgList,
func: this.orgChange, func: this.orgChange,
rules: [{ required: true, message: "请选择机构" }],
}, },
{ {
type: "select", type: "select",
label: "科室", label: "科室",
spanCount: 12, spanCount: 12,
prop: "deptId", prop: "deptId",
rules: [{ required: true, message: "请选择科室" }],
opts: [], opts: [],
}, },
{ {
...@@ -478,7 +476,7 @@ export default { ...@@ -478,7 +476,7 @@ export default {
? { ? {
id, id,
name, name,
sex: String(sex), sex: sex ? String(sex) : "",
idCard, idCard,
phone, phone,
email, email,
......
...@@ -88,8 +88,8 @@ module.exports = { ...@@ -88,8 +88,8 @@ module.exports = {
}, },
proxy: { proxy: {
"/api": { "/api": {
// target: "http://192.168.31.140:11021/", target: "http://192.168.31.140:11021/",
target: "https://ds.cixincloud.com/geca-api/", // target: "https://ds.cixincloud.com/geca-api/",
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
"^/api": "", "^/api": "",
......
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