|
@@ -29,26 +29,28 @@
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="推送角色" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pushTo">
|
|
|
- <j-multi-select-tag
|
|
|
+ <!-- <j-multi-select-tag
|
|
|
v-model="model.pushTo"
|
|
|
:options="rolesOptions"
|
|
|
placeholder="请选择角色">
|
|
|
- </j-multi-select-tag>
|
|
|
- <!-- :value="arrayValue"
|
|
|
- @change="onChange" -->
|
|
|
+ </j-multi-select-tag> -->
|
|
|
+ <j-multi-select-tag v-model="model.pushTo" placeholder="请选择角色" dictCode="sys_role,role_name,id"/>
|
|
|
<!-- <a-select
|
|
|
v-model="model.pushTo"
|
|
|
mode="multiple"
|
|
|
placeholder="请选择角色"
|
|
|
- allowClear>
|
|
|
+ allowClear
|
|
|
+ labelInValue
|
|
|
+ @change="onChange">
|
|
|
<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 style="display: inline-block;width: 100%" :title="item.label ">
|
|
|
{{ item.label }}
|
|
|
- </span>
|
|
|
- </a-select-option>
|
|
|
+ </span> -->
|
|
|
+ <!-- </a-select-option>
|
|
|
</a-select> -->
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
@@ -67,7 +69,7 @@
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
- import {queryall} from '@/api/api'
|
|
|
+
|
|
|
// 只显示父节点(当父节点下所有子节点都选中时)
|
|
|
import { TreeSelect } from 'ant-design-vue';
|
|
|
const SHOW_PARENT = TreeSelect.SHOW_PARENT;
|
|
@@ -77,6 +79,10 @@
|
|
|
components: {
|
|
|
},
|
|
|
props: {
|
|
|
+ rolesOptions: {
|
|
|
+ type: Array,
|
|
|
+ default: [],
|
|
|
+ },
|
|
|
//表单禁用
|
|
|
disabled: {
|
|
|
type: Boolean,
|
|
@@ -86,8 +92,6 @@
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- // 角色列表
|
|
|
- rolesOptions:[],
|
|
|
// 只显示父节点(当父节点下所有子节点都选中时)
|
|
|
SHOW_PARENT,
|
|
|
model:{
|
|
@@ -128,23 +132,10 @@
|
|
|
},
|
|
|
},
|
|
|
created () {
|
|
|
- this.initRoleList()
|
|
|
//备份model原始值
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
},
|
|
|
methods: {
|
|
|
- //初始化角色字典
|
|
|
- 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)
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
add () {
|
|
|
this.edit(this.modelDefault);
|
|
|
},
|
|
@@ -152,6 +143,9 @@
|
|
|
this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
|
},
|
|
|
+ onChange(value){
|
|
|
+ console.log(value)
|
|
|
+ },
|
|
|
submitForm () {
|
|
|
const that = this;
|
|
|
// 触发表单验证
|