Browse Source

修改新闻列表页面;其他

feature/yujt_analysis_pc
yujt 5 years ago
parent
commit
6783802bb0
  1. 69
      src/views/modules/news/allnews.vue
  2. 2
      src/views/modules/police/group-detail.vue
  3. 176
      src/views/modules/police/police.vue
  4. 198
      src/views/modules/property/property-add-or-update.vue
  5. 264
      src/views/modules/property/propertyproject-add-or-update.vue

69
src/views/modules/news/allnews.vue

@ -5,7 +5,7 @@
<el-form :inline="true" <el-form :inline="true"
:model="dataForm" :model="dataForm"
@keyup.enter.native="getDataList()"> @keyup.enter.native="getDataList()">
<el-form-item label="所属机构"> <el-form-item label="发布部门">
<el-cascader v-model="deptIdList" <el-cascader v-model="deptIdList"
:options="options" :options="options"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
@ -81,7 +81,7 @@
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="allDeptNames" <el-table-column prop="allDeptNames"
label="所属网格" label="发布部门"
header-align="center" header-align="center"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="createdTime" <el-table-column prop="createdTime"
@ -144,10 +144,7 @@ export default {
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
id: '', deptId: '',
streetId: '',
communityId: '',
gridId: '',
startTime: '', startTime: '',
endTime: '', endTime: '',
keyword: '', keyword: '',
@ -156,9 +153,6 @@ export default {
time: '', time: '',
options: [], options: [],
deptIdList: [], deptIdList: [],
streetList: [],
communityList: [],
gridList: [],
categorys: [], categorys: [],
onLine: { onLine: {
id: '', id: '',
@ -176,7 +170,6 @@ export default {
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => { }) .catch(() => { })
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))
this.getListCategory() this.getListCategory()
}, },
methods: { methods: {
@ -201,58 +194,6 @@ export default {
return '已下线' return '已下线'
} }
}, },
//
getDeptInfoList (dataReceiver, faDeptId) {
this.$http.get(`/sys/dept/sublist/` + faDeptId).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (dataReceiver === 'street') {
this.streetList = res.data
} else if (dataReceiver === 'community') {
this.communityList = res.data
} else if (dataReceiver === 'grid') {
this.gridList = res.data
}
}).catch(() => { })
},
changeStreet (event) {
if (this.dataForm.streetId === '') {
this.communityList = []
this.gridList = []
this.dataForm.communityId = ''
this.dataForm.gridId = ''
return
}
this.dataForm.streetId = event
let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0]
this.initDeptIdAndName(choosenItem)
this.dataForm.communityId = this.dataForm.gridId = null
this.communityList = this.gridList = []
this.getDeptInfoList('community', event)
},
changeCommunity (event) {
if (this.dataForm.communityId === '') {
this.gridList = []
this.dataForm.gridId = ''
return
}
this.communityId = event
let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0]
this.initDeptIdAndName(choosenItem)
this.dataForm.gridId = null
this.gridList = []
this.getDeptInfoList('grid', event)
},
changeGrid (event) {
this.dataForm.gridId = event
let choosenItem = this.gridList.filter(item => item.id === this.gridId)[0]
this.initDeptIdAndName(choosenItem)
},
initDeptIdAndName (choosenItem) {
this.dataForm.dept = choosenItem.name
this.dataForm.deptId = choosenItem.id
},
setRegistTime () { setRegistTime () {
console.log(this.time[0]) console.log(this.time[0])
this.dataForm.startTime = this.time[0] this.dataForm.startTime = this.time[0]
@ -349,9 +290,9 @@ export default {
watch: { watch: {
'deptIdList': function (val) { 'deptIdList': function (val) {
if (val.length !== 0) { if (val.length !== 0) {
this.dataForm.gridId = val[val.length - 1] this.dataForm.deptId = val[val.length - 1]
} else { } else {
this.dataForm.gridId = '' this.dataForm.deptId = ''
} }
} }
} }

2
src/views/modules/police/group-detail.vue

@ -178,7 +178,7 @@ export default {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
if (res.data.resultCode == 1) { if (res.data.resultCode === 1) {
this.$confirm(res.data.resultMessage, '提示', { this.$confirm(res.data.resultMessage, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',

176
src/views/modules/police/police.vue

@ -88,96 +88,96 @@
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './police-add-or-update' import AddOrUpdate from './police-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data() { data () {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/property/police/page', getDataListURL: '/property/police/page',
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: '/property/police', deleteURL: '/property/police',
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
id: '' id: ''
}, },
options: [], options: []
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
mounted() { mounted () {
// //
this.getByLoginUser() this.getByLoginUser()
}, },
methods: { methods: {
getByLoginUser() { getByLoginUser () {
this.$http this.$http
.get(`/sys/user/deptOptions/getMiddleByLoginUser`) .get(`/sys/user/deptOptions/getMiddleByLoginUser`)
.then(({data: res}) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => { .catch(() => {
}) })
}, },
handleChange(value) { handleChange (value) {
this.dataForm.deptId = value.slice(-1).shift() this.dataForm.deptId = value.slice(-1).shift()
}, },
beforeDeleteHandle(id) { beforeDeleteHandle (id) {
// this.$confirm('?', this.$t('prompt.title'), { // this.$confirm('?', this.$t('prompt.title'), {
// confirmButtonText: this.$t('confirm'), // confirmButtonText: this.$t('confirm'),
// cancelButtonText: this.$t('cancel'), // cancelButtonText: this.$t('cancel'),
// type: 'warning' // type: 'warning'
// }).then(() => { // }).then(() => {
this.deleteHandle(id); this.deleteHandle(id)
// }) // })
}, },
supplementHandle(data) { supplementHandle (data) {
if (!data && this.dataListSelections.length <= 0) { if (!data && this.dataListSelections.length <= 0) {
return this.$message({ return this.$message({
message: '请选择需要补建的社区', message: '请选择需要补建的社区',
type: 'warning', type: 'warning',
duration: 500 duration: 500
}) })
} }
if (!data && this.dataListSelections.length > 1) { if (!data && this.dataListSelections.length > 1) {
return this.$message({ return this.$message({
message: '只能选择一条数据', message: '只能选择一条数据',
type: 'warning', type: 'warning',
duration: 500 duration: 500
}) })
} }
this.$confirm(this.$t('prompt.info', {'handle': '补建群'}), this.$t('prompt.title'), { this.$confirm(this.$t('prompt.info', { 'handle': '补建群' }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'), confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'), cancelButtonText: this.$t('cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http.put('/property/police/supplement', data ? data : this.dataListSelections[0]).then(({data: res}) => { this.$http.put('/property/police/supplement', data || this.dataListSelections[0]).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.$message({
message: this.$t('prompt.success'), message: this.$t('prompt.success'),
type: 'success', type: 'success',
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.getDataList() this.getDataList()
}
})
}).catch(() => {
})
}).catch(() => {
})
} }
} })
}).catch(() => {
})
}).catch(() => {
})
} }
}
}
</script> </script>
<style scoped> <style scoped>
@ -185,4 +185,4 @@
width: 200px !important; width: 200px !important;
height: 200px !important;; height: 200px !important;;
} }
</style> </style>

