feat:合并

This commit is contained in:
lixg
2022-12-13 21:49:54 +08:00
parent dbc88a2568
commit 68f5a4957e
3 changed files with 119 additions and 105 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-21 14:32:52
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-13 09:24:16
* @LastEditTime: 2022-12-13 15:30:27
* @FilePath: /fe-manage/src/api/config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/

View File

@@ -76,7 +76,7 @@ export default {
{
id: 1,
name: "管理员",
go: "/manage/learningpath",
go: "/learningpath",
},
{
id: 2,

View File

@@ -6,7 +6,7 @@
<div
@click="backPage"
style="cursor: pointer"
to="/manage/libraryAdd"
to="/libraryAdd"
class="goback"
>
<span class="return"></span><span class="returntext">返回</span>
@@ -43,7 +43,7 @@
<ProjectClass v-model:value="projectInfo.category"></ProjectClass>
</div>
</div>
<div class="name" style="align-items: flex-start;">
<div class="name" style="align-items: flex-start">
<div class="namebox" style="margin-top: 10px">
<img
class="nameimg"
@@ -67,7 +67,12 @@
allowClear
></a-select>
<img
style="width:100px;height:100px;margin-top:20px;border-radius: 8px"
style="
width: 100px;
height: 100px;
margin-top: 20px;
border-radius: 8px;
"
v-if="projectInfo.picUrl"
:src="projectInfo.picUrl"
alt="avatar"
@@ -151,8 +156,7 @@
<div class="inname">同步学习记录</div>
</div>
<div class="in">
<a-checkbox
v-model:checked="projectInfo.courseSyncFlag"
<a-checkbox v-model:checked="projectInfo.courseSyncFlag"
><span
style="
width: 100%;
@@ -197,9 +201,7 @@
<div class="inname">是否BOEU实施</div>
</div>
<div class="in">
<a-radio-group
v-model:value="projectInfo.boeFlag"
>
<a-radio-group v-model:value="projectInfo.boeFlag">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
@@ -211,15 +213,13 @@
<div class="btn">
<a-button v-on:click="createProject" type="primary" class="btn1"
>确定
</a-button
>
</a-button>
<a-button @click="backPage" class="btn2">取消</a-button>
</div>
</div>
</div>
</template>
<script setup>
import { useStore } from "vuex";
import { ref, onMounted, watch } from "vue";
import { message } from "ant-design-vue";
@@ -234,31 +234,41 @@ import ProjectLevel from "@/components/project/ProjectLevel";
const route = useRoute();
const router = useRouter();
const store = useStore();
const projectInfo = ref({})
const projectPic = ref([])
const projectInfo = ref({});
const projectPic = ref([]);
onMounted(() => {
getDetail()
projectPic.value = store.state.projectPic.map((e) => ({value: e.dictValue, label: e.dictName}));
})
getDetail();
projectPic.value = store.state.projectPic.map((e) => ({
value: e.dictValue,
label: e.dictName,
}));
});
watch(() => route.query.projectTemplateId, () => {
getDetail()
})
watch(
() => route.query.projectTemplateId,
() => {
getDetail();
}
);
const getDetail = () => route.query.projectTemplateId && api.templateDetail(route.query.projectTemplateId)
.then((res) => {
const getDetail = () =>
route.query.projectTemplateId &&
api.templateDetail(route.query.projectTemplateId).then((res) => {
projectInfo.value = res.data.data.projectTemplateInfo;
projectInfo.value.rangeTime = [projectInfo.value.beginTime, projectInfo.value.endTime]
})
projectInfo.value.rangeTime = [
projectInfo.value.beginTime,
projectInfo.value.endTime,
];
});
const backPage = () => {
router.back();
};
const handleChangeSelect = (value) => {
projectInfo.value.picUrl = value
}
projectInfo.value.picUrl = value;
};
function timeChange(e) {
if (e && e.length === 2) {
@@ -289,18 +299,22 @@ const createProject = () => {
return;
}
}
api.templateEdit({...projectInfo.value, courseSyncFlag: projectInfo.value.courseSyncFlag ? 1 : 0}).then(() => {
api
.templateEdit({
...projectInfo.value,
courseSyncFlag: projectInfo.value.courseSyncFlag ? 1 : 0,
})
.then(() => {
message.destroy();
message.success("编辑成功");
router.back()
})
router.back();
});
};
function managerChange(e, l, d, t) {
projectInfo.value.valuesourceBelongId = d
projectInfo.value.sourceBelongName = t
projectInfo.value.valuesourceBelongId = d;
projectInfo.value.sourceBelongName = t;
}
</script>
<style lang="scss">
.projectAdd {