diff --git a/jiace-admin(414).zip b/jiace-admin(414).zip new file mode 100644 index 0000000..30819bd Binary files /dev/null and b/jiace-admin(414).zip differ diff --git a/src/views/policy/library/add.vue b/src/views/policy/library/add.vue index 689936e..2b3bf0d 100644 --- a/src/views/policy/library/add.vue +++ b/src/views/policy/library/add.vue @@ -235,9 +235,7 @@ export default { }, ], source: [{ required: true, message: '请填写来源', trigger: 'blur' }], - text: [ - { required: true, message: '请填写正文内容', trigger: 'blur' }, - ], + text: [{ required: true, message: '请填写正文内容', trigger: 'blur' }], }, }; }, @@ -266,11 +264,11 @@ export default { // resetForm(formName) { // this.$refs[formName].resetFields(); // } - beforeUpload(file){ - const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1); - const whiteList = ["pdf", "doc", "docx", "xls", "xlsx"]; + beforeUpload(file) { + const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1); + const whiteList = ['pdf', 'doc', 'docx', 'xls', 'xlsx']; if (whiteList.indexOf(fileSuffix.toLowerCase()) === -1) { - this.msgError("上传文件只能是 pdf、doc、docx、xls、xlsx格式。"); + this.msgError('上传文件只能是 pdf、doc、docx、xls、xlsx格式。'); return false; } }, @@ -297,7 +295,20 @@ export default { ruleForm: { handler: function () { this.$nextTick(() => { - this.formatRichText(this.ruleForm.downloadUrl, this.ruleForm.id,this.ruleForm.url); + this.formatRichText( + this.ruleForm.downloadUrl, + this.ruleForm.id, + this.ruleForm.url + ); + if (this.ruleForm.captureSource === 'TL_FGW') { + document + .getElementById('text') + .querySelectorAll('img') + .forEach((item) => { + console.log(item.src); + item.src = item.src.replace('./', '/'); + }); + } }); }, }, @@ -308,11 +319,12 @@ export default { if (id) { this.editPage = true; getPolicyInfo({ policyId: id }).then(({ data }) => { + console.log(data); this.ruleForm = data; - if(data.method==1){ + if (data.method == 1) { this.editPage = true; - }else{ - this.editSatus = true + } else { + this.editSatus = true; this.editPage = false; } });