apm意见反馈详情权限
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-29 10:38:50 +08:00
parent 47dd21ea7e
commit 3bb0250699
2 changed files with 89 additions and 90 deletions

View File

@ -52,7 +52,7 @@
class="el-icon-warning-outline" class="el-icon-warning-outline"
style="color: #f56c6c; font-size: 24px" style="color: #f56c6c; font-size: 24px"
></i> ></i>
<span>{{ $t("feedBack:imgfail:tip") }}</span> <span>{{ $t('feedBack:imgfail:tip') }}</span>
</p> </p>
<!-- 问题反馈 --> <!-- 问题反馈 -->
<el-form-item <el-form-item
@ -140,7 +140,7 @@
<div slot="footer" v-if="type !== 'detail' || isImgfail"> <div slot="footer" v-if="type !== 'detail' || isImgfail">
<!-- 取消 --> <!-- 取消 -->
<el-button size="small" @click.stop="cancel"> <el-button size="small" @click.stop="cancel">
{{ $t("feedBack:button:cancel") }} {{ $t('feedBack:button:cancel') }}
</el-button> </el-button>
<!-- 保存 --> <!-- 保存 -->
<el-button <el-button
@ -149,21 +149,21 @@
@click.stop="save" @click.stop="save"
:loading="loading" :loading="loading"
> >
{{ $t("feedBack:button:save") }} {{ $t('feedBack:button:save') }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import uploadImage from "./uploadImage.vue"; import uploadImage from './uploadImage.vue'
import { import {
addOrUpdateUserFeedBack, addOrUpdateUserFeedBack,
getUserFeedBackInfo, getUserFeedBackInfo,
batchUpdateFeedBackState, batchUpdateFeedBackState,
} from "@/api/trials.js"; } from '@/api/trials.js'
export default { export default {
name: "FB", name: 'FB',
components: { uploadImage }, components: { uploadImage },
data() { data() {
return { return {
@ -195,131 +195,131 @@ export default {
QuestionType: [ QuestionType: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
], ],
QuestionDescription: [ QuestionDescription: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (value.length < 5) { if (value.length < 5) {
callback( callback(
new Error(this.$t("feedBack:ruleMessage:lengthLimitMin5")) new Error(this.$t('feedBack:ruleMessage:lengthLimitMin5'))
); )
} }
callback(); callback()
}, },
trigger: "blur", trigger: 'blur',
}, },
], ],
}, },
isUpload: false, isUpload: false,
}; }
}, },
computed: { computed: {
level() { level() {
if (this.hasPermi(["role:dev", "role:admin"])) { if (this.hasPermi(['role:dev', 'role:admin'])) {
return 9; return 9
} }
if (this.hasPermi(["role:pm"])) { if (this.hasPermi(['role:pm', 'role:apm'])) {
return 8; return 8
} }
if (this.hasPermi(["role:ir", "role:crc"])) { if (this.hasPermi(['role:ir', 'role:crc'])) {
return 7; return 7
} }
return 0; return 0
}, },
QuestionTypeOptions() { QuestionTypeOptions() {
if (this.level > 7) { if (this.level > 7) {
return [ return [
...this.$d.FeedBackTypeToCRC.filter((item) => item.value > 0), ...this.$d.FeedBackTypeToCRC.filter((item) => item.value > 0),
...this.$d.FeedBackTypeToIR, ...this.$d.FeedBackTypeToIR,
]; ]
} }
if (this.hasPermi(["role:ir"])) { if (this.hasPermi(['role:ir'])) {
return this.$d.FeedBackTypeToIR; return this.$d.FeedBackTypeToIR
} }
if (this.hasPermi(["role:crc"])) { if (this.hasPermi(['role:crc'])) {
return this.$d.FeedBackTypeToCRC; return this.$d.FeedBackTypeToCRC
} }
return []; return []
}, },
}, },
methods: { methods: {
open(data) { open(data) {
let { type, trialId, Id, visitTaskId, SubjectVisitId } = data; let { type, trialId, Id, visitTaskId, SubjectVisitId } = data
this.type = type; this.type = type
this.trialId = trialId; this.trialId = trialId
this.Id = Id; this.Id = Id
this.visitTaskId = visitTaskId; this.visitTaskId = visitTaskId
this.SubjectVisitId = SubjectVisitId; this.SubjectVisitId = SubjectVisitId
if (visitTaskId) { if (visitTaskId) {
this.isImgfail = true; this.isImgfail = true
} }
this.setTypeOption(); this.setTypeOption()
if (!Id) { if (!Id) {
this.title = this.setTitle(); this.title = this.setTitle()
} }
if (Id || visitTaskId) { if (Id || visitTaskId) {
this.getInfo(Id, visitTaskId); this.getInfo(Id, visitTaskId)
} }
this.visible = true; this.visible = true
}, },
cancel() { cancel() {
this.visible = false; this.visible = false
this.$emit("closed"); this.$emit('closed')
}, },
async save() { async save() {
try { try {
let validate = await this.$refs.feedBackForm.validate(); let validate = await this.$refs.feedBackForm.validate()
if (!validate) return; if (!validate) return
if (this.trialId) { if (this.trialId) {
this.form.TrialId = this.trialId; this.form.TrialId = this.trialId
} }
if (this.visitTaskId) { if (this.visitTaskId) {
this.form.VisitTaskId = this.visitTaskId; this.form.VisitTaskId = this.visitTaskId
} }
if (this.SubjectVisitId) { if (this.SubjectVisitId) {
this.form.SubjectVisitId = this.SubjectVisitId; this.form.SubjectVisitId = this.SubjectVisitId
} }
if (this.Id) { if (this.Id) {
this.form.Id = this.Id; this.form.Id = this.Id
} }
this.loading = true; this.loading = true
let res = await addOrUpdateUserFeedBack(this.form); let res = await addOrUpdateUserFeedBack(this.form)
this.loading = false; this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.$emit("success"); this.$emit('success')
this.$message.success(this.$t("feedBack:save:success")); this.$message.success(this.$t('feedBack:save:success'))
this.cancel(); this.cancel()
} }
} catch (err) { } catch (err) {
this.loading = false; this.loading = false
console.log(err); console.log(err)
} }
}, },
// //
async changeState() { async changeState() {
if (this.isImgfail) return; if (this.isImgfail) return
try { try {
let data = { let data = {
IdList: [this.Id], IdList: [this.Id],
State: this.form.State, State: this.form.State,
}; }
let res = await batchUpdateFeedBackState(data); let res = await batchUpdateFeedBackState(data)
if (res.IsSuccess) { if (res.IsSuccess) {
this.$message.success(this.$t("feedBack:changeState:success")); this.$message.success(this.$t('feedBack:changeState:success'))
this.$emit("success"); this.$emit('success')
// this.cancel(); // this.cancel();
this.getInfo(this.Id, this.visitTaskId); this.getInfo(this.Id, this.visitTaskId)
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
// //
@ -328,56 +328,56 @@ export default {
let data = { let data = {
Id, Id,
visitTaskId, visitTaskId,
}; }
let res = await getUserFeedBackInfo(data); let res = await getUserFeedBackInfo(data)
if (res.IsSuccess && res.Result) { if (res.IsSuccess && res.Result) {
this.form = res.Result; this.form = res.Result
this.form.ScreenshotList = this.form.ScreenshotList || [] this.form.ScreenshotList = this.form.ScreenshotList || []
this.Id = res.Result.Id; this.Id = res.Result.Id
if (res.Result.State > 0) { if (res.Result.State > 0) {
this.isStateChange = false; this.isStateChange = false
} }
if (res.Result.VisitTaskId) { if (res.Result.VisitTaskId) {
this.visitTaskId = res.Result.VisitTaskId; this.visitTaskId = res.Result.VisitTaskId
} }
if (res.Result.SubjectVisitId) { if (res.Result.SubjectVisitId) {
this.SubjectVisitId = res.Result.SubjectVisitId; this.SubjectVisitId = res.Result.SubjectVisitId
} }
let code = this.$fd("UserType", res.Result.UserTypeEnum); let code = this.$fd('UserType', res.Result.UserTypeEnum)
this.title = this.setTitle(code, res.Result.FeedBackFullName); this.title = this.setTitle(code, res.Result.FeedBackFullName)
if (visitTaskId) { if (visitTaskId) {
code = `${res.Result.SubjectCode}-${res.Result.SubjectVisitName}`; code = `${res.Result.SubjectCode}-${res.Result.SubjectVisitName}`
this.title = this.setTitle(code, res.Result.FeedBackFullName); this.title = this.setTitle(code, res.Result.FeedBackFullName)
} }
this.$refs.uploadImage.initFileList(res.Result.ScreenshotList); this.$refs.uploadImage.initFileList(res.Result.ScreenshotList)
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
setTypeOption() { setTypeOption() {
if (!this.trialId) return (this.options = []); if (!this.trialId) return (this.options = [])
if (this.hasPermi(["role:ir"])) if (this.hasPermi(['role:ir']))
return (this.option = this.$d.FeedBackTypeToIR); return (this.option = this.$d.FeedBackTypeToIR)
if (this.hasPermi(["role:crc"])) if (this.hasPermi(['role:crc']))
return (this.option = this.$d.FeedBackTypeToCRC); return (this.option = this.$d.FeedBackTypeToCRC)
}, },
setTitle(code, name) { setTitle(code, name) {
if (this.hasPermi(["role:pm"]) && this.visitTaskId) { if (this.hasPermi(['role:pm']) && this.visitTaskId) {
return `${this.$t("feedBack:form:title:pm2")}(${code}/${name})`; return `${this.$t('feedBack:form:title:pm2')}(${code}/${name})`
} }
if (this.hasPermi(["role:pm", "role:dev", "role:admin"])) { if (this.hasPermi(['role:pm', 'role:dev', 'role:admin'])) {
return `${this.$t("feedBack:form:title:pm")}(${code},${name})`; return `${this.$t('feedBack:form:title:pm')}(${code},${name})`
} }
if (this.hasPermi(["role:ir", "role:crc"]) && this.type === "detail") { if (this.hasPermi(['role:ir', 'role:crc']) && this.type === 'detail') {
return `${this.$t("feedBack:form:detail:title")}`; return `${this.$t('feedBack:form:detail:title')}`
} }
if (this.hasPermi(["role:ir", "role:crc"])) { if (this.hasPermi(['role:ir', 'role:crc'])) {
return `${this.$t("feedBack:form:title")}`; return `${this.$t('feedBack:form:title')}`
} }
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tip { .tip {

View File

@ -136,7 +136,6 @@ export default {
uid: `${name[name.length - 1]}${index}`, uid: `${name[name.length - 1]}${index}`,
}); });
}); });
console.log(this.fileList);
} }
}, },
async uploadFile(param) { async uploadFile(param) {