增加是否可评论

This commit is contained in:
aixianling
2022-05-25 11:55:34 +08:00
parent bcef93975e
commit 67d3ad9bca
2 changed files with 188 additions and 183 deletions

View File

@@ -1,17 +1,17 @@
<template>
<div class="doc-circulation ailist-wrapper">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"/>
</keep-alive>
</div>
</template>
<script>
import List from './components/List'
import Add from './components/Add'
import Detail from './components/Detail'
import List from './components/List'
import Add from './components/Add'
import Detail from './components/Detail'
export default {
export default {
name: 'AppContentManage',
label: '内容管理',
@@ -20,7 +20,7 @@
dict: Object
},
data () {
data() {
return {
component: 'List',
params: {},
@@ -33,12 +33,11 @@
List,
Detail
},
mounted () {
created() {
this.dict.load("yesOrNo")
},
methods: {
onChange (data) {
onChange(data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
@@ -61,13 +60,13 @@
}
}
}
}
}
</script>
<style lang="scss">
.doc-circulation {
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
}
</style>

View File

@@ -9,7 +9,8 @@
<template #content>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="模块名称" style="width: 100%;" prop="moduleName" :rules="[{required: true, message: '请输入模块名称', trigger: 'blur'}]">
<el-input type="input" style="width: 300px" size="small" v-model="form.moduleName" clearable placeholder="请输入模块名称" maxlength="30" show-word-limit></el-input>
<el-input type="input" style="width: 300px" size="small" v-model="form.moduleName" clearable placeholder="请输入模块名称" maxlength="30"
show-word-limit></el-input>
</el-form-item>
<el-form-item prop="menuName" label="菜单名称" :rules="[{required: true, message: '请选择菜单', trigger: 'change'}]">
<el-input type="input" style="width: 300px" disabled size="small" v-model="form.menuName" clearable placeholder="请选择菜单">
@@ -24,6 +25,11 @@
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否可评论" style="width: 100%;" prop="isComment" :rules="[{required: true, message: '请选择是否可评论'}]">
<el-radio-group v-model="form.isComment">
<el-radio v-for="op in dict.getDict('yseOrNo')" :label="op.dictValue">{{ op.dictName }}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</template>
</ai-card>
@@ -54,9 +60,9 @@
</template>
<script>
import { mapState } from 'vuex'
import {mapState} from 'vuex'
export default {
export default {
name: 'Add',
props: {
@@ -65,7 +71,7 @@
params: Object
},
data () {
data() {
return {
info: {},
form: {
@@ -94,7 +100,7 @@
...mapState(['user'])
},
created () {
created() {
this.getMenuList()
if (this.params && this.params.id) {
this.id = this.params.id
@@ -103,7 +109,7 @@
},
methods: {
getInfo (id) {
getInfo(id) {
this.instance.post(`/app/appcontentmoduleinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
@@ -111,7 +117,7 @@
})
},
showAdd () {
showAdd() {
this.isShowAdd = true
this.$nextTick(() => {
@@ -125,11 +131,11 @@
})
},
onClose () {
onClose() {
},
onConfirm () {
onConfirm() {
if (this.chooseNode.type === '1') {
this.form.menuId = this.chooseNode.id
this.form.menuName = this.chooseNode.name
@@ -140,11 +146,11 @@
}
},
onChange (e) {
onChange(e) {
this.chooseNode = e
},
getMenuList () {
getMenuList() {
this.instance.post(`/admin/menu/menuTree?containPermission=0`).then(res => {
if (res.code === 0) {
this.treeData = res.data
@@ -152,7 +158,7 @@
})
},
confirm () {
confirm() {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/appcontentmoduleinfo/addOrUpdate`, {
@@ -170,14 +176,14 @@
})
},
cancel (isRefresh) {
cancel(isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
}
}
</script>
<style scoped lang="scss">