|
@@ -26,7 +26,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="choose">
|
|
<div class="choose">
|
|
<div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index"
|
|
<div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index"
|
|
- :style="{ margin: !CourseTypeJson[item.id].length && 0 }">
|
|
|
|
|
|
+ :style="{ margin: !CourseTypeJson[item.id].length && 0 }" v-if="(item.name != '类型') || typea != '' || typeE.indexOf('e4cb3395-5602-4441-801c-f380e8935a74') != -1">
|
|
<span v-if="CourseTypeJson[item.id].length">{{ item.name }}:</span>
|
|
<span v-if="CourseTypeJson[item.id].length">{{ item.name }}:</span>
|
|
<div class="typeCss" v-if="CourseTypeJson[item.id].length">
|
|
<div class="typeCss" v-if="CourseTypeJson[item.id].length">
|
|
<div class="cName" @click="getCourse2(item.name, '', item.id, 1)"
|
|
<div class="cName" @click="getCourse2(item.name, '', item.id, 1)"
|
|
@@ -50,12 +50,16 @@
|
|
<div class="pb_content_body">
|
|
<div class="pb_content_body">
|
|
<div class="student_table" v-loading="loading">
|
|
<div class="student_table" v-loading="loading">
|
|
<div class="source-box" v-for="(item, index) in res" :key="index">
|
|
<div class="source-box" v-for="(item, index) in res" :key="index">
|
|
- <div class="iamge"><img src="../../../assets/icon/source/image.png" alt=""></div>
|
|
|
|
- <div class="title"><span>{{ item.name }}</span></div>
|
|
|
|
|
|
+ <!-- <div class="iamge"><img src="../../../assets/icon/source/image.png" alt=""></div>
|
|
|
|
+ <div class="title"><span>{{ item.name }}</span></div> -->
|
|
|
|
+ <div class="fengmian">
|
|
|
|
+ <img src="../../../assets/icon/source/fengmian.jpg" alt="">
|
|
|
|
+ <div class="ftitle"><span>{{ item.name }}</span></div>
|
|
|
|
+ </div>
|
|
<div class="detail">{{ item.detail }}</div>
|
|
<div class="detail">{{ item.detail }}</div>
|
|
<div class="label"><span v-for="(k, ki) in item.label.split(',')" :key="index + '-' + ki">{{ k ? k : "无" }}</span>
|
|
<div class="label"><span v-for="(k, ki) in item.label.split(',')" :key="index + '-' + ki">{{ k ? k : "无" }}</span>
|
|
</div>
|
|
</div>
|
|
- <div class="button"><span @click="check(item.url)">查看</span></div>
|
|
|
|
|
|
+ <div class="button"><span @click="check(item.url)">查看</span><span @click="updateSource(item)" v-show="false">修改</span></div>
|
|
</div>
|
|
</div>
|
|
<div v-if="!res.length" style="text-align: center; width: 100%;">暂无数据</div>
|
|
<div v-if="!res.length" style="text-align: center; width: 100%;">暂无数据</div>
|
|
</div>
|
|
</div>
|
|
@@ -110,7 +114,8 @@
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
- <el-button type="primary" @click="add()">确定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="add()" v-if="updateType == 1">确定</el-button>
|
|
|
|
+ <el-button type="primary" @click="update()" v-if="updateType == 2">确定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -145,6 +150,8 @@ export default {
|
|
s_url: "",
|
|
s_url: "",
|
|
s_detail: "",
|
|
s_detail: "",
|
|
s_label: [],
|
|
s_label: [],
|
|
|
|
+ updateType:1,
|
|
|
|
+ updateId:""
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -249,6 +256,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(this.typea == "" && this.typeE.indexOf('e4cb3395-5602-4441-801c-f380e8935a74') == -1){
|
|
|
|
+ this.typeb = "";
|
|
|
|
+ this.typeE = []
|
|
|
|
+ }
|
|
this.getSource();
|
|
this.getSource();
|
|
},
|
|
},
|
|
getSource() {
|
|
getSource() {
|
|
@@ -281,6 +292,17 @@ export default {
|
|
this.s_url = ""
|
|
this.s_url = ""
|
|
this.s_detail = ""
|
|
this.s_detail = ""
|
|
this.s_label = []
|
|
this.s_label = []
|
|
|
|
+ this.updateType = 1
|
|
|
|
+ this.dialogVisible = true
|
|
|
|
+ },
|
|
|
|
+ updateSource(item) {
|
|
|
|
+ this.courseTypeId2 = item.typeid ? item.typeid.split(",") : []
|
|
|
|
+ this.s_title = item.name
|
|
|
|
+ this.s_url = item.url
|
|
|
|
+ this.s_detail = item.detail
|
|
|
|
+ this.s_label = item.label.split(",")
|
|
|
|
+ this.updateType = 2
|
|
|
|
+ this.updateId = item.id
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
},
|
|
},
|
|
add() {
|
|
add() {
|
|
@@ -318,6 +340,43 @@ export default {
|
|
this.$message.error("网络不佳");
|
|
this.$message.error("网络不佳");
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ update() {
|
|
|
|
+ if (this.s_title == '') {
|
|
|
|
+ this.$message.error('请填写工具名称')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.s_url == '') {
|
|
|
|
+ this.$message.error('请填写网址来源')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.s_detail == '') {
|
|
|
|
+ this.$message.error('请填写工具描述')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let params = [{
|
|
|
|
+ id:this.updateId,
|
|
|
|
+ name: this.s_title,
|
|
|
|
+ url: this.s_url,
|
|
|
|
+ detail: this.s_detail,
|
|
|
|
+ label: this.s_label.join(","),
|
|
|
|
+ userid: this.userid,
|
|
|
|
+ courseType: JSON.stringify(this.courseTypeId2)
|
|
|
|
+ }]
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "updateSource", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "修改成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.dialogVisible = false
|
|
|
|
+ this.getSource();
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.$message.error("网络不佳");
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -604,13 +663,15 @@ export default {
|
|
background: #fff;
|
|
background: #fff;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
margin: 0 20px 20px 0;
|
|
margin: 0 20px 20px 0;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
}
|
|
}
|
|
.source-box:nth-child(4n){
|
|
.source-box:nth-child(4n){
|
|
margin-right: 0;
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
.source-box .iamge {
|
|
.source-box .iamge {
|
|
- width: 208px;
|
|
|
|
- height: 180px;
|
|
|
|
|
|
+ width: 150px;
|
|
|
|
+ height: 125px;
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -618,7 +679,28 @@ export default {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
|
|
+.fengmian{
|
|
|
|
+ width: 100%;
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+.fengmian>img{
|
|
|
|
+ width: 100%;
|
|
|
|
+}
|
|
|
|
|
|
|
|
+.fengmian>.ftitle{
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 10%;
|
|
|
|
+ color: rgb(88, 121, 198);
|
|
|
|
+ width: 90%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
+}
|
|
.source-box .title {
|
|
.source-box .title {
|
|
width: 90%;
|
|
width: 90%;
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
@@ -644,6 +726,7 @@ export default {
|
|
-webkit-line-clamp: 2;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-orient: vertical;
|
|
height: 42px;
|
|
height: 42px;
|
|
|
|
+ font-size: 15px;
|
|
}
|
|
}
|
|
|
|
|
|
.source-box .label {
|
|
.source-box .label {
|
|
@@ -667,6 +750,7 @@ export default {
|
|
display: flex;
|
|
display: flex;
|
|
height: 40px;
|
|
height: 40px;
|
|
background: rgb(244, 244, 244);
|
|
background: rgb(244, 244, 244);
|
|
|
|
+ margin-top: auto;
|
|
}
|
|
}
|
|
|
|
|
|
.source-box .button>span {
|
|
.source-box .button>span {
|