意见反馈
continuous-integration/drone/push Build is passing

This commit is contained in:
DESKTOP-6C3NK6N\WXS
2024-08-01 09:31:58 +08:00
parent fc6d0c7b35
commit c13fe6b521
7 changed files with 223 additions and 83 deletions
+4 -3
View File
@@ -3,15 +3,16 @@ import FEEDBACKCOMP from "./index.vue";
const FBConstructor = Vue.extend(FEEDBACKCOMP);
const FB = options => {
const { cancelBack } = options;
// if (!UserId) throw `UserId is requred.but ${UserId}`
const { type, cancelBack, trialId = null, Id = null } = options;
if (!type) throw `type is requred.but ${type}`
const id = `FB${new Date().getTime()}`;
const instance = new FBConstructor();
instance.id = id;
instance.vm = instance.$mount();
if (instance.vm.visible) return;
document.body.appendChild(instance.vm.$el);
instance.vm.open();
console.log(type);
instance.vm.open({ type, trialId, Id });
instance.vm.$on("success", (Id) => {
});
instance.vm.$on("closed", () => {
+75 -12
View File
@@ -1,6 +1,6 @@
<template>
<!--FEEDBACK-->
<div v-if="visible" @click.stop="()=>false">
<div v-if="visible" @click.stop="() => false">
<el-dialog
:visible.sync="visible"
v-dialogDrag
@@ -18,6 +18,7 @@
:model="form"
:inline="true"
class="trialsForm"
v-if="type === 'detail'"
>
<el-form-item :label="$t('feedBack:trials:code')">
<span>2024-06-28 15:00</span>
@@ -41,7 +42,7 @@
label-width="100px"
>
<!-- 影像异常tip -->
<p class="tip">
<p class="tip" v-if="type === 'imgfail'">
<i
class="el-icon-warning-outline"
style="color: #f56c6c; font-size: 24px"
@@ -49,16 +50,27 @@
<span> 影像异常导致无法阅片</span>
</p>
<!-- 问题反馈 -->
<el-form-item :label="$t('feedBack:form:feedBack')" prop="feedBack">
<el-select v-model="form.value" style="width: 100%">
<el-form-item
:label="$t('feedBack:form:feedBack')"
prop="feedBack"
v-if="type === 'feedback' && trialId"
>
<el-select v-model="form.type" style="width: 100%">
<el-option
v-for="item in options"
:key="item.value"
:key="item.id"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<!-- 问题反馈 -->
<el-form-item
:label="$t('feedBack:form:feedBack')"
prop="feedBack"
v-if="type === 'detail'"
>
<span>影像异常导致无法阅片</span>
</el-form-item>
<!-- 问题描述 -->
@@ -66,21 +78,34 @@
:label="$t('feedBack:form:description')"
prop="description"
>
<el-input v-model="form.Code" type="textarea" :rows="4" />
<el-input
v-model="form.Code"
type="textarea"
:rows="4"
:disabled="type === 'detail'"
/>
</el-form-item>
<!-- 截图 -->
<el-form-item :label="$t('feedBack:form:screenshot')" prop="screenshot">
<uploadImage
:path.sync="form.HospitalLogoPath"
:disabled="disabled"
:disabled="type === 'detail'"
/>
</el-form-item>
<!-- 反馈时间 -->
<el-form-item :label="$t('feedBack:form:time')" prop="screenshot">
<el-form-item
:label="$t('feedBack:form:time')"
prop="screenshot"
v-if="type === 'detail'"
>
<span>2024-06-28 15:00</span>
</el-form-item>
<!-- 状态 -->
<el-form-item :label="$t('feedBack:form:status')" prop="screenshot">
<el-form-item
:label="$t('feedBack:form:status')"
prop="screenshot"
v-if="type === 'detail'"
>
<el-switch
v-model="form.status"
active-color="#13ce66"
@@ -89,11 +114,12 @@
:inactive-value="false"
:active-text="$fd('FeedBackStatus', true)"
:inactive-text="$fd('FeedBackStatus', false)"
:disabled="level < 8"
>
</el-switch>
</el-form-item>
</el-form>
<div slot="footer">
<div slot="footer" v-if="type !== 'detail'">
<!-- 取消 -->
<el-button size="small" @click.stop="cancel">
{{ $t("feedBack:button:cancel") }}
@@ -122,11 +148,16 @@ export default {
visible: false,
loading: false,
options: [],
type: null, // detail 表格详情 feedback 填写反馈 imgfail 影像异常
trialId: null,
Id: null,
form: {
Code: null,
UserId: null,
EMail: null,
username: null,
HospitalLogoPath: [],
type: 0,
},
rules: {
Code: [
@@ -154,13 +185,30 @@ export default {
};
},
computed: {
disabled() {
return false;
level() {
if (this.hasPermi(["role:dev", "role:admin"])) {
return 9;
}
if (this.hasPermi(["role:pm"])) {
return 8;
}
if (this.hasPermi(["role:ir", "role:crc"])) {
return 7;
}
return 0;
},
},
methods: {
open(data) {
let { type, trialId, Id } = data;
this.type = type;
this.trialId = trialId;
this.Id = Id;
this.visible = true;
if (!Id) {
this.title = this.setTitle();
}
this.setTypeOption();
},
cancel() {
this.visible = false;
@@ -169,6 +217,21 @@ export default {
async save() {
this.cancel();
},
setTypeOption() {
if (!this.trialId) return (this.options = []);
if (this.hasPermi(["role:ir"]))
return (this.option = this.$d.FeedBackTypeToIR);
if (this.hasPermi(["role:crc"]))
return (this.option = this.$d.FeedBackTypeToCRC);
},
setTitle(code, name) {
if (this.hasPermi(["role:pm"])) {
return `${this.$t("feedBack:form:title:pm")}(${code},${name})`;
}
if (this.hasPermi(["role:ir", "role:crc"])) {
return `${this.$t("feedBack:form:title")}`;
}
},
},
};
</script>
+8 -2
View File
@@ -4,6 +4,7 @@
class="upload-demo"
:class="{ uploadDisabled: disabled ? true : false }"
action
multiple
:http-request="uploadFile"
:before-upload="beforeUpload"
:file-list="fileList"
@@ -70,7 +71,7 @@ export default {
},
methods: {
remove(file, fileList) {
this.$emit("update:path", null);
// this.$emit("update:path", null);
},
fileToBlob(file) {
// 创建 FileReader 对象
@@ -125,6 +126,11 @@ export default {
let res = await this.uploadToOSS(fileName, file);
this.btnDisabled = false;
if (!res) return;
this.fileList.push({
url: this.OSSclientConfig.basePath + res.name,
path: res.name,
uid: param.file.uid,
});
this.$emit("update:path", [...this.path, res.name]);
return false;
},
@@ -159,7 +165,7 @@ export default {
handleRemove(file) {
let index = this.fileList.findIndex((item) => item.uid === file.uid);
this.fileList.splice(index, 1);
let arr = this.fileList.map((item) => item.name);
let arr = this.fileList.map((item) => item.path);
this.$emit("update:path", arr);
},
},