yuhan 1 éve%!(EXTRA string=óta)
szülő
commit
d07881497f

+ 1 - 1
src/views/module_kzks/projectPushSet/ProjectPushSetList.vue

@@ -161,7 +161,7 @@
           {
             title:'推送角色',
             align:"center",
-            dataIndex: 'pushTo'
+            dataIndex: 'pushTo_dictText'
           },
           {
             title:'备注',

+ 18 - 24
src/views/module_kzks/projectPushSet/modules/ProjectPushSetForm.vue

@@ -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;
         // 触发表单验证

+ 20 - 3
src/views/module_kzks/projectPushSet/modules/ProjectPushSetModal.vue

@@ -8,12 +8,12 @@
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="关闭">
-    <project-push-set-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></project-push-set-form>
+    <project-push-set-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :rolesOptions="rolesOptions"></project-push-set-form>
   </j-modal>
 </template>
 
 <script>
-
+import {queryall} from '@/api/api'
   import ProjectPushSetForm from './ProjectPushSetForm'
   export default {
     name: 'ProjectPushSetModal',
@@ -25,10 +25,27 @@
         title:'',
         width:800,
         visible: false,
-        disableSubmit: false
+        disableSubmit: false,
+        // 角色列表
+        rolesOptions: []
       }
     },
+    created(){
+      this.initRoleList()
+    },
     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.visible=true
         this.$nextTick(()=>{