|
@@ -275,6 +275,15 @@ const edit = new Vue({
|
|
|
$('.navLayout').find('.navList').eq(3).addClass("on").find('.con').show().find('a').eq(0).addClass("on");
|
|
|
this.initAutoInput('.seo-auto-input', 'seoKeyword')
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ referenceDialog(val) {
|
|
|
+ if (val) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.onFocused()
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
onFocused() {
|
|
|
this.validTime = null
|
|
@@ -288,26 +297,25 @@ const edit = new Vue({
|
|
|
},
|
|
|
// 自动保存校验
|
|
|
validFormRule() {
|
|
|
- let allow = true
|
|
|
- const ruleData = Object.keys(this.rules)
|
|
|
- for(let i of ruleData){
|
|
|
- if (!this.formData[i]) {
|
|
|
- allow = false
|
|
|
- console.log('数据未填写完成')
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (allow) {
|
|
|
- this.validTime = null
|
|
|
- clearTimeout(this.validTime)
|
|
|
- this.validTime = setTimeout(() => {
|
|
|
- if (this.validTime) {
|
|
|
- this.handleConfirm()
|
|
|
- }
|
|
|
- clearTimeout(this.validTime)
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
this.validTime = null
|
|
|
- }, 5000)
|
|
|
- }
|
|
|
+ clearTimeout(this.validTime)
|
|
|
+ this.validTime = setTimeout(() => {
|
|
|
+ if (this.validTime) {
|
|
|
+ this.handleConfirm()
|
|
|
+ }
|
|
|
+ clearTimeout(this.validTime)
|
|
|
+ this.validTime = null
|
|
|
+ }, 2000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handlerDiscrip() {
|
|
|
+ this.onFocused()
|
|
|
+ },
|
|
|
+ handlerTypeId() {
|
|
|
+ this.onBlured()
|
|
|
},
|
|
|
// 获取表单数据
|
|
|
fetchEntryData(){
|
|
@@ -486,6 +494,7 @@ const edit = new Vue({
|
|
|
this.referenceData = initReferenceData()
|
|
|
this.$refs.referenceForm.clearValidate()
|
|
|
this.referenceDialog = false
|
|
|
+ this.onBlured()
|
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
|
}
|
|
@@ -518,6 +527,7 @@ const edit = new Vue({
|
|
|
if(this.referenceData.imageUrl){
|
|
|
this.referenceImageList = [{ url: this.referenceData.imageUrl, type: 'image' }]
|
|
|
}
|
|
|
+ console.log(1111)
|
|
|
},
|
|
|
// 参考资料删除
|
|
|
handleReferenceDelete(item) {
|
|
@@ -540,10 +550,12 @@ const edit = new Vue({
|
|
|
// 新增信息栏
|
|
|
handleInfoAdd() {
|
|
|
this.formData.infoList.push(this.genereateInfo())
|
|
|
+ this.onFocused()
|
|
|
},
|
|
|
// 删除信息栏
|
|
|
handleInfoRemove(index) {
|
|
|
this.formData.infoList.splice(index, 1)
|
|
|
+ this.onFocused()
|
|
|
},
|
|
|
// 正文目录数据
|
|
|
genereateTextInfo(type, index) {
|
|
@@ -564,14 +576,17 @@ const edit = new Vue({
|
|
|
// 添加正文目录
|
|
|
handleAddTextInfo(index, type) {
|
|
|
this.formData.textInfoList.splice(index + 1, 0, this.genereateTextInfo(type, index + 1))
|
|
|
+ this.onFocused()
|
|
|
},
|
|
|
// 删除正文目录
|
|
|
handleRemoveTextInfo(index, type) {
|
|
|
this.formData.textInfoList.splice(index, 1)
|
|
|
+ this.onFocused()
|
|
|
},
|
|
|
// 文件上传成功
|
|
|
handleUploadSuccess(fileList) {
|
|
|
this.fileList = [...this.fileList, ...fileList]
|
|
|
+ this.onBlured()
|
|
|
},
|
|
|
// 文件移除
|
|
|
handleFileRemove(file) {
|
|
@@ -581,6 +596,7 @@ const edit = new Vue({
|
|
|
handleCoverUploadSuccess(fileList) {
|
|
|
this.coverList = fileList
|
|
|
this.formData.image = fileList[0].url
|
|
|
+ this.onBlured()
|
|
|
},
|
|
|
// 封面删除
|
|
|
handleCoverRemove(file) {
|