From 3cc4215e319fed347e917d964c643a1fe206a086 Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Mon, 8 Aug 2022 16:40:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=96=87=E6=A1=A3=E5=AF=B9?= =?UTF-8?q?=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 2 + jero-web/src/common/lang/zh-cn.js | 2 + .../classificationMaintenanceAdd.vue | 41 ++- .../classificationMaintenanceModel.vue | 21 +- .../components/listAddModel.vue | 315 ++++++++++++++++++ .../components/problemKnowledgeBaseAdd.vue | 255 +++++++++++--- .../components/problemKnowledgeBaseList.vue | 22 +- 7 files changed, 590 insertions(+), 68 deletions(-) create mode 100644 jero-web/src/views/businessSupport/problemKnowledgeBase/components/listAddModel.vue diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index b140fafa0..d69a1a14d 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1244,4 +1244,6 @@ module.exports = { punctuationmark:'Only English punctuation marks other than the # sign can be entered', created: 'Created', updated:'Updated', + OpenOne:'Open', + Privacy:'Privacy', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 60585341d..06f48e3e8 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1345,6 +1345,8 @@ module.exports = { Adjustareasofresponsibility:'调整责任领域', regulatoryTechnicalAssessment:'法规技术评估', punctuationmark:'只能输入除#号外的英文标点符号', + OpenOne:'公开', + Privacy:'私密', created: '创建时间', updated:'更新时间', } \ No newline at end of file diff --git a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/classificationMaintenanceAdd.vue b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/classificationMaintenanceAdd.vue index 5efb6b6bd..b1d02eb16 100644 --- a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/classificationMaintenanceAdd.vue +++ b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/classificationMaintenanceAdd.vue @@ -32,12 +32,12 @@ * {{$t('personCharge')}} - + + v-model="formInline.chargePersonIdName"/> @@ -48,7 +48,8 @@ + + \ No newline at end of file diff --git a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue index bb5cacdb6..f2bc6ff04 100644 --- a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue +++ b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue @@ -3,7 +3,7 @@
- + {{$t('newlyAdded')}} @@ -19,28 +19,28 @@ * {{$t('displayPermission')}}
- + + @change="showPermissionsChange" + v-model="formInline.showPermissions"> - - {{ item.projectName}} + :value="item.value"> + + {{ item.name}}
- +
* {{$t('authorizedUser')}}
- + * {{$t('title')}}
- + {{$t('problemClassification')}}
- - + + + + + {{item.problemLabel}} + + + @@ -88,13 +92,13 @@ * {{$t('market')}} - - + + :triggerChange="false" :dictCode="'region'"/> @@ -105,10 +109,10 @@
{{$t('standardNo')}}
- + @@ -150,10 +154,10 @@ - {{ (formInline.enclosure === 'null' || formInline.enclosure === '' + @click="clickButtonToUpload('accessoryFile')"> + {{ (formInline.accessoryFile === 'null' || formInline.accessoryFile === '' || - formInline.enclosure == null) ? $t('clickUpload') : $t('viewUploadedFiles') + formInline.accessoryFile == null) ? $t('clickUpload') : $t('viewUploadedFiles') }} @@ -161,9 +165,14 @@ +
+ {{$t('submit')}} +
+ {{$t('pleaseWaitWhileRunning')}} + @@ -175,6 +184,7 @@ import 'quill/dist/quill.core.css' import 'quill/dist/quill.snow.css' import 'quill/dist/quill.bubble.css' + import listAddModel from './listAddModel' import { quillEditor } from 'vue-quill-editor' export default { @@ -182,14 +192,72 @@ components: { PersonnelSelection, uploadFile, - quillEditor + quillEditor, + listAddModel }, data() { return { formInline: {}, - rules: {}, + loading: false, + problemTypeList: [], + rules: { + showPermissions: [ + { + required: true, + message: this.$t('displayPermission') + this.$t('cannotEmpty'), + trigger: 'change' + } + ], + studioEngineerName: [ + { + required: true, + message: this.$t('authorizedUser') + this.$t('cannotEmpty'), + trigger: 'change' + } + ], + title: [ + { + required: true, + message: this.$t('title') + this.$t('cannotEmpty'), + trigger: 'blur' + }, + { + max: 100, + message: this.$t('title') + this.$t('cannotExceed') + 100 + this.$t('Characters'), + trigger: 'blur' + } + ], + problemType: [ + { + required: true, + message: this.$t('problemClassification') + this.$t('cannotEmpty'), + trigger: 'change' + } + ], + targetMarket: [ + { + required: true, + message: this.$t('market') + this.$t('cannotEmpty'), + trigger: 'change' + } + ] + }, + url: { + add: '/problemKnowledgeBase/problemKnowledgeBaseEO/add', + edit: '/problemKnowledgeBase/problemKnowledgeBaseEO/edit' + }, + isDisplay: false, disabled: false, - projectNameList: [], + projectNameList: [ + { + value: 'Open', + name: this.$t('OpenOne') + }, + { + value: 'Privacy', + name: this.$t('Privacy') + } + ], content: '

I am Example

', editorOption: { // Some Quill options... @@ -203,34 +271,92 @@ }, mounted() { document.title = this.$t('problemKnowledgeBase') + this.$t('newlyAdded') + this.getBase() + if (this.$route.query.id) { + this.queryById() + } }, methods: { + getBase() { + getAction('/problemKnowledgeBase/problemKnowledgeBaseClassifyEO/list', {}).then((res) => { + if (res.success) { + this.problemTypeList = res.result || [] + } else { + this.problemTypeList = [] + } + }) + }, + queryById() { + let query = { + id: this.$route.query.id + } + getAction('/problemKnowledgeBase/problemKnowledgeBaseEO/queryById', query).then((res) => { + if (res.success) { + this.formInline = res.result || {} + this.formInline = { ...this.formInline } + if (this.formInline.showPermissions == 'Privacy'){ + this.isDisplay = true + }else{ + this.isDisplay = false + } + } else { + this.formInline = {} + } + }) + }, + backClick() { + this.$router.push({ + path: '/problemknowledgeBase' + }) + } + , + showPermissionsChange(event) { + if (event == 'Open') { + this.isDisplay = false + } else { + this.isDisplay = true + } + } + , onEditorBlur(quill) { console.log('editor blur!', quill) - }, + } + , onEditorFocus(quill) { console.log('editor focus!', quill) - }, + } + , onEditorReady(quill) { console.log('editor ready!', quill) - }, + } + , onEditorChange({ quill, html, text }) { console.log('editor change!', quill, html, text) this.content = html - }, + } + , PersonnelSelectionChange(value, id) { this.formInline[value] = id this.formInline = { ...this.formInline } - }, + } + , handleInput(value) { this.$nextTick(() => { this.formInline = { ...this.formInline } this.$refs.ruleForm.validateField([value]) }) - }, + } + , bringInDocumentInformationClick() { - - }, + this.$refs.listAddModelRef.addModel(this.formInline) + } + , + listAddModelForm(id, number) { + this.formInline.standNumber = number + this.formInline.bussDocumentLibraryId = id + this.formInline = { ...this.formInline } + } + , clickButtonToUpload(item) { this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.visible = true @@ -242,7 +368,8 @@ this.$refs.uploadFile.perentHandleFunc() } }) - }, + } + , /** 上传文件的回调 */ uploadSuccess(data) { let attIdList = [] @@ -255,6 +382,47 @@ this.formInline[this.uploadName] = attIdList.join(',') this.formInline = { ...this.formInline } } + , + submit() { + this.$refs.ruleForm.validate(valid => { + if (valid) { + let formInline = JSON.parse(JSON.stringify(this.formInline)) + this.loading = true + this.confirmLoading = true + let url = '' + if (this.formInline.id) { + url = this.url.edit + } else { + url = this.url.add + } + formInline.permissionUserList = [] + if (formInline.showPermissions == 'Privacy') { + let studioEngineer = formInline.studioEngineer.split(',') + studioEngineer.forEach(res => { + formInline.permissionUserList.push({ + userId: res + }) + }) + } + postAction(url, formInline).then((res) => { + if (res.success) { + this.$message.success(this.$t('OperationSuccessful')) + this.loading = false + if (this.$route.query.id) { + + } else { + this.$router.push({ + path: '/problemknowledgeBase' + }) + } + } else { + this.loading = false + this.$message.warning(this.$t('operationFailed')) + } + }) + } + }) + } } } @@ -381,4 +549,13 @@ .box-button { height: 38px; } + + .submit-button { + width: 100%; + margin-top: 20px; + text-align: right; + padding: 0 32px; + box-sizing: border-box; + } + \ No newline at end of file diff --git a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseList.vue b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseList.vue index 6036c6576..a5cae60f5 100644 --- a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseList.vue +++ b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseList.vue @@ -99,7 +99,7 @@ downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', pageNo: 1, url: { - getInfoList: 'search/document/getFullTextInfoList' + getInfoList: '/problemKnowledgeBase/problemKnowledgeBaseEO/page' } } }, @@ -108,10 +108,13 @@ }, methods: { onSearch() { - + this.pageNo = 1 + this.getList() }, ResetSearch() { - + this.searchContent = '' + this.pageNo = 1 + this.getList() }, classificationClick() { this.$refs.classificationMaintenanceModelRef.getData() @@ -124,11 +127,14 @@ window.open(newUrl.href, '_blank') }, newlyAddedClick() { - let newUrl = this.$router.resolve({ - path: '/problemKnowledgeBaseAdd', - query: {} + this.$router.push({ + path: '/problemKnowledgeBaseAdd' }) - window.open(newUrl.href, '_blank') + // let newUrl = this.$router.resolve({ + // path: '/problemKnowledgeBaseAdd', + // query: {} + // }) + // window.open(newUrl.href, '_blank') }, pageOnChange(page, pageSize) { this.pageNo = page @@ -144,7 +150,7 @@ pageNo: this.pageNo, pageSize: this.pageSize } - postAction(this.url.getInfoList, query).then((res) => { + getAction(this.url.getInfoList, query).then((res) => { if (res.success) { this.conList = res.result.records this.total = res.result.total