Browse Source

模块类型bug修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
c22c9fae40
  1. 39
      src/views/modules/news/module-style-list.vue
  2. 8
      src/views/modules/news/modulecategory-add-or-update.vue
  3. 6
      src/views/modules/news/modulecategory.vue
  4. 46
      src/views/modules/news/notice-add-or-update.vue
  5. 57
      src/views/modules/news/notice.vue

39
src/views/modules/custom/module-style-list.vue → src/views/modules/news/module-style-list.vue

@ -14,18 +14,22 @@
:label="item.dictValue" style="margin-left: 30px;margin-top: 30px" @change="setModuleStyle(item.dictName,item.dictValue)">
{{ `${item.dictName}` }}
<div>
<el-image
style="width: 100px;height: 100px;"
:key="item.remark"
:src="item.remark"
:preview-src-list="previewImgList"
@click="clickImg(item.remark)">
</el-image>
<el-image
style="width: 100px;height: 100px;"
:key="item.remark"
:src="item.remark"
:preview-src-list="previewImgList"
@click="clickImg(item.remark)">
</el-image>
</div>
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
@ -41,7 +45,11 @@ export default {
moduleStyle: ''
},
moduleStyleList: [],
previewImgList: []
previewImgList: [],
data: {
moduleStyle: '',
moduleStyleName: ''
}
}
},
computed: {
@ -62,7 +70,7 @@ export default {
this.previewImgList.push(url)
},
getModuleStyleList () {
this.$http.get(`/custom/module/listSimple/jinshui_gui_style`).then(({ data: res }) => {
this.$http.get(`/sys/dict/listSimple/jinshui_gui_style`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -70,15 +78,18 @@ export default {
}).catch(() => {})
},
setModuleStyle (name, value) {
this.data.moduleStyle = value
this.data.moduleStyleName = name
},
dataFormSubmitHandle () {
if (this.data.moduleStyle === '' || this.data.moduleStyle === undefined || this.data.moduleStyleName === '' || this.data.moduleStyleName === undefined) {
return this.$message.error('请选择模块样式')
}
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
let data = {
moduleStyle: value,
moduleStyleName: name
}
this.$emit('setModuleStyle', data)
this.$emit('setModuleStyle', this.data)
this.visible = false
})
},

8
src/views/modules/custom/modulecategory-add-or-update.vue → src/views/modules/news/modulecategory-add-or-update.vue

@ -175,7 +175,7 @@ export default {
this.getSecondOrgDicList()
},
getModuleStyleList () {
this.$http.get(`/custom/module/listSimple/jinshui_gui_style`).then(({ data: res }) => {
this.$http.get(`/sys/dict/listSimple/jinshui_gui_style`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -207,7 +207,7 @@ export default {
this.dataForm.categoryType = item
},
getcategoryList () {
return this.$http.get('/custom/modulecategory/list').then(({ data: res }) => {
return this.$http.get('/news/modulecategory/list').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -223,7 +223,7 @@ export default {
}).catch(() => { })
},
getInfo () {
this.$http.get(`/custom/modulecategory/${this.dataForm.id}`).then(({ data: res }) => {
this.$http.get(`/news/modulecategory/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -258,7 +258,7 @@ export default {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/modulecategory', this.dataForm).then(({ data: res }) => {
this.$http[!this.dataForm.id ? 'post' : 'put']('/news/modulecategory', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}

6
src/views/modules/custom/modulecategory.vue → src/views/modules/news/modulecategory.vue

@ -8,7 +8,6 @@
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;">
<table-tree-column prop="categoryName" label="模块类别名称" header-align="center"></table-tree-column>
<el-table-column prop="parentName" label="上级模块类别名称" header-align="center" align="center"></el-table-column>
<el-table-column align="center" label="模块图片" :show-overflow-tooltip="true" prop="imgUrl">
<template slot-scope="scope">
<el-popover placement="right"
@ -25,7 +24,6 @@
</template>
</el-table-column>
<el-table-column prop="enableFlag" label="启用标识" :formatter="showFlagFormatter" header-align="center" align="center" width="80"></el-table-column>
<el-table-column prop="sort" label="排序" header-align="center" align="center" width="60"></el-table-column>
<el-table-column prop="remark" label="备注" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" :label="$t('dept.sort')" header-align="center" align="center" width="80"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
@ -50,8 +48,8 @@ export default {
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/custom/modulecategory/list',
deleteURL: '/custom/modulecategory'
getDataListURL: '/news/modulecategory/list',
deleteURL: '/news/modulecategory'
},
upLoadUrl: ''
}

46
src/views/modules/news/notice-add-or-update.vue

@ -35,14 +35,9 @@
</el-form-item>
</el-row>
<el-form-item label="所属模块" prop="noticeCategory">
<el-select v-model="dataForm.noticeCategory" placeholder="请选择模块">
<el-option
v-for="item in optionNoticeCategoryCode"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
<div class="block">
<el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable></el-cascader>
</div>
</el-form-item>
<el-form-item label="通知标题"
prop="noticeTitle">
@ -150,7 +145,20 @@ export default {
gridList: [],
options: [],
optionNoticeCategoryCode: [],
videoLoading: false
videoLoading: false,
moduleCategoryList: [],
noticeCategoryList: [],
optionProps: {
checkStrictly: true,
value: 'categoryCode'
}
}
},
watch: {
'noticeCategoryList': function (val) {
if (val.length !== 0) {
this.dataForm.noticeCategory = val[val.length - 1]
}
}
},
computed: {
@ -185,6 +193,7 @@ export default {
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))
// notice_category
this.getListSimpleByDictType()
this.getModuleCategoryList()
},
methods: {
//
@ -251,6 +260,7 @@ export default {
}
this.dataForm = { ...this.dataForm, ...res.data }
// this.quillEditor.root.innerHTML = res.data.noticeContent
this.noticeCategoryList = res.data.noticeCategoriesShow
if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) {
this.dataForm.communityId = this.dataForm.gridId = null
@ -368,6 +378,24 @@ export default {
}
this.optionNoticeCategoryCode = res.data
}).catch(() => {})
},
getModuleCategoryList () {
this.$http.get('/news/modulecategory/list').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.getSelectedNode(res.data, res.data)
this.moduleCategoryList = res.data
}).catch(() => { })
},
getSelectedNode (nodeData, parent) {
nodeData.forEach(item => {
if ('children' in item && item.children.length === 0) {
delete item.children
} else if ('children' in item && item.children.length) {
this.getSelectedNode(item.children, item)
}
})
}
},
components: {

57
src/views/modules/news/notice.vue

@ -10,16 +10,11 @@
placeholder="通知标题"
clearable></el-input>
</el-form-item>
<el-form-item label="所属模块" prop="noticeCategory">
<el-select v-model="dataForm.noticeCategory" placeholder="请选择模块" clearable>
<el-option
v-for="item in optionNoticeCategoryCode"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属模块:" prop="noticeCategory">
<div class="block">
<el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable></el-cascader>
</div>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
@ -48,12 +43,12 @@
align="center"
show-overflow-tooltip
min-width="200"></el-table-column>
<el-table-column prop="noticeCategory"
<el-table-column prop="categoryName"
label="所属模块"
header-align="center"
align="center"
width="150"
:formatter="noticeCategoryFormat"></el-table-column>
></el-table-column>
<el-table-column prop="mobile"
label="联系电话"
header-align="center"
@ -127,7 +122,20 @@ export default {
dataForm: {
noticeTitle: ''
},
optionNoticeCategoryCode: []
optionNoticeCategoryCode: [],
moduleCategoryList: [],
noticeCategoryList: [],
optionProps: {
checkStrictly: true,
value: 'categoryCode'
}
}
},
watch: {
'noticeCategoryList': function (val) {
if (val.length !== 0) {
this.dataForm.noticeCategory = val[val.length - 1]
}
}
},
components: {
@ -135,7 +143,7 @@ export default {
},
created () {
// notice_category
this.getListSimpleByDictType()
this.getModuleCategoryList()
},
methods: {
//
@ -185,12 +193,23 @@ export default {
this.optionNoticeCategoryCode = res.data
}).catch(() => {})
},
noticeCategoryFormat (row, column) {
for (var property in this.optionNoticeCategoryCode) {
if (row.noticeCategory === this.optionNoticeCategoryCode[property].dictValue) {
return this.optionNoticeCategoryCode[property].dictName
getModuleCategoryList () {
this.$http.get('/news/modulecategory/list').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
}
this.getSelectedNode(res.data, res.data)
this.moduleCategoryList = res.data
}).catch(() => { })
},
getSelectedNode (nodeData, parent) {
nodeData.forEach(item => {
if ('children' in item && item.children.length === 0) {
delete item.children
} else if ('children' in item && item.children.length) {
this.getSelectedNode(item.children, item)
}
})
}
}
}

Loading…
Cancel
Save