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