mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
--fix 内容分类 改成从字典取值
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user