duy 1 هفته پیش
والد
کامیت
ca82adccfd
1فایلهای تغییر یافته به همراه16 افزوده شده و 3 حذف شده
  1. 16 3
      src/views/tasks/components/hc-tasks-user/index.vue

+ 16 - 3
src/views/tasks/components/hc-tasks-user/index.vue

@@ -8,7 +8,7 @@
             <div v-if="fixedData.length <= 0" class="tasks-placeholder">点击这里选择任务</div>
         </div>
         <!-- 选择任务人 -->
-        <HcUserModal v-model="isUserModalShow" :data="fixedData" :datas="dataInfo" @finish="fixedUserFinish" />
+        <HcUserModal v-model="isUserModalShow" :data="fixedData" :datas="dataInfo" :is-view="isView" @finish="fixedUserFinish" @close="closeUserModal" />
     </div>
 </template>
 
@@ -31,17 +31,24 @@ const props = defineProps({
         type: Object,
         default: () => ({}),
     },
+    isView:{
+        type: Boolean,
+        default: false,
+    },
 })
 
 //事件
-const emit = defineEmits(['change'])
+const emit = defineEmits(['change,close'])
 
 //监听基础数据
 const dataInfo = ref(props.datas)
 watch(() => props.datas, (data) => {
     dataInfo.value = getObjValue(data)
 }, { deep: true, immediate: true })
-
+const isView = ref(props.isView)
+watch(() => props.isView, (data) => {
+    isView.value = data
+}, { deep: true, immediate: true })
 //监听用户数据
 const fixedData = ref(props.data)
 watch(() => props.data, (data) => {
@@ -70,6 +77,12 @@ const fixedUserFinish = (data) => {
     }
     emit('change', arr)
 }
+const closeUserModal = ()=>{
+    emit('close')
+}
+defineExpose({
+    userShowModal,
+})
 </script>
 
 <style lang="scss">