feat:增加学习路径基本信息编辑

This commit is contained in:
lixg
2022-12-08 20:31:45 +08:00
parent 3bcb5e3efe
commit a748ae9ad3
3 changed files with 70 additions and 10 deletions

View File

@@ -689,7 +689,7 @@
</div>
<div v-show="twobtnn" class="twobtn">
<div class="btnone" @click="closebtn">取消</div>
<div class="btntwo" @click="closebtn">确定</div>
<div class="btntwo" @click="editLearnInfo">确定</div>
</div>
</div>
<div class="onemain clearfix">
@@ -719,6 +719,7 @@
:controls="false"
:autofocus="true"
:min="0"
:precision="0"
/>
<span>-</span
><span style="color: #4ea6ff" v-show="number">{{
@@ -730,11 +731,17 @@
:controls="false"
:autofocus="true"
:min="0"
:precision="0"
/>
<span>关内容</span>
</div>
</div>
<div class="checkcon" style="margin-top: 20px">
<a-checkbox
class="in"
:disabled="number"
v-model:checked="studySelect"
></a-checkbox>
<!-- <input
type="checkbox"
name="cb1"
@@ -755,6 +762,7 @@
:controls="false"
:autofocus="true"
:min="0"
:precision="0"
/>
<span>-</span
><span style="color: #4ea6ff" v-show="number">{{
@@ -766,6 +774,7 @@
:controls="false"
:autofocus="true"
:min="0"
:precision="0"
/>
<span>关内容</span>
</div>
@@ -1449,6 +1458,13 @@ export default {
codevisible: false, //二维码是否显示
codeInfo: null, //二维码内容
previewSelect: 0,
studySelect: 0,
previewStartNum: 0,
previewEndNum: 0,
studyStartNum: 0,
studyEndNum: 0,
});
const levelList = reactive({
@@ -1481,11 +1497,6 @@ export default {
name: "关卡二xx",
},
],
previewStartNum: 0,
previewEndNum: 0,
studyStartNum: 0,
studyEndNum: 0,
});
const tableDataFunc = () => {
@@ -1647,6 +1658,7 @@ export default {
state.twobtn = true;
state.number = true;
state.inputbox = false;
myGetRouterDetail();
};
const showCopyModal = () => {
state.copyModal = true;
@@ -2037,6 +2049,27 @@ export default {
name: data[i].name,
});
}
//获取设置信息
if (res.data.code === 200) {
//previewSetting studySetting
state.previewSelect = res.data.data.routerInfo.enablePreview;
state.studySelect = res.data.data.routerInfo.enableStudy;
if (res.data.data.routerInfo.previewSetting) {
let arr = res.data.data.routerInfo.previewSetting.split(",");
if (arr.length === 2) {
state.previewStartNum = arr[0];
state.previewEndNum = arr[1];
}
}
if (res.data.data.routerInfo.studySetting) {
let arr = res.data.data.routerInfo.studySetting.split(",");
if (arr.length === 2) {
state.studyStartNum = arr[0];
state.studyEndNum = arr[1];
}
}
}
})
.catch((err) => {
console.log(err);
@@ -2194,7 +2227,30 @@ export default {
message.warning("删除失败");
});
};
// 设置------------------------------------------------------
//编辑基本信息
const editLearnInfo = () => {
let obj = {
routerId: state.routerId,
enablePreview: state.previewSelect ? 1 : 0,
enableStudy: state.studySelect ? 1 : 0,
previewSetting: state.previewStartNum + "," + state.previewEndNum,
studySetting: state.studyStartNum + "," + state.studyEndNum,
};
console.log("编辑设置基本信息obj", obj);
api
.editLearnInfo(obj)
.then((res) => {
console.log("编辑设置基本信息成功", res);
if (res.data.code === 200) {
message.success("修改成功");
}
})
.catch((err) => {
console.log("编辑设置基本信息失败", err);
});
};
// 设置-----------------------------------------------------
//添加学员
watch(
() => state.addAuthList,
@@ -2305,6 +2361,7 @@ export default {
checkedClose,
showCodeModel,
showCodeModel2,
editLearnInfo,
};
},
};
@@ -4201,7 +4258,7 @@ export default {
position: absolute;
// margin-top: 10px;
left: 0;
top: 3px;
top: 0px;
}
.yulan {