提交 e692f649 编写于 作者: vino's avatar vino

云鹊专区中应用配置增加自定义积木需求

上级 bd0670d2
...@@ -325,3 +325,15 @@ export const doctorsByIdOrMobile = (params) => { ...@@ -325,3 +325,15 @@ export const doctorsByIdOrMobile = (params) => {
description: '批量导入人员', description: '批量导入人员',
}) })
}; };
// https://dev-sc.yunqueyi.com/contents/admin/template/queryTemplate?id=&title=&publishFlag=&createdTime=&pageNo=1&pageSize=15
export const getActivityList = (params) => {
return fetch({
headers,
url: getBaseUrl(`contents/admin/template/queryTemplate?id=${params.id}&title=${params.title}&publishFlag=${params.publishFlag}&createdTime=${params.createdTime}&pageNo=${params.pageNo}&pageSize=${params.pageSize}`),
method: 'get',
data: params,
description: '活动列表',
})
};
...@@ -39,13 +39,39 @@ ...@@ -39,13 +39,39 @@
<el-input v-model="scope.row.appName" style="width:120px;" :maxlength="6" size="small" placeholder="重命名"/> <el-input v-model="scope.row.appName" style="width:120px;" :maxlength="6" size="small" placeholder="重命名"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="序号" width="200"> <el-table-column label="序号" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.seqNo" style="width:60px;" size="small" @blur="BlurText($event)" @placeholder="序号"/> <el-input v-model="scope.row.seqNo" style="width:60px;" size="small" @blur="BlurText($event)" @placeholder="序号"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="选择积木页" :index="indexMethod" width="300" class="required-label">
<template slot-scope="scope">
<el-select filterable v-if="scope.row.appTag == 10" v-model="scope.row.appUrl" placeholder="请选择积木页" style="position: relative;width:75%;">
<el-option
style="position: relative;"
v-for="item2 in settingForm.activityList"
:key="item2.id"
:label="item2.title"
:value="item2.id">
</el-option>
</el-select>
<img v-if="scope.row.appTag == 10"
@click="add(scope.$index)"
class="edit-img"
src="../../assets/image/plus.png"
/>
<img v-if="scope.row.appTag == 10 && count > 0"
@click="del(scope.$index)"
class="edit-img"
src="../../assets/image/trash.png"
/>
</template>
</el-table-column>
</el-table> </el-table>
<div style="margin-top: 60px;margin-left: 150px;"> <div style="margin-top: 60px;margin-left: 150px;">
<el-button type="primary" @click="checkSubmitData()" center>保存</el-button> <el-button type="primary" @click="checkSubmitData()" center>保存</el-button>
<!--<el-button @click="cancle()">取 消</el-button>--> <!--<el-button @click="cancle()">取 消</el-button>-->
...@@ -58,7 +84,7 @@ ...@@ -58,7 +84,7 @@
<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, getActivityList} from "../../utils/yqrange/yqrangeApi";
import { isEmptyUtils } from "../../utils/index"; import { isEmptyUtils } from "../../utils/index";
export default { export default {
...@@ -84,13 +110,17 @@ export default { ...@@ -84,13 +110,17 @@ export default {
dialogSettingVisible: false, dialogSettingVisible: false,
settingForm:{ settingForm:{
circleId: null, circleId: null,
settingData: [] settingData: [],
} activityList:[]
},
tempList: [],
count: 0,
} }
}, },
created() { created() {
this.circleId = this.$route.query.id; this.circleId = this.$route.query.id;
this.setting(); this.setting();
this.initActivityList();
}, },
methods: { methods: {
...@@ -98,13 +128,24 @@ export default { ...@@ -98,13 +128,24 @@ export default {
setting(){ setting(){
let params = { let params = {
circleId: this.circleId circleId: this.circleId
// circleId: 22 // circleId: 194
} }
getCircleSettingList(params).then((res) => { getCircleSettingList(params).then((res) => {
closeLoading(this); closeLoading(this);
if(res.code == "000000") { if(res.code == "000000") {
this.settingForm.settingData = res.data; this.settingForm.settingData = res.data;
if(this.settingForm.settingData != null
&& this.settingForm.settingData.length > 0){
for (let i = 0; i<this.settingForm.settingData.length; i++){
// 自定义积木
if(this.settingForm.settingData[i].appTag == 10){
this.count ++;
this.settingForm.settingData[i].appUrl = parseInt(this.settingForm.settingData[i].appUrl);
}
}
this.count --;
}
} else { } else {
this.settingForm.settingData = []; this.settingForm.settingData = [];
} }
...@@ -124,12 +165,16 @@ export default { ...@@ -124,12 +165,16 @@ export default {
this.$message.error("序号不可为空,请检查"); this.$message.error("序号不可为空,请检查");
return; return;
} }
if (this.settingForm.settingData[i].appTag == 10 && isEmptyUtils(this.settingForm.settingData[i].appUrl)) {
this.$message.error("请选择积木页");
return;
}
const r = /^\+?[1-9][0-9]*$/; // 正整数 const r = /^\+?[1-9][0-9]*$/; // 正整数
// 如果判断不符合正则,则不是正整数不能提交 // 如果判断不符合正则,则不是正整数不能提交
if (!r.test(this.settingForm.settingData[i].seqNo)) { if (!r.test(this.settingForm.settingData[i].seqNo)) {
return; return;
} }
if (this.settingForm.settingData[i].seqNo < 1 || this.settingForm.settingData[i].seqNo > 10) { if (this.settingForm.settingData[i].seqNo < 1 || this.settingForm.settingData[i].seqNo > 50) {
return; return;
} }
if (this.settingForm.settingData[i].seqNo > this.settingForm.settingData.length) { if (this.settingForm.settingData[i].seqNo > this.settingForm.settingData.length) {
...@@ -182,6 +227,63 @@ export default { ...@@ -182,6 +227,63 @@ export default {
this.$message.warning('请输入 1~10 的正整数') this.$message.warning('请输入 1~10 的正整数')
e.target.value = '' e.target.value = ''
} }
},
// 应用配置
initActivityList(){
let params = {
// circleId: this.circleId
id: "",
title: "",
publishFlag: "",
createdTime: "",
pageNo: 1,
pageSize: 1000
}
getActivityList(params).then((res) => {
closeLoading(this);
if(res.code == "000000") {
this.settingForm.activityList = res.data.templateList;
} else {
this.settingForm.activityList = [];
}
}).catch((error) => {
this.$message.error("请重试");
})
},
indexMethod(index){
this.index = index;
},
add(index){
if(this.settingForm.settingData != null && this.settingForm.settingData.length > 0 ){
this.tempList = this.settingForm.settingData.filter(function (item) {
return item.appTag == 10;
});
if(this.tempList.length > 0){
this.row = {
appName: "",
appTag: 10,
appType: this.tempList[0].appType,
appUrl: "",
ecoAppParams: [],
id: "",
seqNo: index+2,
showOff: 0,
}
this.count ++;
this.settingForm.settingData.push(this.row);
}
}
},
del(index){
this.count --;
this.settingForm.settingData.splice(index, 1);
} }
}, },
} }
...@@ -257,4 +359,7 @@ export default { ...@@ -257,4 +359,7 @@ export default {
.el-table--border th.gutter:last-of-type { .el-table--border th.gutter:last-of-type {
width: 0; width: 0;
} }
.el-select-dropdown {
width: 300px;
}
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册