湖南公安
This commit is contained in:
@@ -20,6 +20,7 @@ export default {
|
||||
value: {default: ""},
|
||||
type: {default: "resident"},
|
||||
nodeKey: {default: "idNumber"},
|
||||
isRequire: {default: 1},
|
||||
selected: {default: () => []},
|
||||
placeholder: {default: "选择人员"},
|
||||
ops: {default: () => ({})},
|
||||
@@ -48,7 +49,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleJump() {
|
||||
let {config, nodeKey, valueObj} = this,
|
||||
let {config, nodeKey, valueObj, isRequire} = this,
|
||||
selected = (valueObj ? this.value[nodeKey] : this.value) || this.selected?.map(e => e[nodeKey])
|
||||
uni.$once('pagePicker:' + this.type, data => {
|
||||
console.log('发送', data)
|
||||
@@ -58,7 +59,7 @@ export default {
|
||||
})
|
||||
let url = `${config.url}`,
|
||||
qsstr = qs.stringify({
|
||||
selected, nodeKey, ...this.$attrs
|
||||
selected, nodeKey, isRequire, ...this.$attrs
|
||||
})
|
||||
if (!!qsstr) {
|
||||
url += `?${qsstr}`
|
||||
|
||||
@@ -48,6 +48,9 @@ export default {
|
||||
},
|
||||
nodeKey() {
|
||||
return this.$route.query.nodeKey || "idNumber"
|
||||
},
|
||||
isRequire() {
|
||||
return this.$route.query.isRequire || 1
|
||||
}
|
||||
},
|
||||
onLoad(query) {
|
||||
@@ -86,13 +89,16 @@ export default {
|
||||
checkList.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
if (!checkList.length && this.isRequire == 1) {
|
||||
return this.$u.toast('请先选择部门')
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
success: () => {
|
||||
uni.$emit("pagePicker:dept", checkList)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -51,7 +51,10 @@ export default {
|
||||
},
|
||||
nodeKey() {
|
||||
return this.$route.query.nodeKey || "idNumber"
|
||||
}
|
||||
},
|
||||
isRequire() {
|
||||
return this.$route.query.isRequire || 1
|
||||
},
|
||||
},
|
||||
onLoad(query) {
|
||||
if (query.selected) {
|
||||
@@ -92,7 +95,7 @@ export default {
|
||||
checkList.push(item)
|
||||
}
|
||||
})
|
||||
if (!checkList.length) {
|
||||
if (!checkList.length && this.isRequire == 1) {
|
||||
return this.$u.toast('请先选择人员')
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
|
||||
@@ -48,15 +48,15 @@
|
||||
<div class="type-content">
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">图片</p>
|
||||
<AiUploader type="image" :def.sync="formData.fileListImg" :limit="1" @data="(v) => fileDataImg = v"></AiUploader>
|
||||
<AiUploader type="image" :limit="9" multiple :def.sync="fileListImg" @data="changeImg"></AiUploader>
|
||||
</div>
|
||||
<div class="flex" >
|
||||
<p class="label" style="width:40px;">视频</p>
|
||||
<AiUploader type="video" :limit="1" placeholder="上传视频" :def.sync="formData.fileListVideo" @data="(v) => fileDataVideo = v"></AiUploader>
|
||||
<AiUploader type="video" :limit="9" multiple placeholder="上传视频" :def.sync="fileListVideo" @data="changeVideo"></AiUploader>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<p class="label" style="width:40px;">附件</p>
|
||||
<AiUploader type="file" :limit="1" placeholder="上传附件" :def.sync="formData.fileListFile" @data="(v) => fileDataFile = v"></AiUploader>
|
||||
<AiUploader type="file" :limit="9" multiple placeholder="上传附件" :def.sync="fileListFile" @data="changeFile"></AiUploader>
|
||||
</div>
|
||||
<div v-if="form.contentType == 'link'">
|
||||
<div class="flex border-b">
|
||||
@@ -139,23 +139,14 @@ export default {
|
||||
],
|
||||
form: {
|
||||
content: '',
|
||||
contentType: 'text',
|
||||
sendType: '0',
|
||||
sendTime: ''
|
||||
},
|
||||
formData: {
|
||||
formData: {},
|
||||
fileList: [],
|
||||
fileListImg: [],
|
||||
fileListVideo: [],
|
||||
fileListFile: [],
|
||||
fileList: [],
|
||||
imgList: [],
|
||||
accessImgurl: '',
|
||||
accessTitle: '',
|
||||
accessUrl: '',
|
||||
accessAppid: '',
|
||||
file: {},
|
||||
mediaId: ''
|
||||
},
|
||||
areaIdList: [],
|
||||
tagIdList: [],
|
||||
deptList: [],
|
||||
@@ -169,17 +160,39 @@ export default {
|
||||
minute: true,
|
||||
second: true
|
||||
},
|
||||
fileDataImg: null,
|
||||
fileDataVideo: null,
|
||||
fileDataFile: null
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
methods: {
|
||||
radioChange(e) {
|
||||
// this.$nextTick(() => {
|
||||
// this.form.contentType = e
|
||||
// })
|
||||
changeImg(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListImg.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'image'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeVideo(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListVideo.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'video'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeFile(e) {
|
||||
this.$nextTick(() => {
|
||||
this.fileListFile.map((item) => {
|
||||
if(item.id == e.file.id) {
|
||||
item.mediaId = e.media.mediaId
|
||||
item.contentType = 'file'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
toSelect() {
|
||||
uni.navigateTo({url: `./chooseUser?tagIdList=${this.tagIdList}&areaList=${this.areaIdList}&deptList=${this.deptList}&userList=${this.userList}`})
|
||||
@@ -195,9 +208,6 @@ export default {
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
// if(!this.areaIdList.length) {
|
||||
// return this.$u.toast('请选择用户')
|
||||
// }
|
||||
this.$loading()
|
||||
if(this.form.sendType == 1 && !this.form.sendTime) {
|
||||
return this.$u.toast('请选择群发时间')
|
||||
@@ -205,57 +215,20 @@ export default {
|
||||
if(!this.form.content) {
|
||||
return this.$u.toast('请输入文本内容')
|
||||
}
|
||||
if(this.form.contentType == 'image' && !this.formData.fileList.length) {
|
||||
return this.$u.toast('请上传图片')
|
||||
}
|
||||
if(this.form.contentType == 'video' && !this.formData.fileList.length) {
|
||||
return this.$u.toast('请上传视频')
|
||||
}
|
||||
if(this.form.contentType == 'file' && !this.formData.fileList.length) {
|
||||
return this.$u.toast('请上传文件')
|
||||
}
|
||||
this.formData.fileList = []
|
||||
this.fileList = []
|
||||
var contentFile = {
|
||||
content: this.form.content,
|
||||
contentType: 'text'
|
||||
}
|
||||
// if(this.formData.fileList.length) {
|
||||
// this.formData.file = this.formData.fileList[0]
|
||||
// this.formData.accessUrl = this.formData.fileList[0].url
|
||||
// this.formData.mediaId = this.fileData.media.mediaId
|
||||
// }
|
||||
this.formData.fileList.push(contentFile)
|
||||
if(this.formData.fileListImg.length) {
|
||||
var info = {
|
||||
contentType: 'image',
|
||||
mediaId: this.fileDataImg.media.mediaId,
|
||||
accessUrl: this.formData.fileListImg[0].url
|
||||
}
|
||||
this.formData.fileList.push(info)
|
||||
}
|
||||
if(this.formData.fileListVideo.length) {
|
||||
var info = {
|
||||
contentType: 'video',
|
||||
mediaId: this.fileDataVideo.media.mediaId,
|
||||
accessUrl: this.formData.fileListVideo[0].url
|
||||
}
|
||||
this.formData.fileList.push(info)
|
||||
}
|
||||
if(this.formData.fileListFile.length) {
|
||||
var info = {
|
||||
contentType: 'file',
|
||||
mediaId: this.fileDataFile.media.mediaId,
|
||||
accessUrl: this.formData.fileListFile[0].url
|
||||
}
|
||||
this.formData.fileList.push(info)
|
||||
}
|
||||
this.fileList = [...this.fileListImg, ...this.fileListVideo, ...this.fileListFile]
|
||||
this.fileList.unshift(contentFile)
|
||||
var params = {
|
||||
...this.form,
|
||||
...this.formData,
|
||||
areaId: this.areaIdList.join(','),
|
||||
tag: this.tagIdList.join(','),
|
||||
deptList: this.deptList,
|
||||
userList: this.userList
|
||||
userList: this.userList,
|
||||
fileList: this.fileList
|
||||
}
|
||||
this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => {
|
||||
if (res?.code == 0) {
|
||||
@@ -277,13 +250,13 @@ export default {
|
||||
})
|
||||
},
|
||||
formDataInit() {
|
||||
for(let key in this.formData) {
|
||||
this.formData[key] = ''
|
||||
for(let key in this.form) {
|
||||
this.form[key] = ''
|
||||
}
|
||||
this.formData.sendType = '0'
|
||||
this.formData.fileListImg = []
|
||||
this.formData.fileListVideo = []
|
||||
this.formData.fileListFile = []
|
||||
this.form.sendType = '0'
|
||||
this.fileListImg = []
|
||||
this.fileListVideo = []
|
||||
this.fileListFile = []
|
||||
this.areaIdList = []
|
||||
this.tagIdList = []
|
||||
this.deptList = []
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="area-flex">
|
||||
<p class="title">部门</p>
|
||||
<div class="value">
|
||||
<AiPagePicker type="dept" :selected.sync="deptList" nodeKey="id">
|
||||
<AiPagePicker type="dept" :selected.sync="deptList" nodeKey="id" :isRequire="0">
|
||||
<AiMore v-model="moreTextDept" />
|
||||
</AiPagePicker>
|
||||
</div>
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="area-flex">
|
||||
<p class="title">人员</p>
|
||||
<div class="value">
|
||||
<AiPagePicker type="sysUser" :selected.sync="userList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id">
|
||||
<AiPagePicker type="sysUser" :selected.sync="userList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id" :isRequire="0">
|
||||
<AiMore v-model="moreText" />
|
||||
</AiPagePicker>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user