This commit is contained in:
clay
2022-09-25 12:53:43 +08:00
parent 362b39a1a8
commit b7e8c3609b
9 changed files with 145 additions and 107 deletions

View File

@@ -47,9 +47,9 @@
placeholder="请选择文章类型" clearable :style="{width: '100%'}">
<el-option
v-for="dict in sistArticleTypeOption"
:key="dict.dictCode"
:label="dict.dictLabel"
:value="dict.dictCode"
:key="dict.id"
:label="dict.title"
:value="dict.id"
/>
</el-select>
</el-form-item>
@@ -74,9 +74,9 @@
@change="getLabApprove(params.labArticleType)" clearable :style="{width: '100%'}">
<el-option
v-for="dict in labArticleTypeOption"
:key="dict.dictCode"
:label="dict.dictLabel"
:value="dict.dictCode"
:key="dict.id"
:label="dict.title"
:value="dict.id"
/>
</el-select>
</el-form-item>
@@ -126,6 +126,7 @@ import Editor from '@/components/Editor';
import {updateArticle, getArticle, drafts, getArticleType, getArticleApprove} from "@/api/sist/article";
import {Message} from "element-ui";
import UploadFile from '@/views/utils/uploadFile.vue';
import { getArticleNav } from '../../../../api/sist/article'
export default {
components: {
@@ -245,22 +246,37 @@ export default {
this.getDicts("article_status").then(response => {
this.statusOptions = response.data;
});
getArticleType().then(res => {
let dictCodes = res.data
let articleList = this.articleTypeOptions
console.log("dictCodes",dictCodes,"articleList",articleList)
for (let i = 0; i < articleList.length; i++) {
for (let j = 0; j < dictCodes.length; j++) {
if (articleList[i].dictCode == dictCodes[j]) {
if (articleList[i].attribute2 == 1) {
this.sistArticleTypeOption.push(articleList[i])
} else if (articleList[i].attribute2 == 2) {
this.labArticleTypeOption.push(articleList[i])
}
}
getArticleNav().then(res=>{
let data = res.data
for (let item of data) {
if (item.sitetype == 1){
this.sistArticleTypeOption.push(item)
}else {
this.labArticleTypeOption.push(item)
}
}
console.log(res)
})
// getArticleType().then(res => {
// let dictCodes = res.data
// let articleList = this.articleTypeOptions
// console.log("dictCodes",dictCodes,"articleList",articleList)
// for (let i = 0; i < articleList.length; i++) {
// for (let j = 0; j < dictCodes.length; j++) {
// if (articleList[i].dictCode == dictCodes[j]) {
// if (articleList[i].attribute2 == 1) {
// this.sistArticleTypeOption.push(articleList[i])
// } else if (articleList[i].attribute2 == 2) {
// this.labArticleTypeOption.push(articleList[i])
// }
// }
// }
// }
// })
},
mounted() {
},