mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 06:16:46 +08:00
feat:面授课预览增加目标人群及资源归属
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: lixg lixg@dongwu-inc.com
|
* @Author: lixg lixg@dongwu-inc.com
|
||||||
* @Date: 2023-02-23 14:57:21
|
* @Date: 2023-02-23 14:57:21
|
||||||
* @LastEditors: lixg lixg@dongwu-inc.com
|
* @LastEditors: lixg lixg@dongwu-inc.com
|
||||||
* @LastEditTime: 2023-02-24 09:58:42
|
* @LastEditTime: 2023-02-24 22:54:03
|
||||||
* @FilePath: /fe-manage/src/components/project/OrgClassCheck.vue
|
* @FilePath: /fe-manage/src/components/project/OrgClassCheck.vue
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -65,19 +65,84 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mbl_items">
|
<div class="mbl_items">
|
||||||
<div class="item_nam">
|
<div class="item_nam" style="margin-bottom: 102px">
|
||||||
<div class="asterisk_icon">
|
<div class="asterisk_icon">
|
||||||
<img
|
<img
|
||||||
style="width: 10px; height: 10px"
|
style="width: 10px; height: 10px"
|
||||||
src="@/assets/images/coursewareManage/asterisk.png"
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
alt="img"
|
alt=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span style="margin-right: 14px">目标人群:</span>
|
<span style="margin-right: 14px">目标人群</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item_inp">
|
<div class="item_inp">
|
||||||
<div class="i1_input">
|
<div class="i1_input">
|
||||||
{{ filterTxt(detail.targetUser) }}
|
<!-- <a-input v-model:value="qdms_inputV2" maxlength="50"
|
||||||
|
style="width: 440px; height: 40px; border-radius: 8px" placeholder="请输入目标人群" />
|
||||||
|
<div class="inp_num">
|
||||||
|
<span style="color: #c7cbd2">
|
||||||
|
{{ qdms_inputV2.length }}/50
|
||||||
|
</span>
|
||||||
|
</div> -->
|
||||||
|
<div>
|
||||||
|
<OrgClassCheck
|
||||||
|
v-model:value="orgSelect"
|
||||||
|
v-model:name="orgSelectName"
|
||||||
|
:disabled="true"
|
||||||
|
></OrgClassCheck>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
<a-select
|
||||||
|
v-model:value="selectJobId"
|
||||||
|
mode="multiple"
|
||||||
|
style="width: 440px; min-height: 40px"
|
||||||
|
placeholder="请选择岗位"
|
||||||
|
:options="jobType"
|
||||||
|
@change="handleChangeJob"
|
||||||
|
:fieldNames="{
|
||||||
|
key: 'id',
|
||||||
|
label: 'name',
|
||||||
|
value: 'id',
|
||||||
|
}"
|
||||||
|
disabled
|
||||||
|
></a-select>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
<a-select
|
||||||
|
v-model:value="selectBandId"
|
||||||
|
mode="multiple"
|
||||||
|
style="width: 440px; min-height: 40px"
|
||||||
|
placeholder="请选择Band"
|
||||||
|
:options="bandList"
|
||||||
|
@change="handleChangeBand"
|
||||||
|
:fieldNames="{
|
||||||
|
key: 'id',
|
||||||
|
label: 'name',
|
||||||
|
value: 'id',
|
||||||
|
}"
|
||||||
|
disabled
|
||||||
|
></a-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mbl_items">
|
||||||
|
<div class="item_nam">
|
||||||
|
<div class="asterisk_icon">
|
||||||
|
<img
|
||||||
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
|
alt="asterisk"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span style="margin-right: 14px">资源归属</span>
|
||||||
|
</div>
|
||||||
|
<div class="item_inp">
|
||||||
|
<div class="select i6_input" style="width: 440px">
|
||||||
|
<OrgClass
|
||||||
|
v-model:value="sourceBelongId"
|
||||||
|
v-model:name="sourceBelongName"
|
||||||
|
:disabled="true"
|
||||||
|
></OrgClass>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -249,11 +314,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a @click="openDown(item)" style="margin-left: 5px">下载</a>
|
||||||
@click="openDown(item)"
|
|
||||||
style="margin-left: 5px"
|
|
||||||
>下载</a
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -281,7 +342,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import { reactive, toRefs, defineComponent, watch, computed } from "vue";
|
import { reactive, toRefs, defineComponent, watch, computed } from "vue";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
|
import OrgClassCheck from "@/components/project/OrgClassCheck";
|
||||||
|
import OrgClass from "@/components/project/OrgClass";
|
||||||
|
import { detail } from "@/api/indexCourse";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
visible: {
|
visible: {
|
||||||
@@ -293,6 +356,10 @@ export default defineComponent({
|
|||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
OrgClassCheck,
|
||||||
|
OrgClass,
|
||||||
|
},
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
console.log("props", props);
|
console.log("props", props);
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@@ -304,20 +371,89 @@ export default defineComponent({
|
|||||||
location.href.indexOf("http://") !== -1
|
location.href.indexOf("http://") !== -1
|
||||||
? "http://43.143.139.204:12016/"
|
? "http://43.143.139.204:12016/"
|
||||||
: location.href.slice(0, location.href.indexOf("/m")) + "/upload/",
|
: location.href.slice(0, location.href.indexOf("/m")) + "/upload/",
|
||||||
|
|
||||||
|
//目标任务
|
||||||
|
orgSelect: [],
|
||||||
|
orgSelectName: [],
|
||||||
|
orgSelectFullName: [],
|
||||||
|
selectJobName: [],
|
||||||
|
selectJobId: [],
|
||||||
|
selectBandName: [],
|
||||||
|
selectBandId: [],
|
||||||
|
//资源归属
|
||||||
|
sourceBelongId: [],
|
||||||
|
sourceBelongName: [],
|
||||||
|
sourceBelongFullName: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const sysTypeOptions = computed(() => store.state.content_type);
|
const sysTypeOptions = computed(() => store.state.content_type);
|
||||||
|
//获取岗位
|
||||||
|
const jobType = computed(() => store.state.job_type);
|
||||||
|
//获取band
|
||||||
|
const bandList = computed(() => store.state.band);
|
||||||
watch(
|
watch(
|
||||||
() => props.detail.sysTypeId,
|
() => props.detail.sysTypeId,
|
||||||
() => {
|
() => {
|
||||||
state.categoryName = findClassFullName(sysTypeOptions.value);
|
state.categoryName = findClassFullName(sysTypeOptions.value);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
watch(
|
||||||
|
() => props.detail.id,
|
||||||
|
() => {
|
||||||
|
detail({
|
||||||
|
offcourseId: Number(props.detail.id),
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
let item = res.data.data;
|
||||||
|
if (item.jobTypeIds) {
|
||||||
|
state.selectJobId = item.jobTypeIds.split(",");
|
||||||
|
}
|
||||||
|
if (item.bandIds) {
|
||||||
|
state.selectBandId = item.bandIds.split(",");
|
||||||
|
}
|
||||||
|
console.log("state.selectBandId", state.selectBandId);
|
||||||
|
state.sourceBelongId = item.sourceBelongId;
|
||||||
|
state.sourceBelongName = item.sourceBelongFullName;
|
||||||
|
if (item.organizationIds && item.organizationNames) {
|
||||||
|
let orgSelectIds = item.organizationIds;
|
||||||
|
let orgSelectNames = item.organizationNames;
|
||||||
|
orgSelectIds = orgSelectIds.split(",");
|
||||||
|
orgSelectNames = orgSelectNames.split(",");
|
||||||
|
console.log(
|
||||||
|
"orgSelectIds&orgSelectNames",
|
||||||
|
orgSelectIds,
|
||||||
|
orgSelectNames
|
||||||
|
);
|
||||||
|
let arrObj = [];
|
||||||
|
arrObj = orgSelectIds.map((item, index) => {
|
||||||
|
return { value: item, lebel: orgSelectNames[index] };
|
||||||
|
});
|
||||||
|
console.log("arrObj-------------", arrObj);
|
||||||
|
state.orgSelect = arrObj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function findClassFullName(list, name = "") {
|
function findClassFullName(list, name = "") {
|
||||||
return (
|
return (
|
||||||
(list && list.length && list.map((e) => props.detail.sysTypeId == e.code ? name ? name + "-" + e.name : e.name : findClassFullName(e.children, name ? name + "-" + e.name : e.name)).filter((name) => name).join("")) || ""
|
(list &&
|
||||||
|
list.length &&
|
||||||
|
list
|
||||||
|
.map((e) =>
|
||||||
|
props.detail.sysTypeId == e.code
|
||||||
|
? name
|
||||||
|
? name + "-" + e.name
|
||||||
|
: e.name
|
||||||
|
: findClassFullName(
|
||||||
|
e.children,
|
||||||
|
name ? name + "-" + e.name : e.name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.filter((name) => name)
|
||||||
|
.join("")) ||
|
||||||
|
""
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,12 +465,13 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
console.log("关闭");
|
||||||
emit("cancel");
|
emit("cancel");
|
||||||
};
|
};
|
||||||
|
|
||||||
function openDown(link){
|
function openDown(link) {
|
||||||
window.open(process.env.VUE_APP_FILE_PATH + link)
|
window.open(process.env.VUE_APP_FILE_PATH + link);
|
||||||
//:href="item.indexOf('http') !== -1 ? item : locationHref + item"
|
//:href="item.indexOf('http') !== -1 ? item : locationHref + item"
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -342,6 +479,8 @@ export default defineComponent({
|
|||||||
filterTxt,
|
filterTxt,
|
||||||
openDown,
|
openDown,
|
||||||
handleCancel,
|
handleCancel,
|
||||||
|
jobType,
|
||||||
|
bandList,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user