In-sensor computing with visual information, which can integrate photosensing, data storage, and computation functions within the same physical element, has promised a fundamentally different architecture for future machine vision technology with extreme energy and time efficiency. The elementary devices required to fulfil the goal of such a new sensory computation scheme would demand a bold functional variation to the existing sensor and data processing hardware. Here, a van der Waals (vdW) heterostructure-based optoelectronic transistor that can act as an integrated photoreceptor, memory, and computation unit by exploiting its own physical attributes is demonstrated. It is found that diverse photoelectric control of device conductance can lead to versatile photoresponse characteristics, including memristive behaviors, retention-, polarity-and strength-tunable photoconductance, photoelectric-coupling effect, etc. Exploiting the photoelectric-coupling effect, reconfigurable and nonvolatile optoelectronic logic functions are realized in this device, featuring a logic-insensor unit. With the same device, both short-and long-term synaptic plasticity can be faithfully emulated, rendering it an optoelectronic synaptic transistor. Moreover, a psychologic human memory model is implemented with the device, showing the emulation of memorization and learning processes. This prototypical demonstration provides a promising hardware system for visual information in-sensor computing capable of addressing complex computation tasks.