198
src/views/modules/property/property-add-or-update.vue

@ -24,105 +24,105 @@
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
propertyName: '', propertyName: '',
propertyCode: '', propertyCode: '',
effectiveFlag: '1', effectiveFlag: '1',
revision: '', revision: '',
delFlag: '', delFlag: '',
createdBy: '', createdBy: '',
createdTime: '', createdTime: '',
updatedBy: '', updatedBy: '',
updatedTime: '' updatedTime: ''
} }
}
},
computed: {
dataRule() {
return {
propertyName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyCode: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
effectiveFlag: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
revision: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
delFlag: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
createdBy: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
createdTime: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
updatedBy: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
updatedTime: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
]
}
}
},
methods: {
init() {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo() {
this.$http.get(`/property/property/${this.dataForm.id}`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {
})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/property/', this.dataForm).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, {'leading': true, 'trailing': false})
}
} }
},
computed: {
dataRule () {
return {
propertyName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
effectiveFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
revision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
delFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/property/property/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {
})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/property/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script> </script>

264
src/views/modules/property/propertyproject-add-or-update.vue

@ -45,138 +45,138 @@
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
loading: true, loading: true,
dataForm: { dataForm: {
id: '', id: '',
gridId: '', gridId: '',
grid: '', grid: '',
projectName: '', projectName: '',
propertyId: '', propertyId: '',
propertyName: '', propertyName: '',
propertyTel: '', propertyTel: '',
propertyManager: '', propertyManager: '',
propertyAddress: '' propertyAddress: ''
}, },
options: [], options: [],
propertyList: [] propertyList: []
}
},
computed: {
dataRule() {
return {
projectName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyTel: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyManager: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyAddress: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
]
}
}
},
methods: {
init() {
//
this.getByLoginUser();
this.getPropertyList();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getPropertyList() {
this.$http.get(`/property/property/dict`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.propertyList = res.data
}).catch(() => {
})
},
//
getByLoginUser() {
this.$http
.get(`/sys/user/deptOptions/getBusinessDeptByUser`)
.then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.loading = false
this.options = res.data.options
})
.catch(() => {
this.loading = false
})
},
deptHandleChange(value) {
this.dataForm.gridId = value.slice(-1).shift();
},
propertyHandleChange(value) {
console.log(value)
let obj = this.propertyList.find((item) => {
return item.dictValue === value;
});
console.log(obj.dictName)
this.dataForm.propertyName = obj.dictName;
},
//
getInfo() {
this.$http.get(`/property/project/${this.dataForm.id}`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.dataForm.allDeptIds = res.data.allDeptIds.split(',').slice(1)
this.loading = false
}).catch(() => {
this.loading = false
})
},
//
dataFormSubmitHandle: debounce(function () {
this.dataForm.allDeptNames = this.$refs['grid'].inputValue;
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/project/', this.dataForm).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, {'leading': true, 'trailing': false})
}
} }
},
computed: {
dataRule () {
return {
projectName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyTel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyManager: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
//
this.getByLoginUser()
this.getPropertyList()
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getPropertyList () {
this.$http.get(`/property/property/dict`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.propertyList = res.data
}).catch(() => {
})
},
//
getByLoginUser () {
this.$http
.get(`/sys/user/deptOptions/getBusinessDeptByUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.loading = false
this.options = res.data.options
})
.catch(() => {
this.loading = false
})
},
deptHandleChange (value) {
this.dataForm.gridId = value.slice(-1).shift()
},
propertyHandleChange (value) {
console.log(value)
let obj = this.propertyList.find((item) => {
return item.dictValue === value
})
console.log(obj.dictName)
this.dataForm.propertyName = obj.dictName
},
//
getInfo () {
this.$http.get(`/property/project/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.dataForm.allDeptIds = res.data.allDeptIds.split(',').slice(1)
this.loading = false
}).catch(() => {
this.loading = false
})
},
//
dataFormSubmitHandle: debounce(function () {
this.dataForm.allDeptNames = this.$refs['grid'].inputValue
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/project/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script> </script>

Loading…
Cancel
Save