mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 06:16:46 +08:00
-- fix bug
This commit is contained in:
@@ -169,13 +169,6 @@
|
||||
</div>
|
||||
<div class="inname">路径图名称</div>
|
||||
<div class="in road">
|
||||
<!-- <a-input-->
|
||||
<!-- v-model:value="pathName"-->
|
||||
<!-- maxlength="20"-->
|
||||
<!-- style="border-radius: 4px"-->
|
||||
<!-- placeholder="请输入学习路径名称"-->
|
||||
<!-- />-->
|
||||
<!-- <div class="showcount">{{ pathName.length }}/20</div>-->
|
||||
<NameInput
|
||||
placeholder="请输入路径名称"
|
||||
v-model:value="pathName"
|
||||
@@ -218,10 +211,6 @@
|
||||
</div>
|
||||
<div class="inname">路径图背景</div>
|
||||
<div class="in learnBg">
|
||||
<!-- <img class="im" src="../../assets/px.jpg" />
|
||||
<img class="im" src="../../assets/px.jpg" />
|
||||
<img class="im" src="../../assets/px.jpg" /> -->
|
||||
|
||||
<div
|
||||
@click="chooseImg(item)"
|
||||
v-for="(item, index) in imgData"
|
||||
@@ -255,7 +244,7 @@
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button class="samtn btn1" @click="handleOut">取消</button>
|
||||
<button class="samtn btn2" @click="createLearnPath">确定</button>
|
||||
<a-button class="samtn btn2" @click="createLearnPath" :loading="confirmLoading">确定</a-button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -297,13 +286,6 @@
|
||||
</div>
|
||||
<div class="inname">路径图名称</div>
|
||||
<div class="in road">
|
||||
<!-- <a-input-->
|
||||
<!-- v-model:value="pathName"-->
|
||||
<!-- maxlength="20"-->
|
||||
<!-- style="border-radius: 4px"-->
|
||||
<!-- placeholder="请输入学习路径名称"-->
|
||||
<!-- />-->
|
||||
<!-- <div class="showcount">{{ pathName.length }}/20</div>-->
|
||||
<NameInput
|
||||
placeholder="请输入路径名称"
|
||||
v-model:value="pathName"
|
||||
@@ -386,7 +368,7 @@
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button class="samtn btn1" @click="handleOut1">取消</button>
|
||||
<button class="samtn btn2" @click="editLearnPath">确定</button>
|
||||
<a-button class="samtn btn2" @click="editLearnPath" :loading="confirmLoading">确定</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -738,7 +720,9 @@ export default {
|
||||
setup() {
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
const userInfo = computed(()=>store.state.userInfo)
|
||||
const state = reactive({
|
||||
confirmLoading:false,
|
||||
tableLoading: false,
|
||||
out: false,
|
||||
out1: false,
|
||||
@@ -866,17 +850,16 @@ export default {
|
||||
const handleOut = () => {
|
||||
console.log(store.state);
|
||||
// console.log("打开创建路径弹窗");
|
||||
state.confirmLoading = false;
|
||||
state.pathName = "";
|
||||
state.pathBg = "";
|
||||
state.pathBgId = "";
|
||||
state.pathIntro = "";
|
||||
state.out = !state.out;
|
||||
setTimeout(() => {
|
||||
if (store.state.userInfo.departId && store.state.userInfo.departName) {
|
||||
state.organizationSelectName = store.state.userInfo.departName;
|
||||
state.organizationSelectId = store.state.userInfo.departId;
|
||||
}
|
||||
}, 2000);
|
||||
if (userInfo.value.departId && userInfo.value.departName) {
|
||||
state.organizationSelectName =userInfo.value.departName;
|
||||
state.organizationSelectId = userInfo.value.departId;
|
||||
}
|
||||
};
|
||||
const handleOut1 = () => {
|
||||
state.pathName = "";
|
||||
@@ -1175,24 +1158,30 @@ export default {
|
||||
};
|
||||
//创建学习路径图
|
||||
const createLearnPath = async () => {
|
||||
state.confirmLoading = true
|
||||
if (!state.pathName) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("请输入路径图名称");
|
||||
}
|
||||
if (!state.organizationSelectName) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("请选择归属组织");
|
||||
}
|
||||
if (!state.pathBg) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("请选择背景图");
|
||||
}
|
||||
if (!state.mobilePicUrl) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("未配置H5背景图,请联系管理员!");
|
||||
}
|
||||
if (!state.validate) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
message.warning("路径图名称重复");
|
||||
return;
|
||||
}
|
||||
@@ -1205,9 +1194,9 @@ export default {
|
||||
});
|
||||
if (offName) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("项目名称重复,请重新填写");
|
||||
}
|
||||
state.lpLoading = true;
|
||||
api.createLearnPath({
|
||||
name: state.pathName,
|
||||
remark: state.pathIntro,
|
||||
@@ -1218,8 +1207,8 @@ export default {
|
||||
mobilePicUrl: state.mobilePicUrl,
|
||||
}).then(id => {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
message.success("创建成功");
|
||||
state.lpLoading = false;
|
||||
router.push( {path: "/leveladd",query:{routerId: id.data.data }})
|
||||
})
|
||||
};
|
||||
@@ -1268,49 +1257,38 @@ export default {
|
||||
};
|
||||
//删除学习路径图
|
||||
const deleteLearnPath = () => {
|
||||
let obj = {
|
||||
routerId: state.deletePathId,
|
||||
type: -2,
|
||||
};
|
||||
api
|
||||
.handleLearnPath(obj)
|
||||
.then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
console.log("删除成功", res);
|
||||
message.destroy();
|
||||
message.success("删除成功");
|
||||
state.deleteModal = false;
|
||||
getLearnPath();
|
||||
}
|
||||
if (res.data.code === -1) {
|
||||
message.warning(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("删除失败", err);
|
||||
});
|
||||
state.deleteModal = false;
|
||||
state.tableLoading = true;
|
||||
message.success("删除成功");
|
||||
api.handleLearnPath({routerId: state.deletePathId, type: -2}).then(() => {getLearnPath()})
|
||||
};
|
||||
|
||||
//编辑学习路径图
|
||||
const editLearnPath = async () => {
|
||||
state.confirmLoading = true
|
||||
if (!state.pathName) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("请输入路径图名称");
|
||||
}
|
||||
if (!state.organizationSelectName) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("请选择归属组织");
|
||||
}
|
||||
if (!state.pathBgId) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("请选择背景图");
|
||||
}
|
||||
if (!state.mobilePicUrl) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("未配置H5背景图,请联系管理员!");
|
||||
}
|
||||
if (!state.validate) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("路径图名称重复");
|
||||
}
|
||||
// state.pathName = detail.name;
|
||||
@@ -1330,10 +1308,15 @@ export default {
|
||||
});
|
||||
if (offName) {
|
||||
message.destroy();
|
||||
state.confirmLoading = false
|
||||
return message.warning("项目名称重复,请重新填写");
|
||||
}
|
||||
state.out1 = false;
|
||||
state.confirmLoading = false
|
||||
message.success("修改成功");
|
||||
state.tableLoading = true;
|
||||
let obj = {
|
||||
routerId: state.editPathId,
|
||||
id: state.editPathId,
|
||||
name: state.pathName,
|
||||
picUrl: state.pathBg,
|
||||
mobilePicUrl: state.mobilePicUrl,
|
||||
@@ -1342,40 +1325,10 @@ export default {
|
||||
organizationId: state.organizationSelectId,
|
||||
status: 0,
|
||||
};
|
||||
api
|
||||
.createLearnPath(obj)
|
||||
.then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
console.log("修改成功", res);
|
||||
message.destroy();
|
||||
message.success("修改成功");
|
||||
// state.createLoading = false;
|
||||
// state.currentPage = 1;
|
||||
state.out1 = false;
|
||||
// router.push("/leveladd");
|
||||
getLearnPath();
|
||||
// setTimeout(() => {
|
||||
// console.log("修改成功", res);
|
||||
// message.success("修改成功");
|
||||
// // state.createLoading = false;
|
||||
// // state.currentPage = 1;
|
||||
// state.out1 = false;
|
||||
// // router.push("/leveladd");
|
||||
// getLearnPath();
|
||||
// }, 1000);
|
||||
}
|
||||
if (res.data.code === -1) {
|
||||
message.warning(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("修改失败", err);
|
||||
// state.createLoading = false;
|
||||
});
|
||||
api.createLearnPath(obj).then(() => {getLearnPath()})
|
||||
};
|
||||
//选择状态
|
||||
const selectStatusClassify = (e, v) => {
|
||||
// console.log("eee", e, v);
|
||||
state.statusValue = e;
|
||||
state.statusClassify = v.classify;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user