Merge remote-tracking branch 'origin/build' into build

This commit is contained in:
aixianling
2023-02-09 11:53:49 +08:00
12 changed files with 997 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
<template>
<section class="AiEditInput" :class="{[align]:true,error}">
<el-input v-if="edit" size="small" v-model="content" @change="handleChange" @blur="cancel" clearable autofocus/>
<div class="valueText" v-else v-text="value" @click="edit=true"/>
<div class="valueText" v-if="!edit && value" v-text="value" @click="edit=true"/>
<i v-if="!edit && !value" class="el-icon-edit" @click="edit = true"></i>
</section>
</template>
@@ -54,7 +55,8 @@ export default {
.valueText {
width: 100%;
height: 100%;
min-height: 32px;
min-width: 43px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;

View File

@@ -32,7 +32,7 @@
<ai-table v-if="moduleId" :tableData="cateList" :col-configs="cateColConfigs" :isShowPagination="false" @getList="getCateList">
<el-table-column slot="category" label="分类名称" align="center">
<template slot-scope="{row}">
<ai-edit-input v-model="row.categoryName" :error.sync="row.error"/>
<ai-edit-input v-model="row.categoryName" :key="row.id" :error.sync="row.error"/>
</template>
</el-table-column>
<el-table-column slot="options" width="220px" fixed="right" label="操作" align="center">

View File

@@ -0,0 +1,63 @@
<template>
<div class="AppQuestionBank">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import Add from './components/Add'
import List from './components/List'
export default {
name: 'AppCertificateManage',
label: '证书管理',
props: {
instance: Function,
dict: Object
},
data () {
return {
component: 'List',
params: {},
include: []
}
},
components: {
Add,
List
},
methods: {
onChange (data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss">
.AppQuestionBank {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>

View File

@@ -0,0 +1,106 @@
<template>
<ai-detail class="AppCertificateManage">
<template slot="title">
<ai-title :title="params.id ? '编辑' + '证书' : '添加' + '证书'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="证书名称" prop="title" :rules="[{required: true, message: '请输入证书名称', trigger: 'blur'}]">
<el-input size="small" v-model="form.title" clearable placeholder="请输入证书名称" :maxlength="200"></el-input>
</el-form-item>
<el-form-item prop="type" style="width: 100%" label="类型" :rules="[{required: true, message: '请选择类型', trigger: 'change'}]">
<el-radio-group v-model="form.type">
<el-radio label="1">单选题</el-radio>
<el-radio label="2">多选题</el-radio>
<el-radio label="3">判断题</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="上传证书" prop="pictureUrl" style="width: 100%;" :rules="[{required: true, message: '请上传证书', trigger: 'change'}]">
<ai-uploader
:instance="instance"
v-model="form.pictureUrl"
:limit="1">
</ai-uploader>
</el-form-item>
</el-form>
</template>
</ai-card>
</template>
<template #footer>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="confirm">提交</el-button>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Add',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
form: {
title: '',
content: '',
pictureUrl: [],
type: '1'
},
id: ''
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
}
})
},
confirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appcontentinfo/addOrUpdate`, {
...this.form
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.cancel(true)
}, 600)
}
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
.AppCertificateManage {
}
</style>

View File

@@ -0,0 +1,126 @@
<template>
<ai-list class="notice">
<template slot="title">
<ai-title title="证书管理" isShowBottomBorder></ai-title>
</template>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
</template>
<template #right>
<el-input
v-model="search.title"
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="请输入标题"
clearable
@clear="search.current = 1, getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
export default {
name: 'List',
props: {
instance: Function,
dict: Object
},
data () {
return {
search: {
current: 1,
size: 10,
title: '',
status: ''
},
total: 10,
colConfigs: [
{ prop: 'title', label: '题目', align: 'left' },
{ prop: 'createUserName', label: '证书名称', align: 'center' },
{ prop: 'createUserName', label: '类型', align: 'center' },
{ prop: 'createUserName', label: '已颁发数量', align: 'center' },
{ prop: 'createUserName', label: '累积学习时(分钟)', align: 'center' },
{ prop: 'createUserName', label: '通过考试', align: 'center' }
],
tableData: []
}
},
created() {
this.getList()
},
methods: {
getList() {
this.instance.post(`/app/appmarketingactivityinfo/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
remove (id) {
this.$confirm('确定删除该活动?').then(() => {
this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
},
toAdd(id) {
this.$emit('change', {
type: 'Add',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,63 @@
<template>
<div class="AppQuestionBank">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import List from './components/List'
import Detail from './components/Detail'
export default {
name: 'AppLearningRecord',
label: '居民学习记录',
props: {
instance: Function,
dict: Object
},
data () {
return {
component: 'List',
params: {},
include: []
}
},
components: {
List,
Detail
},
methods: {
onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss">
.AppQuestionBank {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>

View File

@@ -0,0 +1,74 @@
<template>
<ai-detail>
<template slot="title">
<ai-title title="课程详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="题目描述" isLine :value="info.title"></ai-info-item>
<ai-info-item label="题目类型" isLine :value="info.title"></ai-info-item>
<ai-info-item label="正确答案" isLine :value="info.areaName"></ai-info-item>
<ai-info-item label="题目选项" isLine :value="info.contentType"></ai-info-item>
<ai-info-item label="正文" isLine>
<AiArticle :value="info.content"></AiArticle>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object,
moduleId: String
},
data () {
return {
info: {},
id: ''
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.info.pictureUrl = res.data.pictureUrl ? [{
url: res.data.pictureUrl
}] : []
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,118 @@
<template>
<ai-list class="notice">
<template slot="title">
<ai-title title="居民学习记录" isShowBottomBorder isShowArea v-model="search.areaId" :instance="instance" @change="search.current = 1, getList()"></ai-title>
</template>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
</template>
<template #right>
<el-input
v-model="search.title"
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="请输入姓名/身份证/手机号/微信昵称"
clearable
@clear="search.current = 1, getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="90px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
export default {
name: 'List',
props: {
instance: Function,
dict: Object
},
data () {
return {
search: {
current: 1,
size: 10,
title: '',
areaId: ''
},
total: 10,
colConfigs: [
{ prop: 'title', label: '题目', align: 'left' },
{ prop: 'createUserName', label: '微信昵称', align: 'center' },
{ prop: 'createUserName', label: '手机号', align: 'center' },
{ prop: 'createUserName', label: '姓名', align: 'center' },
{ prop: 'createUserName', label: '身份证号', align: 'center' },
{ prop: 'createUserName', label: '地址', align: 'center' },
{ prop: 'createUserName', label: '学习时长(分钟)', align: 'center' },
{ prop: 'createUserName', label: '考试场数', align: 'center' },
{ prop: 'createUserName', label: '通过考试', align: 'center' }
],
tableData: []
}
},
created() {
this.getList()
},
methods: {
getList() {
this.instance.post(`/app/appmarketingactivityinfo/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
remove (id) {
this.$confirm('确定删除该活动?').then(() => {
this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,70 @@
<template>
<div class="AppQuestionBank">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import Add from './components/Add'
import List from './components/List'
import Detail from './components/Detail'
export default {
name: 'AppQuestionBank',
label: '试题库',
props: {
instance: Function,
dict: Object
},
data () {
return {
component: 'List',
params: {},
include: []
}
},
components: {
Add,
List,
Detail
},
methods: {
onChange (data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
}
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss">
.AppQuestionBank {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>

View File

@@ -0,0 +1,175 @@
<template>
<ai-detail class="AppQuestionBank-add" v-loading="isLoading">
<template slot="title">
<ai-title :title="params.id ? '编辑' + '试题库' : '添加' + '试题库'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="题目描述" style="width: 100%;" prop="title" :rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
<el-input size="small" type="textarea" :rows="4" v-model="form.title" clearable placeholder="请输入..." :maxlength="500" :show-word-limit="true"></el-input>
</el-form-item>
<el-form-item prop="type" label="题目类型" :rules="[{required: true, message: '请选择题目类型', trigger: 'change'}]">
<el-radio-group v-model="form.type" @change="onTypeChange">
<el-radio label="1">单选题</el-radio>
<el-radio label="2">多选题</el-radio>
<el-radio label="3">判断题</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="options" v-if="form.type !== '3'" style="width: 100%;" label="题目选项" :rules="[{required: true, message: '请输入题目选项', trigger: 'change'}]">
<div class="options" v-for="(item, index) in form.options" :key="index">
<span>选项{{ index + 1 }}</span>
<el-input placeholder="请输入选项名" size="small" :maxlength="100" show-word-limit v-model="item.label"></el-input>
<i class="iconfont iconDelete" @click="removeOptions(index)"></i>
</div>
<el-button type="text" class="add-select" @click="addOptions">添加选项</el-button>
</el-form-item>
<el-form-item style="width: 100%;" v-if="form.options.length && form.type !== '3'" prop="answer" label="题目答案" :rules="[{required: true, message: '请选择题目答案', trigger: 'change'}]">
<el-select :multiple="form.type === '2'" v-model="form.answer" size="small" placeholder="请选择题目答案">
<el-option
v-for="(item, index) in form.options"
:key="index"
:label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-if="form.type === '3'" style="width: 100%;" prop="answer" label="题目答案" :rules="[{required: true, message: '请选择题目答案', trigger: 'change'}]">
<el-radio-group v-model="form.answer">
<el-radio label="1">正确</el-radio>
<el-radio label="0">错误</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="答案解析" prop="content" style="width: 100%;" :rules="[{required: true, message: '请输入内容', trigger: 'change'}]">
<ai-editor v-model="form.content" :instance="instance"/>
</el-form-item>
</el-form>
</template>
</ai-card>
</template>
<template #footer>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" :loading="isLoading" @click="confirm">提交</el-button>
</template>
</ai-detail>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Add',
props: {
instance: Function,
dict: Object,
params: Object,
areaId: String
},
data () {
return {
info: {},
form: {
title: '',
content: '',
type: '1',
answer: '',
options: []
},
isLoading: false,
id: ''
}
},
computed: {
...mapState(['user'])
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
}
})
},
onTypeChange (e) {
if (e === '2') {
this.form.answer = []
} else {
this.form.answer = ''
}
},
addOptions () {
this.form.options.push({
label: ''
})
},
removeOptions (index) {
this.form.options.splice(index, 1)
},
confirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.isLoading = true
this.instance.post(`/app/appcontentinfo/addOrUpdate`, {
...this.form
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.cancel(true)
}, 600)
} else {
this.isLoading = false
}
}).catch(() => {
this.isLoading = false
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
.AppQuestionBank-add {
.options {
display: flex;
align-items: center;
.el-input {
width: 420px;
margin: 0 14px;
}
span {
color: #666;
}
i:hover {
cursor: pointer;
opacity: 0.7;
}
}
}
</style>

View File

@@ -0,0 +1,74 @@
<template>
<ai-detail>
<template slot="title">
<ai-title title="课程详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="题目描述" isLine :value="info.title"></ai-info-item>
<ai-info-item label="题目类型" isLine :value="info.title"></ai-info-item>
<ai-info-item label="正确答案" isLine :value="info.areaName"></ai-info-item>
<ai-info-item label="题目选项" isLine :value="info.contentType"></ai-info-item>
<ai-info-item label="正文" isLine>
<AiArticle :value="info.content"></AiArticle>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object,
moduleId: String
},
data () {
return {
info: {},
id: ''
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.info.pictureUrl = res.data.pictureUrl ? [{
url: res.data.pictureUrl
}] : []
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,123 @@
<template>
<ai-list class="notice">
<template slot="title">
<ai-title title="试题库" isShowBottomBorder></ai-title>
</template>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
</template>
<template #right>
<el-input
v-model="search.title"
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="请输入标题"
clearable
@clear="search.current = 1, getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
export default {
name: 'List',
props: {
instance: Function,
dict: Object
},
data () {
return {
search: {
current: 1,
size: 10,
title: '',
status: ''
},
total: 10,
colConfigs: [
{ prop: 'title', label: '题目', align: 'left' },
{ prop: 'createUserName', label: '题目类型', align: 'center' }
],
tableData: []
}
},
created() {
this.getList()
},
methods: {
getList() {
this.instance.post(`/app/appmarketingactivityinfo/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
remove (id) {
this.$confirm('确定删除该活动?').then(() => {
this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
},
toAdd(id) {
this.$emit('change', {
type: 'Add',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>