|
@@ -24,25 +24,32 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-form-model-item label="推送内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="content">
|
|
<a-form-model-item label="推送内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="content">
|
|
- <a-input v-model="model.content" placeholder="请输入推送内容" ></a-input>
|
|
|
|
|
|
+ <a-input v-model="model.content" placeholder="请输入推送内容"></a-input>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
- <a-form-model-item label="推送部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pushTo">
|
|
|
|
- <!-- <a-input v-model="model.pushTo" placeholder="请输入推送部门" ></a-input> -->
|
|
|
|
- <!-- <a-tree-select
|
|
|
|
|
|
+ <a-form-model-item label="推送角色" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pushTo">
|
|
|
|
+ <j-multi-select-tag
|
|
v-model="model.pushTo"
|
|
v-model="model.pushTo"
|
|
- style="width: 100%"
|
|
|
|
- allow-clear
|
|
|
|
- :tree-data="departTree"
|
|
|
|
- search-placeholder="请选择推送部门"
|
|
|
|
- /> -->
|
|
|
|
- <!-- show-search -->
|
|
|
|
- <!-- tree-checkable
|
|
|
|
- :show-checked-strategy="SHOW_PARENT" -->
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <j-select-depart v-model="model.pushTo" :multi="true" :backDepart="true" :treeOpera="true" @back="backDepartInfo"></j-select-depart>
|
|
|
|
|
|
+ :options="rolesOptions"
|
|
|
|
+ placeholder="请选择角色">
|
|
|
|
+ </j-multi-select-tag>
|
|
|
|
+ <!-- :value="arrayValue"
|
|
|
|
+ @change="onChange" -->
|
|
|
|
+ <!-- <a-select
|
|
|
|
+ v-model="model.pushTo"
|
|
|
|
+ mode="multiple"
|
|
|
|
+ placeholder="请选择角色"
|
|
|
|
+ allowClear>
|
|
|
|
+ <a-select-option
|
|
|
|
+ v-for="(item, index) in rolesOptions"
|
|
|
|
+ :key="index"
|
|
|
|
+ :value="item.value">
|
|
|
|
+ <span style="display: inline-block;width: 100%" :title="item.label ">
|
|
|
|
+ {{ item.label }}
|
|
|
|
+ </span>
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select> -->
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
@@ -60,7 +67,7 @@
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
- import {queryDepartTreeList} from '@/api/api'
|
|
|
|
|
|
+ import {queryall} from '@/api/api'
|
|
// 只显示父节点(当父节点下所有子节点都选中时)
|
|
// 只显示父节点(当父节点下所有子节点都选中时)
|
|
import { TreeSelect } from 'ant-design-vue';
|
|
import { TreeSelect } from 'ant-design-vue';
|
|
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
|
|
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
|
|
@@ -79,8 +86,8 @@
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- // 部门树列表
|
|
|
|
- departTree: [],
|
|
|
|
|
|
+ // 角色列表
|
|
|
|
+ rolesOptions:[],
|
|
// 只显示父节点(当父节点下所有子节点都选中时)
|
|
// 只显示父节点(当父节点下所有子节点都选中时)
|
|
SHOW_PARENT,
|
|
SHOW_PARENT,
|
|
model:{
|
|
model:{
|
|
@@ -105,7 +112,7 @@
|
|
{ required: true, message: '请输入推送内容!'},
|
|
{ required: true, message: '请输入推送内容!'},
|
|
],
|
|
],
|
|
pushTo: [
|
|
pushTo: [
|
|
- { required: true, message: '请输入推送部门!'},
|
|
|
|
|
|
+ { required: true, message: '请输入推送角色!'},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
url: {
|
|
url: {
|
|
@@ -121,34 +128,23 @@
|
|
},
|
|
},
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
- this.getDepartTree()
|
|
|
|
|
|
+ this.initRoleList()
|
|
//备份model原始值
|
|
//备份model原始值
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 获取部门树列表
|
|
|
|
- getDepartTree() {
|
|
|
|
- this.departTree = []
|
|
|
|
- queryDepartTreeList().then((res) => {
|
|
|
|
- console.log(res)
|
|
|
|
- if (res.success) {
|
|
|
|
- //部门全选后,再添加部门,选中数量增多
|
|
|
|
- for (let i = 0; i < res.result.length; i++) {
|
|
|
|
- let temp = res.result[i]
|
|
|
|
- this.departTree.push(temp)
|
|
|
|
- // console.log(temp.id)
|
|
|
|
- }
|
|
|
|
|
|
+ //初始化角色字典
|
|
|
|
+ initRoleList(){
|
|
|
|
+ queryall().then((res)=>{
|
|
|
|
+ if(res.success){
|
|
|
|
+ this.rolesOptions = res.result.map((item,index,arr)=>{
|
|
|
|
+ let c = {label:item.roleName, value:item.id}
|
|
|
|
+ return c;
|
|
|
|
+ })
|
|
|
|
+ console.log('this.rolesOptions: ',this.rolesOptions)
|
|
}
|
|
}
|
|
- })
|
|
|
|
- },
|
|
|
|
- backDepartInfo(info) {
|
|
|
|
- this.model.departIds = this.model.selecteddeparts;
|
|
|
|
- this.nextDepartOptions = info.map((item,index,arr)=>{
|
|
|
|
- let c = {label:item.text, value: item.value+""}
|
|
|
|
- return c;
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
-
|
|
|
|
add () {
|
|
add () {
|
|
this.edit(this.modelDefault);
|
|
this.edit(this.modelDefault);
|
|
},
|
|
},
|