提交 b04e7c85 编写于 作者: alex.zhang's avatar alex.zhang

Merge branch 'dev-liveCircle-1.9.1' into dev-circle-9-1-20210112

...@@ -28,7 +28,7 @@ export const getRangeList = (params) => { ...@@ -28,7 +28,7 @@ export const getRangeList = (params) => {
export const getCircleSettingList = (params) => { export const getCircleSettingList = (params) => {
return fetch({ return fetch({
headers, headers,
url: getBaseUrl(`circle/app/${params.circleId}/list`), url: getBaseUrl(`circle/v1/app/${params.circleId}/list`),
method: 'get', method: 'get',
description: '查看生态圈应用配置', description: '查看生态圈应用配置',
}) })
...@@ -37,7 +37,7 @@ export const getCircleSettingList = (params) => { ...@@ -37,7 +37,7 @@ export const getCircleSettingList = (params) => {
export const saveCircleSetting = (params) => { export const saveCircleSetting = (params) => {
return fetch({ return fetch({
headers, headers,
url: getBaseUrl(`circle/app/save`), url: getBaseUrl(`circle/v1/app/save`),
method: 'post', method: 'post',
data: params, data: params,
description: '保存生态圈应用配置', description: '保存生态圈应用配置',
......
...@@ -4,41 +4,63 @@ ...@@ -4,41 +4,63 @@
<div class="yqrange-index-content" id="screenSet"> <div class="yqrange-index-content" id="screenSet">
<!--<div class="header-title">云鹊小圈</div>--> <!--<div class="header-title">云鹊小圈</div>-->
<el-form ref="settingForm" :model="settingForm" <!-- <el-form ref="settingForm" :model="settingForm"
label-width="150px" label-width="150px"
label-suffix=":" label-suffix=":"
class="basic-form"> class="basic-form">
<div v-for="(item, index) in settingForm.settingData" :key="index" display:inline>
<div v-for="(item, index) in settingForm.settingData" :key="index"> <el-form-item :label="item.appType">
<el-form-item :label="item.appTagName">
<el-radio-group size="small" v-model="item.showOff"> <el-radio-group size="small" v-model="item.showOff">
<el-radio :label="1">开启</el-radio> <el-radio :label="1">开启</el-radio>
<el-radio :label="0">关闭</el-radio> <el-radio :label="0">关闭</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item>
</div>
</el-form> <el-input v-model="item.appName" style="width:120px;margin-left:40px;" size="small" placeholder="重命名"/>
<el-input v-model="item.seqNo" style="width:60px;margin-left:40px;" size="small" placeholder="序号"/>
</el-form-item>
</div>
</el-form> -->
<el-table :data="settingForm.settingData" class="customer-table" style="margin-left:70px;"
:header-cell-style="{background:'#ffffff'}">
<el-table-column label="" prop="appType" width="120"></el-table-column>
<el-table-column label="" width="180">
<template slot-scope="scope">
<el-radio-group size="small" v-model="scope.row.showOff">
<el-radio :label="1">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column label="重命名" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.appName" style="width:120px;" size="small" placeholder="重命名"/>
</template>
</el-table-column>
<el-table-column label="序号" width="200">
<template slot-scope="scope">
<el-input v-model="scope.row.seqNo" style="width:60px;" size="small" placeholder="序号"/>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 60px;margin-left: 150px;"> <div style="margin-top: 60px;margin-left: 150px;">
<el-button type="primary" @click="save()" center>保存</el-button> <el-button type="primary" @click="checkSubmitData()" center>保存</el-button>
<!--<el-button @click="cancle()">取 消</el-button>--> <!--<el-button @click="cancle()">取 消</el-button>-->
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue"; import BreadCrumb from "@/components/breadcrumb.vue";
import { getRangeList,updateRangeStatus, getCircleSettingList, saveCircleSetting} from "../../utils/yqrange/yqrangeApi"; import { getRangeList,updateRangeStatus, getCircleSettingList, saveCircleSetting} from "../../utils/yqrange/yqrangeApi";
import { isEmptyUtils } from "../../utils/index";
export default { export default {
components: { components: {
BreadCrumb BreadCrumb
...@@ -69,13 +91,11 @@ export default { ...@@ -69,13 +91,11 @@ export default {
created() { created() {
this.circleId = this.$route.query.id; this.circleId = this.$route.query.id;
this.setting(); this.setting();
}, },
methods: { methods: {
// 应用配置 // 应用配置
setting(){ setting(){
let params = { let params = {
circleId: this.circleId circleId: this.circleId
// circleId: 22 // circleId: 22
...@@ -85,80 +105,59 @@ export default { ...@@ -85,80 +105,59 @@ export default {
closeLoading(this); closeLoading(this);
if(res.code == "000000") { if(res.code == "000000") {
this.settingForm.settingData = res.data; this.settingForm.settingData = res.data;
} else { } else {
// this.$message.error(res.data.message);
this.settingForm.settingData = []; this.settingForm.settingData = [];
} }
if(this.settingForm.settingData == [] || this.settingForm.settingData.length == 0){ }).catch((error) => {
this.$message.error("请重试");
})
this.settingForm.settingData = [{
appTag: 1,
showOff: 1
},
{
appTag: 2,
showOff: 1
}, },
{
appTag: 3,
showOff: 1
},
{
appTag: 4,
showOff: 1
},
{
appTag: 5,
showOff: 0
}];
}
checkSubmitData() {
for(let i = 0; i < this.settingForm.settingData.length; i++){ for(let i=0; i<this.settingForm.settingData.length; i++) {
if(this.settingForm.settingData[i].appTag == 1){ if (isEmptyUtils(this.settingForm.settingData[i].appName)) {
this.settingForm.settingData[i].appTagName = "教培" this.$message.error("重命名输入框中的值不可为空,请检查");
return;
} }
else if(this.settingForm.settingData[i].appTag == 2){ if (isEmptyUtils(this.settingForm.settingData[i].seqNo)) {
this.settingForm.settingData[i].appTagName = "直播" this.$message.error("序号不可为空,请检查");
return;
} }
else if(this.settingForm.settingData[i].appTag == 3){ if (this.settingForm.settingData[i].seqNo > this.settingForm.settingData.length) {
this.settingForm.settingData[i].appTagName = "继教课程" this.$message.error("序号必须从1开始顺序排列,不能有跳序情况,请检查");
return;
} }
else if(this.settingForm.settingData[i].appTag == 4){ for(let j=0; j<this.settingForm.settingData.length; j++) {
this.settingForm.settingData[i].appTagName = "职称培训" if (i == j) {
continue;
} }
else if(this.settingForm.settingData[i].appTag == 5){ if (this.settingForm.settingData[i].seqNo == this.settingForm.settingData[j].seqNo) {
this.settingForm.settingData[i].appTagName = "云鹊豆商城" this.$message.error("序号不可重复,请检查");
return;
} }
} }
}
}).catch((error) => { this.save();
this.$message.error("请重试");
})
}, },
// 保存 // 保存
save(){ save(){
let params = { let params = {
apps: this.settingForm.settingData, apps: this.settingForm.settingData,
circleId: this.circleId circleId: this.circleId
} }
saveCircleSetting(params).then((res) => { saveCircleSetting(params).then((res) => {
closeLoading(this); closeLoading(this);
if(res.code == "000000") { if(res.code == "000000") {
this.$message.success("保存成功!"); this.$message.success("保存成功!");
// this.$router.go(-1); // this.$router.go(-1);
this.setting();
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("请重试"); this.$message.error("请重试");
}) })
}, },
cancle(){ cancle(){
...@@ -208,4 +207,36 @@ export default { ...@@ -208,4 +207,36 @@ export default {
/*margin-top: 30px;*/ /*margin-top: 30px;*/
/*}*/ /*}*/
/*}*/ /*}*/
// 去掉表格单元格边框
.customer-table th{
border:none;
}
.customer-table td,.customer-table th.is-leaf {
border:none;
}
// 表格最外边框
.el-table--border, .el-table--group{
border: none;
}
// 头部边框
.customer-table thead tr th.is-leaf{
width: 0;
}
.customer-table thead tr th:nth-last-of-type(2){
width: 0;
}
// 表格最外层边框-底部边框
.el-table--border::after, .el-table--group::after{
width: 0;
}
.customer-table::before{
width: 0;
}
.customer-table .el-table__fixed-right::before,.el-table__fixed::before{
width: 0;
}
// 表格有滚动时表格头边框
.el-table--border th.gutter:last-of-type {
width: 0;
}
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册