--fix 内容分类 改成从字典取值

This commit is contained in:
yuping
2023-01-13 18:17:07 +08:00
parent 05e9732e3d
commit 29582b6beb
6 changed files with 829 additions and 955 deletions

View File

@@ -107,9 +107,10 @@
</div>
</template>
<script>
import { reactive, toRefs, onMounted } from "vue";
import {reactive, toRefs, onMounted, computed} from "vue";
import { courseListView } from "../../api/indexAudit";
import * as api1 from "@/api/index1";
import {useStore} from "vuex";
export default {
name: "CoursereViewed",
@@ -398,48 +399,19 @@ export default {
],
});
// 课程三级分类回显
const sHX = (data) => {
let str = '-'
let sdata = state.options2222
for (let i = 0; i < sdata.length; i++) {
for (let j = 0; j < sdata[i].children.length; j++) {
str = changeTreeSelectValue(String(data))
{/* if (String(sdata[i].children[j].value) === String(data)) {
str = sdata[i].children[j].title;
} */}
}
}
return str
}
const store = useStore();
// 格式化树型结构选择数据
const changeTreeSelectValue = (values) => {
let data = state.options2222;
console.log(values, data)
let str = ''
for (let i = 0; i < data.length; i++) {
if (data[i].value == values) {
str = data[i].title
} else {
for (let j = 0; j < data[i].children.length; j++) {
if (data[i].children[j].value == values) {
str = data[i].title + '/' + data[i].children[j].title
} else {
if (data[i].children[j].children) {
for (let k = 0; k < data[i].children[j].children.length; k++) {
if (data[i].children[j].children[k].value == values) {
str = data[i].title + '/' + data[i].children[j].title + '/' + data[i].children[j].children[k].title
}
}
}
}
}
}
}
console.log('str-str-str-str', str)
state.fen_lei1 = str;
return str;
const sysTypeOptions = computed(() => store.state.sysType);
function findClassFullName(list,classify,name=''){
return list && list.length && list.map(e=>{
return classify == e.dictCode ? name?name+'-'+e.dictName:e.dictName : findClassFullName(e.children,classify,name?name+'-'+e.dictName:e.dictName)
}).filter(name=>name).join('')
}
// 课程三级分类回显
const sHX = (classify) => {
return findClassFullName(sysTypeOptions.value,classify) || '-'
}
const getList = () => {