Commit 967c8a30 authored by zhengke's avatar zhengke

增加小程序信息

parent 2833a131
...@@ -663,6 +663,45 @@ export function DelContributeMediumBatch(data) { ...@@ -663,6 +663,45 @@ export function DelContributeMediumBatch(data) {
} }
/**
* 获取小程序分页列表
*/
export function GetContributeAppletPageList(data) {
return request({
url: '/QYContribute/GetContributeAppletPageList',
method: 'post',
data
})
}
/**
* 新增修改小程序信息
*/
export function SetContributeApplet(data) {
return request({
url: '/QYContribute/SetContributeApplet',
method: 'post',
data
})
}
/**
* 删除小程序
*/
export function DelContributeApplet(data) {
return request({
url: '/QYContribute/DelContributeApplet',
method: 'post',
data
})
}
......
<template>
<div>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale">
<q-card style="width: 450px; max-width: 450px">
<q-card-section>
<div class="text-h6">
{{ objOption.Id == 0 ? "新增小程序信息" : "修改小程序信息" }}
</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap">
<q-input filled stack-label :dense="false" v-model="objOption.Name" ref="Name"
class="col-12 q-pb-lg" label="小程序名称" :rules="[(val) => !!val || '请填写小程序名称']" />
<q-input filled stack-label :dense="false" v-model="objOption.AppID" ref="AppID"
class="col-12 q-pb-lg" label="AppID" :rules="[(val) => !!val || '请填写小程序AppID']" />
</div>
<div style="width:100px;height:100px;border:1px solid #d1d1d1;text-align:center;line-height:100px;cursor:pointer;" @click="getImgChoice=true">
<i class="el-icon-plus avatar-uploader-icon" style="font-size: 30px;"
v-if="objOption.Image==''"></i>
<q-img v-else :src="objOption.Image" style="width: 100%;height: 100%;">
</q-img>
</div>
<q-input filled stack-label :dense="false" v-model="objOption.Page" ref="Page"
class="col-12 q-pt-lg" label="路径"/>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight: 400 !important" @click="closeCourseForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight: 400 !important" :loading="saveCourseLoading"
@click="saveCourse" />
</q-card-actions>
</q-card>
</q-dialog>
<!-- 选择文件 -->
<q-dialog title="选择文件" v-model="getImgChoice" width="1200px">
<ChooseImg @SelectId="SelectId" :type="1" @closeDia="getImgChoice=false"></ChooseImg>
</q-dialog>
</div>
</template>
<script>
import {
SetContributeApplet
} from "../../api/system/wechat";
import ChooseImg from '../../pages/teacher/components/ChooseImg'
export default {
components: {
ChooseImg
},
props: {
saveObj: {
type: Object,
default: null,
},
},
data() {
return {
persistent: true,
saveCourseLoading:false,
getImgChoice:false,
objOption: {
Id: 0,
Name: "", //小程序名称
AppID: "", // appid
Image: "", //图标
Page: '' //路径
}
};
},
created() {
},
mounted() {
if(this.saveObj){
this.objOption.Id = this.saveObj.Id;
this.objOption.Name = this.saveObj.Name;
this.objOption.AppID = this.saveObj.AppID;
this.objOption.Image = this.saveObj.Image;
this.objOption.Page = this.saveObj.Page;
}
},
methods: {
SelectId(obj) {
this.objOption.Image = obj.url;
this.getImgChoice = false;
},
//关闭弹窗
closeCourseForm() {
this.$emit("close");
this.persistent = false;
},
//保存菜单
saveCourse() {
this.$refs.Name.validate();
this.$refs.AppID.validate();
if (
!this.$refs.Name.hasError &&
!this.$refs.AppID.hasError
) {
this.saveCourseLoading = true;
SetContributeApplet(this.objOption)
.then((res) => {
this.saveCourseLoading = false;
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top",
});
this.$emit("success");
this.$emit("close");
})
.catch(() => {
this.saveCourseLoading = false;
});
}
}
},
};
</script>
<style> <style>
.platformdeploy .Period-rules { .platformdeploy .Period-rules {
display: flex; display: flex;
margin-bottom: 24px; margin-bottom: 24px;
padding-left: 20px; padding-left: 20px;
} }
.platformdeploy .Period_Spreate { .platformdeploy .Period_Spreate {
flex: 1; flex: 1;
min-width: 200px; min-width: 200px;
margin-right: 32px; margin-right: 32px;
} }
.platformdeploy .Period-rule-title { .platformdeploy .Period-rule-title {
color: #646a73; color: #646a73;
margin-bottom: 4px; margin-bottom: 4px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.platformdeploy .Period-info-icon { .platformdeploy .Period-info-icon {
margin-left: 8px; margin-left: 8px;
color: #8f959e; color: #8f959e;
line-height: 1; line-height: 1;
vertical-align: top; vertical-align: top;
} }
.process_Btn_List { .process_Btn_List {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
padding: 20px; padding: 20px;
} }
.processBtn_Cancel { .processBtn_Cancel {
width: 90px; width: 90px;
height: 35px; height: 35px;
border: 1px solid #A1AAB2; border: 1px solid #A1AAB2;
color: #000000; color: #000000;
background-color: #fff; background-color: #fff;
text-align: center; text-align: center;
line-height: 35px; line-height: 35px;
border-radius: 5px; border-radius: 5px;
cursor: pointer; cursor: pointer;
margin-right: 20px; margin-right: 20px;
} }
.processBtn_Save { .processBtn_Save {
width: 90px; width: 90px;
height: 35px; height: 35px;
background-color: #2961FE; background-color: #2961FE;
color: #FFF; color: #FFF;
text-align: center; text-align: center;
line-height: 35px; line-height: 35px;
border-radius: 5px; border-radius: 5px;
cursor: pointer; cursor: pointer;
} }
.baseSetForm_Dialog { .baseSetForm_Dialog {
margin: 20px; margin: 20px;
} }
.cycle_Title {
font-size: 20px;
font-weight: 500;
color: #1f2329;
}
.Period-alert {
padding: 9px 16px;
border-radius: 4px;
background-color: #f0f4ff;
line-height: 22px;
color: #1f2329;
display: flex;
align-items: center;
margin-top: 20px;
margin-bottom: 12px;
font-size: 13px;
}
.Okr_Length {
font-weight: 500;
color: #1f2329;
}
.addDutyUpload .ItemImgDiv {
width: 118px;
height: 118px;
position: relative;
margin: 0 10px 10px 0;
display: inline-block;
}
.addDutyUpload .avatar-uploader .el-upload {
border-radius: 6px;
cursor: pointer;
width: 100%;
height: 100%;
color: #8c939d;
position: relative;
overflow: hidden;
}
.addDutyMain {
display: inline-block;
width: 118px;
height: 118px;
font-size: 70px;
border: 1px dashed #d9d9d9;
line-height: 120px;
}
.cycle_Title {
font-size: 20px;
font-weight: 500;
color: #1f2329;
}
.Period-alert {
padding: 9px 16px;
border-radius: 4px;
background-color: #f0f4ff;
line-height: 22px;
color: #1f2329;
display: flex;
align-items: center;
margin-top: 20px;
margin-bottom: 12px;
font-size: 13px;
}
.Okr_Length {
font-weight: 500;
color: #1f2329;
}
.addDutyUpload .ItemImgDiv {
width: 118px;
height: 118px;
position: relative;
margin: 0 10px 10px 0;
display: inline-block;
}
.addDutyUpload .avatar-uploader .el-upload {
border-radius: 6px;
cursor: pointer;
width: 100%;
height: 100%;
color: #8c939d;
position: relative;
overflow: hidden;
}
.addDutyMain {
display: inline-block;
width: 118px;
height: 118px;
font-size: 70px;
border: 1px dashed #d9d9d9;
line-height: 120px;
}
</style> </style>
<template> <template>
<div class="page-body"> <div class="page-body">
<div class="platformdeploy"> <div class="platformdeploy">
<q-tabs style="margin-bottom:20px;" v-model="tabCheck" @input="tabChange()" narrow-indicator dense <q-tabs style="margin-bottom:20px;" v-model="tabCheck" @input="tabChange()" narrow-indicator dense align="left"
align="left" class="text-primary"> class="text-primary">
<q-tab v-for="(x,y) in TypeEnumList" :key='y' :ripple="false" :name="x.Id" :label="x.Name" /> <q-tab v-for="(x,y) in TypeEnumList" :key='y' :ripple="false" :name="x.Id" :label="x.Name" />
</q-tabs> </q-tabs>
<!-- 公众号 --> <!-- 公众号 -->
<template> <template>
<div style="text-align:right;"> <div style="text-align:right;">
<q-btn color="accent" size="sm" class="q-mr-md" @click="geteject" label="修改平台配置" /> <q-btn color="accent" size="sm" class="q-mr-md" @click="geteject" label="修改平台配置" />
</div> <q-btn color="accent" size="sm" class="q-mr-md" @click="goLittleProgram" label="小程序信息" />
<div v-if="data && data.Id && data.Id>0"> </div>
<div v-if="data && data.Id && data.Id>0">
<div class="Period-rules">
<div class="Period_Spreate"> <div class="Period-rules">
<div class="Period-rule-title">平台类型</div> <div class="Period_Spreate">
<div> <div class="Period-rule-title">平台类型</div>
<span> <div>
{{data.Type}} <span>
</span> {{data.Type}}
</div> </span>
</div>
</div>
<div class="Period_Spreate"> </div>
<div class="Period-rule-title"> <div class="Period_Spreate">
平台名称 <div class="Period-rule-title">
</div> 平台名称
<div> </div>
{{data.Name}} <div>
</div> {{data.Name}}
</div> </div>
</div> </div>
<div class="Period-rules"> </div>
<div class="Period_Spreate"> <div class="Period-rules">
<div class="Period-rule-title"> <div class="Period_Spreate">
AppId <div class="Period-rule-title">
</div> AppId
<div> </div>
{{data.AppId}} <div>
</div> {{data.AppId}}
</div>
</div>
<div class="Period_Spreate"> </div>
<div class="Period-rule-title"> <div class="Period_Spreate">
App秘钥 <div class="Period-rule-title">
</div> App秘钥
<div> </div>
{{data.AppSecret}} <div>
</div> {{data.AppSecret}}
</div>
</div>
</div>
</div>
</div>
<div class="Period-rules">
<div class="Period_Spreate"> <div class="Period-rules">
<div class="Period-rule-title"> <div class="Period_Spreate">
开启状态 <div class="Period-rule-title">
</div> 开启状态
<div> </div>
{{data.Enable==1?'已开启':'未开启'}} <div>
</div> {{data.Enable==1?'已开启':'未开启'}}
</div> </div>
</div> </div>
</div>
</div>
<div v-else style="width: 100%;height: 100px;line-height: 100px;text-align: center;">
暂无任何配置
</div>
</template>
<q-dialog v-model="isShowBaseSet" maximized full-height seamless position="right" @hide="closeProcess">
<q-card style="margin-top:61px;width:500px" class="no-border-radius classinfo_Dialog">
<div class="baseSetForm_Dialog">
<div class="cycle_Title">平台配置</div>
<div style="margin-top: 10px;">
<q-input filled stack-label :dense="false" v-model="addMsg.Name" ref="Name"
class="col-12 q-pb-lg" label="平台名称" :rules="[val => !!val || '请填写平台名称']" />
</div>
<div>
<q-input filled stack-label :dense="false" v-model="addMsg.AppId" ref="AppId"
class="col-12 q-pb-lg" label="AppId" :rules="[val => !!val || '请填写AppId']" />
</div>
<div>
<q-input filled stack-label :dense="false" v-model="addMsg.AppSecret" ref="AppSecret"
class="col-12 q-pb-lg" label="app秘钥" :rules="[val => !!val || '请填写app秘钥']" />
</div>
<div class="Okr_Length" style="margin:20px 0;display: flex;align-items: center;">
<div style="color:#1f2329;margin-right: 10px;">开启状态</div>
<el-switch v-model="addMsg.Enable" :active-value="1" :inactive-value="2"></el-switch>
</div>
</div>
<div class="process_Btn_List">
<div class="processBtn_Cancel" @click="closeProcess">关闭</div>
<div class="processBtn_Save" @click="setBaseInfo">确定</div>
</div>
</q-card>
<div class="dialog-out-close" @click="closeProcess"
style="height:40px !important;border-top-left-radius: 4px !important;border-bottom-left-radius: 4px !important;">
<q-icon name="iconfont icon-jujue1" size="26px" />
</div>
</q-dialog>
</div> </div>
<div v-else style="width: 100%;height: 100px;line-height: 100px;text-align: center;">
暂无任何配置
</div>
</template>
<q-dialog v-model="isShowBaseSet" maximized full-height seamless position="right" @hide="closeProcess">
<q-card style="margin-top:61px;width:500px" class="no-border-radius classinfo_Dialog">
<div class="baseSetForm_Dialog">
<div class="cycle_Title">平台配置</div>
<div style="margin-top: 10px;">
<q-input filled stack-label :dense="false" v-model="addMsg.Name" ref="Name" class="col-12 q-pb-lg"
label="平台名称" :rules="[val => !!val || '请填写平台名称']" />
</div>
<div>
<q-input filled stack-label :dense="false" v-model="addMsg.AppId" ref="AppId" class="col-12 q-pb-lg"
label="AppId" :rules="[val => !!val || '请填写AppId']" />
</div>
<div>
<q-input filled stack-label :dense="false" v-model="addMsg.AppSecret" ref="AppSecret"
class="col-12 q-pb-lg" label="app秘钥" :rules="[val => !!val || '请填写app秘钥']" />
</div>
<div class="Okr_Length" style="margin:20px 0;display: flex;align-items: center;">
<div style="color:#1f2329;margin-right: 10px;">开启状态</div>
<el-switch v-model="addMsg.Enable" :active-value="1" :inactive-value="2"></el-switch>
</div>
</div>
<div class="process_Btn_List">
<div class="processBtn_Cancel" @click="closeProcess">关闭</div>
<div class="processBtn_Save" @click="setBaseInfo">确定</div>
</div>
</q-card>
<div class="dialog-out-close" @click="closeProcess"
style="height:40px !important;border-top-left-radius: 4px !important;border-bottom-left-radius: 4px !important;">
<q-icon name="iconfont icon-jujue1" size="26px" />
</div>
</q-dialog>
</div> </div>
</div>
</template> </template>
<script> <script>
import {
getContributeConfigTypeEnumList,
getContributeConfigInfo,
setContributeConfigInfo
} from '../../api/system/index'
export default {
meta: {
title: "平台配置"
},
components: {
},
data() {
return {
isShowBaseSet: false,
tabCheck: '1',
TypeEnumList: [], //各平台枚举列表
data: null,
addMsg: {}
}
},
mounted() {
this.getEnumList()
},
methods: {
tabChange() {
this.getConfigInfo()
},
getEnumList() {
getContributeConfigTypeEnumList({}).then(res => {
if (res.Code == 1) {
this.TypeEnumList = res.Data;
this.tabCheck = this.TypeEnumList[0].Id;
this.getConfigInfo()
}
})
},
getConfigInfo() { //获取平台配置
getContributeConfigInfo({
Type: this.tabCheck
}).then(res => {
if (res.Code == 1) {
this.data = res.Data;
}
})
},
geteject() {
if (this.data && this.data.Id && this.data.Id > 0) {
this.addMsg = JSON.parse(JSON.stringify(this.data))
} else {
this.addMsg = {
Id: 0,
Type: this.tabCheck,
Enable: 1,
AppId: '',
Name: '',
AppSecret: '',
}
}
import { this.isShowBaseSet = true;
getContributeConfigTypeEnumList, },
getContributeConfigInfo, //关闭流程设置
setContributeConfigInfo closeProcess() {
} from '../../api/system/index' this.isShowBaseSet = false;
},
setBaseInfo() {
export default { this.$refs.Name.validate();
meta: { this.$refs.AppId.validate();
title: "平台配置" this.$refs.AppSecret.validate();
}, if (!this.$refs.Name.hasError && !this.$refs.AppId.hasError && !this.$refs.AppSecret.hasError) {
components: { let msg = {
Id: this.addMsg.Id,
}, Name: this.addMsg.Name,
data() { AppId: this.addMsg.AppId,
return { AppSecret: this.addMsg.AppSecret,
isShowBaseSet: false, Type: this.addMsg.Type,
tabCheck: '1', Enable: this.addMsg.Enable,
TypeEnumList: [],//各平台枚举列表
data: null, }
addMsg: {} setContributeConfigInfo(msg).then(res => {
} if (res.Code == 1) {
}, this.$q.notify({
mounted() { icon: 'iconfont icon-chenggong',
this.getEnumList() color: 'accent',
}, timeout: 2000,
methods: { message: '数据保存成功!',
tabChange(){ position: 'top'
this.getConfigInfo() })
}, this.getConfigInfo()
getEnumList() { this.isShowBaseSet = false;
getContributeConfigTypeEnumList({}).then(res => {
if (res.Code == 1) {
this.TypeEnumList = res.Data;
this.tabCheck = this.TypeEnumList[0].Id;
this.getConfigInfo()
}
})
},
getConfigInfo() {//获取平台配置
getContributeConfigInfo({ Type: this.tabCheck }).then(res => {
if (res.Code == 1) {
this.data = res.Data;
}
})
},
geteject() {
if (this.data && this.data.Id && this.data.Id > 0) {
this.addMsg = JSON.parse(JSON.stringify(this.data))
} else {
this.addMsg = {
Id: 0,
Type: this.tabCheck,
Enable: 1,
AppId: '',
Name: '',
AppSecret: '',
}
}
this.isShowBaseSet = true;
},
//关闭流程设置
closeProcess() {
this.isShowBaseSet = false;
},
setBaseInfo() {
this.$refs.Name.validate();
this.$refs.AppId.validate();
this.$refs.AppSecret.validate();
if (!this.$refs.Name.hasError && !this.$refs.AppId.hasError && !this.$refs.AppSecret.hasError ) {
let msg = {
Id: this.addMsg.Id,
Name: this.addMsg.Name,
AppId: this.addMsg.AppId,
AppSecret: this.addMsg.AppSecret,
Type: this.addMsg.Type,
Enable: this.addMsg.Enable,
}
setContributeConfigInfo(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.getConfigInfo()
this.isShowBaseSet = false;
}
})
}
} }
})
} }
},
//跳转到微信小程序页面
goLittleProgram(){
var tempStr = '../system/smallProgramInfo';
this.$router.push({
path: tempStr,
query: {}
});
}
} }
}
</script> </script>
\ No newline at end of file
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable filled v-model="msg.Name" label="小程序名称"
@clear="resetSearch" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" clearable filled v-model="msg.AppID" label="AppID"
@clear="resetSearch" maxlength="20" />
</div>
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="dataList" :columns="columns">
<template v-slot:top="props">
<div class="col-2 q-table__title">小程序信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增小程序" @click="EditProgram(null)" />
</div>
</template>
<template v-slot:body-cell-Image="props">
<q-td :props="props">
<q-img :src="props.row.Image" />
</q-td>
</template>
<template v-slot:body-cell-Id="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditProgram(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400;" label="删除"
@click="deleteProgram(props.row)" />
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
</q-table>
<program-form v-if="isShowProgram" :save-obj="programObj" @close="closeProgramForm" @success="refreshPage">
</program-form>
</div>
</div>
</template>
<script>
import {
GetContributeAppletPageList,
DelContributeApplet
} from '../../api/system/wechat'
import programForm from '../../components/system/program-form'
export default {
meta: {
title: "小程序信息"
},
components: {
programForm
},
data() {
return {
msg: {
pageIndex: 1,
pageSize: 10,
rowsPerPage: 10,
Name: '', //小程序名称
AppID:'' //AppID
},
pageCount:0,
dataList: [],
loading: true,
columns: [{
name: 'Name',
label: '小程序名称',
field: 'Name',
align: 'left'
},{
name: 'AppID',
label: 'AppID',
field: 'AppID',
align: 'left'
},
{
name: 'Image',
label: '图标',
field: 'Image',
align: 'left'
},
{
name: 'Page',
label: '路径',
field: 'Page',
align: 'left'
},
{
name: 'UpdateByName',
label: '修改人',
align: 'left',
field: row => row.UpdateByName
},
{
name: 'UpdateTime',
label: '修改时间',
align: 'left',
field: row => row.UpdateTime
},
{
name: 'Id',
label: '操作',
field: 'Id'
}
],
isShowProgram:false,
programObj:{}
}
},
mounted() {
this.getList();
},
methods: {
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
changePage(val) {
this.msg.pageIndex = val;
this.getList()
},
//删除系列
deleteProgram(item) {
let delMsg = {
AppletId: item.AppID
};
this.$q.dialog({
title: '提示信息',
message: '是否确定删除该小程序?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
DelContributeApplet(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '删除成功!',
position: 'top'
})
this.refreshPage();
}
})
}).onCancel(() => {
});
},
//刷新页面
refreshPage() {
this.getList();
},
//获取课程系列分页列表
getList() {
this.loading = true;
GetContributeAppletPageList(this.msg).then(res => {
this.loading = false;
this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
})
},
//新增修改课程系列
EditProgram(obj) {
if (obj) {
this.programObj = obj
} else {
this.programObj = null
}
this.isShowProgram = true;
},
//关闭弹窗
closeProgramForm() {
this.isShowProgram = false
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
...@@ -193,6 +193,11 @@ const routes = [{ ...@@ -193,6 +193,11 @@ const routes = [{
component: () => component: () =>
import("pages/system/platformdeploy.vue") import("pages/system/platformdeploy.vue")
}, },
{
path: "/system/smallProgramInfo", //小程序信息
component: () =>
import("pages/system/smallProgramInfo.vue")
},
{ {
path: "/course/catagory", //课程分类 path: "/course/catagory", //课程分类
component: () => component: () =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment