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)"> :label="item.dictValue" style="margin-left: 30px;margin-top: 30px" @change="setModuleStyle(item.dictName,item.dictValue)">
{{ `${item.dictName}` }} {{ `${item.dictName}` }}
<div> <div>
<el-image <el-image
style="width: 100px;height: 100px;" style="width: 100px;height: 100px;"
:key="item.remark" :key="item.remark"
:src="item.remark" :src="item.remark"
:preview-src-list="previewImgList" :preview-src-list="previewImgList"
@click="clickImg(item.remark)"> @click="clickImg(item.remark)">
</el-image> </el-image>
</div> </div>
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-form> </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> </el-dialog>
</template> </template>
@ -41,7 +45,11 @@ export default {
moduleStyle: '' moduleStyle: ''
}, },
moduleStyleList: [], moduleStyleList: [],
previewImgList: [] previewImgList: [],
data: {
moduleStyle: '',
moduleStyleName: ''
}
} }
}, },
computed: { computed: {
@ -62,7 +70,7 @@ export default {
this.previewImgList.push(url) this.previewImgList.push(url)
}, },
getModuleStyleList () { 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) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -70,15 +78,18 @@ export default {
}).catch(() => {}) }).catch(() => {})
}, },
setModuleStyle (name, value) { 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) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false
} }
let data = { this.$emit('setModuleStyle', this.data)
moduleStyle: value,
moduleStyleName: name
}
this.$emit('setModuleStyle', data)
this.visible = false 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() this.getSecondOrgDicList()
}, },
getModuleStyleList () { 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) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -207,7 +207,7 @@ export default {
this.dataForm.categoryType = item this.dataForm.categoryType = item
}, },
getcategoryList () { 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) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -223,7 +223,7 @@ export default {
}).catch(() => { }) }).catch(() => { })
}, },
getInfo () { 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) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
@ -258,7 +258,7 @@ export default {
if (!valid) { if (!valid) {
return false 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) { if (res.code !== 0) {
return this.$message.error(res.msg) 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-form>
<el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;">
<table-tree-column prop="categoryName" label="模块类别名称" header-align="center"></table-tree-column> <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"> <el-table-column align="center" label="模块图片" :show-overflow-tooltip="true" prop="imgUrl">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" <el-popover placement="right"
@ -25,7 +24,6 @@
</template> </template>
</el-table-column> </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="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="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 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"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
@ -50,8 +48,8 @@ export default {
data () { data () {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/custom/modulecategory/list', getDataListURL: '/news/modulecategory/list',
deleteURL: '/custom/modulecategory' deleteURL: '/news/modulecategory'
}, },
upLoadUrl: '' upLoadUrl: ''
} }

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

@ -35,14 +35,9 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-form-item label="所属模块" prop="noticeCategory"> <el-form-item label="所属模块" prop="noticeCategory">
<el-select v-model="dataForm.noticeCategory" placeholder="请选择模块"> <div class="block">
<el-option <el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable></el-cascader>
v-for="item in optionNoticeCategoryCode" </div>
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="通知标题" <el-form-item label="通知标题"
prop="noticeTitle"> prop="noticeTitle">
@ -150,7 +145,20 @@ export default {
gridList: [], gridList: [],
options: [], options: [],
optionNoticeCategoryCode: [], 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: { computed: {
@ -185,6 +193,7 @@ export default {
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street')) this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))
// notice_category // notice_category
this.getListSimpleByDictType() this.getListSimpleByDictType()
this.getModuleCategoryList()
}, },
methods: { methods: {
// //
@ -251,6 +260,7 @@ export default {
} }
this.dataForm = { ...this.dataForm, ...res.data } this.dataForm = { ...this.dataForm, ...res.data }
// this.quillEditor.root.innerHTML = res.data.noticeContent // this.quillEditor.root.innerHTML = res.data.noticeContent
this.noticeCategoryList = res.data.noticeCategoriesShow
if (this.dataForm.streetId) { if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) { if (this.dataForm.communityId === 0) {
this.dataForm.communityId = this.dataForm.gridId = null this.dataForm.communityId = this.dataForm.gridId = null
@ -368,6 +378,24 @@ export default {
} }
this.optionNoticeCategoryCode = res.data this.optionNoticeCategoryCode = res.data
}).catch(() => {}) }).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: { components: {

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

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