tijiao
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="Manuscript Title :" prop="title" label-width="160px">
|
||||
<el-input v-model="form.title"></el-input>
|
||||
<el-input v-model="form.title" type="textarea" rows="2"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="Whether ethical approval was obtained ?" prop="approval" label-width="290px">
|
||||
@@ -166,21 +166,33 @@
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="Key words :">
|
||||
<el-input
|
||||
v-for="(item, index) in keywordsList"
|
||||
:key="index"
|
||||
:name="index + 1"
|
||||
v-model="item.ke"
|
||||
clearable
|
||||
style="width: 150px; margin-right: 15px; margin-bottom: 3px"
|
||||
>
|
||||
</el-input>
|
||||
<div v-if="keywordsList&&keywordsList.length > 0">
|
||||
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange" style="color: #006699;">Select All</el-checkbox>
|
||||
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
|
||||
<div v-for="(item, index) in keywordsList" :key="index" style="margin-right:16px;display: inline-block;">
|
||||
<el-checkbox style="margin-right: 4px;" :label="index + 1" v-model="item.checked">{{item.keyword}}</el-checkbox>
|
||||
<el-input
|
||||
:name="index + 1"
|
||||
v-model="item.ke"
|
||||
clearable
|
||||
style="width: 150px; margin-right: 15px; margin-bottom: 3px"
|
||||
>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<el-button type="text" @click="addfund">
|
||||
<i class="el-icon-circle-plus-outline">Add</i>
|
||||
</el-button>
|
||||
<el-button v-if="checkedCities.length > 0" type="text" @click="deletefund" style="color: #f56c6c;margin-left: 20px;">
|
||||
<i class="el-icon-remove-outline" style="color: #f56c6c;">Delete</i>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="Fund :">
|
||||
<el-input v-model="form.fund"> </el-input>
|
||||
<el-input v-model="form.fund" type="textarea" rows="2"> </el-input>
|
||||
</el-form-item>
|
||||
|
||||
<div style="text-align: center; margin: 40px 0 0 0">
|
||||
@@ -1023,6 +1035,7 @@ export default {
|
||||
ProgressBar
|
||||
},
|
||||
data() {
|
||||
|
||||
// 自定义校验:禁止QQ邮箱
|
||||
const validateNotQQEmail = (rule, value, callback) => {
|
||||
// 通用邮箱格式正则(基础校验,匹配大多数标准邮箱格式)
|
||||
@@ -1056,8 +1069,12 @@ export default {
|
||||
}
|
||||
};
|
||||
return {
|
||||
isNewArticle:true,
|
||||
checkAll: false,
|
||||
isIndeterminate: false,
|
||||
stepStatusCurrent: '',
|
||||
isNewArticle: true,
|
||||
oldMajorValueList: [],
|
||||
checkedCities: [],
|
||||
newOptionLabel: '',
|
||||
showAddOption: false,
|
||||
nextId: 0, // 用于生成新选项的ID
|
||||
@@ -1513,9 +1530,7 @@ export default {
|
||||
immediate: true
|
||||
},
|
||||
form: {
|
||||
async handler(newVal, oldVal) {
|
||||
|
||||
},
|
||||
async handler(newVal, oldVal) {},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
@@ -1532,7 +1547,7 @@ export default {
|
||||
// 分支处理
|
||||
if (this.stagingID !== undefined) {
|
||||
this.form.article_id = this.stagingID;
|
||||
|
||||
|
||||
await this.getMajorData();
|
||||
await this.initStepStatus((step1Incomplete) => {
|
||||
this.show_step = step1Incomplete.current.step;
|
||||
@@ -1540,7 +1555,7 @@ export default {
|
||||
});
|
||||
await this.Temporary();
|
||||
} else {
|
||||
this.isNewArticle=true;
|
||||
this.isNewArticle = true;
|
||||
await this.initMajor();
|
||||
}
|
||||
|
||||
@@ -1583,6 +1598,19 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCheckAllChange(val) {
|
||||
this.checkedCities = val
|
||||
? this.keywordsList.map((_, index) => index + 1) // 遍历数组,取 index+1 作为选中值
|
||||
: [];
|
||||
this.isIndeterminate = false;
|
||||
},
|
||||
handleCheckedCitiesChange(){
|
||||
|
||||
console.log('this.checkedCities at line 1594:', this.checkedCities)
|
||||
},
|
||||
handleDelete(index){
|
||||
this.keywordsList.splice(index, 1);
|
||||
},
|
||||
closeAuthorDialog() {
|
||||
this.getAuthorList();
|
||||
this.authorVisible = false;
|
||||
@@ -1708,7 +1736,7 @@ export default {
|
||||
.then((res) => {
|
||||
if (res.status == 1) {
|
||||
this.stagingID = res.data.article_id;
|
||||
this.form.article_id = res.data.article_id;
|
||||
this.form.article_id = res.data.article_id;
|
||||
this.initStepStatus();
|
||||
this.$message.success('Saving succeeded!');
|
||||
} else {
|
||||
@@ -1745,29 +1773,27 @@ export default {
|
||||
{ step: 4, status: 0, name: 'four', msg: 'four_msg' }
|
||||
]
|
||||
};
|
||||
await this.$api
|
||||
await this.$api
|
||||
.post('api/Article/getArticleState', {
|
||||
article_id: this.form.article_id,
|
||||
user_id: this.form.user_id
|
||||
})
|
||||
.then(async(res) => {
|
||||
.then(async (res) => {
|
||||
if (res.status == 1) {
|
||||
step1Incomplete.list= step1Incomplete.list.map((item) => ({
|
||||
step1Incomplete.list = step1Incomplete.list.map((item) => ({
|
||||
...item,
|
||||
status: res.data[item.name],
|
||||
msg: res.data[item.msg]
|
||||
}));
|
||||
this.stepStatus = step1Incomplete.list
|
||||
this.stepStatus = step1Incomplete.list;
|
||||
if (res.data.current_step) {
|
||||
step1Incomplete.current = step1Incomplete.list.find((item) => item.name == res.data.current_step);
|
||||
this.stepStatusCurrent = step1Incomplete.current;
|
||||
}
|
||||
|
||||
if (fn) {
|
||||
console.log('step1Incomplete at line 1766:', step1Incomplete)
|
||||
fn(step1Incomplete);
|
||||
|
||||
|
||||
|
||||
console.log('step1Incomplete at line 1766:', step1Incomplete);
|
||||
fn(step1Incomplete);
|
||||
}
|
||||
console.log('this.stepStatus at line 1571:', this.stepStatus);
|
||||
}
|
||||
@@ -1928,7 +1954,25 @@ export default {
|
||||
ke: ''
|
||||
});
|
||||
},
|
||||
deletefund() {
|
||||
if (!this.checkedCities.length) {
|
||||
this.$message.error('please select the key word to delete');
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 将选中的序号(index+1)转成原始索引(index),并存入集合(提高查询效率)
|
||||
const selectedIndexes = new Set(
|
||||
this.checkedCities.map(seq => seq - 1) // 序号 - 1 = 原始索引
|
||||
);
|
||||
|
||||
// 3. 过滤 keywordsList:保留索引不在选中集合中的项
|
||||
this.keywordsList = this.keywordsList.filter((_, index) =>
|
||||
!selectedIndexes.has(index)
|
||||
);
|
||||
this.checkAll = false;
|
||||
// 4. 清空选中状态和半选状态(删除后无选中项)
|
||||
this.checkedCities = [];
|
||||
this.isIndeterminate = false; },
|
||||
//初始化期刊选项
|
||||
initSelect() {
|
||||
this.items = this.$store.state.journalList;
|
||||
@@ -2716,9 +2760,9 @@ export default {
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
this.form.manuscirpt = '';
|
||||
this.fileL_manuscirpt = [];
|
||||
this.isShowCommonWord = false;
|
||||
this.initStepStatus()
|
||||
this.fileL_manuscirpt = [];
|
||||
this.isShowCommonWord = false;
|
||||
this.initStepStatus();
|
||||
loading.close();
|
||||
}
|
||||
})
|
||||
@@ -2832,7 +2876,7 @@ export default {
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('Deletion succeeded!');
|
||||
this.initStepStatus()
|
||||
this.initStepStatus();
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
@@ -2985,36 +3029,10 @@ export default {
|
||||
this.move_step = e;
|
||||
} else if (this.move_step < e) {
|
||||
this.$refs.articleform.validate((valid) => {
|
||||
console.log('valid at line 2963:', valid);
|
||||
if (valid) {
|
||||
// deepEqual(this.form, this.oldForm);
|
||||
if (this.move_step == 1) {
|
||||
//暂时注销 start
|
||||
// var flist = this.keywordsList;
|
||||
// var fstr = '';
|
||||
// for (var fu in flist) {
|
||||
// if (flist[fu].ke != '') {
|
||||
// fstr += flist[fu].ke.trim() + ',';
|
||||
// }
|
||||
// }
|
||||
// this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1);
|
||||
// this.$api.post('api/Article/addArticlePart1', this.form).then((res) => {
|
||||
// if (res.code == 0) {
|
||||
// this.stagingID = res.data.article_id;
|
||||
// this.form.article_id = res.data.article_id;
|
||||
|
||||
// this.$message.success('Saving succeeded!');
|
||||
//暂时注销 End
|
||||
this.move_step = 2; //进行步骤
|
||||
this.show_step = 2; //显示内容
|
||||
|
||||
//暂时注销 start
|
||||
// } else {
|
||||
// // this.$message.error(res.msg);
|
||||
// }
|
||||
|
||||
// });
|
||||
//暂时注销 End
|
||||
this.move_step = 2;
|
||||
this.show_step = 2;
|
||||
} else if (this.move_step == 2) {
|
||||
this.onStaging(2);
|
||||
this.show_step = 3;
|
||||
@@ -3025,7 +3043,6 @@ export default {
|
||||
}
|
||||
} else {
|
||||
this.$message.error('Please fill in the current content first!');
|
||||
// return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -3041,42 +3058,39 @@ export default {
|
||||
}
|
||||
},
|
||||
isArrayEqual(arr1, arr2) {
|
||||
if ((arr1 === null || arr1 === undefined) && (arr2 === null || arr2 === undefined)) return true;
|
||||
if (arr1 === null || arr1 === undefined || arr2 === null || arr2 === undefined) return false;
|
||||
|
||||
if ((arr1 === null || arr1 === undefined) && (arr2 === null || arr2 === undefined)) return true;
|
||||
if (arr1 === null || arr1 === undefined || arr2 === null || arr2 === undefined) return false;
|
||||
|
||||
if (!Array.isArray(arr1) || !Array.isArray(arr2)) return false;
|
||||
|
||||
if (arr1.length !== arr2.length) return false;
|
||||
|
||||
return arr1.every((val, index) => val === arr2[index]);
|
||||
},
|
||||
if (!Array.isArray(arr1) || !Array.isArray(arr2)) return false;
|
||||
|
||||
if (arr1.length !== arr2.length) return false;
|
||||
|
||||
return arr1.every((val, index) => val === arr2[index]);
|
||||
},
|
||||
isMajorValueListEqual(list1, list2) {
|
||||
|
||||
if ((list1 === null || list1 === undefined) && (list2 === null || list2 === undefined)) return true;
|
||||
if (list1 === null || list1 === undefined || list2 === null || list2 === undefined) return false;
|
||||
|
||||
if (!Array.isArray(list1) || !Array.isArray(list2)) return false;
|
||||
|
||||
if (list1.length !== list2.length) return false;
|
||||
|
||||
return list1.every((item1, index) => {
|
||||
const item2 = list2[index];
|
||||
|
||||
if ((item1 === null || item1 === undefined) && (item2 === null || item2 === undefined)) return true;
|
||||
if (item1 === null || item1 === undefined || item2 === null || item2 === undefined) return false;
|
||||
|
||||
const sv1 = item1.selectedValue;
|
||||
const sv2 = item2.selectedValue;
|
||||
return this.isArrayEqual(sv1, sv2);
|
||||
});
|
||||
},
|
||||
if ((list1 === null || list1 === undefined) && (list2 === null || list2 === undefined)) return true;
|
||||
if (list1 === null || list1 === undefined || list2 === null || list2 === undefined) return false;
|
||||
|
||||
if (!Array.isArray(list1) || !Array.isArray(list2)) return false;
|
||||
|
||||
if (list1.length !== list2.length) return false;
|
||||
|
||||
return list1.every((item1, index) => {
|
||||
const item2 = list2[index];
|
||||
|
||||
if ((item1 === null || item1 === undefined) && (item2 === null || item2 === undefined)) return true;
|
||||
if (item1 === null || item1 === undefined || item2 === null || item2 === undefined) return false;
|
||||
|
||||
const sv1 = item1.selectedValue;
|
||||
const sv2 = item2.selectedValue;
|
||||
return this.isArrayEqual(sv1, sv2);
|
||||
});
|
||||
},
|
||||
|
||||
StepCode(step, i) {
|
||||
var that = this;
|
||||
const targetIndex = step.index; // 目标步骤索引(1、2、3等)
|
||||
const currentStep = this.move_step; // 当前所在步骤
|
||||
console.log('当前步骤:', currentStep, '目标步骤:', targetIndex, '步骤状态:', this.stepStatus);
|
||||
|
||||
// 1. 后退
|
||||
if (currentStep > targetIndex) {
|
||||
@@ -3091,8 +3105,7 @@ export default {
|
||||
// ? item.selectedValue[item.selectedValue.length - 1]
|
||||
// : []
|
||||
// )
|
||||
// .toString(',');
|
||||
|
||||
// .toString(',');
|
||||
// this.$api
|
||||
// .post('api/Article/addArticleStaging', {
|
||||
// user_id: this.form.user_id,
|
||||
@@ -3104,10 +3117,7 @@ export default {
|
||||
// this.oldMajorValueList = [...this.majorValueList];
|
||||
// }
|
||||
// });
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
}
|
||||
this.show_step = targetIndex;
|
||||
@@ -3121,32 +3131,40 @@ export default {
|
||||
if (!valid) {
|
||||
this.$message.error('Please fill in the current content first!');
|
||||
return false;
|
||||
} else if (this.stepStatus[currentStep - 1].status != 1) {
|
||||
this.$message.error(
|
||||
this.stepStatus[currentStep - 1].msg
|
||||
? this.stepStatus[currentStep - 1].msg
|
||||
: 'Please fill in the current content first!'
|
||||
);
|
||||
return false;
|
||||
} else {
|
||||
let invalidStep = null;
|
||||
for (let i = 0; i < targetIndex - 1; i++) {
|
||||
const step = this.stepStatus[i];
|
||||
if (step.status !== 1) {
|
||||
invalidStep = step;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (invalidStep) {
|
||||
this.$message.error(
|
||||
this.stepStatusCurrent.msg ? this.stepStatusCurrent.msg : 'Please fill in the current content first!'
|
||||
);
|
||||
|
||||
this.show_step = this.stepStatusCurrent.step;
|
||||
this.move_step = this.stepStatusCurrent.step;
|
||||
this.$forceUpdate();
|
||||
} else {
|
||||
this.show_step = targetIndex;
|
||||
this.move_step = targetIndex;
|
||||
}
|
||||
if (targetIndex == 4) {
|
||||
if (
|
||||
Array.isArray(this.majorValueList) &&
|
||||
this.majorValueList.some((item) => item.selectedValue !== null && item.selectedValue !== undefined)
|
||||
) {
|
||||
} else {
|
||||
if(this.isNewArticle){
|
||||
this.getMajorData();
|
||||
if (this.isNewArticle) {
|
||||
this.getMajorData();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
this.show_step = targetIndex;
|
||||
this.move_step = targetIndex;
|
||||
}
|
||||
|
||||
this.show_step = targetIndex;
|
||||
this.move_step = targetIndex;
|
||||
});
|
||||
// return;
|
||||
}
|
||||
@@ -3287,20 +3305,20 @@ export default {
|
||||
this.stagingID = res.data.article_id;
|
||||
this.form.article_id = res.data.article_id;
|
||||
this.$message.success('Saving succeeded!');
|
||||
this.initStepStatus(step1Incomplete=>{
|
||||
console.log('step1Incomplete at line 3283:', step1Incomplete)
|
||||
this.$nextTick(()=>{
|
||||
if(step1Incomplete.list&&step1Incomplete.list.length>0&&step1Incomplete.list[0].status==1){
|
||||
this.move_step = 2; //进行步骤
|
||||
this.show_step = 2; //显示内容
|
||||
this.$forceUpdate()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.initStepStatus((step1Incomplete) => {
|
||||
console.log('step1Incomplete at line 3283:', step1Incomplete);
|
||||
this.$nextTick(() => {
|
||||
if (
|
||||
step1Incomplete.list &&
|
||||
step1Incomplete.list.length > 0 &&
|
||||
step1Incomplete.list[0].status == 1
|
||||
) {
|
||||
this.move_step = 2; //进行步骤
|
||||
this.show_step = 2; //显示内容
|
||||
this.$forceUpdate();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
@@ -3369,7 +3387,7 @@ export default {
|
||||
},
|
||||
|
||||
// save暂存
|
||||
onStagingSave: throttle(function (e) {
|
||||
onStagingSave: throttle(function (e) {
|
||||
if (e == 1) {
|
||||
this.onStaging(1);
|
||||
} else if (e == 2) {
|
||||
@@ -3379,9 +3397,9 @@ export default {
|
||||
} else if (e == 4) {
|
||||
this.onStaging('save4');
|
||||
}
|
||||
},1000),
|
||||
}, 1000),
|
||||
//暂存加下一步
|
||||
onStagingSubmit: throttle(function (e) {
|
||||
onStagingSubmit: throttle(function (e) {
|
||||
if (e == 3) {
|
||||
this.$api
|
||||
.post('api/Article/addArticlePart3', {
|
||||
@@ -3399,10 +3417,9 @@ export default {
|
||||
this.majorValueList.some((item) => item.selectedValue !== null && item.selectedValue !== undefined)
|
||||
) {
|
||||
} else {
|
||||
if(this.isNewArticle){
|
||||
if (this.isNewArticle) {
|
||||
this.getMajorData();
|
||||
}
|
||||
|
||||
}
|
||||
this.move_step = 4;
|
||||
this.show_step = 4;
|
||||
@@ -3414,7 +3431,7 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
},1000),
|
||||
}, 1000),
|
||||
|
||||
// 暂存
|
||||
onStaging(e) {
|
||||
@@ -3441,7 +3458,7 @@ export default {
|
||||
article_id: this.form.article_id,
|
||||
journal: this.form.journal,
|
||||
title: this.form.title,
|
||||
keyWords: this.form.keyWords,
|
||||
keywords: this.form.keyWords,
|
||||
abstrart: this.form.abstrart,
|
||||
type: this.form.type,
|
||||
username: this.form.username,
|
||||
@@ -3454,11 +3471,9 @@ export default {
|
||||
},
|
||||
(res) => {
|
||||
if (res.status == 1) {
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set('id', res.data.article_id); // 替换或新增 id 参数
|
||||
window.history.replaceState({}, document.title, url.toString());
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -3643,8 +3658,7 @@ export default {
|
||||
? item.shu.split(',').map(Number)
|
||||
: [item.shu]
|
||||
}));
|
||||
this.isNewArticle=false;
|
||||
|
||||
this.isNewArticle = false;
|
||||
});
|
||||
},
|
||||
changeUseAi(e) {
|
||||
@@ -3936,7 +3950,7 @@ export default {
|
||||
}
|
||||
|
||||
.step_list_new .C_style {
|
||||
background-color: #ecf5ff !important;
|
||||
background-color: #ecf5ff !important;
|
||||
-webkit-box-shadow: 2px 30px 15px -20px #ebf5ff inset !important;
|
||||
box-shadow: 2px 30px 15px -20px #ebf5ff inset !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user