--demand 字典修改

This commit is contained in:
yuping
2023-02-12 19:02:06 +08:00
parent fe4711ad68
commit 6d5ad2474b
10 changed files with 703 additions and 347 deletions

View File

@@ -85,7 +85,7 @@
<div style="width:440px;height:70px;display: flex;justify-content: flex-start;align-items: center;">
<img v-for="(item, index) in optionsUrl" :key="index" class="choiceoptionurl"
:style="item.value == feng_mian_1 ? 'border:3px solid rgb(78, 166, 255);' : ''" :src="item.value"
:alt="item.label" @click="choicePic(item.value)" />
:alt="item.name" @click="choicePic(item.value)" />
</div>
<!-- <a-select
:getPopupContainer="
@@ -144,8 +144,8 @@
:tree-data="sysTypeOptions"
:fieldNames="{
children: 'children',
label: 'dictName',
value: 'dictCode',
label: 'name',
value: 'code',
}">
</a-tree-select>
</div>
@@ -321,7 +321,6 @@ import { validateName } from "@/api/index1";
import { message } from "ant-design-vue";
import { edit, detail, handle } from "@/api/indexCourse";
import { fileUp } from "../../api/indexEval";
import * as api1 from "../../api/index1";
import "@wangeditor/editor/dist/css/style.css";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import NameInput from "@/components/project/NameInput";
@@ -370,140 +369,11 @@ export default defineComponent({
auditDescription: "",
contentClassify: [],
// 课程三级分类
options2222: [
{
title: '领导力',
value: '100',
children: [
{
title: '管理业务',
value: '1001',
},
{
title: '管理团队',
value: '1002',
},
{
title: '管理自我',
value: '1003',
},
],
},
{
title: '专业力',
value: '200',
children: [
{
title: '研发',
value: '2001',
},
{
title: '系统和解决方案',
value: '2002',
},
{
title: '生产技术与制造',
value: '2003',
},
{
title: '供应链',
value: '2004',
},
{
title: '营销',
value: '2005',
},
{
title: '品质',
value: '2006',
},
{
title: '专业职能',
value: '2007',
children: [
{
title: '战略与企划',
value: '200701',
},
{
title: '流程管理',
value: '200702',
},
{
title: '业绩管理',
value: '200703',
},
{
title: '项目管理',
value: '200704',
},
{
title: '信息技术',
value: '200705',
},
{
title: '环境与安全',
value: '200706',
},
{
title: '人力资源',
value: '200707',
},
{
title: '企业文化',
value: '200708',
},
{
title: '品牌',
value: '200709',
},
{
title: '财务',
value: '200710',
},
{
title: '法务',
value: '200711',
},
{
title: '风险控制',
value: '200712',
},
{
title: '行政',
value: '200713'
},
]
},
{
title: '医工',
value: '2008',
}
],
},
{
title: '通用力',
value: '300',
children: [
{
title: '职业操守与道德',
value: '3001',
},
{
title: '职业素养与技能',
value: '3002',
},
{
title: '规章制度',
value: '3003',
},
],
}
],
});
const store = useStore();
const sysTypeOptions = computed(() => store.state.sysType);
const sysTypeOptions = computed(() => store.state.content_type);
const optionsUrl = computed(() => store.state.course_pic);
watch(()=>state.fen_lei,()=>{
state.fen_lei1 = findClassFullName(sysTypeOptions.value)
@@ -511,7 +381,7 @@ export default defineComponent({
function findClassFullName(list,name=''){
return list && list.length && list.map(e=>{
return state.fen_lei == e.dictCode ? name?name+'-'+e.dictName:e.dictName : findClassFullName(e.children,name?name+'-'+e.dictName:e.dictName)
return state.fen_lei === e.code ? name?name+'-'+e.name:e.name : findClassFullName(e.children,name?name+'-'+e.name:e.name)
}).filter(name=>name).join('')
}
@@ -648,77 +518,10 @@ export default defineComponent({
}
//获取分类、场景、封面图、-----------字典配置-------------------------------
const optionsUrl = ref([]);
const options2 = ref([]);
const options3 = ref([]);
const options4 = ref([]);
const getDictList = (param) => {
let obj = {
pageNo: 1,
pageSize: 10000,
setCode: param,
};
api1
.getDict(obj)
.then((res) => {
console.log("获取字典成功", res);
if (res.data.code === 200) {
if (param === "faceclassPic") {
let arr = res.data.data.rows;
let newArr = [];
arr.forEach((item) => {
newArr.push({
value: item.dictValue,
label: item.dictName,
});
});
optionsUrl.value = newArr;
}
if (param === "faceclassClass") {
let arr = res.data.data.rows;
let newArr = [];
arr.forEach((item) => {
newArr.push({
value: item.dictCode,
label: item.dictName,
});
});
options2.value = newArr;
}
if (param === "faceclassScene") {
let arr = res.data.data.rows;
let newArr = [];
arr.forEach((item) => {
newArr.push({
value: item.dictCode,
label: item.dictName,
});
});
options3.value = newArr;
}
if (param === "contentClassify") {
state.contentClassify = dealDickTree(res.data.data.rows) || []
}
}
})
.catch((err) => {
console.log("获取字典失败", err);
});
};
function dealDickTree(data, level = 1) {
return data?.filter(e => e.levelId == level).map(({ dictName, dictCode }) => ({
title: dictName,
value: dictCode,
key: dictCode,
children: dealDickTree(data, dictCode)
}))
}
getDictList("faceclassClass");
getDictList("faceclassScene");
getDictList("faceclassPic");
getDictList("contentClassify");
//获取分类、场景、封面图、----------------字典配置---------------------------
const hideShow = () => {
@@ -737,12 +540,11 @@ export default defineComponent({
}
}
return count ? false : true;
return !count;
};
//保存面授课
const handlePush = async (param) => {
let files = "";
if (state.imgList.length) {
state.imgList.forEach((item) => {